syncpack 8.5.14 → 9.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.
- package/README.md +194 -108
- package/dist/bin-fix-mismatches/fix-mismatches-cli.d.ts +2 -2
- package/dist/bin-fix-mismatches/fix-mismatches-cli.js +1 -1
- package/dist/bin-fix-mismatches/fix-mismatches.d.ts +2 -2
- package/dist/bin-fix-mismatches/fix-mismatches.js +35 -8
- package/dist/bin-fix-mismatches/index.js +9 -18
- package/dist/bin-format/format-cli.d.ts +2 -2
- package/dist/bin-format/format-cli.js +1 -1
- package/dist/bin-format/format.d.ts +2 -2
- package/dist/bin-format/index.js +2 -0
- package/dist/bin-lint-semver-ranges/index.js +10 -19
- package/dist/bin-lint-semver-ranges/lint-semver-ranges-cli.d.ts +2 -2
- package/dist/bin-lint-semver-ranges/lint-semver-ranges-cli.js +1 -1
- package/dist/bin-lint-semver-ranges/lint-semver-ranges.d.ts +2 -2
- package/dist/bin-lint-semver-ranges/lint-semver-ranges.js +13 -14
- package/dist/bin-list/index.js +9 -18
- package/dist/bin-list/list-cli.d.ts +2 -2
- package/dist/bin-list/list-cli.js +1 -1
- package/dist/bin-list/list.d.ts +2 -2
- package/dist/bin-list/list.js +2 -2
- package/dist/bin-list-mismatches/index.js +9 -18
- package/dist/bin-list-mismatches/list-mismatches-cli.d.ts +2 -2
- package/dist/bin-list-mismatches/list-mismatches-cli.js +1 -1
- package/dist/bin-list-mismatches/list-mismatches.d.ts +2 -2
- package/dist/bin-list-mismatches/list-mismatches.js +6 -6
- package/dist/bin-set-semver-ranges/index.js +10 -19
- package/dist/bin-set-semver-ranges/set-semver-ranges-cli.d.ts +2 -2
- package/dist/bin-set-semver-ranges/set-semver-ranges-cli.js +1 -1
- package/dist/bin-set-semver-ranges/set-semver-ranges.d.ts +2 -2
- package/dist/constants.d.ts +11 -7
- package/dist/constants.js +11 -22
- package/dist/get-context/$R.d.ts +13 -0
- package/dist/get-context/$R.js +56 -0
- package/dist/{lib/get-context → get-context}/get-all-instances.d.ts +0 -0
- package/dist/{lib/get-context → get-context}/get-all-instances.js +1 -1
- package/dist/get-context/get-config/get-core-types.d.ts +36 -0
- package/dist/get-context/get-config/get-core-types.js +68 -0
- package/dist/get-context/get-config/get-custom-types.d.ts +4 -0
- package/dist/get-context/get-config/get-custom-types.js +28 -0
- package/dist/get-context/get-config/get-enabled-types.d.ts +4 -0
- package/dist/get-context/get-config/get-enabled-types.js +19 -0
- package/dist/get-context/get-config/index.d.ts +7 -0
- package/dist/get-context/get-config/index.js +115 -0
- package/dist/get-context/get-config/path-strategy/index.d.ts +8 -0
- package/dist/get-context/get-config/path-strategy/index.js +18 -0
- package/dist/get-context/get-config/path-strategy/lib/get-non-empty-string-prop.d.ts +4 -0
- package/dist/get-context/get-config/path-strategy/lib/get-non-empty-string-prop.js +11 -0
- package/dist/get-context/get-config/path-strategy/name-and-version-props.d.ts +2 -0
- package/dist/get-context/get-config/path-strategy/name-and-version-props.js +66 -0
- package/dist/get-context/get-config/path-strategy/name-and-version-string.d.ts +2 -0
- package/dist/get-context/get-config/path-strategy/name-and-version-string.js +60 -0
- package/dist/get-context/get-config/path-strategy/types.d.ts +15 -0
- package/dist/{lib/get-context/get-config/config.js → get-context/get-config/path-strategy/types.js} +0 -0
- package/dist/get-context/get-config/path-strategy/version-string.d.ts +2 -0
- package/dist/get-context/get-config/path-strategy/version-string.js +60 -0
- package/dist/get-context/get-config/path-strategy/versions-by-name.d.ts +2 -0
- package/dist/get-context/get-config/path-strategy/versions-by-name.js +39 -0
- package/dist/get-context/get-config/schema/base-group.d.ts +6 -0
- package/dist/get-context/get-config/schema/base-group.js +9 -0
- package/dist/get-context/get-config/schema/index.d.ts +1276 -0
- package/dist/get-context/get-config/schema/index.js +104 -0
- package/dist/get-context/get-config/schema/paths.d.ts +89 -0
- package/dist/get-context/get-config/schema/paths.js +33 -0
- package/dist/get-context/get-config/schema/semver-group.d.ts +101 -0
- package/dist/get-context/get-config/schema/semver-group.js +50 -0
- package/dist/get-context/get-config/schema/semver-range.d.ts +2 -0
- package/dist/get-context/get-config/schema/semver-range.js +16 -0
- package/dist/get-context/get-config/schema/version-group.d.ts +151 -0
- package/dist/get-context/get-config/schema/version-group.js +31 -0
- package/dist/get-context/get-groups/get-semver-groups.d.ts +4 -0
- package/dist/{lib/get-context → get-context}/get-groups/get-semver-groups.js +2 -1
- package/dist/get-context/get-groups/get-version-groups.d.ts +4 -0
- package/dist/{lib/get-context → get-context}/get-groups/get-version-groups.js +2 -1
- package/dist/{lib/get-context → get-context}/get-groups/semver-group/index.d.ts +10 -11
- package/dist/get-context/get-groups/semver-group/index.js +56 -0
- package/dist/{lib/get-context → get-context}/get-groups/version-group/index.d.ts +5 -6
- package/dist/{lib/get-context → get-context}/get-groups/version-group/index.js +0 -0
- package/dist/{lib/get-context → get-context}/get-groups/version-group/instance-group/get-highest-version.d.ts +0 -0
- package/dist/{lib/get-context → get-context}/get-groups/version-group/instance-group/get-highest-version.js +2 -2
- package/dist/{lib/get-context → get-context}/get-groups/version-group/instance-group/index.d.ts +3 -1
- package/dist/{lib/get-context → get-context}/get-groups/version-group/instance-group/index.js +10 -9
- package/dist/get-context/get-package-json-files/get-file-paths.d.ts +14 -0
- package/dist/get-context/get-package-json-files/get-file-paths.js +40 -0
- package/dist/get-context/get-package-json-files/get-patterns/get-lerna-patterns.d.ts +4 -0
- package/dist/get-context/get-package-json-files/get-patterns/get-lerna-patterns.js +19 -0
- package/dist/get-context/get-package-json-files/get-patterns/get-pnpm-patterns.d.ts +4 -0
- package/dist/get-context/get-package-json-files/get-patterns/get-pnpm-patterns.js +23 -0
- package/dist/get-context/get-package-json-files/get-patterns/get-yarn-patterns.d.ts +4 -0
- package/dist/get-context/get-package-json-files/get-patterns/get-yarn-patterns.js +20 -0
- package/dist/get-context/get-package-json-files/get-patterns/index.d.ts +11 -0
- package/dist/get-context/get-package-json-files/get-patterns/index.js +70 -0
- package/dist/get-context/get-package-json-files/get-patterns/lib/get-array-of-strings.d.ts +1 -0
- package/dist/get-context/get-package-json-files/get-patterns/lib/get-array-of-strings.js +10 -0
- package/dist/get-context/get-package-json-files/get-patterns/props.d.ts +6 -0
- package/dist/get-context/get-package-json-files/get-patterns/props.js +48 -0
- package/dist/{lib/get-context → get-context}/get-package-json-files/get-patterns/read-json-safe.d.ts +4 -3
- package/dist/get-context/get-package-json-files/get-patterns/read-json-safe.js +20 -0
- package/dist/get-context/get-package-json-files/get-patterns/read-yaml-safe.d.ts +4 -0
- package/dist/get-context/get-package-json-files/get-patterns/read-yaml-safe.js +11 -0
- package/dist/get-context/get-package-json-files/index.d.ts +5 -0
- package/dist/get-context/get-package-json-files/index.js +16 -0
- package/dist/{lib/get-context → get-context}/get-package-json-files/package-json-file/index.d.ts +7 -6
- package/dist/{lib/get-context → get-context}/get-package-json-files/package-json-file/index.js +28 -38
- package/dist/{lib/get-context → get-context}/get-package-json-files/package-json-file/instance.d.ts +6 -6
- package/dist/get-context/get-package-json-files/package-json-file/instance.js +62 -0
- package/dist/{lib/get-context → get-context}/index.d.ts +4 -5
- package/dist/{lib/get-context → get-context}/index.js +1 -1
- package/dist/lib/disk.d.ts +11 -11
- package/dist/lib/error.d.ts +12 -0
- package/dist/lib/error.js +43 -0
- package/dist/lib/exit-if-invalid.d.ts +2 -2
- package/dist/lib/is-semver.d.ts +2 -2
- package/dist/lib/set-semver-range.d.ts +2 -2
- package/dist/lib/show-help-on-error.d.ts +2 -0
- package/dist/lib/show-help-on-error.js +16 -0
- package/dist/lib/write-if-changed.d.ts +2 -2
- package/dist/option.d.ts +4 -10
- package/dist/option.js +6 -16
- package/dist/types.d.ts +88 -0
- package/dist/{lib/get-context/get-config/internal-config.js → types.js} +0 -0
- package/package.json +4 -3
- package/dist/lib/get-context/get-config/config.d.ts +0 -151
- package/dist/lib/get-context/get-config/index.d.ts +0 -8
- package/dist/lib/get-context/get-config/index.js +0 -160
- package/dist/lib/get-context/get-config/internal-config.d.ts +0 -24
- package/dist/lib/get-context/get-groups/get-semver-groups.d.ts +0 -4
- package/dist/lib/get-context/get-groups/get-version-groups.d.ts +0 -4
- package/dist/lib/get-context/get-groups/semver-group/index.js +0 -33
- package/dist/lib/get-context/get-package-json-files/get-file-paths.d.ts +0 -12
- package/dist/lib/get-context/get-package-json-files/get-file-paths.js +0 -55
- package/dist/lib/get-context/get-package-json-files/get-patterns/get-lerna-patterns.d.ts +0 -3
- package/dist/lib/get-context/get-package-json-files/get-patterns/get-lerna-patterns.js +0 -40
- package/dist/lib/get-context/get-package-json-files/get-patterns/get-pnpm-patterns.d.ts +0 -3
- package/dist/lib/get-context/get-package-json-files/get-patterns/get-pnpm-patterns.js +0 -45
- package/dist/lib/get-context/get-package-json-files/get-patterns/get-yarn-patterns.d.ts +0 -3
- package/dist/lib/get-context/get-package-json-files/get-patterns/get-yarn-patterns.js +0 -46
- package/dist/lib/get-context/get-package-json-files/get-patterns/index.d.ts +0 -10
- package/dist/lib/get-context/get-package-json-files/get-patterns/index.js +0 -79
- package/dist/lib/get-context/get-package-json-files/get-patterns/props.d.ts +0 -7
- package/dist/lib/get-context/get-package-json-files/get-patterns/props.js +0 -43
- package/dist/lib/get-context/get-package-json-files/get-patterns/read-json-safe.js +0 -41
- package/dist/lib/get-context/get-package-json-files/get-patterns/read-yaml-safe.d.ts +0 -3
- package/dist/lib/get-context/get-package-json-files/get-patterns/read-yaml-safe.js +0 -34
- package/dist/lib/get-context/get-package-json-files/index.d.ts +0 -5
- package/dist/lib/get-context/get-package-json-files/index.js +0 -40
- package/dist/lib/get-context/get-package-json-files/package-json-file/instance.js +0 -46
- package/dist/lib/get-context/get-package-json-files/tap.d.ts +0 -15
- package/dist/lib/get-context/get-package-json-files/tap.js +0 -56
- package/dist/lib/get-context/get-package-json-files/try-catch.d.ts +0 -5
- package/dist/lib/get-context/get-package-json-files/try-catch.js +0 -13
|
@@ -32,39 +32,30 @@ 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
|
|
35
|
+
var _a, _b, _c, _d;
|
|
36
36
|
exports.__esModule = true;
|
|
37
37
|
var chalk_1 = __importDefault(require("chalk"));
|
|
38
38
|
var commander_1 = require("commander");
|
|
39
39
|
var disk_1 = require("../lib/disk");
|
|
40
|
+
var show_help_on_error_1 = require("../lib/show-help-on-error");
|
|
40
41
|
var option_1 = require("../option");
|
|
41
42
|
var fix_mismatches_cli_1 = require("./fix-mismatches-cli");
|
|
42
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/, ''));
|
|
43
44
|
commander_1.program.on('--help', function () {
|
|
44
|
-
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
|
|
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"]))));
|
|
45
46
|
});
|
|
46
|
-
(
|
|
47
|
+
(0, show_help_on_error_1.showHelpOnError)(commander_1.program);
|
|
48
|
+
(_a = (_b = (_c = (_d = commander_1.program
|
|
47
49
|
.option.apply(commander_1.program, __spreadArray([], __read(option_1.option.source), false)))
|
|
48
|
-
.option.apply(
|
|
49
|
-
.option.apply(
|
|
50
|
-
.option.apply(
|
|
51
|
-
.option.apply(_f, __spreadArray([], __read(option_1.option.dev), false)))
|
|
52
|
-
.option.apply(_e, __spreadArray([], __read(option_1.option.peer), false)))
|
|
53
|
-
.option.apply(_d, __spreadArray([], __read(option_1.option.resolutions), false)))
|
|
54
|
-
.option.apply(_c, __spreadArray([], __read(option_1.option.overrides), false)))
|
|
55
|
-
.option.apply(_b, __spreadArray([], __read(option_1.option.workspace), 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)))
|
|
56
53
|
.option.apply(_a, __spreadArray([], __read(option_1.option.indent), false)).parse(process.argv);
|
|
57
54
|
(0, fix_mismatches_cli_1.fixMismatchesCli)({
|
|
58
55
|
configPath: commander_1.program.opts().config,
|
|
59
|
-
dev: commander_1.program.opts().dev,
|
|
60
56
|
filter: commander_1.program.opts().filter,
|
|
61
57
|
indent: commander_1.program.opts().indent,
|
|
62
|
-
overrides: commander_1.program.opts().overrides,
|
|
63
|
-
peer: commander_1.program.opts().peer,
|
|
64
|
-
pnpmOverrides: commander_1.program.opts().pnpmOverrides,
|
|
65
|
-
prod: commander_1.program.opts().prod,
|
|
66
|
-
resolutions: commander_1.program.opts().resolutions,
|
|
67
58
|
source: commander_1.program.opts().source,
|
|
68
|
-
|
|
59
|
+
types: commander_1.program.opts().types
|
|
69
60
|
}, disk_1.disk);
|
|
70
61
|
var templateObject_1, templateObject_2;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { Disk } from '../lib/disk';
|
|
2
|
-
import type {
|
|
3
|
-
export declare function formatCli(input: Partial<Config.
|
|
2
|
+
import type { Syncpack } from '../types';
|
|
3
|
+
export declare function formatCli(input: Partial<Syncpack.Config.Cli>, disk: Disk): void;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
exports.__esModule = true;
|
|
3
3
|
exports.formatCli = void 0;
|
|
4
|
-
var get_context_1 = require("../
|
|
4
|
+
var get_context_1 = require("../get-context");
|
|
5
5
|
var write_if_changed_1 = require("../lib/write-if-changed");
|
|
6
6
|
var format_1 = require("./format");
|
|
7
7
|
function formatCli(input, disk) {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
export declare function format(ctx:
|
|
1
|
+
import type { Syncpack } from '../types';
|
|
2
|
+
export declare function format(ctx: Syncpack.Ctx): Syncpack.Ctx;
|
package/dist/bin-format/index.js
CHANGED
|
@@ -37,12 +37,14 @@ exports.__esModule = true;
|
|
|
37
37
|
var chalk_1 = __importDefault(require("chalk"));
|
|
38
38
|
var commander_1 = require("commander");
|
|
39
39
|
var disk_1 = require("../lib/disk");
|
|
40
|
+
var show_help_on_error_1 = require("../lib/show-help-on-error");
|
|
40
41
|
var option_1 = require("../option");
|
|
41
42
|
var format_cli_1 = require("./format-cli");
|
|
42
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/, ''));
|
|
43
44
|
commander_1.program.on('--help', function () {
|
|
44
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"]))));
|
|
45
46
|
});
|
|
47
|
+
(0, show_help_on_error_1.showHelpOnError)(commander_1.program);
|
|
46
48
|
(_a = (_b = commander_1.program
|
|
47
49
|
.option.apply(commander_1.program, __spreadArray([], __read(option_1.option.source), false)))
|
|
48
50
|
.option.apply(_b, __spreadArray([], __read(option_1.option.config), false)))
|
|
@@ -32,39 +32,30 @@ 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
|
|
35
|
+
var _a, _b, _c, _d;
|
|
36
36
|
exports.__esModule = true;
|
|
37
37
|
var chalk_1 = __importDefault(require("chalk"));
|
|
38
38
|
var commander_1 = require("commander");
|
|
39
39
|
var disk_1 = require("../lib/disk");
|
|
40
|
+
var show_help_on_error_1 = require("../lib/show-help-on-error");
|
|
40
41
|
var option_1 = require("../option");
|
|
41
42
|
var lint_semver_ranges_cli_1 = require("./lint-semver-ranges-cli");
|
|
42
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/, ''));
|
|
43
44
|
commander_1.program.on('--help', function () {
|
|
44
|
-
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
|
|
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"]))));
|
|
45
46
|
});
|
|
46
|
-
(
|
|
47
|
+
(0, show_help_on_error_1.showHelpOnError)(commander_1.program);
|
|
48
|
+
(_a = (_b = (_c = (_d = commander_1.program
|
|
47
49
|
.option.apply(commander_1.program, __spreadArray([], __read(option_1.option.source), false)))
|
|
48
|
-
.option.apply(
|
|
49
|
-
.option.apply(
|
|
50
|
-
.option.apply(
|
|
51
|
-
.option.apply(
|
|
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);
|
|
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);
|
|
57
54
|
(0, lint_semver_ranges_cli_1.lintSemverRangesCli)({
|
|
58
55
|
configPath: commander_1.program.opts().config,
|
|
59
|
-
dev: commander_1.program.opts().dev,
|
|
60
56
|
filter: commander_1.program.opts().filter,
|
|
61
|
-
overrides: commander_1.program.opts().overrides,
|
|
62
|
-
peer: commander_1.program.opts().peer,
|
|
63
|
-
pnpmOverrides: commander_1.program.opts().pnpmOverrides,
|
|
64
|
-
prod: commander_1.program.opts().prod,
|
|
65
|
-
resolutions: commander_1.program.opts().resolutions,
|
|
66
57
|
semverRange: commander_1.program.opts().semverRange,
|
|
67
58
|
source: commander_1.program.opts().source,
|
|
68
|
-
|
|
59
|
+
types: commander_1.program.opts().types
|
|
69
60
|
}, disk_1.disk);
|
|
70
61
|
var templateObject_1, templateObject_2;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { Disk } from '../lib/disk';
|
|
2
|
-
import type {
|
|
3
|
-
export declare function lintSemverRangesCli(input: Partial<Config.
|
|
2
|
+
import type { Syncpack } from '../types';
|
|
3
|
+
export declare function lintSemverRangesCli(input: Partial<Syncpack.Config.Cli>, disk: Disk): void;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
exports.__esModule = true;
|
|
3
3
|
exports.lintSemverRangesCli = void 0;
|
|
4
|
+
var get_context_1 = require("../get-context");
|
|
4
5
|
var exit_if_invalid_1 = require("../lib/exit-if-invalid");
|
|
5
|
-
var get_context_1 = require("../lib/get-context");
|
|
6
6
|
var 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)));
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
export declare function lintSemverRanges(ctx:
|
|
1
|
+
import type { Syncpack } from '../types';
|
|
2
|
+
export declare function lintSemverRanges(ctx: Syncpack.Ctx): Syncpack.Ctx;
|
|
@@ -53,24 +53,23 @@ var log = __importStar(require("../lib/log"));
|
|
|
53
53
|
var set_semver_range_1 = require("../lib/set-semver-range");
|
|
54
54
|
function lintSemverRanges(ctx) {
|
|
55
55
|
ctx.semverGroups.reverse().forEach(function (semverGroup, i) {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
56
|
+
// Nothing to do if there are no mismatches
|
|
57
|
+
if (!semverGroup.hasMismatches())
|
|
58
|
+
return;
|
|
59
|
+
// Record that this project has mismatches, so that eg. the CLI can exit
|
|
60
|
+
// with the correct status code.
|
|
61
|
+
ctx.isInvalid = true;
|
|
62
|
+
// Log each group which has mismatches
|
|
63
|
+
semverGroup.getMismatches().forEach(function (_a) {
|
|
64
|
+
var _b = __read(_a, 2), name = _b[0], mismatches = _b[1];
|
|
63
65
|
// Annotate user-defined version groups
|
|
64
66
|
if (!semverGroup.isDefault)
|
|
65
67
|
log.semverGroupHeader(i);
|
|
66
|
-
// Record that this project has mismatches, so that eg. the CLI can exit
|
|
67
|
-
// with the correct status code.
|
|
68
|
-
ctx.isInvalid = true;
|
|
69
68
|
// Log the dependency name
|
|
70
69
|
log.invalid(name);
|
|
71
70
|
// Log each of the dependencies mismatches
|
|
72
|
-
|
|
73
|
-
if (!instance.hasRange(range)) {
|
|
71
|
+
mismatches.forEach(function (instance) {
|
|
72
|
+
if (!instance.hasRange(semverGroup.range)) {
|
|
74
73
|
logSemverRangeMismatch(instance, semverGroup);
|
|
75
74
|
}
|
|
76
75
|
});
|
|
@@ -80,10 +79,10 @@ function lintSemverRanges(ctx) {
|
|
|
80
79
|
}
|
|
81
80
|
exports.lintSemverRanges = lintSemverRanges;
|
|
82
81
|
function logSemverRangeMismatch(instance, semverGroup) {
|
|
83
|
-
var
|
|
82
|
+
var path = instance.pathDef.path;
|
|
84
83
|
var shortPath = instance.packageJsonFile.shortPath;
|
|
85
84
|
var actual = instance.version;
|
|
86
85
|
var expected = (0, set_semver_range_1.setSemverRange)(semverGroup.range, actual);
|
|
87
|
-
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,
|
|
86
|
+
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));
|
|
88
87
|
}
|
|
89
88
|
var templateObject_1;
|
package/dist/bin-list/index.js
CHANGED
|
@@ -32,37 +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
|
|
35
|
+
var _a, _b, _c;
|
|
36
36
|
exports.__esModule = true;
|
|
37
37
|
var chalk_1 = __importDefault(require("chalk"));
|
|
38
38
|
var commander_1 = require("commander");
|
|
39
39
|
var disk_1 = require("../lib/disk");
|
|
40
|
+
var show_help_on_error_1 = require("../lib/show-help-on-error");
|
|
40
41
|
var option_1 = require("../option");
|
|
41
42
|
var list_cli_1 = require("./list-cli");
|
|
42
43
|
commander_1.program.description(' List all dependencies required by your packages.');
|
|
43
44
|
commander_1.program.on('--help', function () {
|
|
44
|
-
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
|
|
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 --types dev\n {dim # only inspect \"devDependencies\" and \"peerDependencies\"}\n syncpack list --types 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 --types dev\n {dim # only inspect \"devDependencies\" and \"peerDependencies\"}\n syncpack list --types 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"]))));
|
|
45
46
|
});
|
|
46
|
-
(
|
|
47
|
+
(0, show_help_on_error_1.showHelpOnError)(commander_1.program);
|
|
48
|
+
(_a = (_b = (_c = commander_1.program
|
|
47
49
|
.option.apply(commander_1.program, __spreadArray([], __read(option_1.option.source), false)))
|
|
48
|
-
.option.apply(
|
|
49
|
-
.option.apply(
|
|
50
|
-
.option.apply(
|
|
51
|
-
.option.apply(_e, __spreadArray([], __read(option_1.option.dev), false)))
|
|
52
|
-
.option.apply(_d, __spreadArray([], __read(option_1.option.peer), false)))
|
|
53
|
-
.option.apply(_c, __spreadArray([], __read(option_1.option.resolutions), false)))
|
|
54
|
-
.option.apply(_b, __spreadArray([], __read(option_1.option.overrides), false)))
|
|
55
|
-
.option.apply(_a, __spreadArray([], __read(option_1.option.workspace), false)).parse(process.argv);
|
|
50
|
+
.option.apply(_c, __spreadArray([], __read(option_1.option.filter), false)))
|
|
51
|
+
.option.apply(_b, __spreadArray([], __read(option_1.option.config), false)))
|
|
52
|
+
.option.apply(_a, __spreadArray([], __read(option_1.option.types), false)).parse(process.argv);
|
|
56
53
|
(0, list_cli_1.listCli)({
|
|
57
54
|
configPath: commander_1.program.opts().config,
|
|
58
|
-
dev: commander_1.program.opts().dev,
|
|
59
55
|
filter: commander_1.program.opts().filter,
|
|
60
|
-
overrides: commander_1.program.opts().overrides,
|
|
61
|
-
peer: commander_1.program.opts().peer,
|
|
62
|
-
pnpmOverrides: commander_1.program.opts().pnpmOverrides,
|
|
63
|
-
prod: commander_1.program.opts().prod,
|
|
64
|
-
resolutions: commander_1.program.opts().resolutions,
|
|
65
56
|
source: commander_1.program.opts().source,
|
|
66
|
-
|
|
57
|
+
types: commander_1.program.opts().types
|
|
67
58
|
}, disk_1.disk);
|
|
68
59
|
var templateObject_1;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { Disk } from '../lib/disk';
|
|
2
|
-
import type {
|
|
3
|
-
export declare function listCli(input: Partial<Config.
|
|
2
|
+
import type { Syncpack } from '../types';
|
|
3
|
+
export declare function listCli(input: Partial<Syncpack.Config.Cli>, disk: Disk): void;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
exports.__esModule = true;
|
|
3
3
|
exports.listCli = void 0;
|
|
4
|
+
var get_context_1 = require("../get-context");
|
|
4
5
|
var exit_if_invalid_1 = require("../lib/exit-if-invalid");
|
|
5
|
-
var get_context_1 = require("../lib/get-context");
|
|
6
6
|
var list_1 = require("./list");
|
|
7
7
|
function listCli(input, disk) {
|
|
8
8
|
(0, exit_if_invalid_1.exitIfInvalid)((0, list_1.list)((0, get_context_1.getContext)(input, disk)));
|
package/dist/bin-list/list.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
export declare function list(ctx:
|
|
1
|
+
import type { Syncpack } from '../types';
|
|
2
|
+
export declare function list(ctx: Syncpack.Ctx): Syncpack.Ctx;
|
package/dist/bin-list/list.js
CHANGED
|
@@ -46,9 +46,9 @@ function list(ctx) {
|
|
|
46
46
|
// with the correct status code.
|
|
47
47
|
if (instanceGroup.isInvalid)
|
|
48
48
|
ctx.isInvalid = true;
|
|
49
|
-
|
|
49
|
+
versionGroup.isBanned
|
|
50
50
|
? logBanned(instanceGroup)
|
|
51
|
-
:
|
|
51
|
+
: versionGroup.isIgnored
|
|
52
52
|
? logIgnored(instanceGroup)
|
|
53
53
|
: instanceGroup.hasMismatches
|
|
54
54
|
? logVersionMismatch(instanceGroup, uniques, expected)
|
|
@@ -32,37 +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
|
|
35
|
+
var _a, _b, _c;
|
|
36
36
|
exports.__esModule = true;
|
|
37
37
|
var chalk_1 = __importDefault(require("chalk"));
|
|
38
38
|
var commander_1 = require("commander");
|
|
39
39
|
var disk_1 = require("../lib/disk");
|
|
40
|
+
var show_help_on_error_1 = require("../lib/show-help-on-error");
|
|
40
41
|
var option_1 = require("../option");
|
|
41
42
|
var list_mismatches_cli_1 = require("./list-mismatches-cli");
|
|
42
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/, ''));
|
|
43
44
|
commander_1.program.on('--help', function () {
|
|
44
|
-
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
|
|
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 --types dev\n {dim # only inspect \"devDependencies\" and \"peerDependencies\"}\n syncpack list-mismatches --types 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 --types dev\n {dim # only inspect \"devDependencies\" and \"peerDependencies\"}\n syncpack list-mismatches --types 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"]))));
|
|
45
46
|
});
|
|
46
|
-
(
|
|
47
|
+
(0, show_help_on_error_1.showHelpOnError)(commander_1.program);
|
|
48
|
+
(_a = (_b = (_c = commander_1.program
|
|
47
49
|
.option.apply(commander_1.program, __spreadArray([], __read(option_1.option.source), false)))
|
|
48
|
-
.option.apply(
|
|
49
|
-
.option.apply(
|
|
50
|
-
.option.apply(
|
|
51
|
-
.option.apply(_e, __spreadArray([], __read(option_1.option.dev), false)))
|
|
52
|
-
.option.apply(_d, __spreadArray([], __read(option_1.option.peer), false)))
|
|
53
|
-
.option.apply(_c, __spreadArray([], __read(option_1.option.resolutions), false)))
|
|
54
|
-
.option.apply(_b, __spreadArray([], __read(option_1.option.overrides), false)))
|
|
55
|
-
.option.apply(_a, __spreadArray([], __read(option_1.option.workspace), false)).parse(process.argv);
|
|
50
|
+
.option.apply(_c, __spreadArray([], __read(option_1.option.filter), false)))
|
|
51
|
+
.option.apply(_b, __spreadArray([], __read(option_1.option.config), false)))
|
|
52
|
+
.option.apply(_a, __spreadArray([], __read(option_1.option.types), false)).parse(process.argv);
|
|
56
53
|
(0, list_mismatches_cli_1.listMismatchesCli)({
|
|
57
54
|
configPath: commander_1.program.opts().config,
|
|
58
|
-
dev: commander_1.program.opts().dev,
|
|
59
55
|
filter: commander_1.program.opts().filter,
|
|
60
|
-
overrides: commander_1.program.opts().overrides,
|
|
61
|
-
peer: commander_1.program.opts().peer,
|
|
62
|
-
pnpmOverrides: commander_1.program.opts().pnpmOverrides,
|
|
63
|
-
prod: commander_1.program.opts().prod,
|
|
64
|
-
resolutions: commander_1.program.opts().resolutions,
|
|
65
56
|
source: commander_1.program.opts().source,
|
|
66
|
-
|
|
57
|
+
types: commander_1.program.opts().types
|
|
67
58
|
}, disk_1.disk);
|
|
68
59
|
var templateObject_1;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { Disk } from '../lib/disk';
|
|
2
|
-
import type {
|
|
3
|
-
export declare function listMismatchesCli(input: Partial<Config.
|
|
2
|
+
import type { Syncpack } from '../types';
|
|
3
|
+
export declare function listMismatchesCli(input: Partial<Syncpack.Config.Cli>, disk: Disk): void;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
exports.__esModule = true;
|
|
3
3
|
exports.listMismatchesCli = void 0;
|
|
4
|
+
var get_context_1 = require("../get-context");
|
|
4
5
|
var exit_if_invalid_1 = require("../lib/exit-if-invalid");
|
|
5
|
-
var get_context_1 = require("../lib/get-context");
|
|
6
6
|
var list_mismatches_1 = require("./list-mismatches");
|
|
7
7
|
function listMismatchesCli(input, disk) {
|
|
8
8
|
(0, exit_if_invalid_1.exitIfInvalid)((0, list_mismatches_1.listMismatches)((0, get_context_1.getContext)(input, disk)));
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
export declare function listMismatches(ctx:
|
|
1
|
+
import type { Syncpack } from '../types';
|
|
2
|
+
export declare function listMismatches(ctx: Syncpack.Ctx): Syncpack.Ctx;
|
|
@@ -49,15 +49,15 @@ function listMismatches(ctx) {
|
|
|
49
49
|
invalidGroups.forEach(function (instanceGroup) {
|
|
50
50
|
var name = instanceGroup.name;
|
|
51
51
|
var workspaceInstance = instanceGroup.getWorkspaceInstance();
|
|
52
|
-
var expected = instanceGroup.getExpectedVersion() || '
|
|
53
|
-
var isBanned =
|
|
52
|
+
var expected = instanceGroup.getExpectedVersion() || '';
|
|
53
|
+
var isBanned = versionGroup.isBanned;
|
|
54
54
|
var isUnpinned = instanceGroup.isUnpinned;
|
|
55
55
|
// Log the dependency name
|
|
56
56
|
if (isBanned) {
|
|
57
57
|
logBanned(name);
|
|
58
58
|
}
|
|
59
59
|
else if (isUnpinned) {
|
|
60
|
-
logPinVersionMismatch(name,
|
|
60
|
+
logPinVersionMismatch(name, versionGroup);
|
|
61
61
|
}
|
|
62
62
|
else if (workspaceInstance) {
|
|
63
63
|
logWorkspaceMismatch(workspaceInstance, expected, name);
|
|
@@ -77,8 +77,8 @@ function listMismatches(ctx) {
|
|
|
77
77
|
function logBanned(name) {
|
|
78
78
|
log.invalid(name, 'is banned in this version group');
|
|
79
79
|
}
|
|
80
|
-
function logPinVersionMismatch(name,
|
|
81
|
-
var pinVersion =
|
|
80
|
+
function logPinVersionMismatch(name, versionGroup) {
|
|
81
|
+
var pinVersion = versionGroup.pinVersion;
|
|
82
82
|
log.invalid(name, (0, chalk_1["default"])(templateObject_1 || (templateObject_1 = __makeTemplateObject(["is pinned in this version group at {reset.green ", "}"], ["is pinned in this version group at {reset.green ", "}"])), pinVersion));
|
|
83
83
|
}
|
|
84
84
|
function logWorkspaceMismatch(workspaceInstance, expected, name) {
|
|
@@ -89,7 +89,7 @@ function listMismatches(ctx) {
|
|
|
89
89
|
log.invalid(name, (0, chalk_1["default"])(templateObject_3 || (templateObject_3 = __makeTemplateObject(["{reset.green ", "} {dim is the highest valid semver version in use}"], ["{reset.green ", "} {dim is the highest valid semver version in use}"])), expected));
|
|
90
90
|
}
|
|
91
91
|
function logVersionMismatch(instance) {
|
|
92
|
-
var type = instance.
|
|
92
|
+
var type = instance.pathDef.path;
|
|
93
93
|
var shortPath = instance.packageJsonFile.shortPath;
|
|
94
94
|
var actual = instance.version;
|
|
95
95
|
console.log((0, chalk_1["default"])(templateObject_4 || (templateObject_4 = __makeTemplateObject([" {red ", "} {dim in ", " of ", "}"], [" {red ", "} {dim in ", " of ", "}"])), actual, type, shortPath));
|
|
@@ -32,41 +32,32 @@ 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
|
|
35
|
+
var _a, _b, _c, _d, _e;
|
|
36
36
|
exports.__esModule = true;
|
|
37
37
|
var chalk_1 = __importDefault(require("chalk"));
|
|
38
38
|
var commander_1 = require("commander");
|
|
39
39
|
var disk_1 = require("../lib/disk");
|
|
40
|
+
var show_help_on_error_1 = require("../lib/show-help-on-error");
|
|
40
41
|
var option_1 = require("../option");
|
|
41
42
|
var set_semver_ranges_cli_1 = require("./set-semver-ranges-cli");
|
|
42
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/, ''));
|
|
43
44
|
commander_1.program.on('--help', function () {
|
|
44
|
-
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
|
|
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 --types dev --semver-range ~\n {dim # set ~ range in \"devDependencies\" and \"peerDependencies\"}\n syncpack set-semver-ranges --types 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 --types dev --semver-range ~\n {dim # set ~ range in \"devDependencies\" and \"peerDependencies\"}\n syncpack set-semver-ranges --types 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"]))));
|
|
45
46
|
});
|
|
46
|
-
(
|
|
47
|
+
(0, show_help_on_error_1.showHelpOnError)(commander_1.program);
|
|
48
|
+
(_a = (_b = (_c = (_d = (_e = commander_1.program
|
|
47
49
|
.option.apply(commander_1.program, __spreadArray([], __read(option_1.option.source), false)))
|
|
48
|
-
.option.apply(
|
|
49
|
-
.option.apply(
|
|
50
|
-
.option.apply(
|
|
51
|
-
.option.apply(
|
|
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)))
|
|
50
|
+
.option.apply(_e, __spreadArray([], __read(option_1.option.filter), false)))
|
|
51
|
+
.option.apply(_d, __spreadArray([], __read(option_1.option.config), false)))
|
|
52
|
+
.option.apply(_c, __spreadArray([], __read(option_1.option.semverRange), false)))
|
|
53
|
+
.option.apply(_b, __spreadArray([], __read(option_1.option.types), false)))
|
|
57
54
|
.option.apply(_a, __spreadArray([], __read(option_1.option.indent), false)).parse(process.argv);
|
|
58
55
|
(0, set_semver_ranges_cli_1.setSemverRangesCli)({
|
|
59
56
|
configPath: commander_1.program.opts().config,
|
|
60
|
-
dev: commander_1.program.opts().dev,
|
|
61
57
|
filter: commander_1.program.opts().filter,
|
|
62
58
|
indent: commander_1.program.opts().indent,
|
|
63
|
-
overrides: commander_1.program.opts().overrides,
|
|
64
|
-
peer: commander_1.program.opts().peer,
|
|
65
|
-
pnpmOverrides: commander_1.program.opts().pnpmOverrides,
|
|
66
|
-
prod: commander_1.program.opts().prod,
|
|
67
|
-
resolutions: commander_1.program.opts().resolutions,
|
|
68
59
|
semverRange: commander_1.program.opts().semverRange,
|
|
69
60
|
source: commander_1.program.opts().source,
|
|
70
|
-
|
|
61
|
+
types: commander_1.program.opts().types
|
|
71
62
|
}, disk_1.disk);
|
|
72
63
|
var templateObject_1, templateObject_2;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { Disk } from '../lib/disk';
|
|
2
|
-
import type {
|
|
3
|
-
export declare function setSemverRangesCli(input: Partial<Config.
|
|
2
|
+
import type { Syncpack } from '../types';
|
|
3
|
+
export declare function setSemverRangesCli(input: Partial<Syncpack.Config.Cli>, disk: Disk): void;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
exports.__esModule = true;
|
|
3
3
|
exports.setSemverRangesCli = void 0;
|
|
4
|
-
var get_context_1 = require("../
|
|
4
|
+
var get_context_1 = require("../get-context");
|
|
5
5
|
var write_if_changed_1 = require("../lib/write-if-changed");
|
|
6
6
|
var set_semver_ranges_1 = require("./set-semver-ranges");
|
|
7
7
|
function setSemverRangesCli(input, disk) {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
export declare const setSemverRanges: (ctx:
|
|
1
|
+
import type { Syncpack } from '../types';
|
|
2
|
+
export declare const setSemverRanges: (ctx: Syncpack.Ctx) => Syncpack.Ctx;
|