Repository navigation
[pull] main from pnpm:main - #394
Merged
Merged
Conversation
…member reachability (#12849) * fix(pacquet): resolve non-npm specifiers in the napi `resolveDependency` `resolveDependency` in the `@pnpm/napi` binding built a bare `NpmResolver`, so any non-npm specifier (a folder path, git URL, `file:` / `link:` / `workspace:` spec, `http(s)` tarball URL, or `<alias>:` named-registry spec) errored with "the specifier was not claimed by the npm resolver". Bit's `resolveRemoteVersion` passes exactly these shapes and expects a manifest back. Mirror the install path's `DefaultResolver` chain (`install_with_fresh_lockfile.rs`): npm -> git -> tarball -> localScheme -> node -> deno -> bun -> namedRegistry -> localPath. The single-resolve path runs the tarball resolver without a fetch context (there is no install store to extract into), and omits the pnpmfile custom resolvers (an install-time concern); everything else matches the install chain, so a folder path resolves to its manifest, a `file:` / `link:` spec resolves to its directory, a git URL pins a commit, and a normal npm spec still resolves as before. An unclaimed spec now surfaces the chain's `SPEC_NOT_SUPPORTED_BY_ANY_RESOLVER` diagnostic. Adds offline unit tests covering the `file:` / `link:` directory cases and the no-resolver-claimed error. * feat(pacquet): support root-component member reachability for hoistingLimits: workspaces Bit's root-components install writes one importer per root under node_modules/.bit_roots/<id> whose manifest injects the root's sibling components as workspace deps and carries installConfig: { hoistingLimits: "workspaces" }. Under nodeLinker: isolated those injected members are materialized as file: deps, each in its own global-virtual-store slot whose node_modules only holds that member's own deps. A realpath-based resolution (Node default) that lands in a member's slot never reaches a sibling, so require of a sibling component throws MODULE_NOT_FOUND even though peer resolution is correct. Parse installConfig.hoistingLimits from the manifest and, after the isolated symlink pass, cross-link every one of a root's injected members into every other member's slot node_modules so the upward walk from any member finds its siblings. The pass is gated on hoistingLimits: "workspaces" (a shape no non-Bit install produces) and is purely additive, so ordinary installs are untouched. Because each root's peer context is folded into its members' slot hashes, two roots get distinct member slots and cross-linking one root can never leak a wrong sibling into another. Wired into both the fresh and frozen isolated paths. * fix(pacquet): honor offline in deno/bun resolvers and dedupe ArcResolver Addresses review feedback on the napi resolver-chain PR. - The resolve chain wired NodeResolver's offline flag but left the deno and bun runtime resolvers fetching GitHub release metadata unconditionally, so an offline resolve could still reach the network for their `runtime:` specifiers. Add an `offline` field (with matching NO_OFFLINE_DENO_RESOLUTION / NO_OFFLINE_BUN_RESOLUTION errors) to both resolvers, short-circuit before any fetch, and set it in both the napi and fresh-install paths so the node/deno/bun trio all fail fast offline. - Replace the two duplicated ArcResolver adapters (napi and package-manager) with a single `impl Resolver for Arc<dyn Resolver>` in resolving-resolver-base. - Add offline unit tests for the deno/bun runtime specifiers and the pre-assertion logging the style guide requires. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]> * fix(pacquet): treat non-reparse-point paths as non-junctions on Windows `is_symlink_or_junction` propagated `junction::exists`'s ERROR_NOT_A_REPARSE_POINT (4390) for a plain directory instead of returning `false`, so the `injected_members_are_cross_linked` test panicked on Windows where it asserts a member's own package dir is not a symlink. Check `Path::is_symlink` first, then map the not-a-reparse-point error from `junction::exists` back to `false`. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]> * fix: reject offline resolution in the deno and bun runtime resolvers The deno and bun runtime resolvers accepted an `offline` flag but ignored it, reaching out to GitHub for release assets even when offline. Fail fast with NO_OFFLINE_DENO_RESOLUTION / NO_OFFLINE_BUN_RESOLUTION instead, matching the Node.js runtime resolver and the pacquet engine. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]> * fix: drop deno/bun runtime-resolver offline gating Reverts the deno/bun offline fail-fast added earlier in this PR. It diverged from the tested behavior: the e2e tests test/install/denoRuntime.ts and test/install/bunRuntime.ts assert that an offline runtime install fails downstream (the "in package mirror" error), and the runtime resolvers intentionally do not short-circuit on `offline` — only the node resolver does, because it reaches the mirror at resolve time. The ArcResolver dedup and test-logging changes are kept. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]> * refactor(pacquet): scope root-component linking to declared siblings Replace the all-to-all cross-link of a root component's injected members with pnpm's per-package child linking: each member's slot `node_modules/` gains symlinks only to the siblings it declares in its own manifest, so a transitive sibling resolves through the chain (comp3 -> comp2 -> comp1) instead of a clique. This mirrors how pnpm's isolated linker wires an injected package's own children and drops the "broader than the declared dependency set" caveat. The member's manifest is the source of truth — it survives Bit's `excludeLinksFromLockfile` / `dedupeInjectedDeps`, where the lockfile edges do not — so the function signature and both install call sites are unchanged. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]> * style(pacquet): add trailing commas to multi-line asserts Satisfies the `perfectionist::macro-trailing-comma` dylint lint on the three multi-line `assert!` invocations in the root-component tests. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]> --------- Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]>
…ce.yaml (#12871) Project-level pnpm-workspace.yaml is repository-controlled and therefore untrusted, so getOptionsFromPnpmSettings refuses to expand ${...} environment-variable placeholders in request-destination fields. The guarded set only covered registry, namedRegistries, and pnprServer; the httpProxy, httpsProxy, and noProxy fields were missing, so a malicious repository could route requests through an attacker-controlled proxy whose URL embedded a secret and exfiltrate install-time secrets before any lifecycle script runs. Add httpProxy, httpsProxy, and noProxy to REQUEST_DESTINATION_SCALAR_KEYS so they receive the same protection already applied to the registry channel, and extend the workspace-yaml request-destination test to cover them. Reported by YESHYUNGSEOK as flaw F01 of GHSA-vx52-2968-3vc6.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 : )