From 60189d9c1d6a9554873a5f387073989515355027 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=89=8B=E7=93=9C=E4=B8=80=E5=8D=81=E9=9B=AA?= Date: Wed, 6 May 2026 10:23:45 +0800 Subject: [PATCH] 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. --- .github/workflows/dev-build.yml | 31 ++++++++++++++++++++++++++++++- packages/websocket/package.json | 3 +++ 2 files changed, 33 insertions(+), 1 deletion(-) diff --git a/.github/workflows/dev-build.yml b/.github/workflows/dev-build.yml index 0ad48487..a3a42470 100644 --- a/.github/workflows/dev-build.yml +++ b/.github/workflows/dev-build.yml @@ -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: diff --git a/packages/websocket/package.json b/packages/websocket/package.json index 51f71379..accdc245 100644 --- a/packages/websocket/package.json +++ b/packages/websocket/package.json @@ -12,6 +12,9 @@ } }, "description": "SnowLuma in-tree WebSocket implementation. Loads packages/runtime/native/websocket--.node via process.dlopen().", + "scripts": { + "typecheck": "tsc --noEmit" + }, "devDependencies": { "@types/node": "^24.12.2", "typescript": "catalog:"