syncpack 7.2.1 → 8.2.4
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 +120 -14
- package/dist/bin-fix-mismatches/fix-mismatches.js +6 -1
- package/dist/bin-fix-mismatches/index.js +1 -0
- package/dist/bin-lint-semver-ranges/index.js +1 -0
- package/dist/bin-list/index.js +1 -0
- package/dist/bin-list/list.js +12 -3
- package/dist/bin-list-mismatches/index.js +1 -0
- package/dist/bin-list-mismatches/list-mismatches.js +51 -8
- package/dist/bin-set-semver-ranges/index.js +1 -0
- package/dist/bin-set-semver-ranges/set-semver-ranges.js +7 -1
- package/dist/constants.d.ts +14 -4
- package/dist/constants.js +9 -1
- package/dist/lib/disk.d.ts +1 -1
- package/dist/lib/disk.js +17 -7
- package/dist/lib/get-input/get-config.js +25 -8
- package/dist/lib/get-input/get-instances.js +49 -30
- package/dist/lib/get-input/get-wrappers/get-file-paths.d.ts +1 -4
- package/dist/lib/get-input/get-wrappers/get-file-paths.js +4 -6
- package/dist/lib/get-input/get-wrappers/get-patterns/get-lerna-patterns.d.ts +2 -2
- package/dist/lib/get-input/get-wrappers/get-patterns/get-pnpm-patterns.d.ts +2 -2
- package/dist/lib/get-input/get-wrappers/get-patterns/get-yarn-patterns.d.ts +2 -2
- package/dist/lib/get-input/get-wrappers/get-patterns/index.d.ts +1 -4
- package/dist/lib/get-input/get-wrappers/get-patterns/index.js +7 -4
- package/dist/lib/get-input/get-wrappers/index.d.ts +4 -1
- package/dist/lib/get-input/get-wrappers/tap.d.ts +11 -1
- package/dist/lib/get-input/get-wrappers/tap.js +19 -1
- package/dist/lib/log.d.ts +1 -1
- package/dist/lib/log.js +38 -2
- package/dist/lib/{write-if-changed.d.ts → write-if-changed/index.d.ts} +2 -2
- package/dist/lib/{write-if-changed.js → write-if-changed/index.js} +7 -5
- package/dist/lib/write-if-changed/set-newlines.d.ts +4 -0
- package/dist/lib/write-if-changed/set-newlines.js +24 -0
- package/dist/option.d.ts +1 -0
- package/dist/option.js +5 -4
- package/package.json +16 -16
package/README.md
CHANGED
|
@@ -14,6 +14,13 @@
|
|
|
14
14
|
npm install --global syncpack
|
|
15
15
|
```
|
|
16
16
|
|
|
17
|
+
## 🤖 GitHub Action
|
|
18
|
+
|
|
19
|
+
As of May 2022 there is now a
|
|
20
|
+
[Syncpack GitHub Action](https://github.com/marketplace/actions/syncpack-synchronise-monorepo-dependency-versions).
|
|
21
|
+
It is new and less stable than syncpack itself, but please give it a try and
|
|
22
|
+
[give your feedback](https://github.com/JamieMason/syncpack-github-action/issues/new).
|
|
23
|
+
|
|
17
24
|
## 📝 Commands
|
|
18
25
|
|
|
19
26
|
### fix-mismatches
|
|
@@ -34,7 +41,8 @@ See [`versionGroups`](#versiongroups) if you have advanced requirements.
|
|
|
34
41
|
-d, --dev include devDependencies
|
|
35
42
|
-P, --peer include peerDependencies
|
|
36
43
|
-R, --resolutions include resolutions (yarn)
|
|
37
|
-
-o, --overrides include overrides (
|
|
44
|
+
-o, --overrides include overrides (npm)
|
|
45
|
+
-O, --pnpmOverrides include overrides (pnpm)
|
|
38
46
|
-w, --workspace include locally developed package versions
|
|
39
47
|
-i, --indent [value] override indentation. defaults to " "
|
|
40
48
|
-c, --config <path> path to a syncpack config file
|
|
@@ -116,7 +124,8 @@ See [`semverGroups`](#semvergroups) if you have advanced requirements.
|
|
|
116
124
|
-d, --dev include devDependencies
|
|
117
125
|
-P, --peer include peerDependencies
|
|
118
126
|
-R, --resolutions include resolutions (yarn)
|
|
119
|
-
-o, --overrides include overrides (
|
|
127
|
+
-o, --overrides include overrides (npm)
|
|
128
|
+
-O, --pnpmOverrides include overrides (pnpm)
|
|
120
129
|
-f, --filter [pattern] only include dependencies whose name matches this regex
|
|
121
130
|
-r, --semver-range <range> see supported ranges below. defaults to ""
|
|
122
131
|
-c, --config <path> path to a syncpack config file
|
|
@@ -161,7 +170,8 @@ List all dependencies required by your packages.
|
|
|
161
170
|
-d, --dev include devDependencies
|
|
162
171
|
-P, --peer include peerDependencies
|
|
163
172
|
-R, --resolutions include resolutions (yarn)
|
|
164
|
-
-o, --overrides include overrides (
|
|
173
|
+
-o, --overrides include overrides (npm)
|
|
174
|
+
-O, --pnpmOverrides include overrides (pnpm)
|
|
165
175
|
-f, --filter [pattern] only include dependencies whose name matches this regex
|
|
166
176
|
-c, --config <path> path to a syncpack config file
|
|
167
177
|
-w, --workspace include locally developed package versions
|
|
@@ -206,7 +216,8 @@ See [`versionGroups`](#versiongroups) if you have advanced requirements.
|
|
|
206
216
|
-d, --dev include devDependencies
|
|
207
217
|
-P, --peer include peerDependencies
|
|
208
218
|
-R, --resolutions include resolutions (yarn)
|
|
209
|
-
-o, --overrides include overrides (
|
|
219
|
+
-o, --overrides include overrides (npm)
|
|
220
|
+
-O, --pnpmOverrides include overrides (pnpm)
|
|
210
221
|
-f, --filter [pattern] only include dependencies whose name matches this regex
|
|
211
222
|
-c, --config <path> path to a syncpack config file
|
|
212
223
|
-w, --workspace include locally developed package versions
|
|
@@ -253,7 +264,8 @@ See [`semverGroups`](#semvergroups) if you have advanced requirements.
|
|
|
253
264
|
-d, --dev include devDependencies
|
|
254
265
|
-P, --peer include peerDependencies
|
|
255
266
|
-R, --resolutions include resolutions (yarn)
|
|
256
|
-
-o, --overrides include overrides (
|
|
267
|
+
-o, --overrides include overrides (npm)
|
|
268
|
+
-O, --pnpmOverrides include overrides (pnpm)
|
|
257
269
|
-w, --workspace include locally developed package versions
|
|
258
270
|
-i, --indent [value] override indentation. defaults to " "
|
|
259
271
|
-r, --semver-range <range> see supported ranges below. defaults to ""
|
|
@@ -311,6 +323,7 @@ configuration file (if present), you can use the `--config` option.
|
|
|
311
323
|
"indent": " ",
|
|
312
324
|
"overrides": true,
|
|
313
325
|
"peer": true,
|
|
326
|
+
"pnpmOverrides": true,
|
|
314
327
|
"prod": true,
|
|
315
328
|
"resolutions": true,
|
|
316
329
|
"workspace": true,
|
|
@@ -331,17 +344,17 @@ configuration file (if present), you can use the `--config` option.
|
|
|
331
344
|
}
|
|
332
345
|
```
|
|
333
346
|
|
|
334
|
-
### `dev`, `peer`, `prod`, `resolutions`, `overrides`, and `workspace`
|
|
347
|
+
### `dev`, `peer`, `prod`, `resolutions`, `overrides`, `pnpmOverrides`, and `workspace`
|
|
335
348
|
|
|
336
349
|
Whether to search within `devDependencies`, `peerDependencies`, `dependencies`,
|
|
337
|
-
`resolutions` (Yarn), `overrides` (
|
|
338
|
-
package.json files of your own packages developed
|
|
339
|
-
respectively.
|
|
350
|
+
`resolutions` (Yarn), `overrides` (npm), `pnpmOverrides` (pnpm), and the
|
|
351
|
+
`version` property of the package.json files of your own packages developed
|
|
352
|
+
within your `workspace` respectively.
|
|
340
353
|
|
|
341
354
|
All of these locations are searched by default but they can be disabled
|
|
342
355
|
individually in your config file. If any are set via the command line options
|
|
343
|
-
`--dev`, `--peer`, `--prod`, `--resolutions`, `--overrides`,
|
|
344
|
-
then only the options you provide will be searched.
|
|
356
|
+
`--dev`, `--peer`, `--prod`, `--resolutions`, `--overrides`, `--pnpmOverrides`,
|
|
357
|
+
or `--workspace` then only the options you provide will be searched.
|
|
345
358
|
|
|
346
359
|
### `filter`
|
|
347
360
|
|
|
@@ -447,6 +460,49 @@ to apply to an entire package:
|
|
|
447
460
|
|
|
448
461
|
See [`semverGroups`](#semverGroups) for more examples, they work the same way.
|
|
449
462
|
|
|
463
|
+
#### `versionGroup.dependencies`
|
|
464
|
+
|
|
465
|
+
Required. An array of minimatch glob patterns which should match the key of
|
|
466
|
+
dependencies defined in your package.json files.
|
|
467
|
+
|
|
468
|
+
| Pattern | Matches |
|
|
469
|
+
| ------------------------ | ---------------------------------------- |
|
|
470
|
+
| `["**"]` | Any dependency |
|
|
471
|
+
| `["@aws-sdk/**"]` | Any dependency with the scope `@aws-sdk` |
|
|
472
|
+
| `["react", "react-dom"]` | Specific dependencies by name |
|
|
473
|
+
|
|
474
|
+
#### `versionGroup.packages`
|
|
475
|
+
|
|
476
|
+
Required. An array of minimatch glob patterns which should match the `name`
|
|
477
|
+
property of packages developed within your monorepo.
|
|
478
|
+
|
|
479
|
+
| Pattern | Matches |
|
|
480
|
+
| ---------------------------- | ------------------------------------- |
|
|
481
|
+
| `["**"]` | Any package |
|
|
482
|
+
| `["@my-repo/**"]` | Any package with the scope `@my-repo` |
|
|
483
|
+
| `["my-server", "my-client"]` | Specific packages by name |
|
|
484
|
+
|
|
485
|
+
#### `versionGroup.dependencyTypes`
|
|
486
|
+
|
|
487
|
+
Optional. If set, will result in only the dependency types included in that
|
|
488
|
+
array being considered a match for this version group.
|
|
489
|
+
|
|
490
|
+
In this example we define that all dependencies within `peerDependencies` in the
|
|
491
|
+
repo must match, regardless of what versions of the same dependencies might be
|
|
492
|
+
used in `dependencies` or `devDependencies`.
|
|
493
|
+
|
|
494
|
+
```json
|
|
495
|
+
{
|
|
496
|
+
"versionGroups": [
|
|
497
|
+
{
|
|
498
|
+
"dependencies": ["**"],
|
|
499
|
+
"dependencyTypes": ["peer"],
|
|
500
|
+
"packages": ["**"]
|
|
501
|
+
}
|
|
502
|
+
]
|
|
503
|
+
}
|
|
504
|
+
```
|
|
505
|
+
|
|
450
506
|
#### `versionGroup.isBanned`
|
|
451
507
|
|
|
452
508
|
Remove dependencies which you've decided should never be allowed.
|
|
@@ -455,8 +511,8 @@ Remove dependencies which you've decided should never be allowed.
|
|
|
455
511
|
{
|
|
456
512
|
"versionGroups": [
|
|
457
513
|
{
|
|
458
|
-
"isBanned": true,
|
|
459
514
|
"dependencies": ["never-gonna"],
|
|
515
|
+
"isBanned": true,
|
|
460
516
|
"packages": ["**"]
|
|
461
517
|
}
|
|
462
518
|
]
|
|
@@ -472,9 +528,9 @@ you've defined.
|
|
|
472
528
|
{
|
|
473
529
|
"versionGroups": [
|
|
474
530
|
{
|
|
475
|
-
"pinVersion": "3.55.0",
|
|
476
531
|
"dependencies": ["@aws-sdk/**"],
|
|
477
|
-
"packages": ["**"]
|
|
532
|
+
"packages": ["**"],
|
|
533
|
+
"pinVersion": "3.55.0"
|
|
478
534
|
}
|
|
479
535
|
]
|
|
480
536
|
}
|
|
@@ -534,6 +590,56 @@ semver range of `~`, regardless of what the rest of the monorepo uses:
|
|
|
534
590
|
}
|
|
535
591
|
```
|
|
536
592
|
|
|
593
|
+
3: Production dependencies should have fixed version numbers, but development
|
|
594
|
+
and peer dependencies can be broader.
|
|
595
|
+
|
|
596
|
+
```json
|
|
597
|
+
{
|
|
598
|
+
"semverGroups": [
|
|
599
|
+
{
|
|
600
|
+
"range": "",
|
|
601
|
+
"dependencyTypes": [
|
|
602
|
+
"prod",
|
|
603
|
+
"resolutions",
|
|
604
|
+
"overrides",
|
|
605
|
+
"pnpmOverrides",
|
|
606
|
+
"workspace"
|
|
607
|
+
],
|
|
608
|
+
"dependencies": ["**"],
|
|
609
|
+
"packages": ["**"]
|
|
610
|
+
},
|
|
611
|
+
{
|
|
612
|
+
"range": "~",
|
|
613
|
+
"dependencyTypes": ["dev"],
|
|
614
|
+
"dependencies": ["**"],
|
|
615
|
+
"packages": ["**"]
|
|
616
|
+
},
|
|
617
|
+
{
|
|
618
|
+
"range": "^",
|
|
619
|
+
"dependencyTypes": ["peer"],
|
|
620
|
+
"dependencies": ["**"],
|
|
621
|
+
"packages": ["**"]
|
|
622
|
+
}
|
|
623
|
+
]
|
|
624
|
+
}
|
|
625
|
+
```
|
|
626
|
+
|
|
627
|
+
#### `semverGroup.range`
|
|
628
|
+
|
|
629
|
+
Which of the [Supported Ranges](#supported-ranges) this group should use.
|
|
630
|
+
|
|
631
|
+
#### `semverGroup.dependencies`
|
|
632
|
+
|
|
633
|
+
Works the same as [`semverGroup.dependencies`](#semvergroupdependencies).
|
|
634
|
+
|
|
635
|
+
#### `semverGroup.packages`
|
|
636
|
+
|
|
637
|
+
Works the same as [`semverGroup.packages`](#semvergrouppackages).
|
|
638
|
+
|
|
639
|
+
#### `semverGroup.dependencyTypes`
|
|
640
|
+
|
|
641
|
+
Works the same as [`semverGroup.dependencyTypes`](#semvergroupdependencytypes).
|
|
642
|
+
|
|
537
643
|
## 🕵🏾♀️ Resolving Packages
|
|
538
644
|
|
|
539
645
|
package.json files are resolved in this order of precendence:
|
|
@@ -33,7 +33,12 @@ function fixMismatches(input, disk) {
|
|
|
33
33
|
var dependencyType = _a.dependencyType, version = _a.version, wrapper = _a.wrapper;
|
|
34
34
|
var root = wrapper.contents;
|
|
35
35
|
if (version !== nextVersion_1) {
|
|
36
|
-
|
|
36
|
+
if (dependencyType === 'pnpmOverrides') {
|
|
37
|
+
root.pnpm.overrides[name] = nextVersion_1;
|
|
38
|
+
}
|
|
39
|
+
else {
|
|
40
|
+
root[dependencyType][name] = nextVersion_1;
|
|
41
|
+
}
|
|
37
42
|
}
|
|
38
43
|
});
|
|
39
44
|
}
|
|
@@ -62,6 +62,7 @@ commander_1.program.on('--help', function () {
|
|
|
62
62
|
indent: commander_1.program.opts().indent,
|
|
63
63
|
overrides: commander_1.program.opts().overrides,
|
|
64
64
|
peer: commander_1.program.opts().peer,
|
|
65
|
+
pnpmOverrides: commander_1.program.opts().pnpmOverrides,
|
|
65
66
|
prod: commander_1.program.opts().prod,
|
|
66
67
|
resolutions: commander_1.program.opts().resolutions,
|
|
67
68
|
source: commander_1.program.opts().source,
|
|
@@ -61,6 +61,7 @@ commander_1.program.on('--help', function () {
|
|
|
61
61
|
filter: commander_1.program.opts().filter,
|
|
62
62
|
overrides: commander_1.program.opts().overrides,
|
|
63
63
|
peer: commander_1.program.opts().peer,
|
|
64
|
+
pnpmOverrides: commander_1.program.opts().pnpmOverrides,
|
|
64
65
|
prod: commander_1.program.opts().prod,
|
|
65
66
|
resolutions: commander_1.program.opts().resolutions,
|
|
66
67
|
semverRange: commander_1.program.opts().semverRange,
|
package/dist/bin-list/index.js
CHANGED
|
@@ -60,6 +60,7 @@ commander_1.program.on('--help', function () {
|
|
|
60
60
|
filter: commander_1.program.opts().filter,
|
|
61
61
|
overrides: commander_1.program.opts().overrides,
|
|
62
62
|
peer: commander_1.program.opts().peer,
|
|
63
|
+
pnpmOverrides: commander_1.program.opts().pnpmOverrides,
|
|
63
64
|
prod: commander_1.program.opts().prod,
|
|
64
65
|
resolutions: commander_1.program.opts().resolutions,
|
|
65
66
|
source: commander_1.program.opts().source,
|
package/dist/bin-list/list.js
CHANGED
|
@@ -9,6 +9,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
9
9
|
exports.__esModule = true;
|
|
10
10
|
exports.list = void 0;
|
|
11
11
|
var chalk_1 = __importDefault(require("chalk"));
|
|
12
|
+
var get_expected_version_1 = require("../bin-fix-mismatches/get-expected-version");
|
|
13
|
+
var constants_1 = require("../constants");
|
|
12
14
|
var list_version_groups_1 = require("./list-version-groups");
|
|
13
15
|
function list(input, disk) {
|
|
14
16
|
var isInvalid = false;
|
|
@@ -25,10 +27,17 @@ function list(input, disk) {
|
|
|
25
27
|
}
|
|
26
28
|
groups.forEach(function (_a) {
|
|
27
29
|
var hasMismatches = _a.hasMismatches, isBanned = _a.isBanned, name = _a.name, uniques = _a.uniques;
|
|
28
|
-
var versionList = uniques.sort()
|
|
30
|
+
var versionList = uniques.sort();
|
|
31
|
+
var expected = (0, get_expected_version_1.getExpectedVersion)(name, versionGroup, input);
|
|
29
32
|
console.log(isBanned
|
|
30
|
-
? (0, chalk_1["default"])(templateObject_2 || (templateObject_2 = __makeTemplateObject(["{red
|
|
31
|
-
? (0, chalk_1["default"])(templateObject_3 || (templateObject_3 = __makeTemplateObject(["{red
|
|
33
|
+
? (0, chalk_1["default"])(templateObject_2 || (templateObject_2 = __makeTemplateObject(["{red ", " ", "} {dim.red is defined in this version group as banned from use}"], ["{red ", " ", "} {dim.red is defined in this version group as banned from use}"])), constants_1.ICON.cross, name) : hasMismatches
|
|
34
|
+
? (0, chalk_1["default"])(templateObject_3 || (templateObject_3 = __makeTemplateObject(["{red ", " ", "} ", ""], ["{red ", " ", "} ", ""])), constants_1.ICON.cross, name, versionList
|
|
35
|
+
.map(function (version) {
|
|
36
|
+
return version === expected
|
|
37
|
+
? chalk_1["default"].green(version)
|
|
38
|
+
: chalk_1["default"].red(version);
|
|
39
|
+
})
|
|
40
|
+
.join(chalk_1["default"].dim(', '))) : (0, chalk_1["default"])(templateObject_4 || (templateObject_4 = __makeTemplateObject(["{dim -} {white ", "} {dim ", "}"], ["{dim -} {white ", "} {dim ", "}"])), name, versionList));
|
|
32
41
|
});
|
|
33
42
|
if (groups.some(function (_a) {
|
|
34
43
|
var hasMismatches = _a.hasMismatches;
|
|
@@ -60,6 +60,7 @@ commander_1.program.on('--help', function () {
|
|
|
60
60
|
filter: commander_1.program.opts().filter,
|
|
61
61
|
overrides: commander_1.program.opts().overrides,
|
|
62
62
|
peer: commander_1.program.opts().peer,
|
|
63
|
+
pnpmOverrides: commander_1.program.opts().pnpmOverrides,
|
|
63
64
|
prod: commander_1.program.opts().prod,
|
|
64
65
|
resolutions: commander_1.program.opts().resolutions,
|
|
65
66
|
source: commander_1.program.opts().source,
|
|
@@ -3,6 +3,17 @@ var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cook
|
|
|
3
3
|
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
4
4
|
return cooked;
|
|
5
5
|
};
|
|
6
|
+
var __values = (this && this.__values) || function(o) {
|
|
7
|
+
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
8
|
+
if (m) return m.call(o);
|
|
9
|
+
if (o && typeof o.length === "number") return {
|
|
10
|
+
next: function () {
|
|
11
|
+
if (o && i >= o.length) o = void 0;
|
|
12
|
+
return { value: o && o[i++], done: !o };
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
16
|
+
};
|
|
6
17
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
7
18
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
8
19
|
};
|
|
@@ -33,18 +44,50 @@ function listMismatches(input, disk) {
|
|
|
33
44
|
}
|
|
34
45
|
}
|
|
35
46
|
groups.forEach(function (_a) {
|
|
47
|
+
var e_1, _b;
|
|
36
48
|
var instances = _a.instances, isBanned = _a.isBanned, name = _a.name;
|
|
37
|
-
var
|
|
38
|
-
|
|
39
|
-
|
|
49
|
+
var workspaceMatch = null;
|
|
50
|
+
var expected = (0, get_expected_version_1.getExpectedVersion)(name, versionGroup, input);
|
|
51
|
+
try {
|
|
52
|
+
for (var instances_1 = __values(instances), instances_1_1 = instances_1.next(); !instances_1_1.done; instances_1_1 = instances_1.next()) {
|
|
53
|
+
var instance = instances_1_1.value;
|
|
54
|
+
var isMatch = instance.version === expected;
|
|
55
|
+
var isWorkspace = instance.dependencyType === 'workspace';
|
|
56
|
+
if (isMatch && isWorkspace) {
|
|
57
|
+
workspaceMatch = instance;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
62
|
+
finally {
|
|
63
|
+
try {
|
|
64
|
+
if (instances_1_1 && !instances_1_1.done && (_b = instances_1["return"])) _b.call(instances_1);
|
|
65
|
+
}
|
|
66
|
+
finally { if (e_1) throw e_1.error; }
|
|
67
|
+
}
|
|
68
|
+
if (isBanned) {
|
|
69
|
+
console.log((0, chalk_1["default"])(templateObject_2 || (templateObject_2 = __makeTemplateObject(["{red ", " ", "} {dim.red is defined in this version group as banned from use}"], ["{red ", " ", "} {dim.red is defined in this version group as banned from use}"])), constants_1.ICON.cross, name));
|
|
70
|
+
}
|
|
71
|
+
else if (workspaceMatch) {
|
|
72
|
+
var shortPath = (0, path_1.relative)(constants_1.CWD, workspaceMatch.wrapper.filePath);
|
|
73
|
+
var reason = (0, chalk_1["default"])(templateObject_3 || (templateObject_3 = __makeTemplateObject(["{dim : ", " is developed in this repo at ", "}"], ["{dim : ", " is developed in this repo at ", "}"])), expected, shortPath);
|
|
74
|
+
console.log((0, chalk_1["default"])(templateObject_4 || (templateObject_4 = __makeTemplateObject(["{dim -} ", "", ""], ["{dim -} ", "", ""])), name, reason));
|
|
75
|
+
}
|
|
76
|
+
else {
|
|
77
|
+
var reason = (0, chalk_1["default"])(templateObject_5 || (templateObject_5 = __makeTemplateObject(["{dim : ", " is the highest valid semver version in use}"], ["{dim : ", " is the highest valid semver version in use}"])), expected);
|
|
78
|
+
console.log((0, chalk_1["default"])(templateObject_6 || (templateObject_6 = __makeTemplateObject(["{dim -} ", "", ""], ["{dim -} ", "", ""])), name, reason));
|
|
79
|
+
}
|
|
40
80
|
instances.forEach(function (_a) {
|
|
41
81
|
var dependencyType = _a.dependencyType, version = _a.version, wrapper = _a.wrapper;
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
82
|
+
var isMatch = version === expected;
|
|
83
|
+
var isLocal = dependencyType === 'workspace';
|
|
84
|
+
var shortPath = (0, path_1.relative)(constants_1.CWD, wrapper.filePath);
|
|
85
|
+
var loc = isLocal ? 'version' : dependencyType;
|
|
86
|
+
if (isMatch) {
|
|
87
|
+
console.log((0, chalk_1["default"])(templateObject_7 || (templateObject_7 = __makeTemplateObject(["{green ", " in ", " of ", "}"], ["{green ", " in ", " of ", "}"])), version, loc, shortPath));
|
|
45
88
|
}
|
|
46
89
|
else {
|
|
47
|
-
console.log((0, chalk_1["default"])(
|
|
90
|
+
console.log((0, chalk_1["default"])(templateObject_8 || (templateObject_8 = __makeTemplateObject(["{red ", " in ", " of ", "}"], ["{red ", " in ", " of ", "}"])), version, loc, shortPath));
|
|
48
91
|
}
|
|
49
92
|
});
|
|
50
93
|
});
|
|
@@ -54,4 +97,4 @@ function listMismatches(input, disk) {
|
|
|
54
97
|
}
|
|
55
98
|
}
|
|
56
99
|
exports.listMismatches = listMismatches;
|
|
57
|
-
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5;
|
|
100
|
+
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8;
|
|
@@ -63,6 +63,7 @@ commander_1.program.on('--help', function () {
|
|
|
63
63
|
indent: commander_1.program.opts().indent,
|
|
64
64
|
overrides: commander_1.program.opts().overrides,
|
|
65
65
|
peer: commander_1.program.opts().peer,
|
|
66
|
+
pnpmOverrides: commander_1.program.opts().pnpmOverrides,
|
|
66
67
|
prod: commander_1.program.opts().prod,
|
|
67
68
|
resolutions: commander_1.program.opts().resolutions,
|
|
68
69
|
semverRange: commander_1.program.opts().semverRange,
|
|
@@ -10,7 +10,13 @@ var setSemverRanges = function (input, disk) {
|
|
|
10
10
|
mismatches.forEach(function (_a) {
|
|
11
11
|
var dependencyType = _a.dependencyType, name = _a.name, version = _a.version, wrapper = _a.wrapper;
|
|
12
12
|
var root = wrapper.contents;
|
|
13
|
-
|
|
13
|
+
var nextVersion = (0, set_semver_range_1.setSemverRange)(semverGroup.range, version);
|
|
14
|
+
if (dependencyType === 'pnpmOverrides') {
|
|
15
|
+
root.pnpm.overrides[name] = nextVersion;
|
|
16
|
+
}
|
|
17
|
+
else {
|
|
18
|
+
root[dependencyType][name] = nextVersion;
|
|
19
|
+
}
|
|
14
20
|
});
|
|
15
21
|
});
|
|
16
22
|
input.wrappers.forEach(function (wrapper) {
|
package/dist/constants.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare type DependencyType = 'dependencies' | 'devDependencies' | 'overrides' | 'peerDependencies' | 'resolutions' | 'workspace';
|
|
1
|
+
export declare type DependencyType = 'dependencies' | 'devDependencies' | 'overrides' | 'peerDependencies' | 'pnpmOverrides' | 'resolutions' | 'workspace';
|
|
2
2
|
export declare type DependencyOption = Pick<SyncpackConfig, 'dev' | 'workspace' | 'overrides' | 'peer' | 'prod' | 'resolutions'>;
|
|
3
3
|
export declare type ValidRange = typeof RANGE_ANY | typeof RANGE_EXACT | typeof RANGE_GT | typeof RANGE_GTE | typeof RANGE_LOOSE | typeof RANGE_LT | typeof RANGE_LTE | typeof RANGE_MINOR | typeof RANGE_PATCH;
|
|
4
4
|
export interface SemverGroup {
|
|
@@ -43,7 +43,7 @@ export interface VersionGroup {
|
|
|
43
43
|
*/
|
|
44
44
|
dependencyTypes?: DependencyType[];
|
|
45
45
|
}
|
|
46
|
-
export
|
|
46
|
+
export interface SyncpackConfig {
|
|
47
47
|
/**
|
|
48
48
|
* which dependency properties to search within
|
|
49
49
|
*/
|
|
@@ -63,13 +63,17 @@ export declare type SyncpackConfig = Readonly<{
|
|
|
63
63
|
*/
|
|
64
64
|
indent: string;
|
|
65
65
|
/**
|
|
66
|
-
* whether to search within
|
|
66
|
+
* whether to search within npm overrides
|
|
67
67
|
*/
|
|
68
68
|
overrides: boolean;
|
|
69
69
|
/**
|
|
70
70
|
* whether to search within peerDependencies
|
|
71
71
|
*/
|
|
72
72
|
peer: boolean;
|
|
73
|
+
/**
|
|
74
|
+
* whether to search within pnpm overrides
|
|
75
|
+
*/
|
|
76
|
+
pnpmOverrides: boolean;
|
|
73
77
|
/**
|
|
74
78
|
* whether to search within dependencies
|
|
75
79
|
*/
|
|
@@ -109,7 +113,7 @@ export declare type SyncpackConfig = Readonly<{
|
|
|
109
113
|
* your workspace/monorepo as part of the search for versions to sync
|
|
110
114
|
*/
|
|
111
115
|
workspace: boolean;
|
|
112
|
-
}
|
|
116
|
+
}
|
|
113
117
|
export declare const ALL_PATTERNS: string[];
|
|
114
118
|
export declare const DEPENDENCY_TYPES: DependencyType[];
|
|
115
119
|
export declare const CWD: string;
|
|
@@ -126,4 +130,10 @@ export declare const RANGE_LTE = "<=";
|
|
|
126
130
|
export declare const RANGE_MINOR = "^";
|
|
127
131
|
export declare const RANGE_PATCH = "~";
|
|
128
132
|
export declare const SEMVER_ORDER: ValidRange[];
|
|
133
|
+
export declare const ICON: {
|
|
134
|
+
cross: string;
|
|
135
|
+
debug: string;
|
|
136
|
+
skip: string;
|
|
137
|
+
tick: string;
|
|
138
|
+
};
|
|
129
139
|
export declare const DEFAULT_CONFIG: SyncpackConfig;
|
package/dist/constants.js
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
exports.__esModule = true;
|
|
3
|
-
exports.DEFAULT_CONFIG = exports.SEMVER_ORDER = exports.RANGE_PATCH = exports.RANGE_MINOR = exports.RANGE_LTE = exports.RANGE_LT = exports.RANGE_LOOSE = exports.RANGE_GTE = exports.RANGE_GT = exports.RANGE_EXACT = exports.RANGE_ANY = exports.SAME = exports.LESSER = exports.GREATER = exports.CWD = exports.DEPENDENCY_TYPES = exports.ALL_PATTERNS = void 0;
|
|
3
|
+
exports.DEFAULT_CONFIG = exports.ICON = exports.SEMVER_ORDER = exports.RANGE_PATCH = exports.RANGE_MINOR = exports.RANGE_LTE = exports.RANGE_LT = exports.RANGE_LOOSE = exports.RANGE_GTE = exports.RANGE_GT = exports.RANGE_EXACT = exports.RANGE_ANY = exports.SAME = exports.LESSER = exports.GREATER = exports.CWD = exports.DEPENDENCY_TYPES = exports.ALL_PATTERNS = void 0;
|
|
4
4
|
exports.ALL_PATTERNS = ['package.json', 'packages/*/package.json'];
|
|
5
5
|
exports.DEPENDENCY_TYPES = [
|
|
6
6
|
'dependencies',
|
|
7
7
|
'devDependencies',
|
|
8
8
|
'overrides',
|
|
9
9
|
'peerDependencies',
|
|
10
|
+
'pnpmOverrides',
|
|
10
11
|
'resolutions',
|
|
11
12
|
'workspace',
|
|
12
13
|
];
|
|
@@ -33,6 +34,12 @@ exports.SEMVER_ORDER = [
|
|
|
33
34
|
exports.RANGE_GT,
|
|
34
35
|
exports.RANGE_ANY,
|
|
35
36
|
];
|
|
37
|
+
exports.ICON = {
|
|
38
|
+
cross: '✘',
|
|
39
|
+
debug: '?',
|
|
40
|
+
skip: '-',
|
|
41
|
+
tick: '✓'
|
|
42
|
+
};
|
|
36
43
|
exports.DEFAULT_CONFIG = {
|
|
37
44
|
dependencyTypes: [],
|
|
38
45
|
dev: true,
|
|
@@ -40,6 +47,7 @@ exports.DEFAULT_CONFIG = {
|
|
|
40
47
|
indent: ' ',
|
|
41
48
|
overrides: true,
|
|
42
49
|
peer: true,
|
|
50
|
+
pnpmOverrides: true,
|
|
43
51
|
prod: true,
|
|
44
52
|
resolutions: true,
|
|
45
53
|
workspace: true,
|
package/dist/lib/disk.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ export declare const disk: {
|
|
|
5
5
|
readonly exit: (code: number) => void;
|
|
6
6
|
};
|
|
7
7
|
readonly globSync: (pattern: string) => string[];
|
|
8
|
-
readonly readConfigFileSync: (configPath?: string
|
|
8
|
+
readonly readConfigFileSync: (configPath?: string) => Partial<SyncpackConfig>;
|
|
9
9
|
readonly readFileSync: (filePath: string) => string;
|
|
10
10
|
readonly readYamlFileSync: <T = unknown>(filePath: string) => T;
|
|
11
11
|
readonly removeSync: (filePath: string) => void;
|
package/dist/lib/disk.js
CHANGED
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
exports.__esModule = true;
|
|
3
3
|
exports.disk = void 0;
|
|
4
4
|
var cosmiconfig_1 = require("cosmiconfig");
|
|
5
|
-
var expect_more_1 = require("expect-more");
|
|
6
5
|
var fs_extra_1 = require("fs-extra");
|
|
7
6
|
var glob_1 = require("glob");
|
|
8
7
|
var read_yaml_file_1 = require("read-yaml-file");
|
|
@@ -12,10 +11,12 @@ var client = (0, cosmiconfig_1.cosmiconfigSync)('syncpack');
|
|
|
12
11
|
exports.disk = {
|
|
13
12
|
process: {
|
|
14
13
|
exit: function (code) {
|
|
14
|
+
(0, log_1.verbose)('exit(', code, ')');
|
|
15
15
|
process.exit(code);
|
|
16
16
|
}
|
|
17
17
|
},
|
|
18
18
|
globSync: function (pattern) {
|
|
19
|
+
(0, log_1.verbose)('globSync(', pattern, ')');
|
|
19
20
|
return (0, glob_1.sync)(pattern, {
|
|
20
21
|
ignore: '**/node_modules/**',
|
|
21
22
|
absolute: true,
|
|
@@ -23,29 +24,38 @@ exports.disk = {
|
|
|
23
24
|
});
|
|
24
25
|
},
|
|
25
26
|
readConfigFileSync: function (configPath) {
|
|
27
|
+
(0, log_1.verbose)('readConfigFileSync(', configPath, ')');
|
|
26
28
|
try {
|
|
27
29
|
var result = configPath ? client.load(configPath) : client.search();
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
30
|
+
if (result === null) {
|
|
31
|
+
(0, log_1.verbose)('no config file found');
|
|
32
|
+
return {};
|
|
33
|
+
}
|
|
34
|
+
var rcPath = result.filepath;
|
|
35
|
+
var rcConfig = result.config;
|
|
36
|
+
(0, log_1.verbose)('.syncpackrc path:', rcPath);
|
|
37
|
+
(0, log_1.verbose)('.syncpackrc contents:', rcConfig);
|
|
38
|
+
return rcConfig;
|
|
33
39
|
}
|
|
34
40
|
catch (err) {
|
|
35
|
-
(0, log_1.verbose)(
|
|
41
|
+
(0, log_1.verbose)('no config file found at:', configPath);
|
|
36
42
|
return {};
|
|
37
43
|
}
|
|
38
44
|
},
|
|
39
45
|
readFileSync: function (filePath) {
|
|
46
|
+
(0, log_1.verbose)('readFileSync(', filePath, ')');
|
|
40
47
|
return (0, fs_extra_1.readFileSync)(filePath, { encoding: 'utf8' });
|
|
41
48
|
},
|
|
42
49
|
readYamlFileSync: function (filePath) {
|
|
50
|
+
(0, log_1.verbose)('readYamlFileSync(', filePath, ')');
|
|
43
51
|
return (0, read_yaml_file_1.sync)(filePath);
|
|
44
52
|
},
|
|
45
53
|
removeSync: function (filePath) {
|
|
54
|
+
(0, log_1.verbose)('removeSync(', filePath, ')');
|
|
46
55
|
(0, fs_extra_1.removeSync)(filePath);
|
|
47
56
|
},
|
|
48
57
|
writeFileSync: function (filePath, contents) {
|
|
58
|
+
(0, log_1.verbose)('writeFileSync(', filePath, contents, ')');
|
|
49
59
|
(0, fs_extra_1.writeFileSync)(filePath, contents);
|
|
50
60
|
}
|
|
51
61
|
};
|
|
@@ -4,6 +4,7 @@ exports.getConfig = void 0;
|
|
|
4
4
|
var expect_more_1 = require("expect-more");
|
|
5
5
|
var constants_1 = require("../../constants");
|
|
6
6
|
var is_semver_1 = require("../../lib/is-semver");
|
|
7
|
+
var log_1 = require("../log");
|
|
7
8
|
/**
|
|
8
9
|
* Take all configuration from the command line and config file, combine it, and
|
|
9
10
|
* set defaults for anything which hasn't been defined.
|
|
@@ -12,38 +13,51 @@ var is_semver_1 = require("../../lib/is-semver");
|
|
|
12
13
|
* @param program Optional command line options
|
|
13
14
|
*/
|
|
14
15
|
var getConfig = function (disk, program) {
|
|
16
|
+
(0, log_1.verbose)('cli arguments:', program);
|
|
15
17
|
var rcFile = disk.readConfigFileSync(program.configPath);
|
|
16
18
|
var hasTypeOverride = (0, expect_more_1.isBoolean)(program.dev) ||
|
|
17
|
-
(0, expect_more_1.isBoolean)(program.workspace) ||
|
|
18
19
|
(0, expect_more_1.isBoolean)(program.overrides) ||
|
|
19
20
|
(0, expect_more_1.isBoolean)(program.peer) ||
|
|
21
|
+
(0, expect_more_1.isBoolean)(program.pnpmOverrides) ||
|
|
20
22
|
(0, expect_more_1.isBoolean)(program.prod) ||
|
|
21
|
-
(0, expect_more_1.isBoolean)(program.resolutions)
|
|
23
|
+
(0, expect_more_1.isBoolean)(program.resolutions) ||
|
|
24
|
+
(0, expect_more_1.isBoolean)(program.workspace);
|
|
22
25
|
var dev = hasTypeOverride
|
|
23
26
|
? Boolean(program.dev)
|
|
24
27
|
: getOption('dev', expect_more_1.isBoolean);
|
|
25
|
-
var workspace = hasTypeOverride
|
|
26
|
-
? Boolean(program.workspace)
|
|
27
|
-
: getOption('workspace', expect_more_1.isBoolean);
|
|
28
28
|
var overrides = hasTypeOverride
|
|
29
29
|
? Boolean(program.overrides)
|
|
30
30
|
: getOption('overrides', expect_more_1.isBoolean);
|
|
31
31
|
var peer = hasTypeOverride
|
|
32
32
|
? Boolean(program.peer)
|
|
33
33
|
: getOption('peer', expect_more_1.isBoolean);
|
|
34
|
+
var pnpmOverrides = hasTypeOverride
|
|
35
|
+
? Boolean(program.pnpmOverrides)
|
|
36
|
+
: getOption('pnpmOverrides', expect_more_1.isBoolean);
|
|
34
37
|
var prod = hasTypeOverride
|
|
35
38
|
? Boolean(program.prod)
|
|
36
39
|
: getOption('prod', expect_more_1.isBoolean);
|
|
37
40
|
var resolutions = hasTypeOverride
|
|
38
41
|
? Boolean(program.resolutions)
|
|
39
42
|
: getOption('resolutions', expect_more_1.isBoolean);
|
|
40
|
-
var
|
|
43
|
+
var workspace = hasTypeOverride
|
|
44
|
+
? Boolean(program.workspace)
|
|
45
|
+
: getOption('workspace', expect_more_1.isBoolean);
|
|
46
|
+
var dependencyTypes = dev ||
|
|
47
|
+
overrides ||
|
|
48
|
+
peer ||
|
|
49
|
+
pnpmOverrides ||
|
|
50
|
+
prod ||
|
|
51
|
+
resolutions ||
|
|
52
|
+
workspace
|
|
41
53
|
? constants_1.DEPENDENCY_TYPES.filter(function (type) {
|
|
42
54
|
return (type === 'devDependencies' && dev) ||
|
|
43
55
|
(type === 'overrides' && overrides) ||
|
|
44
56
|
(type === 'peerDependencies' && peer) ||
|
|
57
|
+
(type === 'pnpmOverrides' && pnpmOverrides) ||
|
|
45
58
|
(type === 'dependencies' && prod) ||
|
|
46
|
-
(type === 'resolutions' && resolutions)
|
|
59
|
+
(type === 'resolutions' && resolutions) ||
|
|
60
|
+
(type === 'workspace' && workspace);
|
|
47
61
|
})
|
|
48
62
|
: constants_1.DEPENDENCY_TYPES;
|
|
49
63
|
var filter = getOption('filter', expect_more_1.isNonEmptyString);
|
|
@@ -71,7 +85,7 @@ var getConfig = function (disk, program) {
|
|
|
71
85
|
dependencies: ['**']
|
|
72
86
|
};
|
|
73
87
|
var versionGroups = getOption('versionGroups', isArrayOfVersionGroups).concat(defaultVersionGroup);
|
|
74
|
-
|
|
88
|
+
var finalConfig = {
|
|
75
89
|
dependencyTypes: dependencyTypes,
|
|
76
90
|
dev: dev,
|
|
77
91
|
filter: filter,
|
|
@@ -79,6 +93,7 @@ var getConfig = function (disk, program) {
|
|
|
79
93
|
workspace: workspace,
|
|
80
94
|
overrides: overrides,
|
|
81
95
|
peer: peer,
|
|
96
|
+
pnpmOverrides: pnpmOverrides,
|
|
82
97
|
prod: prod,
|
|
83
98
|
resolutions: resolutions,
|
|
84
99
|
semverGroups: semverGroups,
|
|
@@ -88,6 +103,8 @@ var getConfig = function (disk, program) {
|
|
|
88
103
|
source: source,
|
|
89
104
|
versionGroups: versionGroups
|
|
90
105
|
};
|
|
106
|
+
(0, log_1.verbose)('final config:', finalConfig);
|
|
107
|
+
return finalConfig;
|
|
91
108
|
function getOption(name, isValid) {
|
|
92
109
|
var cliOption = program[name];
|
|
93
110
|
if (isValid(cliOption))
|
|
@@ -44,9 +44,10 @@ exports.__esModule = true;
|
|
|
44
44
|
exports.getInstances = void 0;
|
|
45
45
|
var expect_more_1 = require("expect-more");
|
|
46
46
|
var minimatch_1 = __importDefault(require("minimatch"));
|
|
47
|
+
var log_1 = require("../log");
|
|
47
48
|
function getInstances(options, wrappers) {
|
|
48
|
-
var e_1, _a, e_2, _b, e_3, _c;
|
|
49
|
-
var
|
|
49
|
+
var e_1, _a, e_2, _b, e_3, _c, e_4, _d;
|
|
50
|
+
var _e, _f, _g, _h, _j;
|
|
50
51
|
var allInstances = {
|
|
51
52
|
all: [],
|
|
52
53
|
semverGroups: options.semverGroups.map(withInstances),
|
|
@@ -57,40 +58,22 @@ function getInstances(options, wrappers) {
|
|
|
57
58
|
var wrapper = wrappers_1_1.value;
|
|
58
59
|
var pkgName = wrapper.contents.name || 'packagewithoutaname';
|
|
59
60
|
try {
|
|
60
|
-
for (var
|
|
61
|
-
var dependencyType =
|
|
61
|
+
for (var _k = (e_2 = void 0, __values(options.dependencyTypes)), _l = _k.next(); !_l.done; _l = _k.next()) {
|
|
62
|
+
var dependencyType = _l.value;
|
|
62
63
|
if (dependencyType === 'workspace') {
|
|
63
|
-
var name = (
|
|
64
|
-
var version = (
|
|
65
|
-
|
|
66
|
-
continue;
|
|
67
|
-
if (name.search(new RegExp(options.filter)) === -1)
|
|
68
|
-
continue;
|
|
69
|
-
if (!(0, expect_more_1.isNonEmptyString)(version))
|
|
70
|
-
continue;
|
|
71
|
-
var instance = { dependencyType: dependencyType, name: name, version: version, wrapper: wrapper };
|
|
72
|
-
allInstances.all.push(instance);
|
|
73
|
-
groupInstancesBy('semverGroups', dependencyType, pkgName, instance);
|
|
74
|
-
groupInstancesBy('versionGroups', dependencyType, pkgName, instance);
|
|
64
|
+
var name = (_e = wrapper.contents) === null || _e === void 0 ? void 0 : _e.name;
|
|
65
|
+
var version = (_f = wrapper.contents) === null || _f === void 0 ? void 0 : _f.version;
|
|
66
|
+
addInstance({ dependencyType: dependencyType, name: name, pkgName: pkgName, version: version, wrapper: wrapper });
|
|
75
67
|
}
|
|
76
|
-
else {
|
|
77
|
-
var versionsByName = (
|
|
68
|
+
else if (dependencyType === 'pnpmOverrides') {
|
|
69
|
+
var versionsByName = (_h = (_g = wrapper.contents) === null || _g === void 0 ? void 0 : _g.pnpm) === null || _h === void 0 ? void 0 : _h.overrides;
|
|
78
70
|
if (!(0, expect_more_1.isObject)(versionsByName))
|
|
79
71
|
continue;
|
|
80
72
|
var pkgs = Object.entries(versionsByName);
|
|
81
73
|
try {
|
|
82
74
|
for (var pkgs_1 = (e_3 = void 0, __values(pkgs)), pkgs_1_1 = pkgs_1.next(); !pkgs_1_1.done; pkgs_1_1 = pkgs_1.next()) {
|
|
83
|
-
var
|
|
84
|
-
|
|
85
|
-
continue;
|
|
86
|
-
if (name.search(new RegExp(options.filter)) === -1)
|
|
87
|
-
continue;
|
|
88
|
-
if (!(0, expect_more_1.isNonEmptyString)(version))
|
|
89
|
-
continue;
|
|
90
|
-
var instance = { dependencyType: dependencyType, name: name, version: version, wrapper: wrapper };
|
|
91
|
-
allInstances.all.push(instance);
|
|
92
|
-
groupInstancesBy('semverGroups', dependencyType, pkgName, instance);
|
|
93
|
-
groupInstancesBy('versionGroups', dependencyType, pkgName, instance);
|
|
75
|
+
var _m = __read(pkgs_1_1.value, 2), name = _m[0], version = _m[1];
|
|
76
|
+
addInstance({ dependencyType: dependencyType, name: name, pkgName: pkgName, version: version, wrapper: wrapper });
|
|
94
77
|
}
|
|
95
78
|
}
|
|
96
79
|
catch (e_3_1) { e_3 = { error: e_3_1 }; }
|
|
@@ -101,12 +84,31 @@ function getInstances(options, wrappers) {
|
|
|
101
84
|
finally { if (e_3) throw e_3.error; }
|
|
102
85
|
}
|
|
103
86
|
}
|
|
87
|
+
else {
|
|
88
|
+
var versionsByName = (_j = wrapper.contents) === null || _j === void 0 ? void 0 : _j[dependencyType];
|
|
89
|
+
if (!(0, expect_more_1.isObject)(versionsByName))
|
|
90
|
+
continue;
|
|
91
|
+
var pkgs = Object.entries(versionsByName);
|
|
92
|
+
try {
|
|
93
|
+
for (var pkgs_2 = (e_4 = void 0, __values(pkgs)), pkgs_2_1 = pkgs_2.next(); !pkgs_2_1.done; pkgs_2_1 = pkgs_2.next()) {
|
|
94
|
+
var _o = __read(pkgs_2_1.value, 2), name = _o[0], version = _o[1];
|
|
95
|
+
addInstance({ dependencyType: dependencyType, name: name, pkgName: pkgName, version: version, wrapper: wrapper });
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
catch (e_4_1) { e_4 = { error: e_4_1 }; }
|
|
99
|
+
finally {
|
|
100
|
+
try {
|
|
101
|
+
if (pkgs_2_1 && !pkgs_2_1.done && (_d = pkgs_2["return"])) _d.call(pkgs_2);
|
|
102
|
+
}
|
|
103
|
+
finally { if (e_4) throw e_4.error; }
|
|
104
|
+
}
|
|
105
|
+
}
|
|
104
106
|
}
|
|
105
107
|
}
|
|
106
108
|
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
|
107
109
|
finally {
|
|
108
110
|
try {
|
|
109
|
-
if (
|
|
111
|
+
if (_l && !_l.done && (_b = _k["return"])) _b.call(_k);
|
|
110
112
|
}
|
|
111
113
|
finally { if (e_2) throw e_2.error; }
|
|
112
114
|
}
|
|
@@ -120,6 +122,23 @@ function getInstances(options, wrappers) {
|
|
|
120
122
|
finally { if (e_1) throw e_1.error; }
|
|
121
123
|
}
|
|
122
124
|
return allInstances;
|
|
125
|
+
function addInstance(input) {
|
|
126
|
+
var dependencyType = input.dependencyType, name = input.name, pkgName = input.pkgName, version = input.version, wrapper = input.wrapper;
|
|
127
|
+
if (!(0, expect_more_1.isNonEmptyString)(name)) {
|
|
128
|
+
return (0, log_1.verbose)('skip instance, no name', input);
|
|
129
|
+
}
|
|
130
|
+
if (name.search(new RegExp(options.filter)) === -1) {
|
|
131
|
+
return (0, log_1.verbose)('skip instance, name does not match filter', input);
|
|
132
|
+
}
|
|
133
|
+
if (!(0, expect_more_1.isNonEmptyString)(version)) {
|
|
134
|
+
return (0, log_1.verbose)('skip instance, no version', input);
|
|
135
|
+
}
|
|
136
|
+
var instance = { dependencyType: dependencyType, name: name, version: version, wrapper: wrapper };
|
|
137
|
+
(0, log_1.verbose)("add ".concat(name, "@").concat(version, " to ").concat(dependencyType, " ").concat(wrapper.filePath));
|
|
138
|
+
allInstances.all.push(instance);
|
|
139
|
+
groupInstancesBy('semverGroups', dependencyType, pkgName, instance);
|
|
140
|
+
groupInstancesBy('versionGroups', dependencyType, pkgName, instance);
|
|
141
|
+
}
|
|
123
142
|
function withInstances(group) {
|
|
124
143
|
var instances = [];
|
|
125
144
|
var instancesByName = {};
|
|
@@ -2,8 +2,6 @@ import * as E from 'fp-ts/lib/Either';
|
|
|
2
2
|
import * as O from 'fp-ts/lib/Option';
|
|
3
3
|
import type { SyncpackConfig } from '../../../constants';
|
|
4
4
|
import type { Disk } from '../../../lib/disk';
|
|
5
|
-
declare type MaybeFilePaths = O.Option<string[]>;
|
|
6
|
-
declare type EitherMaybeFilePaths = E.Either<Error, MaybeFilePaths>;
|
|
7
5
|
/**
|
|
8
6
|
* Using --source options and/or config files on disk from npm/pnpm/yarn/lerna,
|
|
9
7
|
* return an array of absolute paths to every package.json file the user is
|
|
@@ -11,5 +9,4 @@ declare type EitherMaybeFilePaths = E.Either<Error, MaybeFilePaths>;
|
|
|
11
9
|
*
|
|
12
10
|
* @returns Array of absolute file paths to package.json files
|
|
13
11
|
*/
|
|
14
|
-
export declare function getFilePaths(disk: Disk, program: SyncpackConfig):
|
|
15
|
-
export {};
|
|
12
|
+
export declare function getFilePaths(disk: Disk, program: SyncpackConfig): E.Either<Error, O.Option<string[]>>;
|
|
@@ -25,9 +25,11 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
25
25
|
exports.__esModule = true;
|
|
26
26
|
exports.getFilePaths = void 0;
|
|
27
27
|
var expect_more_1 = require("expect-more");
|
|
28
|
+
var A = __importStar(require("fp-ts/lib/Array"));
|
|
28
29
|
var E = __importStar(require("fp-ts/lib/Either"));
|
|
29
30
|
var function_1 = require("fp-ts/lib/function");
|
|
30
31
|
var O = __importStar(require("fp-ts/lib/Option"));
|
|
32
|
+
var S = __importStar(require("fp-ts/lib/string"));
|
|
31
33
|
var get_patterns_1 = require("./get-patterns");
|
|
32
34
|
var readonly_1 = require("./readonly");
|
|
33
35
|
var tap_1 = require("./tap");
|
|
@@ -40,13 +42,9 @@ var try_catch_1 = require("./try-catch");
|
|
|
40
42
|
* @returns Array of absolute file paths to package.json files
|
|
41
43
|
*/
|
|
42
44
|
function getFilePaths(disk, program) {
|
|
43
|
-
return (0, function_1.pipe)((0, get_patterns_1.getPatterns)(disk,
|
|
45
|
+
return (0, function_1.pipe)(program, (0, get_patterns_1.getPatterns)(disk), O.getOrElse(function () { return []; }), E.traverseArray(resolvePattern), E.map(readonly_1.removeReadonlyType), E.map((0, function_1.flow)(A.flatten, A.uniq(S.Eq))), E.map(O.fromPredicate(expect_more_1.isArrayOfStrings)), E.map((0, tap_1.tapOption)('package.json files found')));
|
|
44
46
|
function resolvePattern(pattern) {
|
|
45
|
-
return (0, function_1.pipe)(E.tryCatch(function () { return disk.globSync(pattern); }, (0, try_catch_1.getErrorOrElse)("npm package \"glob\" threw on pattern \"".concat(pattern, "\""))), E.map((0, function_1.flow)(O.
|
|
46
|
-
}
|
|
47
|
-
function mergeArrayOfOptionsIntoOne(options) {
|
|
48
|
-
var unwrap = O.getOrElse(function () { return []; });
|
|
49
|
-
return O.of(options.reduce(function (values, option) { return values.concat(unwrap(option)); }, []));
|
|
47
|
+
return (0, function_1.pipe)(E.tryCatch(function () { return disk.globSync(pattern); }, (0, try_catch_1.getErrorOrElse)("npm package \"glob\" threw on pattern \"".concat(pattern, "\""))), E.map((0, function_1.flow)(O.fromPredicate(expect_more_1.isArrayOfStrings), (0, tap_1.tapOption)("files found matching pattern \"".concat(pattern, "\"")), O.getOrElse(function () { return []; }))));
|
|
50
48
|
}
|
|
51
49
|
}
|
|
52
50
|
exports.getFilePaths = getFilePaths;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as O from 'fp-ts/lib/Option';
|
|
2
2
|
import type { Disk } from '../../../../lib/disk';
|
|
3
|
-
export declare function getLernaPatterns(disk: Disk): () =>
|
|
3
|
+
export declare function getLernaPatterns(disk: Disk): () => O.Option<string[]>;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as O from 'fp-ts/lib/Option';
|
|
2
2
|
import type { Disk } from '../../../../lib/disk';
|
|
3
|
-
export declare function getPnpmPatterns(disk: Disk): () =>
|
|
3
|
+
export declare function getPnpmPatterns(disk: Disk): () => O.Option<string[]>;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as O from 'fp-ts/lib/Option';
|
|
2
2
|
import type { Disk } from '../../../../lib/disk';
|
|
3
|
-
export declare function getYarnPatterns(disk: Disk): () =>
|
|
3
|
+
export declare function getYarnPatterns(disk: Disk): () => O.Option<string[]>;
|
|
@@ -1,13 +1,10 @@
|
|
|
1
1
|
import * as O from 'fp-ts/lib/Option';
|
|
2
2
|
import type { SyncpackConfig } from '../../../../constants';
|
|
3
3
|
import type { Disk } from '../../../../lib/disk';
|
|
4
|
-
declare type Patterns = string[];
|
|
5
|
-
export declare type MaybePatterns = O.Option<Patterns>;
|
|
6
4
|
/**
|
|
7
5
|
* Find every glob pattern which should be used to find package.json files for
|
|
8
6
|
* this monorepo.
|
|
9
7
|
*
|
|
10
8
|
* @returns `['./package.json', './packages/* /package.json']`
|
|
11
9
|
*/
|
|
12
|
-
export declare function getPatterns(disk: Disk
|
|
13
|
-
export {};
|
|
10
|
+
export declare function getPatterns(disk: Disk): (program: SyncpackConfig) => O.Option<string[]>;
|
|
@@ -52,7 +52,6 @@ exports.getPatterns = void 0;
|
|
|
52
52
|
var expect_more_1 = require("expect-more");
|
|
53
53
|
var function_1 = require("fp-ts/lib/function");
|
|
54
54
|
var O = __importStar(require("fp-ts/lib/Option"));
|
|
55
|
-
var path_1 = require("path");
|
|
56
55
|
var constants_1 = require("../../../../constants");
|
|
57
56
|
var tap_1 = require("../tap");
|
|
58
57
|
var get_lerna_patterns_1 = require("./get-lerna-patterns");
|
|
@@ -64,13 +63,17 @@ var get_yarn_patterns_1 = require("./get-yarn-patterns");
|
|
|
64
63
|
*
|
|
65
64
|
* @returns `['./package.json', './packages/* /package.json']`
|
|
66
65
|
*/
|
|
67
|
-
function getPatterns(disk
|
|
68
|
-
return
|
|
66
|
+
function getPatterns(disk) {
|
|
67
|
+
return function (program) {
|
|
68
|
+
return (0, function_1.pipe)(O.of(program.source), O.filter(expect_more_1.isArrayOfStrings), (0, tap_1.tapOption)('--source patterns found'), O.fold((0, function_1.flow)((0, get_yarn_patterns_1.getYarnPatterns)(disk), O.map(addRootDir)), O.of), (0, tap_1.tapOption)('yarn workspaces found'), O.fold((0, function_1.flow)((0, get_pnpm_patterns_1.getPnpmPatterns)(disk), O.map(addRootDir)), O.of), (0, tap_1.tapOption)('pnpm workspaces found'), O.fold((0, function_1.flow)((0, get_lerna_patterns_1.getLernaPatterns)(disk), O.map(addRootDir)), O.of), (0, tap_1.tapOption)('lerna packages found'), O.map(limitToPackageJson), (0, tap_1.tapNone)('no patterns found, using defaults'), O.fold(function () { return O.some(constants_1.ALL_PATTERNS); }, O.of));
|
|
69
|
+
};
|
|
69
70
|
function addRootDir(patterns) {
|
|
70
71
|
return __spreadArray(['.'], __read(patterns), false);
|
|
71
72
|
}
|
|
72
73
|
function limitToPackageJson(patterns) {
|
|
73
|
-
return patterns.map(function (pattern) {
|
|
74
|
+
return patterns.map(function (pattern) {
|
|
75
|
+
return pattern.includes('package.json') ? pattern : "".concat(pattern, "/package.json");
|
|
76
|
+
});
|
|
74
77
|
}
|
|
75
78
|
}
|
|
76
79
|
exports.getPatterns = getPatterns;
|
|
@@ -10,6 +10,9 @@ export interface Source {
|
|
|
10
10
|
keywords?: string[];
|
|
11
11
|
name?: string;
|
|
12
12
|
peerDependencies?: Record<string, string>;
|
|
13
|
+
pnpm?: {
|
|
14
|
+
overrides?: Record<string, string>;
|
|
15
|
+
};
|
|
13
16
|
repository?: {
|
|
14
17
|
type: string;
|
|
15
18
|
url: string;
|
|
@@ -18,7 +21,7 @@ export interface Source {
|
|
|
18
21
|
scripts?: Record<string, string>;
|
|
19
22
|
version?: string;
|
|
20
23
|
workspaces?: Record<string, string[]> | string[];
|
|
21
|
-
[otherProps: string]: Record<string, string | string[]
|
|
24
|
+
[otherProps: string]: Record<string, string | string[] | Record<string, string | string[]>> | string | string[] | undefined;
|
|
22
25
|
}
|
|
23
26
|
export interface SourceWrapper {
|
|
24
27
|
/** the absolute path on disk to this package.json file */
|
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
import * as O from 'fp-ts/lib/Option';
|
|
2
|
+
declare type Fn<T> = (ma: O.Option<T>) => O.Option<T>;
|
|
2
3
|
/**
|
|
3
4
|
* Log a message when a pipeline contains `None` and let it continue unchanged.
|
|
4
5
|
*/
|
|
5
|
-
export declare function tapNone<T>(message: string):
|
|
6
|
+
export declare function tapNone<T>(message: string): Fn<T>;
|
|
7
|
+
/**
|
|
8
|
+
* Log a message when a pipeline contains `Some` and let it continue unchanged.
|
|
9
|
+
*/
|
|
10
|
+
export declare function tapSome<T>(message: string): Fn<T>;
|
|
11
|
+
/**
|
|
12
|
+
* Log both possibilities of an `Option` and let it continue unchanged.
|
|
13
|
+
*/
|
|
14
|
+
export declare function tapOption<T>(message: string): Fn<T>;
|
|
15
|
+
export {};
|
|
@@ -23,7 +23,8 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
23
23
|
return result;
|
|
24
24
|
};
|
|
25
25
|
exports.__esModule = true;
|
|
26
|
-
exports.tapNone = void 0;
|
|
26
|
+
exports.tapOption = exports.tapSome = exports.tapNone = void 0;
|
|
27
|
+
var function_1 = require("fp-ts/lib/function");
|
|
27
28
|
var O = __importStar(require("fp-ts/lib/Option"));
|
|
28
29
|
var log_1 = require("../../log");
|
|
29
30
|
/**
|
|
@@ -36,3 +37,20 @@ function tapNone(message) {
|
|
|
36
37
|
}, O.of);
|
|
37
38
|
}
|
|
38
39
|
exports.tapNone = tapNone;
|
|
40
|
+
/**
|
|
41
|
+
* Log a message when a pipeline contains `Some` and let it continue unchanged.
|
|
42
|
+
*/
|
|
43
|
+
function tapSome(message) {
|
|
44
|
+
return O.map(function logSomeValue(value) {
|
|
45
|
+
(0, log_1.verbose)(message, value);
|
|
46
|
+
return value;
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
exports.tapSome = tapSome;
|
|
50
|
+
/**
|
|
51
|
+
* Log both possibilities of an `Option` and let it continue unchanged.
|
|
52
|
+
*/
|
|
53
|
+
function tapOption(message) {
|
|
54
|
+
return (0, function_1.flow)(tapSome(message), tapNone("no ".concat(message)));
|
|
55
|
+
}
|
|
56
|
+
exports.tapOption = tapOption;
|
package/dist/lib/log.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function verbose(
|
|
1
|
+
export declare function verbose(...values: unknown[]): void;
|
package/dist/lib/log.js
CHANGED
|
@@ -1,13 +1,49 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __read = (this && this.__read) || function (o, n) {
|
|
3
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
4
|
+
if (!m) return o;
|
|
5
|
+
var i = m.call(o), r, ar = [], e;
|
|
6
|
+
try {
|
|
7
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
8
|
+
}
|
|
9
|
+
catch (error) { e = { error: error }; }
|
|
10
|
+
finally {
|
|
11
|
+
try {
|
|
12
|
+
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
13
|
+
}
|
|
14
|
+
finally { if (e) throw e.error; }
|
|
15
|
+
}
|
|
16
|
+
return ar;
|
|
17
|
+
};
|
|
18
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
19
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
20
|
+
if (ar || !(i in from)) {
|
|
21
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
22
|
+
ar[i] = from[i];
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
26
|
+
};
|
|
2
27
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
28
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
29
|
};
|
|
5
30
|
exports.__esModule = true;
|
|
6
31
|
exports.verbose = void 0;
|
|
7
32
|
var chalk_1 = __importDefault(require("chalk"));
|
|
8
|
-
|
|
33
|
+
var expect_more_1 = require("expect-more");
|
|
34
|
+
var util_1 = require("util");
|
|
35
|
+
var constants_1 = require("../constants");
|
|
36
|
+
function verbose() {
|
|
37
|
+
var values = [];
|
|
38
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
39
|
+
values[_i] = arguments[_i];
|
|
40
|
+
}
|
|
9
41
|
if (process.env.SYNCPACK_VERBOSE) {
|
|
10
|
-
console.
|
|
42
|
+
console.info.apply(console, __spreadArray([chalk_1["default"].yellow(constants_1.ICON.debug)], __read(values.map(function (value) {
|
|
43
|
+
return (0, expect_more_1.isString)(value)
|
|
44
|
+
? chalk_1["default"].yellow(value)
|
|
45
|
+
: (0, util_1.inspect)(value, false, null, true);
|
|
46
|
+
})), false));
|
|
11
47
|
}
|
|
12
48
|
}
|
|
13
49
|
exports.verbose = verbose;
|
|
@@ -5,19 +5,21 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
exports.__esModule = true;
|
|
6
6
|
exports.writeIfChanged = void 0;
|
|
7
7
|
var chalk_1 = __importDefault(require("chalk"));
|
|
8
|
-
var os_1 = require("os");
|
|
9
8
|
var path_1 = require("path");
|
|
10
|
-
var constants_1 = require("
|
|
9
|
+
var constants_1 = require("../../constants");
|
|
10
|
+
var set_newlines_1 = require("./set-newlines");
|
|
11
11
|
function writeIfChanged(disk, fileData) {
|
|
12
12
|
var contents = fileData.contents, filePath = fileData.filePath, indent = fileData.indent, json = fileData.json;
|
|
13
|
+
var EOL = (0, set_newlines_1.detectNewlines)(json);
|
|
13
14
|
var shortPath = (0, path_1.relative)(constants_1.CWD, filePath);
|
|
14
|
-
var
|
|
15
|
+
var source = "".concat(JSON.stringify(contents, null, indent)).concat(EOL);
|
|
16
|
+
var after = (0, set_newlines_1.setNewlines)(source, EOL);
|
|
15
17
|
if (json !== after) {
|
|
16
18
|
disk.writeFileSync(filePath, after);
|
|
17
|
-
console.log(chalk_1["default"].green(
|
|
19
|
+
console.log(chalk_1["default"].green(constants_1.ICON.tick), shortPath);
|
|
18
20
|
}
|
|
19
21
|
else {
|
|
20
|
-
console.log(chalk_1["default"].dim(
|
|
22
|
+
console.log(chalk_1["default"].dim(constants_1.ICON.skip), chalk_1["default"].dim(shortPath));
|
|
21
23
|
}
|
|
22
24
|
}
|
|
23
25
|
exports.writeIfChanged = writeIfChanged;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
exports.__esModule = true;
|
|
3
|
+
exports.detectNewlines = exports.setNewlines = void 0;
|
|
4
|
+
var os_1 = require("os");
|
|
5
|
+
var LF = '\n';
|
|
6
|
+
var CR = '\r';
|
|
7
|
+
var CRLF = '\r\n';
|
|
8
|
+
function setNewlines(source, lineEnding) {
|
|
9
|
+
return source.replace(/\r\n|\n|\r/g, lineEnding);
|
|
10
|
+
}
|
|
11
|
+
exports.setNewlines = setNewlines;
|
|
12
|
+
function detectNewlines(source) {
|
|
13
|
+
var cr = source.split(CR).length;
|
|
14
|
+
var lf = source.split(LF).length;
|
|
15
|
+
var crlf = source.split(CRLF).length;
|
|
16
|
+
if (cr + lf === 0)
|
|
17
|
+
return os_1.EOL;
|
|
18
|
+
if (crlf === cr && crlf === lf)
|
|
19
|
+
return CRLF;
|
|
20
|
+
if (cr > lf)
|
|
21
|
+
return CR;
|
|
22
|
+
return LF;
|
|
23
|
+
}
|
|
24
|
+
exports.detectNewlines = detectNewlines;
|
package/dist/option.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ export declare const option: {
|
|
|
6
6
|
readonly indent: readonly ["-i, --indent [value]", `override indentation. defaults to "${string}"`];
|
|
7
7
|
readonly overrides: readonly ["-o, --overrides", string];
|
|
8
8
|
readonly peer: readonly ["-P, --peer", string];
|
|
9
|
+
readonly pnpmOverrides: readonly ["-O, --overrides", string];
|
|
9
10
|
readonly prod: readonly ["-p, --prod", string];
|
|
10
11
|
readonly resolutions: readonly ["-R, --resolutions", string];
|
|
11
12
|
readonly semverRange: readonly ["-r, --semver-range <range>", "see supported ranges below. defaults to \"\"" | "see supported ranges below. defaults to \"*\"" | "see supported ranges below. defaults to \">\"" | "see supported ranges below. defaults to \">=\"" | "see supported ranges below. defaults to \".x\"" | "see supported ranges below. defaults to \"<\"" | "see supported ranges below. defaults to \"<=\"" | "see supported ranges below. defaults to \"^\"" | "see supported ranges below. defaults to \"~\""];
|
package/dist/option.js
CHANGED
|
@@ -22,12 +22,13 @@ exports.option = {
|
|
|
22
22
|
'-i, --indent [value]',
|
|
23
23
|
"override indentation. defaults to \"".concat(constants_1.DEFAULT_CONFIG.indent, "\""),
|
|
24
24
|
],
|
|
25
|
-
overrides: ['-o, --overrides', (0, chalk_1["default"])(templateObject_3 || (templateObject_3 = __makeTemplateObject(["include {yellow overrides} (
|
|
25
|
+
overrides: ['-o, --overrides', (0, chalk_1["default"])(templateObject_3 || (templateObject_3 = __makeTemplateObject(["include {yellow overrides} (npm)"], ["include {yellow overrides} (npm)"])))],
|
|
26
26
|
peer: ['-P, --peer', (0, chalk_1["default"])(templateObject_4 || (templateObject_4 = __makeTemplateObject(["include {yellow peerDependencies}"], ["include {yellow peerDependencies}"])))],
|
|
27
|
-
|
|
27
|
+
pnpmOverrides: ['-O, --overrides', (0, chalk_1["default"])(templateObject_5 || (templateObject_5 = __makeTemplateObject(["include {yellow overrides} (pnpm)"], ["include {yellow overrides} (pnpm)"])))],
|
|
28
|
+
prod: ['-p, --prod', (0, chalk_1["default"])(templateObject_6 || (templateObject_6 = __makeTemplateObject(["include {yellow dependencies}"], ["include {yellow dependencies}"])))],
|
|
28
29
|
resolutions: [
|
|
29
30
|
'-R, --resolutions',
|
|
30
|
-
(0, chalk_1["default"])(
|
|
31
|
+
(0, chalk_1["default"])(templateObject_7 || (templateObject_7 = __makeTemplateObject(["include {yellow resolutions} (yarn)"], ["include {yellow resolutions} (yarn)"]))),
|
|
31
32
|
],
|
|
32
33
|
semverRange: [
|
|
33
34
|
'-r, --semver-range <range>',
|
|
@@ -41,4 +42,4 @@ exports.option = {
|
|
|
41
42
|
],
|
|
42
43
|
workspace: ['-w, --workspace', 'include locally developed package versions']
|
|
43
44
|
};
|
|
44
|
-
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6;
|
|
45
|
+
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "syncpack",
|
|
3
3
|
"description": "Manage multiple package.json files, such as in Lerna Monorepos and Yarn/Pnpm Workspaces",
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "8.2.4",
|
|
5
5
|
"author": "Jamie Mason <jamie@foldleft.io> (https://github.com/JamieMason)",
|
|
6
6
|
"bin": {
|
|
7
7
|
"syncpack": "dist/bin.js",
|
|
@@ -25,32 +25,32 @@
|
|
|
25
25
|
],
|
|
26
26
|
"dependencies": {
|
|
27
27
|
"chalk": "4.1.2",
|
|
28
|
-
"commander": "9.
|
|
28
|
+
"commander": "9.3.0",
|
|
29
29
|
"cosmiconfig": "7.0.1",
|
|
30
30
|
"expect-more": "1.2.0",
|
|
31
31
|
"fp-ts": "2.12.1",
|
|
32
32
|
"fs-extra": "10.1.0",
|
|
33
|
-
"glob": "8.0.
|
|
34
|
-
"minimatch": "5.0
|
|
33
|
+
"glob": "8.0.3",
|
|
34
|
+
"minimatch": "5.1.0",
|
|
35
35
|
"read-yaml-file": "2.1.0",
|
|
36
36
|
"semver": "7.3.7"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
39
|
"@types/fs-extra": "9.0.13",
|
|
40
40
|
"@types/glob": "7.2.0",
|
|
41
|
-
"@types/jest": "
|
|
42
|
-
"@types/node": "
|
|
43
|
-
"@types/semver": "7.3.
|
|
44
|
-
"@typescript-eslint/eslint-plugin": "5.
|
|
45
|
-
"@typescript-eslint/parser": "5.
|
|
46
|
-
"eslint": "8.
|
|
41
|
+
"@types/jest": "28.1.3",
|
|
42
|
+
"@types/node": "18.0.0",
|
|
43
|
+
"@types/semver": "7.3.10",
|
|
44
|
+
"@typescript-eslint/eslint-plugin": "5.29.0",
|
|
45
|
+
"@typescript-eslint/parser": "5.29.0",
|
|
46
|
+
"eslint": "8.18.0",
|
|
47
47
|
"eslint-plugin-import": "2.26.0",
|
|
48
|
-
"expect-more-jest": "5.4.
|
|
49
|
-
"jest": "
|
|
50
|
-
"prettier": "2.
|
|
48
|
+
"expect-more-jest": "5.4.1",
|
|
49
|
+
"jest": "28.1.1",
|
|
50
|
+
"prettier": "2.7.1",
|
|
51
51
|
"rimraf": "3.0.2",
|
|
52
|
-
"ts-jest": "
|
|
53
|
-
"typescript": "4.
|
|
52
|
+
"ts-jest": "28.0.5",
|
|
53
|
+
"typescript": "4.7.4"
|
|
54
54
|
},
|
|
55
55
|
"engines": {
|
|
56
56
|
"node": ">=10"
|
|
@@ -88,6 +88,6 @@
|
|
|
88
88
|
"format:source": "prettier --write .",
|
|
89
89
|
"lint": "eslint --ext .ts .",
|
|
90
90
|
"prepack": "yarn build",
|
|
91
|
-
"test": "jest"
|
|
91
|
+
"test": "jest src"
|
|
92
92
|
}
|
|
93
93
|
}
|