Skip to content

chore: use bun check for local typechecks and TypeScript 7.1 in CI - #58253

Merged
Hona merged 5 commits into
anomalyco:devfrom
Hona:bun-check-local
Oct 22, 2026
Merged

Hona merged 5 commits into
anomalyco:devfrom
Hona:bun-check-local

Conversation

@Hona

@Hona Hona commented Oct 22, 2026 •

Copy link
Copy Markdown
Member

Local typechecks run on bun check. CI and package publishing keep the official compiler, upgraded to TypeScript 7.1.

flowchart LR
  subgraph local["Local: pre-push, bun run check, bun typecheck"]
    A["typecheck"] --> B["bun check --no-script"]
  end
  subgraph ci["CI: check.yml, deploy-*.yml, publish.ts"]
    C["typecheck:tsc"] --> D["tsc (@typescript/native 7.1.0-beta)"]
  end
Loading
  • Split scripts: every package keeps its tsc command as typecheck:tsc, and typecheck becomes the bun check equivalent.

    typecheck:tsc typecheck
    tsc --noEmit bun check --no-script
    tsc -b bun check --no-script -b
    tsc -b tsconfig.json tsconfig.tests.json (core) bun check --no-script -b -p tsconfig.tests.json
    astro check (posts, www) unchanged
  • Turbo cache fix: typecheck was {}, so a task's hash ignored changes in its workspace dependencies. Only the 5 packages with a dependsOn on core picked up core edits. Both tasks now depend on transit, the same trick test uses.

    Edit Re-checked before Re-checked now
    packages/schema/src schema only (18 dependents replay a cached pass) schema + 18 dependents
    packages/core/src core + 5 via dependsOn same 6, via transit
  • Turbo order: typecheck (bun check) no longer waits for core, because it reads dependency sources directly. typecheck:tsc keeps the core dependsOn for its 5 dependents, because tsc -b writes core's declarations for them. Package entries replace the generic task entry, so they repeat transit.

  • CI: check.yml runs bun run lint and then bun run typecheck:tsc. The deploy-files, deploy-changelog, deploy-update workflows and every script/publish.ts also run typecheck:tsc.

  • TypeScript 7.1: the @typescript/native catalog entry (and the copy in plugins/figma) moves from 7.0.2 to 7.1.0-beta. bun check already follows 7.1 for deep type comparisons, so the editor, CI and local checks now agree more closely.

  • Release age: [email protected] is added to minimumReleaseAgeExcludes. The per-platform binaries (@typescript/typescript-<os>-<arch>) are separate packages that the entry does not cover, so they are pinned in bun.lock and pass the 3-day age on 2026-10-23 anyway.

  • 7.1 migration: TypeScript 7.1 rejects declaration emit for inferred types it cannot name, in the composite projects (app, core) whose .d.ts files feed tsc -b. bun check writes no declarations, so it never reports these.

    Error Site Fix
    TS5088 cyclic inferred type app/src/composer/state.ts, because capture() returns the state itself Name the shape as ComposerStateValue and annotate createComposerStateValue
    TS5088 cyclic inferred type core/src/mcp/client.ts connect const connection: Connection = {...} instead of satisfies Connection
    TS2883 type not portable app/playwright.components.config.ts Annotate the default export as PlaywrightTestConfig
    TS5088 cyclic inferred type, in util's library build util/src/effect/app-node.ts makeGlobalNode, makeLocationNode Name the factory type as LayerNode.TagMaker

    The TS2345, TS7006 and TS6305 errors in core/test/mcp*.test.ts, and the same errors reported again in cli, desktop, sdk, server, simulation and tui, came from the missing client.d.ts and clear with the fix above.

  • Why CI stays on tsc: bun check matches tsc diagnostics on dev, but it is a separate checker. It reports TypeScript 7.0.2 while following 7.1 for deep type comparisons (bun check: process.versions.typescript and docs say 7.0.2, but type checking follows TypeScript 7.1 oven-sh/bun#46536), and it has open parity bugs.

Benchmarks

Cold runs (no turbo cache, no .tsbuildinfo), Windows, bun turbo typecheck --concurrency=3 without the two astro check packages unless noted.

Run dev (tsc 7.0.2) This PR (bun check)
Typecheck, 20 cores 49.4 s 17.8 s
Typecheck, pinned to 4 cores 107.2 s 40.4 s
bun run check (lint + typecheck + astro), 20 cores 77.2 s (lint and typecheck timed separately) 39.9 s
Pre-push after an edit in packages/core/src (6 tasks re-run) 33.2 s 13.3 s

Per package, 20 cores:

Package tsc bun check
cli 16.8 s 2.6 s
core 15.8 s 2.5 s
sdk 15.3 s 2.3 s
server 15.3 s 2.4 s
tui 11.4 s 1.7 s
simulation 10.7 s 1.6 s
desktop 9.4 s 1.5 s
All 32 tsc packages, sum 129.3 s 22.2 s

Added by the opencode bot (AI-generated).

Public API: adds the exported type LayerNode.TagMaker to @opencode/util (backwards compatible)

@Hona
Hona requested a review from Brendonovich as a code owner October 22, 2026 22:46
Copilot AI balanced review requested due to automatic review settings October 22, 2026 22:46

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

@opencode-agent opencode-agent Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

With this change, CI's typecheck fails while the local check passes.

I ran both checks with Bun 1.4.4 after bun install --frozen-lockfile (which resolves 7.1.0-beta fine). On the base, bun run typecheck (tsc 7.0.2) passes all 34 tasks. With this PR, bun run typecheck (bun check) also passes all 34, and it is much faster (core takes ~1.9 s instead of ~11–14 s). But bun run typecheck:tsc (tsc 7.1.0-beta, which check.yml now runs) fails in 8 packages: core, app, cli, desktop, sdk, server, simulation and tui.

  • TS5088 ("inferred type … references a type with a cyclic structure") at packages/core/src/mcp/client.ts:152 on connect. This leads to ~25 follow-on errors in test/mcp.test.ts and test/mcp-oauth.test.ts (TS6305, Effect<…, unknown> vs never, implicit any), and the same error shows up in every package that depends on core.
  • TS5088 on createComposerState, createDraftComposerState, createMemoryComposerState, createTabComposerState, createComposerSubmission and the persistence context export in packages/app/src/composer/.
  • TS2883 at packages/app/playwright.components.config.ts:4: the inferred PlaywrightTestConfig type "cannot be named".

The source is the same as on the base, so the 7.1 upgrade causes these errors. bun check reports none of them. These errors come from writing declaration files under tsc -b, which bun check doesn't seem to cover, so a local typecheck won't catch this kind of CI failure. Either add the type annotations 7.1 needs in this PR, or keep the catalog on 7.0.2 and do the 7.1 upgrade separately.

Public API: unchanged. This only touches dev scripts, CI and the @typescript/native dev-dependency version.

Comment thread package.json Resolved
Comment thread .github/workflows/check.yml Resolved

@opencode-agent opencode-agent Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The earlier problem is fixed: bun run typecheck:tsc (tsc 7.1.0-beta) now passes all 34 tasks after a clean --force run. The annotations in core/src/mcp/client.ts, app/src/composer/state.ts and app/playwright.components.config.ts clear every TS5088/TS2883 error, along with the follow-on errors in core's tests and its dependents. bun run typecheck (bun check) also passes 34/34, and bun install --frozen-lockfile works with the new minimumReleaseAgeExcludes entry. The transit dependency in turbo.json is consistent with how build and test use it.

Public API: unchanged (dev scripts, CI, turbo/bunfig config and a dev-dependency only). No further concerns.

@opencode-agent opencode-agent Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The new commit fixes the TS5088 error in @opencode/util's library build. At the previous head, bun run build in packages/util failed under tsc 7.1 on makeGlobalNode/makeLocationNode (that build runs in util's publish script). With this commit, bun run typecheck:dist passes. Repo-wide typecheck:tsc and typecheck both pass 34/34, and packages/util tests pass. No further concerns.

Public API: @opencode/util adds the exported type LayerNode.TagMaker, and Tags.make keeps the same type (backwards compatible). Everything else is dev scripts and CI only.

@Hona
Hona merged commit 84578e1 into anomalyco:dev Oct 22, 2026
24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants