-
Notifications
You must be signed in to change notification settings - Fork 34
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
RFC: Mount package.json
for Corepack
#1512
Conversation
Our Dockerfiles currently run `corepack enable pnpm` without any versioning information: https://github.com/seek-oss/skuba/blob/bc2c69d3b85a6aba738c5d63d01f810a69b1a248/template/greeter/Dockerfile#L5 This may use a different version than is specified in package.json: https://github.com/seek-oss/skuba/blob/bc2c69d3b85a6aba738c5d63d01f810a69b1a248/template/greeter/package.json This can result in a subsequent `pnpm install --offline` to hang in CI on the following prompt: ```console Corepack is about to download https://registry.npmjs.org/pnpm/-/pnpm-8.15.4.tgz. Do you want to continue? [Y/n] ```
|
@@ -279,7 +281,7 @@ This migration guide assumes that your project was scaffolded with a **skuba** t | |||
Your build pipeline may have previously output an ephemeral `.npmrc` with an auth token on the build agent. | |||
This needs to be output elsewhere to avoid overwriting the new pnpm configuration stored in `.npmrc`. | |||
|
|||
Swap out caching on `package.json` and `yarn.lock` for `.npmrc` and `pnpm-lock.yaml` at the same time. | |||
Swap out caching on `yarn.lock` for `.npmrc` and `pnpm-lock.yaml` at the same time. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cc @samchungy as I know you have opinions about caching
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sadge but there is no better solution imo
This renovate upgrade the packageManager version if we do option 2? One pro is we have run into issues in the past with version upgrades where we THEN need to pin pnpm |
@tadhglewis Yup, Renovate will raise PRs 👍 |
🤦 forgot a changeset |
I finally decided to read the Corepack documentation and skim its code. It turns out `corepack enable` doesn't actually do any installing. https://github.com/nodejs/corepack?tab=readme-ov-file#utility-commands
Our Dockerfiles currently run
corepack enable pnpm
without any versioning information:skuba/template/greeter/Dockerfile
Line 5 in bc2c69d
This may use a different (newer) version than is specified in package.json:
skuba/template/greeter/package.json
Line 21 in 6c2f984
This can result in a subsequent
pnpm install --offline
hanging in CI on the following prompt:Couple options:
package.json
package.json
on that Dockerfile commandThis implements option 2, but I could be convinced the other way.