syncpack 9.8.4 → 10.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/LICENSE +12 -13
- package/README.md +17 -19
- package/dist/bin-fix-mismatches/fix-mismatches-cli.d.ts +2 -2
- package/dist/bin-fix-mismatches/fix-mismatches-cli.js +3 -1
- package/dist/bin-fix-mismatches/fix-mismatches.d.ts +2 -2
- package/dist/bin-fix-mismatches/fix-mismatches.js +44 -25
- package/dist/bin-format/format-cli.d.ts +2 -2
- package/dist/bin-format/format-cli.js +2 -1
- package/dist/bin-format/format.d.ts +2 -2
- package/dist/bin-format/format.js +7 -4
- 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 +2 -1
- package/dist/bin-lint-semver-ranges/lint-semver-ranges.d.ts +2 -2
- package/dist/bin-lint-semver-ranges/lint-semver-ranges.js +29 -25
- package/dist/bin-list/list-cli.d.ts +2 -2
- package/dist/bin-list/list-cli.js +2 -1
- package/dist/bin-list/list.d.ts +2 -2
- package/dist/bin-list/list.js +58 -52
- package/dist/bin-list-mismatches/list-mismatches-cli.d.ts +2 -2
- package/dist/bin-list-mismatches/list-mismatches-cli.js +2 -1
- package/dist/bin-list-mismatches/list-mismatches.d.ts +2 -2
- package/dist/bin-list-mismatches/list-mismatches.js +72 -105
- 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 +2 -1
- package/dist/bin-set-semver-ranges/set-semver-ranges.d.ts +2 -2
- package/dist/bin-set-semver-ranges/set-semver-ranges.js +17 -3
- package/dist/config/get-custom-types.d.ts +9 -0
- package/dist/config/get-custom-types.js +49 -0
- package/dist/config/get-enabled-types.d.ts +3 -0
- package/dist/config/get-enabled-types.js +48 -0
- package/dist/config/get-filter.d.ts +2 -0
- package/dist/config/get-filter.js +13 -0
- package/dist/config/get-indent.d.ts +2 -0
- package/dist/config/get-indent.js +12 -0
- package/dist/config/get-semver-range.d.ts +3 -0
- package/dist/config/get-semver-range.js +12 -0
- package/dist/config/get-sort-az.d.ts +2 -0
- package/dist/config/get-sort-az.js +18 -0
- package/dist/config/get-sort-first.d.ts +2 -0
- package/dist/config/get-sort-first.js +10 -0
- package/dist/config/get-source.d.ts +2 -0
- package/dist/config/get-source.js +13 -0
- package/dist/config/types.d.ts +106 -0
- package/dist/constants.d.ts +1 -0
- package/dist/constants.js +1 -0
- package/dist/get-context/index.d.ts +8 -16
- package/dist/get-context/index.js +8 -31
- package/dist/get-package-json-files/get-file-paths.d.ts +13 -0
- package/dist/get-package-json-files/get-file-paths.js +30 -0
- package/dist/get-package-json-files/get-patterns/get-lerna-patterns.d.ts +3 -0
- package/dist/get-package-json-files/get-patterns/get-lerna-patterns.js +17 -0
- package/dist/get-package-json-files/get-patterns/get-pnpm-patterns.d.ts +3 -0
- package/dist/get-package-json-files/get-patterns/get-pnpm-patterns.js +22 -0
- package/dist/get-package-json-files/get-patterns/get-yarn-patterns.d.ts +3 -0
- package/dist/get-package-json-files/get-patterns/get-yarn-patterns.js +18 -0
- package/dist/get-package-json-files/get-patterns/index.d.ts +10 -0
- package/dist/get-package-json-files/get-patterns/index.js +35 -0
- package/dist/{get-context/get-package-json-files → get-package-json-files}/get-patterns/read-json-safe.d.ts +3 -4
- package/dist/get-package-json-files/get-patterns/read-json-safe.js +14 -0
- package/dist/get-package-json-files/get-patterns/read-yaml-safe.d.ts +3 -0
- package/dist/get-package-json-files/get-patterns/read-yaml-safe.js +12 -0
- package/dist/get-package-json-files/index.d.ts +6 -0
- package/dist/get-package-json-files/index.js +18 -0
- package/dist/{get-context/get-package-json-files/package-json-file → get-package-json-files}/instance.d.ts +6 -8
- package/dist/get-package-json-files/instance.js +23 -0
- package/dist/{get-context/get-package-json-files/package-json-file/index.d.ts → get-package-json-files/package-json-file.d.ts} +7 -9
- package/dist/get-package-json-files/package-json-file.js +45 -0
- package/dist/get-semver-groups/catch-all.d.ts +4 -0
- package/dist/get-semver-groups/catch-all.js +11 -0
- package/dist/get-semver-groups/filtered-out.d.ts +13 -0
- package/dist/get-semver-groups/filtered-out.js +29 -0
- package/dist/get-semver-groups/ignored.d.ts +11 -0
- package/dist/get-semver-groups/ignored.js +22 -0
- package/dist/get-semver-groups/index.d.ts +32 -0
- package/dist/get-semver-groups/index.js +90 -0
- package/dist/get-semver-groups/with-range.d.ts +11 -0
- package/dist/get-semver-groups/with-range.js +55 -0
- package/dist/get-version-groups/banned.d.ts +11 -0
- package/dist/get-version-groups/banned.js +24 -0
- package/dist/get-version-groups/catch-all.d.ts +4 -0
- package/dist/get-version-groups/catch-all.js +11 -0
- package/dist/get-version-groups/filtered-out.d.ts +13 -0
- package/dist/get-version-groups/filtered-out.js +31 -0
- package/dist/get-version-groups/ignored.d.ts +11 -0
- package/dist/get-version-groups/ignored.js +24 -0
- package/dist/get-version-groups/index.d.ts +57 -0
- package/dist/get-version-groups/index.js +119 -0
- package/dist/get-version-groups/lib/delete.d.ts +2 -0
- package/dist/get-version-groups/lib/delete.js +4 -0
- package/dist/get-version-groups/lib/get-highest-version.d.ts +2 -0
- package/dist/get-version-groups/lib/get-highest-version.js +13 -0
- package/dist/get-version-groups/lib/get-lowest-version.d.ts +2 -0
- package/dist/get-version-groups/lib/get-lowest-version.js +13 -0
- package/dist/{get-context/get-groups/version-group/instance-group → get-version-groups}/lib/get-range-score.js +3 -2
- package/dist/get-version-groups/lib/get-unique-versions.d.ts +2 -0
- package/dist/get-version-groups/lib/get-unique-versions.js +8 -0
- package/dist/get-version-groups/lib/group-by.d.ts +1 -0
- package/dist/get-version-groups/lib/group-by.js +11 -0
- package/dist/get-version-groups/lib/sort.d.ts +1 -0
- package/dist/get-version-groups/lib/sort.js +44 -0
- package/dist/get-version-groups/pinned.d.ts +11 -0
- package/dist/get-version-groups/pinned.js +43 -0
- package/dist/get-version-groups/snapped-to.d.ts +11 -0
- package/dist/get-version-groups/snapped-to.js +52 -0
- package/dist/get-version-groups/standard.d.ts +11 -0
- package/dist/get-version-groups/standard.js +95 -0
- package/dist/index.d.ts +2 -0
- package/dist/lib/$R.d.ts +12 -0
- package/dist/lib/$R.js +34 -0
- package/dist/lib/disk.d.ts +3 -2
- package/dist/lib/disk.js +1 -1
- package/dist/lib/exit-if-invalid.d.ts +2 -2
- package/dist/lib/is-semver.d.ts +5 -3
- package/dist/lib/is-semver.js +18 -4
- package/dist/lib/log.d.ts +4 -8
- package/dist/lib/log.js +4 -30
- package/dist/lib/set-semver-range.d.ts +2 -2
- package/dist/lib/write-if-changed.d.ts +2 -2
- package/dist/lib/write-if-changed.js +6 -25
- package/dist/strategy/lib/get-non-empty-string-prop.d.ts +3 -0
- package/dist/strategy/lib/get-non-empty-string-prop.js +12 -0
- package/dist/strategy/name-and-version-props.d.ts +12 -0
- package/dist/strategy/name-and-version-props.js +50 -0
- package/dist/strategy/named-version-string.d.ts +11 -0
- package/dist/strategy/named-version-string.js +53 -0
- package/dist/strategy/unnamed-version-string.d.ts +11 -0
- package/dist/strategy/unnamed-version-string.js +48 -0
- package/dist/strategy/versions-by-name.d.ts +11 -0
- package/dist/strategy/versions-by-name.js +29 -0
- package/package.json +23 -20
- package/dist/get-context/$R.d.ts +0 -13
- package/dist/get-context/$R.js +0 -34
- package/dist/get-context/get-config/get-core-types.d.ts +0 -36
- package/dist/get-context/get-config/get-core-types.js +0 -38
- package/dist/get-context/get-config/get-custom-types.d.ts +0 -4
- package/dist/get-context/get-config/get-custom-types.js +0 -16
- package/dist/get-context/get-config/get-enabled-types.d.ts +0 -4
- package/dist/get-context/get-config/get-enabled-types.js +0 -17
- package/dist/get-context/get-config/index.d.ts +0 -9
- package/dist/get-context/get-config/index.js +0 -91
- package/dist/get-context/get-config/path-strategy/index.d.ts +0 -8
- package/dist/get-context/get-config/path-strategy/index.js +0 -18
- package/dist/get-context/get-config/path-strategy/lib/get-non-empty-string-prop.d.ts +0 -4
- package/dist/get-context/get-config/path-strategy/lib/get-non-empty-string-prop.js +0 -11
- package/dist/get-context/get-config/path-strategy/name-and-version-props.d.ts +0 -2
- package/dist/get-context/get-config/path-strategy/name-and-version-props.js +0 -40
- package/dist/get-context/get-config/path-strategy/name-and-version-string.d.ts +0 -2
- package/dist/get-context/get-config/path-strategy/name-and-version-string.js +0 -44
- package/dist/get-context/get-config/path-strategy/types.d.ts +0 -15
- package/dist/get-context/get-config/path-strategy/version-string.d.ts +0 -2
- package/dist/get-context/get-config/path-strategy/version-string.js +0 -44
- package/dist/get-context/get-config/path-strategy/versions-by-name.d.ts +0 -2
- package/dist/get-context/get-config/path-strategy/versions-by-name.js +0 -23
- package/dist/get-context/get-config/schema/base-group.d.ts +0 -7
- package/dist/get-context/get-config/schema/base-group.js +0 -10
- package/dist/get-context/get-config/schema/index.d.ts +0 -1540
- package/dist/get-context/get-config/schema/index.js +0 -81
- package/dist/get-context/get-config/schema/lib/non-empty-string.d.ts +0 -2
- package/dist/get-context/get-config/schema/lib/non-empty-string.js +0 -5
- package/dist/get-context/get-config/schema/paths.d.ts +0 -89
- package/dist/get-context/get-config/schema/paths.js +0 -33
- package/dist/get-context/get-config/schema/semver-group.d.ts +0 -119
- package/dist/get-context/get-config/schema/semver-group.js +0 -43
- package/dist/get-context/get-config/schema/semver-range.d.ts +0 -2
- package/dist/get-context/get-config/schema/semver-range.js +0 -16
- package/dist/get-context/get-config/schema/version-group.d.ts +0 -230
- package/dist/get-context/get-config/schema/version-group.js +0 -36
- package/dist/get-context/get-groups/base-group.d.ts +0 -22
- package/dist/get-context/get-groups/base-group.js +0 -39
- package/dist/get-context/get-groups/index.d.ts +0 -12
- package/dist/get-context/get-groups/index.js +0 -51
- package/dist/get-context/get-groups/semver-group.d.ts +0 -15
- package/dist/get-context/get-groups/semver-group.js +0 -46
- package/dist/get-context/get-groups/version-group/index.d.ts +0 -15
- package/dist/get-context/get-groups/version-group/index.js +0 -36
- package/dist/get-context/get-groups/version-group/instance-group/get-highest-version.d.ts +0 -3
- package/dist/get-context/get-groups/version-group/instance-group/get-highest-version.js +0 -42
- package/dist/get-context/get-groups/version-group/instance-group/get-lowest-version.d.ts +0 -3
- package/dist/get-context/get-groups/version-group/instance-group/get-lowest-version.js +0 -44
- package/dist/get-context/get-groups/version-group/instance-group/index.d.ts +0 -35
- package/dist/get-context/get-groups/version-group/instance-group/index.js +0 -88
- package/dist/get-context/get-groups/version-group/instance-group/lib/compare-semver.d.ts +0 -4
- package/dist/get-context/get-groups/version-group/instance-group/lib/compare-semver.js +0 -38
- package/dist/get-context/get-package-json-files/get-file-paths.d.ts +0 -14
- package/dist/get-context/get-package-json-files/get-file-paths.js +0 -40
- package/dist/get-context/get-package-json-files/get-patterns/get-lerna-patterns.d.ts +0 -4
- package/dist/get-context/get-package-json-files/get-patterns/get-lerna-patterns.js +0 -16
- package/dist/get-context/get-package-json-files/get-patterns/get-pnpm-patterns.d.ts +0 -4
- package/dist/get-context/get-package-json-files/get-patterns/get-pnpm-patterns.js +0 -21
- package/dist/get-context/get-package-json-files/get-patterns/get-yarn-patterns.d.ts +0 -4
- package/dist/get-context/get-package-json-files/get-patterns/get-yarn-patterns.js +0 -17
- package/dist/get-context/get-package-json-files/get-patterns/index.d.ts +0 -11
- package/dist/get-context/get-package-json-files/get-patterns/index.js +0 -43
- package/dist/get-context/get-package-json-files/get-patterns/lib/get-array-of-strings.d.ts +0 -1
- package/dist/get-context/get-package-json-files/get-patterns/lib/get-array-of-strings.js +0 -8
- package/dist/get-context/get-package-json-files/get-patterns/props.d.ts +0 -6
- package/dist/get-context/get-package-json-files/get-patterns/props.js +0 -24
- package/dist/get-context/get-package-json-files/get-patterns/read-json-safe.js +0 -17
- package/dist/get-context/get-package-json-files/get-patterns/read-yaml-safe.d.ts +0 -4
- package/dist/get-context/get-package-json-files/get-patterns/read-yaml-safe.js +0 -11
- package/dist/get-context/get-package-json-files/index.d.ts +0 -7
- package/dist/get-context/get-package-json-files/index.js +0 -16
- package/dist/get-context/get-package-json-files/package-json-file/index.js +0 -63
- package/dist/get-context/get-package-json-files/package-json-file/instance.js +0 -46
- package/dist/lib/error.d.ts +0 -12
- package/dist/lib/error.js +0 -25
- package/dist/types.d.ts +0 -90
- /package/dist/{get-context/get-config/path-strategy → config}/types.js +0 -0
- /package/dist/{get-context/get-groups/version-group/instance-group → get-version-groups}/lib/clean.d.ts +0 -0
- /package/dist/{get-context/get-groups/version-group/instance-group → get-version-groups}/lib/clean.js +0 -0
- /package/dist/{get-context/get-groups/version-group/instance-group → get-version-groups}/lib/get-range-score.d.ts +0 -0
- /package/dist/{types.js → index.js} +0 -0
|
@@ -27,117 +27,84 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
27
27
|
};
|
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
29
|
exports.listMismatches = void 0;
|
|
30
|
-
const ts_belt_1 = require("@mobily/ts-belt");
|
|
31
30
|
const chalk_1 = __importDefault(require("chalk"));
|
|
31
|
+
const is_non_empty_array_1 = require("tightrope/guard/is-non-empty-array");
|
|
32
|
+
const constants_1 = require("../constants");
|
|
33
|
+
const get_version_groups_1 = require("../get-version-groups");
|
|
32
34
|
const log = __importStar(require("../lib/log"));
|
|
35
|
+
const sort_by_name_1 = require("../lib/sort-by-name");
|
|
33
36
|
function listMismatches(ctx) {
|
|
34
|
-
const
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
if (
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
37
|
+
const versionGroups = (0, get_version_groups_1.getVersionGroups)(ctx);
|
|
38
|
+
const hasUserGroups = (0, is_non_empty_array_1.isNonEmptyArray)(ctx.config.rcFile.versionGroups);
|
|
39
|
+
versionGroups.forEach((versionGroup, i) => {
|
|
40
|
+
versionGroup
|
|
41
|
+
.inspect()
|
|
42
|
+
.sort(sort_by_name_1.sortByName)
|
|
43
|
+
.forEach((report, ii) => {
|
|
44
|
+
// no action needed
|
|
45
|
+
if (report.isValid)
|
|
46
|
+
return;
|
|
47
|
+
// Allow eg. CLI to exit with the correct status code.
|
|
48
|
+
ctx.isInvalid = true;
|
|
49
|
+
// Annotate each group
|
|
50
|
+
if (ii === 0 && hasUserGroups)
|
|
51
|
+
log.versionGroupHeader(versionGroup, i);
|
|
52
|
+
switch (report.status) {
|
|
53
|
+
case 'BANNED':
|
|
54
|
+
console.log((0, chalk_1.default) ` {red %s} %s {dim is banned in this version group}`, constants_1.ICON.cross, report.name);
|
|
55
|
+
report.instances.forEach((instance) => {
|
|
56
|
+
console.log((0, chalk_1.default) ` {red %s} {dim in %s of %s}`, instance.version, instance.strategy.path, instance.packageJsonFile.shortPath);
|
|
57
|
+
});
|
|
58
|
+
break;
|
|
59
|
+
case 'HIGHEST_SEMVER_MISMATCH':
|
|
60
|
+
case 'LOWEST_SEMVER_MISMATCH': {
|
|
61
|
+
console.log((0, chalk_1.default) `{red %s} %s {green %s} {dim is the %s valid semver version in use}`, constants_1.ICON.cross, report.name, report.expectedVersion, report.status === 'LOWEST_SEMVER_MISMATCH' ? 'lowest' : 'highest');
|
|
62
|
+
report.instances.forEach((instance) => {
|
|
63
|
+
if (instance.version !== report.expectedVersion) {
|
|
64
|
+
console.log((0, chalk_1.default) ` {red %s} {dim in %s of %s}`, instance.version, instance.strategy.path, instance.packageJsonFile.shortPath);
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
break;
|
|
68
|
+
}
|
|
69
|
+
case 'PINNED_MISMATCH': {
|
|
70
|
+
console.log((0, chalk_1.default) `{red %s} %s {dim is pinned in this version group at} {green %s}`, constants_1.ICON.cross, report.name, report.expectedVersion);
|
|
71
|
+
report.instances.forEach((instance) => {
|
|
72
|
+
if (instance.version !== report.expectedVersion) {
|
|
73
|
+
console.log((0, chalk_1.default) ` {red %s} {dim in %s of %s}`, instance.version, instance.strategy.path, instance.packageJsonFile.shortPath);
|
|
74
|
+
}
|
|
75
|
+
});
|
|
76
|
+
break;
|
|
77
|
+
}
|
|
78
|
+
case 'SNAPPED_TO_MISMATCH': {
|
|
79
|
+
console.log((0, chalk_1.default) `{red %s} %s {dim should snap to {reset.green %s}, used by %s}`, constants_1.ICON.cross, report.name, report.expectedVersion, versionGroup.config.snapTo.join(' || '));
|
|
80
|
+
report.instances.forEach((instance) => {
|
|
81
|
+
if (instance.version !== report.expectedVersion) {
|
|
82
|
+
console.log((0, chalk_1.default) ` {red %s} {dim in %s of %s}`, instance.version, instance.strategy.path, instance.packageJsonFile.shortPath);
|
|
83
|
+
}
|
|
84
|
+
});
|
|
85
|
+
break;
|
|
86
|
+
}
|
|
87
|
+
case 'UNSUPPORTED_MISMATCH': {
|
|
88
|
+
console.log((0, chalk_1.default) `{red %s} %s {dim has mismatched versions which syncpack cannot fix}`, constants_1.ICON.cross, report.name);
|
|
89
|
+
report.instances.forEach((instance) => {
|
|
90
|
+
console.log((0, chalk_1.default) ` {yellow %s} {dim in %s of %s}`, instance.version, instance.strategy.path, instance.packageJsonFile.shortPath);
|
|
91
|
+
});
|
|
92
|
+
break;
|
|
93
|
+
}
|
|
94
|
+
case 'WORKSPACE_MISMATCH': {
|
|
95
|
+
console.log((0, chalk_1.default) `{red %s} %s {green %s} {dim is developed in this repo at %s}`, constants_1.ICON.cross, report.name, report.expectedVersion, report.workspaceInstance.packageJsonFile.shortPath);
|
|
96
|
+
report.instances.forEach((instance) => {
|
|
97
|
+
if (instance.version !== report.expectedVersion) {
|
|
98
|
+
console.log((0, chalk_1.default) ` {red %s} {dim in %s of %s}`, instance.version, instance.strategy.path, instance.packageJsonFile.shortPath);
|
|
99
|
+
}
|
|
100
|
+
});
|
|
101
|
+
break;
|
|
102
|
+
}
|
|
103
|
+
// @TODO case 'SEMVER_UNSATISFIED': break;
|
|
104
|
+
// @TODO case 'WORKSPACE_UNSATISFIED': break;
|
|
57
105
|
}
|
|
58
|
-
logHighLowVersionMismatch(instanceGroup);
|
|
59
106
|
});
|
|
60
107
|
});
|
|
61
108
|
return ctx;
|
|
62
|
-
function logBanned(instanceGroup) {
|
|
63
|
-
const name = instanceGroup.name;
|
|
64
|
-
log.invalid(name, 'is banned in this version group');
|
|
65
|
-
// Log each of the dependencies mismatches
|
|
66
|
-
instanceGroup.instances.forEach((instance) => {
|
|
67
|
-
logVersionMismatch(instance);
|
|
68
|
-
});
|
|
69
|
-
}
|
|
70
|
-
function logUnsupportedMismatches(instanceGroup) {
|
|
71
|
-
const name = instanceGroup.name;
|
|
72
|
-
log.invalid(name, 'has mismatched versions which syncpack cannot fix');
|
|
73
|
-
// Log each of the dependencies mismatches
|
|
74
|
-
instanceGroup.instances.forEach((instance) => {
|
|
75
|
-
logUnsupportedVersionMismatch(instance);
|
|
76
|
-
});
|
|
77
|
-
}
|
|
78
|
-
function logUnpinned(instanceGroup) {
|
|
79
|
-
const name = instanceGroup.name;
|
|
80
|
-
const pinVersion = ts_belt_1.O.getExn(instanceGroup.versionGroup.getPinnedVersion());
|
|
81
|
-
log.invalid(name, (0, chalk_1.default) `is pinned in this version group at {reset.green ${pinVersion}}`);
|
|
82
|
-
// Log each of the dependencies mismatches
|
|
83
|
-
instanceGroup.instances.forEach((instance) => {
|
|
84
|
-
if (instance.version !== pinVersion) {
|
|
85
|
-
logVersionMismatch(instance);
|
|
86
|
-
}
|
|
87
|
-
});
|
|
88
|
-
}
|
|
89
|
-
function logSnappedTo(instanceGroup) {
|
|
90
|
-
const name = instanceGroup.name;
|
|
91
|
-
const versionGroup = instanceGroup.versionGroup;
|
|
92
|
-
const snappedVersion = ts_belt_1.R.getExn(instanceGroup.getSnappedVersion());
|
|
93
|
-
const snappedToPackages = ts_belt_1.O.getExn(versionGroup.getSnappedToPackages()).join(' || ');
|
|
94
|
-
const version = ts_belt_1.R.getExn(instanceGroup.getExpectedVersion());
|
|
95
|
-
log.invalid(name, (0, chalk_1.default) `should snap to {reset.green ${version}}, used by ${snappedToPackages}`);
|
|
96
|
-
// Log each of the dependencies mismatches
|
|
97
|
-
instanceGroup.instances.forEach((instance) => {
|
|
98
|
-
if (instance.version !== snappedVersion) {
|
|
99
|
-
logVersionMismatch(instance);
|
|
100
|
-
}
|
|
101
|
-
});
|
|
102
|
-
}
|
|
103
|
-
function logWorkspaceMismatch(instanceGroup) {
|
|
104
|
-
const name = instanceGroup.name;
|
|
105
|
-
const workspaceInstance = ts_belt_1.O.getExn(instanceGroup.getWorkspaceInstance());
|
|
106
|
-
const shortPath = workspaceInstance?.packageJsonFile.shortPath;
|
|
107
|
-
const expected = ts_belt_1.R.getExn(instanceGroup.getExpectedVersion());
|
|
108
|
-
log.invalid(name, (0, chalk_1.default) `{reset.green ${expected}} {dim is developed in this repo at ${shortPath}}`);
|
|
109
|
-
// Log each of the dependencies mismatches
|
|
110
|
-
instanceGroup.instances.forEach((instance) => {
|
|
111
|
-
if (instance.version !== expected) {
|
|
112
|
-
logVersionMismatch(instance);
|
|
113
|
-
}
|
|
114
|
-
});
|
|
115
|
-
}
|
|
116
|
-
function logHighLowVersionMismatch(instanceGroup) {
|
|
117
|
-
const name = instanceGroup.name;
|
|
118
|
-
const preference = instanceGroup.versionGroup
|
|
119
|
-
.groupConfig.preferVersion;
|
|
120
|
-
const direction = preference === 'highestSemver' ? 'highest' : 'lowest';
|
|
121
|
-
const expected = ts_belt_1.R.getExn(instanceGroup.getExpectedVersion());
|
|
122
|
-
log.invalid(name, (0, chalk_1.default) `{reset.green ${expected}} {dim is the ${direction} valid semver version in use}`);
|
|
123
|
-
// Log each of the dependencies mismatches
|
|
124
|
-
instanceGroup.instances.forEach((instance) => {
|
|
125
|
-
if (instance.version !== expected) {
|
|
126
|
-
logVersionMismatch(instance);
|
|
127
|
-
}
|
|
128
|
-
});
|
|
129
|
-
}
|
|
130
|
-
function logVersionMismatch(instance) {
|
|
131
|
-
const type = instance.pathDef.path;
|
|
132
|
-
const shortPath = instance.packageJsonFile.shortPath;
|
|
133
|
-
const actual = instance.version;
|
|
134
|
-
console.log((0, chalk_1.default) ` {red ${actual}} {dim in ${type} of ${shortPath}}`);
|
|
135
|
-
}
|
|
136
|
-
function logUnsupportedVersionMismatch(instance) {
|
|
137
|
-
const type = instance.pathDef.path;
|
|
138
|
-
const shortPath = instance.packageJsonFile.shortPath;
|
|
139
|
-
const actual = instance.version;
|
|
140
|
-
console.log((0, chalk_1.default) ` {yellow ${actual}} {dim in ${type} of ${shortPath}}`);
|
|
141
|
-
}
|
|
142
109
|
}
|
|
143
110
|
exports.listMismatches = listMismatches;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
+
import type { CliConfig } from '../config/types';
|
|
1
2
|
import type { Disk } from '../lib/disk';
|
|
2
|
-
|
|
3
|
-
export declare function setSemverRangesCli(input: Partial<Syncpack.Config.Cli>, disk: Disk): void;
|
|
3
|
+
export declare function setSemverRangesCli(input: Partial<CliConfig>, disk: Disk): void;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.setSemverRangesCli = void 0;
|
|
4
|
+
const pipe_1 = require("tightrope/fn/pipe");
|
|
4
5
|
const get_context_1 = require("../get-context");
|
|
5
6
|
const write_if_changed_1 = require("../lib/write-if-changed");
|
|
6
7
|
const set_semver_ranges_1 = require("./set-semver-ranges");
|
|
7
8
|
function setSemverRangesCli(input, disk) {
|
|
8
|
-
(0,
|
|
9
|
+
(0, pipe_1.pipe)((0, get_context_1.getContext)(input, disk), set_semver_ranges_1.setSemverRanges, write_if_changed_1.writeIfChanged);
|
|
9
10
|
}
|
|
10
11
|
exports.setSemverRangesCli = setSemverRangesCli;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
export declare const setSemverRanges: (ctx:
|
|
1
|
+
import type { Context } from '../get-context';
|
|
2
|
+
export declare const setSemverRanges: (ctx: Context) => Context;
|
|
@@ -1,10 +1,24 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.setSemverRanges = void 0;
|
|
4
|
+
const get_semver_groups_1 = require("../get-semver-groups");
|
|
4
5
|
const setSemverRanges = (ctx) => {
|
|
5
|
-
ctx.
|
|
6
|
-
semverGroup.
|
|
7
|
-
|
|
6
|
+
(0, get_semver_groups_1.getSemverGroups)(ctx).forEach((semverGroup) => {
|
|
7
|
+
semverGroup.inspect().forEach((report) => {
|
|
8
|
+
switch (report.status) {
|
|
9
|
+
case 'WORKSPACE_SEMVER_RANGE_MISMATCH':
|
|
10
|
+
case 'SEMVER_RANGE_MISMATCH': {
|
|
11
|
+
report.instance.setVersion(report.expectedVersion);
|
|
12
|
+
break;
|
|
13
|
+
}
|
|
14
|
+
case 'FILTERED_OUT':
|
|
15
|
+
case 'IGNORED':
|
|
16
|
+
case 'UNSUPPORTED_VERSION':
|
|
17
|
+
case 'VALID': {
|
|
18
|
+
// no action needed
|
|
19
|
+
break;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
8
22
|
});
|
|
9
23
|
});
|
|
10
24
|
return ctx;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { Context } from '../get-context';
|
|
2
|
+
import { NameAndVersionPropsStrategy } from '../strategy/name-and-version-props';
|
|
3
|
+
import { NamedVersionStringStrategy } from '../strategy/named-version-string';
|
|
4
|
+
import { UnnamedVersionStringStrategy } from '../strategy/unnamed-version-string';
|
|
5
|
+
import { VersionsByNameStrategy } from '../strategy/versions-by-name';
|
|
6
|
+
export declare namespace Strategy {
|
|
7
|
+
type Any = NameAndVersionPropsStrategy | NamedVersionStringStrategy | UnnamedVersionStringStrategy | VersionsByNameStrategy;
|
|
8
|
+
}
|
|
9
|
+
export declare function getCustomTypes({ rcFile }: Context['config']): Strategy.Any[];
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getCustomTypes = void 0;
|
|
4
|
+
const is_non_empty_object_1 = require("tightrope/guard/is-non-empty-object");
|
|
5
|
+
const is_non_empty_string_1 = require("tightrope/guard/is-non-empty-string");
|
|
6
|
+
const is_object_1 = require("tightrope/guard/is-object");
|
|
7
|
+
const name_and_version_props_1 = require("../strategy/name-and-version-props");
|
|
8
|
+
const named_version_string_1 = require("../strategy/named-version-string");
|
|
9
|
+
const unnamed_version_string_1 = require("../strategy/unnamed-version-string");
|
|
10
|
+
const versions_by_name_1 = require("../strategy/versions-by-name");
|
|
11
|
+
function getCustomTypes({ rcFile }) {
|
|
12
|
+
if (!(0, is_non_empty_object_1.isNonEmptyObject)(rcFile.customTypes))
|
|
13
|
+
return [];
|
|
14
|
+
const ERR_OBJ = new Error('Invalid customType');
|
|
15
|
+
const ERR_NAME = new Error('Invalid customType name');
|
|
16
|
+
const ERR_PATH = new Error('Invalid customType.path');
|
|
17
|
+
const ERR_NAME_PATH = new Error('Invalid customType namePath');
|
|
18
|
+
const ERR_STRATEGY = new Error('Invalid customType.strategy');
|
|
19
|
+
return Object.entries(rcFile.customTypes).map(([name, config]) => {
|
|
20
|
+
if (!(0, is_object_1.isObject)(config))
|
|
21
|
+
throw ERR_OBJ;
|
|
22
|
+
if (!(0, is_non_empty_string_1.isNonEmptyString)(name))
|
|
23
|
+
throw ERR_NAME;
|
|
24
|
+
if (!(0, is_non_empty_string_1.isNonEmptyString)(config.path))
|
|
25
|
+
throw ERR_PATH;
|
|
26
|
+
const path = config.path;
|
|
27
|
+
const strategy = config.strategy;
|
|
28
|
+
switch (strategy) {
|
|
29
|
+
case 'name~version': {
|
|
30
|
+
const namePath = config.namePath;
|
|
31
|
+
if (!(0, is_non_empty_string_1.isNonEmptyString)(namePath))
|
|
32
|
+
throw ERR_NAME_PATH;
|
|
33
|
+
return new name_and_version_props_1.NameAndVersionPropsStrategy(name, path, namePath);
|
|
34
|
+
}
|
|
35
|
+
case 'name@version': {
|
|
36
|
+
return new named_version_string_1.NamedVersionStringStrategy(name, path);
|
|
37
|
+
}
|
|
38
|
+
case 'version': {
|
|
39
|
+
return new unnamed_version_string_1.UnnamedVersionStringStrategy(name, path);
|
|
40
|
+
}
|
|
41
|
+
case 'versionsByName': {
|
|
42
|
+
return new versions_by_name_1.VersionsByNameStrategy(name, path);
|
|
43
|
+
}
|
|
44
|
+
default:
|
|
45
|
+
throw ERR_STRATEGY;
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
exports.getCustomTypes = getCustomTypes;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getEnabledTypes = void 0;
|
|
4
|
+
const is_array_of_strings_1 = require("tightrope/guard/is-array-of-strings");
|
|
5
|
+
const is_empty_array_1 = require("tightrope/guard/is-empty-array");
|
|
6
|
+
const is_non_empty_string_1 = require("tightrope/guard/is-non-empty-string");
|
|
7
|
+
const name_and_version_props_1 = require("../strategy/name-and-version-props");
|
|
8
|
+
const versions_by_name_1 = require("../strategy/versions-by-name");
|
|
9
|
+
const get_custom_types_1 = require("./get-custom-types");
|
|
10
|
+
function getEnabledTypes({ cli, rcFile, }) {
|
|
11
|
+
const enabledTypes = [];
|
|
12
|
+
const enabledTypeNames = ((0, is_non_empty_string_1.isNonEmptyString)(cli.types)
|
|
13
|
+
? cli.types.split(',')
|
|
14
|
+
: (0, is_array_of_strings_1.isArrayOfStrings)(rcFile.dependencyTypes)
|
|
15
|
+
? rcFile.dependencyTypes
|
|
16
|
+
: []).filter(is_non_empty_string_1.isNonEmptyString);
|
|
17
|
+
// @TODO accept `dependencyTypes: ['**']`
|
|
18
|
+
// @TODO support `dependencyTypes: ['!dev']`
|
|
19
|
+
const useDefaults = (0, is_empty_array_1.isEmptyArray)(enabledTypeNames);
|
|
20
|
+
if (useDefaults || enabledTypeNames.includes('dev')) {
|
|
21
|
+
enabledTypes.push(new versions_by_name_1.VersionsByNameStrategy('dev', 'devDependencies'));
|
|
22
|
+
}
|
|
23
|
+
if (useDefaults || enabledTypeNames.includes('overrides')) {
|
|
24
|
+
enabledTypes.push(new versions_by_name_1.VersionsByNameStrategy('overrides', 'overrides'));
|
|
25
|
+
}
|
|
26
|
+
if (useDefaults || enabledTypeNames.includes('peer')) {
|
|
27
|
+
enabledTypes.push(new versions_by_name_1.VersionsByNameStrategy('peer', 'peerDependencies'));
|
|
28
|
+
}
|
|
29
|
+
if (useDefaults || enabledTypeNames.includes('pnpmOverrides')) {
|
|
30
|
+
enabledTypes.push(new versions_by_name_1.VersionsByNameStrategy('pnpmOverrides', 'pnpm.overrides'));
|
|
31
|
+
}
|
|
32
|
+
if (useDefaults || enabledTypeNames.includes('prod')) {
|
|
33
|
+
enabledTypes.push(new versions_by_name_1.VersionsByNameStrategy('prod', 'dependencies'));
|
|
34
|
+
}
|
|
35
|
+
if (useDefaults || enabledTypeNames.includes('resolutions')) {
|
|
36
|
+
enabledTypes.push(new versions_by_name_1.VersionsByNameStrategy('resolutions', 'resolutions'));
|
|
37
|
+
}
|
|
38
|
+
if (useDefaults || enabledTypeNames.includes('workspace')) {
|
|
39
|
+
enabledTypes.push(new name_and_version_props_1.NameAndVersionPropsStrategy('workspace', 'version', 'name'));
|
|
40
|
+
}
|
|
41
|
+
(0, get_custom_types_1.getCustomTypes)({ cli, rcFile }).forEach((customType) => {
|
|
42
|
+
if (useDefaults || enabledTypeNames.includes(customType.name)) {
|
|
43
|
+
enabledTypes.push(customType);
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
return enabledTypes;
|
|
47
|
+
}
|
|
48
|
+
exports.getEnabledTypes = getEnabledTypes;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getFilter = void 0;
|
|
4
|
+
const is_non_empty_string_1 = require("tightrope/guard/is-non-empty-string");
|
|
5
|
+
function getFilter({ cli, rcFile }) {
|
|
6
|
+
// @TODO Deprecate `filter` in .syncpackrc
|
|
7
|
+
return (0, is_non_empty_string_1.isNonEmptyString)(cli.filter)
|
|
8
|
+
? cli.filter
|
|
9
|
+
: (0, is_non_empty_string_1.isNonEmptyString)(rcFile.filter)
|
|
10
|
+
? rcFile.filter
|
|
11
|
+
: '.';
|
|
12
|
+
}
|
|
13
|
+
exports.getFilter = getFilter;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getIndent = void 0;
|
|
4
|
+
const is_non_empty_string_1 = require("tightrope/guard/is-non-empty-string");
|
|
5
|
+
function getIndent({ cli, rcFile }) {
|
|
6
|
+
return (0, is_non_empty_string_1.isNonEmptyString)(cli.indent)
|
|
7
|
+
? cli.indent
|
|
8
|
+
: (0, is_non_empty_string_1.isNonEmptyString)(rcFile.indent)
|
|
9
|
+
? rcFile.indent
|
|
10
|
+
: ' ';
|
|
11
|
+
}
|
|
12
|
+
exports.getIndent = getIndent;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getSemverRange = void 0;
|
|
4
|
+
const is_semver_1 = require("../lib/is-semver");
|
|
5
|
+
function getSemverRange({ cli, rcFile, }) {
|
|
6
|
+
return (0, is_semver_1.isValidSemverRange)(cli.semverRange)
|
|
7
|
+
? cli.semverRange
|
|
8
|
+
: (0, is_semver_1.isValidSemverRange)(rcFile.semverRange)
|
|
9
|
+
? rcFile.semverRange
|
|
10
|
+
: '';
|
|
11
|
+
}
|
|
12
|
+
exports.getSemverRange = getSemverRange;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getSortAz = void 0;
|
|
4
|
+
const is_array_of_strings_1 = require("tightrope/guard/is-array-of-strings");
|
|
5
|
+
function getSortAz({ rcFile }) {
|
|
6
|
+
return (0, is_array_of_strings_1.isArrayOfStrings)(rcFile.sortAz)
|
|
7
|
+
? rcFile.sortAz
|
|
8
|
+
: [
|
|
9
|
+
'contributors',
|
|
10
|
+
'dependencies',
|
|
11
|
+
'devDependencies',
|
|
12
|
+
'keywords',
|
|
13
|
+
'peerDependencies',
|
|
14
|
+
'resolutions',
|
|
15
|
+
'scripts',
|
|
16
|
+
];
|
|
17
|
+
}
|
|
18
|
+
exports.getSortAz = getSortAz;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getSortFirst = void 0;
|
|
4
|
+
const is_array_of_strings_1 = require("tightrope/guard/is-array-of-strings");
|
|
5
|
+
function getSortFirst({ rcFile }) {
|
|
6
|
+
return (0, is_array_of_strings_1.isArrayOfStrings)(rcFile.sortFirst)
|
|
7
|
+
? rcFile.sortFirst
|
|
8
|
+
: ['name', 'description', 'version', 'author'];
|
|
9
|
+
}
|
|
10
|
+
exports.getSortFirst = getSortFirst;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getSource = void 0;
|
|
4
|
+
const is_array_of_strings_1 = require("tightrope/guard/is-array-of-strings");
|
|
5
|
+
const constants_1 = require("../constants");
|
|
6
|
+
function getSource({ cli, rcFile }) {
|
|
7
|
+
return (0, is_array_of_strings_1.isArrayOfStrings)(cli.source)
|
|
8
|
+
? cli.source
|
|
9
|
+
: (0, is_array_of_strings_1.isArrayOfStrings)(rcFile.source)
|
|
10
|
+
? rcFile.source
|
|
11
|
+
: [...constants_1.DEFAULT_CONFIG.source];
|
|
12
|
+
}
|
|
13
|
+
exports.getSource = getSource;
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import type { Union } from 'ts-toolbelt';
|
|
2
|
+
/**
|
|
3
|
+
* Aliases for semver range formats supported by syncpack
|
|
4
|
+
*
|
|
5
|
+
* Defaults to `""` to ensure that exact dependency versions are used
|
|
6
|
+
* instead of loose ranges, but this can be overridden in your config file
|
|
7
|
+
* or via the `--semver-range` command line option.
|
|
8
|
+
*
|
|
9
|
+
* | Supported Range | Example |
|
|
10
|
+
* | --------------- | --------: |
|
|
11
|
+
* | `"<"` | `<1.4.2` |
|
|
12
|
+
* | `"<="` | `<=1.4.2` |
|
|
13
|
+
* | `""` | `1.4.2` |
|
|
14
|
+
* | `"~"` | `~1.4.2` |
|
|
15
|
+
* | `"^"` | `^1.4.2` |
|
|
16
|
+
* | `">="` | `>=1.4.2` |
|
|
17
|
+
* | `">"` | `>1.4.2` |
|
|
18
|
+
* | `"*"` | `*` |
|
|
19
|
+
*
|
|
20
|
+
* @default ""
|
|
21
|
+
*/
|
|
22
|
+
export type SemverRange = '' | '*' | '>' | '>=' | '.x' | '<' | '<=' | '^' | '~';
|
|
23
|
+
export interface GroupConfig {
|
|
24
|
+
dependencies: string[];
|
|
25
|
+
dependencyTypes?: string[];
|
|
26
|
+
label?: string;
|
|
27
|
+
packages: string[];
|
|
28
|
+
}
|
|
29
|
+
export declare namespace SemverGroupConfig {
|
|
30
|
+
interface Ignored extends GroupConfig {
|
|
31
|
+
isIgnored: true;
|
|
32
|
+
}
|
|
33
|
+
interface WithRange extends GroupConfig {
|
|
34
|
+
range: SemverRange;
|
|
35
|
+
}
|
|
36
|
+
type Any = Union.Strict<Ignored | WithRange>;
|
|
37
|
+
}
|
|
38
|
+
export declare namespace VersionGroupConfig {
|
|
39
|
+
interface Banned extends GroupConfig {
|
|
40
|
+
isBanned: true;
|
|
41
|
+
}
|
|
42
|
+
interface Ignored extends GroupConfig {
|
|
43
|
+
isIgnored: true;
|
|
44
|
+
}
|
|
45
|
+
interface Pinned extends GroupConfig {
|
|
46
|
+
pinVersion: string;
|
|
47
|
+
}
|
|
48
|
+
interface SnappedTo extends GroupConfig {
|
|
49
|
+
snapTo: string[];
|
|
50
|
+
}
|
|
51
|
+
interface Standard extends GroupConfig {
|
|
52
|
+
preferVersion?: 'highestSemver' | 'lowestSemver';
|
|
53
|
+
}
|
|
54
|
+
type Any = Union.Strict<Standard | Banned | Ignored | Pinned | SnappedTo>;
|
|
55
|
+
}
|
|
56
|
+
declare namespace CustomTypeConfig {
|
|
57
|
+
interface NameAndVersionProps {
|
|
58
|
+
namePath: string;
|
|
59
|
+
path: string;
|
|
60
|
+
strategy: 'name~version';
|
|
61
|
+
}
|
|
62
|
+
interface NamedVersionString {
|
|
63
|
+
path: string;
|
|
64
|
+
strategy: 'name@version';
|
|
65
|
+
}
|
|
66
|
+
interface UnnamedVersionString {
|
|
67
|
+
path: string;
|
|
68
|
+
strategy: 'version';
|
|
69
|
+
}
|
|
70
|
+
interface VersionsByName {
|
|
71
|
+
path: string;
|
|
72
|
+
strategy: 'versionsByName';
|
|
73
|
+
}
|
|
74
|
+
type Any = Union.Strict<NameAndVersionProps | NamedVersionString | UnnamedVersionString | VersionsByName>;
|
|
75
|
+
}
|
|
76
|
+
export interface CliConfig {
|
|
77
|
+
configPath?: string;
|
|
78
|
+
filter: string;
|
|
79
|
+
indent: string;
|
|
80
|
+
semverRange: SemverRange;
|
|
81
|
+
source: string[];
|
|
82
|
+
types: string;
|
|
83
|
+
}
|
|
84
|
+
export interface RcConfig {
|
|
85
|
+
/** @see https://jamiemason.github.io/syncpack/config/custom-types */
|
|
86
|
+
customTypes: Record<string, CustomTypeConfig.Any>;
|
|
87
|
+
/** @see https://jamiemason.github.io/syncpack/config/dependency-types */
|
|
88
|
+
dependencyTypes: string[];
|
|
89
|
+
/** @see https://jamiemason.github.io/syncpack/config/filter */
|
|
90
|
+
filter: string;
|
|
91
|
+
/** @see https://jamiemason.github.io/syncpack/config/indent */
|
|
92
|
+
indent: string;
|
|
93
|
+
/** @see https://jamiemason.github.io/syncpack/config/semver-groups */
|
|
94
|
+
semverGroups: SemverGroupConfig.Any[];
|
|
95
|
+
/** @see https://jamiemason.github.io/syncpack/config/semver-range */
|
|
96
|
+
semverRange: SemverRange;
|
|
97
|
+
/** @see https://jamiemason.github.io/syncpack/config/sort-az */
|
|
98
|
+
sortAz: string[];
|
|
99
|
+
/** @see https://jamiemason.github.io/syncpack/config/sort-first */
|
|
100
|
+
sortFirst: string[];
|
|
101
|
+
/** @see https://jamiemason.github.io/syncpack/config/source */
|
|
102
|
+
source: string[];
|
|
103
|
+
/** @see https://jamiemason.github.io/syncpack/config/version-groups */
|
|
104
|
+
versionGroups: VersionGroupConfig.Any[];
|
|
105
|
+
}
|
|
106
|
+
export {};
|
package/dist/constants.d.ts
CHANGED
|
@@ -21,6 +21,7 @@ export declare const RANGE: {
|
|
|
21
21
|
readonly LTE: "<=";
|
|
22
22
|
readonly MINOR: "^";
|
|
23
23
|
readonly PATCH: "~";
|
|
24
|
+
readonly WORKSPACE: "workspace:";
|
|
24
25
|
};
|
|
25
26
|
export declare const DEFAULT_CONFIG: {
|
|
26
27
|
readonly dependencyTypes: readonly ["dev", "overrides", "peer", "pnpmOverrides", "prod", "resolutions", "workspace"];
|
package/dist/constants.js
CHANGED
|
@@ -1,22 +1,14 @@
|
|
|
1
|
+
import type { O } from 'ts-toolbelt';
|
|
2
|
+
import type { CliConfig, RcConfig } from '../config/types';
|
|
3
|
+
import type { PackageJsonFile } from '../get-package-json-files/package-json-file';
|
|
1
4
|
import type { Disk } from '../lib/disk';
|
|
2
|
-
import type { Syncpack } from '../types';
|
|
3
|
-
import type { SemverGroup } from './get-groups/semver-group';
|
|
4
|
-
import type { VersionGroup } from './get-groups/version-group';
|
|
5
|
-
import type { PackageJsonFile } from './get-package-json-files/package-json-file';
|
|
6
5
|
export interface Context {
|
|
7
|
-
config:
|
|
6
|
+
config: {
|
|
7
|
+
cli: Partial<CliConfig>;
|
|
8
|
+
rcFile: O.Partial<RcConfig, 'deep'>;
|
|
9
|
+
};
|
|
8
10
|
disk: Disk;
|
|
9
11
|
isInvalid: boolean;
|
|
10
12
|
packageJsonFiles: PackageJsonFile[];
|
|
11
|
-
semverGroups: SemverGroup[];
|
|
12
|
-
versionGroups: VersionGroup[];
|
|
13
13
|
}
|
|
14
|
-
|
|
15
|
-
* Every command in syncpack should accept the return value of this function as
|
|
16
|
-
* its input.
|
|
17
|
-
*
|
|
18
|
-
* The aim here is to move all disk activity to a single place, so
|
|
19
|
-
* that the majority of syncpack and its tests don't have to deal with the file
|
|
20
|
-
* system and can focus solely on transformation logic.
|
|
21
|
-
*/
|
|
22
|
-
export declare function getContext(program: Partial<Syncpack.Config.Cli>, disk?: Disk): Context;
|
|
14
|
+
export declare function getContext(cli: Partial<CliConfig>, disk: Disk): Context;
|