-
Notifications
You must be signed in to change notification settings - Fork 710
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
Showing
10 changed files
with
1,409 additions
and
94 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,29 @@ | ||
import scopes from '@commitlint/config-pnpm-scopes' | ||
|
||
export default { | ||
extends: [ | ||
'@commitlint/config-conventional', | ||
'@commitlint/config-pnpm-scopes' | ||
], | ||
rules: { | ||
'body-max-line-length': [0], | ||
'scope-enum': async (ctx) => { | ||
const scopeEnum = await scopes.rules['scope-enum'](ctx) | ||
|
||
return [ | ||
scopeEnum[0], | ||
scopeEnum[1], | ||
[ | ||
...scopeEnum[2], | ||
'deps', | ||
'dev-deps' | ||
] | ||
] | ||
} | ||
}, | ||
prompt: { | ||
settings: { | ||
enableMultipleScopes: true | ||
} | ||
} | ||
} |
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 @@ | ||
{ | ||
"path": "@commitlint/cz-commitlint" | ||
} |
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,9 @@ | ||
{ | ||
"extends": [ | ||
"config:base", | ||
":preserveSemverRanges" | ||
], | ||
"constraints": { | ||
"pnpm": "^8.7.5" | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
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,25 @@ | ||
name: Commit | ||
on: | ||
push: | ||
jobs: | ||
commitlint: | ||
runs-on: ubuntu-latest | ||
name: commitlint | ||
steps: | ||
- name: Checkout the repository | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- name: Install pnpm | ||
uses: pnpm/action-setup@v2 | ||
with: | ||
version: 8 | ||
- name: Install Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 18 | ||
cache: 'pnpm' | ||
- name: Install dependencies | ||
run: pnpm install | ||
- name: Run commitlint | ||
run: pnpm commitlint --from=HEAD~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,116 @@ | ||
name: Tests | ||
on: | ||
workflow_dispatch: | ||
pull_request: | ||
push: | ||
branches: | ||
- master | ||
jobs: | ||
types: | ||
runs-on: ubuntu-latest | ||
name: types | ||
steps: | ||
- name: Checkout the repository | ||
uses: actions/checkout@v4 | ||
- name: Install pnpm | ||
uses: pnpm/action-setup@v2 | ||
with: | ||
version: 8 | ||
- name: Install Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 18 | ||
cache: 'pnpm' | ||
- name: Install dependencies | ||
run: pnpm install | ||
- name: Check types | ||
run: pnpm test:types | ||
lint: | ||
runs-on: ubuntu-latest | ||
name: lint | ||
steps: | ||
- name: Checkout the repository | ||
uses: actions/checkout@v4 | ||
- name: Install pnpm | ||
uses: pnpm/action-setup@v2 | ||
with: | ||
version: 8 | ||
- name: Install Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 18 | ||
cache: 'pnpm' | ||
- name: Install dependencies | ||
run: pnpm install | ||
- name: Lint files | ||
run: pnpm lint | ||
unit: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
node-version: | ||
- 18 | ||
- 20 | ||
name: Node.js ${{ matrix.node-version }} / unit | ||
steps: | ||
- name: Checkout the repository | ||
uses: actions/checkout@v4 | ||
- name: Install pnpm | ||
uses: pnpm/action-setup@v2 | ||
with: | ||
version: 8 | ||
- name: Install Node.js ${{ matrix.node-version }} | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
cache: 'pnpm' | ||
- name: Install dependencies | ||
run: pnpm install | ||
- run: git config --global user.name 'CI' | ||
- run: git config --global user.email 'dummy@example.org' | ||
- name: Run tests | ||
run: pnpm test | ||
- name: Collect coverage | ||
uses: coverallsapp/github-action@main | ||
with: | ||
flag-name: actions ${{ matrix.node-version }} | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
parallel: true | ||
fail-on-error: false | ||
unit-windows: | ||
runs-on: windows-latest | ||
name: Windows / unit | ||
steps: | ||
- name: Checkout the repository | ||
uses: actions/checkout@v4 | ||
- name: Install pnpm | ||
uses: pnpm/action-setup@v2 | ||
with: | ||
version: 8 | ||
- name: Install Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 18 | ||
cache: 'pnpm' | ||
- name: Install dependencies | ||
run: pnpm install | ||
- run: git config --global user.name 'CI' | ||
- run: git config --global user.email 'dummy@example.org' | ||
- name: Run tests | ||
run: pnpm test -- --test-timeout=60000 | ||
- name: Collect coverage | ||
uses: coverallsapp/github-action@main | ||
with: | ||
flag-name: actions windows | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
parallel: true | ||
fail-on-error: false | ||
finish: | ||
needs: [unit, unit-windows] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Upload collected coverage | ||
uses: coverallsapp/github-action@main | ||
with: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
parallel-finished: true |
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 @@ | ||
{ | ||
"*.{js,cjs,ts}": "eslint --fix" | ||
} |
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 @@ | ||
{ | ||
"commit-msg": "pnpm commitlint --edit \"$1\"", | ||
"pre-commit": "pnpm nano-staged" | ||
} |
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
Oops, something went wrong.