Skip to content

build(deps): bump @types/node from 22 to 26 - #60

Merged
stuffbucket merged 2 commits into
mainfrom
chore/npm-major-language
Sep 7, 2026
Merged

stuffbucket merged 2 commits into
mainfrom
chore/npm-major-language

Conversation

@stuffbucket

Copy link
Copy Markdown
Owner

Group 4 of 4 replacing #37 — or rather, half of it.

All six declarations move together (anthropic-provider, maximal-dsh-host,
maximal-electron, maximal-provider-contract, maximal/client, omlx), so
the workspace stays on one major.

typescript 5.9 → 7 is not in this PR

It was grouped with @types/node and does not belong there. TypeScript 7's
package exports "." → ./lib/version.cjs — the package root is now just the
version string
. The compiler API moved to typescript/unstable/* (upstream's
naming). import * as ts from "typescript" no longer gets you a compiler.

That produces 307 errors across three packages from two unrelated causes, and
it is a migration rather than a bump. It gets its own PR.

A tradeoff worth recording

@types/node's major tracks the Node major, and this repo pins Node 24
(.nvmrc, asserted by verify-workspace.mjs: "node 24.x is what is running").

At 26, the definitions describe a runtime one major ahead of the one that
actually runs — so code can typecheck against APIs that are not there at run
time. The previous state had types one major behind the runtime, which only
ever meant they described a subset: the safe direction.

I raised ^24.x as the alternative (matching the runtime, still a major bump
off 22, and consistent with @types/bun being held at ^1.2.23 to match the
.bun-version pin). Brian chose latest. Noting the direction of the risk here
so it does not have to be rediscovered, not to reopen the decision.

Verification

  • All six consumers typecheck cleanly (tsc --noEmit, TypeScript 5.9).
  • Container suite 15/15 tasks.
  • verify:workspace passes; lockfile re-resolved and stripped of rotating shard
    hosts per SOURCES.md.

Replaces part of #37.

@stuffbucket
stuffbucket force-pushed the chore/npm-major-language branch from 2dcfaf1 to 1197e1f Compare September 7, 2026 04:08
stuffbucket added a commit that referenced this pull request Sep 7, 2026
The other half of the language group from #37. Depends on nothing else;
#60
carries `@types/node` separately.

## Why a bare bump does not work

**TypeScript 7.0 ships no programmatic API.** The package root exports
`lib/version.cjs` and nothing else — `typeof ts.createProgram` is
`undefined`.
The API is planned for 7.1.

That breaks three things at once here:

- seven files use the compiler API (`find-casts.ts`,
`provider-host-boundary.ts`, maximal-electron's test helpers and
scripts);
- typescript-eslint reads `ts.versionMajorMinor` and **refuses** major ≥
7;
- knip 5 crashes calling into the stub.

The typescript-eslint failure is the dangerous one: install succeeds,
`tsc` gets
faster, and **lint silently stops running rules**.

## The fix is the configuration TypeScript documents for this gap

```json
"@typescript/native": "npm:typescript@^7.0.2",
"typescript":         "npm:@typescript/typescript6@^6.0.2"
```

`typescript` resolves to the TS 6 compatibility package, which carries
the full
compiler API; TS 7 arrives under an alias owning the `tsc` bin (TS 6
names its
own bin `tsc6`, so no collision). Typechecking runs on 7, everything
needing the
API runs on 6 — the JS implementation of the same language version.

**Nothing that consumes the compiler API changes.** All seven files are
untouched, knip stays on 5, and typescript-eslint lands *inside* its
peer range
instead of being refused.

## Two real migrations

| Change | Why |
|---|---|
| `types: ["bun"]` in `maximal`, `maximal-core` | TS 6/7 no longer
auto-include it. Without it every `node:*` import and
`process`/`console` fails in `maximal`, and `maximal-core`'s declaration
build fails on `RequestInit`, `Response`, `AbortController`,
`setTimeout`. `maximal-core`'s downstream tsconfigs keep `types: []` and
are unaffected — they do not extend it. |
| `ignoreDeprecations: "6.0"` in the six tsup-dts packages | tsup
injects `baseUrl`, which TS 7 drops. None of these configs sets it
themselves. Removable once tsup stops emitting it. |

## A wrong turn worth recording

My first attempt aliased **TypeScript 5** for the API instead. It
reached zero
typecheck errors and every lint passed — and it was wrong. pnpm gave
typescript-eslint the 5.9.3 copy, so `tsc` checked with 7 while the
type-aware
lint rules checked with 5: two type systems judging the same code.

`verify-workspace.mjs`'s "one typescript major" guard did **not** catch
it,
because the alias installed under a different package name. That guard's
own
comment records this exact class of failure from the last time this
workspace
ran two majors — *"made eslint-plugin-perfectionist call a TS 5 API on
the TS 7
module"*. Under the official pair the guard is honest again:
`typescript`
resolves to one major everywhere.

## Verification

- All nine packages typecheck **and** lint (type-aware rules confirmed
running,
  not silently skipped).
- `maximal-core` `check:deep:host` passes end to end — including knip 5,
casts,
  deps, dupes, build, and the downstream contract typecheck.
- Every tsup declaration build passes. *(The container caught five
packages I
had missed by running only `tsc --noEmit` locally instead of the
builds.)*
- Container suite **15/15 tasks**; `verify:workspace` clean; lockfile
  re-resolved and stripped of rotating shard hosts.
@stuffbucket
stuffbucket force-pushed the chore/npm-major-language branch from bd5cef8 to 9d00748 Compare September 7, 2026 04:48
Half of the npm-major language group. typescript 5.9 -> 7 is the other
half and is not here: TypeScript 7 no longer exports the compiler API
from the package root, so it is a migration rather than a bump and gets
its own change.

All six declarations move together, so the workspace stays on one major.

Recorded, because it is a real tradeoff rather than a clean win:
@types/node's major tracks the Node major, and this repo pins Node 24
(.nvmrc, asserted by verify-workspace.mjs). At 26 the definitions
describe a runtime one major ahead of the one that runs, so code can
typecheck against APIs that are not there. The previous state had the
types one major BEHIND the runtime, which only ever meant they described
a subset. Brian chose latest over matching the runtime; noting the
direction of the risk so the next person reading this does not have to
rediscover it.

Verified: all six consumers typecheck, the container suite is 15/15, and
verify:workspace passes with the lockfile re-resolved and stripped of
rotating shard hosts.
Two type-aware lint rules start firing under @types/node 26, both from
the same change: ExecException now extends Omit<NodeJS.ErrnoException,
"code"> rather than Error, so the Error brand is gone from the type.

  opencode.ts  prefer-promise-reject-errors rejected a hand-rolled
               promisify whose reject() argument no longer types as an
               Error. Replaced with promisify(exec) from node:util,
               which is what the hand-rolled wrapper was reimplementing.
               Same rejection value, twelve fewer lines, and no cast.

  gh-cli.ts    no-deprecated flagged ExecFileException, now a deprecated
               empty alias for ExecException. Renamed at the import and
               the callback parameter.

Caught by CI rather than locally: the container suite does not run lint
(the image builds and tests; CI lints natively), and for this PR I had
checked types without linting. Both were real.
@stuffbucket
stuffbucket force-pushed the chore/npm-major-language branch from 9d00748 to b21c4b3 Compare September 7, 2026 04:54
@stuffbucket
stuffbucket merged commit b406fca into main Sep 7, 2026
6 checks passed
@stuffbucket
stuffbucket deleted the chore/npm-major-language branch September 7, 2026 05:04
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.

1 participant