Skip to content

Commit

Permalink
fix: do not enforce engines in package.json
Browse files Browse the repository at this point in the history
The engines field causes warnings on npm but errors on yarn when the
required node version is not met.

Not all of our modules require LTS node and they are used by projects
outside of libp2p/helia/etc.

This change removes the automatic addition of an engines field to a
project's `package.json` while running the `check-project` command,
instead projects that do require a certain node version are free to
define it and deal with the breakage that subsequently occurs.

Partial revert of: #1184
Refs: #1276
  • Loading branch information
achingbrain committed May 17, 2023
1 parent 716c6ee commit 40d70da
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 5 deletions.
4 changes: 0 additions & 4 deletions src/check-project/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -248,10 +248,6 @@ export function constructManifest (manifest, manifestFields, repoUrl, homePage =
url: `${repoUrl}/issues`
},
keywords: manifest.keywords ? manifest.keywords.sort() : undefined,
engines: {
node: '>=18.0.0',
npm: '>=8.6.0'
},
bin: manifest.bin,
...manifestFields,
scripts: manifest.scripts,
Expand Down
2 changes: 1 addition & 1 deletion src/config/.npmpackagejsonlintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"require-description": "error",
"require-devDependencies": "off",
"require-directories": "off",
"require-engines": "error",
"require-engines": "off",
"require-files": "error",
"require-funding": "off",
"require-homepage": "error" ,
Expand Down

0 comments on commit 40d70da

Please sign in to comment.