Commit Graph

577 Commits

Author SHA1 Message Date
Zoltan Kochan
5979bb7b0c test: replace sinon with built-in jest spying across the repo (#10849)
Replace all sinon.spy/match/withArgs usage with jest.fn, toHaveBeenCalledWith,
mockClear, and mock.calls filtering. Remove sinon and @types/sinon from all
package.json files and the workspace catalog.
2026-03-04 15:00:25 +01:00
Zoltan Kochan
543c7e4bae feat: use global virtual store for global packages and dlx (#10694)
* feat: use global virtual store for global packages and dlx

* fix(config): remove unnecessary virtualStoreDir override for global installs

When the global virtual store is disabled, the default `node_modules/.pnpm`
path works fine — no need to explicitly override it to `.pnpm`.
2026-03-01 18:03:04 +01:00
Zoltan Kochan
fd511e4676 feat: isolated global packages (#10697)
**TLDR:** Global packages in pnpm v10 are annoying and slow because they all are installed to a single global package. Instead, we will now use a system that is similar to the one used by "pnpm dlx" (aka "pnpx").

Each globally installed package (or group of packages installed together) now gets its own isolated installation directory with its own `package.json`, `node_modules`, and lockfile. This prevents global packages from interfering with each other through peer dependency conflicts or version resolution shifts.

## Changes

- Add `@pnpm/global-packages` shared utilities package for scanning, hashing, and managing isolated global installs
- `pnpm add -g` creates isolated installs in `{pnpmHomeDir}/global/v11/{hash}/`
- `pnpm remove -g` removes the entire installation group containing the package
- `pnpm update -g` re-installs into new isolated directories and swaps symlinks
- `pnpm list -g` scans isolated directories to show installed global packages
- `pnpm outdated -g` checks each isolated installation for outdated dependencies
- `pnpm store prune` cleans up orphaned global installation directories

## Breaking changes

- `pnpm install -g` (no args) is no longer supported — use `pnpm add -g <pkg>`
- `pnpm link <pkg-name>` no longer resolves packages from the global store — only relative or absolute paths are accepted
- `pnpm link --global` is removed — use `pnpm add -g .` to register a local package's bins globally
2026-03-01 15:49:18 +01:00
Ishan Gupta
f8367e88d2 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-02-28 02:02:53 +01:00
thilllon
2e8816e83b 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-02-25 11:36:49 +01:00
Zoltan Kochan
6ea94ea5eb refactor: remove last mentions of use-node-version (#10674) 2026-02-23 08:24:16 +01:00
Zoltan Kochan
e18a879d72 feat!: drop Node.js 22.12 support 2026-02-18 14:54:09 +01:00
Zoltan Kochan
56a59df674 perf: persist bundled manifest in store index to avoid reading package.json from CAFS (#10473)
close #10461
2026-02-17 12:03:08 +01:00
Ryo Matsukawa
fa5ff08473 fix(dlx): respect minimumReleaseAgeExclude (#10572)
close #10338
2026-02-11 02:32:54 +01:00
Brandon Cheng
1a5b5beea2 build: replace ts-jest with simple transformer (#10579)
* test: use `import type` in more places

Several tests are failing because a module isn't being mocked. This is
due to the mocked module being imported before the mock being set up.

Switching to `import type` should elide the import fully.

* build: replace ts-jest with simple transformer

* chore: remove `ts-jest`

* chore: remove babel dependencies from root project

* ci: use Node.js 22.13.0 (instead of 22.12.0)

Node.js 22.13.0 introduces the `stripTypeScriptTypes` function

* fix: copilot feedback
2026-02-09 11:35:22 +01:00
Zoltan Kochan
1b4df57a01 feat!: drop Node.js 20 and 21 support (#10569) 2026-02-08 19:16:24 +01:00
Zoltan Kochan
57e99b6996 chore: update pnpm-lock.yaml (#10558)
---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2026-02-06 03:28:39 +01:00
Johan Quan Vo
7b1c189f2e feat!: remove deprecated patch options (#10505)
* refactor: remove allowNonAppliedPatches

* refactor: remove ignorePatchFailures

* refactor: remove `strict` field in groupPatchedDependencies

* test: update test failure in package patching

* test: fix

* docs: update changesets

---------

Co-authored-by: Zoltan Kochan <z@kochan.io>
2026-01-27 17:08:45 +01:00
Maikel van Dort
f3cd9f7c05 feat: dlx timeout & retry (#10512) 2026-01-27 01:37:26 +01:00
Maikel van Dort
8eee41691c 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-01-26 07:06:36 +01:00
Zoltan Kochan
e2e0a321b3 perf: optimize how the integrities of files in the CAFS are stored (#10504) 2026-01-24 21:41:11 +01:00
Zoltan Kochan
40b107efa7 perf: migrate internal cache and index files to MessagePack serialization (#10500) 2026-01-23 01:31:09 +01:00
Zoltan Kochan
e3b35b6f37 style: update eslint to v9 (#10474) 2026-01-17 12:01:23 +01:00
Oleg Pustovit
46de860489 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:49:24 +01:00
Zoltan Kochan
a8fe2d5298 feat!: remove the server command (#10463) 2026-01-15 11:32:07 +01:00
Zoltan Kochan
a00f9e515c chore: use typescript-go (#10452) 2026-01-14 01:18:13 +01:00
Zoltan Kochan
da112f7cb2 revert: "perf: use v8 serialize/deserialize instead of JSON (#9971)" (#10420)
close #10409
2026-01-13 15:16:33 +01:00
Zoltan Kochan
e4d08f920e fix(exec): preserve user execution cwd (#10445)
close #5759
close #10403
2026-01-12 15:41:17 +01:00
baozj
9c0637f531 docs: fix typos on changelogs (#10441)
Co-authored-by: baozj <www.1670370148@qq.com>
2026-01-12 12:15:36 +01:00
Zoltan Kochan
c5d4d81f56 refactor: rename FilesIndex to FilesMap (#10427) 2026-01-08 18:17:57 +01:00
Zoltan Kochan
095f659720 fix: setting requiredScripts in pnpm-workspace.yaml (#10404)
close #10261
2026-01-04 16:43:08 +01:00
btea
a521ccf731 test: approve-builds should retain the previous allowBuilds config (#10400) 2026-01-03 11:21:12 +01:00
Zoltan Kochan
8b4bdf9a83 refactor: replace onlyBuiltDependencies and ignoredBuiltDependencies with allowBuilds (#10401) 2026-01-02 23:21:17 +01:00
Zoltan Kochan
cb367b9515 feat!: deprecate old settings that were replaced by allowBuilds (#10382) 2026-01-02 12:22:42 +01:00
btea
ace7903b85 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
2025-12-30 00:35:08 +01:00
Zoltan Kochan
71de2b3f2b feat!: remove use-node-version CLI option and pnpm.executionEnv.nodeVersion manifest field (#10373) 2025-12-27 22:41:53 +01:00
Brandon Cheng
db72923b5c fix: forward $NODE_OPTIONS when running jest for debug terminals (#10364)
* fix: forward existing `$NODE_OPTIONS` when running jest

* chore: update `package.json` files for meta-updater changes

---------

Co-authored-by: Zoltan Kochan <z@kochan.io>
2025-12-27 22:10:52 +01:00
Zoltan Kochan
05d8a71bae test: making the rebuild tests stable 2025-12-23 13:01:47 +01:00
月正海角
a297ebc9f6 feat: improve error message for versions not meeting minimumReleaseAge (#10350)
close #10307
2025-12-22 17:28:52 +01:00
btea
4015eeb8e9 chore: replace write-pkg with write-package (#10351) 2025-12-22 16:21:30 +01:00
Zoltan Kochan
1cc61e87bc feat!: change the default values of blockExoticSubdeps and strictDepBuilds (#10332) 2025-12-22 14:36:46 +01:00
btea
79791d879f chore: replace mem with memoize (#10344) 2025-12-21 18:09:02 +01:00
Khải
90bd3c31f8 feat(config)!: project-specific packageConfigs (#10304)
* feat(config)!: project level `config.yaml`

* test: fix

* refactor: shorten some names

* docs(changeset): change wording

* feat: move project settings to pnpm-workspace.yaml

* test: remove unneeded fixture

* docs(changeset): correct

* refactor: replace validation with creation

* docs: consistent terminology

* perf: validate once

* test: projectConfig

* refactor: explicitly use `undefined`

* refactor: reuse `ProjectConfigRecord`

* chore(deps): remove unused dependency

* style: remove extra pipe character

* refactor: rename to `projectConfigs`

* feat: flatten `projectConfig` with `match`

* refactor: correct error class names

* docs(changeset): update

* test: fix

* feat: rename to `packageConfigs`

Rename `projectConfigs` to `packageConfigs` in the workspace manifest.

The term "project config" is still used internally, because, internally,
"project" refers to workspace packages whilst "package" refers to 3rd party
packages and dependencies.

* docs(changeset): clarify `project-N`
2025-12-21 12:01:18 +01:00
Zoltan Kochan
0048667db4 refactor: use Maps instead of Records (#10312) 2025-12-15 11:48:19 +01:00
Zoltan Kochan
7e12e5bf71 fix: update run-groups to v4 2025-12-10 17:17:40 +01:00
Oren
ba065f6a8b 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-09 18:25:07 +01:00
Zoltan Kochan
05fb1aee5f fix: reporting ignored dependency builds (#10276) 2025-12-06 16:32:19 +01:00
Zoltan Kochan
4362c06005 fix: dependencies that were added to onlyBuiltDependencies should be built on install (#10256) 2025-12-02 15:31:52 +01:00
Zoltan Kochan
7e2910e70f chore(release): 11.0.0-alpha.0 2025-11-13 15:44:27 +01:00
Ryo Matsukawa
10bc39152e 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:23:58 +01:00
Zoltan Kochan
9b344c8982 perf: use v8 serialize/deserialize instead of JSON (#9971)
close #9965
2025-11-06 01:01:06 +01:00
Khải
d392c3d059 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
2025-11-05 23:46:20 +01:00
Zoltan Kochan
efb48dcab5 feat: install js runtime as prod dependency (#10141) 2025-10-31 17:12:50 +01:00
Zoltan Kochan
3ce5f82bd7 Merge remote-tracking branch 'origin/main' into v11 2025-10-28 18:40:05 +01:00
Zoltan Kochan
49f03d14ee chore(release): 10.20.0 2025-10-28 17:35:21 +01:00