Commit Graph

285 Commits

Author SHA1 Message Date
btea
6e4b09415f fix: make catalog protocol matching error messages clearer (#10052)
* fix: verify in advance whether the specifier that the catalog pkg is valid

* fix: update error message

* test: update

* Update resolving/default-resolver/src/index.ts

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

---------

Co-authored-by: Brandon Cheng <gluxon@users.noreply.github.com>
2026-01-16 01:53:08 +01:00
Brandon Cheng
6eb43b356c 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:07:59 +01:00
Zoltan Kochan
9a2393f67e 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:28:09 +01:00
Zoltan Kochan
f9d53286e5 fix: compile 2025-12-23 12:45:14 +01:00
Zoltan Kochan
914f2e5e3e fix: linking commands of engines (#10354)
close #10244
2025-12-23 12:31:42 +01:00
Zoltan Kochan
cdd1fcd1fc fix(git-resolver): installing git-hosted dependency using annotated tags (#10349)
close #10335
2025-12-23 12:31:19 +01:00
Oren
73cc63504d feat: support blockExoticSubdeps option to disallow non-trusted dep sources in subdeps (#10265)
* feat(core): add onlyRegistryDependencies option to disallow non-registry subdependencies

* fix: onlyRegistryDependencies=>registrySubdepsOnly

* fix: allow resolution from custom resolver

* fix: add registry-subdeps-only to types

* docs: update changesets

* refactor: registry-only

* refactor: registrySubdepsOnly=>blockExoticSubdeps

* fix: trust runtime deps

* refactor: remove comment

---------

Co-authored-by: Zoltan Kochan <z@kochan.io>
2025-12-10 12:22:37 +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
Oren
b7d3ec65b1 fix(tarball-resolver): add integrity hash to HTTP tarball dependencies (#10287)
* fix(tarball-resolver): add integrity hash to HTTP tarball dependencies

* Refactor to download tarball just once

* Fix tests

* fix: only calc hash when it is not passed in to the fetcher

* docs: update changesets
2025-12-10 00:49:50 +01:00
Zoltan Kochan
9b05bdd7e1 fix: reporting ignored dependency builds (#10276) 2025-12-06 16:43:42 +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
Brandon Cheng
3631b01697 fix: throw a frozen lockfile error when catalogs change (#10231)
close #9369
2025-11-26 01:13:54 +01:00
Zoltan Kochan
5847af412b feat: install js runtime as prod dependency (#10141) 2025-10-31 17:15:38 +01:00
Zoltan Kochan
dee39ecb8a feat: support allowing the build of specific versions of dependencies (#10104)
close #10076
2025-10-21 12:38:16 +02:00
Ryo Matsukawa
7c1382f7b7 feat: add support for exact versions in minimumReleaseAgeExclude (#10059)
close #9985

---------

Co-authored-by: Zoltan Kochan <z@kochan.io>
2025-10-18 11:10:08 +02:00
Zoltan Kochan
c5e895f657 fix: don't print a warning when --lockfile-only is used (#10044)
close #8320
2025-10-05 02:28:26 +02:00
btea
3a58aaa3e3 feat: minimumReleaseAgeExclude support patterns (#9984)
close #9983

---------

Co-authored-by: Zoltan Kochan <z@kochan.io>
2025-09-17 16:45:01 +02:00
Zoltan Kochan
38e2599ecd feat: set minimumReleaseAge to delay new versions of dependencies from being installed (#9957)
close #9921
2025-09-11 17:25:11 +02:00
Zoltan Kochan
3482fe17d1 fix: pick package by real name to resolve a peer dependency (#9919)
* fix: pick package by real name to resolve a peer dependency

close #9913

This fixes a regression introduced in #9835

* fix: resolve from alias

* test: fix

* refactor: test

* fix: sort aliases

* docs: add changesets

* refactor: types
2025-08-31 10:40:02 +02:00
Zoltan Kochan
facd7656e8 refactor: always use extensions in relative imports (#9878) 2025-08-19 15:25:11 +02:00
Zoltan Kochan
c89c93d59b test: use @jest/globals (#9877) 2025-08-19 00:16:25 +02:00
Zoltan Kochan
14c78e81d4 test: use jest.mocked (#9874) 2025-08-18 15:22:37 +02:00
Zoltan Kochan
aa24e7fe7f fix: when automatically installing peer deps, prefer the version found in the root of the workspace (#9835) 2025-08-07 14:07:13 +02:00
Zoltan Kochan
86b33e91ea feat: support installing Bun runtime (#9815)
* feat: support installing Bun runtime

* feat: support installing Bun runtime

* fix: cache libc resolution

* refactor: shasum file fetching

* docs: add changesets

* feat: installing the right artifact

* test: supported architectures

* test: fix on Windows
2025-07-31 13:46:13 +02:00
Brandon Cheng
98dd75a5d9 fix: re-resolve catalog entries when running pnpm dedupe (#9808)
* test: catalog is deduped on pnpm dedupe

* fix: re-resolve catalog entries when running `pnpm dedupe`
2025-07-30 11:47:27 +02:00
Brandon Cheng
9908269a12 fix: re-link local tarball when contents change (without rename) during filtered install (#9805)
* test: ensure current lockfile updates when tarball integrity changes

* fix: update store when local tarball contents change without rename
2025-07-30 11:31:24 +02:00
Zoltan Kochan
d1edf732ad feat: support installing Deno runtime (#9791)
* feat: support installing Deno runtime

* refactor: use npm registry to resolve deno version

* feat: wip

* feat: installing deno runtime

* style: fix

* test: fix

* test: deno

* test: fix

* feat: deno

* feat: deno

* feat: create zip fetcher

* style: fix

* refactor: node fetch

* feat: support a new binary fetcher

* test: fix

* feat: rename zip-fetcher to binary-fetcher

* refactor: change naming

* fix: windows

* refactor: rename packages

* refactor: deno resolver

* refactor: runtime resolvers

* refactor: binary fetcher

* refactor: runtime resolvers

* refactor: runtime resolvers

* refactor: create SingleResolution

* refactor: remove not needed change

* refactor: package requester

* docs: add changesets

* refactor: use VariationsResolution and AtomicResolution

* refactor: implement CR suggestions

* docs: add changesets

* fix: address comment in CR

* feat: update formatting of pnpm-lock.yaml
2025-07-30 11:27:07 +02:00
Zoltan Kochan
f91922c938 fix: store every Node.js artifact's integrity separately in the lockfile (#9798)
* fix: store every Node.js artifact's integrity separately in the lockfile

* fix: store every Node.js artifact's integrity separately in the lockfile

* style: fix

* Potential fix for code scanning alert no. 76: Incomplete string escaping or encoding

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>

* fix: windows

* refactor: node install

* fix: test

* fix: test on Windows

---------

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
2025-07-25 16:31:23 +02:00
Zoltan Kochan
06d1835219 test: fix test due to a package removed from the npm registry 2025-07-23 13:39:53 +02:00
Zoltan Kochan
cefe4bf174 test: fix test due to a package removed from the npm registry 2025-07-23 11:46:56 +02:00
Zoltan Kochan
1a07b8fc7c feat: install Node.js runtime as a dependency (#9755) 2025-07-19 15:11:40 +02:00
Zoltan Kochan
3f309fa36d test(core): fix 2025-07-19 14:44:25 +02:00
Nico Wang
260f1caff1 fix(#9673): break mutual-wait dead-lock introduced in #8760 (#9675)
close #9673

---------

Co-authored-by: Zoltan Kochan <z@kochan.io>
2025-06-26 18:57:51 +02:00
Zoltan Kochan
b982a0d6dc fix: hoisting with global virtual store (#9648) 2025-06-22 22:03:29 +02:00
Zoltan Kochan
540986f326 refactor: rename peersSuffix to peerDepGraphHash (#9656) 2025-06-17 02:27:58 +02:00
Brandon Cheng
5ab40c1dee feat: support catalog: protocol on pnpm update (#9517) 2025-06-08 10:26:15 +02:00
Zoltan Kochan
b3898dbb1e fix: take into account the integrities of packages in when calculating the dependency graph hash (#9605)
* fix: take into account the integrities of packages in when calculating the dependency graph hash

* test: fix

* test: fix

* test: fix

* test: fix

* fix: include the package's integirty in the hash as well

* docs: add comment

* perf: hashing deps graph

* fix: deps graph hash

* refactor: calc graph hash

* test: fix

* refactor: calc graph hash

* refactor: rename uniquePkgId to fullPkgId

* docs: add changeset
2025-06-08 01:05:10 +02:00
Zoltan Kochan
b0ead519b3 feat: global virtual store (#8190)
close #1001
2025-06-03 18:18:58 +02:00
Brandon Cheng
c56dff75c3 test: ensure catalog resolutions are consistent for dep with peers (#9587) 2025-06-01 23:44:33 +02:00
Brandon Cheng
5d904375aa fix: --lockfile-only flag causes pnpm update to ignore matchers (#9588)
* test: add regression test for `pnpm update --lockfile-only`

* fix: --lockfile-only flag causes pnpm update to ignore matchers
2025-06-01 23:39:54 +02:00
Zoltan Kochan
7cd0e712df fix: install exiting with 1 exit code and no error message (#9567)
close #9559
2025-05-22 15:26:51 +02:00
martinkors
046af72a96 feat: add new catalogMode setting (#9552)
* feat: add new `catalogMode` setting

Add new `catalogMode` setting for automatically adding new dependencies to
the default catalog.

Closes pnpm#8876, Closes pnpm#8308

* fix: catalogs don't only store semver ranges and versions

---------

Co-authored-by: Zoltan Kochan <z@kochan.io>
2025-05-20 16:47:05 +02:00
Brandon Cheng
28402b9c89 test: fix catalog tests adding dependencies to wrong package (#9514)
* test: ensure dep is added to correct package in pnpm add catalog tests

* test: fix catalog tests adding dependencies to wrong package
2025-05-11 00:11:32 +02:00
Zoltan Kochan
f0c3ed6781 fix: don't fail with strictPeerDependencies=true if the peerDependencyRules ignore the peer issues (#9505)
close #9449
close #8859
close #7978
close #8382
2025-05-09 11:38:56 +02:00
Khải
6627b95cf8 test: correct some assertions (#9494) 2025-05-06 22:14:20 +02:00
Khải
3b0b740e87 refactor: use toMatchObject (#9431) 2025-04-18 18:00:18 +02:00
Zoltan Kochan
5b73df1eb1 refactor: resolvers should calculate the specifiers that are saved into package.json (#9426)
* refactor: resolvers should return specifier templates

* refactor: updating workspace protocol specs in package.json

* refactor: move workspace selector calculation logic to npm-resolver

* refactor: move workspace selector calculation logic to npm-resolver

* refactor: calculating range in npm-resolver

* refactor: rename normalizedPref and specifierTemplate to specifier

* refactor: specifiers creation

* refactor: npm-resolver

* refactor: remove which-version-is-pinned package

* refactor: which version is pinned

* docs: add changesets

* refactor: implement suggestions

* refactor: revert regex usage
2025-04-18 17:48:03 +02:00
Brandon Cheng
9397a518a2 refactor: swap is-positive for @pnpm.e2e/foo in catalog update tests (#9419) 2025-04-14 11:41:55 +02:00
Khải
72cff38486 refactor: pass whole registries to the resolver (#9375) 2025-04-04 01:20:16 +02:00
Khải
8814fa4822 fix: failing tests caused by new version of express (#9359) 2025-04-01 13:30:31 +02:00