-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
geekact
committed
Jul 9, 2024
0 parents
commit d0a7fd9
Showing
22 changed files
with
7,206 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
extends: | ||
- '@commitlint/config-conventional' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
name: Lint | ||
|
||
on: [push] | ||
|
||
jobs: | ||
git-commit: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- uses: pnpm/action-setup@v4 | ||
- uses: actions/setup-node@v4 | ||
with: | ||
cache: 'pnpm' | ||
node-version-file: 'package.json' | ||
- run: pnpm install | ||
- if: github.event_name == 'pull_request' | ||
run: pnpm exec commitlint --from ${{ github.event.pull_request.base.sha }} --to ${{ github.event.pull_request.head.sha }} --verbose | ||
- if: github.event_name == 'push' | ||
run: echo "${{ github.event.head_commit.message }}" | pnpm exec commitlint --verbose | ||
type-checking: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
ts: [5.4.x, 5.5.x] | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: pnpm/action-setup@v4 | ||
- uses: actions/setup-node@v4 | ||
with: | ||
cache: 'pnpm' | ||
node-version-file: 'package.json' | ||
- name: Use Typescript@${{ matrix.ts }} & @types/node@${{ matrix.node-dts }} | ||
run: | | ||
pnpm install | ||
pnpm install typescript@${{ matrix.ts }} -w | ||
- run: pnpm exec tsc | ||
code-format: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: pnpm/action-setup@v4 | ||
- uses: actions/setup-node@v4 | ||
with: | ||
cache: 'pnpm' | ||
node-version-file: 'package.json' | ||
- run: pnpm install | ||
- run: pnpm exec prettier --cache --check . | ||
bundle: | ||
needs: [git-commit, type-checking, code-format] | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [ubuntu-latest, macos-latest, windows-latest] | ||
node: [18, 20, 22] | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: pnpm/action-setup@v4 | ||
- uses: actions/setup-node@v4 | ||
with: | ||
cache: 'pnpm' | ||
node-version-file: ${{ matrix.node }} | ||
- run: pnpm install | ||
- run: pnpm build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
name: Release | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
env: | ||
CI: true | ||
|
||
jobs: | ||
publish: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
# This makes Actions fetch all Git history so that Changesets can generate changelogs with the correct commits | ||
fetch-depth: 0 | ||
- name: git config | ||
run: | | ||
git config user.name "${GITHUB_ACTOR}" | ||
git config user.email "${GITHUB_ACTOR}@users.noreply.github.com" | ||
- uses: pnpm/action-setup@v4 | ||
- uses: actions/setup-node@v4 | ||
with: | ||
cache: 'pnpm' | ||
node-version-file: 'package.json' | ||
- run: pnpm install | ||
- run: npx lerna version --force-publish --yes | ||
env: | ||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
- run: | | ||
npm config set //registry.npmjs.org/:_authToken ${{ secrets.NPM_TOKEN }} | ||
pnpm --recursive publish |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
name: Test | ||
|
||
on: [push] | ||
|
||
jobs: | ||
test: | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [ubuntu-latest, macos-latest, windows-latest] | ||
node: [18, 20, 22] | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: pnpm/action-setup@v4 | ||
- uses: actions/setup-node@v4 | ||
with: | ||
cache: 'pnpm' | ||
node-version: ${{ matrix.node }} | ||
- run: pnpm install | ||
- run: pnpm test | ||
- if: github.ref == 'refs/heads/main' && strategy.job-index == 0 | ||
uses: codecov/codecov-action@v4 | ||
with: | ||
verbose: true | ||
fail_ci_if_error: true | ||
token: ${{ secrets.CODECOV_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
node_modules/ | ||
.idea/ | ||
TODO | ||
dist/ | ||
.npmrc | ||
coverage/ | ||
.DS_Store | ||
*.log | ||
.tsbuildinfo | ||
.nx/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/usr/bin/env sh | ||
|
||
npx --no-install commitlint --edit $1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/usr/bin/env sh | ||
|
||
npx --no-install prettier --cache --check . | ||
npx --no-install tsc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
dist/ | ||
pnpm-lock.yaml | ||
CHANGELOG.md | ||
coverage/ | ||
openapi.json | ||
/.nx/workspace-data |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
semi: true | ||
singleQuote: true | ||
# Change when properties in objects are quoted. | ||
# If at least one property in an object requires quotes, quote all properties. | ||
quoteProps: consistent | ||
tabWidth: 2 | ||
printWidth: 90 | ||
endOfLine: lf | ||
trailingComma: all | ||
bracketSpacing: true | ||
# Include parentheses around a sole arrow function parameter. | ||
arrowParens: always | ||
proseWrap: preserve | ||
jsxSingleQuote: false | ||
# Put > on the last line instead of at a new line. | ||
bracketSameLine: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"recommendations": ["esbenp.prettier-vscode"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{ | ||
"editor.formatOnSave": true, | ||
"editor.defaultFormatter": "esbenp.prettier-vscode", | ||
"[prisma]": { | ||
"editor.defaultFormatter": "Prisma.prisma" | ||
}, | ||
"editor.tabSize": 2, | ||
"editor.inlayHints.fontSize": 9, | ||
"typescript.inlayHints.parameterNames.enabled": "all", | ||
"typescript.inlayHints.enumMemberValues.enabled": true, | ||
"typescript.inlayHints.functionLikeReturnTypes.enabled": true, | ||
"typescript.tsdk": "node_modules/typescript/lib", | ||
"typescript.preferences.quoteStyle": "single", | ||
"typescript.suggest.autoImports": true, | ||
"cSpell.words": ["openapi"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2024 geekact | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{ | ||
"$schema": "node_modules/lerna/schemas/lerna-schema.json", | ||
"version": "1.6.0", | ||
"npmClient": "pnpm", | ||
"command": { | ||
"version": { | ||
"allowBranch": "main", | ||
"conventionalCommits": true, | ||
"message": "chore(release): 发布版本%s", | ||
"createRelease": "github", | ||
"private": false, | ||
"exact": false | ||
} | ||
}, | ||
"access": "public" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
{ | ||
"name": "aomex", | ||
"private": true, | ||
"repository": "git@github.com:aomex/aomex.git", | ||
"homepage": "https://aomex.js.org", | ||
"author": "geekact <fanwenhua1990@gmail.com>", | ||
"license": "MIT", | ||
"type": "module", | ||
"scripts": { | ||
"test": "vitest", | ||
"build": "pnpm --recursive --workspace-concurrency 1 prepublishOnly", | ||
"preinstall": "only-allow pnpm", | ||
"prepare": "husky", | ||
"deploy:main": "sh scripts/develop-deploy-main.sh", | ||
"sync:main": "sh scripts/develop-sync-main.sh" | ||
}, | ||
"volta": { | ||
"node": "20.13.0", | ||
"pnpm": "9.5.0" | ||
}, | ||
"packageManager": "pnpm@9.5.0", | ||
"engines": { | ||
"node": ">=18" | ||
}, | ||
"dependencies": { | ||
"@commitlint/cli": "^19.3.0", | ||
"@commitlint/config-conventional": "^19.2.2", | ||
"@types/node": "^18", | ||
"@vitest/coverage-v8": "^1.5.2", | ||
"husky": "^9.0.11", | ||
"lerna": "^8.1.5", | ||
"only-allow": "^1.2.1", | ||
"prettier": "^3.2.5", | ||
"ts-expect": "^1.3.0", | ||
"tsup": "^8.0.2", | ||
"tsx": "^4.15.6", | ||
"typescript": "^5.5.3", | ||
"vitest": "^1.5.2" | ||
} | ||
} |
Oops, something went wrong.