8000 ci: type check with tsgo by simon-inkie · Pull Request #204 · simon-inkie/inkie-deck · GitHub
[go: up one dir, main page]

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
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ jobs:
- name: Install ripgrep, jq and PyYAML
run: sudo apt-get update && sudo apt-get install -y ripgrep jq python3-yaml

- name: Typecheck
- name: Typecheck with tsgo
run: pnpm typecheck

- name: Unit tests
Expand Down
46 changes: 46 additions & 0 deletions .specs/ci-tsgo-typecheck/SPEC.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Use native TypeScript for CI typechecking

## TL;DR

Use the TypeScript native preview for Deck's required typecheck. Keep the
existing `tsc` check available for comparing diagnostics. The lockfile needs
a registry-backed update before CI can install the preview.

## Scope

- Keep the existing CI jobs and Node matrix.
- Generate React Router types before either compiler runs.
- Leave Base unchanged: it has no typecheck script or `tsconfig.json`.

## Test plan

- Run the original `pnpm typecheck` as a `tsc` baseline.
- Run `pnpm install --lockfile-only --no-frozen-lockfile` with registry access,
then `pnpm install --frozen-lockfile`.
- Compare `pnpm typecheck` and `pnpm typecheck:tsc`, then run `pnpm test`.

## Log

### 2026-11-18: Switch to the cached preview version
- What changed: pinned the preview version recorded in local registry metadata
and kept the original compiler as a fallback.
- Why: the preview package and native binary are not available for offline
installation. Do not hand-edit the lockfile.
- Supersedes: nothing, additive.

### 2026-11-18: Verify the fallback and offline blocker
- What changed: verified that the original `pnpm typecheck` and the new
`pnpm typecheck:tsc` both pass with TypeScript 5.9.3. Native diagnostics
remain unverified: pnpm could not resolve the preview offline.
- Why: confirm the fallback works and leave the lockfile update to a run
with registry access.
Comment on lines +31 to +36
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔍 Stale native typecheck verification record

The SPEC records tsgo as unverified, but the PR description reports both compilers passing. The committed lockfile also contains the dependency previously described as blocked. The required handover record leaves the final verification state unclear.

Devin Review


Was this helpful? React with 👍 or 👎 to provide feedback.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed in 7ff21ee: the SPEC now has a later entry recording that the lockfile was regenerated and tsgo verified. The earlier entry is kept as history (the SPEC is append-only).

- Supersedes: nothing, additive.

### 2026-11-18: Lockfile regenerated, tsgo verified
- What changed: regenerated `pnpm-lock.yaml` with registry access and ran
`pnpm install --frozen-lockfile`. `pnpm typecheck` (tsgo) and
`pnpm typecheck:tsc` both exit 0 on this tree.
- Why: closes the offline blocker and the "native diagnostics unverified"
note above, which are now out of date.
- Supersedes: the two entries above on the verification state; their
history is kept as written.
3 changes: 3 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ pnpm check:lib-version
pnpm -C packages/deck check:dashes
```

- `pnpm typecheck` runs the TypeScript native preview (`tsgo`). Use
`pnpm typecheck:tsc` to compare diagnostics with `tsc`, not as a substitute
for the required CI check.
- `check:leaks` scans the tree for material that must not be published.
`check:leaks:history` and `check:leaks:messages` extend that to git history
and commit messages.
Expand Down
3 changes: 3 additions & 0 deletions DEVELOPMENT.md
10000
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,9 @@ Before opening:
pnpm check:lib-version
```

`pnpm typecheck` uses `tsgo`; run `pnpm typecheck:tsc` to compare diagnostics
with `tsc` when investigating a discrepancy.

The dash check lives in the deck package rather than the root, so run it
from there: `pnpm -C packages/deck check:dashes`.

Expand Down
6 changes: 3 additions & 3 deletions INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -566,9 +566,9 @@ pnpm install
One warning is expected and harmless:
`Ignored build scripts: esbuild@0.27.7, esbuild@0.28.0`.

If you want to run the checks the project runs on itself (`pnpm typecheck`,
`pnpm test` and the three gates), the README covers them. They are not needed
to run Deck.
The README covers the project's checks, including `pnpm typecheck` (native
TypeScript), `pnpm typecheck:tsc` (the `tsc` fallback), and `pnpm test`.
They are not needed to run Deck.

## 3. Try it

Expand Down
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,11 @@ pnpm check:licence
CI runs exactly this list (plus gitleaks), so a green pipeline never claims
more than a green local run.

`pnpm typecheck` uses the TypeScript native preview (`tsgo`) after generating
Deck's React Router types. The preview can report different diagnostics from
`tsc`. Run `pnpm typecheck:tsc` to compare or to check on a platform without a
native preview binary. CI requires the `tsgo` check.

## The codes in the comments

Comments through `packages/deck` cite short codes that arrived with the code.
Expand Down
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"build": "pnpm -C packages/deck build",
"start": "pnpm -C packages/deck start",
"typecheck": "pnpm -r run typecheck",
"typecheck:tsc": "pnpm -r run typecheck:tsc",
"_comment:test": "One workspace at a time, deliberately. pnpm -r defaults to running package scripts in parallel, and the base suite drives bin/create-agent.sh as real subprocesses. Run alongside deck's suite, that load alone pushed a dozen of deck's 5-second per-test timeouts over the line: 64 failures, none of them a real defect, on a tree that is green when the two run in sequence. A suite that fails for load reasons is no more use than one that passes for environmental ones.",
"test": "pnpm -r --workspace-concurrency=1 run test",
"check:boundaries": "depcruise packages",
Expand All @@ -28,6 +29,7 @@
"check:lib-version": "node scripts/lib-version-gate.mjs"
},
"devDependencies": {
"@typescript/native-preview": "7.0.0-dev.20260707.2",
"dependency-cruiser": "^16.10.0",
"typescript": "^5.8.0"
}
Expand Down
3 changes: 2 additions & 1 deletion packages/deck/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
"preflight": "node scripts/preflight.mjs",
"dev:raw": "react-router dev",
"start": "react-router-serve ./build/server/index.js",
"typecheck": "react-router typegen && tsc",
"typecheck": "react-router typegen && tsgo --noEmit",
"typecheck:tsc": "react-router typegen && tsc",
"test": "vitest run",
"check:dashes": "node scripts/check-dashes.mjs",
"e2e": "node e2e/setup.mjs && playwright test --config=playwright.config.ts",
Expand Down
81 changes: 81 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
0