syncpack 5.8.12 → 6.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +211 -91
- package/dist/bin-fix-mismatches/fix-mismatches.d.ts +3 -0
- package/dist/bin-fix-mismatches/fix-mismatches.js +51 -0
- package/dist/bin-fix-mismatches/get-expected-version/get-highest-version.d.ts +1 -0
- package/dist/{commands/lib → bin-fix-mismatches/get-expected-version}/get-highest-version.js +25 -28
- package/dist/bin-fix-mismatches/get-expected-version/get-pinned-version.d.ts +2 -0
- package/dist/bin-fix-mismatches/get-expected-version/get-pinned-version.js +7 -0
- package/dist/bin-fix-mismatches/get-expected-version/get-workspace-version.d.ts +6 -0
- package/dist/bin-fix-mismatches/get-expected-version/get-workspace-version.js +17 -0
- package/dist/bin-fix-mismatches/get-expected-version/index.d.ts +3 -0
- package/dist/bin-fix-mismatches/get-expected-version/index.js +15 -0
- package/dist/{bin-fix-mismatches.d.ts → bin-fix-mismatches/index.d.ts} +0 -0
- package/dist/bin-fix-mismatches/index.js +66 -0
- package/dist/bin-format/format.d.ts +3 -0
- package/dist/bin-format/format.js +44 -0
- package/dist/{bin-format.d.ts → bin-format/index.d.ts} +0 -0
- package/dist/bin-format/index.js +56 -0
- package/dist/{bin-lint-semver-ranges.d.ts → bin-lint-semver-ranges/index.d.ts} +0 -0
- package/dist/bin-lint-semver-ranges/index.js +66 -0
- package/dist/bin-lint-semver-ranges/lint-semver-ranges.d.ts +2 -0
- package/dist/bin-lint-semver-ranges/lint-semver-ranges.js +40 -0
- package/dist/bin-lint-semver-ranges/list-semver-group-mismatches.d.ts +2 -0
- package/dist/bin-lint-semver-ranges/list-semver-group-mismatches.js +12 -0
- package/dist/{bin-list.d.ts → bin-list/index.d.ts} +0 -0
- package/dist/bin-list/index.js +64 -0
- package/dist/bin-list/list-version-groups.d.ts +9 -0
- package/dist/bin-list/list-version-groups.js +46 -0
- package/dist/bin-list/list.d.ts +2 -0
- package/dist/bin-list/list.js +44 -0
- package/dist/{bin-list-mismatches.d.ts → bin-list-mismatches/index.d.ts} +0 -0
- package/dist/bin-list-mismatches/index.js +64 -0
- package/dist/bin-list-mismatches/list-mismatches.d.ts +2 -0
- package/dist/bin-list-mismatches/list-mismatches.js +44 -0
- package/dist/{bin-set-semver-ranges.d.ts → bin-set-semver-ranges/index.d.ts} +0 -0
- package/dist/bin-set-semver-ranges/index.js +68 -0
- package/dist/bin-set-semver-ranges/set-semver-ranges.d.ts +3 -0
- package/dist/bin-set-semver-ranges/set-semver-ranges.js +25 -0
- package/dist/bin.js +19 -6
- package/dist/constants.d.ts +57 -32
- package/dist/constants.js +23 -19
- package/dist/lib/collect.d.ts +1 -1
- package/dist/lib/collect.js +2 -2
- package/dist/lib/disk.d.ts +10 -0
- package/dist/lib/disk.js +32 -0
- package/dist/lib/get-input/get-config.d.ts +9 -0
- package/dist/lib/get-input/get-config.js +112 -0
- package/dist/lib/get-input/get-instances.d.ts +21 -0
- package/dist/lib/get-input/get-instances.js +135 -0
- package/dist/lib/get-input/get-wrappers/get-file-paths.d.ts +15 -0
- package/dist/lib/get-input/get-wrappers/get-file-paths.js +48 -0
- package/dist/lib/get-input/get-wrappers/get-patterns/get-lerna-patterns.d.ts +3 -0
- package/dist/lib/get-input/get-wrappers/get-patterns/get-lerna-patterns.js +36 -0
- package/dist/lib/get-input/get-wrappers/get-patterns/get-pnpm-patterns.d.ts +3 -0
- package/dist/lib/get-input/get-wrappers/get-patterns/get-pnpm-patterns.js +41 -0
- package/dist/lib/get-input/get-wrappers/get-patterns/get-yarn-patterns.d.ts +3 -0
- package/dist/lib/get-input/get-wrappers/get-patterns/get-yarn-patterns.js +42 -0
- package/dist/lib/get-input/get-wrappers/get-patterns/index.d.ts +13 -0
- package/dist/lib/get-input/get-wrappers/get-patterns/index.js +72 -0
- package/dist/lib/get-input/get-wrappers/get-patterns/props.d.ts +7 -0
- package/dist/lib/get-input/get-wrappers/get-patterns/props.js +39 -0
- package/dist/lib/get-input/get-wrappers/get-patterns/read-json-safe.d.ts +4 -0
- package/dist/lib/get-input/get-wrappers/get-patterns/read-json-safe.js +37 -0
- package/dist/lib/get-input/get-wrappers/get-patterns/read-yaml-safe.d.ts +3 -0
- package/dist/lib/get-input/get-wrappers/get-patterns/read-yaml-safe.js +30 -0
- package/dist/lib/get-input/get-wrappers/index.d.ts +34 -0
- package/dist/lib/get-input/get-wrappers/index.js +36 -0
- package/dist/lib/get-input/get-wrappers/readonly.d.ts +4 -0
- package/dist/lib/get-input/get-wrappers/readonly.js +10 -0
- package/dist/lib/get-input/get-wrappers/tap.d.ts +5 -0
- package/dist/lib/get-input/get-wrappers/tap.js +39 -0
- package/dist/lib/get-input/get-wrappers/try-catch.d.ts +5 -0
- package/dist/lib/get-input/get-wrappers/try-catch.js +13 -0
- package/dist/lib/get-input/index.d.ts +18 -0
- package/dist/lib/get-input/index.js +33 -0
- package/dist/lib/group-by.d.ts +1 -0
- package/dist/lib/group-by.js +11 -0
- package/dist/lib/is-semver.d.ts +4 -0
- package/dist/lib/is-semver.js +26 -0
- package/dist/lib/set-semver-range.d.ts +2 -0
- package/dist/lib/set-semver-range.js +19 -0
- package/dist/lib/sort-by-name.d.ts +5 -0
- package/dist/{commands/lib/installations → lib}/sort-by-name.js +2 -2
- package/dist/lib/write-if-changed.d.ts +10 -0
- package/dist/lib/write-if-changed.js +23 -0
- package/dist/option.d.ts +12 -0
- package/dist/option.js +42 -0
- package/package.json +36 -36
- package/CHANGELOG.md +0 -410
- package/dist/bin-fix-mismatches.js +0 -58
- package/dist/bin-format.js +0 -50
- package/dist/bin-lint-semver-ranges.js +0 -58
- package/dist/bin-list-mismatches.js +0 -56
- package/dist/bin-list.js +0 -56
- package/dist/bin-set-semver-ranges.js +0 -60
- package/dist/commands/fix-mismatches.d.ts +0 -6
- package/dist/commands/fix-mismatches.js +0 -58
- package/dist/commands/format.d.ts +0 -6
- package/dist/commands/format.js +0 -49
- package/dist/commands/lib/get-dependency-types.d.ts +0 -8
- package/dist/commands/lib/get-dependency-types.js +0 -14
- package/dist/commands/lib/get-highest-version.d.ts +0 -1
- package/dist/commands/lib/get-wrappers.d.ts +0 -42
- package/dist/commands/lib/get-wrappers.js +0 -46
- package/dist/commands/lib/installations/get-dependencies.d.ts +0 -19
- package/dist/commands/lib/installations/get-dependencies.js +0 -121
- package/dist/commands/lib/installations/get-grouped-mismatched-dependencies.d.ts +0 -4
- package/dist/commands/lib/installations/get-grouped-mismatched-dependencies.js +0 -133
- package/dist/commands/lib/installations/get-installations-of.d.ts +0 -4
- package/dist/commands/lib/installations/get-installations-of.js +0 -105
- package/dist/commands/lib/installations/get-installations.d.ts +0 -6
- package/dist/commands/lib/installations/get-installations.js +0 -105
- package/dist/commands/lib/installations/get-mismatched-dependencies.d.ts +0 -4
- package/dist/commands/lib/installations/get-mismatched-dependencies.js +0 -131
- package/dist/commands/lib/installations/sort-by-name.d.ts +0 -2
- package/dist/commands/lib/is-semver.d.ts +0 -4
- package/dist/commands/lib/is-semver.js +0 -23
- package/dist/commands/lib/log.d.ts +0 -2
- package/dist/commands/lib/log.js +0 -32
- package/dist/commands/lib/matches-filter.d.ts +0 -5
- package/dist/commands/lib/matches-filter.js +0 -10
- package/dist/commands/lib/set-semver-range.d.ts +0 -4
- package/dist/commands/lib/set-semver-range.js +0 -20
- package/dist/commands/lib/write-if-changed.d.ts +0 -2
- package/dist/commands/lib/write-if-changed.js +0 -26
- package/dist/commands/lint-semver-ranges.d.ts +0 -9
- package/dist/commands/lint-semver-ranges.js +0 -65
- package/dist/commands/list-mismatches.d.ts +0 -7
- package/dist/commands/list-mismatches.js +0 -39
- package/dist/commands/list.d.ts +0 -6
- package/dist/commands/list.js +0 -42
- package/dist/commands/set-semver-ranges.d.ts +0 -6
- package/dist/commands/set-semver-ranges.js +0 -50
- package/dist/lib/get-config.d.ts +0 -2
- package/dist/lib/get-config.js +0 -40
package/dist/commands/list.js
DELETED
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
3
|
-
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
4
|
-
return cooked;
|
|
5
|
-
};
|
|
6
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
7
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
8
|
-
};
|
|
9
|
-
exports.__esModule = true;
|
|
10
|
-
exports.listFromDisk = exports.list = void 0;
|
|
11
|
-
var chalk_1 = __importDefault(require("chalk"));
|
|
12
|
-
var get_wrappers_1 = require("./lib/get-wrappers");
|
|
13
|
-
var get_dependencies_1 = require("./lib/installations/get-dependencies");
|
|
14
|
-
var get_mismatched_dependencies_1 = require("./lib/installations/get-mismatched-dependencies");
|
|
15
|
-
var sort_by_name_1 = require("./lib/installations/sort-by-name");
|
|
16
|
-
var log_1 = require("./lib/log");
|
|
17
|
-
var matches_filter_1 = require("./lib/matches-filter");
|
|
18
|
-
var list = function (wrappers, options) {
|
|
19
|
-
var packages = Array.from(get_dependencies_1.getDependencies(wrappers, options)).filter(matches_filter_1.matchesFilter(options));
|
|
20
|
-
var mismatches = Array.from(get_mismatched_dependencies_1.getMismatchedDependencies(wrappers, options)).filter(matches_filter_1.matchesFilter(options));
|
|
21
|
-
packages.sort(sort_by_name_1.sortByName).forEach(function (_a) {
|
|
22
|
-
var name = _a.name, installations = _a.installations;
|
|
23
|
-
var versions = installations.map(function (_a) {
|
|
24
|
-
var version = _a.version;
|
|
25
|
-
return version;
|
|
26
|
-
});
|
|
27
|
-
var uniques = Array.from(new Set(versions));
|
|
28
|
-
var mismatch = mismatches.find(function (mismatch) { return mismatch.name === name; });
|
|
29
|
-
var hasMismatches = mismatch !== undefined;
|
|
30
|
-
var uniquesList = uniques.sort().join(', ');
|
|
31
|
-
var message = hasMismatches
|
|
32
|
-
? chalk_1["default"](templateObject_1 || (templateObject_1 = __makeTemplateObject(["{red \u2715 ", "} {dim.red ", "}"], ["{red \u2715 ", "} {dim.red ", "}"])), name, uniquesList) : chalk_1["default"](templateObject_2 || (templateObject_2 = __makeTemplateObject(["{dim -} {white ", "} {dim ", "}"], ["{dim -} {white ", "} {dim ", "}"])), name, uniquesList);
|
|
33
|
-
log_1.log(message);
|
|
34
|
-
});
|
|
35
|
-
};
|
|
36
|
-
exports.list = list;
|
|
37
|
-
var listFromDisk = function (options) {
|
|
38
|
-
var wrappers = get_wrappers_1.getWrappers(options);
|
|
39
|
-
exports.list(wrappers, options);
|
|
40
|
-
};
|
|
41
|
-
exports.listFromDisk = listFromDisk;
|
|
42
|
-
var templateObject_1, templateObject_2;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { SyncpackConfig } from '../constants';
|
|
2
|
-
import { SourceWrapper } from './lib/get-wrappers';
|
|
3
|
-
declare type Options = Pick<SyncpackConfig, 'dev' | 'filter' | 'indent' | 'peer' | 'prod' | 'semverRange' | 'source'>;
|
|
4
|
-
export declare const setSemverRanges: (wrapper: SourceWrapper, options: Options) => void;
|
|
5
|
-
export declare const setSemverRangesToDisk: (options: Options) => void;
|
|
6
|
-
export {};
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __values = (this && this.__values) || function(o) {
|
|
3
|
-
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
4
|
-
if (m) return m.call(o);
|
|
5
|
-
if (o && typeof o.length === "number") return {
|
|
6
|
-
next: function () {
|
|
7
|
-
if (o && i >= o.length) o = void 0;
|
|
8
|
-
return { value: o && o[i++], done: !o };
|
|
9
|
-
}
|
|
10
|
-
};
|
|
11
|
-
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
12
|
-
};
|
|
13
|
-
exports.__esModule = true;
|
|
14
|
-
exports.setSemverRangesToDisk = exports.setSemverRanges = void 0;
|
|
15
|
-
var get_wrappers_1 = require("./lib/get-wrappers");
|
|
16
|
-
var get_installations_1 = require("./lib/installations/get-installations");
|
|
17
|
-
var set_semver_range_1 = require("./lib/set-semver-range");
|
|
18
|
-
var write_if_changed_1 = require("./lib/write-if-changed");
|
|
19
|
-
var setSemverRanges = function (wrapper, options) {
|
|
20
|
-
var e_1, _a;
|
|
21
|
-
var installationsIterator = get_installations_1.getInstallations([wrapper], options);
|
|
22
|
-
var setSemverRange = set_semver_range_1.setSemverRange(options);
|
|
23
|
-
try {
|
|
24
|
-
for (var installationsIterator_1 = __values(installationsIterator), installationsIterator_1_1 = installationsIterator_1.next(); !installationsIterator_1_1.done; installationsIterator_1_1 = installationsIterator_1.next()) {
|
|
25
|
-
var installation = installationsIterator_1_1.value;
|
|
26
|
-
var name = installation.name, type = installation.type, version = installation.version;
|
|
27
|
-
var dependencies = installation.source.contents[type];
|
|
28
|
-
if (dependencies) {
|
|
29
|
-
dependencies[name] = setSemverRange(version);
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
34
|
-
finally {
|
|
35
|
-
try {
|
|
36
|
-
if (installationsIterator_1_1 && !installationsIterator_1_1.done && (_a = installationsIterator_1["return"])) _a.call(installationsIterator_1);
|
|
37
|
-
}
|
|
38
|
-
finally { if (e_1) throw e_1.error; }
|
|
39
|
-
}
|
|
40
|
-
};
|
|
41
|
-
exports.setSemverRanges = setSemverRanges;
|
|
42
|
-
var setSemverRangesToDisk = function (options) {
|
|
43
|
-
var indent = options.indent, source = options.source;
|
|
44
|
-
get_wrappers_1.getWrappers({ source: source }).forEach(function (wrapper) {
|
|
45
|
-
write_if_changed_1.writeIfChanged(indent, wrapper, function () {
|
|
46
|
-
exports.setSemverRanges(wrapper, options);
|
|
47
|
-
});
|
|
48
|
-
});
|
|
49
|
-
};
|
|
50
|
-
exports.setSemverRangesToDisk = setSemverRangesToDisk;
|
package/dist/lib/get-config.d.ts
DELETED
package/dist/lib/get-config.js
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
exports.__esModule = true;
|
|
3
|
-
exports.getConfig = void 0;
|
|
4
|
-
var cosmiconfig_1 = require("cosmiconfig");
|
|
5
|
-
var expect_more_1 = require("expect-more");
|
|
6
|
-
var is_semver_1 = require("../commands/lib/is-semver");
|
|
7
|
-
var constants_1 = require("../constants");
|
|
8
|
-
var getConfig = function (program) {
|
|
9
|
-
var rcSearch = cosmiconfig_1.cosmiconfigSync('syncpack').search();
|
|
10
|
-
var rcFile = expect_more_1.isObject(rcSearch) && expect_more_1.isObject(rcSearch.config) ? rcSearch.config : {};
|
|
11
|
-
var getOption = function (name, isValid) {
|
|
12
|
-
var cliOption = program[name];
|
|
13
|
-
if (isValid(cliOption)) {
|
|
14
|
-
return cliOption;
|
|
15
|
-
}
|
|
16
|
-
var configOption = rcFile[name];
|
|
17
|
-
if (isValid(configOption)) {
|
|
18
|
-
return configOption;
|
|
19
|
-
}
|
|
20
|
-
return constants_1.DEFAULT_CONFIG[name];
|
|
21
|
-
};
|
|
22
|
-
var isVersionGroup = function (value) {
|
|
23
|
-
return expect_more_1.isObject(value) && expect_more_1.isArrayOfStrings(value.packages) && expect_more_1.isArrayOfStrings(value.dependencies);
|
|
24
|
-
};
|
|
25
|
-
var isArrayOfVersionGroups = function (value) { return expect_more_1.isArray(value) && value.every(isVersionGroup); };
|
|
26
|
-
var hasTypeOverride = program.prod || program.dev || program.peer;
|
|
27
|
-
return {
|
|
28
|
-
dev: hasTypeOverride ? Boolean(program.dev) : getOption('dev', expect_more_1.isBoolean),
|
|
29
|
-
filter: getOption('filter', function (value) { return expect_more_1.isNonEmptyString(value); }),
|
|
30
|
-
indent: getOption('indent', function (value) { return expect_more_1.isNonEmptyString(value); }),
|
|
31
|
-
peer: hasTypeOverride ? Boolean(program.peer) : getOption('peer', expect_more_1.isBoolean),
|
|
32
|
-
prod: hasTypeOverride ? Boolean(program.prod) : getOption('prod', expect_more_1.isBoolean),
|
|
33
|
-
semverRange: getOption('semverRange', is_semver_1.isValidSemverRange),
|
|
34
|
-
sortAz: getOption('sortAz', expect_more_1.isArrayOfStrings),
|
|
35
|
-
sortFirst: getOption('sortFirst', expect_more_1.isArrayOfStrings),
|
|
36
|
-
source: getOption('source', expect_more_1.isArrayOfStrings),
|
|
37
|
-
versionGroups: getOption('versionGroups', isArrayOfVersionGroups)
|
|
38
|
-
};
|
|
39
|
-
};
|
|
40
|
-
exports.getConfig = getConfig;
|