Skip to content

ci(node-build): fail when @types/node major drifts from .nvmrc - #4

Merged
RobFaustLZ merged 1 commit into
mainfrom
chore/types-node-drift-check
Jul 29, 2026
Merged

ci(node-build): fail when @types/node major drifts from .nvmrc#4
RobFaustLZ merged 1 commit into
mainfrom
chore/types-node-drift-check

Conversation

@FaustClaw

Copy link
Copy Markdown

What

Adds a no-install step to the reusable node-build.yml that compares the @types/node major in package.json against the Node major in .nvmrc and fails the build on mismatch.

Why

.nvmrc is already the source of truth here (node-version-file), for Cloudflare Workers Builds, and for local fnm. @types/node's major must track that runtime, but nothing enforced it — which is exactly how web-app-react drifted 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 .nvmrc presence, and is a no-op when @types/node isn't a dependency — so callers without either are unaffected.

The two Astro repos (docs-astro, website-astro) don't build through this workflow (they deploy via Cloudflare Workers Builds), so they get an equivalent standalone types-node-check.yml in their own PRs.

⚠️ Merge ordering

web-app-react is currently misaligned on main (@types/node ^17 vs .nvmrc Node 24). Merge labelzoom/labelzoom-web-app-react#127 first, or this check will turn web-app-react's build red until it lands. cf-api-gateway is already aligned; the two cf-* workers have no @types/node and are skipped.

🤖 Generated with Claude Code

.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>
@FaustClaw
FaustClaw requested a review from a team as a code owner July 29, 2026 13:59
@RobFaustLZ
RobFaustLZ merged commit 3a4bd42 into main Jul 29, 2026
1 check passed
@RobFaustLZ
RobFaustLZ deleted the chore/types-node-drift-check branch July 29, 2026 15:40
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.

2 participants