ci(node-build): fail when @types/node major drifts from .nvmrc - #4
Merged
Conversation
.nvmrc is already the source of truth for the build Node version here (node-version-file), for Cloudflare Workers Builds, and for local fnm. @types/node's major must track that runtime; nothing enforced it, which is how a consumer drifted seven majors behind. Add a no-install step that compares the @types/node major in package.json against .nvmrc and fails on mismatch. Guarded on .nvmrc presence and skipped when @types/node is absent, so existing callers without either are unaffected. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
RobFaustLZ
approved these changes
Jul 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds a no-install step to the reusable
node-build.ymlthat compares the@types/nodemajor inpackage.jsonagainst the Node major in.nvmrcand fails the build on mismatch.Why
.nvmrcis already the source of truth here (node-version-file), for Cloudflare Workers Builds, and for localfnm.@types/node's major must track that runtime, but nothing enforced it — which is exactly howweb-app-reactdrifted 7 majors behind. This turns silent drift into a red check for every repo that builds through this workflow (cf-api-gateway,web-app-react,cf-analytics-pipeline,cf-queue-consumer).It reads only
package.json+.nvmrc(no install), is guarded on.nvmrcpresence, and is a no-op when@types/nodeisn't a dependency — so callers without either are unaffected.web-app-reactis currently misaligned onmain(@types/node ^17vs.nvmrcNode 24). Merge labelzoom/labelzoom-web-app-react#127 first, or this check will turnweb-app-react's build red until it lands.cf-api-gatewayis already aligned; the twocf-*workers have no@types/nodeand are skipped.🤖 Generated with Claude Code