You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+18-4Lines changed: 18 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,7 +3,10 @@
3
3
[![npm version][npm-image]][npm-url]
4
4
[![CI][ci-image]][ci-url]
5
5
6
-
This CLI tool checks to ensure that dependencies are on consistent versions across a monorepo / yarn workspace. For example, every package in a workspace that has a dependency on `eslint` should specify the same version for it.
6
+
This CLI tool enforces the following aspects of consistency across a monorepo / yarn workspace:
7
+
8
+
1. Dependencies are on consistent versions. For example, every package in a workspace that has a dependency on `eslint` should specify the same version for it.
9
+
2. Dependencies on local packages use the local packages directly instead of older versions of them. For example, if one package `package1` in a workspace depends on another package `package2` in the workspace, `package1` should request the current version of `package2`.
7
10
8
11
## Motivation
9
12
@@ -27,9 +30,9 @@ To run, use this command and optionally pass the path to the workspace root (whe
27
30
yarn check-dependency-version-consistency .
28
31
```
29
32
30
-
If there are no dependency mismatches, the program will exit with success.
33
+
If there are no inconsistencies, the program will exit with success.
31
34
32
-
If there are any dependency mismatches, the program will exit with failure and output the mismatching versions.
35
+
If there are any inconsistencies, the program will exit with failure and output the mismatching versions.
33
36
34
37
## Example
35
38
@@ -57,6 +60,9 @@ If there are any dependency mismatches, the program will exit with failure and o
57
60
"name": "package1",
58
61
"devDependencies": {
59
62
"eslint": "^8.0.0"
63
+
},
64
+
"dependencies": {
65
+
"package2": "^0.0.0"
60
66
}
61
67
}
62
68
```
@@ -66,6 +72,7 @@ If there are any dependency mismatches, the program will exit with failure and o
66
72
```json
67
73
{
68
74
"name": "package2",
75
+
"version": "1.0.0",
69
76
"devDependencies": {
70
77
"eslint": "^7.0.0"
71
78
}
@@ -86,14 +93,21 @@ If there are any dependency mismatches, the program will exit with failure and o
86
93
Output:
87
94
88
95
```pt
89
-
Found 1 dependency with mismatching versions across the workspace. Fix with `--fix`.
96
+
Found 2 dependencies with mismatching versions across the workspace. Fix with `--fix`.
0 commit comments