syncpack 7.0.0 → 7.1.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.
package/README.md CHANGED
@@ -37,6 +37,7 @@ See [`versionGroups`](#versiongroups) if you have advanced requirements.
37
37
  -o, --overrides include overrides (pnpm)
38
38
  -w, --workspace include locally developed package versions
39
39
  -i, --indent [value] override indentation. defaults to " "
40
+ -c, --config <path> path to a syncpack config file
40
41
  -h, --help display help for command
41
42
  ```
42
43
 
@@ -77,7 +78,8 @@ Shorthand properties are used where available, such as the `"repository"` and
77
78
  ```
78
79
  -s, --source [pattern] glob pattern for package.json files to read from
79
80
  -i, --indent [value] override indentation. defaults to " "
80
- -h, --help output usage information
81
+ -c, --config <path> path to a syncpack config file
82
+ -h, --help display help for command
81
83
  ```
82
84
 
83
85
  </details>
@@ -110,13 +112,14 @@ See [`semverGroups`](#semvergroups) if you have advanced requirements.
110
112
 
111
113
  ```
112
114
  -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 ""
115
115
  -p, --prod include dependencies
116
116
  -d, --dev include devDependencies
117
117
  -P, --peer include peerDependencies
118
118
  -R, --resolutions include resolutions (yarn)
119
119
  -o, --overrides include overrides (pnpm)
120
+ -f, --filter [pattern] only include dependencies whose name matches this regex
121
+ -r, --semver-range <range> see supported ranges below. defaults to ""
122
+ -c, --config <path> path to a syncpack config file
120
123
  -w, --workspace include locally developed package versions
121
124
  -h, --help display help for command
122
125
  ```
@@ -154,12 +157,13 @@ List all dependencies required by your packages.
154
157
 
155
158
  ```
156
159
  -s, --source [pattern] glob pattern for package.json files to read from
157
- -f, --filter [pattern] only include dependencies whose name matches this regex
158
160
  -p, --prod include dependencies
159
161
  -d, --dev include devDependencies
160
162
  -P, --peer include peerDependencies
161
163
  -R, --resolutions include resolutions (yarn)
162
164
  -o, --overrides include overrides (pnpm)
165
+ -f, --filter [pattern] only include dependencies whose name matches this regex
166
+ -c, --config <path> path to a syncpack config file
163
167
  -w, --workspace include locally developed package versions
164
168
  -h, --help display help for command
165
169
  ```
@@ -198,12 +202,13 @@ See [`versionGroups`](#versiongroups) if you have advanced requirements.
198
202
 
199
203
  ```
200
204
  -s, --source [pattern] glob pattern for package.json files to read from
201
- -f, --filter [pattern] only include dependencies whose name matches this regex
202
205
  -p, --prod include dependencies
203
206
  -d, --dev include devDependencies
204
207
  -P, --peer include peerDependencies
205
208
  -R, --resolutions include resolutions (yarn)
206
209
  -o, --overrides include overrides (pnpm)
210
+ -f, --filter [pattern] only include dependencies whose name matches this regex
211
+ -c, --config <path> path to a syncpack config file
207
212
  -w, --workspace include locally developed package versions
208
213
  -h, --help display help for command
209
214
  ```
@@ -251,6 +256,8 @@ See [`semverGroups`](#semvergroups) if you have advanced requirements.
251
256
  -o, --overrides include overrides (pnpm)
252
257
  -w, --workspace include locally developed package versions
253
258
  -i, --indent [value] override indentation. defaults to " "
259
+ -r, --semver-range <range> see supported ranges below. defaults to ""
260
+ -c, --config <path> path to a syncpack config file
254
261
  -h, --help display help for command
255
262
  ```
256
263
 
@@ -292,6 +299,9 @@ tree in the following places:
292
299
  - a `syncpack.config.js` or `syncpack.config.cjs` CommonJS module exporting an
293
300
  object
294
301
 
302
+ If you want to specify a path to a configuration file, overriding the discovered
303
+ configuration file (if present), you can use the `--config` option.
304
+
295
305
  ### Default Configuration
296
306
 
297
307
  ```json
@@ -32,7 +32,7 @@ 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");
@@ -44,9 +44,10 @@ commander_1.program.description((0, chalk_1["default"])(templateObject_1 || (tem
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 = (_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.filter), false)))
49
+ .option.apply(_j, __spreadArray([], __read(option_1.option.filter), false)))
50
+ .option.apply(_h, __spreadArray([], __read(option_1.option.config), false)))
50
51
  .option.apply(_g, __spreadArray([], __read(option_1.option.prod), false)))
51
52
  .option.apply(_f, __spreadArray([], __read(option_1.option.dev), false)))
52
53
  .option.apply(_e, __spreadArray([], __read(option_1.option.peer), false)))
@@ -55,6 +56,7 @@ commander_1.program.on('--help', function () {
55
56
  .option.apply(_b, __spreadArray([], __read(option_1.option.workspace), false)))
56
57
  .option.apply(_a, __spreadArray([], __read(option_1.option.indent), false)).parse(process.argv);
57
58
  (0, fix_mismatches_1.fixMismatches)((0, get_input_1.getInput)(disk_1.disk, {
59
+ configPath: commander_1.program.opts().config,
58
60
  dev: commander_1.program.opts().dev,
59
61
  filter: commander_1.program.opts().filter,
60
62
  indent: commander_1.program.opts().indent,
@@ -32,7 +32,7 @@ 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;
35
+ var _a, _b;
36
36
  exports.__esModule = true;
37
37
  var chalk_1 = __importDefault(require("chalk"));
38
38
  var commander_1 = require("commander");
@@ -44,10 +44,12 @@ commander_1.program.description((0, chalk_1["default"])(templateObject_1 || (tem
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 format\n {dim # uses packages defined by --source when provided}\n syncpack format --source {yellow \"apps/*/package.json\"}\n {dim # multiple globs can be provided like this}\n syncpack format --source {yellow \"apps/*/package.json\"} --source {yellow \"core/*/package.json\"}\n {dim # indent package.json with 4 spaces instead of 2}\n syncpack format --indent {yellow \" \"}\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 format\n {dim # uses packages defined by --source when provided}\n syncpack format --source {yellow \"apps/*/package.json\"}\n {dim # multiple globs can be provided like this}\n syncpack format --source {yellow \"apps/*/package.json\"} --source {yellow \"core/*/package.json\"}\n {dim # indent package.json with 4 spaces instead of 2}\n syncpack format --indent {yellow \" \"}\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 = commander_1.program
47
+ (_a = (_b = commander_1.program
48
48
  .option.apply(commander_1.program, __spreadArray([], __read(option_1.option.source), false)))
49
+ .option.apply(_b, __spreadArray([], __read(option_1.option.config), false)))
49
50
  .option.apply(_a, __spreadArray([], __read(option_1.option.indent), false)).parse(process.argv);
50
51
  (0, format_1.format)((0, get_input_1.getInput)(disk_1.disk, {
52
+ configPath: commander_1.program.opts().config,
51
53
  indent: commander_1.program.opts().indent,
52
54
  source: commander_1.program.opts().source
53
55
  }), disk_1.disk);
@@ -32,7 +32,7 @@ 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");
@@ -44,10 +44,11 @@ commander_1.program.description((0, chalk_1["default"])(templateObject_1 || (tem
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 = (_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.filter), false)))
50
- .option.apply(_g, __spreadArray([], __read(option_1.option.semverRange), false)))
49
+ .option.apply(_j, __spreadArray([], __read(option_1.option.filter), false)))
50
+ .option.apply(_h, __spreadArray([], __read(option_1.option.semverRange), false)))
51
+ .option.apply(_g, __spreadArray([], __read(option_1.option.config), false)))
51
52
  .option.apply(_f, __spreadArray([], __read(option_1.option.prod), false)))
52
53
  .option.apply(_e, __spreadArray([], __read(option_1.option.dev), false)))
53
54
  .option.apply(_d, __spreadArray([], __read(option_1.option.peer), false)))
@@ -55,6 +56,7 @@ commander_1.program.on('--help', function () {
55
56
  .option.apply(_b, __spreadArray([], __read(option_1.option.overrides), false)))
56
57
  .option.apply(_a, __spreadArray([], __read(option_1.option.workspace), false)).parse(process.argv);
57
58
  (0, lint_semver_ranges_1.lintSemverRanges)((0, get_input_1.getInput)(disk_1.disk, {
59
+ configPath: commander_1.program.opts().config,
58
60
  dev: commander_1.program.opts().dev,
59
61
  filter: commander_1.program.opts().filter,
60
62
  overrides: commander_1.program.opts().overrides,
@@ -32,7 +32,7 @@ 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");
@@ -44,9 +44,10 @@ commander_1.program.description(' List all dependencies required by your packag
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 = (_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.filter), false)))
49
+ .option.apply(_h, __spreadArray([], __read(option_1.option.filter), false)))
50
+ .option.apply(_g, __spreadArray([], __read(option_1.option.config), false)))
50
51
  .option.apply(_f, __spreadArray([], __read(option_1.option.prod), false)))
51
52
  .option.apply(_e, __spreadArray([], __read(option_1.option.dev), false)))
52
53
  .option.apply(_d, __spreadArray([], __read(option_1.option.peer), false)))
@@ -54,6 +55,7 @@ commander_1.program.on('--help', function () {
54
55
  .option.apply(_b, __spreadArray([], __read(option_1.option.overrides), false)))
55
56
  .option.apply(_a, __spreadArray([], __read(option_1.option.workspace), false)).parse(process.argv);
56
57
  (0, list_1.list)((0, get_input_1.getInput)(disk_1.disk, {
58
+ configPath: commander_1.program.opts().config,
57
59
  dev: commander_1.program.opts().dev,
58
60
  filter: commander_1.program.opts().filter,
59
61
  overrides: commander_1.program.opts().overrides,
@@ -32,7 +32,7 @@ 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");
@@ -44,9 +44,10 @@ commander_1.program.description("\n List dependencies which are required by mul
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 = (_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.filter), false)))
49
+ .option.apply(_h, __spreadArray([], __read(option_1.option.filter), false)))
50
+ .option.apply(_g, __spreadArray([], __read(option_1.option.config), false)))
50
51
  .option.apply(_f, __spreadArray([], __read(option_1.option.prod), false)))
51
52
  .option.apply(_e, __spreadArray([], __read(option_1.option.dev), false)))
52
53
  .option.apply(_d, __spreadArray([], __read(option_1.option.peer), false)))
@@ -54,6 +55,7 @@ commander_1.program.on('--help', function () {
54
55
  .option.apply(_b, __spreadArray([], __read(option_1.option.overrides), false)))
55
56
  .option.apply(_a, __spreadArray([], __read(option_1.option.workspace), false)).parse(process.argv);
56
57
  (0, list_mismatches_1.listMismatches)((0, get_input_1.getInput)(disk_1.disk, {
58
+ configPath: commander_1.program.opts().config,
57
59
  dev: commander_1.program.opts().dev,
58
60
  filter: commander_1.program.opts().filter,
59
61
  overrides: commander_1.program.opts().overrides,
@@ -32,7 +32,7 @@ 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, _j;
35
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
36
36
  exports.__esModule = true;
37
37
  var chalk_1 = __importDefault(require("chalk"));
38
38
  var commander_1 = require("commander");
@@ -44,10 +44,11 @@ commander_1.program.description((0, chalk_1["default"])(templateObject_1 || (tem
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 = (_j = commander_1.program
47
+ (_a = (_b = (_c = (_d = (_e = (_f = (_g = (_h = (_j = (_k = commander_1.program
48
48
  .option.apply(commander_1.program, __spreadArray([], __read(option_1.option.source), false)))
49
- .option.apply(_j, __spreadArray([], __read(option_1.option.semverRange), false)))
50
- .option.apply(_h, __spreadArray([], __read(option_1.option.filter), false)))
49
+ .option.apply(_k, __spreadArray([], __read(option_1.option.filter), false)))
50
+ .option.apply(_j, __spreadArray([], __read(option_1.option.config), false)))
51
+ .option.apply(_h, __spreadArray([], __read(option_1.option.semverRange), false)))
51
52
  .option.apply(_g, __spreadArray([], __read(option_1.option.prod), false)))
52
53
  .option.apply(_f, __spreadArray([], __read(option_1.option.dev), false)))
53
54
  .option.apply(_e, __spreadArray([], __read(option_1.option.peer), false)))
@@ -56,6 +57,7 @@ commander_1.program.on('--help', function () {
56
57
  .option.apply(_b, __spreadArray([], __read(option_1.option.workspace), false)))
57
58
  .option.apply(_a, __spreadArray([], __read(option_1.option.indent), false)).parse(process.argv);
58
59
  (0, set_semver_ranges_1.setSemverRanges)((0, get_input_1.getInput)(disk_1.disk, {
60
+ configPath: commander_1.program.opts().config,
59
61
  dev: commander_1.program.opts().dev,
60
62
  filter: commander_1.program.opts().filter,
61
63
  indent: commander_1.program.opts().indent,
@@ -2,7 +2,7 @@ import type { SyncpackConfig } from '../constants';
2
2
  export declare type Disk = typeof disk;
3
3
  export declare const disk: {
4
4
  readonly globSync: (pattern: string) => string[];
5
- readonly readConfigFileSync: () => Partial<SyncpackConfig>;
5
+ readonly readConfigFileSync: (configPath?: string | undefined) => Partial<SyncpackConfig>;
6
6
  readonly readFileSync: (filePath: string) => string;
7
7
  readonly readYamlFileSync: <T = unknown>(filePath: string) => T;
8
8
  readonly removeSync: (filePath: string) => void;
package/dist/lib/disk.js CHANGED
@@ -7,6 +7,8 @@ var fs_extra_1 = require("fs-extra");
7
7
  var glob_1 = require("glob");
8
8
  var read_yaml_file_1 = require("read-yaml-file");
9
9
  var constants_1 = require("../constants");
10
+ var log_1 = require("./log");
11
+ var client = (0, cosmiconfig_1.cosmiconfigSync)('syncpack');
10
12
  exports.disk = {
11
13
  globSync: function (pattern) {
12
14
  return (0, glob_1.sync)(pattern, {
@@ -15,11 +17,19 @@ exports.disk = {
15
17
  cwd: constants_1.CWD
16
18
  });
17
19
  },
18
- readConfigFileSync: function () {
19
- var rcSearch = (0, cosmiconfig_1.cosmiconfigSync)('syncpack').search();
20
- var rcConfig = rcSearch !== null ? rcSearch.config : {};
21
- var rcFile = (0, expect_more_1.isObject)(rcConfig) ? rcConfig : {};
22
- return rcFile;
20
+ readConfigFileSync: function (configPath) {
21
+ try {
22
+ var result = configPath ? client.load(configPath) : client.search();
23
+ var rcConfig = result !== null ? result.config : {};
24
+ var rcFile = (0, expect_more_1.isObject)(rcConfig)
25
+ ? rcConfig
26
+ : {};
27
+ return rcFile;
28
+ }
29
+ catch (err) {
30
+ (0, log_1.verbose)("no config file found at ".concat(configPath));
31
+ return {};
32
+ }
23
33
  },
24
34
  readFileSync: function (filePath) {
25
35
  return (0, fs_extra_1.readFileSync)(filePath, { encoding: 'utf8' });
@@ -1,4 +1,5 @@
1
1
  import type { SyncpackConfig } from '../../constants';
2
+ import type { Disk } from '../disk';
2
3
  /**
3
4
  * Take all configuration from the command line and config file, combine it, and
4
5
  * set defaults for anything which hasn't been defined.
@@ -6,4 +7,6 @@ import type { SyncpackConfig } from '../../constants';
6
7
  * @param rcFile Optional configuration file contents
7
8
  * @param program Optional command line options
8
9
  */
9
- export declare const getConfig: (rcFile: Partial<SyncpackConfig>, program: Partial<SyncpackConfig>) => SyncpackConfig;
10
+ export declare const getConfig: (disk: Disk, program: Partial<SyncpackConfig & {
11
+ configPath: string;
12
+ }>) => SyncpackConfig;
@@ -11,7 +11,8 @@ var is_semver_1 = require("../../lib/is-semver");
11
11
  * @param rcFile Optional configuration file contents
12
12
  * @param program Optional command line options
13
13
  */
14
- var getConfig = function (rcFile, program) {
14
+ var getConfig = function (disk, program) {
15
+ var rcFile = disk.readConfigFileSync(program.configPath);
15
16
  var hasTypeOverride = (0, expect_more_1.isBoolean)(program.dev) ||
16
17
  (0, expect_more_1.isBoolean)(program.workspace) ||
17
18
  (0, expect_more_1.isBoolean)(program.overrides) ||
@@ -22,21 +22,16 @@ var __importStar = (this && this.__importStar) || function (mod) {
22
22
  __setModuleDefault(result, mod);
23
23
  return result;
24
24
  };
25
- var __importDefault = (this && this.__importDefault) || function (mod) {
26
- return (mod && mod.__esModule) ? mod : { "default": mod };
27
- };
28
25
  exports.__esModule = true;
29
26
  exports.tapNone = void 0;
30
- var chalk_1 = __importDefault(require("chalk"));
31
27
  var O = __importStar(require("fp-ts/lib/Option"));
28
+ var log_1 = require("../../log");
32
29
  /**
33
30
  * Log a message when a pipeline contains `None` and let it continue unchanged.
34
31
  */
35
32
  function tapNone(message) {
36
33
  return O.fold(function logNoneValue() {
37
- if (process.env.SYNCPACK_VERBOSE) {
38
- console.log(chalk_1["default"].yellow("? ".concat(message)));
39
- }
34
+ (0, log_1.verbose)(message);
40
35
  return O.none;
41
36
  }, O.of);
42
37
  }
@@ -13,6 +13,8 @@ export declare type ProgramInput = SyncpackConfig & {
13
13
  * that the majority of syncpack and its tests don't have to deal with the file
14
14
  * system and can focus solely on transformation logic.
15
15
  *
16
- * @param program Options received from CLI arguments
16
+ * @param program Options received from CLI arguments
17
17
  */
18
- export declare function getInput(disk: Disk, program: Partial<SyncpackConfig>): ProgramInput;
18
+ export declare function getInput(disk: Disk, program: Partial<SyncpackConfig & {
19
+ configPath: string;
20
+ }>): ProgramInput;
@@ -21,11 +21,10 @@ var get_wrappers_1 = require("./get-wrappers");
21
21
  * that the majority of syncpack and its tests don't have to deal with the file
22
22
  * system and can focus solely on transformation logic.
23
23
  *
24
- * @param program Options received from CLI arguments
24
+ * @param program Options received from CLI arguments
25
25
  */
26
26
  function getInput(disk, program) {
27
- var rcFile = disk.readConfigFileSync();
28
- var config = (0, get_config_1.getConfig)(rcFile, program);
27
+ var config = (0, get_config_1.getConfig)(disk, program);
29
28
  var wrappers = (0, get_wrappers_1.getWrappers)(disk, config);
30
29
  var instances = (0, get_instances_1.getInstances)(config, wrappers);
31
30
  return __assign(__assign({}, config), { disk: disk, instances: instances, wrappers: wrappers });
@@ -0,0 +1 @@
1
+ export declare function verbose(message: string): void;
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ exports.__esModule = true;
6
+ exports.verbose = void 0;
7
+ var chalk_1 = __importDefault(require("chalk"));
8
+ function verbose(message) {
9
+ if (process.env.SYNCPACK_VERBOSE) {
10
+ console.log(chalk_1["default"].yellow("? ".concat(message)));
11
+ }
12
+ }
13
+ exports.verbose = verbose;
package/dist/option.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  import { collect } from './lib/collect';
2
2
  export declare const option: {
3
+ readonly config: readonly ["-c, --config <path>", "path to a syncpack config file"];
3
4
  readonly dev: readonly ["-d, --dev", string];
4
5
  readonly filter: readonly ["-f, --filter [pattern]", string];
5
6
  readonly indent: readonly ["-i, --indent [value]", `override indentation. defaults to "${string}"`];
package/dist/option.js CHANGED
@@ -12,6 +12,7 @@ var chalk_1 = __importDefault(require("chalk"));
12
12
  var constants_1 = require("./constants");
13
13
  var collect_1 = require("./lib/collect");
14
14
  exports.option = {
15
+ config: ['-c, --config <path>', 'path to a syncpack config file'],
15
16
  dev: ['-d, --dev', (0, chalk_1["default"])(templateObject_1 || (templateObject_1 = __makeTemplateObject(["include {yellow devDependencies}"], ["include {yellow devDependencies}"])))],
16
17
  filter: [
17
18
  '-f, --filter [pattern]',
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": "7.0.0",
4
+ "version": "7.1.0",
5
5
  "author": "Jamie Mason <jamie@foldleft.io> (https://github.com/JamieMason)",
6
6
  "bin": {
7
7
  "syncpack": "dist/bin.js",