Skip to content

[pull] main from pnpm:main - #481

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

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

Conversation

@pull

@pull pull Bot commented Aug 5, 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 : )

zkochan and others added 7 commits August 5, 2026 12:48
…13661)

Split the 1899-line `optimistic_repeat_install.rs` into per-subject probe modules (`manifest_agreement`, `settings`, `deps_status`, `local_file_deps`, `timestamps`, `conflict_markers`), leaving the decision itself at 601 lines. Pure code motion; the crate's public surface is unchanged.
…#13658)

Materialize linked snapshot dependencies inside pacquet's virtual-store slots so packages remain self-contained when those slots live outside the project.

Model each resolved link target as a leaf in the TypeScript and Rust dependency graphs. This makes a changed link target affect the recursively computed slot hash of every ancestor while allowing projects that resolve to the same target to keep sharing a slot. Keep the graph extension limited to global-virtual-store hashing so side-effects-cache keys retain their existing behavior.

Thread optional-dependency selection through pacquet's slot materialization and inspect warm slots before reuse. This removes stale optional links under --no-optional and restores them when optional dependencies are enabled again. Preserve transitive optional dependencies during partial installs, where a narrowed direct dependency-group selection does not express --no-optional intent.

Pin the normalization contract with a fixture consumed by both stacks, covering empty targets, parent segments, and Windows drive-letter casing and asserting the final slot hash as well as each synthetic node. Treat missing, dangling, and non-directory expected optional children as a reuse mismatch, detect dangling unexpected entries too, and surface other metadata errors. Run optional-child scans only after the slot passes the cheaper existence and integrity checks.
Split the 1617-line `build_modules.rs` into `allow_build_policy` (build-script permission and dep-path key parsing), `build_one_snapshot` (a single package's build), and `slots` (virtual-store slot location and repair), leaving orchestration in the root at 590 lines. Pure code motion.
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
…13495)

pnpm keeps global packages and configuration in the invoking user's
home directory, so 'sudo pnpm add -g', 'sudo pnpm setup', and
'sudo pnpm self-update' never do what the user wants: they target
root's home and leave root-owned files behind. Other package managers
settled on the same direction - npm 9 removed its SUDO_UID chown
machinery (npm/cli#5710) and tells users not to use sudo, and Homebrew
refuses root outright.

Both stacks detect the same situation: effective uid 0, SUDO_USER
naming a non-root user, and a command that mutates home-directory
state - setup, self-update, or a global write (add, remove, update,
runtime, approve-builds, bare link, config set/delete resolving to
the global scope). They differ only in severity, because refusing
these commands is a breaking change: pnpm v11 warns and names the
v12 removal, so existing provisioning scripts keep working, while
pacquet (v12) fails with ERR_PNPM_SUDO_NOT_SUPPORTED. Read-only
global commands (bin, root, prefix, list, outdated, config get, ...)
still work, and plain root sessions without SUDO_USER are unaffected.

The TypeScript check lives in pnpm11/pnpm/src/checkSudo.ts and runs
once the reporter is initialized, so the warning is not published to
a bus nobody is subscribed to yet. The pacquet check lives in
crates/cli/src/cli_args/sudo_guard.rs and runs before the
pre-command package-manager switch, so pnpm never delegates to a
downloaded CLI as root either.

Related to #13096.
… it is linkable (#13536)

`dirsAreEqual` compared the result of `path.relative()` with `'.'`, but
Node returns `''` for equal paths, so both equality checks in
`storePathRelativeToHome` were always false. The dead branch would have
placed the store in the home directory whenever the project folder was
the only linkable location.

Executing that branch would be the wrong trade. It fires exactly when no
ancestor of the project accepts a hard link — an agent sandbox that
grants write access only to the project, or a container with just the
project bind-mounted writable. There the home store is either read-only,
so the install fails outright, or on another volume, so every package is
copied instead of hard linked and nothing is ever reused. A store on the
project's own volume is the better answer in both cases, so the branch is
removed rather than repaired, and the surviving root guard drops the
helper for a plain string comparison of two `path.join` results.

pacquet implemented the intended-but-dead branch, so it inherited both
failure modes; it now keeps the store in the project too. It places the
store at `<project>/node_modules/.pnpm-store` instead of pnpm 11's
`<project>/.pnpm-store`, which keeps it out of the working tree's VCS
status. The install purge already skips hidden entries other than `.bin`,
`.modules.yaml`, and the virtual store dir, so a layout change cannot
wipe the store; `test_install_purges_node_modules_on_layout_mismatch` now
pins that.

Closes #13525
)

`resolveDependency` derived `filter_metadata` from `full_metadata`, so a
caller asking for full metadata got a manifest run through `clear_meta` —
reduced to npm's abbreviated version fields. Registry-custom fields were
dropped, which broke Bit's `componentId` lookups ("the package.json of
version X has no componentId field").

The API this replaces, `createClient({ fullMetadata: true })`, leaves
`filterMetadata` unset and keeps the document whole; only the install
path pairs the two flags, where nothing outside the abbreviated set is
read. Untangle them here.
@pull pull Bot locked and limited conversation to collaborators Aug 5, 2026
@pull pull Bot added the ⤵️ pull label Aug 5, 2026
@pull
pull Bot merged commit 34347bc into dwongdev:main Aug 5, 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.

2 participants