nodejs / nodejs/package-maintenance
Wishlist on managing package manager versions in a Node.js application
Nobody has claimed this yet.
- Dominant language
- No language data
- Stars
- 423
- Forks
- 147
- PR merge metrics
- No merged PRs in 30d
Description
Is your feature request related to a problem? Please describe.
There are several discussions about managing package manager version in the past.
At the time of writing, i.e. 2024-07-30, Node.js ships experimental corepack which allows pinning the packageManager field in package.json. It's being used in at least tens of thousands of applications searchable in public code.
There has been asks to make corepack stable since May 2022 https://github.com/nodejs/corepack/issues/104
The PR to enable yarn/pnpm corepack binaries by default in https://github.com/nodejs/node/pull/51886, has moved from most approvals to most declines. There's an open PR to remove corepack too at https://github.com/nodejs/node/pull/51981
The tweets about corepack often go viral, like ones by Matt https://twitter.com/search?q=from%3Amattpocockuk%20corepack&src=typed_query, and then some discussions happen Twitter threads which aren't documented.
Here is some wishlist I would like to share:
- As a Node.js user, I want an built-in way to manage my package manager version, like corepack.
- As a corepack user, I don't want my application which specified
packageManagerfield to break. - As a Node.js user, I'm open to experiment with alternatives, like
devEngines.
Describe the solution you'd like
Based on requirements, and consensus in devEngines proposal as of July 2024, here is what a good solution may look like:
- Do not break applications which use
packageManagerfield. - Implement
devEnginesspecification, and provide an easy built-in way for users to use it. This can becorepackor something else. It doesn't matter as long as it ships with Node.js and is easy to use.
Over time, if there's data that one specification is better than other, then add doc/runtime deprecations and provide a migration path to the preferred one.
Describe alternatives you've considered
- Switch to installing corepack from npm.
- Switch to a different runtime, like Deno/Bun.
Additional context
Originally posted as a tweet in https://twitter.com/trivikram/status/1818303053902307479.
A GitHub issue was created as per response from @wesleytodd
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No implementation files, tests, or entry points are named. Start by reviewing the linked Corepack discussions and the devEngines proposal to understand the competing requirements and current consensus. Done would require an agreed specification, an implementation location, and a migration path that preserves existing packageManager users.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- node.js
- Domain
- developer-experience, tooling
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100