feat(ci): run JS tests in CI, add npm run check in ws root

This commit is contained in:
ethernet 2026-07-03 19:28:13 -04:00
parent c44de99854
commit 7b3f3047ab
12 changed files with 32 additions and 22 deletions

View file

@ -10,7 +10,7 @@ outputs:
description: Run Python tests / ruff / ty / windows-footguns.
value: ${{ steps.classify.outputs.python }}
frontend:
description: Run the TypeScript typecheck matrix + desktop build.
description: Run the TypeScript testing matrix + desktop build.
value: ${{ steps.classify.outputs.frontend }}
docker_meta:
description: Docker setup and meta files have changed.

View file

@ -70,11 +70,11 @@ jobs:
with:
event_name: ${{ needs.detect.outputs.event_name }}
typecheck:
name: TypeScript
js-tests:
name: JS & TS checks
needs: detect
if: needs.detect.outputs.frontend == 'true'
uses: ./.github/workflows/typecheck.yml
uses: ./.github/workflows/js-tests.yml
docs-site:
name: Docs Site
@ -139,7 +139,7 @@ jobs:
needs:
- tests
- lint
- typecheck
- js-tests
- docs-site
- history-check
- contributor-check

View file

@ -1,12 +1,12 @@
# .github/workflows/typecheck.yml
name: Typecheck
# .github/workflows/js-tests.yml
name: JS Tests
on:
workflow_call:
jobs:
typecheck:
name: Check TypeScript
check:
name: Typecheck & Test
runs-on: ubuntu-latest
strategy:
matrix:
@ -19,14 +19,11 @@ jobs:
with:
node-version: 22
cache: npm
# --ignore-scripts: typecheck only needs the TS sources + type defs, not
# native builds. Skipping install scripts drops node-pty's node-gyp
# header fetch — the transient flake that killed this job pre-`tsc` — and
# is faster. retry covers the remaining registry blips.
- uses: ./.github/actions/retry
with:
# --ignore-scripts: TS & tests don't need native deps
command: npm ci --ignore-scripts
- run: npm run --prefix ${{ matrix.package }} typecheck
- run: npm run --prefix ${{ matrix.package }} check
# Production build of the desktop renderer. `typecheck` runs `tsc` only,
# which does NOT exercise Vite/Rolldown module resolution — so an

View file

@ -12,7 +12,8 @@
"tauri:dev": "tauri dev",
"tauri:build": "tauri build",
"tauri:build:debug": "tauri build --debug",
"typecheck": "tsc -p . --noEmit"
"typecheck": "tsc -p . --noEmit",
"check": "npm run typecheck"
},
"dependencies": {
"@nous-research/ui": "0.16.0",

View file

@ -45,7 +45,8 @@
"fmt": "prettier --write 'src/**/*.{ts,tsx}' 'electron/**/*.ts' 'vite.config.ts'",
"fix": "npm run lint:fix && npm run fmt",
"test:ui": "vitest run --environment jsdom",
"preview": "node scripts/assert-root-install.mjs && vite preview --host 127.0.0.1 --port 4174"
"preview": "node scripts/assert-root-install.mjs && vite preview --host 127.0.0.1 --port 4174",
"check": "npm run typecheck && npm run test:ui && npm run test:desktop:all"
},
"dependencies": {
"@assistant-ui/react": "^0.12.28",

View file

@ -8,7 +8,8 @@
},
"types": "./src/index.ts",
"scripts": {
"typecheck": "tsc -p . --noEmit"
"typecheck": "tsc -p . --noEmit",
"check": "npm run typecheck"
},
"devDependencies": {
"typescript": "^6.0.3"

3
package-lock.json generated
View file

@ -19614,7 +19614,8 @@
"wrap-ansi": "^9.0.0"
},
"devDependencies": {
"esbuild": "^0.28.1"
"esbuild": "^0.28.1",
"typescript": "^6.0.3"
},
"peerDependencies": {
"ink-text-input": ">=6.0.0",

View file

@ -20,7 +20,8 @@
"audit:tui": "npm audit --workspace ui-tui",
"audit:fix:root": "npm audit fix --workspaces=false",
"audit:fix:web": "npm audit fix --workspace web",
"audit:fix:tui": "npm audit fix --workspace ui-tui"
"audit:fix:tui": "npm audit fix --workspace ui-tui",
"check": "npm run check --ws"
},
"repository": {
"type": "git",

View file

@ -12,6 +12,7 @@
"lint:fix": "eslint src/ packages/ --fix",
"fmt": "prettier --write 'src/**/*.{ts,tsx}' 'packages/**/*.{ts,tsx}'",
"fix": "npm run lint:fix && npm run fmt",
"check": "npm run typecheck && npm run test",
"test": "vitest run",
"test:watch": "vitest"
},

View file

@ -4,7 +4,9 @@
"private": true,
"type": "module",
"scripts": {
"build": "esbuild src/entry-exports.ts --bundle --platform=node --format=esm --packages=external --outdir=dist"
"build": "esbuild src/entry-exports.ts --bundle --platform=node --format=esm --packages=external --outdir=dist",
"check": "npm run typecheck",
"typecheck": "tsc -b . --noEmit"
},
"sideEffects": true,
"main": "./index.js",
@ -49,6 +51,7 @@
"wrap-ansi": "^9.0.0"
},
"devDependencies": {
"esbuild": "^0.28.1"
"esbuild": "^0.28.1",
"typescript": "^6.0.3"
}
}

View file

@ -0,0 +1,3 @@
{
"extends": "../../tsconfig.json"
}

View file

@ -9,7 +9,8 @@
"lint": "eslint .",
"preview": "vite preview",
"typecheck": "tsc -p . --noEmit",
"test": "vitest run"
"test": "vitest run",
"check": "npm run typecheck && npm run test"
},
"dependencies": {
"@hermes/shared": "file:../apps/shared",