Commit Graph

113 Commits

Author SHA1 Message Date
R.P. Pedraza
76973d8c81 feat(link): normalize generated link paths in package.json (#9163) 2025-02-26 02:56:59 +01:00
R.P. Pedraza
529696182f fix: reference root manifest directory instead of the dependent dir (#9132)
* fix: reference root manifest directory instead of the dependent dir

This fixes https://github.com/pnpm/pnpm/issues/9066.

* refactor: link test

* docs: add changeset

---------

Co-authored-by: Zoltan Kochan <z@kochan.io>
2025-02-25 02:15:38 +01:00
Zoltan Kochan
8fcc221394 feat: reading settings from pnpm-workspace.yaml (#9121)
Related discussion: https://github.com/orgs/pnpm/discussions/9037

close #9033
2025-02-22 02:10:43 +01:00
btea
546ab377de fix: --allow-build=<pkg> overlaps with ignoredBuiltDependencies (#9105)
* fix: `--allow-build=<pkg>` overlaps with `ignoredBuiltDependencies`

* feat: update

* fix: update

* test: update

* fix: add hint to the error message

* test: fix

* docs: update changeset

---------

Co-authored-by: Zoltan Kochan <z@kochan.io>
2025-02-16 22:07:52 +01:00
Zoltan Kochan
91d46eecd4 feat: add --allow-build=<pkg> to add command (#9086) 2025-02-13 00:43:44 +01:00
Zoltan Kochan
f6006f2b4b feat: add an option to fail on unapproved dependency builds (#9071) 2025-02-11 00:26:25 +01:00
Zoltan Kochan
b5ba5350bf feat(dlx): add an option to dlx for providing a list of deps that are allowed to run install scripts (#9026) 2025-02-03 14:46:28 +01:00
Khải
f3ffaed009 feat(install): option to disable fast reinstall (#8977) 2025-01-26 11:53:16 +01:00
Zoltan Kochan
e050221384 fix: pnpm link should keep the indentations in the updated manifest 2025-01-07 02:48:02 +01:00
Zoltan Kochan
9591a18d96 feat: configurational dependencies (#8915)
* feat: configuration dependencies

* feat: remove configuration dependencies

* feat: update configuration dependencies

* feat: configuration dependencies fast check on repeat install

* revert: comment

* refactor: install configurational deps

* refactor: install config deps

* refactor: install config deps

* test: config deps

* test: config deps

* docs: add changeset

* test: loading a pnpmfile from config deps

* fix: reading hooks after installing config deps

* test: fix

* test: fix

* test: fix

* test: fix

* test: loading patch from config dep

* fix: do not allow config deps w/o integrity checksum
2025-01-04 11:29:22 +01:00
Fotis Papadogeorgopoulos
c7eefdd082 fix: pnpm update --filter --latest should only change relevant packages and projects, with dedupe-peer-dependents=true (#8905)
* test(update): add failing tests for update with dedupe-peer-dependents=true

Relates to https://github.com/pnpm/pnpm/issues/8877

* fix: update --filter --latest should work with dedupe-peer-dependents

Fixes https://github.com/pnpm/pnpm/issues/8877, whereby
`update --filter --latest` with `dedupe-peer-dependents` would end up
updating all available dependencies for all projects.

* test(pnpm): more accurate dedupePeers filtered install case

* docs: add changeset for updateToLatest moving to projects/importers

* docs: add changesets for pnpm and plugin-commands-installation

* chore: fix tsc issue by removing unknown bound resolver property

This unknown property was accepted by tsc prior to adding updateToLatest
in toResovleImporter options, but now it was erroring out. This is
likely a tsc quirk about the shape of the object; regardless that
property is not defined, and should not be present.

* test: keep only pnpm/test/monorepo/dedupePeers.test.ts

There was duplicate coverage of the pnpm update --filter --latest
command between two tests, so this keeps only the one dedicated
to testing the dedupe-peer-dependents feature.

* chore: fix unused import error
2024-12-29 17:30:36 +01:00
Khải
f89128883f feat(deploy): create dedicated lockfile (#8828)
* feat(deploy): create dedicated lockfile

Closes https://github.com/pnpm/pnpm/issues/8778

* chore: remove a leftover `console.log`

* fix: hoisted should also use dedicated lockfile

* feat: inherit more keys

* docs(changeset): more details

* refactor: remove a variable

* refactor: use `selectedProject.rootDir`

* fix: manifest files

* fix: update lockfile

* fix: accidentally skipped normal dependencies

* test: update

* fix: meta

* fix: remove links to nowhere

* docs: remove the false todo

* fix: transitive workspace dependencies

* fix: package snapshot names

* fix: dependencies that depend on deployed package

* perf: do not repeat computation

* fix: compile error

* refactor: base on allProjects

* fix: add missing `link:` prefix

* test: add some tests

* fix: revert stupid refactor

This reverts commit 000788127c.

* test: more assertions

* test: more assertions

* test: https://github.com/pnpm/pnpm/issues/8778

* test: exact paths

* refactor: use `toBe`

* refactor: divide section

* fix: eslint

* test: fix assertions

* fix: dependencies that depend on deploy package

* perf: cheap operation first

* test: remove `.only`

* test: add assertions

* test: remove unnecessary assertions

* test: remove unnecessary details

* fix: deployed package depends on itself

* docs: remove the other todo

* fix: self-referential dependencies

* test: fix

* test: more assertions

* feat: convert fallbacks to programmer errors

* fix: `file:` protocol

* refactor: more types

* refactor: remove unused variables

* refactor: fix regex

* feat: force-legacy-deploy

* feat: suggest reporting bug and using workaround

* feat: overrides, patchedDependencies, packageExtensions (wip)

* test: fix

* feat: handle `packageExtensions` in a smarter way

* fix: pnpmfile

* docs: change wording

* fix: `packageExtensions` with internal dependencies

* fix: directory resolution location

* refactor: use `rootProjectManifestDir`

* feat: set `overrides` to `undefined` instead

* refactor: remove `as ProjectRootDirRealPath`

* test: packageExtensions

* test: use regex string matchers

* refactor: move new tests to its own file

* fix: patchedDependencies

* fix: eslint

* test: patchedDependencies

* test: fix windows

* fix: pnpmfile checksum

* docs: change wording

* fix: peer dependencies

* docs: omission of peers

* docs: more detailed explanation

* fix: preserve unique peer dependencies suffix

* refactor: code rearrange

* refactor: shorten lines of code

* feat: add `dedupeInjectedDeps` to `InstallCommandOptions`

* test: peer dependencies suffix

* docs(changeset): config -> force-legacy-deploy

* docs(changeset): merge

* docs(changeset): add missing period
2024-12-27 17:17:12 +01:00
Fotis Papadogeorgopoulos
f685565f92 fix(remove): ensure that link-workspace-packages=false is respected in single project runs in a workspace (#8881) 2024-12-19 01:39:21 +01:00
Zoltan Kochan
ac5b9d8e16 feat!: ignore the NODE_ENV env variable (#8839)
close #8827
2024-12-15 20:24:51 +01:00
Zoltan Kochan
a76da0c53c feat!: remove conversion of lockfile v6 to v9 (#8866) 2024-12-15 14:39:19 +01:00
Zoltan Kochan
31911f103e fix: dependency status check should never throw an exception (#8852) (#8857) 2024-12-10 17:16:08 +01:00
Zoltan Kochan
d47c4266db perf: faster repeat install (#8838) 2024-12-08 23:42:33 +01:00
Zoltan Kochan
b8bda0ac40 fix: global update should not fail if no packages are found (#8829)
ref #7898
2024-12-04 10:47:38 +01:00
Khải
19d5b51558 feat(exec): check dependencies before running scripts (#8645)
* refactor: break a long line into multiple lines

* feat: cache that tracks workspace structures

* feat: handle hash collisions

* docs(changeset): packages-list-cache

* feat(packages-list-cache): store mtime

* fix(packages-list-cache): JSON5 and YAML manifests

* feat(packages-list-cache): add catalogs

* style: sort fields alphabetically

* fix: actually fix it

* lint: fix

* lint: fix

* test(packages-list-cache): test

* feat(exec): check deps before run scripts

Resolves https://github.com/pnpm/pnpm/issues/8585

* style: fix eslint

* feat: use a single lastValidatedTimestamp

* refactor: rearrange

* perf: don't do pointless comparisons

* perf: optimize non-workspace

* perf: optimize sharedWorkspaceLockfile=false

* perf: remove unnecessary fs reads

* refactor: statManifestFile

* perf: skip comparing manifest to lockfile by stats

* feat: add wantedLockfileDir to error message

* refactor: shorten a function name

* refactor: rename a function

* docs: improve wordings

* feat: export `linkedPackagesAreUpToDate`

* feat: make sure lockfile specs satisfy manifest (wip)

* docs: todo

* fix: projectId

* feat: skip install-related scripts

* fix: type errors

* refactor: use tagged union

* refactor: remove unnecessary type expression

* docs: todo

* feat: add linkedPackagesAreUpToDate (wip)

* refactor: rearrange fields

* refactor: remove a temporary variable

* feat: export `getWorkspacePackagesByDirectory`

* feat: make workspacePackages optional

* feat: complete `linkedPackagesAreUpToDate`

* docs: remove unapplicable todo

* docs: explain why check is skipped

* feat: load allProjects and try again

* refactor: remove unused dependencies

* refactor: remove commented-out code

* refactor: replace `else if` with `return`

* feat: use-case without workspace manifest

* perf: skip unnecessary work

* feat: add a guard

* fix: eslint

* refactor: move code to new package

* refactor: sort dependencies

* test: outline

* refactor: extract assertLockfilesEqual for testing

* test: skip failing tests for now

* fix: eslint

* test: assertLockfilesEqual

* refactor: extract statManifestFile for testing

* test: todo

* test: statManifestFile

* test: shouldRunCheck

* refactor: rename a test file

* test: add

* test: todo

* docs: remove a commented-out code

* test: create groups

* test: todo

* test: add

* test: platform agnostic

* test: remove unnecessary scripts

* test: use `assert.strictEqual` instead

* test: export bin locations

* test: nested `pnpm run`

* test: todo

* test: add `cwd` option to `execPnpmSync`

* test: add

* fix: recursive

* test: add

* test: fix package names

* fix: catalogs comparison

* test: add

* refactor: just use ramda filter

* test: add

* test: mutations

* fix: package.json

* fix: jest

* feat(packages-list): debug logs

* feat: add debug messages

* fix: eslint

* test: check debug messages in other case

* docs: add next step

* test: mtime updates without modification

* docs: correct test description

* test: mtime changes

* test: check should be skipped

* docs: remove fulfilled todos

* fix: remove `.only`

* docs: todo

* docs: correct test names

* test: workspace structure changes

* test: packages list cache

* test: add

* refactor: divide a test file into 2

* docs: consistent wordings

* refactor: clearer error messages

* fix: ignore check in recursive nested scripts

* test: no dependencies

* test: print error messages on failures

* test: improve stdout/stderr in error messages

* docs: consistent wordings

* docs: clarify what did what

* test: nested script

* docs: consistent test descriptions

* docs(changeset): correction

* fix: save catalogs to packages list

* test: catalogs

* test: fix

* test: fix windows

* refactor: remove unused option field

* refactor: prefer `!= null`

* feat: use `node_modules` instead

* refactor: rename a package

* refactor: apply suggestion

* refactor: remove workspaceDir

* refactor: move `shouldRunCheck` to `exec`

* feat: rename config key

* refactor: rename a test dir

* refactor: correct grammar

* refactor: make loadPackagesList sync

* test: multiple lockfiles

* feat: prevent deletion of `node_modules`

* feat: skip checking on filtered install

* fix: accidentally dropping catalogs

* refactor: remove unnecessary `Promise.all`

* refactor: use `virtualStoreDir` from config

* refactor: split `opts` into `ctx` and `opts`

* test: fix

* style: fix eslint

* test: fix windows

* feat(exec): add `verifyDepsBeforeRun` to `exec`

* refactor: sync stat

* feat: stop ignoring filtered install

* test: filtered install

* refactor: rearrange imports

* feat: rename "packages list" to "workspace state"

* test: fix

* fix: workspace state on failed install
2024-11-15 01:01:09 +01:00
Zoltan Kochan
6b27c811e7 fix!: do not allow to install pnpm globally via pnpm add (#8728) 2024-11-03 20:47:45 +01:00
Zoltan Kochan
32613a05af Merge remote-tracking branch 'origin/main' into v10 2024-10-28 04:01:43 +01:00
chlorine
6014522ddb fix: print ERR_PNPM_NO_GLOBAL_BIN_DIR error when global bin directory is not found (#8710) 2024-10-28 03:08:16 +01:00
Zoltan Kochan
284d5e9baf Merge remote-tracking branch 'origin/main' into v10 2024-10-26 13:33:00 +02:00
Shion Ichikawa
9335a45c2d style: fix lint errors (#8699)
close #8698
2024-10-26 12:56:26 +02:00
Zoltan Kochan
477e0c1f74 feat!: the link command should add overrides (#8653) 2024-10-24 16:59:55 +02:00
btea
807f2de798 refactor: remove unused parameters (#8593) 2024-10-01 13:35:34 +02:00
Khải
83681daf57 fix: install packages with incompatible libc (#8569)
close #7362
2024-09-27 22:46:16 +02:00
Khải
ad1fd64b64 fix(deploy): node-linker=hoisted produces empty node_modules (#8525)
close https://github.com/pnpm/pnpm/issues/6682

---------

Co-authored-by: Zoltan Kochan <z@kochan.io>
2024-09-20 03:27:05 +02:00
Khải
24ad47cfb8 refactor: replace array.reduce (#8537) 2024-09-18 04:41:35 +02:00
Khải
f071d00815 refactor: replace forEach with for-loops (#8535)
* refactor: replace `forEach` with `for`-loops

Changes:
* Most `Object.keys(o).forEach` are replaced by `for in`.
* Most `Array.filter(c).forEach` are replaced by `for of` + `if continue`.
* `return` in `forEach` callbacks are replaced by `continue`.

There may be minor improvement to memory footprint as this change would
reduce the creations of temporary arrays and temporary functions.

* fix: return -> continue

* refactor: remove the commented out code
2024-09-18 03:58:25 +02:00
Zoltan Kochan
eeb76cd1d0 fix: deploy with shared-workspace-lockfile=false (#8515)
close #8475
close #8504
2024-09-11 15:32:57 +02:00
Zoltan Kochan
7ee59a166a fix(deploy): write node_modules/.modules.yaml to the deploy directory (#8465)
close #7731
2024-08-26 17:07:16 +02:00
Zoltan Kochan
eb8bf2a993 feat: self-update command (#8424) 2024-08-19 14:26:17 +02:00
Zoltan Kochan
797ef0fc46 refactor: rename lockfile-types to lockfile.types 2024-07-27 14:46:23 +02:00
Brandon Cheng
1e4dd79163 fix: install failure on pnpm deploy when using catalogs (#8298)
* fix: install failure on pnpm deploy when using catalogs

* test: add test for pnpm deploy when using catalogs

* chore: changeset
2024-07-14 02:45:35 +02:00
Khải
0ef168b77d feat: per-package node version (#8277)
close #6720
2024-07-13 14:08:57 +02:00
Zoltan Kochan
a2e9bdcc02 refactor: remove path-exists from tests 2024-07-08 17:51:23 +02:00
Zoltan Kochan
0406d4ad3d refactor: use a branded type for project root dir paths (#8272) 2024-07-04 13:13:34 +02:00
Zoltan Kochan
84654bd2ad fix: installation with filtering and dedupe-peer-dependents=true (#8270)
close #6300
2024-07-03 15:43:01 +02:00
Zoltan Kochan
341656f9b3 refactor: make workspace packages a map 2024-07-02 22:49:38 +02:00
Zoltan Kochan
576f13878e refactor: deduplicate arrayOfWorkspacePackagesToMap (#8265) 2024-07-01 14:45:13 +02:00
Zoltan Kochan
dd00eeb18c refactor: normalize dir field names across project objects (#8262) 2024-07-01 11:27:04 +02:00
Zoltan Kochan
79830ff0b9 chore: use catalogs 2024-06-27 21:18:27 +02:00
Brandon Cheng
75a98e12b3 refactor: improve type checking when finding workspace packages (#8214)
---------

Co-authored-by: Zoltan Kochan <z@kochan.io>
2024-06-17 17:34:54 +02:00
Brandon Cheng
04b8363a8d refactor: store workspace manifest in @pnpm/config for reuse (#8213)
* feat: store workspacePackagePatterns in @pnpm/config

* refactor: pass workspace patterns from config to findWorkspacePackages

* chore: add changeset
2024-06-17 01:26:45 +02:00
Zoltan Kochan
13e55b2865 fix: a filtered install should update the lockfile first (#8183)
close #8165
2024-06-12 14:49:39 +02:00
Zoltan Kochan
c9db742824 fix: update typescript to v5.4 (#7905) 2024-04-12 14:03:45 +02:00
Khải
e8fc6139ea refactor(install): type checking perf (#7877) 2024-04-09 16:23:44 +02:00
Colin Casey
d4e13ca969 fix(prune): add --ignore-scripts arg to prune command (#7836)
close #5030
2024-03-28 00:05:07 +01:00
Khải
316c18aba4 feat(cli): forbid combining specs and --latest (#7567)
---------

Co-authored-by: Zoltan Kochan <z@kochan.io>
2024-01-27 16:37:17 +01:00