Skip to content

Commit

Permalink
docs(pnpm): add note about pnpm vs bazel patching (#1916)
Browse files Browse the repository at this point in the history
  • Loading branch information
jbedard committed Sep 12, 2024
1 parent dc07ad1 commit bf93e47
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion docs/pnpm.md
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,9 @@ git config --global merge.ours.driver true

### Patching via pnpm.patchedDependencies

Patches included in [pnpm.patchedDependencies](https://pnpm.io/next/package_json#pnpmpatcheddependencies) are automatically applied. These patches must be included in the `data` attribute of `npm_translate_lock`, for example:
Patches included in [pnpm.patchedDependencies](https://pnpm.io/next/package_json#pnpmpatcheddependencies) are automatically applied by rules_js.

These patches must be included in the `data` attribute of `npm_translate_lock`, for example:

```json
{
Expand All @@ -216,6 +218,12 @@ npm_translate_lock(
)
```

Patching applied by rules_js may slightly deviate from standard pnpm patching behavior.
The [bazel-lib patch util](https://docs.aspect.build/rulesets/aspect_bazel_lib/docs/repo_utils/#patch)
is used for patching within rules_js instead of the internal pnpm patching mechanism.
For example a bad patch file may be partially applied when using pnpm outside of bazel but fail
when applied by rules_js, see [rules_js #1915](https://github.com/aspect-build/rules_js/issues/1915).

### Patching via `patches` attribute

We recommend patching via [pnpm.patchedDependencies](#patching-via-pnpmpatcheddependencies) as above, but if you are importing
Expand Down

0 comments on commit bf93e47

Please sign in to comment.