syncpack 9.3.2 → 9.8.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (100) hide show
  1. package/dist/bin-fix-mismatches/fix-mismatches-cli.js +4 -4
  2. package/dist/bin-fix-mismatches/fix-mismatches.js +17 -15
  3. package/dist/bin-fix-mismatches/index.js +50 -48
  4. package/dist/bin-format/format-cli.js +4 -4
  5. package/dist/bin-format/format.js +20 -18
  6. package/dist/bin-format/index.js +43 -46
  7. package/dist/bin-lint-semver-ranges/index.js +59 -48
  8. package/dist/bin-lint-semver-ranges/lint-semver-ranges-cli.js +4 -4
  9. package/dist/bin-lint-semver-ranges/lint-semver-ranges.js +13 -35
  10. package/dist/bin-list/index.js +43 -46
  11. package/dist/bin-list/list-cli.js +4 -4
  12. package/dist/bin-list/list.js +26 -29
  13. package/dist/bin-list-mismatches/index.js +46 -47
  14. package/dist/bin-list-mismatches/list-mismatches-cli.js +4 -4
  15. package/dist/bin-list-mismatches/list-mismatches.js +55 -40
  16. package/dist/bin-set-semver-ranges/index.js +62 -49
  17. package/dist/bin-set-semver-ranges/set-semver-ranges-cli.js +4 -4
  18. package/dist/bin-set-semver-ranges/set-semver-ranges.js +4 -4
  19. package/dist/bin.js +8 -8
  20. package/dist/constants.d.ts +2 -1
  21. package/dist/constants.js +6 -5
  22. package/dist/get-context/$R.js +14 -36
  23. package/dist/get-context/get-config/get-core-types.js +11 -41
  24. package/dist/get-context/get-config/get-custom-types.js +7 -19
  25. package/dist/get-context/get-config/get-enabled-types.js +9 -11
  26. package/dist/get-context/get-config/index.d.ts +3 -1
  27. package/dist/get-context/get-config/index.js +37 -61
  28. package/dist/get-context/get-config/path-strategy/index.js +8 -8
  29. package/dist/get-context/get-config/path-strategy/lib/get-non-empty-string-prop.js +6 -6
  30. package/dist/get-context/get-config/path-strategy/name-and-version-props.js +23 -49
  31. package/dist/get-context/get-config/path-strategy/name-and-version-string.js +26 -42
  32. package/dist/get-context/get-config/path-strategy/types.js +1 -1
  33. package/dist/get-context/get-config/path-strategy/version-string.js +25 -41
  34. package/dist/get-context/get-config/path-strategy/versions-by-name.js +14 -30
  35. package/dist/get-context/get-config/schema/base-group.d.ts +2 -2
  36. package/dist/get-context/get-config/schema/base-group.js +5 -5
  37. package/dist/get-context/get-config/schema/index.d.ts +292 -164
  38. package/dist/get-context/get-config/schema/index.js +40 -63
  39. package/dist/get-context/get-config/schema/lib/non-empty-string.d.ts +2 -0
  40. package/dist/get-context/get-config/schema/lib/non-empty-string.js +5 -0
  41. package/dist/get-context/get-config/schema/paths.js +12 -12
  42. package/dist/get-context/get-config/schema/semver-group.d.ts +24 -24
  43. package/dist/get-context/get-config/schema/semver-group.js +11 -18
  44. package/dist/get-context/get-config/schema/semver-range.js +4 -4
  45. package/dist/get-context/get-config/schema/version-group.d.ts +90 -41
  46. package/dist/get-context/get-config/schema/version-group.js +28 -23
  47. package/dist/get-context/get-groups/base-group.d.ts +4 -1
  48. package/dist/get-context/get-groups/base-group.js +18 -19
  49. package/dist/get-context/get-groups/index.d.ts +7 -3
  50. package/dist/get-context/get-groups/index.js +42 -38
  51. package/dist/get-context/get-groups/semver-group.d.ts +0 -1
  52. package/dist/get-context/get-groups/semver-group.js +23 -66
  53. package/dist/get-context/get-groups/version-group/index.d.ts +7 -4
  54. package/dist/get-context/get-groups/version-group/index.js +31 -70
  55. package/dist/get-context/get-groups/version-group/instance-group/get-highest-version.d.ts +3 -1
  56. package/dist/get-context/get-groups/version-group/instance-group/get-highest-version.js +36 -45
  57. package/dist/get-context/get-groups/version-group/instance-group/get-lowest-version.d.ts +3 -0
  58. package/dist/get-context/get-groups/version-group/instance-group/get-lowest-version.js +44 -0
  59. package/dist/get-context/get-groups/version-group/instance-group/index.d.ts +16 -5
  60. package/dist/get-context/get-groups/version-group/instance-group/index.js +66 -54
  61. package/dist/get-context/get-groups/version-group/instance-group/lib/clean.d.ts +2 -0
  62. package/dist/get-context/get-groups/version-group/instance-group/lib/clean.js +13 -0
  63. package/dist/get-context/get-groups/version-group/instance-group/lib/compare-semver.d.ts +4 -0
  64. package/dist/get-context/get-groups/version-group/instance-group/lib/compare-semver.js +38 -0
  65. package/dist/get-context/get-groups/version-group/instance-group/lib/get-range-score.d.ts +2 -0
  66. package/dist/get-context/get-groups/version-group/instance-group/lib/get-range-score.js +23 -0
  67. package/dist/get-context/get-package-json-files/get-file-paths.js +18 -19
  68. package/dist/get-context/get-package-json-files/get-patterns/get-lerna-patterns.js +9 -12
  69. package/dist/get-context/get-package-json-files/get-patterns/get-pnpm-patterns.js +9 -11
  70. package/dist/get-context/get-package-json-files/get-patterns/get-yarn-patterns.js +10 -13
  71. package/dist/get-context/get-package-json-files/get-patterns/index.js +15 -42
  72. package/dist/get-context/get-package-json-files/get-patterns/lib/get-array-of-strings.js +4 -6
  73. package/dist/get-context/get-package-json-files/get-patterns/props.js +9 -33
  74. package/dist/get-context/get-package-json-files/get-patterns/read-json-safe.js +6 -9
  75. package/dist/get-context/get-package-json-files/get-patterns/read-yaml-safe.js +4 -4
  76. package/dist/get-context/get-package-json-files/index.d.ts +3 -1
  77. package/dist/get-context/get-package-json-files/index.js +8 -8
  78. package/dist/get-context/get-package-json-files/package-json-file/index.js +32 -55
  79. package/dist/get-context/get-package-json-files/package-json-file/instance.d.ts +2 -1
  80. package/dist/get-context/get-package-json-files/package-json-file/instance.js +15 -15
  81. package/dist/get-context/index.d.ts +3 -2
  82. package/dist/get-context/index.js +28 -24
  83. package/dist/lib/disk.js +28 -29
  84. package/dist/lib/error.js +13 -31
  85. package/dist/lib/exit-if-invalid.js +1 -1
  86. package/dist/lib/is-semver.d.ts +1 -1
  87. package/dist/lib/is-semver.js +15 -7
  88. package/dist/lib/log.js +38 -58
  89. package/dist/lib/newlines.js +11 -11
  90. package/dist/lib/print-strings.js +2 -2
  91. package/dist/lib/set-semver-range.js +8 -8
  92. package/dist/lib/show-help-on-error.js +31 -8
  93. package/dist/lib/sort-by-name.js +1 -1
  94. package/dist/lib/write-if-changed.js +3 -3
  95. package/dist/option.js +8 -13
  96. package/dist/types.d.ts +3 -1
  97. package/dist/types.js +1 -1
  98. package/package.json +20 -16
  99. package/dist/get-context/get-all-instances.d.ts +0 -3
  100. package/dist/get-context/get-all-instances.js +0 -8
@@ -1,9 +1,9 @@
1
1
  "use strict";
2
- exports.__esModule = true;
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.fixMismatchesCli = void 0;
4
- var get_context_1 = require("../get-context");
5
- var write_if_changed_1 = require("../lib/write-if-changed");
6
- var fix_mismatches_1 = require("./fix-mismatches");
4
+ const get_context_1 = require("../get-context");
5
+ const write_if_changed_1 = require("../lib/write-if-changed");
6
+ const fix_mismatches_1 = require("./fix-mismatches");
7
7
  function fixMismatchesCli(input, disk) {
8
8
  (0, write_if_changed_1.writeIfChanged)((0, fix_mismatches_1.fixMismatches)((0, get_context_1.getContext)(input, disk)));
9
9
  }
@@ -1,30 +1,32 @@
1
1
  "use strict";
2
- exports.__esModule = true;
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.fixMismatches = void 0;
4
- var expect_more_1 = require("expect-more");
4
+ const ts_belt_1 = require("@mobily/ts-belt");
5
+ const is_object_1 = require("expect-more/dist/is-object");
6
+ const is_undefined_1 = require("expect-more/dist/is-undefined");
7
+ const _R_1 = require("../get-context/$R");
5
8
  function fixMismatches(ctx) {
6
- ctx.versionGroups.forEach(function (versionGroup) {
7
- var invalidGroups = versionGroup.getInvalidInstanceGroups();
9
+ ctx.versionGroups.forEach((versionGroup) => {
10
+ const invalidGroups = versionGroup.getInvalidInstanceGroups();
8
11
  // Nothing to do if there are no mismatches
9
12
  if (invalidGroups.length === 0)
10
13
  return;
11
14
  // Set the correct version on each instance.
12
- invalidGroups.forEach(function (instanceGroup) {
15
+ invalidGroups.forEach((instanceGroup) => {
13
16
  if (!instanceGroup.hasUnsupportedVersion()) {
14
- var nextVersion_1 = instanceGroup.getExpectedVersion();
15
- instanceGroup.instances.forEach(function (instance) {
16
- return instance.setVersion(nextVersion_1);
17
- });
17
+ (0, ts_belt_1.pipe)(instanceGroup.getExpectedVersion(), ts_belt_1.R.tap((nextVersion) => {
18
+ instanceGroup.instances.forEach((instance) => instance.setVersion(nextVersion));
19
+ }), _R_1.$R.tapErrVerbose);
18
20
  }
19
21
  });
20
22
  });
21
23
  /** Remove eg `{"dependencies": {}, "devDependencies": {}}` */
22
- ctx.packageJsonFiles.forEach(function (packageJsonFile) {
23
- var contents = packageJsonFile.contents;
24
- Object.keys(contents).forEach(function (key) {
25
- var value = contents[key];
26
- if ((0, expect_more_1.isObject)(value) &&
27
- Object.values(value).every(expect_more_1.isUndefined)) {
24
+ ctx.packageJsonFiles.forEach((packageJsonFile) => {
25
+ const contents = packageJsonFile.contents;
26
+ Object.keys(contents).forEach((key) => {
27
+ const value = contents[key];
28
+ if ((0, is_object_1.isObject)(value) &&
29
+ Object.values(value).every(is_undefined_1.isUndefined)) {
28
30
  delete contents[key];
29
31
  }
30
32
  });
@@ -1,61 +1,63 @@
1
1
  #!/usr/bin/env node
2
2
  "use strict";
3
- var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
4
- if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
5
- return cooked;
6
- };
7
- var __read = (this && this.__read) || function (o, n) {
8
- var m = typeof Symbol === "function" && o[Symbol.iterator];
9
- if (!m) return o;
10
- var i = m.call(o), r, ar = [], e;
11
- try {
12
- while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
13
- }
14
- catch (error) { e = { error: error }; }
15
- finally {
16
- try {
17
- if (r && !r.done && (m = i["return"])) m.call(i);
18
- }
19
- finally { if (e) throw e.error; }
20
- }
21
- return ar;
22
- };
23
- var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
24
- if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
25
- if (ar || !(i in from)) {
26
- if (!ar) ar = Array.prototype.slice.call(from, 0, i);
27
- ar[i] = from[i];
28
- }
29
- }
30
- return to.concat(ar || Array.prototype.slice.call(from));
31
- };
32
3
  var __importDefault = (this && this.__importDefault) || function (mod) {
33
4
  return (mod && mod.__esModule) ? mod : { "default": mod };
34
5
  };
35
- var _a, _b, _c, _d;
36
- exports.__esModule = true;
37
- var chalk_1 = __importDefault(require("chalk"));
38
- var commander_1 = require("commander");
39
- var disk_1 = require("../lib/disk");
40
- var show_help_on_error_1 = require("../lib/show-help-on-error");
41
- var option_1 = require("../option");
42
- var fix_mismatches_cli_1 = require("./fix-mismatches-cli");
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
- commander_1.program.on('--help', function () {
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 --types dev\n {dim # only inspect \"devDependencies\" and \"peerDependencies\"}\n syncpack fix-mismatches --types 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 --types dev\n {dim # only inspect \"devDependencies\" and \"peerDependencies\"}\n syncpack fix-mismatches --types 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"]))));
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ const chalk_1 = __importDefault(require("chalk"));
8
+ const commander_1 = require("commander");
9
+ const disk_1 = require("../lib/disk");
10
+ const show_help_on_error_1 = require("../lib/show-help-on-error");
11
+ const option_1 = require("../option");
12
+ const fix_mismatches_cli_1 = require("./fix-mismatches-cli");
13
+ commander_1.program.description((0, chalk_1.default) `
14
+ Ensure that multiple packages requiring the same dependency define the same
15
+ version, so that every package requires eg. {yellow react@16.4.2}, instead of a
16
+ combination of {yellow react@16.4.2}, {yellow react@0.15.9}, and {yellow react@16.0.0}.`.replace(/^\n/, ''));
17
+ commander_1.program.on('--help', () => {
18
+ console.log((0, chalk_1.default) `
19
+ Resolving Packages:
20
+ 1. If {yellow --source} globs are provided, use those.
21
+ 2. If using Pnpm Workspaces, read {yellow packages} from {yellow pnpm-workspace.yaml} in the root of the project.
22
+ 3. If using Yarn Workspaces, read {yellow workspaces} from {yellow package.json}.
23
+ 4. If using Lerna, read {yellow packages} from {yellow lerna.json}.
24
+ 5. Default to {yellow "package.json"} and {yellow "packages/*/package.json"}.
25
+
26
+ Examples:
27
+ {dim # uses defaults for resolving packages}
28
+ syncpack fix-mismatches
29
+ {dim # uses packages defined by --source when provided}
30
+ syncpack fix-mismatches --source {yellow "apps/*/package.json"}
31
+ {dim # multiple globs can be provided like this}
32
+ syncpack fix-mismatches --source {yellow "apps/*/package.json"} --source {yellow "core/*/package.json"}
33
+ {dim # uses dependencies regular expression defined by --filter when provided}
34
+ syncpack fix-mismatches --filter {yellow "typescript|tslint"}
35
+ {dim # only inspect "devDependencies"}
36
+ syncpack fix-mismatches --types dev
37
+ {dim # only inspect "devDependencies" and "peerDependencies"}
38
+ syncpack fix-mismatches --types dev,peer
39
+ {dim # indent package.json with 4 spaces instead of 2}
40
+ syncpack fix-mismatches --indent {yellow " "}
41
+
42
+ Reference:
43
+ globs {blue.underline https://github.com/isaacs/node-glob#glob-primer}
44
+ lerna.json {blue.underline https://github.com/lerna/lerna#lernajson}
45
+ Yarn Workspaces {blue.underline https://yarnpkg.com/lang/en/docs/workspaces}
46
+ Pnpm Workspaces {blue.underline https://pnpm.js.org/en/workspaces}
47
+ `);
46
48
  });
47
49
  (0, show_help_on_error_1.showHelpOnError)(commander_1.program);
48
- (_a = (_b = (_c = (_d = commander_1.program
49
- .option.apply(commander_1.program, __spreadArray([], __read(option_1.option.source), false)))
50
- .option.apply(_d, __spreadArray([], __read(option_1.option.filter), false)))
51
- .option.apply(_c, __spreadArray([], __read(option_1.option.types), false)))
52
- .option.apply(_b, __spreadArray([], __read(option_1.option.config), false)))
53
- .option.apply(_a, __spreadArray([], __read(option_1.option.indent), false)).parse(process.argv);
50
+ commander_1.program
51
+ .option(...option_1.option.source)
52
+ .option(...option_1.option.filter)
53
+ .option(...option_1.option.types)
54
+ .option(...option_1.option.config)
55
+ .option(...option_1.option.indent)
56
+ .parse(process.argv);
54
57
  (0, fix_mismatches_cli_1.fixMismatchesCli)({
55
58
  configPath: commander_1.program.opts().config,
56
59
  filter: commander_1.program.opts().filter,
57
60
  indent: commander_1.program.opts().indent,
58
61
  source: commander_1.program.opts().source,
59
- types: commander_1.program.opts().types
62
+ types: commander_1.program.opts().types,
60
63
  }, disk_1.disk);
61
- var templateObject_1, templateObject_2;
@@ -1,9 +1,9 @@
1
1
  "use strict";
2
- exports.__esModule = true;
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.formatCli = void 0;
4
- var get_context_1 = require("../get-context");
5
- var write_if_changed_1 = require("../lib/write-if-changed");
6
- var format_1 = require("./format");
4
+ const get_context_1 = require("../get-context");
5
+ const write_if_changed_1 = require("../lib/write-if-changed");
6
+ const format_1 = require("./format");
7
7
  function formatCli(input, disk) {
8
8
  (0, write_if_changed_1.writeIfChanged)((0, format_1.format)((0, get_context_1.getContext)(input, disk)));
9
9
  }
@@ -1,42 +1,44 @@
1
1
  "use strict";
2
- exports.__esModule = true;
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.format = void 0;
4
- var expect_more_1 = require("expect-more");
4
+ const is_array_1 = require("expect-more/dist/is-array");
5
+ const is_non_empty_string_1 = require("expect-more/dist/is-non-empty-string");
6
+ const is_object_1 = require("expect-more/dist/is-object");
5
7
  function format(ctx) {
6
- var sortAz = ctx.sortAz, sortFirst = ctx.sortFirst, packageJsonFiles = ctx.packageJsonFiles;
7
- packageJsonFiles.forEach(function (packageJsonFile) {
8
- var _a, _b, _c;
9
- var contents = packageJsonFile.contents;
10
- var sortedKeys = Object.keys(contents).sort();
11
- var keys = new Set(sortFirst.concat(sortedKeys));
12
- var optionalChaining = contents;
13
- var bugsUrl = (_a = optionalChaining === null || optionalChaining === void 0 ? void 0 : optionalChaining.bugs) === null || _a === void 0 ? void 0 : _a.url;
14
- var repoUrl = (_b = optionalChaining === null || optionalChaining === void 0 ? void 0 : optionalChaining.repository) === null || _b === void 0 ? void 0 : _b.url;
15
- var repoDir = (_c = optionalChaining === null || optionalChaining === void 0 ? void 0 : optionalChaining.repository) === null || _c === void 0 ? void 0 : _c.directory;
8
+ const { packageJsonFiles } = ctx;
9
+ const { sortAz, sortFirst } = ctx.config;
10
+ packageJsonFiles.forEach((packageJsonFile) => {
11
+ const { contents } = packageJsonFile;
12
+ const sortedKeys = Object.keys(contents).sort();
13
+ const keys = new Set(sortFirst.concat(sortedKeys));
14
+ const optionalChaining = contents;
15
+ const bugsUrl = optionalChaining?.bugs?.url;
16
+ const repoUrl = optionalChaining?.repository?.url;
17
+ const repoDir = optionalChaining?.repository?.directory;
16
18
  if (bugsUrl) {
17
19
  contents.bugs = bugsUrl;
18
20
  }
19
- if ((0, expect_more_1.isNonEmptyString)(repoUrl) && !(0, expect_more_1.isNonEmptyString)(repoDir)) {
21
+ if ((0, is_non_empty_string_1.isNonEmptyString)(repoUrl) && !(0, is_non_empty_string_1.isNonEmptyString)(repoDir)) {
20
22
  contents.repository = repoUrl.includes('github.com')
21
23
  ? repoUrl.replace(/^.+github\.com\//, '')
22
24
  : repoUrl;
23
25
  }
24
- sortAz.forEach(function (key) { return sortAlphabetically(contents[key]); });
26
+ sortAz.forEach((key) => sortAlphabetically(contents[key]));
25
27
  sortObject(keys, contents);
26
28
  });
27
29
  return ctx;
28
30
  function sortObject(sortedKeys, obj) {
29
- sortedKeys.forEach(function (key) {
30
- var value = obj[key];
31
+ sortedKeys.forEach((key) => {
32
+ const value = obj[key];
31
33
  delete obj[key];
32
34
  obj[key] = value;
33
35
  });
34
36
  }
35
37
  function sortAlphabetically(value) {
36
- if ((0, expect_more_1.isArray)(value)) {
38
+ if ((0, is_array_1.isArray)(value)) {
37
39
  value.sort();
38
40
  }
39
- else if ((0, expect_more_1.isObject)(value)) {
41
+ else if ((0, is_object_1.isObject)(value)) {
40
42
  sortObject(Object.keys(value).sort(), value);
41
43
  }
42
44
  }
@@ -1,57 +1,54 @@
1
1
  #!/usr/bin/env node
2
2
  "use strict";
3
- var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
4
- if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
5
- return cooked;
6
- };
7
- var __read = (this && this.__read) || function (o, n) {
8
- var m = typeof Symbol === "function" && o[Symbol.iterator];
9
- if (!m) return o;
10
- var i = m.call(o), r, ar = [], e;
11
- try {
12
- while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
13
- }
14
- catch (error) { e = { error: error }; }
15
- finally {
16
- try {
17
- if (r && !r.done && (m = i["return"])) m.call(i);
18
- }
19
- finally { if (e) throw e.error; }
20
- }
21
- return ar;
22
- };
23
- var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
24
- if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
25
- if (ar || !(i in from)) {
26
- if (!ar) ar = Array.prototype.slice.call(from, 0, i);
27
- ar[i] = from[i];
28
- }
29
- }
30
- return to.concat(ar || Array.prototype.slice.call(from));
31
- };
32
3
  var __importDefault = (this && this.__importDefault) || function (mod) {
33
4
  return (mod && mod.__esModule) ? mod : { "default": mod };
34
5
  };
35
- var _a, _b;
36
- exports.__esModule = true;
37
- var chalk_1 = __importDefault(require("chalk"));
38
- var commander_1 = require("commander");
39
- var disk_1 = require("../lib/disk");
40
- var show_help_on_error_1 = require("../lib/show-help-on-error");
41
- var option_1 = require("../option");
42
- var format_cli_1 = require("./format-cli");
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
- commander_1.program.on('--help', function () {
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"]))));
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ const chalk_1 = __importDefault(require("chalk"));
8
+ const commander_1 = require("commander");
9
+ const disk_1 = require("../lib/disk");
10
+ const show_help_on_error_1 = require("../lib/show-help-on-error");
11
+ const option_1 = require("../option");
12
+ const format_cli_1 = require("./format-cli");
13
+ commander_1.program.description((0, chalk_1.default) `
14
+ Organise package.json files according to a conventional format, where fields
15
+ appear in a predictable order and nested fields are ordered alphabetically.
16
+ Shorthand properties are used where available, such as the {yellow repository} and
17
+ {yellow bugs} fields.`.replace(/^\n/, ''));
18
+ commander_1.program.on('--help', () => {
19
+ console.log((0, chalk_1.default) `
20
+ Examples:
21
+ {dim # uses defaults for resolving packages}
22
+ syncpack format
23
+ {dim # uses packages defined by --source when provided}
24
+ syncpack format --source {yellow "apps/*/package.json"}
25
+ {dim # multiple globs can be provided like this}
26
+ syncpack format --source {yellow "apps/*/package.json"} --source {yellow "core/*/package.json"}
27
+ {dim # indent package.json with 4 spaces instead of 2}
28
+ syncpack format --indent {yellow " "}
29
+
30
+ Resolving Packages:
31
+ 1. If {yellow --source} globs are provided, use those.
32
+ 2. If using Pnpm Workspaces, read {yellow packages} from {yellow pnpm-workspace.yaml} in the root of the project.
33
+ 3. If using Yarn Workspaces, read {yellow workspaces} from {yellow package.json}.
34
+ 4. If using Lerna, read {yellow packages} from {yellow lerna.json}.
35
+ 5. Default to {yellow "package.json"} and {yellow "packages/*/package.json"}.
36
+
37
+ Reference:
38
+ globs {blue.underline https://github.com/isaacs/node-glob#glob-primer}
39
+ lerna.json {blue.underline https://github.com/lerna/lerna#lernajson}
40
+ Yarn Workspaces {blue.underline https://yarnpkg.com/lang/en/docs/workspaces}
41
+ Pnpm Workspaces {blue.underline https://pnpm.js.org/en/workspaces}
42
+ `);
46
43
  });
47
44
  (0, show_help_on_error_1.showHelpOnError)(commander_1.program);
48
- (_a = (_b = commander_1.program
49
- .option.apply(commander_1.program, __spreadArray([], __read(option_1.option.source), false)))
50
- .option.apply(_b, __spreadArray([], __read(option_1.option.config), false)))
51
- .option.apply(_a, __spreadArray([], __read(option_1.option.indent), false)).parse(process.argv);
45
+ commander_1.program
46
+ .option(...option_1.option.source)
47
+ .option(...option_1.option.config)
48
+ .option(...option_1.option.indent)
49
+ .parse(process.argv);
52
50
  (0, format_cli_1.formatCli)({
53
51
  configPath: commander_1.program.opts().config,
54
52
  indent: commander_1.program.opts().indent,
55
- source: commander_1.program.opts().source
53
+ source: commander_1.program.opts().source,
56
54
  }, disk_1.disk);
57
- var templateObject_1, templateObject_2;
@@ -1,61 +1,72 @@
1
1
  #!/usr/bin/env node
2
2
  "use strict";
3
- var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
4
- if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
5
- return cooked;
6
- };
7
- var __read = (this && this.__read) || function (o, n) {
8
- var m = typeof Symbol === "function" && o[Symbol.iterator];
9
- if (!m) return o;
10
- var i = m.call(o), r, ar = [], e;
11
- try {
12
- while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
13
- }
14
- catch (error) { e = { error: error }; }
15
- finally {
16
- try {
17
- if (r && !r.done && (m = i["return"])) m.call(i);
18
- }
19
- finally { if (e) throw e.error; }
20
- }
21
- return ar;
22
- };
23
- var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
24
- if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
25
- if (ar || !(i in from)) {
26
- if (!ar) ar = Array.prototype.slice.call(from, 0, i);
27
- ar[i] = from[i];
28
- }
29
- }
30
- return to.concat(ar || Array.prototype.slice.call(from));
31
- };
32
3
  var __importDefault = (this && this.__importDefault) || function (mod) {
33
4
  return (mod && mod.__esModule) ? mod : { "default": mod };
34
5
  };
35
- var _a, _b, _c, _d;
36
- exports.__esModule = true;
37
- var chalk_1 = __importDefault(require("chalk"));
38
- var commander_1 = require("commander");
39
- var disk_1 = require("../lib/disk");
40
- var show_help_on_error_1 = require("../lib/show-help-on-error");
41
- var option_1 = require("../option");
42
- var lint_semver_ranges_cli_1 = require("./lint-semver-ranges-cli");
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
- commander_1.program.on('--help', function () {
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 --types dev --semver-range ~\n {dim # use ~ range in \"devDependencies\" and \"peerDependencies\"}\n syncpack lint-semver-ranges --types 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 --types dev --semver-range ~\n {dim # use ~ range in \"devDependencies\" and \"peerDependencies\"}\n syncpack lint-semver-ranges --types 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"]))));
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ const chalk_1 = __importDefault(require("chalk"));
8
+ const commander_1 = require("commander");
9
+ const disk_1 = require("../lib/disk");
10
+ const show_help_on_error_1 = require("../lib/show-help-on-error");
11
+ const option_1 = require("../option");
12
+ const lint_semver_ranges_cli_1 = require("./lint-semver-ranges-cli");
13
+ commander_1.program.description((0, chalk_1.default) `
14
+ Check dependency versions within {yellow dependencies}, {yellow devDependencies},
15
+ {yellow peerDependencies}, {yellow overrides}, and {yellow resolutions} follow a consistent format.`.replace(/^\n/, ''));
16
+ commander_1.program.on('--help', () => {
17
+ console.log((0, chalk_1.default) `
18
+ Examples:
19
+ {dim # uses defaults for resolving packages}
20
+ syncpack lint-semver-ranges
21
+ {dim # uses packages defined by --source when provided}
22
+ syncpack lint-semver-ranges --source {yellow "apps/*/package.json"}
23
+ {dim # multiple globs can be provided like this}
24
+ syncpack lint-semver-ranges --source {yellow "apps/*/package.json"} --source {yellow "core/*/package.json"}
25
+ {dim # uses dependencies regular expression defined by --filter when provided}
26
+ syncpack lint-semver-ranges --filter {yellow "typescript|tslint"}
27
+ {dim # use ~ range instead of default ""}
28
+ syncpack lint-semver-ranges --semver-range ~
29
+ {dim # use ~ range in "devDependencies"}
30
+ syncpack lint-semver-ranges --types dev --semver-range ~
31
+ {dim # use ~ range in "devDependencies" and "peerDependencies"}
32
+ syncpack lint-semver-ranges --types dev,peer semver-range ~
33
+
34
+ Supported Ranges:
35
+ < {dim <1.4.2}
36
+ <= {dim <=1.4.2}
37
+ "" {dim 1.4.2}
38
+ ~ {dim ~1.4.2}
39
+ ^ {dim ^1.4.2}
40
+ >= {dim >=1.4.2}
41
+ > {dim >1.4.2}
42
+ * {dim *}
43
+
44
+ Resolving Packages:
45
+ 1. If {yellow --source} globs are provided, use those.
46
+ 2. If using Pnpm Workspaces, read {yellow packages} from {yellow pnpm-workspace.yaml} in the root of the project.
47
+ 3. If using Yarn Workspaces, read {yellow workspaces} from {yellow package.json}.
48
+ 4. If using Lerna, read {yellow packages} from {yellow lerna.json}.
49
+ 5. Default to {yellow "package.json"} and {yellow "packages/*/package.json"}.
50
+
51
+ Reference:
52
+ globs {blue.underline https://github.com/isaacs/node-glob#glob-primer}
53
+ lerna.json {blue.underline https://github.com/lerna/lerna#lernajson}
54
+ Yarn Workspaces {blue.underline https://yarnpkg.com/lang/en/docs/workspaces}
55
+ Pnpm Workspaces {blue.underline https://pnpm.js.org/en/workspaces}
56
+ `);
46
57
  });
47
58
  (0, show_help_on_error_1.showHelpOnError)(commander_1.program);
48
- (_a = (_b = (_c = (_d = commander_1.program
49
- .option.apply(commander_1.program, __spreadArray([], __read(option_1.option.source), false)))
50
- .option.apply(_d, __spreadArray([], __read(option_1.option.filter), false)))
51
- .option.apply(_c, __spreadArray([], __read(option_1.option.semverRange), false)))
52
- .option.apply(_b, __spreadArray([], __read(option_1.option.config), false)))
53
- .option.apply(_a, __spreadArray([], __read(option_1.option.types), false)).parse(process.argv);
59
+ commander_1.program
60
+ .option(...option_1.option.source)
61
+ .option(...option_1.option.filter)
62
+ .option(...option_1.option.semverRange)
63
+ .option(...option_1.option.config)
64
+ .option(...option_1.option.types)
65
+ .parse(process.argv);
54
66
  (0, lint_semver_ranges_cli_1.lintSemverRangesCli)({
55
67
  configPath: commander_1.program.opts().config,
56
68
  filter: commander_1.program.opts().filter,
57
69
  semverRange: commander_1.program.opts().semverRange,
58
70
  source: commander_1.program.opts().source,
59
- types: commander_1.program.opts().types
71
+ types: commander_1.program.opts().types,
60
72
  }, disk_1.disk);
61
- var templateObject_1, templateObject_2;
@@ -1,9 +1,9 @@
1
1
  "use strict";
2
- exports.__esModule = true;
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.lintSemverRangesCli = void 0;
4
- var get_context_1 = require("../get-context");
5
- var exit_if_invalid_1 = require("../lib/exit-if-invalid");
6
- var lint_semver_ranges_1 = require("./lint-semver-ranges");
4
+ const get_context_1 = require("../get-context");
5
+ const exit_if_invalid_1 = require("../lib/exit-if-invalid");
6
+ const lint_semver_ranges_1 = require("./lint-semver-ranges");
7
7
  function lintSemverRangesCli(input, disk) {
8
8
  (0, exit_if_invalid_1.exitIfInvalid)((0, lint_semver_ranges_1.lintSemverRanges)((0, get_context_1.getContext)(input, disk)));
9
9
  }
@@ -1,8 +1,4 @@
1
1
  "use strict";
2
- var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
3
- if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
4
- return cooked;
5
- };
6
2
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
7
3
  if (k2 === undefined) k2 = k;
8
4
  var desc = Object.getOwnPropertyDescriptor(m, k);
@@ -26,33 +22,17 @@ var __importStar = (this && this.__importStar) || function (mod) {
26
22
  __setModuleDefault(result, mod);
27
23
  return result;
28
24
  };
29
- var __read = (this && this.__read) || function (o, n) {
30
- var m = typeof Symbol === "function" && o[Symbol.iterator];
31
- if (!m) return o;
32
- var i = m.call(o), r, ar = [], e;
33
- try {
34
- while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
35
- }
36
- catch (error) { e = { error: error }; }
37
- finally {
38
- try {
39
- if (r && !r.done && (m = i["return"])) m.call(i);
40
- }
41
- finally { if (e) throw e.error; }
42
- }
43
- return ar;
44
- };
45
25
  var __importDefault = (this && this.__importDefault) || function (mod) {
46
26
  return (mod && mod.__esModule) ? mod : { "default": mod };
47
27
  };
48
- exports.__esModule = true;
28
+ Object.defineProperty(exports, "__esModule", { value: true });
49
29
  exports.lintSemverRanges = void 0;
50
- var chalk_1 = __importDefault(require("chalk"));
51
- var constants_1 = require("../constants");
52
- var log = __importStar(require("../lib/log"));
30
+ const chalk_1 = __importDefault(require("chalk"));
31
+ const constants_1 = require("../constants");
32
+ const log = __importStar(require("../lib/log"));
53
33
  function lintSemverRanges(ctx) {
54
- var hasUserGroups = ctx.semverGroups.length > 1;
55
- ctx.semverGroups.forEach(function (semverGroup, i) {
34
+ const hasUserGroups = ctx.semverGroups.length > 1;
35
+ ctx.semverGroups.forEach((semverGroup, i) => {
56
36
  // Nothing to do if there are no mismatches
57
37
  if (!semverGroup.hasMismatches())
58
38
  return;
@@ -62,12 +42,11 @@ function lintSemverRanges(ctx) {
62
42
  // Annotate each group
63
43
  hasUserGroups && log.semverGroupHeader(semverGroup, i);
64
44
  // Log each group which has mismatches
65
- semverGroup.getMismatches().forEach(function (_a) {
66
- var _b = __read(_a, 2), name = _b[0], mismatches = _b[1];
45
+ semverGroup.getMismatches().forEach(([name, mismatches]) => {
67
46
  // Log the dependency name
68
47
  log.invalid(name);
69
48
  // Log each of the dependencies mismatches
70
- mismatches.forEach(function (instance) {
49
+ mismatches.forEach((instance) => {
71
50
  logSemverRangeMismatch(instance, semverGroup);
72
51
  });
73
52
  });
@@ -76,10 +55,9 @@ function lintSemverRanges(ctx) {
76
55
  }
77
56
  exports.lintSemverRanges = lintSemverRanges;
78
57
  function logSemverRangeMismatch(instance, semverGroup) {
79
- var path = instance.pathDef.path;
80
- var shortPath = instance.packageJsonFile.shortPath;
81
- var actual = instance.version;
82
- var expected = semverGroup.getExpectedVersion(instance);
83
- console.log((0, chalk_1["default"])(templateObject_1 || (templateObject_1 = __makeTemplateObject([" {red ", "} ", " {green ", "} {dim in ", " of ", "}"], [" {red ", "} ", " {green ", "} {dim in ", " of ", "}"])), actual, constants_1.ICON.rightArrow, expected, path, shortPath));
58
+ const path = instance.pathDef.path;
59
+ const shortPath = instance.packageJsonFile.shortPath;
60
+ const actual = instance.version;
61
+ const expected = semverGroup.getExpectedVersion(instance);
62
+ console.log((0, chalk_1.default) ` {red ${actual}} ${constants_1.ICON.rightArrow} {green ${expected}} {dim in ${path} of ${shortPath}}`);
84
63
  }
85
- var templateObject_1;