Commit Graph

564 Commits

Author SHA1 Message Date
Zoltan Kochan
3937b441cb chore(release): 10.34.1 (#12008) 2026-05-28 00:51:17 +02:00
Zoltan Kochan
1de167838c chore(release): 10.34.0 (#11988) 2026-05-27 14:58:46 +02:00
Zoltan Kochan
ff3304fcb3 chore(release): 10.33.4 2026-05-06 15:00:18 +02:00
Zoltan Kochan
edbe2a7c9b fix: pin integrity of git-hosted tarballs in lockfile (#11491)
Cherry-pick of #11481 from main, adapted to the v10 layout.

For git-hosted tarballs (codeload.github.com / gitlab.com / bitbucket.org)
the fetcher dropped the integrity it computed while downloading, so the
lockfile only stored the URL. A compromised git host or man-in-the-middle
could serve a substituted tarball on subsequent installs and pnpm would
install it without lockfile changes.

This pins the SHA-512 SRI of the raw tarball in the lockfile in the same
sha512-<base64> form npm-registry tarballs use; subsequent installs verify
the download against that integrity in the worker.

A new optional gitHosted: boolean field is recorded on TarballResolution
so every store-key consumer can route by a single typed read instead of
re-deriving the routing from the URL. Lockfiles written by older pnpm
versions are enriched on load (URL fallback) so the field can be relied
on uniformly.

🤖 Cherry-picked by Claude (claude-opus-4-7) on behalf of @zkochan
2026-05-06 14:28:42 +02:00
Zoltan Kochan
2a1ffe1956 chore(release): 10.33.2 2026-04-23 13:39:20 +02:00
Zoltan Kochan
08bf69c811 fix: prevent fork-bomb during packageManager-driven version switching (#11346)
* fix: prevent fork-bomb during packageManager-driven version switching

When pnpm was installed via one method (e.g. `npm install -g pnpm@A`)
and run in a project whose package.json's packageManager field selected
a different pnpm version (pnpm@B), and a pnpm-workspace.yaml existed at
the project root, the install-child spawned by `installPnpmToTools` to
fetch pnpm@B inherited a cwd under the pnpm home directory. pnpm's
workspace walk-up from there discovered the ancestor pnpm-workspace.yaml,
adopted the root package.json, and re-triggered switchCliVersion inside
the child. Because the target tool dir had not yet been symlinked in, the
recursive installPnpmToTools call saw alreadyExisted === false and kicked
off another nested install, recursing forever at 100% CPU.

Force the install-child's environment to disable its own version handling:
- `npm_config_manage_package_manager_versions=false` (v10 setting name)
- `pnpm_config_pm_on_fail=ignore` (v11+ setting name)

Also set the v11 setting on the final spawn at the end of switchCliVersion,
so when v10 hands off to a v11 target the child's check/download paths stay
disabled regardless of which env-var convention the child reads.

Closes #11337.

* test: add v11-switch and same-version regression tests for #11337

- v11 switch with a root pnpm-workspace.yaml: covers the primary #11337
  reproducer (target major differs from running major). Before the fix this
  fork-bombed via the install-child's workspace walk-up; now it reaches the
  terminal spawn and `installPnpmToTools` completes.
- Same-version short-circuit: with a root pnpm-workspace.yaml and
  `packageManager: pnpm@<current>`, `switchCliVersion` must return at the
  `pm.version === packageManager.version` guard, and the tool dir must not
  be created. Guards against a future regression where the ancestor
  pnpm-workspace.yaml alone accidentally triggers an install.

* fix(installPnpmToTools): isolate the install-child from the caller's workspace

Pass `--ignore-workspace` to the child pnpm so it doesn't walk up from the
stage directory and adopt the caller's pnpm-workspace.yaml as its own root.
That walk-up was both (a) the mechanism that caused the #11337 fork-bomb
(the child would rediscover the caller's packageManager field and re-enter
switchCliVersion) and (b) a correctness problem in its own right: once the
child treats the caller's project as its workspace, `pnpm add` runs with
semantics that don't match an isolated tool-dir install. The env-var guards
from the previous commit stay in place as a defense-in-depth measure in
case any future code path surfaces a wantedPackageManager without going
through workspace discovery.

Also fold the new v11-switch regression into the existing v11 test rather
than adding a second v11 install, so CI doesn't fetch pnpm@11.0.0-rc.5
from the real npmjs registry twice. The tool-dir assertion in that test
now doubles as a fork-bomb regression check for the v11-target path.
2026-04-23 13:27:49 +02:00
Zoltan Kochan
948bd8c7c5 chore(release): libs 2026-04-14 10:48:26 +02:00
Zoltan Kochan
be07631710 chore(release): 10.33.0 2026-03-24 17:15:56 +01:00
Zoltan Kochan
7df00bc3db fix: use ENOENT check instead of which.sync for command-not-found on Windows (#11004)
Cherry-picked from main (e9318ce974).
2026-03-24 15:57:06 +01:00
Zoltan Kochan
cb17c44e55 fix(dlx): fix race conditions in parallel dlx calls sharing
Global Virtual Store (#10939)

Content-verified skip in GVS mode, tolerate EPERM during
bin creation on Windows, handle EPERM in DLX cache symlink.

(cherry picked from commit 62f760ec3d)
2026-03-12 21:19:29 +01:00
Zoltan Kochan
eaae772717 chore(release): 10.32.1 2026-03-11 02:25:40 +01:00
Zoltan Kochan
49d249bf7f chore(release): 10.32.0 2026-03-09 22:43:09 +01:00
Zoltan Kochan
f733456bfb revert: "fix: explicitly tell npm the config file path (#10154)"
This reverts commit c6cbb25f82.
2026-03-09 22:22:46 +01:00
thilllon
39aa198567 feat(approve-builds): add --all flag to skip interactive prompts (#10619)
Allow approving all pending build dependencies at once without
interactive selection, useful for CI/CD pipelines and project
bootstrapping scenarios where interactive prompts are not feasible.

close #10136
2026-03-08 11:44:22 +01:00
Zoltan Kochan
229c244e64 chore(release): 10.31.0 2026-03-08 00:30:23 +01:00
Ishan Gupta
9c7b3cabab fix(dlx): print help message when no arguments are provided (#10690)
* fix(dlx): print help message on calling pnpm dlx without arguments

Running `pnpm dlx` with no arguments would crash Node.js with a
TypeError as it attempted to call `.indexOf()` on an undefined variable.
This commit adds a guard clause and displays the help message instead
and exits gracefully.

Fixes #10633

* refactor: dlx

---------

Co-authored-by: Zoltan Kochan <z@kochan.io>
2026-03-07 23:02:51 +01:00
btea
e5fab27321 fix: sync --allow-build flag value to allowBuilds (#10343)
* fix: sync `--allow-build` flag value to `allowBuilds`

* feat: rename

* fix: update

* chore: reset

* fix: update

* fix: test

* fix: update

* fix: update
2026-03-07 23:02:51 +01:00
Khải
c6cbb25f82 fix: explicitly tell npm the config file path (#10154)
* fix: explicitly tell npm the config file path

* fix: `managingAuthSettings`

* feat: other `npm` call-sites

* docs: changeset

* fix: make optional again

* feat: remove the change from `publish`

* fix: eslint

* refactor: just one is sufficient
2026-03-07 23:02:51 +01:00
Zoltan Kochan
2a56acc1b2 chore(release): 10.30.2 2026-02-24 00:36:58 +01:00
Zoltan Kochan
958ab703d1 chore(release): libs 2026-02-17 16:44:04 +01:00
Zoltan Kochan
d12c9028ec chore(release): 10.30.0 2026-02-17 15:49:12 +01:00
Zoltan Kochan
f001ab770f chore(release): 10.29.3 2026-02-11 13:07:10 +01:00
Ryo Matsukawa
0d3798c216 fix(dlx): respect minimumReleaseAgeExclude (#10572)
close #10338
2026-02-11 02:35:44 +01:00
Zoltan Kochan
ea870c786f chore(release): 10.29.2 2026-02-09 02:22:45 +01:00
Zoltan Kochan
11202fc1ed chore(release): 10.29.0 2026-02-07 17:51:43 +01:00
Maikel van Dort
6065d2e196 feat: dlx timeout & retry (#10512) 2026-02-06 20:02:11 +01:00
Maikel van Dort
69dc1bf336 feat: add support for catalogs with dlx (#10434)
* feat: add support for catalogs with dlx

* fix: feedback

* Update .changeset/curly-dryers-jam.md

Co-authored-by: Brandon Cheng <gluxon@users.noreply.github.com>

* Update .changeset/curly-dryers-jam.md

Close #10249

Co-authored-by: Brandon Cheng <gluxon@users.noreply.github.com>

---------

Co-authored-by: Brandon Cheng <gluxon@users.noreply.github.com>
2026-02-06 20:01:26 +01:00
Zoltan Kochan
89a2c4ec38 chore(release): 10.28.2 2026-01-26 15:17:27 +01:00
Zoltan Kochan
0b5a56aaec chore(release): 10.28.1 2026-01-19 12:12:58 +01:00
Oleg Pustovit
85416ea581 fix(run): fail when no packages have script in filtered recursive run (#10437)
* fix(run): fail when no packages have script in filtered recursive run

Previously, `pnpm run -r <script>` and `pnpm run --filter <filter> <script>`
would silently succeed with exit code 0 when no packages had the specified
script, as long as a filter was used. This was inconsistent with the
documentation which states "If none of the packages have the command, the
command fails."

This change makes the command fail with ERR_PNPM_RECURSIVE_RUN_NO_SCRIPT in
all cases where no packages have the script, regardless of whether a filter
is used. The `--if-present` flag can be used to suppress this error.

close #6844
2026-01-16 01:53:37 +01:00
Zoltan Kochan
9cbba288fc fix(exec): preserve user execution cwd (#10445)
close #5759
close #10403
2026-01-16 01:52:31 +01:00
Zoltan Kochan
91a241e692 chore(release): 10.28.0 2026-01-09 23:47:40 +01:00
Zoltan Kochan
f022a1b29a fix: setting requiredScripts in pnpm-workspace.yaml (#10404)
close #10261
2026-01-04 16:45:44 +01:00
Zoltan Kochan
6bdba72ad3 chore(release): 10.27.0 2025-12-30 21:49:41 +01:00
Zoltan Kochan
8ec7939657 chore(release): 10.26.2 2025-12-23 14:34:19 +01:00
Zoltan Kochan
1e5643fcda test: making the rebuild tests stable 2025-12-23 13:39:41 +01:00
月正海角
71624c9384 feat: improve error message for versions not meeting minimumReleaseAge (#10350)
close #10307
2025-12-23 12:31:08 +01:00
Zoltan Kochan
4986c46b48 chore(release): 10.26.1 2025-12-19 01:48:40 +01:00
Zoltan Kochan
244e33b4e9 chore(release): 10.26.0 2025-12-15 12:10:26 +01:00
Oren
40775391d5 fix(git-fetcher): block git dependencies from running prepare scripts unless allowed (#10288)
* fix(git-fetcher): block git dependencies from running prepare scripts unless allowed

* Update exec/prepare-package/src/index.ts

Co-authored-by: Zoltan Kochan <z@kochan.io>

* Also implement in gitHostedTarballFetcher

* refactor: move allowBuild function creation to the store manager

* refactor: pass allowBuild function to fetch function directly

* refactor: revert not needed changes and update changesets

* test: fix

* fix: implemented CR suggestions

* test: fix

* test: fix

---------

Co-authored-by: Zoltan Kochan <z@kochan.io>
2025-12-10 00:51:43 +01:00
Zoltan Kochan
b0cd2dea48 chore(release): 10.25.0 2025-12-08 15:33:42 +01:00
Zoltan Kochan
9b05bdd7e1 fix: reporting ignored dependency builds (#10276) 2025-12-06 16:43:42 +01:00
Zoltan Kochan
7c15c93c26 chore(release): libs 2025-12-02 16:02:38 +01:00
Zoltan Kochan
033a2561eb fix: dependencies that were added to onlyBuiltDependencies should be built on install (#10256) 2025-12-02 15:36:29 +01:00
Zoltan Kochan
16d08d0cb0 chore(release): 10.24.0 2025-11-27 14:53:58 +01:00
Zoltan Kochan
603aedae0a chore(release): 10.23.0 2025-11-20 14:46:54 +01:00
Zoltan Kochan
1de6d19f59 chore(release): 10.22.0 2025-11-12 14:13:12 +01:00
Zoltan Kochan
2e2dc27d07 chore(release): 10.21.0 2025-11-09 23:45:04 +01:00
Ryo Matsukawa
68ad0868b4 feat: add support for npm package trust evidence check via a new trustPolicy setting (#10103)
close #8889

---------

Co-authored-by: Zoltan Kochan <z@kochan.io>
2025-11-09 23:32:56 +01:00
Zoltan Kochan
5847af412b feat: install js runtime as prod dependency (#10141) 2025-10-31 17:15:38 +01:00