yarn-berry-deduplicate 6.0.4 → 6.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +10 -38
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,59 +1,31 @@
|
|
|
1
|
-
# yarn-deduplicate
|
|
1
|
+
# yarn-berry-deduplicate
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
Builds:
|
|
6
|
-
[](https://github.com/scinos/yarn-deduplicate/actions/workflows/node.js.yml)
|
|
7
|
-
|
|
8
|
-
This package only works with Yarn v1. Yarn v2 supports package deduplication
|
|
9
|
-
[natively](https://github.com/yarnpkg/berry/pull/1558)!
|
|
10
|
-
|
|
11
|
-
A duplicate package is when two dependencies are resolved to a different version, even when a single
|
|
12
|
-
version matches the range specified in the dependencies. See the
|
|
13
|
-
[Deduplication strategies](#deduplication-strategies) section for a few examples.
|
|
14
|
-
|
|
15
|
-
## Installation
|
|
16
|
-
|
|
17
|
-
Install the package globally:
|
|
18
|
-
|
|
19
|
-
```sh
|
|
20
|
-
npm install -g yarn-deduplicate
|
|
21
|
-
```
|
|
3
|
+
*This is a fork of [yarn-deduplicate](https://www.npmjs.com/package/yarn-deduplicate) for yarn berry. *
|
|
22
4
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
```sh
|
|
26
|
-
yarn global add yarn-deduplicate
|
|
27
|
-
```
|
|
28
|
-
|
|
29
|
-
This package also works wth
|
|
30
|
-
[npx](https://medium.com/@maybekatz/introducing-npx-an-npm-package-runner-55f7d4bd282b), so you
|
|
31
|
-
don't need to install it. For example, to recreate the most common scenario below with `npx`, run:
|
|
5
|
+
Cleans up `yarn.lock` by removing duplicates.
|
|
32
6
|
|
|
33
|
-
|
|
34
|
-
npx yarn-deduplicate yarn.lock
|
|
35
|
-
```
|
|
7
|
+
Yarn berry includes [`yarn dedupe`](https://yarnpkg.com/cli/dedupe) that currently only supports "highest" strategy. Follow this issue: https://github.com/yarnpkg/berry/issues/2297.
|
|
36
8
|
|
|
37
|
-
|
|
9
|
+
In the meantime, this is a fork of [yarn-deduplicate](https://www.npmjs.com/package/yarn-deduplicate) that works with both highest and fewer strategies.
|
|
38
10
|
|
|
39
11
|
## Usage
|
|
40
12
|
|
|
41
|
-
The most common scenario is to run
|
|
42
|
-
|
|
43
13
|
```sh
|
|
44
|
-
yarn-deduplicate
|
|
14
|
+
yarn dlx yarn-berry-deduplicate
|
|
45
15
|
```
|
|
46
16
|
|
|
47
|
-
This will use the
|
|
17
|
+
This will use the fewest then highest strategy to remove duplicated packages in `yarn.lock`.
|
|
48
18
|
|
|
49
19
|
If you do not specify the yarn.lock path, it defaults to `yarn.lock`.
|
|
50
20
|
|
|
51
21
|
Check all available options with:
|
|
52
22
|
|
|
53
23
|
```sh
|
|
54
|
-
yarn-deduplicate --help
|
|
24
|
+
yarn dlx yarn-berry-deduplicate --help
|
|
55
25
|
```
|
|
56
26
|
|
|
27
|
+
Note: you can apply multiple times deduplication and each time dedupe more. To prevent issues, try running `yarn dedupe` after each `yarn-berry-deduplicate`.
|
|
28
|
+
|
|
57
29
|
---
|
|
58
30
|
|
|
59
31
|
## Duplicated packages
|