Skip to content

Adding engines to prevent installation for unsupported nodejs versions#14

Open
fantaJinMode wants to merge 1 commit intoLinkForty:mainfrom
fantaJinMode:add_engines_field_package
Open

Adding engines to prevent installation for unsupported nodejs versions#14
fantaJinMode wants to merge 1 commit intoLinkForty:mainfrom
fantaJinMode:add_engines_field_package

Conversation

@fantaJinMode
Copy link
Contributor

Description

Adds an engines field to package.json declaring minimum supported runtime versions, preventing installation on incompatible Node.js or npm versions.

Why It Was Needed

The project requires Node.js 18+ (documented in prerequisites) but nothing enforced this at install time. Consumers on older Node.js versions could install the package and encounter runtime failures with no clear indication of the root cause.

Benefits

  • npm warns (or errors with engine-strict) on unsupported Node.js/npm versions
  • Aligns declared requirements with documented prerequisites
  • Prevents hard-to-debug runtime failures on older environments

Type of Change

  • 🐛 Bug fix (non-breaking change which fixes an issue)
  • ✨ New feature (non-breaking change which adds functionality)
  • 💥 Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • 📝 Documentation update
  • ♻️ Code refactoring
  • ⚡ Performance improvement
  • ✅ Test addition or update

Changes Made

  • Added "engines": { "node": ">=18", "npm": ">=9" } to package.json

Testing

Successfully run npm run build

  • Tests pass locally (npm test)
  • New tests added for new functionality
  • Existing tests updated (if needed)
  • Type checking passes (npm run typecheck)

Checklist

  • My code follows the project's code style
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings or errors
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published
  • I have used conventional commit messages (e.g., feat:, fix:)
  • I have signed the Contributor License Agreement (the CLA bot will prompt you)

Breaking Changes

None

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@codecov
Copy link

codecov bot commented Mar 11, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

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