Skip to content

chore: add .node-version file and engines field to package.json#192

Open
andrerfneves wants to merge 1 commit into
mainfrom
maintenance/add-node-version-20260618
Open

chore: add .node-version file and engines field to package.json#192
andrerfneves wants to merge 1 commit into
mainfrom
maintenance/add-node-version-20260618

Conversation

@andrerfneves

Copy link
Copy Markdown
Owner

Summary

Adds a .node-version file and an engines field to package.json so 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:

  • nvm/fnm/asdf users have to manually check the README or remember which Node version to use
  • npm users on unsupported Node versions won't get a warning
  • CI (20.x, 22.x) and local development could drift apart

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

  • All 52 existing tests pass
  • .node-version is consumed by nvm/fnm — no code change, just metadata
  • engines field is validated by npm on install — existing lockfile ensures compatibility

- 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
@vercel

vercel Bot commented Jun 18, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
lightning-decoder Ready Ready Preview, Comment Jun 18, 2026 10:08am

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread package.json
"license": "MIT",
"type": "module",
"engines": {
"node": ">=18"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

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