PNpM CLI
Minor Changes
-
Dependencies patching is possible via the
pnpm.patchedDependenciesfield of thepackage.json. To patch a package, the package name, exact version, and the relative path to the patch file should be specified. For instance:{ "pnpm": { "patchedDependencies": { "eslint@1.0.0": "./patches/eslint@1.0.0.patch" } } } -
Two new commands added:
pnpm patchandpnpm patch-commit.pnpm patch <pkg>prepares a package for patching. For instance, if you want to patch express v1, run:pnpm patch express@1.0.0pnpm will create a temporary directory with
express@1.0.0that you can modify with your changes. Once you are read with your changes, run:pnpm patch-commit <path to temp folder>This will create a patch file and write it to
<project>/patches/express@1.0.0.patch. Also, it will reference this new patch file from thepatchedDependenciesfield inpackage.json:{ "pnpm": { "patchedDependencies": { "express@1.0.0": "patches/express@1.0.0.patch" } } } -
A new experimental command added:
pnpm deploy. The deploy command takes copies a project from a workspace and installs all of its production dependencies (even if some of those dependencies are other projects from the workspace).For example, the new command will deploy the project named
footo thedistdirectory in the root of the workspace:pnpm --filter=foo deploy dist -
package-import-methodsupports a new option:clone-or-copy. -
New setting added:
include-workspace-root. When it is set totrue, therun,exec,add, andtestcommands will include the root package, when executed recursively #4906
Patch Changes
-
Don't crash when
pnpm update --interactiveis cancelled with Ctrl+c. -
The
use-node-versionsetting should work with prerelease Node.js versions. For instance:use-node-version=18.0.0-rc.3 -
Return early when the lockfile is up-to-date.
-
Resolve native workspace path for case-insensitive file systems #4904.
-
Don't link local dev dependencies, when prod dependencies should only be installed.
-
pnpm audit --fixshould not add an override for a vulnerable package that has no fixes released. -
Update the compatibility database.
Our Gold Sponsors
<table> <tbody> <tr> <td align="center" valign="middle"> <a href="https://bit.dev/?utm_source=pnpm&utm_medium=release_notes" target="_blank"><img src="https://raw.githubusercontent.com/pnpm/pnpm.github.io/main/static/img/users/bit.svg" width="80"></a> </td> <td align="center" valign="middle"> <a href="https://nhost.io/?utm_source=pnpm&utm_medium=release_notes" target="_blank"><img src="https://raw.githubusercontent.com/pnpm/pnpm.github.io/main/static/img/users/nhost.svg" width="180"></a> </td> </tr> </tbody> </table>
Our Silver Sponsors
<table> <tbody> <tr> <td align="center" valign="middle"> <a href="https://prisma.io/?utm_source=pnpm&utm_medium=release_notes" target="_blank"><img src="https://raw.githubusercontent.com/pnpm/pnpm.github.io/main/static/img/users/prisma.svg" width="180"></a> </td> <td align="center" valign="middle"> <a href="https://leniolabs.com/?utm_source=pnpm&utm_medium=release_notes" target="_blank"><img src="https://raw.githubusercontent.com/pnpm/pnpm.github.io/main/static/img/users/leniolabs.jpg" width="80"></a> </td> <td align="center" valign="middle"> <a href="https://vercel.com/?utm_source=pnpm&utm_medium=release_notes" target="_blank"><img src="https://raw.githubusercontent.com/pnpm/pnpm.github.io/main/static/img/users/vercel.svg" width="180"></a> </td> <td align="center" valign="middle"> <a href="https://www.takeshape.io/?utm_source=pnpm&utm_medium=release_notes" target="_blank"><img src="https://raw.githubusercontent.com/pnpm/pnpm.github.io/main/static/img/users/takeshape.svg" width="280"></a> </td> </tr> </tbody> </table>
What's Changed
- feat: patch package by @zkochan in https://github.com/pnpm/pnpm/pull/4885
- feat: add
patchandpatch-commitcommands by @zkochan in https://github.com/pnpm/pnpm/pull/4900 - fix(env):
use-node-versionshould work with prerelease versions by @zkochan in https://github.com/pnpm/pnpm/pull/4903 - refactor: create @pnpm/node.fetcher by @zkochan in https://github.com/pnpm/pnpm/pull/4908
- feat(patch): update patched dependencies on install by @zkochan in https://github.com/pnpm/pnpm/pull/4905
- fix: throw an error if not all patches were applied by @zkochan in https://github.com/pnpm/pnpm/pull/4911
- fix: a modified patch should update the deps on install by @zkochan in https://github.com/pnpm/pnpm/pull/4918
- fix: packages should be patched even when scripts are ignored by @zkochan in https://github.com/pnpm/pnpm/pull/4922
- fix: patch package even if it is not in the onlyBuiltDependencies list by @zkochan in https://github.com/pnpm/pnpm/pull/4925
- fix: respect include-workspace-root npmrc option by @shirotech in https://github.com/pnpm/pnpm/pull/4928
- fix: install --lockfile-only should exit early by @zkochan in https://github.com/pnpm/pnpm/pull/4932
- fix: resolve real path for case insensitive systems by @mdogadailo in https://github.com/pnpm/pnpm/pull/4935
- feat: deploy command by @zkochan in https://github.com/pnpm/pnpm/pull/4933
- fix: use recursive for deploy command directory creation by @ragrag in https://github.com/pnpm/pnpm/pull/4943
- fix: don't fail when the patched pkg appears multiple times by @zkochan in https://github.com/pnpm/pnpm/pull/4945
New Contributors
- @shirotech made their first contribution in https://github.com/pnpm/pnpm/pull/4928
- @mdogadailo made their first contribution in https://github.com/pnpm/pnpm/pull/4935
- @ragrag made their first contribution in https://github.com/pnpm/pnpm/pull/4943
Full Changelog: https://github.com/pnpm/pnpm/compare/v7.3.0...v7.4.0