Repository navigation
chore: use bun check for local typechecks and TypeScript 7.1 in CI - #58253
Conversation
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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:152onconnect. This leads to ~25 follow-on errors intest/mcp.test.tsandtest/mcp-oauth.test.ts(TS6305,Effect<…, unknown>vsnever, implicitany), and the same error shows up in every package that depends on core. - TS5088 on
createComposerState,createDraftComposerState,createMemoryComposerState,createTabComposerState,createComposerSubmissionand the persistence context export inpackages/app/src/composer/. - TS2883 at
packages/app/playwright.components.config.ts:4: the inferredPlaywrightTestConfigtype "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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
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)"] endSplit scripts: every package keeps its
tsccommand astypecheck:tsc, andtypecheckbecomes thebun checkequivalent.typecheck:tsctypechecktsc --noEmitbun check --no-scripttsc -bbun check --no-script -btsc -b tsconfig.json tsconfig.tests.json(core)bun check --no-script -b -p tsconfig.tests.jsonastro check(posts, www)Turbo cache fix:
typecheckwas{}, so a task's hash ignored changes in its workspace dependencies. Only the 5 packages with adependsOnon core picked up core edits. Both tasks now depend ontransit, the same tricktestuses.packages/schema/srcschemaonly (18 dependents replay a cached pass)schema+ 18 dependentspackages/core/srccore+ 5 viadependsOntransitTurbo order:
typecheck(bun check) no longer waits for core, because it reads dependency sources directly.typecheck:tsckeeps the coredependsOnfor its 5 dependents, becausetsc -bwrites core's declarations for them. Package entries replace the generic task entry, so they repeattransit.CI:
check.ymlrunsbun run lintand thenbun run typecheck:tsc. Thedeploy-files,deploy-changelog,deploy-updateworkflows and everyscript/publish.tsalso runtypecheck:tsc.TypeScript 7.1: the
@typescript/nativecatalog entry (and the copy inplugins/figma) moves from7.0.2to7.1.0-beta.bun checkalready follows 7.1 for deep type comparisons, so the editor, CI and local checks now agree more closely.Release age:
[email protected]is added tominimumReleaseAgeExcludes. The per-platform binaries (@typescript/typescript-<os>-<arch>) are separate packages that the entry does not cover, so they are pinned inbun.lockand 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.tsfiles feedtsc -b.bun checkwrites no declarations, so it never reports these.app/src/composer/state.ts, becausecapture()returns the state itselfComposerStateValueand annotatecreateComposerStateValuecore/src/mcp/client.tsconnectconst connection: Connection = {...}instead ofsatisfies Connectionapp/playwright.components.config.tsPlaywrightTestConfigutil's library buildutil/src/effect/app-node.tsmakeGlobalNode,makeLocationNodeLayerNode.TagMakerThe TS2345, TS7006 and TS6305 errors in
core/test/mcp*.test.ts, and the same errors reported again incli,desktop,sdk,server,simulationandtui, came from the missingclient.d.tsand clear with the fix above.Why CI stays on
tsc:bun checkmatchestscdiagnostics ondev, but it is a separate checker. It reports TypeScript7.0.2while 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=3without the twoastro checkpackages unless noted.dev(tsc 7.0.2)bun check)bun run check(lint + typecheck + astro), 20 corespackages/core/src(6 tasks re-run)Per package, 20 cores:
bun checkclicoresdkservertuisimulationdesktopAdded by the opencode bot (AI-generated).
Public API: adds the exported type LayerNode.TagMaker to @opencode/util (backwards compatible)