Commit Graph

333 Commits

Author SHA1 Message Date
Zoltan Kochan
821b36ac20 feat: install config dependencies into the global virtual store (#10910)
* feat: install config dependencies into the global virtual store

Config dependencies are now imported into {storeDir}/links/ following the
same path convention as regular packages (@scope/name/version/hash), then
symlinked into node_modules/.pnpm-config/. When the package already exists
in the GVS, the fetch and import are skipped entirely.

* refactor: extract shared GVS path computation into @pnpm/calc-dep-state

Move the leaf node hash computation from config deps-installer into
calcLeafGlobalVirtualStorePath in @pnpm/calc-dep-state to avoid
duplicating the hash logic.
2026-03-08 13:49:26 +01:00
Brandon Cheng
01914345d5 build: enable @typescript-eslint/no-import-type-side-effects (#10630)
* build: enable `@typescript-eslint/no-import-type-side-effects`

* build: disable `@typescript-eslint/consistent-type-imports`

* chore: apply fixes for `no-import-type-side-effects`

pnpm exec eslint "**/src/**/*.ts" "**/test/**/*.ts" --fix
2026-03-08 00:02:48 +01:00
Zoltan Kochan
c096e48090 fix: show absolute path instead of ??? when globally linking from cwd (#10899)
When running `pnpm add -g .`, the linked-from path equals the cwd,
so path.relative() returns an empty string which is falsy, causing
the fallback to '???'. Use the absolute path as fallback instead.

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 15:49:20 +01:00
Zoltan Kochan
ab9eb59e9c fix: improve global install output to show clean summary (#10897)
Hide the ugly temporary directory path prefix from progress output
for global installs (same approach as dlx). Show a proper install
summary with "global:" heading instead of the temp directory path.
2026-03-07 14:05:26 +01:00
Zoltan Kochan
de561a55fa fix: prefer .pnpmfile.mjs by default (#10683)
* fix: prefer .pnpmfile.mjs by default

* fix: handle ERR_MODULE_NOT_FOUND for missing optional .pnpmfile.mjs

Node's dynamic import() throws ERR_MODULE_NOT_FOUND (not MODULE_NOT_FOUND
like require()) when a file doesn't exist. This caused a hard error when
tryLoadDefaultPnpmfile was enabled and .pnpmfile.mjs was absent.

* fix: load only .pnpmfile.mjs when it exists, not both .mjs and .cjs

When both .pnpmfile.mjs and .pnpmfile.cjs exist, only the .mjs file
is now loaded. Previously both were loaded and their hooks combined.
Also adds .mjs support for config dependency plugins.
2026-03-01 17:00:33 +01:00
Conny Brunnkvist
e1ea7799ea feat(cli): add -F short alias for --filter (#10821) 2026-03-01 15:51:34 +01:00
Zoltan Kochan
f54347e415 feat: replace pkg with Node.js SEA for standalone executables (#10661)
* feat: switch from pkg to Node.js SEA for creating standalone executables

Replace @yao-pkg/pkg with Node.js native Single Executable Applications
(--build-sea, Node.js 25.5+). The SEA binary embeds only pnpm.cjs (CJS
bootstrap), while pnpm.mjs and all assets live in a dist/ directory
shipped alongside the binary in platform-specific tarballs.

* refactor: move dist/ from platform packages to @pnpm/exe

The dist/ directory (pnpm.mjs, worker.js, templates, etc.) is identical
across all platforms, so ship it once in @pnpm/exe instead of duplicating
it in each platform package. Platform packages now only contain the
binary. The self-updater installs @pnpm/exe (not the platform package)
so it gets both dist/ and the binary via optionalDependencies.

* refactor: externalize @reflink/reflink in esbuild bundle

Make @reflink/reflink external in both the main and worker esbuild
bundles so the require() calls resolve at runtime from dist/node_modules
instead of being inlined. Add @reflink/reflink as a production dependency
of both pnpm (bundled into dist/node_modules by bundle-deps.ts) and
@pnpm/exe (installed by npm alongside the binary).

For GitHub release tarballs, only the target platform's reflink package
is kept. For @pnpm/exe npm publishing, all reflink platform packages
are stripped from dist/ since npm installs the right one automatically.

* chore: update cspell list

* test: update system-node-version tests for SEA detection

Mock @pnpm/cli-meta's detectIfCurrentPkgIsExecutable instead of
setting process.pkg, which is no longer used for SEA detection.

* test: improve cli-meta test coverage for SEA migration

Add tests for detectIfCurrentPkgIsExecutable() (non-SEA path) and
isExecutedByCorepack() which were previously untested. The SEA=true
path of detectIfCurrentPkgIsExecutable() cannot be unit tested since
node:sea is unavailable in an ESM test environment.

* refactor: move GitHub tarball assembly to copy-artifacts.ts

build-artifacts.ts (prepublishOnly of @pnpm/exe) now only builds the
SEA executables and prepares the exe npm dist/. The per-target dist/
assembly for GitHub release tarballs moves to copy-artifacts.ts, which
is the natural owner of that concern.

Other changes:
- Extract getReflinkKeepPackages/stripReflinkPackages to reflink-utils.ts
  with tests using node:test
- Move --force from top-level pnpm install in release.yml to the pnpm
  deploy in bundle-deps.ts, where it is actually needed to install all
  @reflink/reflink-* platform packages into dist/node_modules
- Change @pnpm/exe prepublishOnly to run pnpm's full prepublishOnly
  (compile + bundle-deps) so dist/node_modules is populated before
  build-artifacts.ts and copy-artifacts.ts read from pnpm/dist

* fix: copy dist/ alongside binary when running pnpm setup for SEA

When the pnpm CLI is a Node.js SEA binary, it requires a dist/ directory
adjacent to the executable at runtime (containing pnpm.mjs and bundled
node_modules). The copyCli function in plugin-commands-setup now copies
dist/ from alongside the current binary into the tools directory so that
the installed pnpm works correctly after `pnpm setup`.


* fix: avoid argument list too long when creating Windows zip archives


* fix: propagate errors in copy-artifacts script

Previously errors in createArtifactTarball were swallowed, causing the
script to exit 0 even when artifact creation failed. Now errors are
re-thrown with a descriptive message, and the top-level IIFE has a
.catch() handler that sets a non-zero exit code.


* refactor: remove reflink-utils.ts from @pnpm/exe

The stripReflinkPackages call in build-artifacts.ts stripped all platform
packages while keeping @reflink/reflink. Instead, just remove the entire
@reflink directory from dist/ — @pnpm/exe already declares @reflink/reflink
as a runtime dependency, so npm installs it (along with the right platform
package via optionalDependencies) automatically.

This eliminates reflink-utils.ts, its tests, and the code duplication with
copy-artifacts.ts.
2026-02-22 12:45:50 +01:00
Zoltan Kochan
e18a879d72 feat!: drop Node.js 22.12 support 2026-02-18 14:54:09 +01:00
Brandon Cheng
5bf7768ca4 feat: skip confirm modules purge prompt if --yes is passed (#10383)
* feat: add --yes command line option

* feat: skip confirm modules purge prompt if --yes is passed

* refactor: factor out `ExecPnpmSyncOpts`

* test: add end-to-end test for --yes flag
2026-02-11 02:39:23 +01:00
Zoltan Kochan
1b4df57a01 feat!: drop Node.js 20 and 21 support (#10569) 2026-02-08 19:16:24 +01:00
btea
f72215107a fix: remove the prefix for view version info (#10498) 2026-02-06 16:50:49 +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
Ryo Matsukawa
3ed41f4811 fix: shamefullyHoist set via updateConfig in .pnpmfile.cjs (#10519)
* fix: `shamefullyHoist` set via `updateConfig` in `.pnpmfile.cjs`

* refactor: consolidate derived config processing to cli-utils

Move shamefullyHoist → publicHoistPattern conversion from
config/config to cli-utils/getConfig.ts as suggested in review.

* test(config): update tests for derived config processing move

* refactor: move applyDerivedConfig to cli-utils

* refactor: move applyDerivedConfig to cli-utils

* test: use unit test for hoist: false in cli-utils

* revert: not needed changes

close #10271
2026-02-05 22:45:20 +01:00
Zoltan Kochan
e3b35b6f37 style: update eslint to v9 (#10474) 2026-01-17 12:01:23 +01:00
Johan Quan Vo
cc1b8e310a fix: use tarball URL returned in package metadata (#10431)
close #10254
2026-01-16 17:31:04 +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
Brandon Cheng
11352aabbf chore: migrate remaining package.json scripts using ts-node (#10380)
* chore: remove unused test scripts

* chore: migrate remaining `package.json` scripts using `ts-node`
2025-12-30 06:27:28 +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
9fa3b6bc6b fix: validate that Object methods are not used on Maps (#10314) 2025-12-14 13:14:39 +01:00
Zoltan Kochan
19f36cfc39 fix: don't silently skip an optional dependency if it cannot be resolved from a mature version (#10289)
close #10270
2025-12-08 11:18:24 +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
49c1b9c10e feat(default-reporter): using custom instruction for builds approval 2025-11-28 13:12:14 +01:00
Ryo Matsukawa
b51bb42da5 feat!: support lowercase options in pnpm add (-d, -p, -o, -e) (#10079)
close #9197
2025-11-17 23:52:11 +01:00
Zoltan Kochan
7e2910e70f chore(release): 11.0.0-alpha.0 2025-11-13 15:44:27 +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
Khải
ae43ac79fa feat(cli/config)!: breaking changes (#9854)
* feat(cli/config)!: breaking changes

* refactor(test): remove `deepNullProto` and reuse `getOutputString`

* feat(cli/config/list): censor protected settings

* test: censorship of protected settings

* docs(changeset): censorship of protected settings

* fix: eslint

* feat(config)!: exclude non-option from `rawConfig`

* fix: eslint

* refactor: move default registries to builtin (#9886)

* feat(config)!: filter rc settings

* feat(config): don't exclude non-options

This reverts commit a79f72dbfb.

* feat(cli/config/get)!: print array as json

* test: fix

* docs(changeset): correct

* test: fix

* feat(cli/config)!: only kebabize option fields (wip)

* chore(git): revert the implementation

This reverts commit 529f9bdd47.

* test: restore

This reverts commit d8191e0ed8.

* feat(cli/config)!: only kebabize option fields (wip)

* feat: use `types` instead

* feat(cli/config/get)!: only kebabize rc fields

* test: add

* test: non-rc kebab-case keys

* test: correct

* docs(changeset): correct

* docs(changeset): style

* docs(changeset): correct

* test: only kebabize rc fields

* fix: import path

* fix: eslint

* fix: `isCamelCase`

* feat(cli/config/set)!: forbid unknown rc fields

* test: fix existing test

* test: refuse unsupported rc settings

* feat: hint

* feat(cli/config/set)!: refuse kebab-case workspace-specific settings

* feat(config)!: ignore non-camelCase from `pnpm-workspace.yaml`

* test: config get

* test: config list

* refactor: extract shared code into its own package

* test: `isCamelCase`

* feat(cli/config/list)!: consistent naming cases

* refactor: make it more reusable

* feat(cli/config/get)!: consistent naming cases

* feat(cli/config/get): censor protected settings

* test: `get ''` should be the same as `list`

* docs(test): quotation marks

* refactor: remove unnecessary `test.each`

* docs(changeset): case changes

* test: unknown keys

* docs(changeset): correct

* docs(changeset): non camelCase from `pnpm-workspace.yaml`

* fix: eslint

* docs(changeset): correct terminology

* docs(changeset): clarify

* feat!: do not load non-auth and non-registry

* fix: implementation

* test: no hidden settings

* fix: eslint

* fix: do not drop default values

* test: fix

* test: remove irrelevant tests

* test: fix (wip)

* fix: auth

* test: skip an inapplicable test

* test: temporary skip a test

* test: fix 'respects testPattern'

* test: fix 'respects changedFilesIgnorePattern'

* test: fix 'changedFilesIgnorePattern is respected'

* test: rename a test

* test: fix `package-lock=false`

* feat: exception for `managePackageManagerVersions`

* test: `managePackageManagerVersions: false`

* test: fix (wip)

* test: workaround

* fix: default `optional` to `true`

* fix: `filter` on `pnpm-workspace.yaml`

* test: fix

* test: disable ones that no longer apply

* chore(git): revert incorrect change

* fix: `filter` on `pnpm-workspace.yaml` (#10127)

* fix: `filter` on `pnpm-workspace.yaml`

* docs: changeset

* fix: actual fix

* fix: don't set default on config

* docs(readme): correct a package description

* fix: typo

* test: fix

* test: use a field that wouldn't be ignored

* test: replace some `.npmrc` with `pnpm-workspace.yaml`

* docs(changeset): less awkward wordings

* docs(changeset): correction
2025-10-28 17:09:15 +01:00
Zoltan Kochan
dab9abef5c Merge remote-tracking branch 'origin/main' into v11 2025-10-24 14:19:07 +02:00
Zoltan Kochan
0cde1287c8 chore: update repository fields 2025-10-23 11:57:12 +02:00
Zoltan Kochan
43d7b18c2f chore(release): 10.19.0 2025-10-21 15:30:20 +02:00
Zoltan Kochan
1bfc105da0 chore(release): 10.18.3 2025-10-14 11:27:45 +02:00
Zoltan Kochan
a43166624e Merge remote-tracking branch 'origin/main' into v11 2025-10-10 10:01:19 +02:00
Zoltan Kochan
e146e988ea feat: loading ESM pnpmfiles (#9730) 2025-10-10 09:50:21 +02:00
Zoltan Kochan
1b15e45ae9 chore(release): 10.18.2 2025-10-09 16:56:04 +02:00
Zoltan Kochan
6618431aee chore(release): libs 2025-09-29 11:56:00 +02:00
Zoltan Kochan
f307b9a130 Merge remote-tracking branch 'origin/main' into v11 2025-09-24 10:51:53 +02:00
Zoltan Kochan
f6242c333b chore(release): 10.17.1 2025-09-22 15:09:34 +02:00
btea
baf8bf6304 feat: improve error message when no mature enough matching package is found (#9974)
---------

Co-authored-by: Zoltan Kochan <z@kochan.io>
2025-09-19 19:51:57 +02:00
Zoltan Kochan
cb0c5b94c6 Merge remote-tracking branch 'origin/main' into v11 2025-09-19 14:31:36 +02:00
Zoltan Kochan
1a1a272fa4 chore(release): 10.17.0 2025-09-17 16:48:25 +02:00
Zoltan Kochan
ea44ff979f chore(release): 10.16.1 2025-09-13 19:20:27 +02:00
Zoltan Kochan
6f861bccaa Merge remote-tracking branch 'origin/main' into v11 2025-09-12 22:35:14 +02:00
Zoltan Kochan
a3c1498403 chore(release): 10.16.0 2025-09-12 14:24:30 +02:00
Zoltan Kochan
e792927841 feat: support finder functions for performing complex searches with list and why commands (#9946) 2025-09-12 11:46:32 +02:00
Zoltan Kochan
3d1711a439 chore(release): 10.15.1 2025-09-01 11:41:05 +02:00
Zoltan Kochan
46a65def8e Merge remote-tracking branch 'origin/main' into v11 2025-08-29 13:30:11 +02:00
Zoltan Kochan
cf9f14aa9e fix: update tempy 2025-08-28 14:00:51 +02:00
Zoltan Kochan
3df6702bcb fix: update load-json-file, write-json-file, write-pkg 2025-08-28 11:37:38 +02:00
Zoltan Kochan
491a84fb26 feat: use ESM instead of commonjs (#9870) 2025-08-25 10:02:00 +02:00