syncpack 6.2.1 → 7.0.0

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.
Files changed (29) hide show
  1. package/README.md +89 -63
  2. package/dist/bin-fix-mismatches/get-expected-version/index.d.ts +1 -1
  3. package/dist/bin-fix-mismatches/get-expected-version/index.js +1 -1
  4. package/dist/bin-fix-mismatches/index.js +7 -5
  5. package/dist/bin-format/index.js +1 -3
  6. package/dist/bin-lint-semver-ranges/index.js +13 -11
  7. package/dist/bin-list/index.js +7 -5
  8. package/dist/bin-list/list-version-groups.d.ts +1 -2
  9. package/dist/bin-list-mismatches/index.js +7 -5
  10. package/dist/bin-list-mismatches/list-mismatches.js +10 -2
  11. package/dist/bin-set-semver-ranges/index.js +14 -12
  12. package/dist/constants.d.ts +7 -2
  13. package/dist/constants.js +2 -0
  14. package/dist/lib/disk.js +5 -1
  15. package/dist/lib/get-input/get-config.js +7 -1
  16. package/dist/lib/get-input/get-instances.js +42 -26
  17. package/dist/lib/get-input/get-wrappers/get-file-paths.js +5 -1
  18. package/dist/lib/get-input/get-wrappers/get-patterns/get-lerna-patterns.js +5 -1
  19. package/dist/lib/get-input/get-wrappers/get-patterns/get-pnpm-patterns.js +5 -1
  20. package/dist/lib/get-input/get-wrappers/get-patterns/get-yarn-patterns.js +5 -1
  21. package/dist/lib/get-input/get-wrappers/get-patterns/index.js +5 -1
  22. package/dist/lib/get-input/get-wrappers/get-patterns/props.js +5 -1
  23. package/dist/lib/get-input/get-wrappers/get-patterns/read-json-safe.js +5 -1
  24. package/dist/lib/get-input/get-wrappers/get-patterns/read-yaml-safe.js +5 -1
  25. package/dist/lib/get-input/get-wrappers/index.js +6 -2
  26. package/dist/lib/get-input/get-wrappers/tap.js +5 -1
  27. package/dist/option.d.ts +1 -0
  28. package/dist/option.js +3 -2
  29. package/package.json +17 -17
package/README.md CHANGED
@@ -28,13 +28,14 @@ See [`versionGroups`](#versiongroups) if you have advanced requirements.
28
28
  <summary>Options</summary>
29
29
 
30
30
  ```
31
- -s, --source [pattern] glob pattern for package.json files to read from (default: [])
31
+ -s, --source [pattern] glob pattern for package.json files to read from
32
+ -f, --filter [pattern] only include dependencies whose name matches this regex
32
33
  -p, --prod include dependencies
33
34
  -d, --dev include devDependencies
34
35
  -P, --peer include peerDependencies
35
36
  -R, --resolutions include resolutions (yarn)
36
37
  -o, --overrides include overrides (pnpm)
37
- -f, --filter [pattern] only include dependencies whose name matches this regex
38
+ -w, --workspace include locally developed package versions
38
39
  -i, --indent [value] override indentation. defaults to " "
39
40
  -h, --help display help for command
40
41
  ```
@@ -108,14 +109,15 @@ See [`semverGroups`](#semvergroups) if you have advanced requirements.
108
109
  <summary>Options</summary>
109
110
 
110
111
  ```
111
- -s, --source [pattern] glob pattern for package.json files to read from (default: [])
112
+ -s, --source [pattern] glob pattern for package.json files to read from
113
+ -f, --filter [pattern] only include dependencies whose name matches this regex
114
+ -r, --semver-range <range> see supported ranges below. defaults to ""
112
115
  -p, --prod include dependencies
113
116
  -d, --dev include devDependencies
114
117
  -P, --peer include peerDependencies
115
118
  -R, --resolutions include resolutions (yarn)
116
119
  -o, --overrides include overrides (pnpm)
117
- -f, --filter [pattern] only include dependencies whose name matches this regex
118
- -r, --semver-range <range> see supported ranges below. defaults to ""
120
+ -w, --workspace include locally developed package versions
119
121
  -h, --help display help for command
120
122
  ```
121
123
 
@@ -151,13 +153,14 @@ List all dependencies required by your packages.
151
153
  <summary>Options</summary>
152
154
 
153
155
  ```
154
- -s, --source [pattern] glob pattern for package.json files to read from (default: [])
156
+ -s, --source [pattern] glob pattern for package.json files to read from
157
+ -f, --filter [pattern] only include dependencies whose name matches this regex
155
158
  -p, --prod include dependencies
156
159
  -d, --dev include devDependencies
157
160
  -P, --peer include peerDependencies
158
161
  -R, --resolutions include resolutions (yarn)
159
162
  -o, --overrides include overrides (pnpm)
160
- -f, --filter [pattern] only include dependencies whose name matches this regex
163
+ -w, --workspace include locally developed package versions
161
164
  -h, --help display help for command
162
165
  ```
163
166
 
@@ -194,13 +197,14 @@ See [`versionGroups`](#versiongroups) if you have advanced requirements.
194
197
  <summary>Options</summary>
195
198
 
196
199
  ```
197
- -s, --source [pattern] glob pattern for package.json files to read from (default: [])
200
+ -s, --source [pattern] glob pattern for package.json files to read from
201
+ -f, --filter [pattern] only include dependencies whose name matches this regex
198
202
  -p, --prod include dependencies
199
203
  -d, --dev include devDependencies
200
204
  -P, --peer include peerDependencies
201
205
  -R, --resolutions include resolutions (yarn)
202
206
  -o, --overrides include overrides (pnpm)
203
- -f, --filter [pattern] only include dependencies whose name matches this regex
207
+ -w, --workspace include locally developed package versions
204
208
  -h, --help display help for command
205
209
  ```
206
210
 
@@ -237,15 +241,16 @@ See [`semverGroups`](#semvergroups) if you have advanced requirements.
237
241
  <summary>Options</summary>
238
242
 
239
243
  ```
240
- -s, --source [pattern] glob pattern for package.json files to read from (default: [])
244
+ -s, --source [pattern] glob pattern for package.json files to read from
245
+ -r, --semver-range <range> see supported ranges below. defaults to ""
246
+ -f, --filter [pattern] only include dependencies whose name matches this regex
241
247
  -p, --prod include dependencies
242
248
  -d, --dev include devDependencies
243
249
  -P, --peer include peerDependencies
244
250
  -R, --resolutions include resolutions (yarn)
245
251
  -o, --overrides include overrides (pnpm)
246
- -f, --filter [pattern] only include dependencies whose name matches this regex
252
+ -w, --workspace include locally developed package versions
247
253
  -i, --indent [value] override indentation. defaults to " "
248
- -r, --semver-range <range> see supported ranges below. defaults to ""
249
254
  -h, --help display help for command
250
255
  ```
251
256
 
@@ -298,6 +303,7 @@ tree in the following places:
298
303
  "peer": true,
299
304
  "prod": true,
300
305
  "resolutions": true,
306
+ "workspace": true,
301
307
  "semverGroups": [],
302
308
  "semverRange": "",
303
309
  "sortAz": [
@@ -306,23 +312,31 @@ tree in the following places:
306
312
  "devDependencies",
307
313
  "keywords",
308
314
  "peerDependencies",
315
+ "resolutions",
309
316
  "scripts"
310
317
  ],
311
- "sortFirst": ["name", "description", "version", "author"],
312
- "source": ["package.json", "packages/*/package.json"],
318
+ "sortFirst": [
319
+ "name",
320
+ "description",
321
+ "version",
322
+ "author"
323
+ ],
324
+ "source": [],
313
325
  "versionGroups": []
314
326
  }
315
327
  ```
316
328
 
317
- ### `dev`, `peer`, `prod`, `resolutions`, and `overrides`
329
+ ### `dev`, `peer`, `prod`, `resolutions`, `overrides`, and `workspace`
318
330
 
319
331
  Whether to search within `devDependencies`, `peerDependencies`, `dependencies`,
320
- `resolutions` (Yarn), and `overrides` (Pnpm) respectively.
332
+ `resolutions` (Yarn), `overrides` (Pnpm), and the `version` property of the
333
+ package.json files of your own packages developed within your `workspace`
334
+ respectively.
321
335
 
322
336
  All of these locations are searched by default but they can be disabled
323
337
  individually in your config file. If any are set via the command line options
324
- `--dev`, `--peer`, `--prod`, `--resolutions`, or `overrides` then only the
325
- options you provide will be searched.
338
+ `--dev`, `--peer`, `--prod`, `--resolutions`, `--overrides`, or `--workspace`
339
+ then only the options you provide will be searched.
326
340
 
327
341
  ### `filter`
328
342
 
@@ -373,6 +387,61 @@ using Lerna or Yarn Workspaces, but this can be overridden in your config file
373
387
  or via multiple `--source` command line options. Supports any patterns supported
374
388
  by [glob](https://github.com/isaacs/node-glob).
375
389
 
390
+ ### `versionGroups`
391
+
392
+ The most common use case for version groups is when some of the packages in your
393
+ Monorepo are considered alpha (or legacy). Since those packages are much further
394
+ ahead (or behind) the other packages, the dependencies within those packages
395
+ need to be managed differently to the rest of the Monorepo.
396
+
397
+ Your alpha packages might use unstable versions of some dependencies, while the
398
+ rest of the repo might need to remain on stable versions.
399
+
400
+ You don't want mismatches within your alpha packages, you don't want mismatches
401
+ within the other packages, but you _do_ want those groups to use different
402
+ versions *to each other* and not have `syncpack` make them all the same.
403
+
404
+ In the following example, 2 of our packages are using different versions of
405
+ `react` and `react-dom` to the rest of the project.
406
+
407
+ ```json
408
+ {
409
+ "versionGroups": [
410
+ {
411
+ "dependencies": ["react", "react-dom"],
412
+ "packages": ["@alpha/server", "@alpha/ui"]
413
+ }
414
+ ]
415
+ }
416
+ ```
417
+
418
+ > 👋 The `dependencies` and `packages` fields are processed using
419
+ > [minimatch](https://github.com/isaacs/minimatch), so the above example can
420
+ > also be written as `"packages": ["@alpha/**"]`.
421
+
422
+ `syncpack` will make ensure that:
423
+
424
+ - The versions of `react` and `react-dom` are the same within `@alpha/server`
425
+ and `@alpha/ui`.
426
+ - The versions of `react` and `react-dom` are the same across every package
427
+ except `@alpha/server` and `@alpha/ui`.
428
+ - The versions of `react` and `react-dom` within `@alpha/server` and `@alpha/ui`
429
+ can be different to the other packages in the monorepo.
430
+ - The versions of every other dependency in the monorepo (eg `lodash`) are the
431
+ same across every package including `@alpha/server` and `@alpha/ui`.
432
+
433
+ Each dependency can only belong to one version group, the first rule which
434
+ matches a given dependency and package will apply.
435
+
436
+ You can be quite granular with these rules, so the partitioning doesn't _have_
437
+ to apply to an entire package:
438
+
439
+ - A specific dependency in a specific package.
440
+ - A specific dependency in some specific packages only.
441
+ - Any dependency who name matches a pattern such as `@aws-sdk/**`.
442
+
443
+ See [`semverGroups`](#semverGroups) for some examples, they work the same way.
444
+
376
445
  ### `semverGroups`
377
446
 
378
447
  Allow some packages to have different semver range rules to the rest of your
@@ -397,14 +466,14 @@ regardless of what the rest of the monorepo uses:
397
466
  ```
398
467
 
399
468
  2: Every dependency of `@myrepo/library` whose name matches `@alpha/**` should
400
- have a semver range of `~`, regardless of what the rest of that package or the
469
+ have a semver range of `^`, regardless of what the rest of that package or the
401
470
  rest of the monorepo uses:
402
471
 
403
472
  ```json
404
473
  {
405
474
  "semverGroups": [
406
475
  {
407
- "range": "~",
476
+ "range": "^",
408
477
  "dependencies": ["@alpha/**"],
409
478
  "packages": ["@myrepo/library"]
410
479
  }
@@ -427,49 +496,6 @@ semver range of `~`, regardless of what the rest of the monorepo uses:
427
496
  }
428
497
  ```
429
498
 
430
- ### `versionGroups`
431
-
432
- If some packages in your Monorepo relate to "alpha" (or legacy) versions of your
433
- software, you will need to manage dependencies differently within those
434
- packages. Your alpha packages might use latest or unstable versions of some 3rd
435
- party dependencies, while the rest of the repo might need to remain on older
436
- versions. You don't want mismatches within your alpha packages, or within the
437
- other packages in your monorepo – but you do want those groups to use different
438
- versions to each other and not have `syncpack fix-mismatches` make them all the
439
- same.
440
-
441
- In the following example, 2 packages in our monorepo are using different
442
- versions of `react` and `react-dom` to the rest of the project.
443
-
444
- ```json
445
- {
446
- "versionGroups": [
447
- {
448
- "dependencies": ["react", "react-dom"],
449
- "packages": ["@alpha/server", "@alpha/ui"]
450
- }
451
- ]
452
- }
453
- ```
454
-
455
- > ℹ️ The `dependencies` and `packages` fields are processed using
456
- > [minimatch](https://github.com/isaacs/minimatch), so the above example can
457
- > also be written as `"packages": ["@alpha/**"]`.
458
-
459
- `syncpack` will make ensure that:
460
-
461
- - The versions of `react` and `react-dom` are the same within `@alpha/server`
462
- and `@alpha/ui`.
463
- - The versions of `react` and `react-dom` are the same across every package
464
- except `@alpha/server` and `@alpha/ui`.
465
- - The versions of `react` and `react-dom` within `@alpha/server` and `@alpha/ui`
466
- can be different to the other packages in the monorepo.
467
- - The versions of every other dependency in the monorepo (eg `lodash`) are the
468
- same across every package including `@alpha/server` and `@alpha/ui`.
469
-
470
- Each dependency can only belong to one version group, the first rule which
471
- matches a given dependency and package will apply.
472
-
473
499
  ## 🕵🏾‍♀️ Resolving Packages
474
500
 
475
501
  package.json files are resolved in this order of precendence:
@@ -1,3 +1,3 @@
1
1
  import type { ProgramInput } from '../../lib/get-input';
2
2
  import type { IndexedVersionGroup } from '../../lib/get-input/get-instances';
3
- export declare function getExpectedVersion(name: string, versionGroup: Pick<IndexedVersionGroup, 'instances' | 'pinVersion'>, input: Pick<ProgramInput, 'wrappers'>): string;
3
+ export declare function getExpectedVersion(name: string, versionGroup: Pick<IndexedVersionGroup, 'instances' | 'pinVersion'>, input: Pick<ProgramInput, 'workspace' | 'wrappers'>): string;
@@ -6,7 +6,7 @@ var get_pinned_version_1 = require("./get-pinned-version");
6
6
  var get_workspace_version_1 = require("./get-workspace-version");
7
7
  function getExpectedVersion(name, versionGroup, input) {
8
8
  return ((0, get_pinned_version_1.getPinnedVersion)(versionGroup) ||
9
- (0, get_workspace_version_1.getWorkspaceVersion)(name, input.wrappers) ||
9
+ (input.workspace === true && (0, get_workspace_version_1.getWorkspaceVersion)(name, input.wrappers)) ||
10
10
  (0, get_highest_version_1.getHighestVersion)(versionGroup.instances
11
11
  .filter(function (instance) { return instance.name === name; })
12
12
  .map(function (_a) {
@@ -32,26 +32,27 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
32
32
  var __importDefault = (this && this.__importDefault) || function (mod) {
33
33
  return (mod && mod.__esModule) ? mod : { "default": mod };
34
34
  };
35
- var _a, _b, _c, _d, _e, _f, _g;
35
+ var _a, _b, _c, _d, _e, _f, _g, _h;
36
36
  exports.__esModule = true;
37
37
  var chalk_1 = __importDefault(require("chalk"));
38
38
  var commander_1 = require("commander");
39
- var option_1 = require("../option");
40
39
  var disk_1 = require("../lib/disk");
41
40
  var get_input_1 = require("../lib/get-input");
41
+ var option_1 = require("../option");
42
42
  var fix_mismatches_1 = require("./fix-mismatches");
43
43
  commander_1.program.description((0, chalk_1["default"])(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n Ensure that multiple packages requiring the same dependency define the same\n version, so that every package requires eg. {yellow react@16.4.2}, instead of a\n combination of {yellow react@16.4.2}, {yellow react@0.15.9}, and {yellow react@16.0.0}."], ["\n Ensure that multiple packages requiring the same dependency define the same\n version, so that every package requires eg. {yellow react@16.4.2}, instead of a\n combination of {yellow react@16.4.2}, {yellow react@0.15.9}, and {yellow react@16.0.0}."]))).replace(/^\n/, ''));
44
44
  commander_1.program.on('--help', function () {
45
45
  console.log((0, chalk_1["default"])(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\nResolving Packages:\n 1. If {yellow --source} globs are provided, use those.\n 2. If using Pnpm Workspaces, read {yellow packages} from {yellow pnpm-workspace.yaml} in the root of the project.\n 3. If using Yarn Workspaces, read {yellow workspaces} from {yellow package.json}.\n 4. If using Lerna, read {yellow packages} from {yellow lerna.json}.\n 5. Default to {yellow \"package.json\"} and {yellow \"packages/*/package.json\"}.\n\nExamples:\n {dim # uses defaults for resolving packages}\n syncpack fix-mismatches\n {dim # uses packages defined by --source when provided}\n syncpack fix-mismatches --source {yellow \"apps/*/package.json\"}\n {dim # multiple globs can be provided like this}\n syncpack fix-mismatches --source {yellow \"apps/*/package.json\"} --source {yellow \"core/*/package.json\"}\n {dim # uses dependencies regular expression defined by --filter when provided}\n syncpack fix-mismatches --filter {yellow \"typescript|tslint\"}\n {dim # only inspect \"devDependencies\"}\n syncpack fix-mismatches --dev\n {dim # only inspect \"devDependencies\" and \"peerDependencies\"}\n syncpack fix-mismatches --dev --peer\n {dim # indent package.json with 4 spaces instead of 2}\n syncpack fix-mismatches --indent {yellow \" \"}\n\nReference:\n globs {blue.underline https://github.com/isaacs/node-glob#glob-primer}\n lerna.json {blue.underline https://github.com/lerna/lerna#lernajson}\n Yarn Workspaces {blue.underline https://yarnpkg.com/lang/en/docs/workspaces}\n Pnpm Workspaces {blue.underline https://pnpm.js.org/en/workspaces}\n"], ["\nResolving Packages:\n 1. If {yellow --source} globs are provided, use those.\n 2. If using Pnpm Workspaces, read {yellow packages} from {yellow pnpm-workspace.yaml} in the root of the project.\n 3. If using Yarn Workspaces, read {yellow workspaces} from {yellow package.json}.\n 4. If using Lerna, read {yellow packages} from {yellow lerna.json}.\n 5. Default to {yellow \"package.json\"} and {yellow \"packages/*/package.json\"}.\n\nExamples:\n {dim # uses defaults for resolving packages}\n syncpack fix-mismatches\n {dim # uses packages defined by --source when provided}\n syncpack fix-mismatches --source {yellow \"apps/*/package.json\"}\n {dim # multiple globs can be provided like this}\n syncpack fix-mismatches --source {yellow \"apps/*/package.json\"} --source {yellow \"core/*/package.json\"}\n {dim # uses dependencies regular expression defined by --filter when provided}\n syncpack fix-mismatches --filter {yellow \"typescript|tslint\"}\n {dim # only inspect \"devDependencies\"}\n syncpack fix-mismatches --dev\n {dim # only inspect \"devDependencies\" and \"peerDependencies\"}\n syncpack fix-mismatches --dev --peer\n {dim # indent package.json with 4 spaces instead of 2}\n syncpack fix-mismatches --indent {yellow \" \"}\n\nReference:\n globs {blue.underline https://github.com/isaacs/node-glob#glob-primer}\n lerna.json {blue.underline https://github.com/lerna/lerna#lernajson}\n Yarn Workspaces {blue.underline https://yarnpkg.com/lang/en/docs/workspaces}\n Pnpm Workspaces {blue.underline https://pnpm.js.org/en/workspaces}\n"]))));
46
46
  });
47
- (_a = (_b = (_c = (_d = (_e = (_f = (_g = commander_1.program
47
+ (_a = (_b = (_c = (_d = (_e = (_f = (_g = (_h = commander_1.program
48
48
  .option.apply(commander_1.program, __spreadArray([], __read(option_1.option.source), false)))
49
+ .option.apply(_h, __spreadArray([], __read(option_1.option.filter), false)))
49
50
  .option.apply(_g, __spreadArray([], __read(option_1.option.prod), false)))
50
51
  .option.apply(_f, __spreadArray([], __read(option_1.option.dev), false)))
51
52
  .option.apply(_e, __spreadArray([], __read(option_1.option.peer), false)))
52
53
  .option.apply(_d, __spreadArray([], __read(option_1.option.resolutions), false)))
53
54
  .option.apply(_c, __spreadArray([], __read(option_1.option.overrides), false)))
54
- .option.apply(_b, __spreadArray([], __read(option_1.option.filter), false)))
55
+ .option.apply(_b, __spreadArray([], __read(option_1.option.workspace), false)))
55
56
  .option.apply(_a, __spreadArray([], __read(option_1.option.indent), false)).parse(process.argv);
56
57
  (0, fix_mismatches_1.fixMismatches)((0, get_input_1.getInput)(disk_1.disk, {
57
58
  dev: commander_1.program.opts().dev,
@@ -61,6 +62,7 @@ commander_1.program.on('--help', function () {
61
62
  peer: commander_1.program.opts().peer,
62
63
  prod: commander_1.program.opts().prod,
63
64
  resolutions: commander_1.program.opts().resolutions,
64
- source: commander_1.program.opts().source
65
+ source: commander_1.program.opts().source,
66
+ workspace: commander_1.program.opts().workspace
65
67
  }), disk_1.disk);
66
68
  var templateObject_1, templateObject_2;
@@ -36,9 +36,9 @@ var _a;
36
36
  exports.__esModule = true;
37
37
  var chalk_1 = __importDefault(require("chalk"));
38
38
  var commander_1 = require("commander");
39
- var option_1 = require("../option");
40
39
  var disk_1 = require("../lib/disk");
41
40
  var get_input_1 = require("../lib/get-input");
41
+ var option_1 = require("../option");
42
42
  var format_1 = require("./format");
43
43
  commander_1.program.description((0, chalk_1["default"])(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n Organise package.json files according to a conventional format, where fields\n appear in a predictable order and nested fields are ordered alphabetically.\n Shorthand properties are used where available, such as the {yellow repository} and\n {yellow bugs} fields."], ["\n Organise package.json files according to a conventional format, where fields\n appear in a predictable order and nested fields are ordered alphabetically.\n Shorthand properties are used where available, such as the {yellow repository} and\n {yellow bugs} fields."]))).replace(/^\n/, ''));
44
44
  commander_1.program.on('--help', function () {
@@ -49,8 +49,6 @@ commander_1.program.on('--help', function () {
49
49
  .option.apply(_a, __spreadArray([], __read(option_1.option.indent), false)).parse(process.argv);
50
50
  (0, format_1.format)((0, get_input_1.getInput)(disk_1.disk, {
51
51
  indent: commander_1.program.opts().indent,
52
- overrides: commander_1.program.opts().overrides,
53
- resolutions: commander_1.program.opts().resolutions,
54
52
  source: commander_1.program.opts().source
55
53
  }), disk_1.disk);
56
54
  var templateObject_1, templateObject_2;
@@ -32,27 +32,28 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
32
32
  var __importDefault = (this && this.__importDefault) || function (mod) {
33
33
  return (mod && mod.__esModule) ? mod : { "default": mod };
34
34
  };
35
- var _a, _b, _c, _d, _e, _f, _g;
35
+ var _a, _b, _c, _d, _e, _f, _g, _h;
36
36
  exports.__esModule = true;
37
37
  var chalk_1 = __importDefault(require("chalk"));
38
38
  var commander_1 = require("commander");
39
- var option_1 = require("../option");
40
39
  var disk_1 = require("../lib/disk");
41
40
  var get_input_1 = require("../lib/get-input");
41
+ var option_1 = require("../option");
42
42
  var lint_semver_ranges_1 = require("./lint-semver-ranges");
43
43
  commander_1.program.description((0, chalk_1["default"])(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n Check dependency versions within {yellow dependencies}, {yellow devDependencies},\n {yellow peerDependencies}, {yellow overrides}, and {yellow resolutions} follow a consistent format."], ["\n Check dependency versions within {yellow dependencies}, {yellow devDependencies},\n {yellow peerDependencies}, {yellow overrides}, and {yellow resolutions} follow a consistent format."]))).replace(/^\n/, ''));
44
44
  commander_1.program.on('--help', function () {
45
45
  console.log((0, chalk_1["default"])(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\nExamples:\n {dim # uses defaults for resolving packages}\n syncpack lint-semver-ranges\n {dim # uses packages defined by --source when provided}\n syncpack lint-semver-ranges --source {yellow \"apps/*/package.json\"}\n {dim # multiple globs can be provided like this}\n syncpack lint-semver-ranges --source {yellow \"apps/*/package.json\"} --source {yellow \"core/*/package.json\"}\n {dim # uses dependencies regular expression defined by --filter when provided}\n syncpack lint-semver-ranges --filter {yellow \"typescript|tslint\"}\n {dim # use ~ range instead of default \"\"}\n syncpack lint-semver-ranges --semver-range ~\n {dim # use ~ range in \"devDependencies\"}\n syncpack lint-semver-ranges --dev --semver-range ~\n {dim # use ~ range in \"devDependencies\" and \"peerDependencies\"}\n syncpack lint-semver-ranges --dev --peer --semver-range ~\n\nSupported Ranges:\n < {dim <1.4.2}\n <= {dim <=1.4.2}\n \"\" {dim 1.4.2}\n ~ {dim ~1.4.2}\n ^ {dim ^1.4.2}\n >= {dim >=1.4.2}\n > {dim >1.4.2}\n * {dim *}\n\nResolving Packages:\n 1. If {yellow --source} globs are provided, use those.\n 2. If using Pnpm Workspaces, read {yellow packages} from {yellow pnpm-workspace.yaml} in the root of the project.\n 3. If using Yarn Workspaces, read {yellow workspaces} from {yellow package.json}.\n 4. If using Lerna, read {yellow packages} from {yellow lerna.json}.\n 5. Default to {yellow \"package.json\"} and {yellow \"packages/*/package.json\"}.\n\nReference:\n globs {blue.underline https://github.com/isaacs/node-glob#glob-primer}\n lerna.json {blue.underline https://github.com/lerna/lerna#lernajson}\n Yarn Workspaces {blue.underline https://yarnpkg.com/lang/en/docs/workspaces}\n Pnpm Workspaces {blue.underline https://pnpm.js.org/en/workspaces}\n"], ["\nExamples:\n {dim # uses defaults for resolving packages}\n syncpack lint-semver-ranges\n {dim # uses packages defined by --source when provided}\n syncpack lint-semver-ranges --source {yellow \"apps/*/package.json\"}\n {dim # multiple globs can be provided like this}\n syncpack lint-semver-ranges --source {yellow \"apps/*/package.json\"} --source {yellow \"core/*/package.json\"}\n {dim # uses dependencies regular expression defined by --filter when provided}\n syncpack lint-semver-ranges --filter {yellow \"typescript|tslint\"}\n {dim # use ~ range instead of default \"\"}\n syncpack lint-semver-ranges --semver-range ~\n {dim # use ~ range in \"devDependencies\"}\n syncpack lint-semver-ranges --dev --semver-range ~\n {dim # use ~ range in \"devDependencies\" and \"peerDependencies\"}\n syncpack lint-semver-ranges --dev --peer --semver-range ~\n\nSupported Ranges:\n < {dim <1.4.2}\n <= {dim <=1.4.2}\n \"\" {dim 1.4.2}\n ~ {dim ~1.4.2}\n ^ {dim ^1.4.2}\n >= {dim >=1.4.2}\n > {dim >1.4.2}\n * {dim *}\n\nResolving Packages:\n 1. If {yellow --source} globs are provided, use those.\n 2. If using Pnpm Workspaces, read {yellow packages} from {yellow pnpm-workspace.yaml} in the root of the project.\n 3. If using Yarn Workspaces, read {yellow workspaces} from {yellow package.json}.\n 4. If using Lerna, read {yellow packages} from {yellow lerna.json}.\n 5. Default to {yellow \"package.json\"} and {yellow \"packages/*/package.json\"}.\n\nReference:\n globs {blue.underline https://github.com/isaacs/node-glob#glob-primer}\n lerna.json {blue.underline https://github.com/lerna/lerna#lernajson}\n Yarn Workspaces {blue.underline https://yarnpkg.com/lang/en/docs/workspaces}\n Pnpm Workspaces {blue.underline https://pnpm.js.org/en/workspaces}\n"]))));
46
46
  });
47
- (_a = (_b = (_c = (_d = (_e = (_f = (_g = commander_1.program
47
+ (_a = (_b = (_c = (_d = (_e = (_f = (_g = (_h = commander_1.program
48
48
  .option.apply(commander_1.program, __spreadArray([], __read(option_1.option.source), false)))
49
- .option.apply(_g, __spreadArray([], __read(option_1.option.prod), false)))
50
- .option.apply(_f, __spreadArray([], __read(option_1.option.dev), false)))
51
- .option.apply(_e, __spreadArray([], __read(option_1.option.peer), false)))
52
- .option.apply(_d, __spreadArray([], __read(option_1.option.resolutions), false)))
53
- .option.apply(_c, __spreadArray([], __read(option_1.option.overrides), false)))
54
- .option.apply(_b, __spreadArray([], __read(option_1.option.filter), false)))
55
- .option.apply(_a, __spreadArray([], __read(option_1.option.semverRange), false)).parse(process.argv);
49
+ .option.apply(_h, __spreadArray([], __read(option_1.option.filter), false)))
50
+ .option.apply(_g, __spreadArray([], __read(option_1.option.semverRange), false)))
51
+ .option.apply(_f, __spreadArray([], __read(option_1.option.prod), false)))
52
+ .option.apply(_e, __spreadArray([], __read(option_1.option.dev), false)))
53
+ .option.apply(_d, __spreadArray([], __read(option_1.option.peer), false)))
54
+ .option.apply(_c, __spreadArray([], __read(option_1.option.resolutions), false)))
55
+ .option.apply(_b, __spreadArray([], __read(option_1.option.overrides), false)))
56
+ .option.apply(_a, __spreadArray([], __read(option_1.option.workspace), false)).parse(process.argv);
56
57
  (0, lint_semver_ranges_1.lintSemverRanges)((0, get_input_1.getInput)(disk_1.disk, {
57
58
  dev: commander_1.program.opts().dev,
58
59
  filter: commander_1.program.opts().filter,
@@ -61,6 +62,7 @@ commander_1.program.on('--help', function () {
61
62
  prod: commander_1.program.opts().prod,
62
63
  resolutions: commander_1.program.opts().resolutions,
63
64
  semverRange: commander_1.program.opts().semverRange,
64
- source: commander_1.program.opts().source
65
+ source: commander_1.program.opts().source,
66
+ workspace: commander_1.program.opts().workspace
65
67
  }));
66
68
  var templateObject_1, templateObject_2;
@@ -32,26 +32,27 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
32
32
  var __importDefault = (this && this.__importDefault) || function (mod) {
33
33
  return (mod && mod.__esModule) ? mod : { "default": mod };
34
34
  };
35
- var _a, _b, _c, _d, _e, _f;
35
+ var _a, _b, _c, _d, _e, _f, _g;
36
36
  exports.__esModule = true;
37
37
  var chalk_1 = __importDefault(require("chalk"));
38
38
  var commander_1 = require("commander");
39
- var option_1 = require("../option");
40
39
  var disk_1 = require("../lib/disk");
41
40
  var get_input_1 = require("../lib/get-input");
41
+ var option_1 = require("../option");
42
42
  var list_1 = require("./list");
43
43
  commander_1.program.description(' List all dependencies required by your packages.');
44
44
  commander_1.program.on('--help', function () {
45
45
  console.log((0, chalk_1["default"])(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\nExamples:\n {dim # uses defaults for resolving packages}\n syncpack list\n {dim # uses packages defined by --source when provided}\n syncpack list --source {yellow \"apps/*/package.json\"}\n {dim # multiple globs can be provided like this}\n syncpack list --source {yellow \"apps/*/package.json\"} --source {yellow \"core/*/package.json\"}\n {dim # uses dependencies regular expression defined by --filter when provided}\n syncpack list --filter {yellow \"typescript|tslint\"}\n {dim # only inspect \"devDependencies\"}\n syncpack list --dev\n {dim # only inspect \"devDependencies\" and \"peerDependencies\"}\n syncpack list --dev --peer\n\nResolving Packages:\n 1. If {yellow --source} globs are provided, use those.\n 2. If using Pnpm Workspaces, read {yellow packages} from {yellow pnpm-workspace.yaml} in the root of the project.\n 3. If using Yarn Workspaces, read {yellow workspaces} from {yellow package.json}.\n 4. If using Lerna, read {yellow packages} from {yellow lerna.json}.\n 5. Default to {yellow \"package.json\"} and {yellow \"packages/*/package.json\"}.\n\nReference:\n globs {blue.underline https://github.com/isaacs/node-glob#glob-primer}\n lerna.json {blue.underline https://github.com/lerna/lerna#lernajson}\n Yarn Workspaces {blue.underline https://yarnpkg.com/lang/en/docs/workspaces}\n Pnpm Workspaces {blue.underline https://pnpm.js.org/en/workspaces}\n"], ["\nExamples:\n {dim # uses defaults for resolving packages}\n syncpack list\n {dim # uses packages defined by --source when provided}\n syncpack list --source {yellow \"apps/*/package.json\"}\n {dim # multiple globs can be provided like this}\n syncpack list --source {yellow \"apps/*/package.json\"} --source {yellow \"core/*/package.json\"}\n {dim # uses dependencies regular expression defined by --filter when provided}\n syncpack list --filter {yellow \"typescript|tslint\"}\n {dim # only inspect \"devDependencies\"}\n syncpack list --dev\n {dim # only inspect \"devDependencies\" and \"peerDependencies\"}\n syncpack list --dev --peer\n\nResolving Packages:\n 1. If {yellow --source} globs are provided, use those.\n 2. If using Pnpm Workspaces, read {yellow packages} from {yellow pnpm-workspace.yaml} in the root of the project.\n 3. If using Yarn Workspaces, read {yellow workspaces} from {yellow package.json}.\n 4. If using Lerna, read {yellow packages} from {yellow lerna.json}.\n 5. Default to {yellow \"package.json\"} and {yellow \"packages/*/package.json\"}.\n\nReference:\n globs {blue.underline https://github.com/isaacs/node-glob#glob-primer}\n lerna.json {blue.underline https://github.com/lerna/lerna#lernajson}\n Yarn Workspaces {blue.underline https://yarnpkg.com/lang/en/docs/workspaces}\n Pnpm Workspaces {blue.underline https://pnpm.js.org/en/workspaces}\n"]))));
46
46
  });
47
- (_a = (_b = (_c = (_d = (_e = (_f = commander_1.program
47
+ (_a = (_b = (_c = (_d = (_e = (_f = (_g = commander_1.program
48
48
  .option.apply(commander_1.program, __spreadArray([], __read(option_1.option.source), false)))
49
+ .option.apply(_g, __spreadArray([], __read(option_1.option.filter), false)))
49
50
  .option.apply(_f, __spreadArray([], __read(option_1.option.prod), false)))
50
51
  .option.apply(_e, __spreadArray([], __read(option_1.option.dev), false)))
51
52
  .option.apply(_d, __spreadArray([], __read(option_1.option.peer), false)))
52
53
  .option.apply(_c, __spreadArray([], __read(option_1.option.resolutions), false)))
53
54
  .option.apply(_b, __spreadArray([], __read(option_1.option.overrides), false)))
54
- .option.apply(_a, __spreadArray([], __read(option_1.option.filter), false)).parse(process.argv);
55
+ .option.apply(_a, __spreadArray([], __read(option_1.option.workspace), false)).parse(process.argv);
55
56
  (0, list_1.list)((0, get_input_1.getInput)(disk_1.disk, {
56
57
  dev: commander_1.program.opts().dev,
57
58
  filter: commander_1.program.opts().filter,
@@ -59,6 +60,7 @@ commander_1.program.on('--help', function () {
59
60
  peer: commander_1.program.opts().peer,
60
61
  prod: commander_1.program.opts().prod,
61
62
  resolutions: commander_1.program.opts().resolutions,
62
- source: commander_1.program.opts().source
63
+ source: commander_1.program.opts().source,
64
+ workspace: commander_1.program.opts().workspace
63
65
  }));
64
66
  var templateObject_1;
@@ -1,9 +1,8 @@
1
1
  import type { IndexedVersionGroup, Instance } from '../lib/get-input/get-instances';
2
- interface ListItem {
2
+ export interface ListItem {
3
3
  hasMismatches: boolean;
4
4
  instances: Instance[];
5
5
  name: string;
6
6
  uniques: string[];
7
7
  }
8
8
  export declare function listVersionGroups(versionGroup: IndexedVersionGroup): ListItem[];
9
- export {};
@@ -32,26 +32,27 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
32
32
  var __importDefault = (this && this.__importDefault) || function (mod) {
33
33
  return (mod && mod.__esModule) ? mod : { "default": mod };
34
34
  };
35
- var _a, _b, _c, _d, _e, _f;
35
+ var _a, _b, _c, _d, _e, _f, _g;
36
36
  exports.__esModule = true;
37
37
  var chalk_1 = __importDefault(require("chalk"));
38
38
  var commander_1 = require("commander");
39
- var option_1 = require("../option");
40
39
  var disk_1 = require("../lib/disk");
41
40
  var get_input_1 = require("../lib/get-input");
41
+ var option_1 = require("../option");
42
42
  var list_mismatches_1 = require("./list-mismatches");
43
43
  commander_1.program.description("\n List dependencies which are required by multiple packages, where the version\n is not the same across every package.".replace(/^\n/, ''));
44
44
  commander_1.program.on('--help', function () {
45
45
  console.log((0, chalk_1["default"])(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\nExamples:\n {dim # uses defaults for resolving packages}\n syncpack list-mismatches\n {dim # uses packages defined by --source when provided}\n syncpack list-mismatches --source {yellow \"apps/*/package.json\"}\n {dim # multiple globs can be provided like this}\n syncpack list-mismatches --source {yellow \"apps/*/package.json\"} --source {yellow \"core/*/package.json\"}\n {dim # uses dependencies regular expression defined by --filter when provided}\n syncpack list-mismatches --filter {yellow \"typescript|tslint\"}\n {dim # only inspect \"devDependencies\"}\n syncpack list-mismatches --dev\n {dim # only inspect \"devDependencies\" and \"peerDependencies\"}\n syncpack list-mismatches --dev --peer\n\nResolving Packages:\n 1. If {yellow --source} globs are provided, use those.\n 2. If using Pnpm Workspaces, read {yellow packages} from {yellow pnpm-workspace.yaml} in the root of the project.\n 3. If using Yarn Workspaces, read {yellow workspaces} from {yellow package.json}.\n 4. If using Lerna, read {yellow packages} from {yellow lerna.json}.\n 5. Default to {yellow \"package.json\"} and {yellow \"packages/*/package.json\"}.\n\nReference:\n globs {blue.underline https://github.com/isaacs/node-glob#glob-primer}\n lerna.json {blue.underline https://github.com/lerna/lerna#lernajson}\n Yarn Workspaces {blue.underline https://yarnpkg.com/lang/en/docs/workspaces}\n Pnpm Workspaces {blue.underline https://pnpm.js.org/en/workspaces}\n"], ["\nExamples:\n {dim # uses defaults for resolving packages}\n syncpack list-mismatches\n {dim # uses packages defined by --source when provided}\n syncpack list-mismatches --source {yellow \"apps/*/package.json\"}\n {dim # multiple globs can be provided like this}\n syncpack list-mismatches --source {yellow \"apps/*/package.json\"} --source {yellow \"core/*/package.json\"}\n {dim # uses dependencies regular expression defined by --filter when provided}\n syncpack list-mismatches --filter {yellow \"typescript|tslint\"}\n {dim # only inspect \"devDependencies\"}\n syncpack list-mismatches --dev\n {dim # only inspect \"devDependencies\" and \"peerDependencies\"}\n syncpack list-mismatches --dev --peer\n\nResolving Packages:\n 1. If {yellow --source} globs are provided, use those.\n 2. If using Pnpm Workspaces, read {yellow packages} from {yellow pnpm-workspace.yaml} in the root of the project.\n 3. If using Yarn Workspaces, read {yellow workspaces} from {yellow package.json}.\n 4. If using Lerna, read {yellow packages} from {yellow lerna.json}.\n 5. Default to {yellow \"package.json\"} and {yellow \"packages/*/package.json\"}.\n\nReference:\n globs {blue.underline https://github.com/isaacs/node-glob#glob-primer}\n lerna.json {blue.underline https://github.com/lerna/lerna#lernajson}\n Yarn Workspaces {blue.underline https://yarnpkg.com/lang/en/docs/workspaces}\n Pnpm Workspaces {blue.underline https://pnpm.js.org/en/workspaces}\n"]))));
46
46
  });
47
- (_a = (_b = (_c = (_d = (_e = (_f = commander_1.program
47
+ (_a = (_b = (_c = (_d = (_e = (_f = (_g = commander_1.program
48
48
  .option.apply(commander_1.program, __spreadArray([], __read(option_1.option.source), false)))
49
+ .option.apply(_g, __spreadArray([], __read(option_1.option.filter), false)))
49
50
  .option.apply(_f, __spreadArray([], __read(option_1.option.prod), false)))
50
51
  .option.apply(_e, __spreadArray([], __read(option_1.option.dev), false)))
51
52
  .option.apply(_d, __spreadArray([], __read(option_1.option.peer), false)))
52
53
  .option.apply(_c, __spreadArray([], __read(option_1.option.resolutions), false)))
53
54
  .option.apply(_b, __spreadArray([], __read(option_1.option.overrides), false)))
54
- .option.apply(_a, __spreadArray([], __read(option_1.option.filter), false)).parse(process.argv);
55
+ .option.apply(_a, __spreadArray([], __read(option_1.option.workspace), false)).parse(process.argv);
55
56
  (0, list_mismatches_1.listMismatches)((0, get_input_1.getInput)(disk_1.disk, {
56
57
  dev: commander_1.program.opts().dev,
57
58
  filter: commander_1.program.opts().filter,
@@ -59,6 +60,7 @@ commander_1.program.on('--help', function () {
59
60
  peer: commander_1.program.opts().peer,
60
61
  prod: commander_1.program.opts().prod,
61
62
  resolutions: commander_1.program.opts().resolutions,
62
- source: commander_1.program.opts().source
63
+ source: commander_1.program.opts().source,
64
+ workspace: commander_1.program.opts().workspace
63
65
  }));
64
66
  var templateObject_1;
@@ -9,8 +9,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
9
9
  exports.__esModule = true;
10
10
  exports.listMismatches = void 0;
11
11
  var chalk_1 = __importDefault(require("chalk"));
12
+ var path_1 = require("path");
12
13
  var get_expected_version_1 = require("../bin-fix-mismatches/get-expected-version");
13
14
  var list_version_groups_1 = require("../bin-list/list-version-groups");
15
+ var constants_1 = require("../constants");
14
16
  function listMismatches(input) {
15
17
  var isInvalid = false;
16
18
  /**
@@ -36,7 +38,13 @@ function listMismatches(input) {
36
38
  console.log((0, chalk_1["default"])(templateObject_2 || (templateObject_2 = __makeTemplateObject(["{dim -} ", " {green.dim ", "}"], ["{dim -} ", " {green.dim ", "}"])), name, expectedVersion));
37
39
  instances.forEach(function (_a) {
38
40
  var dependencyType = _a.dependencyType, version = _a.version, wrapper = _a.wrapper;
39
- console.log((0, chalk_1["default"])(templateObject_3 || (templateObject_3 = __makeTemplateObject(["{red ", " {dim in ", " of ", "}}"], ["{red ", " {dim in ", " of ", "}}"])), version, dependencyType, wrapper.contents.name));
41
+ if (dependencyType === 'workspace') {
42
+ var shortPath = (0, path_1.relative)(constants_1.CWD, wrapper.filePath);
43
+ console.log((0, chalk_1["default"])(templateObject_3 || (templateObject_3 = __makeTemplateObject(["{red ", " {dim at ", "}}"], ["{red ", " {dim at ", "}}"])), version, shortPath));
44
+ }
45
+ else {
46
+ console.log((0, chalk_1["default"])(templateObject_4 || (templateObject_4 = __makeTemplateObject(["{red ", " {dim in ", " of ", "}}"], ["{red ", " {dim in ", " of ", "}}"])), version, dependencyType, wrapper.contents.name));
47
+ }
40
48
  });
41
49
  });
42
50
  });
@@ -45,4 +53,4 @@ function listMismatches(input) {
45
53
  }
46
54
  }
47
55
  exports.listMismatches = listMismatches;
48
- var templateObject_1, templateObject_2, templateObject_3;
56
+ var templateObject_1, templateObject_2, templateObject_3, templateObject_4;
@@ -32,28 +32,29 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
32
32
  var __importDefault = (this && this.__importDefault) || function (mod) {
33
33
  return (mod && mod.__esModule) ? mod : { "default": mod };
34
34
  };
35
- var _a, _b, _c, _d, _e, _f, _g, _h;
35
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
36
36
  exports.__esModule = true;
37
37
  var chalk_1 = __importDefault(require("chalk"));
38
38
  var commander_1 = require("commander");
39
- var option_1 = require("../option");
40
39
  var disk_1 = require("../lib/disk");
41
40
  var get_input_1 = require("../lib/get-input");
41
+ var option_1 = require("../option");
42
42
  var set_semver_ranges_1 = require("./set-semver-ranges");
43
43
  commander_1.program.description((0, chalk_1["default"])(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n Ensure dependency versions within {yellow dependencies}, {yellow devDependencies},\n {yellow peerDependencies}, {yellow overrides}, and {yellow resolutions} follow a consistent format."], ["\n Ensure dependency versions within {yellow dependencies}, {yellow devDependencies},\n {yellow peerDependencies}, {yellow overrides}, and {yellow resolutions} follow a consistent format."]))).replace(/^\n/, ''));
44
44
  commander_1.program.on('--help', function () {
45
45
  console.log((0, chalk_1["default"])(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\nExamples:\n {dim # uses defaults for resolving packages}\n syncpack set-semver-ranges\n {dim # uses packages defined by --source when provided}\n syncpack set-semver-ranges --source {yellow \"apps/*/package.json\"}\n {dim # multiple globs can be provided like this}\n syncpack set-semver-ranges --source {yellow \"apps/*/package.json\"} --source {yellow \"core/*/package.json\"}\n {dim # uses dependencies regular expression defined by --filter when provided}\n syncpack set-semver-ranges --filter {yellow \"typescript|tslint\"}\n {dim # use ~ range instead of default \"\"}\n syncpack set-semver-ranges --semver-range ~\n {dim # set ~ range in \"devDependencies\"}\n syncpack set-semver-ranges --dev --semver-range ~\n {dim # set ~ range in \"devDependencies\" and \"peerDependencies\"}\n syncpack set-semver-ranges --dev --peer --semver-range ~\n {dim # indent package.json with 4 spaces instead of 2}\n syncpack set-semver-ranges --indent {yellow \" \"}\n\nSupported Ranges:\n < {dim <1.4.2}\n <= {dim <=1.4.2}\n \"\" {dim 1.4.2}\n ~ {dim ~1.4.2}\n ^ {dim ^1.4.2}\n >= {dim >=1.4.2}\n > {dim >1.4.2}\n * {dim *}\n\nResolving Packages:\n 1. If {yellow --source} globs are provided, use those.\n 2. If using Pnpm Workspaces, read {yellow packages} from {yellow pnpm-workspace.yaml} in the root of the project.\n 3. If using Yarn Workspaces, read {yellow workspaces} from {yellow package.json}.\n 4. If using Lerna, read {yellow packages} from {yellow lerna.json}.\n 5. Default to {yellow \"package.json\"} and {yellow \"packages/*/package.json\"}.\n\nReference:\n globs {blue.underline https://github.com/isaacs/node-glob#glob-primer}\n lerna.json {blue.underline https://github.com/lerna/lerna#lernajson}\n Yarn Workspaces {blue.underline https://yarnpkg.com/lang/en/docs/workspaces}\n Pnpm Workspaces {blue.underline https://pnpm.js.org/en/workspaces}\n"], ["\nExamples:\n {dim # uses defaults for resolving packages}\n syncpack set-semver-ranges\n {dim # uses packages defined by --source when provided}\n syncpack set-semver-ranges --source {yellow \"apps/*/package.json\"}\n {dim # multiple globs can be provided like this}\n syncpack set-semver-ranges --source {yellow \"apps/*/package.json\"} --source {yellow \"core/*/package.json\"}\n {dim # uses dependencies regular expression defined by --filter when provided}\n syncpack set-semver-ranges --filter {yellow \"typescript|tslint\"}\n {dim # use ~ range instead of default \"\"}\n syncpack set-semver-ranges --semver-range ~\n {dim # set ~ range in \"devDependencies\"}\n syncpack set-semver-ranges --dev --semver-range ~\n {dim # set ~ range in \"devDependencies\" and \"peerDependencies\"}\n syncpack set-semver-ranges --dev --peer --semver-range ~\n {dim # indent package.json with 4 spaces instead of 2}\n syncpack set-semver-ranges --indent {yellow \" \"}\n\nSupported Ranges:\n < {dim <1.4.2}\n <= {dim <=1.4.2}\n \"\" {dim 1.4.2}\n ~ {dim ~1.4.2}\n ^ {dim ^1.4.2}\n >= {dim >=1.4.2}\n > {dim >1.4.2}\n * {dim *}\n\nResolving Packages:\n 1. If {yellow --source} globs are provided, use those.\n 2. If using Pnpm Workspaces, read {yellow packages} from {yellow pnpm-workspace.yaml} in the root of the project.\n 3. If using Yarn Workspaces, read {yellow workspaces} from {yellow package.json}.\n 4. If using Lerna, read {yellow packages} from {yellow lerna.json}.\n 5. Default to {yellow \"package.json\"} and {yellow \"packages/*/package.json\"}.\n\nReference:\n globs {blue.underline https://github.com/isaacs/node-glob#glob-primer}\n lerna.json {blue.underline https://github.com/lerna/lerna#lernajson}\n Yarn Workspaces {blue.underline https://yarnpkg.com/lang/en/docs/workspaces}\n Pnpm Workspaces {blue.underline https://pnpm.js.org/en/workspaces}\n"]))));
46
46
  });
47
- (_a = (_b = (_c = (_d = (_e = (_f = (_g = (_h = commander_1.program
47
+ (_a = (_b = (_c = (_d = (_e = (_f = (_g = (_h = (_j = commander_1.program
48
48
  .option.apply(commander_1.program, __spreadArray([], __read(option_1.option.source), false)))
49
- .option.apply(_h, __spreadArray([], __read(option_1.option.prod), false)))
50
- .option.apply(_g, __spreadArray([], __read(option_1.option.dev), false)))
51
- .option.apply(_f, __spreadArray([], __read(option_1.option.peer), false)))
52
- .option.apply(_e, __spreadArray([], __read(option_1.option.resolutions), false)))
53
- .option.apply(_d, __spreadArray([], __read(option_1.option.overrides), false)))
54
- .option.apply(_c, __spreadArray([], __read(option_1.option.filter), false)))
55
- .option.apply(_b, __spreadArray([], __read(option_1.option.indent), false)))
56
- .option.apply(_a, __spreadArray([], __read(option_1.option.semverRange), false)).parse(process.argv);
49
+ .option.apply(_j, __spreadArray([], __read(option_1.option.semverRange), false)))
50
+ .option.apply(_h, __spreadArray([], __read(option_1.option.filter), false)))
51
+ .option.apply(_g, __spreadArray([], __read(option_1.option.prod), false)))
52
+ .option.apply(_f, __spreadArray([], __read(option_1.option.dev), false)))
53
+ .option.apply(_e, __spreadArray([], __read(option_1.option.peer), false)))
54
+ .option.apply(_d, __spreadArray([], __read(option_1.option.resolutions), false)))
55
+ .option.apply(_c, __spreadArray([], __read(option_1.option.overrides), false)))
56
+ .option.apply(_b, __spreadArray([], __read(option_1.option.workspace), false)))
57
+ .option.apply(_a, __spreadArray([], __read(option_1.option.indent), false)).parse(process.argv);
57
58
  (0, set_semver_ranges_1.setSemverRanges)((0, get_input_1.getInput)(disk_1.disk, {
58
59
  dev: commander_1.program.opts().dev,
59
60
  filter: commander_1.program.opts().filter,
@@ -63,6 +64,7 @@ commander_1.program.on('--help', function () {
63
64
  prod: commander_1.program.opts().prod,
64
65
  resolutions: commander_1.program.opts().resolutions,
65
66
  semverRange: commander_1.program.opts().semverRange,
66
- source: commander_1.program.opts().source
67
+ source: commander_1.program.opts().source,
68
+ workspace: commander_1.program.opts().workspace
67
69
  }), disk_1.disk);
68
70
  var templateObject_1, templateObject_2;
@@ -1,5 +1,5 @@
1
- export declare type DependencyType = 'dependencies' | 'devDependencies' | 'overrides' | 'peerDependencies' | 'resolutions';
2
- export declare type DependencyOption = Pick<SyncpackConfig, 'dev' | 'overrides' | 'peer' | 'prod' | 'resolutions'>;
1
+ export declare type DependencyType = 'dependencies' | 'devDependencies' | 'overrides' | 'peerDependencies' | 'resolutions' | 'workspace';
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 {
5
5
  /**
@@ -100,6 +100,11 @@ export declare type SyncpackConfig = Readonly<{
100
100
  *
101
101
  */
102
102
  versionGroups: VersionGroup[];
103
+ /**
104
+ * whether to include the versions of the `--source` packages developed in
105
+ * your workspace/monorepo as part of the search for versions to sync
106
+ */
107
+ workspace: boolean;
103
108
  }>;
104
109
  export declare const ALL_PATTERNS: string[];
105
110
  export declare const DEPENDENCY_TYPES: DependencyType[];
package/dist/constants.js CHANGED
@@ -8,6 +8,7 @@ exports.DEPENDENCY_TYPES = [
8
8
  'overrides',
9
9
  'peerDependencies',
10
10
  'resolutions',
11
+ 'workspace',
11
12
  ];
12
13
  exports.CWD = process.cwd();
13
14
  exports.GREATER = 1;
@@ -41,6 +42,7 @@ exports.DEFAULT_CONFIG = {
41
42
  peer: true,
42
43
  prod: true,
43
44
  resolutions: true,
45
+ workspace: true,
44
46
  semverGroups: [],
45
47
  semverRange: '',
46
48
  sortAz: [
package/dist/lib/disk.js CHANGED
@@ -9,7 +9,11 @@ var read_yaml_file_1 = require("read-yaml-file");
9
9
  var constants_1 = require("../constants");
10
10
  exports.disk = {
11
11
  globSync: function (pattern) {
12
- return (0, glob_1.sync)(pattern, { ignore: '**/node_modules/**', absolute: true, cwd: constants_1.CWD });
12
+ return (0, glob_1.sync)(pattern, {
13
+ ignore: '**/node_modules/**',
14
+ absolute: true,
15
+ cwd: constants_1.CWD
16
+ });
13
17
  },
14
18
  readConfigFileSync: function () {
15
19
  var rcSearch = (0, cosmiconfig_1.cosmiconfigSync)('syncpack').search();
@@ -13,6 +13,7 @@ var is_semver_1 = require("../../lib/is-semver");
13
13
  */
14
14
  var getConfig = function (rcFile, program) {
15
15
  var hasTypeOverride = (0, expect_more_1.isBoolean)(program.dev) ||
16
+ (0, expect_more_1.isBoolean)(program.workspace) ||
16
17
  (0, expect_more_1.isBoolean)(program.overrides) ||
17
18
  (0, expect_more_1.isBoolean)(program.peer) ||
18
19
  (0, expect_more_1.isBoolean)(program.prod) ||
@@ -20,6 +21,9 @@ var getConfig = function (rcFile, program) {
20
21
  var dev = hasTypeOverride
21
22
  ? Boolean(program.dev)
22
23
  : getOption('dev', expect_more_1.isBoolean);
24
+ var workspace = hasTypeOverride
25
+ ? Boolean(program.workspace)
26
+ : getOption('workspace', expect_more_1.isBoolean);
23
27
  var overrides = hasTypeOverride
24
28
  ? Boolean(program.overrides)
25
29
  : getOption('overrides', expect_more_1.isBoolean);
@@ -32,9 +36,10 @@ var getConfig = function (rcFile, program) {
32
36
  var resolutions = hasTypeOverride
33
37
  ? Boolean(program.resolutions)
34
38
  : getOption('resolutions', expect_more_1.isBoolean);
35
- var dependencyTypes = dev || overrides || peer || prod || resolutions
39
+ var dependencyTypes = dev || workspace || overrides || peer || prod || resolutions
36
40
  ? constants_1.DEPENDENCY_TYPES.filter(function (type) {
37
41
  return (type === 'devDependencies' && dev) ||
42
+ (type === 'workspace' && workspace) ||
38
43
  (type === 'overrides' && overrides) ||
39
44
  (type === 'peerDependencies' && peer) ||
40
45
  (type === 'dependencies' && prod) ||
@@ -71,6 +76,7 @@ var getConfig = function (rcFile, program) {
71
76
  dev: dev,
72
77
  filter: filter,
73
78
  indent: indent,
79
+ workspace: workspace,
74
80
  overrides: overrides,
75
81
  peer: peer,
76
82
  prod: prod,
@@ -46,7 +46,7 @@ var expect_more_1 = require("expect-more");
46
46
  var minimatch_1 = __importDefault(require("minimatch"));
47
47
  function getInstances(options, wrappers) {
48
48
  var e_1, _a, e_2, _b, e_3, _c;
49
- var _d;
49
+ var _d, _e, _f;
50
50
  var allInstances = {
51
51
  all: [],
52
52
  semverGroups: options.semverGroups.map(withInstances),
@@ -57,40 +57,56 @@ function getInstances(options, wrappers) {
57
57
  var wrapper = wrappers_1_1.value;
58
58
  var pkgName = wrapper.contents.name || 'packagewithoutaname';
59
59
  try {
60
- for (var _e = (e_2 = void 0, __values(options.dependencyTypes)), _f = _e.next(); !_f.done; _f = _e.next()) {
61
- var dependencyType = _f.value;
62
- var versionsByName = (_d = wrapper.contents) === null || _d === void 0 ? void 0 : _d[dependencyType];
63
- if (!(0, expect_more_1.isObject)(versionsByName))
64
- continue;
65
- var pkgs = Object.entries(versionsByName);
66
- try {
67
- 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()) {
68
- var _g = __read(pkgs_1_1.value, 2), name = _g[0], version = _g[1];
69
- if (!(0, expect_more_1.isNonEmptyString)(name))
70
- continue;
71
- if (name.search(new RegExp(options.filter)) === -1)
72
- continue;
73
- if (!(0, expect_more_1.isNonEmptyString)(version))
74
- continue;
75
- var instance = { dependencyType: dependencyType, name: name, version: version, wrapper: wrapper };
76
- allInstances.all.push(instance);
77
- groupInstancesBy('semverGroups', dependencyType, pkgName, instance);
78
- groupInstancesBy('versionGroups', dependencyType, pkgName, instance);
79
- }
60
+ for (var _g = (e_2 = void 0, __values(options.dependencyTypes)), _h = _g.next(); !_h.done; _h = _g.next()) {
61
+ var dependencyType = _h.value;
62
+ if (dependencyType === 'workspace') {
63
+ var name = (_d = wrapper.contents) === null || _d === void 0 ? void 0 : _d.name;
64
+ var version = (_e = wrapper.contents) === null || _e === void 0 ? void 0 : _e.version;
65
+ if (!(0, expect_more_1.isNonEmptyString)(name))
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);
80
75
  }
81
- catch (e_3_1) { e_3 = { error: e_3_1 }; }
82
- finally {
76
+ else {
77
+ var versionsByName = (_f = wrapper.contents) === null || _f === void 0 ? void 0 : _f[dependencyType];
78
+ if (!(0, expect_more_1.isObject)(versionsByName))
79
+ continue;
80
+ var pkgs = Object.entries(versionsByName);
83
81
  try {
84
- if (pkgs_1_1 && !pkgs_1_1.done && (_c = pkgs_1["return"])) _c.call(pkgs_1);
82
+ 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 _j = __read(pkgs_1_1.value, 2), name = _j[0], version = _j[1];
84
+ if (!(0, expect_more_1.isNonEmptyString)(name))
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);
94
+ }
95
+ }
96
+ catch (e_3_1) { e_3 = { error: e_3_1 }; }
97
+ finally {
98
+ try {
99
+ if (pkgs_1_1 && !pkgs_1_1.done && (_c = pkgs_1["return"])) _c.call(pkgs_1);
100
+ }
101
+ finally { if (e_3) throw e_3.error; }
85
102
  }
86
- finally { if (e_3) throw e_3.error; }
87
103
  }
88
104
  }
89
105
  }
90
106
  catch (e_2_1) { e_2 = { error: e_2_1 }; }
91
107
  finally {
92
108
  try {
93
- if (_f && !_f.done && (_b = _e["return"])) _b.call(_e);
109
+ if (_h && !_h.done && (_b = _g["return"])) _b.call(_g);
94
110
  }
95
111
  finally { if (e_2) throw e_2.error; }
96
112
  }
@@ -1,7 +1,11 @@
1
1
  "use strict";
2
2
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
3
  if (k2 === undefined) k2 = k;
4
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
5
9
  }) : (function(o, m, k, k2) {
6
10
  if (k2 === undefined) k2 = k;
7
11
  o[k2] = m[k];
@@ -1,7 +1,11 @@
1
1
  "use strict";
2
2
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
3
  if (k2 === undefined) k2 = k;
4
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
5
9
  }) : (function(o, m, k, k2) {
6
10
  if (k2 === undefined) k2 = k;
7
11
  o[k2] = m[k];
@@ -1,7 +1,11 @@
1
1
  "use strict";
2
2
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
3
  if (k2 === undefined) k2 = k;
4
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
5
9
  }) : (function(o, m, k, k2) {
6
10
  if (k2 === undefined) k2 = k;
7
11
  o[k2] = m[k];
@@ -1,7 +1,11 @@
1
1
  "use strict";
2
2
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
3
  if (k2 === undefined) k2 = k;
4
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
5
9
  }) : (function(o, m, k, k2) {
6
10
  if (k2 === undefined) k2 = k;
7
11
  o[k2] = m[k];
@@ -1,7 +1,11 @@
1
1
  "use strict";
2
2
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
3
  if (k2 === undefined) k2 = k;
4
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
5
9
  }) : (function(o, m, k, k2) {
6
10
  if (k2 === undefined) k2 = k;
7
11
  o[k2] = m[k];
@@ -1,7 +1,11 @@
1
1
  "use strict";
2
2
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
3
  if (k2 === undefined) k2 = k;
4
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
5
9
  }) : (function(o, m, k, k2) {
6
10
  if (k2 === undefined) k2 = k;
7
11
  o[k2] = m[k];
@@ -1,7 +1,11 @@
1
1
  "use strict";
2
2
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
3
  if (k2 === undefined) k2 = k;
4
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
5
9
  }) : (function(o, m, k, k2) {
6
10
  if (k2 === undefined) k2 = k;
7
11
  o[k2] = m[k];
@@ -1,7 +1,11 @@
1
1
  "use strict";
2
2
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
3
  if (k2 === undefined) k2 = k;
4
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
5
9
  }) : (function(o, m, k, k2) {
6
10
  if (k2 === undefined) k2 = k;
7
11
  o[k2] = m[k];
@@ -1,7 +1,11 @@
1
1
  "use strict";
2
2
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
3
  if (k2 === undefined) k2 = k;
4
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
5
9
  }) : (function(o, m, k, k2) {
6
10
  if (k2 === undefined) k2 = k;
7
11
  o[k2] = m[k];
@@ -21,8 +25,8 @@ var __importStar = (this && this.__importStar) || function (mod) {
21
25
  exports.__esModule = true;
22
26
  exports.getWrappers = void 0;
23
27
  var E = __importStar(require("fp-ts/lib/Either"));
24
- var O = __importStar(require("fp-ts/lib/Option"));
25
28
  var function_1 = require("fp-ts/lib/function");
29
+ var O = __importStar(require("fp-ts/lib/Option"));
26
30
  var get_file_paths_1 = require("./get-file-paths");
27
31
  var read_json_safe_1 = require("./get-patterns/read-json-safe");
28
32
  var readonly_1 = require("./readonly");
@@ -1,7 +1,11 @@
1
1
  "use strict";
2
2
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
3
  if (k2 === undefined) k2 = k;
4
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
5
9
  }) : (function(o, m, k, k2) {
6
10
  if (k2 === undefined) k2 = k;
7
11
  o[k2] = m[k];
package/dist/option.d.ts CHANGED
@@ -9,4 +9,5 @@ export declare const option: {
9
9
  readonly resolutions: readonly ["-R, --resolutions", string];
10
10
  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 \"~\""];
11
11
  readonly source: readonly ["-s, --source [pattern]", "glob pattern for package.json files to read from", typeof collect, string[]];
12
+ readonly workspace: readonly ["-w, --workspace", "include locally developed package versions"];
12
13
  };
package/dist/option.js CHANGED
@@ -9,8 +9,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
9
9
  exports.__esModule = true;
10
10
  exports.option = void 0;
11
11
  var chalk_1 = __importDefault(require("chalk"));
12
- var collect_1 = require("./lib/collect");
13
12
  var constants_1 = require("./constants");
13
+ var collect_1 = require("./lib/collect");
14
14
  exports.option = {
15
15
  dev: ['-d, --dev', (0, chalk_1["default"])(templateObject_1 || (templateObject_1 = __makeTemplateObject(["include {yellow devDependencies}"], ["include {yellow devDependencies}"])))],
16
16
  filter: [
@@ -37,6 +37,7 @@ exports.option = {
37
37
  'glob pattern for package.json files to read from',
38
38
  collect_1.collect,
39
39
  [],
40
- ]
40
+ ],
41
+ workspace: ['-w, --workspace', 'include locally developed package versions']
41
42
  };
42
43
  var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6;
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": "6.2.1",
4
+ "version": "7.0.0",
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": "8.3.0",
28
+ "commander": "9.2.0",
29
29
  "cosmiconfig": "7.0.1",
30
30
  "expect-more": "1.2.0",
31
- "fp-ts": "2.11.5",
32
- "fs-extra": "10.0.0",
33
- "glob": "7.2.0",
34
- "minimatch": "3.0.4",
31
+ "fp-ts": "2.12.0",
32
+ "fs-extra": "10.1.0",
33
+ "glob": "8.0.1",
34
+ "minimatch": "5.0.1",
35
35
  "read-yaml-file": "2.1.0",
36
- "semver": "7.3.5"
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": "27.4.0",
42
- "@types/node": "17.0.6",
41
+ "@types/jest": "27.4.1",
42
+ "@types/node": "17.0.25",
43
43
  "@types/semver": "7.3.9",
44
- "@typescript-eslint/eslint-plugin": "5.8.1",
45
- "@typescript-eslint/parser": "5.8.1",
46
- "eslint": "8.6.0",
47
- "eslint-plugin-import": "2.25.3",
44
+ "@typescript-eslint/eslint-plugin": "5.20.0",
45
+ "@typescript-eslint/parser": "5.20.0",
46
+ "eslint": "8.14.0",
47
+ "eslint-plugin-import": "2.26.0",
48
48
  "expect-more-jest": "5.4.0",
49
- "jest": "27.4.5",
50
- "prettier": "2.5.1",
49
+ "jest": "27.5.1",
50
+ "prettier": "2.6.2",
51
51
  "rimraf": "3.0.2",
52
- "ts-jest": "27.1.2",
53
- "typescript": "4.5.4"
52
+ "ts-jest": "27.1.4",
53
+ "typescript": "4.6.3"
54
54
  },
55
55
  "engines": {
56
56
  "node": ">=10"