-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add devEngines
field
#7253
Conversation
This field is only looked at when in the top-level project, and takes precedence over `engines` when present See openjs-foundation/package-metadata-interoperability-collab-space#15 (comment) for the schema
As I mentioned to @ljharb in a side channel, I think this feature could/should land as Why
|
I don't think it makes sense to hardcode just node and npm - there's lots of things that can go in |
Makes sense, |
If this field could be made equivalent with Corepack’s What this would need for equivalence is support for URLs (to download the package manager version) and hashes (to validate the download). See: "packageManager": "[email protected]+sha224.953c8233f7a92884eee2de69a1b92d1f2ec1655e66d08071ba9a02fa" or "packageManager": "yarn@https://registry.npmjs.org/@yarnpkg/cli-dist/-/cli-dist-3.2.3.tgz#sha224.16a0797d1710d1fb7ec40ab5c3801b68370a612a9b66ba117ad9924b" Obviously npm would have no use for these, but there would need to be a place to define these values in |
I don’t think that expansion of the field makes sense; that functionality in corepack is both recent and ill-advised and i wouldn’t want to see it replicated anywhere else. This field is intended to only be the dev-time mirror of the engines field (or, in the alternative explanation, the publish-time mirror). |
In order to not shard our design efforts it is probably worthwhile to keep discussion in nodejs/node#51888 for now. I like the idea of having a discrete "interacting with this as an app" directive for npm that is different than "interacting with this as a published package". I don't know that a net new top level attribute for this single function is the right approach. We're heading in the right direction though. See you in the other issue. I'm closing this not as a hard "no" but (hopefully) in service of consolidating design concerns. |
@wraithgar I don't think it's a good idea to delay this long-discussed and much-needed feature indefinitely until something larger and more complex is designed and widely shipped . If you don't want a top-level attribute, what do you think about the |
fba38d8
to
5d5f6a8
Compare
This needs to be added to npm-install-checks itself, not the vendored copy here. |
I'm working on an implementation of this this week, you may want to wait on any effort here. |
This field is only looked at when in the top-level project, and takes precedence over
engines
when present. It's particularly useful when you want devs to use a more modern node/npm/etc version than your package actually supports.An alternative implementation instead of a new top-level field would be
publishConfig.engines
, which when present/published would overrideengines
for NON top-level projects (this would mean that theengines
field is always the source of truth, but the packument is altered on publish when publishConfig.engines is present). Happy to make that change if preferred.(This would be an RFC, but RFC calls have been dead for years)