chore(node): pin runtime and types to the Node 24 LTS line - #27
Merged
Conversation
Vercel only offers major Node versions (24.x is its current default, then
22.x and 20.x), and `engines.node` overrides the project's Build &
Deployment setting. Pinning the range to a single major keeps local, CI,
and deployed runtimes identical instead of letting each pick a different
arm of a multi-range.
- engines.node: `^22.22.2 || ^24.15.0 || >=26.0.0` -> `^24.15.0`.
The 24.15 floor is jsdom 30's, the strictest dev dependency; every 24.x
Vercel ships satisfies it.
- @types/node: `^26.5.1` -> `^24.13.4`. Types must not lead the runtime —
typings for APIs that do not exist in the deployed Node compile clean
and fail at request time.
- Add `.nvmrc` (`24`) and point CI at it via `node-version-file`, so the
CI version is no longer a second hardcoded copy.
- scripts/setup.ts: `REQUIRED_NODE_VERSION = 20` becomes
REQUIRED_NODE_MAJOR/MINOR (24/15) and `getNodeVersion()` returns
`{ major, minor }`. The check now rejects any major other than 24, not
just older ones — a developer on 26 was previously passing setup while
deploying to 24.
- Document the pin and the condition that releases it (Vercel moving its
default forward) in CLAUDE.md, plus an `@types/node` 25+ row in
Current holds; refresh the README prerequisite.
Verified: npm install clean (0 vulnerabilities), 812 tests / 50 files
pass, `eslint .` clean, `setup:check` reports Node v24.18.0.
Note: `tsc --noEmit` reports 18 pre-existing type errors in MP provider
test files. The count is identical before and after this change and is
unrelated to it.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
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.
Pins the project to a single Node major so local, CI, and Vercel all run the same runtime.
Why
engines.nodewas a three-arm range (^22.22.2 || ^24.15.0 || >=26.0.0), which let every environment pick a different arm. Vercel only offers major versions —24.x(its current default),22.x,20.x— andengines.nodeoverrides the project's Build & Deployment setting, so the deployed runtime was effectively 24 while nothing else guaranteed it.@types/nodewas at^26.5.1, two majors ahead of what actually runs. Typings for APIs that don't exist in the deployed Node compile clean and fail at request time.Changes
package.jsonengines.node→^24.15.0;@types/node^26.5.1→^24.13.4.nvmrc(new)24.github/workflows/test.ymlnode-version: 24→node-version-file: .nvmrc— removes the second hardcoded copyscripts/setup.tsREQUIRED_NODE_VERSION = 20→REQUIRED_NODE_MAJOR/MINOR(24/15);getNodeVersion()returns{ major, minor }. Now rejects any major other than 24, not just older ones — someone on 26 previously passed setup while deploying to 24.CLAUDE.md@types/node25+ row added to Current holdsREADME.md.nvmrc-drivenThe
24.15floor is jsdom 30's requirement (strictest dev dependency); every24.xVercel ships satisfies it.Vercel coverage
engines.node: ^24.15.0resolves to the latest24.xon Vercel and overrides the dashboard setting, covering both builds and functions. There is no Node-version field invercel.json, so no such file was added —enginesis the correct and complete mechanism. See Supported Node.js versions.Hold condition
Hold this pin until Vercel's default Node version moves forward. Then bump
engines.node,.nvmrc,@types/node, andREQUIRED_NODE_MAJORinscripts/setup.tstogether.Verification
npm installclean — 0 vulnerabilitiesnpm run test:run— 812 tests / 50 files passeslint .— cleannpm run setup:check—[1/8] Node.js version... ✓ v24.18.0tsc --noEmitreports 18 type errors in MP provider test files (CommunicationInfo/MessageInfo/FileUploadParamsshape mismatches). The count is identical before and after this change. Since CI gates tests only,npm run buildis already broken ondevindependently of this PR.🤖 Generated with Claude Code