nodejs / nodejs/corepack

Switch to devEngines.packageManager in "When Authoring Packages"

Open
#835 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
3.8k
Forks
279
Avg merge
1h 47m
Merged PRs (30d)
2

Description

Hi, thanks for Corepack! It's been a useful tool to maintain environments across student machines.

In the When Authoring Packages section of the readme, the instructions start with suggesting using a top-level packageManager field of package.json:

Set your package's manager with the packageManager field in package.json:

{
  "packageManager": "yarn@3.2.3+sha224.953c8233f7a92884eee2de69a1b92d1f2ec1655e66d08071ba9a02fa"
}

Further down in the readme, there is a subsection devEngines.packageManager, which shifts to describing the devEngines.packageManager field:

devEngines.packageManager

When a devEngines.packageManager field is defined, and is an object containing
a "name" field (can also optionally contain version and onFail fields),
Corepack will use it to validate you're using a compatible package manager.

devEngines.packageManager has some level of support in:

  1. npm v10+ https://docs.npmjs.com/cli/v10/configuring-npm/package-json#devengines
  2. Yarn via Corepack
  3. pnpm https://pnpm.io/package_json#devenginespackagemanager

My suggestion is regarding that first starting section of the readme on the top-level packageManager field:

  1. replace the packageManager docs with devEngines.packageManager docs (without the extra subsection)
  2. and then either:
    1. drop the packageManager docs
    2. deprioritize the packageManager docs by moving them to the end and describing it as "Legacy" or similar

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in the README's "When Authoring Packages" section and compare its top-level packageManager guidance with the later devEngines.packageManager subsection. Review the linked npm, Yarn, pnpm, and package-metadata documentation, then align the README's structure and examples with the chosen recommendation and verify all links and JSON snippets.

Written by the indexing model from the issue text.

Assessment

Tech stack
node.js
Domain
documentation
Issue type
Documentation
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.