Skip to content

Add devEngines.packageManager support#789

Merged
sindresorhus merged 2 commits into
sindresorhus:mainfrom
LitoMore:add-devEngines-support
Apr 20, 2026
Merged

Add devEngines.packageManager support#789
sindresorhus merged 2 commits into
sindresorhus:mainfrom
LitoMore:add-devEngines-support

Conversation

@LitoMore LitoMore changed the title Add devEngies.packageManager support Add devEngines.packageManager support Apr 19, 2026
@sindresorhus
Copy link
Copy Markdown
Owner

One small issue:

devEngines.packageManager entries without a name are currently ignored and the code falls back to lockfile/default detection. npm does not do that. I double checked it by creating a package with devEngines.packageManager: {version: '>=9'} and running npm run check; npm fails immediately with Missing "name" property for "packageManager".

That means this change can silently accept an invalid manifest and then publish with a different package manager than the package actually declares. I’d rather make this error out instead of treating it as a fallback case. I think the current missing-name test should be flipped accoridngly.

@LitoMore
Copy link
Copy Markdown
Contributor Author

LitoMore commented Apr 19, 2026

@sindresorhus Nice catch. I've updated the logic and tests to check the name field.

@sindresorhus sindresorhus merged commit 03d4787 into sindresorhus:main Apr 20, 2026
2 checks passed
@LitoMore LitoMore deleted the add-devEngines-support branch April 20, 2026 12:30
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