nodejs / nodejs/corepack

feat: store `packageManager` property also inside the lock file

Open
#465 5 comments 1 reaction 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

Our current flow:
We use docker + pnpm fetch

COPY --chown=node:node pnpm-*.yaml .npmrc ./
RUN npm install -g pnpm@^8 # curernt usage without corepack
# RUN corepack enable #  <= but we want this one
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm fetch --loglevel=warn --ignore-scripts

This means we don't cache the package.json file before the pnpm fetch execution.
This allows us to worry about package.json changes.
But corepack will always install the latest version of pnpm instead of a specific one.

If store the packageManager property in a lock file, this will solve the problem.

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 by tracing the Docker flow using pnpm fetch and how package.json, pnpm-*.yaml, and .npmrc are handled before fetching. Determine how the lock file is read or generated, then ensure it preserves the packageManager property so corepack can select the pinned pnpm version without copying package.json first.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker
Domain
build-system, devops
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.