Skip to content

[pull] main from pnpm:main - #431

Merged
pull[bot] merged 4 commits into
dwongdev:mainfrom
pnpm:main
Jul 21, 2026
Merged

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

Conversation

@pull

@pull pull Bot commented Jul 21, 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 : )

Safort and others added 4 commits July 21, 2026 18:34
Port the `view` command (aliases `info`, `show`, `v`) to pacquet: fetch a
package's registry metadata and render a formatted summary, a JSON dump
(`--json`), or selected dotted fields. When the package name is omitted, the
nearest project manifest's name is used, searching upward from `--dir`.

Reuses the existing metadata-fetch stack (full-metadata fetch,
`pick_package_from_meta` version selection, registry/auth resolution) and
assembles the info object from the picked version's raw JSON fragment so
registry key order is preserved in `--json` output. Error codes match pnpm:
ERR_PNPM_MISSING_PACKAGE_NAME, ERR_PNPM_INVALID_PACKAGE_NAME,
ERR_PNPM_INVALID_PACKAGE_JSON, ERR_PNPM_PACKAGE_NOT_FOUND, ERR_PNPM_FETCH_404.

The TypeScript pnpm CLI already ships `view`, so this only adds the pacquet
side; no TypeScript change is needed. Covers the `view` item under the Stage 3
command surface in #11633.

Tests: unit tests for the pure helpers (byte/time/field formatting) plus an
integration suite that drives the built binary against a mockito registry,
covering the upstream view scenarios. `package.yaml` name resolution is left
as an ignored test — pacquet's project-manifest reader is package.json only
today.
Replace the ERR_PNPM_NOT_IMPLEMENTED stub with the npm-style form:
`pnpm version <major|minor|patch|premajor|preminor|prepatch|prerelease>`
and `pnpm version <exact-version>` (a leading `v` is accepted and
stripped, like semver.valid), also recursively with `-r`/`--filter`.
The bare `pnpm version -r` change-intents release flow is untouched.

The bump follows node-semver's inc() with its default identifier base
of 0 — bumping major/minor/patch from a matching prerelease finalizes
it, the pre* types start a `.0` prerelease honoring `--preid`, and
`prerelease` increments the right-most numeric identifier. Options
mirror the TypeScript CLI: `--allow-same-version`, `--message` with
`%s` substitution, `--no-git-tag-version`, `--no-commit-hooks`,
`--sign-git-tag`, `--tag-version-prefix` (default "v"), and `--json`.

The single-package form records the bump as a commit plus an annotated
(or GPG-signed) tag through the same RunCommand capability the publish
git checks use; recursive runs skip the commit and tag since there is
no single version to tag with. The preversion/version/postversion
scripts run through pacquet-executor's run_lifecycle_hook — the same
port of the upstream exec.lifecycle package the TypeScript handler
calls — re-reading the manifest between stages so each hook sees the
right version. Error codes match pnpm: ERR_PNPM_INVALID_VERSION_BUMP,
ERR_PNPM_INVALID_VERSION, ERR_PNPM_VERSION_NOT_CHANGED,
ERR_PNPM_NO_PACKAGES_TO_VERSION, ERR_PNPM_UNCLEAN_WORKING_TREE.

The TypeScript CLI already ships this form, so only the pacquet side
changes; no TypeScript change is needed. Covers the remaining `version`
gap under the Stage 3 command surface in #11633.

Tests: a unit table driving inc() through the node-semver cases, plus
integration tests against the built binary porting the upstream
scenarios from releasing/commands/test/version/index.test.ts and
pnpm/test/version.ts — bumps, preid, JSON output, explicit versions,
same-version handling, lifecycle-hook ordering, the git commit/tag
matrix, and recursive selection with and without --filter.
…teConfig, auditConfig, and auditLevel (#13197)

Introduces two user-facing settings sections in `pnpm-workspace.yaml`, replacing awkwardly named settings:

```yaml
update:
  ignoreDeps: # was updateConfig.ignoreDependencies
    - webpack
    - "@babel/*"

audit:
  level: high # was auditLevel
  ignore: # was auditConfig.ignoreGhsas
    - GHSA-xxxx-yyyy-zzzz
```

- `update.ignoreDeps` — dependency name patterns that `pnpm update` and `pnpm outdated` skip. Equivalent to `updateConfig.ignoreDependencies`.
- `audit.level` / `audit.ignore` — tune `pnpm audit`. Equivalent to the top-level `auditLevel` and `auditConfig.ignoreGhsas`.

The update key is `ignoreDeps` rather than a bare `ignore` deliberately: it names an axis (ignore *by dependency name*), leaving room for a future `update.ignorePaths` / `ignorePackages` (ignore *by workspace package location*) to sit beside it unambiguously — the same split Renovate makes with `ignoreDeps` / `ignorePaths`. `audit.ignore` stays bare because its values are GHSA IDs and there is no competing axis.

## Why

The `Config` suffix on `updateConfig` only exists because the natural name `update` was taken: `opts.update` is the internal boolean that turns an install into an update, threaded through the install machinery right next to `opts.updateConfig`. Users shouldn't pay for that internal collision. `auditConfig` has no such collision — it was named that way purely by symmetry — but it carries the same awkwardness, and its settings were split across a top-level `auditLevel` and a nested `auditConfig`. Grouping them under `audit` is cleaner. And as pnpm grows into a replacement for Renovate/Dependabot, update/audit policy will keep gaining settings, so both deserve clean namespaces to grow into.

## Behavior

- The new sections are honored wherever the old settings are read (`pnpm-workspace.yaml`).
- **Backward compatible**: `updateConfig`, `auditConfig`, and `auditLevel` keep working silently and stay supported until the next major.
- **Precedence**: when both a new section value and its deprecated counterpart are set, the new section wins and a warning is printed (per pairing — e.g. `audit.level` vs `auditLevel` warns independently of `audit.ignore` vs `auditConfig`).
- Putting any of these in the legacy `pnpm` field of `package.json` produces the existing "no longer read, move to pnpm-workspace.yaml" warning.

## Implementation

The translation happens at a single boundary — `getOptionsFromPnpmSettings` in `@pnpm/config.reader` — where the new sections are mapped onto the existing internal `updateConfig` / `auditConfig` / `auditLevel` shapes, so nothing downstream changes.

**Critical correctness property (update only)**: the raw `update` settings object must never reach merged command options, because `opts.update` there is the boolean that would turn a plain `pnpm install` into an update run. The mapping deletes the `update` key from the returned options, guarded by a dedicated regression test (`never leaks the raw "update" key into the options`). `audit` has no equivalent boolean, but its raw key is deleted the same way for cleanliness (also test-guarded).
`pnpm update` gains a `--changeset` flag, an `update.changeset` default in
pnpm-workspace.yaml, and a `--no-changeset` override. After the update, both the
TypeScript CLI and pacquet write one .changeset/pnpm-update-<suffix>.md declaring
a release for every workspace package whose published dependency contract changed.

Rationale: the scheduled-update pnpm/update action generates changesets by
git-diffing package.json files, which cannot see catalog-driven updates -- when
`pnpm update` bumps a catalog entry in pnpm-workspace.yaml, the consuming manifests
only say `catalog:` and never change. Only pnpm can map a changed catalog entry to
its consumers, so the generation lives here.

Semantics:
- changed dependencies / optionalDependencies specs -> patch;
- changed peerDependencies specs -> major (they can invalidate consumers);
- changed catalog specs are attributed to every production or peer consumer,
  including packages outside the --filter selection;
- resolution-only and devDependencies-only movement produces nothing;
- private, unnamed, and changeset-config-ignored packages are skipped;
- missing .changeset/config.json warns and skips; malformed config fails with a
  stable ERR_PNPM_INVALID_CHANGESET_CONFIG error; a symlinked .changeset directory
  is refused and generated files use exclusive creation.

Design notes:
- Both engines snapshot dependency specs and workspace catalogs before their shared
  update pipeline and diff the on-disk state afterward, rather than plumbing
  updatedCatalogs out of the installer -- the disk diff covers the single-project,
  recursive, and pacquet-delegated paths without changing any return contract, and
  structurally cannot observe resolution-only changes, so the specs-only rule holds
  by construction.
- The default is exposed as update.changeset on the canonical `update` section
  (#13197); the never-released updateConfig.changeset spelling needs no back-compat
  alias. It resolves onto the internal updateConfig.changeset the command reads.
@pull pull Bot locked and limited conversation to collaborators Jul 21, 2026
@pull pull Bot added the ⤵️ pull label Jul 21, 2026
@pull
pull Bot merged commit 15c21aa into dwongdev:main Jul 21, 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