Skip to content

[pull] main from pnpm:main - #524

Merged
pull[bot] merged 15 commits into
dwongdev:mainfrom
pnpm:main
Aug 20, 2026
Merged

pull[bot] merged 15 commits into
dwongdev:mainfrom
pnpm:main

Conversation

@pull

@pull pull Bot commented Aug 20, 2026 •

Copy link
Copy Markdown

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.4)

Can you help keep this open source service alive? 💖 Please sponsor : )

scarab-systems and others added 15 commits August 20, 2026 18:11
Fixes #13526.

Preserve the kept manifest specifier when pacquet update --no-save resolves an admitted requested version into pnpm-lock.yaml.

The update command still rewrites the manifest in memory so resolution can target the requested selector. For --no-save runs, the fresh-lockfile builder now receives a separate per-importer manifest source used only for lockfile importer specifier serialization. This prevents the transient requested version from replacing the user's kept dependency range in the importer entry while still allowing the lockfile package version to move.

The regression covers the reported shape: package.json stays on ^100.0.0, update --no-save --lockfile-only [email protected] resolves 100.1.0 into the lockfile, the importer specifier remains ^100.0.0, and a subsequent frozen install succeeds.

---------

Co-authored-by: Zoltan Kochan <[email protected]>
…rom the packument (#13767)

The old `<version>+<integrity>` config-dependency format was migrated
into the env lockfile with a tarball URL derived from the registry,
the package name and the version, without consulting the packument.
On registries that do not serve tarballs at that path, GitLab's group
endpoint among them, the derived URL 404s, and GitLab redirects
unknown tarball paths to registry.npmjs.org, so a private scope's
request reaches a registry the organisation does not control.

Migrated config dependencies now go through the resolver for their
tarball URL, like clean specifiers, and keep the inline integrity so
the download is still verified against the pinned hash. Deriving the
URL remains the fallback in installConfigDeps for lockfile entries
that record none. Their optional subdependencies stay unresolved, as
before, so a manifest declaring one by range still installs.

A migrated name and version are validated before resolution rather
than at lockfile-write time, so invalid ones are rejected with the
same errors as before.

Closes #13765.

---------

Co-authored-by: Zoltan Kochan <[email protected]>
The package picker and the two bump pickers of `pnpm change` called
checkbox without a pageSize, so each one showed inquirer's default of 7
rows regardless of the terminal height. A workspace with more releasable
packages than that hid the rest behind scrolling.

All three now pass interactivePromptPageSize(), the helper the
interactive update and audit-fix prompts already use, which derives the
page from process.stdout.rows with 7 as the floor.

The Rust change command is unaffected: dialoguer clamps a MultiSelect
page to the terminal height when max_length is unset.

Fixes #13815.

---------

Co-authored-by: Zoltan Kochan <[email protected]>
… environment (#13821)

The config schema typed verify-deps-before-run as Boolean, so parseEnvVars
returned undefined for install/warn/error/prompt and the value was dropped
before it reached the config. Only the lowercase pnpm_config_ env var
survived, through the explicit assignment in updateConfigFromWorkspaceManifest
that keeps the setting's priority right.

Typing it as [Boolean, 'install', 'warn', 'error', 'prompt'] matches the
VerifyDepsBeforeRun type and covers the CLI flag too. Unrecognized values
still parse to undefined and are skipped, as before.

Closes #13816
`pnpm update <pkg>@<version>` re-resolved the dependency graph under the
selected package because the `every(dep => !dep.substring(1).includes('@'))`
guard on the matcher-construction branch (added in 8c1cf25, predating
the matcher's ability to parse `@version`) disabled the per-package match
predicate whenever any selector carried a version. With the predicate
null, the resolver treated every package in reach as an update target and
unrelated transitive deps snapped to their latest in-range version.

The resolver matches update targets by package name, so build the
predicate from the names a selector targets. `parseUpdateParam` strips the
version suffix -- the `createMatcher` used here is the plain glob/exact
matcher from `@pnpm/config.matcher`, not the version-aware one in
`recursive.ts`, so an unstripped `[email protected]` matches nothing. An `npm:`
selector additionally contributes the aliased package's own name, since
that is the name the resolver resolves the edge under; without it,
`pnpm update <alias>@npm:<pkg>@<range>` stops updating whenever the range
already matches the manifest.

The bare-name form was fixed in dcabb78 (#10662); this closes
the versioned-form gap tracked in #13825.

Tests: `update <pkg>@<version> updates only the selected package` and
`update <alias>@npm:<pkg>@<version> updates the aliased package`, each
verified to fail without its corresponding fix.

---------

Co-authored-by: Zoltan Kochan <[email protected]>
…quet) (#13864)

The global config.yaml is parsed into a struct with camelCase fields and
no `deny_unknown_fields`, and the workspace-only fields are then zeroed.
Both passes are silent, so a key that cannot be set in that file and a
key spelled in kebab-case each did nothing and said nothing, while the
TypeScript CLI reports both against the same file.

Report them from pacquet too, with the texts pnpm uses, including the
third message pnpm has for a key no configuration file may set: the
refusal list and whereRefusedKeyBelongs's routes are ported as
refused_keys. What was dropped is read back off the settings after the
clearing pass rather than from a second list of key names: a key serde
did not recognize is missing from the serialized settings, and a key the
clearing pass zeroed is null there, so the report cannot drift from the
struct.

The keys pacquet honors but pnpm's `isConfigFileKey` rejects stay silent.
Warning about a setting that is still honored would be worse than the
silence, and closing that gap is a behavior change rather than a report.
The mirror gap is silent too: a camelCase key pnpm honors in this file
but pacquet does not read yet gets no warning, since the fix for it is
to honor it, not to report it.

Closes #13863

---------

Co-authored-by: Zoltan Kochan <[email protected]>
The pnpm_config environment reader excluded node-version when its npm config schema used a private semver parser. The schema is now parser-supported, but the exclusion remained and caused PNPM_CONFIG_NODE_VERSION to be ignored.

Remove only the stale node-version exclusion. Keep init-version excluded until pnpm and pacquet have matching init config behavior, and keep umask excluded because Number parsing does not preserve npm's octal semantics.

Add regression coverage for environment loading and CLI/environment/manifest precedence.

Related to #11254.

---------

Co-authored-by: Zoltan Kochan <[email protected]>
…yaml (#13849)

allowBuilds replaced onlyBuiltDependencies, onlyBuiltDependenciesFile,
neverBuiltDependencies, and ignoredBuiltDependencies in pnpm 11, but nothing
removed them from pnpm-workspace.yaml, so a workspace migrated from pnpm 10
kept them around looking active even though they're silently ignored.

approve-builds now clears those four keys in the same manifest write that
records allowBuilds, via a new deletedLegacyKeys option on the TypeScript
workspace-manifest writer and a matching set_allow_builds_clearing_legacy
in pacquet's Rust writer.

Fixes #13845

---------

Co-authored-by: Zoltan Kochan <[email protected]>
The scalar-budget regression test built a 96 MB lockfile out of a
million importer lines, so parsing allocated a million AST nodes and
the test ran for many minutes (or timed out) instead of exercising the
one thing it guards: that a document larger than the parser's 64 MiB
default scalar budget still parses. A single 65 MiB scalar crosses the
same budget and parses in under a second.

Also drops a needless `return` in pnpm-fs's is_symlink_or_junction,
uses `.cast()` instead of `as _` for the raw handle passed to
GetFileInformationByHandle in the injected-deps syncer, and extends
the --allow-build merge test with a string-valued allowBuilds entry.

The allowBuilds fix this PR originally carried was superseded by
#13873 (Closes #13872 there).

---------

Co-authored-by: Zoltan Kochan <[email protected]>
…ing version (#13889)

The minimumReleaseAge cutoff filters an immature version out of the
packument and repopulates every dist-tag pointing at it to the newest
mature release below it. For a dependency that is the right answer,
but self-update reads the tag as "which pnpm should I be running", so
a tag pointing at the freshly published version the user already runs
resolved to the previous release and downgraded them: pnpm
self-update next-12 on 12.0.0-rc.4 switched to 12.0.0-rc.3.

The no-downgrade guard added in #11435 does not cover this,
and cannot be widened to every tag without losing the explicit
"pnpm self-update latest" downgrade it deliberately allows.

Self-update now appends the running version to
minimumReleaseAgeExclude before it resolves. That version is already
installed, so the cutoff protects nothing by hiding it, and keeping
it visible pins any tag that points at it or past it to it. Mirrored
in pacquet's resolve_pnpm_version.

Closes #13883.
resolvePlatformSelector took the first entry of each supportedArchitectures
list, so a project with devEngines.runtime and several supported platforms
downloaded the runtime for the first configured OS and CPU rather than for the
host. Each axis now prefers the host's own value when the list allows it, by
naming the value or by naming `current`, and falls back to the first entry only
when the list leaves the host out. pacquet's runtime_platform_selector follows
the same rule.

Closes #13898

---------

Co-authored-by: Zoltan Kochan <[email protected]>
Avoid conditional registry requests when lockfile-derived selector weights prove that a cached version must remain the unique winning range resolution.

Compute a conservative upper bound for every version absent from the cached packument. Reuse cached metadata only when one satisfying lockfile pin has a strictly greater guaranteed weight and the normal picker selects that pin.

Keep cached metadata marked as unverified and re-run the proof for each later range, preventing a proven range from making unrelated ranges trust stale metadata. Preserve online resolution for release-age and trust policies, updates, checksum refreshes, ambiguous selectors, missing pins, and guarded repicks.

Implement the same behavior and safety tests in the TypeScript and Rust resolvers.

Related to #13976.
…th (#14039)

With `node-linker=hoisted`, pacquet's hoister produced broken layouts on graphs with version conflicts. Validated against `@teambit/[email protected]`'s published lockfile by checking the resolution of every (position, dependency) pair of the hoisted tree: **185 wrong resolutions on `main`, 0 with this PR** (plus one inherent ambiguity where two peer-variants of one package version pin different dependency versions due to lockfile drift — the TS CLI merges variants the same way). One real-world symptom: bit's own CI crashing with `ERR_IMPORT_ATTRIBUTE_MISSING` because a conflict-nested ESM `execa` resolved the root's CommonJS `npm-run-path@4` instead of its own `@5`.

### The fixes (all ports of `@yarnpkg/nm` behavior, which the TypeScript CLI delegates to)

1. **Per-path decisions on decoupled copies** (`decoupleGraphNode`): a version-conflicted package shared by several dependents kept its conflicting transitive deps under only one of them; requiring them through any other dependent resolved the wrong root-hoisted version (e.g. `parse-entities@4` → `character-entities-legacy` v1 instead of v3). Shared DAG nodes are now cloned into single-parent copies before mutation, so every parent path gets its own hoist and peer ruling. Same-node dedup and peer-shadow checks compare locators instead of `Rc` identity; cycle edges are cut per path via an aliased-locator guard (`name` + locator, mirroring `aliasedLocatorPath` — an alias edge exposing the same package under a different name is kept).
2. **Peer-variant collapse** (pnpm v11 wrapper's `depPathByPkgId`): peer-resolution variants of one package version now map to the first-seen snapshot key, so the hoister sees one locator per version and dedups the variants. Keeping distinct variant locators both nested wrong copies *and* made the per-path walk explode combinatorially — on bit's lockfile the hoister ran out of memory (2 GB in under 3 s before OOM; 37 MB / 100 ms after).
3. **Shadow gates** (`getNodeHoistInfo`'s "filled by parent" scan and `usedDependencies` gate, in the zero-round variant yarn always uses since it hardcodes `fastLookupPossible: true`): hoisting or dedup is refused when a nearer ancestor holds a different version of the candidate's name, or when the hoist root's subtree already resolves that name through an ancestor directory. Requires `hoisted_dependencies` bookkeeping (each node records what the hoist pass removed from it).
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
@pull pull Bot locked and limited conversation to collaborators Aug 20, 2026
@pull pull Bot added the ⤵️ pull label Aug 20, 2026
@pull
pull Bot merged commit c233e72 into dwongdev:main Aug 20, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants