Skip to content

fix(release): pin the type toolchain the artifact validator installs - #34

Merged
matej21 merged 1 commit into
mainfrom
fix/pin-validator-node-types
Sep 10, 2026
Merged

fix(release): pin the type toolchain the artifact validator installs#34
matej21 merged 1 commit into
mainfrom
fix/pin-validator-node-types

Conversation

@matej21

@matej21 matej21 commented Sep 10, 2026

Copy link
Copy Markdown
Member

Summary

The v0.2.3 publish failed in Pack and validate published artifacts. Nothing reached npm; every step before it passed.

The consumer harness in pack-and-validate.mjs installs with npm and --package-lock=false, so anything it does not pin floats. It pinned typescript, @types/bun, @types/react and @types/react-dom, but not @types/node — that one arrived only through bun-types, which asks for "*".

bun and npm read "*" differently:

resolves * to
bun (repository, against bun.lock) @types/node@25.5.0, the newest version
npm (harness, no lockfile) @types/node@22.20.2, the latest dist-tag

bun-types@1.4.2 does not compile against @types/node@22. An empty file reproduces it outside this repository:

bun-types/globals.d.ts(320,74): Namespace '"node:util"' has no exported member 'TextEncoderEncodeIntoResult'.
bun-types/overrides.d.ts(352,47): Cannot find name 'ConnectionOptions'.
bun-types/overrides.d.ts(390,67): Cannot find name 'KeyObject'.
bun-types/overrides.d.ts(394,88): Cannot find name 'TLSSocket'.

No dependency of ours moved. The latest dist-tag did, so the same commit that published 0.2.2 would fail today.

Change

Declare @types/node in the catalog, consume it at the root, and pin it in the harness beside the other type packages. Consuming it at the root is what keeps the pin honest: the catalog value is now the version bun resolves, so the validator cannot drift away from what the repository builds against.

The resolved version does not change — bun.lock already had 25.5.0, and the only lockfile lines added are the declaration itself.

Verification

  • node ./scripts/npm-publish/pack-and-validate.mjs on a real prepare-packages.mjs v0.2.3 tree: Validated 10 package tarballs. This is the step that failed; CI does not run it.
  • bun install --frozen-lockfile accepts the lockfile with no changes.
  • bun run lint and bun run ts:build pass.

Note for later, out of scope here: @roj-ai/demo, @roj-ai/platform-cli and @roj-ai/sandbox-runtime declare "@types/bun": "latest", which re-resolves on every unfrozen install. Same class of problem, different blast radius.

🤖 Generated with Claude Code

https://claude.ai/code/session_01XtPnrL2GXJVhNxFoBDq4yt

The consumer harness installs with npm and no lockfile, so every version it
does not pin floats. It pinned typescript and the @types it names, but not
@types/node: that one arrived through bun-types, which asks for '*'. bun reads
'*' as the newest version and npm reads it as the latest dist-tag, so the two
managers disagreed and the harness got @types/node 22 under bun-types 1.4.

The repository never noticed, because it installs with bun against the
lockfile. Only the validator installs the other way, and it broke there alone:
an empty file failed to compile against bun-types with four missing Node
globals, failing the v0.2.3 publish before anything reached npm.

Declare @types/node in the catalog and consume it at the root, so bun pins the
version the harness now installs. The resolved version does not change.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XtPnrL2GXJVhNxFoBDq4yt
@matej21
matej21 merged commit cf3e6ff into main Sep 10, 2026
1 check passed
@matej21
matej21 deleted the fix/pin-validator-node-types branch September 10, 2026 09:29
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