Repository navigation
[pull] main from pnpm:main - #513
Merged
Merged
Conversation
pnpm update -g --latest built each global group's install selectors by collapsing every dependency to its bare alias so the latest version is resolved from the registry. Packages installed with `pnpm add -g .` or `pnpm link -g` are recorded with a link:/file: spec, so the collapse sent their name to the registry, which fails with ERR_PNPM_FETCH_404 for private packages, and the sequential group loop then aborted the update of every remaining global package as well. Local specs (link:/file:) now keep the alias@spec selector form the non-latest path already uses, so they are relinked as-is while registry packages still update to latest. Implemented in both the TypeScript CLI and the Rust port. Closes #12854 --------- Co-authored-by: Zoltan Kochan <[email protected]>
…age must win (#13717) With `preferWorkspacePackages`, the gate in `resolveNpm` that prefers a workspace package fires whenever a local version satisfies the spec, no matter what the registry returned. The request that precedes it is pure latency: its result is discarded. Workspaces that declare inter-workspace dependencies with plain ranges ("*", "^1.2.3") instead of the `workspace:` protocol therefore pay one round-trip per workspace package name on every install. Workspace packages that were never published pay a 404 every time, because negative results are not cached. Skip the request when the outcome is already determined: - `preferWorkspacePackages` is on, so the gate ignores the registry's version. - Exactly one workspace copy carries the name. With several copies the exact-match gate can select a different one via `pickedPackage.version`, which needs the registry. - The dependency is not injected. Injected packages resolve to a `file:` id, which `packageRequester` does not mark `isLocal`, so they keep flowing through the registry bookkeeping that reads `latest`. - `trustPolicy` is not 'no-downgrade', which validates registry metadata even when a workspace package wins. - `updateChecksums` is off, since that asks the resolver to rewrite cached metadata. The fast path sits after the store peek so a lockfile-recorded resolution keeps its precedence. `update` is deliberately not excluded: it does not change which local version is chosen, and `wantedDepIsLocallyAvailable` forces `update` on for exactly the workspace deps this targets, so gating on it would leave the path almost never reachable. Measured on a 250-project monorepo whose workspace deps use "*": an incremental install goes from ~200 registry requests, all 404s for unpublished workspace packages, to 1.
Source the fallback for an omitted setting from the config's own defaults rather than a hardcoded copy of them, and restore the rationale for gating the input-lockfile fallback on a frozen request. Send the three settings inline like every other optional field of the resolve request: the server reads an explicit null the same as an absent key, so the manual inserts bought nothing. Give the resolver settings their own forwarding test instead of folding them into the verification-policy one. --------- Co-authored-by: Zoltan Kochan <[email protected]>
… as a one-entry list (#13737) `trustPolicyExclude` and `minimumReleaseAgeExclude` are declared as `[String, Array]`, so a single .npmrc line, env var, or YAML scalar arrives as a bare string. `createPackageVersionPolicy` iterated it and built one rule per character: the exclusion never matched the package it named, and a `*` anywhere in the value matched every package, silently switching the policy off. --------- Co-authored-by: Zoltan Kochan <[email protected]>
`resolutionMode: time-based` needs each version's publish time, which
`registry.npmjs.org` omits from abbreviated metadata, so pnpm falls back
to the far larger full packument. `registrySupportsTimeField` answered
that question for every registry at once, which is wrong in both
directions for a project that resolves from more than one: it either
buys full metadata from a registry that does carry `time`, or claims a
`time` field npmjs does not serve.
A registry entry now carries `supportsTimeField`, and the fallback is
decided per registry:
resolutionMode: time-based
registries:
https://npm.internal.example/:
supportsTimeField: true
The resolver asks a `needsFullMetadataFor(registry)` callback where it
used to read a single `fullMetadata` flag; the metadata mirror path and
the cache key are already keyed by registry, so two registries can
disagree within one install. A registry that declares nothing answers
exactly what the global setting says, so nothing changes unless a
project describes a registry.
The declaration reaches a pnpr server too — it already inverts the
client's `registries` through the same lookups, so a pnpr-served resolve
applies it to the resolution it runs on the caller's behalf.
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 : )