Repository navigation
[pull] main from pnpm:main - #525
Merged
Merged
Conversation
Retain pending build approvals for packages that remain installed after `pnpm remove`. This keeps previously ignored builds eligible before merging new build results, and mirrors the behavior in the Rust path. Closes #13891. --------- Co-authored-by: kuanghuangshuo <[email protected]> Co-authored-by: Zoltan Kochan <[email protected]>
When update resolves a prerelease dependency, preserve the range style already declared in the manifest in both the TypeScript and Rust implementations. Newly added prerelease dependencies remain pinned exactly. The TypeScript calcVersionRange serves plain update, re-add of a declared dependency, and update --latest, so all three preserve the style. pacquet routes those paths through a new calc_version_range helper mirroring it, replacing the duplicated decision (PackageVersion::serialize is removed). Add shared-fixture unit and end-to-end coverage for the prerelease update path. Fixes #7002. --------- Co-authored-by: Zoltan Kochan <[email protected]>
pnpm resolves the command name before parsing argv: getCommandName in @pnpm/parse-cli-args maps an `install` that carries a package name to `add`, which is why `pnpm i valibot` saves the dependency. Clap scopes positionals to the subcommand that declares them, and `install` declares none, so the same command line aborted with "unexpected argument" (Closes #13886). The new `install_as_add` pass renames the subcommand token in argv, so `add`'s grammar parses the rest of the line, aliases and all. It sits after `relocate_pre_subcommand_flags` in the pre-clap chain, which means options written ahead of the subcommand have already moved behind it and the scan for a package name cannot trip over an option's value. Command and arity lookups both come from the clap tree rather than a hand-written list of names, so `install-test` and `pnpm install --reporter silent` are left alone. The scan for a package name follows nopt across the `--` terminator: nopt strips it and keeps what follows as positionals, so `pnpm install -- <pkg>` maps to `add` too, matching the TypeScript CLI. --------- Co-authored-by: Zoltan Kochan <[email protected]>
) `pnpm config get registries` printed `undefined`: the reader splits the setting into internal lookups and deletes the raw key. The same translate-and-delete pattern hid `update` and `audit`, whose deprecated internal spellings were the only readable names, and pacquet's config record diverged from the TypeScript CLI on a dozen keys. Both CLIs now answer the documented names with the settings they act on, and print byte-identical JSON: - `registries`: the resolved view, merged across every source, keyed by registry URL with the default registry as the bare `@` scope and the built-in routes (the `@jsr` scope, the `npmjs` / `gh` prefixes) declared unless pointed elsewhere. Built on the existing pnpr-request rebuilder (`toRegistryDeclarations` / `registries::to_declarations`), with a canonical key/field/scope order. The internal lookups (`registriesByScope`, `registriesByPrefix`, `registryOptionsByUrl`) leave the record. `BUILTIN_REGISTRIES_BY_PREFIX` and the JSR default moved from the npm resolver into `pnpm-config` so both layers consult one constant. - `update` / `audit`: re-joined from `updateConfig` and `auditConfig`/`auditLevel`, whichever spelling set them; the deprecated spellings leave the record. Pacquet mirrors `audit.level` into its explicit `auditLevel` entry so `config get audit-level` answers the way the TypeScript CLI does. - Pacquet record holes: `packages`, `catalog`, `catalogs` (shown merged, with the singular `catalog` block as its `default` entry), `onlyBuiltDependencies`, `neverBuiltDependencies`, and `ignoredBuiltDependencies` are now carried by `WorkspaceSettings` for display only; the global config.yaml refuses them via the existing workspace-only clearing. - Pacquet answered `undefined` for `registry` and `@jsr:registry` where the TypeScript CLI answers the built-in defaults; the JSR default registry moved from the npm resolver into `pnpm-config` so both consult one constant. `patchedDependencies` now displays workspace-resolved paths, matching the TypeScript record. - `RegistryDeclaration` serialization skips absent fields, so pacquet's pnpr requests stop sending nulls the TypeScript CLI's requests omit.
getConfig derived extraEnv.NODE_PATH from `lockfileDir ?? dir`, but sharedWorkspaceLockfile only set lockfileDir from workspaceDir further down the function. Run from a workspace package, NODE_PATH therefore pointed at that package's non-existent virtual store instead of the workspace root's, and scripts could not resolve dependencies that live only in the hoisted store. The lockfileDir assignment now happens before extraEnv is built; no other read of lockfileDir sits between the two positions. Closes #13912 --------- Co-authored-by: Zoltan Kochan <[email protected]>
…13887) A packages: entry pointing outside the workspace root (../shared, ../../docs/*) was silently dropped from the project list. normalize_manifest_patterns turns it into ../shared/package.json and hands it to wax, whose globs cannot express parent traversal, so a walk rooted at the workspace root matched nothing and raised no error. The declared project never reached the install's project list, which is what trusted_importer_ids is built from, so a lockfile pnpm 11 wrote for the same workspace failed with ERR_PNPM_PACKAGE_MANAGER_UNSAFE_IMPORTER_PATH on its ../shared importer key. pnpm list -r and --filter did not see the package either. Discovery now strips the leading ../ components off each normalized pattern and starts the walk from the ancestor they name, keeping the glob handed to wax traversal free. A pattern that climbs past the filesystem root matches nothing. A walk can therefore start above the workspace root, while a ! pattern stays written relative to the workspace root, so user negations moved out of Walk::not and are matched against each entry's path from the workspace root instead. pacquet only: the TypeScript CLI globs through tinyglobby, which handles the parent-relative form already. Closes #13880. --------- Co-authored-by: Zoltan Kochan <[email protected]>
Fixes #13924 ## Summary - Write tar entries in the full POSIX ustar header form npm and pnpm 11 emit: `Header::new_ustar` for the `ustar\0` magic and `00` version, plus an explicit `0` regular-file typeflag (the typeflag byte stays NUL otherwise). - Add a regression test that pins the raw typeflag, magic, and version header bytes, since tar readers accept every header form and decoded values would not catch a format regression. - Add the required pacquet patch changeset, and `typeflag` to the cspell dictionary. --------- Co-authored-by: Zoltan Kochan <[email protected]>
…y> (#13930) `ConfigOverrides` re-applies only an allowlist of `--config.<key>` tokens after the file-based config layers run, and the minimum-release-age settings were missing from it. When pnpm parses the token and delegates, dropping it costs nothing: the pacquet leg falls back to the value pnpm already honored. When the binary is the entrypoint there is no other leg, so the override is lost and the install silently uses the yaml value or the 24 hour default (Closes #13929). Port `minimum-release-age`, `minimum-release-age-exclude`, `minimum-release-age-ignore-missing-time` and `minimum-release-age-strict`, the same four keys the PNPM_CONFIG_* overlay reads. The exclude list is appended to when the token repeats, matching how nopt collects a repeated key it has no type for. The four keys also land in `Config::explicit_settings`, pacquet's stand-in for pnpm's `explicitlySetKeys`, which the yaml and env layers already feed. Otherwise a CLI-set `minimumReleaseAge` would record a different `minimumReleaseAgeStrict` in the workspace state than the same value in `pnpm-workspace.yaml`. Reading these keys from `.npmrc` stays unsupported, matching pnpm 11, which only reads auth, registry and proxy keys from there.
#14040) `pacquet update <alias>@npm:<pkg>@<range>` left the aliased package on its pin: the matched direct dependencies went into `drop_names` under their manifest key, which is the alias, while `is_update_target` matches `real_package_name_of(..)` and `subtree_fully_reusable` matches `key.name` — both the resolved package name. An aliased package therefore never matched its own drop entry and kept its seeded resolution. `update_target_name` derives the name from the selector that claimed the dependency, so an `npm:` (or `jsr:`) selector contributes the package it installs. It skips a selector whose derived name is just the alias again, so an earlier `*` cannot shadow a later `<alias>@npm:<pkg>` — the `requested` lookup beside it takes the first match and would have missed the expansion. `real_package_name_of` is promoted to the resolver crate's public API rather than reimplemented: it is the function the reuse matching already keys on, and it carries the `npm:<range>`-keeps-the-alias and `jsr:` cases a second parser would have to repeat. The changeset pending from #13826 is amended to name `pacquet` and describe the alias behavior, rather than adding a second changeset for the same user-visible change. Test: `update_npm_alias_selector_targets_the_aliased_package` pins the aliased package through a direct exact entry, drops the entry so only the alias holds it, and asserts the selector moves it — verified to fail without the fix. Five unit tests cover the name derivation. Follow-up to #13826. Related to #13825.
Cloned the manifest and its dependency properties in createVersionsOverrider to avoid mutating the cached manifest in-place. Resolves #13918 --------- Co-authored-by: Zoltan Kochan <[email protected]>
The prefer-symlinked-executables key was recognized by the config parser but had no behavior. Now: (1) Config grows a tri-state prefer_symlinked_executables (None = unconfigured, defaulted to true by the hoisted nodeLinker after extraEnv is built, so the derived default symlinks bins without exporting NODE_PATH — the same ordering pnpm's config reader has); (2) Config::current exports NODE_PATH=<virtual-store-dir>/node_modules on Unix when the setting is explicitly true, anchored at the workspace root via the existing virtual_store_dir re-anchor (the semantics pnpm restored in #13913); (3) write_shim gains a symlink branch modeled on link_node_bin that materializes each bin as a relative symlink plus a chmod of the target, with warm-install idempotency and tolerated dangling targets, inert on Windows; (4) the linker's extra_node_paths parameter is folded into a LinkBinsOptions struct produced by the shim_link_options bridge, with global/self-update/engine-pm/ injected-deps call sites keeping default options like their TypeScript counterparts. Related to #13912.
The global config file's unknown-key warning claimed every dropped key could be moved to a project-level pnpm-workspace.yaml. For a key this version of pnpm does not read at all — a typo, or a setting of another release line sharing the file, like pnpm v12's globalShims — that advice was wrong twice over: the project file ignores the key too, and for a cross-version setting the right action is to change nothing. Both stacks now classify dropped keys against the union of every known setting name and report unrecognized ones with their own message, naming the release line that reads the key or the closest real setting name when the key looks like a typo. Unrecognized and non-camelCase keys in a project's pnpm-workspace.yaml, previously ignored in silence, get the same report; in the TypeScript CLI the known-key set is proven exhaustive against the Config type at compile time, so a newly added setting cannot start out reported as unknown. pacquet hardens the project-file report into ERR_PNPM_UNRECOGNIZED_WORKSPACE_SETTINGS when the project pins a pnpm the running pnpm satisfies: with the pin honored, no version-skew excuse remains, so the key is a mistake the project must fix. The pnpm config subcommands never hard-fail (a broken file must stay inspectable and repairable), a satisfied pin behind --global only warns, and the enforcement runs after the pm-switch decision so a delegating pnpm never judges the file with the wrong version's key set. pnpm config get <key> (and pnpm get <key>) no longer prints config-load warnings in either stack: single-key reads are consumed by scripts, and the noise on every read is the complaint that started this change.
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 : )