Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ jobs:

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- uses: pnpm/action-setup@v4

Expand All @@ -25,11 +27,20 @@ jobs:
- name: Check types
run: pnpm check:types

- name: Check deps
run: pnpm check:deps

- name: Resolve changed files
run: |
set -eo pipefail # fail fast: exit on error (-e) and propagate pipe failures (-o pipefail)
echo "CHANGED=$(git diff --name-only origin/${{ github.base_ref }}...HEAD | tr '\n' ' ')" >> $GITHUB_ENV

- name: Lint and Format
run: pnpm format:lint
run: pnpm format:lint $CHANGED

- name: Test
run: pnpm test
# run: pnpm test:related $CHANGED // rstest don't understand the deps graph
run: pnpm test:coverage

- name: Build
run: pnpm build
3 changes: 3 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ jobs:
- name: Check types
run: pnpm check:types

- name: Check deps
run: pnpm check:deps

- name: Lint and Format
run: pnpm format:lint

Expand Down
8 changes: 8 additions & 0 deletions knip.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"$schema": "https://unpkg.com/knip@5/schema.json",
"entry": ["src/**/index.ts"],
"project": ["src/**/*.ts"],
"ignoreBinaries": ["only-allow"],
"ignoreDependencies": ["@rstest/coverage-istanbul"],
"ignoreExportsUsedInFile": true
}
8 changes: 5 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,11 @@
],
"scripts": {
"build": "rslib build",
"check:deps": "knip",
"check:types": "tsc --noEmit",
"dev": "rslib build --watch",
"format": "biome format --write",
"format:lint": "biome check --diagnostic-level=error",
"format:lint": "biome check --diagnostic-level=error --no-errors-on-unmatched",
"preinstall": "npx only-allow pnpm",
"lint": "biome lint --write",
"prepare": "simple-git-hooks",
Expand All @@ -73,10 +74,10 @@
"lint-staged": {
"package.json": [
"sort-package-json",
"biome check --diagnostic-level=error --write --no-errors-on-unmatched"
"pnpm format:lint --write"
],
"*.{js,ts,mts,tsx,css,md,json}": [
"biome check --diagnostic-level=error --write --no-errors-on-unmatched"
"pnpm format:lint --write"
]
},
"devDependencies": {
Expand All @@ -89,6 +90,7 @@
"@rstest/coverage-istanbul": "^0.2.1",
"@types/node": "^24.10.13",
"happy-dom": "^20.7.0",
"knip": "^5.85.0",
"lint-staged": "^16.3.0",
"simple-git-hooks": "^2.13.1",
"sort-package-json": "^3.6.1",
Expand Down
Loading