diff --git a/.github/actions/detect-changes/action.yml b/.github/actions/detect-changes/action.yml index 268b0aa103c8..b2ab85be5bca 100644 --- a/.github/actions/detect-changes/action.yml +++ b/.github/actions/detect-changes/action.yml @@ -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. diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ab6012016536..8cecc8d18679 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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 diff --git a/.github/workflows/typecheck.yml b/.github/workflows/js-tests.yml similarity index 78% rename from .github/workflows/typecheck.yml rename to .github/workflows/js-tests.yml index dd2906629b01..acc0cadbba75 100644 --- a/.github/workflows/typecheck.yml +++ b/.github/workflows/js-tests.yml @@ -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 diff --git a/apps/bootstrap-installer/package.json b/apps/bootstrap-installer/package.json index 4638a8c905ea..7550e3c7c989 100644 --- a/apps/bootstrap-installer/package.json +++ b/apps/bootstrap-installer/package.json @@ -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", diff --git a/apps/desktop/package.json b/apps/desktop/package.json index 28f976a99b4f..d1620f225ebc 100644 --- a/apps/desktop/package.json +++ b/apps/desktop/package.json @@ -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", diff --git a/apps/shared/package.json b/apps/shared/package.json index bd1c10a48a6f..57b7f776bce9 100644 --- a/apps/shared/package.json +++ b/apps/shared/package.json @@ -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" diff --git a/package-lock.json b/package-lock.json index 1c25cb2b1dbe..92b7699b03c2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -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", diff --git a/package.json b/package.json index 9e9448497f68..5eb1e6b63714 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/ui-tui/package.json b/ui-tui/package.json index dfdb03b55a03..e370624c3c8b 100644 --- a/ui-tui/package.json +++ b/ui-tui/package.json @@ -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" }, diff --git a/ui-tui/packages/hermes-ink/package.json b/ui-tui/packages/hermes-ink/package.json index ab6728a7c9fa..9f4be632bef1 100644 --- a/ui-tui/packages/hermes-ink/package.json +++ b/ui-tui/packages/hermes-ink/package.json @@ -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" } } diff --git a/ui-tui/packages/hermes-ink/tsconfig.json b/ui-tui/packages/hermes-ink/tsconfig.json new file mode 100644 index 000000000000..21601918fe6f --- /dev/null +++ b/ui-tui/packages/hermes-ink/tsconfig.json @@ -0,0 +1,3 @@ +{ + "extends": "../../tsconfig.json" +} \ No newline at end of file diff --git a/web/package.json b/web/package.json index d211f68c2d77..8dfe84074a09 100644 --- a/web/package.json +++ b/web/package.json @@ -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",