Commit Graph

10667 Commits

Author SHA1 Message Date
Zoltan Kochan
7486d3806f feat: remove engines.runtime from pnpm CLI 2026-01-13 15:25:02 +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
Trevor Burnham
41664e83f5 feat: pass currentPkg to custom resolvers (#10440)
- Add currentPkg (with name/version) to custom resolver ResolveOptions
- Pass currentPkg through to custom resolvers in default-resolver
- Simplify checkCustomResolverForceResolve to use parseDepPath
2026-01-12 21:04:38 +01:00
Zoltan Kochan
8a8a51c394 perf: don't calculate package file paths in the store twice (#10428) 2026-01-12 15:58:25 +01:00
Zoltan Kochan
e4d08f920e fix(exec): preserve user execution cwd (#10445)
close #5759
close #10403
2026-01-12 15:41:17 +01:00
Sam Chung
938ea1f18c Revert "fix: try not to make network requests with prefer offline" (#10423)
* Revert "fix: try not to make network requests with prefer offline (#10334)"

This reverts commit 1bc6b5ac2c.

* Add changeset

---------

Co-authored-by: Zoltan Kochan <z@kochan.io>
2026-01-12 13:39:59 +01:00
Zoltan Kochan
0bcbaf9994 refactor: move out skip resolution logic from package requester (#10439) 2026-01-12 13:08:50 +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
5a0ed1d450 fix: prevent circular symlinks in projects registry (#10432)
close #10411
2026-01-09 18:04:57 +01:00
Zoltan Kochan
c5d4d81f56 refactor: rename FilesIndex to FilesMap (#10427) 2026-01-08 18:17:57 +01:00
Zoltan Kochan
9aba854cbc test(package-requester): fix 2026-01-08 15:29:17 +01:00
Zoltan Kochan
d71174a4fa perf: calculate the package file maps in the workers (#10422) 2026-01-08 14:53:47 +01:00
Brandon Cheng
2b81a4f09d feat: improve filtered install performance with an optimistic lookup of package metadata from store (#10408) 2026-01-08 00:36:00 +01:00
Brandon Cheng
2b14c742eb feat: preserve comments when updating pnpm-workspace.yaml (#10402)
* chore: create empty new `@pnpm/yaml.document-sync` package

* feat: implement @pnpm/yaml.document-sync

* feat: preserve comments when updating `pnpm-workspace.yaml`

* fix: add missing rootProjectManifestDir field to fix test

This was causing a test to fail due to the rootProjectManifestDir being
an empty string.

The main branch doesn't have this problem because `write-yaml-file`
internally does a `path.dirname(...)` call that ends up resolving the
empty string to `.`.

● logger warns about peer dependencies when linking

    ENOENT: no such file or directory, mkdir ''

    25 |     singleQuote: true, // Prefer single quotes over double quotes
    26 |   })
    > 27 |   await fs.promises.mkdir(dir, { recursive: true })
        |   ^
    28 |   await writeFileAtomic(path.join(dir, fileName), manifestStr)
    29 | }
    30 |

    at writeManifestFile (../../workspace/manifest-writer/src/index.ts:27:3)
    at updateWorkspaceManifest (../../workspace/manifest-writer/src/index.ts:83:3)
    at writeSettings (../../config/config-writer/src/index.ts:38:3)
    at addLinkToManifest (src/link.ts:182:3)
    at src/link.ts:161:7
        at async Promise.all (index 0)
    at Module.handler (src/link.ts:159:3)
    at Object.<anonymous> (test/link.ts:300:3)%

* Update workspace/manifest-writer/src/index.ts
2026-01-06 01:11:17 +01:00
Brandon Cheng
8ed2c7d7c3 feat: create new @pnpm/yaml.document-sync package (#10405) 2026-01-05 12:14:56 +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
571ca0b80c docs: update copyright year in LICENSE file 2026-01-02 12:23:58 +01:00
Zoltan Kochan
cb367b9515 feat!: deprecate old settings that were replaced by allowBuilds (#10382) 2026-01-02 12:22:42 +01:00
Brandon Cheng
b5751aeac8 chore: print type checking errors relative to user's working directory (#10388) 2025-12-31 18:35:18 +01:00
Brandon Cheng
6b9e5f2c07 chore: upgrade qs to 6.14.1 (#10389) 2025-12-31 13:08:39 +01:00
Brandon Cheng
6225d84db0 chore: configure external source maps on final pnpm.mjs bundle (#10378)
* chore: configure external source maps

* chore: upload `source-maps.tgz` artifact to GitHub release
2025-12-31 12:59:39 +01:00
Zoltan Kochan
82f461026a fix: git dependencies respect dangerouslyAllowAllBuilds (#10387)
close #10376
2025-12-30 19:02:27 +01:00
Junius Chen
b773199eb0 fix(store): return only directory names when clean expired cache (#10384)
* fix(store): return only directory names when clean expired cache

* docs: add changeset

* test: clean dlx cache

---------

Co-authored-by: Zoltan Kochan <z@kochan.io>
2025-12-30 18:01:53 +01:00
Zoltan Kochan
3c72b6b2de feat: add validation to tokenHelper settings to disallow environment variables 2025-12-30 17:04:05 +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
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
Brandon Cheng
9c74361aaf fix: frozen lockfile installs in pnpm repo (#10377) 2025-12-30 00:09:52 +01:00
Phantom
24da84c19d feat(cli): skip package manager check when using --global option (#10368)
Add warning when package manager check is skipped due to --global flag

close #10367
2025-12-29 02:06:31 +01:00
Brandon Cheng
4f3ad2388c fix: pnpm add incorrectly modifies a catalog entry in pnpm-workspace.yaml to its exact version (#10370)
* refactor: factor out a `getRealNameAndSpec` function

* test: `pnpm add` does not modify existing catalog entries

* fix: resolve preferred version without mutating bare specifier

close #9759
2025-12-29 02:05:54 +01:00
Brandon Cheng
d404c55ac8 fix: handle npm aliases without a bare specifier in unwrapPackageName (#10374)
* refactor: factor out a `getRealNameAndSpec` function

* fix: handle npm aliases without a bare specifier in `unwrapPackageName`

* Fix formatting in unwrapPackageName.ts
2025-12-29 02:00:21 +01:00
Brandon Cheng
aa077a19ef refactor: factor out a getRealNameAndSpec function (#10369) 2025-12-29 01:54:14 +01:00
btea
facdd717bf feat: add trustPolicyIgnoreAfter (#10359)
* feat: add `trustPolicyIgnoreAfter`

* Update .changeset/big-lies-pump.md

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* refactor: npm-resolver

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Zoltan Kochan <z@kochan.io>
2025-12-28 02:01:09 +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
394d88cf5e feat: enable injected local packages to work with global virtual store (#10366)
* feat: enable injected local packages to work with global virtual store

by leveraging `pkgLocationsByDepPath` for `file:` dependencies.

* fix: populate `pkgLocationsByDepPath` directly for directory dependencies in the graph builder

* refactor: store directory dependencies as a Map instead of an object

* refactor: improve file: dependency target directory resolution

by prioritizing `directoryDepsByDepPath` and providing a lockfile fallback.

* refactor: remove `pkgLocationsByDepPath` from hoisted dependency graph generation parameters

* test: fix

* test: fix

* refactor: simplify directory lookup for injected workspace packages

by directly using the dependency graph

* refactor: move extendProjectsWithTargetDirs to headless module and update imports

* refactor: make `directoryDepsByDepPath` required

in `LockfileToDepGraphOptions` and remove its nullish coalescing in headless

* refactor: directory dependency tracking

by renaming `directoryDepsByDepPath` to `injectionTargetsByDepPath`
and extracting related logic, and remove an unused export.

* docs: add changesets

* fix: implemented CR suggestions
2025-12-27 12:21:19 +01:00
Brandon Cheng
6f806be0ae chore: enable TypeScript's erasableSyntaxOnly config (#10365)
* chore: configure `erasableSyntaxOnly`

* refactor: remove class property access modifiers in constructor

```
../dedupe/check/src/DedupeCheckIssuesError.ts:5:16 - error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled.

5   constructor (public dedupeCheckIssues: DedupeCheckIssues) {
                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

../reviewing/dependencies-hierarchy/src/getTree.ts:243:24 - error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled.

243   private constructor (private readonly keypath: readonly string[]) {}
                           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```

* chore: migrate from enum types

```
../pkg-manager/plugin-commands-installation/src/import/index.ts:66:6 - error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled.

66 enum YarnLockType {
        ~~~~~~~~~~~~

../lockfile/detect-dep-types/src/index.ts:5:13 - error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled.

5 export enum DepType {
              ~~~~~~~
```

* chore: add changelog

* chore: remove `ts-node` dev dependency (#10371)

* chore: remove `ts-node` dev dependency

* chore: remove `ts-node` usages from `package.json` scripts
2025-12-27 11:23:49 +01:00
Zoltan Kochan
9eddabb32b feat: enhance store prune to clean global virtual store (#10360)
* feat: enhance `store prune` to clean global virtual store

`pnpm store prune` will now clean the global virtual store
via a new project registry and mark-and-sweep garbage collection.

* test: add store prune test for transitive dependency preservation

* refactor: extract global virtual store pruning logic to a new file

* fix: improve symlink handling in global virtual store pruning

* fix: optimize removal of unreachable packages in global virtual store

* fix: refine project registry error handling

Throw `PnpmError` for inaccessible projects
and specifically clean up stale symlinks for `ENOENT` errors.

* test: create virtual store with install command

* refactor: standardize global virtual store directory structure

by placing unscoped packages under an `@` scope.

* test: update store prune tests to use `toContain` and `not.toContain` assertions`

* fix: linting issues

* Apply suggestions from code review

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* fix: implemented CR suggestions

* fix: revert not needed change

* fix: use `is-subdir` to accurately determine if symlink targets

are within the global virtual store.

* revert: changes in package.json files

* test: add `--config.ci=false` to store prune tests
2025-12-26 01:35:35 +01:00
Zoltan Kochan
c4045fc689 fix: update unscoped package storage location in virtual global store (#10363) 2025-12-25 21:13:41 +01:00
Zoltan Kochan
05d8a71bae test: making the rebuild tests stable 2025-12-23 13:01:47 +01:00
Zoltan Kochan
3bf5e218a6 fix: linking commands of engines (#10354)
close #10244
2025-12-23 12:26:59 +01:00
Zoltan Kochan
6bbdbe87ba refactor: binary fetcher 2025-12-22 23:43:03 +01:00
Zoltan Kochan
01760da877 fix(git-resolver): installing git-hosted dependency using annotated tags (#10349)
close #10335
2025-12-22 23:05:40 +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
55c5432eab ci: increase timeout for pnpm install step 2025-12-22 16:11:48 +01:00
btea
ac4c9f4b96 fix: install absolute path pkg failed (#9888) 2025-12-22 14:57:45 +01:00
Zoltan Kochan
1cc61e87bc feat!: change the default values of blockExoticSubdeps and strictDepBuilds (#10332) 2025-12-22 14:36:46 +01:00
Khải
97cf97609e fix(cli/config): phantom keys (#10323)
* fix(cli/config): phantom keys

Fixes https://github.com/pnpm/pnpm/issues/10296

This patch also include other refactors.

* test: does not traverse the prototype chain

* test: more properties

* test: fix other tests

* feat: revert unrelated changes
2025-12-22 12:26:14 +01:00