Commit Graph

235 Commits

Author SHA1 Message Date
Brandon Cheng
4fa1091c80 feat: add experimental use-inline-specifiers-lockfile-format (#5091)
* feat: add experimental use-inline-specifiers-lockfile-format

* fix(lockfile-file): check importers key for shared lockfile format

The `convertFromLockfileFileMutable` function reverts changes from
`normalizeLockfile` when not using the shared lockfile format.

  - The non-shared lockfile format puts fields like `specifiers`,
    `dependencies`, `devDependencies`, `optionalDependencies`, and
    `dependenciesMeta` on the root of the lockfile. This is typically
    the case for a repo not using pnpm workspaces.
  - The shared lockfile format puts these under a `importers` block
    scoped by a path.

The `use-inline-specifiers-lockfile-format` feature flag removes the
`specifiers` block in favor of putting each specifier next to the
resolved version within each `dependencies`, `devDependencies`, etc
block.

This means the `convertFromLockfileFileMutable` function can no longer
check for `specifiers` to detect the whether the "shared" format is
used. @zkochan suggested checking for `importers` instead, which should
have the same effect.
https://github.com/pnpm/pnpm/pull/5091#discussion_r929326835

* test(lockfile-file): add read & write test for useInlineSpecifiersFormat
2022-07-27 12:27:41 +03:00
Michał Belniak
406656f806 feat: add lockfile-include-tarball-url option (#5054)
* feat: add save-tarball-url .npmrc option

- add save-tarball-url option, which saves resolved tarball URL to
pnpm-lock.yaml during install or add command

* feat: add save-tarball-url .npmrc option - remove incorrect change

- remove help section for new option

* feat: add lockfile-include-tarball-url option - change option name, add test

- option is now named lockfile-include-tarball-url as suggested by
@zkochan
- add test covering new feature

* feat: add lockfile-include-tarball-url option - add changeset

- add changeset

* refactor: lockfile-include-tarball-url

Co-authored-by: Zoltan Kochan <z@kochan.io>
2022-07-20 16:57:47 +03:00
Zoltan Kochan
28f0005096 feat: prefer-symlinked-executables (#5048)
A new setting supported: `prefer-symlinked-executables`
When `true`, on Posix systems pnpm will create symlinks to executables in
`node_modules/.bin` instead of command shims.

This setting is `true` by default when `node-linker` is set to
`hoisted`.

close #4782
2022-07-18 17:18:31 +03:00
javier-garcia-meteologica
f5621a42c2 feat: use workspace spec alias by default in pnpm add (#4947) 2022-07-02 14:12:08 +03:00
Zoltan Kochan
5f643f23b0 fix(deps): update ramda to v0.28 2022-06-28 15:33:17 +03:00
Van Nguyen
f48d46ef6f fix: respect include-workspace-root npmrc option (#4928)
close #4906

Co-authored-by: Zoltan Kochan <z@kochan.io>
2022-06-25 00:04:28 +03:00
Zoltan Kochan
47b5e45dd6 feat: add patch and patch-commit commands (#4900)
close #3077
close #2675
2022-06-20 16:00:24 +03:00
Cheng
56cf04cb36 feat: add git-branch-lockfile config to generate lockfile in each branch (#4475)
Co-authored-by: Zoltan Kochan <z@kochan.io>
Co-authored-by: David Michon <dmichon@microsoft.com>
2022-06-14 23:31:16 +03:00
Zoltan Kochan
d5730ba815 feat: ca and cert may be set to an array of strings 2022-06-09 01:11:35 +03:00
spencer17x
ae2f845c5d fix: only devDependencies are installed regardless of the node env (#4805)
close #4745
2022-05-27 03:05:20 +03:00
Zoltan Kochan
05159665d4 fix: correctly detect the active Node.js version (#4780)
close #4203
2022-05-23 11:34:51 +03:00
Zoltan Kochan
af22c6c4fe fix(config): checking global-bin-dir in PATH (#4751)
When global-bin-dir is pointing to a symlink.

close #4744
2022-05-17 16:59:52 +03:00
Zoltan Kochan
e05dcc48a0 feat: add legacy-dir-filtering (#4610)
close #4606
2022-04-23 16:23:04 +03:00
Zoltan Kochan
066f38dda3 feat: shrink path to the global directory (to reduce chance of too long names on Windows) (#4591) 2022-04-19 14:48:28 +03:00
Kenrick
c6463b9fd0 feat(git-fetcher): shallow clone when fetching git resource (#4548)
Co-authored-by: Zoltan Kochan <z@kochan.io>
2022-04-14 12:08:59 +03:00
Zoltan Kochan
72b79f55a0 fix: auto-install-peers 2022-04-12 01:05:19 +03:00
Zoltan Kochan
4bed585e23 feat: remove deprecated settings (#4519) 2022-04-02 01:01:54 +03:00
傅鹏
8dac029ef6 chore: public-hoist-pattern prettier config (#3954)
* chore: public-hoist-pattern prettier config

* docs: add changesets

Co-authored-by: Zoltan Kochan <z@kochan.io>
2022-04-01 23:21:18 +03:00
Zoltan Kochan
8fa95fd868 fix(cmd-shim): extend NODE_PATH with path to hidden hoisted dir (#4513)
Deprecating `extend-node-path` in pnpm v7 has caused issues with "next dev".

This change is bringing back extending `NODE_PATH` in bin command shims. However, only when `node-linker` is set to `isolated` and packages are hoisted to `node_modules/.pnpm/node_modules`. Only `node_modules/.pnpm/node_modules` is added to `NODE_PATH`, so it should not cause too long input errors (as it was sometimes the case in pnpm v6)
2022-04-01 21:58:46 +03:00
CommanderRoot
bc35dff9a9 chore: replace deprecated String.prototype.substr() (#4479)
Co-authored-by: Zoltan Kochan <z@kochan.io>
2022-03-25 23:04:20 +02:00
Zoltan Kochan
546e644e93 fix: types should not be hoisted to the root of node_modules (#4459)
close #4457
2022-03-23 02:03:00 +02:00
Zoltan Kochan
73d71a2d5b feat: strict-peer-dependencies is true by default (#4427) 2022-03-10 11:54:19 +02:00
Zoltan Kochan
585e9ca9ec feat!: global bins should be created only in predefined locations (#4280) 2022-01-31 18:01:37 +02:00
Zoltan Kochan
3b77e2f1e5 Merge remote-tracking branch 'origin/main' into v7 2022-01-30 22:20:07 +02:00
LeSuisse
334e5340a4 feat: add support of the update-notifier configuration option (#4285)
The configuration option `update-notifier` allows users to disable the
update verification. This is interesting when pnpm is installed from
another package manager because the given instructions will not be
accurate. The `update-notifier` option exists in NPM so it can also
ease the migration to pnpm.
(https://docs.npmjs.com/cli/v8/using-npm/config#update-notifier).

close #4158.

Co-authored-by: Zoltan Kochan <z@kochan.io>
2022-01-28 00:54:02 +02:00
Zoltan Kochan
fa656992c4 feat!: embed-readme is false by default 2022-01-23 02:27:17 +02:00
Zoltan Kochan
73fce0d935 Merge branch 'main' into v7 2022-01-20 23:28:21 +02:00
Dan Onoshko
b7566b9791 feat: embed-readme option (#4265) 2022-01-20 19:20:27 +02:00
Zoltan Kochan
5168591786 feat!: breaking config changes for v7 (#4253)
ref https://github.com/pnpm/pnpm/discussions/3536
2022-01-20 12:34:14 +02:00
Zoltan Kochan
fff0e4493b fix: side effects cache should work in a workspace 2022-01-14 17:37:01 +02:00
Zoltan Kochan
e76151f669 feat: pnpm add <pkg> autoinstalls any missing peer dependencies (#4213)
ref #3995
2022-01-11 16:27:12 +02:00
Zoltan Kochan
8fe8f5e55e feat: --ignore-workspace option 2022-01-04 04:44:00 +02:00
Zoltan Kochan
0b8d0ee873 refactor: rename the values of the node-linker setting (#4185)
ref #4073
2022-01-03 13:43:37 +02:00
Zoltan Kochan
732d4962f5 feat: Create a node modules directory without using symlinks (#4162)
ref #4073
2021-12-31 22:41:54 +02:00
Dave Brotherstone
a6cf11cb77 feat(config): add support for token helper (#4163)
* feat(config): add support for token helper

Use the new interface in `pnpm/credentials-by-uri` for supporting token
helpers. A token helper is an executable, set in the user's `.npmrc`
which outputs an auth token. This can be used in situations where the
`authToken` is not a constant value, but is something that refreshes
regularly, where a script or other tool can use an existing refresh
token to obtain a new access token.

The configuration for the path to the helper must be an absolute path,
with no arguments. In order to be secure, it is _only_ permitted to set
this value in the user `.npmrc`, otherwise a project could place a value
in a project local `.npmrc` and run arbitrary executables.

A similar feature is available in many similar tools. The implementation
in `credentials-by-uri` is modelled after the `vault` (vaultproject.io)
implementation - https://github.com/hashicorp/vault/blob/main/command/token/helper_external.go

* test: fix

* docs: add changesets

Co-authored-by: Zoltan Kochan <z@kochan.io>
2021-12-30 23:16:06 +02:00
Igor Bezkrovnyi
927c4a0890 feat: aggregate-output (#4109)
close #4070
2021-12-11 23:46:20 +02:00
Zoltan Kochan
30bfca9671 fix: don't add trailing slash to registry URLs
ref #2933
ref #4034
ref #4032
2021-12-06 21:17:53 +02:00
Zoltan Kochan
46aaf7108d revert: "fix: don't add trailing slash to registry URLs (#4032)" (#4059)
* revert: "fix: don't add trailing slash to registry URLs (#4032)"

This reverts commit a7ff2d5ceb.

* docs: add changesets
2021-12-02 16:19:18 +02:00
Zoltan Kochan
8a99a01ff6 feat(core): overrides, packageExtensions, and neverBuiltDependencies are options (#4050) 2021-11-30 18:01:11 +02:00
Zoltan Kochan
a7ff2d5ceb fix: don't add trailing slash to registry URLs (#4032)
ref #2933
close #4034
2021-11-23 02:17:08 +02:00
Zoltan Kochan
0027785595 feat: scripts-prepend-node-path (#4020) 2021-11-21 03:53:35 +02:00
Kaito Udagawa
b6d74c5458 chore(config): allow a system's package manager to override pnpm's default settings (#3896)
https://github.com/Homebrew/homebrew-core/pull/85890
2021-10-20 18:43:54 +03:00
Zoltan Kochan
bd7bcdbe8e feat: new setting - maxsockets (#3889) 2021-10-19 00:45:36 +03:00
Zoltan Kochan
917b95c01f fix: upgrade typescript to v4.4.4 2021-10-16 23:33:34 +03:00
Zoltan Kochan
5ee3b2dc77 fix: use single global config file for all npm/pnpm versions (#3873) 2021-10-15 13:10:02 +03:00
Cheng
ef9d2719a1 feat(pnpm): add filterLog hook to pnpmfile (#3802)
Co-authored-by: Zoltan Kochan <z@kochan.io>
2021-10-10 02:41:28 +03:00
Cheng
4027a3c691 feat: move requireHooks to pnpm CLI (#3835)
Co-authored-by: Zoltan Kochan <z@kochan.io>
2021-10-09 02:38:31 +03:00
Zoltan Kochan
c7081cbb43 feat: new option - extend-node-path (#3799)
close #2890
2021-09-28 22:36:20 +03:00
Igor Bezkrovnyi
fe5688dc0c feat: changed-files-ignore-pattern option (#3797) 2021-09-27 00:42:43 +03:00
Zoltan Kochan
d62259d677 feat(config): new global packages location in beta mode (#3781) 2021-09-21 03:01:59 +03:00