Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
fuxingloh committed Mar 11, 2024
1 parent 8df7d4c commit 3ee8adc
Show file tree
Hide file tree
Showing 40 changed files with 5,310 additions and 1 deletion.
11 changes: 11 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
.github
.husky
.idea
**/.turbo
**/.DS_Store
**/node_modules

# tsconfig.json
packages/*/**/*.d.ts
packages/*/**/*.d.ts.map
packages/*/**/*.js
5 changes: 5 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Define individuals that are responsible for code in a repository.
# More details are here: https://help.github.com/articles/about-codeowners/

/.github/ @fuxingloh
/pnpm-lock.yaml @fuxingloh
3 changes: 3 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#### What this PR does / why we need it:

#### Which issue(s) will this PR fix?:
46 changes: 46 additions & 0 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
version: v1

labels:
- label: kind/feature
sync: true
matcher:
title: "^feat\\(.+\\)?: .+"

- label: kind/fix
sync: true
matcher:
title: "^fix\\(.+\\)?: .+"

- label: kind/chore
sync: true
matcher:
title: "^chore\\(.+\\)?: .+"

- label: kind/refactor
sync: true
matcher:
title: "^refactor\\(.+\\)?: .+"

- label: kind/docs
sync: true
matcher:
title: "^docs\\(.+\\)?: .+"

- label: kind/dependencies
sync: true
matcher:
title: "^bump(\\(.+\\))?: .+"

checks:
- context: 'Semantic Pull Request'
description:
success: Ready for review & merge.
failure: 'Missing semantic title or label for merge [kind(directory): title]'
labels:
any:
- kind/feature
- kind/fix
- kind/chore
- kind/refactor
- kind/docs
- kind/dependencies
27 changes: 27 additions & 0 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name-template: 'v$RESOLVED_VERSION'
tag-template: 'v$RESOLVED_VERSION'
categories:
- title: 'Features'
labels:
- 'kind/feature'
- title: 'Fixes'
labels:
- 'kind/fix'
- title: 'Chore & Maintenance'
labels:
- 'kind/refactor'
- 'kind/chore'
- 'kind/docs'
- title: 'Dependencies'
labels:
- 'kind/dependencies'
change-template: '- $TITLE @$AUTHOR (#$NUMBER)'
change-title-escapes: '\<*_&'
version-resolver:
minor:
labels:
- 'kind/feature'
default: patch
prerelease: false
template: |
$CHANGES
80 changes: 80 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
name: CI

on:
pull_request:
branches: [main]
merge_group:
branches: [main]

concurrency:
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.ref }}
cancel-in-progress: true

permissions:
contents: read
packages: read

jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0

- uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d # v3.8.1
with:
node-version-file: '.nvmrc'

- run: corepack enable pnpm

- run: pnpm install --frozen-lockfile

- run: pnpm turbo run build

test:
name: Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1

- uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d # v3.8.1
with:
node-version-file: '.nvmrc'

- run: corepack enable pnpm

- run: pnpm install --frozen-lockfile

- run: pnpm turbo run test

lint_prettier:
name: Lint [prettier]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0

- uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d # v3.8.1
with:
node-version-file: '.nvmrc'

- run: corepack enable pnpm

- run: pnpm install --frozen-lockfile

- run: pnpm prettier --check .

lint_eslint:
name: Lint [eslint]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0

- uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d # v3.8.1
with:
node-version-file: '.nvmrc'

- run: corepack enable pnpm

- run: pnpm install --frozen-lockfile

- run: pnpm turbo run lint
21 changes: 21 additions & 0 deletions .github/workflows/oss-governance-labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: OSS Governance Labeler

on:
pull_request_target:
types: [opened, edited, synchronize]

permissions:
contents: read
issues: write
pull-requests: write
statuses: write
checks: write

jobs:
main:
name: Labeler
runs-on: ubuntu-latest
steps:
- uses: fuxingloh/multi-labeler@b15a54460c38f54043fa75f7b08a0e2aa5b94b5b # v4.0.0
with:
config-path: .github/labeler.yml
22 changes: 22 additions & 0 deletions .github/workflows/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Release Drafter

on:
push:
branches: [main]

permissions:
contents: write
pull-requests: read

concurrency:
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.ref }}
cancel-in-progress: true

jobs:
main:
name: Draft Release
runs-on: ubuntu-latest
steps:
- uses: release-drafter/release-drafter@65c5fb495d1e69aa8c08a3317bc44ff8aabe9772 # v5.24.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
56 changes: 56 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Release

on:
release:
types: [published]

permissions:
contents: read

jobs:
version:
runs-on: ubuntu-latest
outputs:
result: ${{ steps.version.outputs.result }}
steps:
- id: version
uses: actions/github-script@d7906e4ad0b1822421a7e6a35d5ca353c962f410 # v6.4.1
with:
script: |
const tag = "${{ github.event.release.tag_name }}";
const semver = tag.replace('v', '');
if (semver.match(/^[0-9]+\.[0-9]+\.[0-9]+$/)) {
return semver
}
throw new Error('not semver, ref: ${context.ref}')
result-encoding: string

npm:
name: Release NPM
runs-on: ubuntu-latest
needs: version
environment: NPM Packages
steps:
- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0

- uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d # v3.8.1
with:
node-version-file: '.nvmrc'

- run: corepack enable pnpm

- run: pnpm install --frozen-lockfile

- run: pnpm -r exec pnpm version ${{ needs.Version.outputs.result }} --git-tag-version=false

- run: pnpm turbo run build

- run: npm config set "//registry.npmjs.org/:_authToken" "\${NPM_PACKAGES_TOKEN}" --location=global

- run: pnpm -r publish --access public --tag latest --no-git-checks
env:
NPM_PACKAGES_TOKEN: ${{ secrets.NPM_PACKAGES_TOKEN }}
NPM_CONFIG_PROVENANCE: true

- run: npm config delete "//registry.npmjs.org/:_authToken" --location=global
if: always()
21 changes: 21 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# MacOS
.DS_Store

# NodeJS
node_modules
dist
build
*.tgz
coverage
.nyc_output

# turborepo
.turbo

# contented
.contented

# tsconfig.json
packages/*/**/*.d.ts
packages/*/**/*.d.ts.map
packages/*/**/*.js
1 change: 1 addition & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
npx lint-staged
10 changes: 10 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

77 changes: 77 additions & 0 deletions .idea/codeStyles/Project.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 3ee8adc

Please sign in to comment.