chore: add .node-version file and engines field to package.json#192
chore: add .node-version file and engines field to package.json#192andrerfneves wants to merge 1 commit into
Conversation
- Adds .node-version (v20) so nvm/fnm/asdf users automatically pick the correct Node.js version when working on the project - Adds engines.node (>=18) to package.json so npm warns on unsupported Node.js versions - Both values match the README's stated minimum (18+) and recommended (20+) versions, and align with the CI matrix
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8828b3fda2
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| "license": "MIT", | ||
| "type": "module", | ||
| "engines": { | ||
| "node": ">=18" |
There was a problem hiding this comment.
Require the same Node version as the locked tooling
This now advertises Node 18 as supported, but the checked-in lockfile already installs dev tools that do not support Node 18: package-lock.json records vitest@4.1.0 with node: ^20.0.0 || ^22.0.0 || >=24.0.0 and jsdom@29.1.1 with node: ^20.19.0 || ^22.13.0 || >=24.0.0. In environments that select or validate Node from package.json instead of .node-version, npm test/jsdom-based tests can run under Node 18 even though the installed test stack declares it unsupported; the engine range should be tightened to the minimum version the locked toolchain supports.
Useful? React with 👍 / 👎.
Summary
Adds a
.node-versionfile and anenginesfield topackage.jsonso developers using version managers automatically pick the correct Node.js version, and npm warns on unsupported versions.Why
The README already documents that the project requires Node.js 18+ (recommended 20+), but there was no machine-readable specification. This means:
Changes
.node-version— Pins to Node.js 20 (matches the recommended version in README and the minimum CI matrix entry)package.json— Adds"engines": { "node": ">=18" }(matches the minimum version stated in README)Test Plan
.node-versionis consumed by nvm/fnm — no code change, just metadataenginesfield is validated by npm on install — existing lockfile ensures compatibility