Add typecheck CI job and package script

Introduce a `typecheck` job to GitHub Actions that sets up pnpm and Node.js (v22), installs dependencies, and runs `pnpm typecheck` on the workspace. Make the `build` job depend on `typecheck`. Also add a `typecheck` script (`tsc --noEmit`) to packages/websocket/package.json to enable package-level type checking. This ensures TypeScript errors are caught before the build runs.
This commit is contained in:
手瓜一十雪 committed 2026-05-06 10:23:45 +08:00
1 parent e67e0ea497
commit 60189d9c1d
2 files changed
+33 -1

No files matched your search

+30 -1
View File
@@ -38,8 +38,37 @@ jobs:
page++;
}
typecheck:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 10.28.0
run_install: false
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '22'
cache: 'pnpm'
- name: Install dependencies
run: pnpm install --frozen-lockfile
# Runs `tsc --noEmit` (or `tsc -b`) in every workspace package that
# exposes a `typecheck` script. Platform-independent, so a single
# ubuntu runner is sufficient.
- name: Type check all packages
run: pnpm typecheck
build:
needs: cleanup
needs: [cleanup, typecheck]
permissions:
contents: read
strategy: