ci: install pnpm v12 and configure the bundle with native pnpm commands - #10627
ci: install pnpm v12 and configure the bundle with native pnpm commands#10627zkochan wants to merge 4 commits into
Conversation
pnpm 12 no longer reads its settings from the "pnpm" field in package.json
("The 'pnpm' field in package.json is no longer read by pnpm"), so the jsonmod
and json dlx calls that populated pnpm.overrides would have produced a bundle
with no overrides at all. They are replaced by a single native
`pnpm config set --location=project --json overrides '{...}'`, which writes
pnpm-workspace.yaml.
The same applies to the .npmrc echoes: in v12 node-linker,
package-import-method, user-agent and prefer-symlinked-executables are not read
from there (a hoisted request in .npmrc silently produced an isolated tree, and
the custom user-agent never reached the registry). `pnpm config set` routes each
one to its home - pnpm settings to pnpm-workspace.yaml, registry to .npmrc.
Two consequences of the version bump:
- pnpm is no longer installed from npm. It is a native binary that the `pnpm`
package only fetches from a preinstall script, which newer npm blocks by
default, leaving a placeholder bin behind. `npx get-pnpm` is pnpm's own
installer. It hands off to `pnpm setup`, which writes the PATH entry to
~/.bashrc - a file CircleCI steps never read - so PNPM_HOME is also put on
$BASH_ENV, and SHELL is set because the installer errors without it.
- `strictDepBuilds` is turned off. Dependency build scripts have never run for
the bundle, and v12 fails an install that skips one where v10 only warned.
install_bit_bundle_windows was a copy of install_bit_bundle apart from
--os=win32 and one setting, and its neverBuiltDependencies workaround has no
meaning in v12, where dependency scripts are opt-in. It is merged into
install_bit_bundle behind a prefer_symlinked_executables parameter.
Both platforms were verified end to end against node-registry.bit.cloud: the
install exits 0, the tree is hoisted, every override is applied, the platform's
pnpm-napi.node is present for verify_pnpm_napi_bundle, and pnpm-lock.yaml is
still lockfileVersion 9.0 for the bvm upload.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
PR Summary by Qodoci: migrate CircleCI bundle jobs to pnpm v12 with native config commands
AI Description
Diagram
High-Level Assessment
Files changed (1)
|
Code Review by Qodo
1.
|
The check greps config.yml for the jsonmod-era spelling (`pnpm.overrides.@teambit/harmony" --values "0.4.12"`) and requires two hits, one per bundle-install step. The pin now lives once, as a line of the JSON object handed to `pnpm config set overrides`, so the check reads that spelling and expects a single override. `--fix` rewrites the same line. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
`pnpm setup` installs into $PNPM_HOME/bin, which is the entry setup_pnpm writes to $BASH_ENV. Calling the binary at that path right after the install turns the assumption into a check: a layout change fails the install step with the path it looked at, rather than a later bundle job failing with "pnpm: command not found". Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
Code review by qodo was updated up to the latest commit 8eec7fd |
Updates the CircleCI bundle jobs to pnpm v12 and drops the
pnpm dlxworkarounds that populatedpnpm.overridesinpackage.json.Why the workarounds had to go
pnpm 12 no longer reads the
pnpmfield inpackage.json— it says so outright:So the ten
pnpm dlx @ialdama/jsonmod/pnpm dlx jsoncalls would have produced a bundle with no overrides at all. They are replaced by one native command:The
.npmrcechoes are dead in v12 for the same reason:node-linker,package-import-method,user-agentandprefer-symlinked-executablesare not read from there any more (verified: a hoisted request in.npmrcsilently produced an isolated tree, and the custom user-agent never reached the registry).pnpm config setroutes each setting to its own home — pnpm settings topnpm-workspace.yaml,registryto.npmrc.Two consequences of the version bump
pnpmpackage only fetches from a preinstall script, which newer npm blocks by default — leaving a placeholder bin that dies with a shell syntax error.npx get-pnpmis pnpm's own installer. It hands off topnpm setup, which writes the PATH entry to~/.bashrc(a file CircleCI steps never read), soPNPM_HOMEalso goes on$BASH_ENV;SHELLis set because the installer exits non-zero withERR_PNPM_UNKNOWN_SHELLwithout it.strictDepBuildsis turned off. Dependency build scripts have never run for the bundle, and v12 fails an install that skips one (ERR_PNPM_IGNORED_BUILDS) where v10 only warned. Without this,pnpm add @teambit/biterrors and never writes the dependency topackage.json.Deduplication
install_bit_bundle_windowswas a copy ofinstall_bit_bundleapart from--os=win32and one setting, and itsneverBuiltDependenciesworkaround has no meaning in v12, where dependency scripts are opt-in. It is merged intoinstall_bit_bundlebehind aprefer_symlinked_executablesparameter.Verification
The install command was rendered out of the YAML with its parameters substituted and run for real against
node-registry.bit.cloud, for bothlinux/x64andwin32/x64:uri-js→uri-js-replace, harmony 0.4.12)pnpm-napi.nodeis present, which is whatverify_pnpm_napi_bundlechecks (napi.linux-x64/napi.win32-x64)pnpm-lock.yamlis stilllockfileVersion: '9.0', the format the bvm upload step consumes🤖 Generated with Claude Code