Skip to content

fix(release): build before bumping versions to avoid stale nested install#9

Merged
faraa2m merged 1 commit into
mainfrom
fix/release-build-before-bump
May 9, 2026
Merged

fix(release): build before bumping versions to avoid stale nested install#9
faraa2m merged 1 commit into
mainfrom
fix/release-build-before-bump

Conversation

@faraa2m
Copy link
Copy Markdown
Owner

@faraa2m faraa2m commented May 9, 2026

Summary

  • Release run 25590632252 (version: 0.1.0) failed at npm run build with TS2339 errors on packages/cli/src/render.ts (contextWindow, maxOutputTokens "missing" from ModelDescriptor — even though the type clearly declares them).
  • Root cause: npm version --workspaces triggers an automatic install. After the bump, packages/cli's dep specifier "@tokenometer/core": "0.0.2" no longer matches the new workspace version 0.1.0, so npm fetches the published @tokenometer/core@0.0.2 from the registry into packages/cli/node_modules/@tokenometer/core/. That nested copy has the pre-tokenlens ModelDescriptor (just id + provider) and shadows the workspace symlink → cli's TypeScript resolves to stale types.
  • Fix: run build/test/benchmarks before the version bump (so build executes against the unpolluted install state from npm ci), and sync cross-package deps after the bump (so the published tokenometer@x.y.z correctly lists @tokenometer/core@x.y.z instead of the previous version, which is also a publish-time correctness bug independent of the build failure).

Test plan

  • Reproduced the failure locally: fresh npm ci, then npm version 0.1.0 --workspaces && npm run build → identical TS2339 errors as CI.
  • Confirmed nested copy: packages/cli/node_modules/@tokenometer/core/dist/types.d.ts is the published 0.0.2 (no contextWindow/maxOutputTokens); root node_modules/@tokenometer/core is still the workspace symlink.
  • Validated the fix end-to-end locally:
    • npm run build (pre-bump): clean
    • npm test: 48/48 pass
    • npm version 0.1.0 --workspaces: bumps all packages to 0.1.0
    • Sync step: packages/cli/package.json and packages/action/package.json now list @tokenometer/core@0.1.0
  • Re-dispatch the release workflow with version: 0.1.0 after merge to confirm green build + correct published deps.

🤖 Generated with Claude Code

…tall

`npm version --workspaces` triggers an automatic install that re-resolves
each workspace's dependencies. After the bump, packages/cli's dep
specifier `"@tokenometer/core": "0.0.2"` no longer satisfies the new
workspace version `0.1.0`, so npm fetches the published `0.0.2` from
the registry into `packages/cli/node_modules/@tokenometer/core/`. That
nested copy shadows the workspace symlink at the root, and TypeScript
resolves cli's `@tokenometer/core` import to the stale registry types
— which lack the `contextWindow`/`maxOutputTokens` fields added in
ec35c5e — producing TS2339 build errors.

Reorder the workflow so build/test runs against the committed source
before any version bump, and sync cross-package deps after the bump
so the published `tokenometer@x.y.z` correctly depends on
`@tokenometer/core@x.y.z` instead of the previous version.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@vercel
Copy link
Copy Markdown

vercel Bot commented May 9, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
tokenometer Ready Ready Preview, Comment May 9, 2026 3:52am

@faraa2m faraa2m merged commit 3658e6e into main May 9, 2026
7 checks passed
@faraa2m faraa2m deleted the fix/release-build-before-bump branch May 9, 2026 04:11
faraa2m added a commit that referenced this pull request May 11, 2026
…tall (#9)

`npm version --workspaces` triggers an automatic install that re-resolves
each workspace's dependencies. After the bump, packages/cli's dep
specifier `"@tokenometer/core": "0.0.2"` no longer satisfies the new
workspace version `0.1.0`, so npm fetches the published `0.0.2` from
the registry into `packages/cli/node_modules/@tokenometer/core/`. That
nested copy shadows the workspace symlink at the root, and TypeScript
resolves cli's `@tokenometer/core` import to the stale registry types
— which lack the `contextWindow`/`maxOutputTokens` fields added in
a1cf6ea — producing TS2339 build errors.

Reorder the workflow so build/test runs against the committed source
before any version bump, and sync cross-package deps after the bump
so the published `tokenometer@x.y.z` correctly depends on
`@tokenometer/core@x.y.z` instead of the previous version.

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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