syncpack 10.7.3 → 11.2.1
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/dist/bin-fix-mismatches/effects.js +9 -9
- package/dist/bin-fix-mismatches/fix-mismatches.js +2 -2
- package/dist/bin-format/format-cli.js +2 -2
- package/dist/bin-format/format.js +4 -3
- package/dist/bin-lint/lint.js +2 -2
- package/dist/bin-lint-semver-ranges/effects.js +10 -10
- package/dist/bin-lint-semver-ranges/lint-semver-ranges.js +2 -2
- package/dist/bin-list/effects.js +16 -14
- package/dist/bin-list/list.js +2 -2
- package/dist/bin-list-mismatches/effects.js +22 -22
- package/dist/bin-list-mismatches/list-mismatches.js +2 -2
- package/dist/bin-prompt/effects.js +15 -15
- package/dist/bin-prompt/prompt.js +2 -2
- package/dist/bin-set-semver-ranges/effects.js +10 -10
- package/dist/bin-set-semver-ranges/set-semver-ranges.js +2 -2
- package/dist/bin-update/effects.js +36 -30
- package/dist/bin-update/update.js +2 -2
- package/dist/config/get-enabled-types.d.ts +6 -1
- package/dist/config/get-enabled-types.js +62 -34
- package/dist/config/tag.d.ts +3 -0
- package/dist/config/tag.js +28 -0
- package/dist/config/types.d.ts +0 -2
- package/dist/config/types.js +0 -26
- package/dist/constants.d.ts +3 -4
- package/dist/constants.js +12 -13
- package/dist/create-program/effects.d.ts +4 -4
- package/dist/create-program/semver-ranges.d.ts +2 -2
- package/dist/create-program/semver-ranges.js +6 -6
- package/dist/create-program/versions.d.ts +2 -2
- package/dist/create-program/versions.js +6 -6
- package/dist/env/create-env.js +28 -7
- package/dist/env/default-env.js +14 -9
- package/dist/env/exit-if-invalid.js +1 -1
- package/dist/env/write-if-changed.js +1 -1
- package/dist/error-handlers/create-error-handlers.d.ts +2 -1
- package/dist/error-handlers/create-error-handlers.js +3 -0
- package/dist/error-handlers/default-error-handlers.js +5 -0
- package/dist/get-context/index.js +2 -2
- package/dist/get-package-json-files/get-patterns/get-lerna-patterns.js +1 -1
- package/dist/get-package-json-files/get-patterns/get-pnpm-patterns.js +1 -1
- package/dist/get-package-json-files/get-patterns/get-yarn-patterns.js +9 -6
- package/dist/get-package-json-files/get-patterns/index.js +1 -1
- package/dist/get-package-json-files/get-patterns/read-json-safe.js +5 -2
- package/dist/get-package-json-files/package-json-file.d.ts +4 -2
- package/dist/get-package-json-files/package-json-file.js +5 -4
- package/dist/get-semver-groups/filtered-out.d.ts +3 -3
- package/dist/get-semver-groups/filtered-out.js +1 -1
- package/dist/get-semver-groups/ignored.d.ts +3 -3
- package/dist/get-semver-groups/index.d.ts +18 -18
- package/dist/get-semver-groups/index.js +5 -5
- package/dist/get-semver-groups/with-range.d.ts +4 -4
- package/dist/get-semver-groups/with-range.js +9 -9
- package/dist/get-version-groups/banned.d.ts +3 -3
- package/dist/get-version-groups/filtered-out.d.ts +3 -3
- package/dist/get-version-groups/filtered-out.js +1 -1
- package/dist/get-version-groups/ignored.d.ts +3 -3
- package/dist/get-version-groups/index.d.ts +72 -24
- package/dist/get-version-groups/index.js +54 -6
- package/dist/get-version-groups/lib/{sort.js → compare-semver.js} +0 -5
- package/dist/get-version-groups/lib/get-highest-version.js +2 -2
- package/dist/get-version-groups/lib/get-lowest-version.js +2 -2
- package/dist/get-version-groups/lib/get-unique-specifiers.d.ts +2 -0
- package/dist/get-version-groups/lib/get-unique-specifiers.js +11 -0
- package/dist/get-version-groups/pinned.d.ts +3 -3
- package/dist/get-version-groups/pinned.js +1 -1
- package/dist/get-version-groups/same-range.d.ts +3 -3
- package/dist/get-version-groups/same-range.js +1 -1
- package/dist/get-version-groups/snapped-to.d.ts +3 -3
- package/dist/get-version-groups/snapped-to.js +4 -3
- package/dist/get-version-groups/standard.d.ts +4 -4
- package/dist/get-version-groups/standard.js +19 -18
- package/dist/guards/can-add-to-group.d.ts +2 -2
- package/dist/guards/can-add-to-group.js +35 -5
- package/dist/guards/is-loose-semver.d.ts +1 -0
- package/dist/guards/is-loose-semver.js +1 -0
- package/dist/guards/is-semver.d.ts +1 -0
- package/dist/guards/is-semver.js +1 -0
- package/dist/guards/is-valid-semver-range.d.ts +1 -0
- package/dist/guards/is-valid-semver-range.js +1 -0
- package/dist/instance/create.d.ts +4 -0
- package/dist/instance/create.js +142 -0
- package/dist/instance/index.d.ts +122 -0
- package/dist/instance/index.js +154 -0
- package/dist/schema.json +361 -0
- package/package.json +24 -20
- package/dist/get-package-json-files/instance.d.ts +0 -21
- package/dist/get-package-json-files/instance.js +0 -23
- package/dist/get-version-groups/lib/get-unique-versions.d.ts +0 -2
- package/dist/get-version-groups/lib/get-unique-versions.js +0 -8
- package/dist/guards/is-supported.d.ts +0 -1
- package/dist/guards/is-supported.js +0 -17
- /package/dist/get-version-groups/lib/{sort.d.ts → compare-semver.d.ts} +0 -0
|
@@ -38,13 +38,13 @@ const delete_1 = require("../get-version-groups/lib/delete");
|
|
|
38
38
|
const log_group_header_1 = require("../lib/log-group-header");
|
|
39
39
|
exports.fixMismatchesEffects = {
|
|
40
40
|
onFilteredOut() {
|
|
41
|
-
return Effect.unit
|
|
41
|
+
return Effect.unit;
|
|
42
42
|
},
|
|
43
43
|
onIgnored() {
|
|
44
|
-
return Effect.unit
|
|
44
|
+
return Effect.unit;
|
|
45
45
|
},
|
|
46
46
|
onValid() {
|
|
47
|
-
return Effect.unit
|
|
47
|
+
return Effect.unit;
|
|
48
48
|
},
|
|
49
49
|
onBanned(input) {
|
|
50
50
|
return Effect.sync(() => removeVersions(input));
|
|
@@ -64,10 +64,10 @@ exports.fixMismatchesEffects = {
|
|
|
64
64
|
onSnappedToMismatch(input) {
|
|
65
65
|
return Effect.sync(() => setVersions(input));
|
|
66
66
|
},
|
|
67
|
-
|
|
68
|
-
return Effect.sync(() => (0, Function_1.pipe)(input, logHeader,
|
|
67
|
+
onNonSemverMismatch(input) {
|
|
68
|
+
return Effect.sync(() => (0, Function_1.pipe)(input, logHeader, logNonSemverMismatch));
|
|
69
69
|
},
|
|
70
|
-
|
|
70
|
+
onLocalPackageMismatch(input) {
|
|
71
71
|
return Effect.sync(() => setVersions(input));
|
|
72
72
|
},
|
|
73
73
|
onComplete(ctx) {
|
|
@@ -82,19 +82,19 @@ function logHeader(input) {
|
|
|
82
82
|
}
|
|
83
83
|
function setVersions({ report }) {
|
|
84
84
|
report.instances.forEach((instance) => {
|
|
85
|
-
instance.
|
|
85
|
+
instance.setSpecifier(report.expectedVersion);
|
|
86
86
|
});
|
|
87
87
|
}
|
|
88
88
|
function removeVersions({ report }) {
|
|
89
89
|
report.instances.forEach((instance) => {
|
|
90
|
-
instance.
|
|
90
|
+
instance.setSpecifier(delete_1.DELETE);
|
|
91
91
|
});
|
|
92
92
|
}
|
|
93
93
|
function logSameRangeMismatch({ ctx, report }) {
|
|
94
94
|
ctx.isInvalid = true;
|
|
95
95
|
console.log((0, chalk_1.default) `{yellow %s %s} {dim has mismatched versions under the "sameRange" policy which syncpack cannot auto fix}%s`, constants_1.ICON.panic, report.name, (0, chalk_1.default) `${os_1.EOL} use {blue syncpack prompt} to fix manually`);
|
|
96
96
|
}
|
|
97
|
-
function
|
|
97
|
+
function logNonSemverMismatch({ ctx, report }) {
|
|
98
98
|
ctx.isInvalid = true;
|
|
99
99
|
console.log((0, chalk_1.default) `{yellow %s %s} {dim has mismatched unsupported versions which syncpack cannot auto fix}%s`, constants_1.ICON.panic, report.name, (0, chalk_1.default) `${os_1.EOL} use {blue syncpack prompt} to fix manually`);
|
|
100
100
|
}
|
|
@@ -27,7 +27,7 @@ exports.fixMismatches = void 0;
|
|
|
27
27
|
const Context = __importStar(require("@effect/data/Context"));
|
|
28
28
|
const Function_1 = require("@effect/data/Function");
|
|
29
29
|
const Effect = __importStar(require("@effect/io/Effect"));
|
|
30
|
-
const
|
|
30
|
+
const tag_1 = require("../config/tag");
|
|
31
31
|
const versions_1 = require("../create-program/versions");
|
|
32
32
|
const create_env_1 = require("../env/create-env");
|
|
33
33
|
const exit_if_invalid_1 = require("../env/exit-if-invalid");
|
|
@@ -38,6 +38,6 @@ const default_error_handlers_1 = require("../error-handlers/default-error-handle
|
|
|
38
38
|
const get_context_1 = require("../get-context");
|
|
39
39
|
const effects_1 = require("./effects");
|
|
40
40
|
function fixMismatches(cli, env) {
|
|
41
|
-
return (0, Function_1.pipe)((0, get_context_1.getContext)(), Effect.flatMap((ctx) => (0, versions_1.createVersionsProgram)(ctx, effects_1.fixMismatchesEffects)), Effect.flatMap(write_if_changed_1.writeIfChanged), Effect.flatMap(exit_if_invalid_1.exitIfInvalid), Effect.catchTags((0, create_error_handlers_1.createErrorHandlers)(default_error_handlers_1.defaultErrorHandlers)), Effect.provideContext((0, Function_1.pipe)(Context.empty(), Context.add(
|
|
41
|
+
return (0, Function_1.pipe)((0, get_context_1.getContext)(), Effect.flatMap((ctx) => (0, versions_1.createVersionsProgram)(ctx, effects_1.fixMismatchesEffects)), Effect.flatMap(write_if_changed_1.writeIfChanged), Effect.flatMap(exit_if_invalid_1.exitIfInvalid), Effect.catchTags((0, create_error_handlers_1.createErrorHandlers)(default_error_handlers_1.defaultErrorHandlers)), Effect.provideContext((0, Function_1.pipe)(Context.empty(), Context.add(tag_1.CliConfigTag, cli), Context.add(tags_1.EnvTag, (0, create_env_1.createEnv)(env)))));
|
|
42
42
|
}
|
|
43
43
|
exports.fixMismatches = fixMismatches;
|
|
@@ -27,7 +27,7 @@ exports.formatCli = void 0;
|
|
|
27
27
|
const Context = __importStar(require("@effect/data/Context"));
|
|
28
28
|
const Function_1 = require("@effect/data/Function");
|
|
29
29
|
const Effect = __importStar(require("@effect/io/Effect"));
|
|
30
|
-
const
|
|
30
|
+
const tag_1 = require("../config/tag");
|
|
31
31
|
const create_env_1 = require("../env/create-env");
|
|
32
32
|
const exit_if_invalid_1 = require("../env/exit-if-invalid");
|
|
33
33
|
const tags_1 = require("../env/tags");
|
|
@@ -37,6 +37,6 @@ const default_error_handlers_1 = require("../error-handlers/default-error-handle
|
|
|
37
37
|
const get_context_1 = require("../get-context");
|
|
38
38
|
const format_1 = require("./format");
|
|
39
39
|
function formatCli(cli, env) {
|
|
40
|
-
return (0, Function_1.pipe)((0, get_context_1.getContext)(), Effect.flatMap(format_1.format), Effect.flatMap(write_if_changed_1.writeIfChanged), Effect.flatMap(exit_if_invalid_1.exitIfInvalid), Effect.catchTags((0, create_error_handlers_1.createErrorHandlers)(default_error_handlers_1.defaultErrorHandlers)), Effect.provideContext((0, Function_1.pipe)(Context.empty(), Context.add(
|
|
40
|
+
return (0, Function_1.pipe)((0, get_context_1.getContext)(), Effect.flatMap(format_1.format), Effect.flatMap(write_if_changed_1.writeIfChanged), Effect.flatMap(exit_if_invalid_1.exitIfInvalid), Effect.catchTags((0, create_error_handlers_1.createErrorHandlers)(default_error_handlers_1.defaultErrorHandlers)), Effect.provideContext((0, Function_1.pipe)(Context.empty(), Context.add(tag_1.CliConfigTag, cli), Context.add(tags_1.EnvTag, (0, create_env_1.createEnv)(env)))));
|
|
41
41
|
}
|
|
42
42
|
exports.formatCli = formatCli;
|
|
@@ -35,13 +35,14 @@ function format(ctx) {
|
|
|
35
35
|
const sortAz = (0, get_sort_az_1.getSortAz)(ctx.config);
|
|
36
36
|
const sortFirst = (0, get_sort_first_1.getSortFirst)(ctx.config);
|
|
37
37
|
packageJsonFiles.forEach((packageJsonFile) => {
|
|
38
|
+
var _a, _b, _c;
|
|
38
39
|
const { contents } = packageJsonFile;
|
|
39
40
|
const sortedKeys = Object.keys(contents).sort();
|
|
40
41
|
const keys = new Set(sortFirst.concat(sortedKeys));
|
|
41
42
|
const optionalChaining = contents;
|
|
42
|
-
const bugsUrl = optionalChaining
|
|
43
|
-
const repoUrl = optionalChaining
|
|
44
|
-
const repoDir = optionalChaining
|
|
43
|
+
const bugsUrl = (_a = optionalChaining === null || optionalChaining === void 0 ? void 0 : optionalChaining.bugs) === null || _a === void 0 ? void 0 : _a.url;
|
|
44
|
+
const repoUrl = (_b = optionalChaining === null || optionalChaining === void 0 ? void 0 : optionalChaining.repository) === null || _b === void 0 ? void 0 : _b.url;
|
|
45
|
+
const repoDir = (_c = optionalChaining === null || optionalChaining === void 0 ? void 0 : optionalChaining.repository) === null || _c === void 0 ? void 0 : _c.directory;
|
|
45
46
|
if (bugsUrl) {
|
|
46
47
|
contents.bugs = bugsUrl;
|
|
47
48
|
}
|
package/dist/bin-lint/lint.js
CHANGED
|
@@ -29,7 +29,7 @@ const Function_1 = require("@effect/data/Function");
|
|
|
29
29
|
const Effect = __importStar(require("@effect/io/Effect"));
|
|
30
30
|
const effects_1 = require("../bin-lint-semver-ranges/effects");
|
|
31
31
|
const effects_2 = require("../bin-list-mismatches/effects");
|
|
32
|
-
const
|
|
32
|
+
const tag_1 = require("../config/tag");
|
|
33
33
|
const semver_ranges_1 = require("../create-program/semver-ranges");
|
|
34
34
|
const versions_1 = require("../create-program/versions");
|
|
35
35
|
const create_env_1 = require("../env/create-env");
|
|
@@ -39,6 +39,6 @@ const create_error_handlers_1 = require("../error-handlers/create-error-handlers
|
|
|
39
39
|
const default_error_handlers_1 = require("../error-handlers/default-error-handlers");
|
|
40
40
|
const get_context_1 = require("../get-context");
|
|
41
41
|
function lint(cli, env) {
|
|
42
|
-
return (0, Function_1.pipe)((0, get_context_1.getContext)(), Effect.flatMap((ctx) => (0, versions_1.createVersionsProgram)(ctx, effects_2.listMismatchesEffects)), Effect.flatMap((ctx) => (0, semver_ranges_1.createSemverRangesProgram)(ctx, effects_1.lintSemverRangesEffects)), Effect.flatMap(exit_if_invalid_1.exitIfInvalid), Effect.catchTags((0, create_error_handlers_1.createErrorHandlers)(default_error_handlers_1.defaultErrorHandlers)), Effect.provideContext((0, Function_1.pipe)(Context.empty(), Context.add(
|
|
42
|
+
return (0, Function_1.pipe)((0, get_context_1.getContext)(), Effect.flatMap((ctx) => (0, versions_1.createVersionsProgram)(ctx, effects_2.listMismatchesEffects)), Effect.flatMap((ctx) => (0, semver_ranges_1.createSemverRangesProgram)(ctx, effects_1.lintSemverRangesEffects)), Effect.flatMap(exit_if_invalid_1.exitIfInvalid), Effect.catchTags((0, create_error_handlers_1.createErrorHandlers)(default_error_handlers_1.defaultErrorHandlers)), Effect.provideContext((0, Function_1.pipe)(Context.empty(), Context.add(tag_1.CliConfigTag, cli), Context.add(tags_1.EnvTag, (0, create_env_1.createEnv)(env)))));
|
|
43
43
|
}
|
|
44
44
|
exports.lint = lint;
|
|
@@ -34,25 +34,25 @@ const constants_1 = require("../constants");
|
|
|
34
34
|
const log_group_header_1 = require("../lib/log-group-header");
|
|
35
35
|
exports.lintSemverRangesEffects = {
|
|
36
36
|
onFilteredOut() {
|
|
37
|
-
return Effect.unit
|
|
37
|
+
return Effect.unit;
|
|
38
38
|
},
|
|
39
39
|
onIgnored() {
|
|
40
|
-
return Effect.unit
|
|
40
|
+
return Effect.unit;
|
|
41
41
|
},
|
|
42
42
|
onValid() {
|
|
43
|
-
return Effect.unit
|
|
43
|
+
return Effect.unit;
|
|
44
44
|
},
|
|
45
45
|
onSemverRangeMismatch(input) {
|
|
46
46
|
return Effect.sync(() => (0, Function_1.pipe)(input, logHeader, logRangeMismatch));
|
|
47
47
|
},
|
|
48
|
-
|
|
49
|
-
return Effect.sync(() => (0, Function_1.pipe)(input, logHeader,
|
|
48
|
+
onNonSemverVersion(input) {
|
|
49
|
+
return Effect.sync(() => (0, Function_1.pipe)(input, logHeader, logNonSemverVersion));
|
|
50
50
|
},
|
|
51
|
-
|
|
51
|
+
onLocalPackageSemverRangeMismatch(input) {
|
|
52
52
|
return Effect.sync(() => (0, Function_1.pipe)(input, logHeader, logRangeMismatch));
|
|
53
53
|
},
|
|
54
54
|
onComplete() {
|
|
55
|
-
return Effect.unit
|
|
55
|
+
return Effect.unit;
|
|
56
56
|
},
|
|
57
57
|
};
|
|
58
58
|
function logHeader(input) {
|
|
@@ -63,8 +63,8 @@ function logHeader(input) {
|
|
|
63
63
|
}
|
|
64
64
|
function logRangeMismatch({ report, ctx }) {
|
|
65
65
|
ctx.isInvalid = true;
|
|
66
|
-
console.log((0, chalk_1.default) `{red %s} %s {red %s} %s {green %s} {dim in %s of %s}`, constants_1.ICON.cross, report.name, report.instance.
|
|
66
|
+
console.log((0, chalk_1.default) `{red %s} %s {red %s} %s {green %s} {dim in %s of %s}`, constants_1.ICON.cross, report.name, report.instance.specifier, constants_1.ICON.rightArrow, report.expectedVersion, report.instance.strategy.path, report.instance.packageJsonFile.shortPath);
|
|
67
67
|
}
|
|
68
|
-
function
|
|
69
|
-
console.log((0, chalk_1.default) `{yellow %s} %s {yellow %s} {dim ignored as a format which syncpack cannot apply semver ranges to}`, constants_1.ICON.panic, report.name, report.instance.
|
|
68
|
+
function logNonSemverVersion({ report }) {
|
|
69
|
+
console.log((0, chalk_1.default) `{yellow %s} %s {yellow %s} {dim ignored as a format which syncpack cannot apply semver ranges to}`, constants_1.ICON.panic, report.name, report.instance.specifier);
|
|
70
70
|
}
|
|
@@ -27,7 +27,7 @@ exports.lintSemverRanges = void 0;
|
|
|
27
27
|
const Context = __importStar(require("@effect/data/Context"));
|
|
28
28
|
const Function_1 = require("@effect/data/Function");
|
|
29
29
|
const Effect = __importStar(require("@effect/io/Effect"));
|
|
30
|
-
const
|
|
30
|
+
const tag_1 = require("../config/tag");
|
|
31
31
|
const semver_ranges_1 = require("../create-program/semver-ranges");
|
|
32
32
|
const create_env_1 = require("../env/create-env");
|
|
33
33
|
const exit_if_invalid_1 = require("../env/exit-if-invalid");
|
|
@@ -37,6 +37,6 @@ const default_error_handlers_1 = require("../error-handlers/default-error-handle
|
|
|
37
37
|
const get_context_1 = require("../get-context");
|
|
38
38
|
const effects_1 = require("./effects");
|
|
39
39
|
function lintSemverRanges(cli, env) {
|
|
40
|
-
return (0, Function_1.pipe)((0, get_context_1.getContext)(), Effect.flatMap((ctx) => (0, semver_ranges_1.createSemverRangesProgram)(ctx, effects_1.lintSemverRangesEffects)), Effect.flatMap(exit_if_invalid_1.exitIfInvalid), Effect.catchTags((0, create_error_handlers_1.createErrorHandlers)(default_error_handlers_1.defaultErrorHandlers)), Effect.provideContext((0, Function_1.pipe)(Context.empty(), Context.add(
|
|
40
|
+
return (0, Function_1.pipe)((0, get_context_1.getContext)(), Effect.flatMap((ctx) => (0, semver_ranges_1.createSemverRangesProgram)(ctx, effects_1.lintSemverRangesEffects)), Effect.flatMap(exit_if_invalid_1.exitIfInvalid), Effect.catchTags((0, create_error_handlers_1.createErrorHandlers)(default_error_handlers_1.defaultErrorHandlers)), Effect.provideContext((0, Function_1.pipe)(Context.empty(), Context.add(tag_1.CliConfigTag, cli), Context.add(tags_1.EnvTag, (0, create_env_1.createEnv)(env)))));
|
|
41
41
|
}
|
|
42
42
|
exports.lintSemverRanges = lintSemverRanges;
|
package/dist/bin-list/effects.js
CHANGED
|
@@ -32,12 +32,11 @@ const Effect = __importStar(require("@effect/io/Effect"));
|
|
|
32
32
|
const chalk_1 = __importDefault(require("chalk"));
|
|
33
33
|
const uniq_1 = require("tightrope/array/uniq");
|
|
34
34
|
const constants_1 = require("../constants");
|
|
35
|
-
const
|
|
36
|
-
const is_supported_1 = require("../guards/is-supported");
|
|
35
|
+
const get_unique_specifiers_1 = require("../get-version-groups/lib/get-unique-specifiers");
|
|
37
36
|
const log_group_header_1 = require("../lib/log-group-header");
|
|
38
37
|
exports.listEffects = {
|
|
39
38
|
onFilteredOut() {
|
|
40
|
-
return Effect.unit
|
|
39
|
+
return Effect.unit;
|
|
41
40
|
},
|
|
42
41
|
onIgnored(input) {
|
|
43
42
|
return Effect.sync(() => (0, Function_1.pipe)(input, logHeader, logIgnored));
|
|
@@ -63,14 +62,14 @@ exports.listEffects = {
|
|
|
63
62
|
onSnappedToMismatch(input) {
|
|
64
63
|
return Effect.sync(() => (0, Function_1.pipe)(input, logHeader, logFixableMismatch));
|
|
65
64
|
},
|
|
66
|
-
|
|
65
|
+
onNonSemverMismatch(input) {
|
|
67
66
|
return Effect.sync(() => (0, Function_1.pipe)(input, logHeader, logUnfixableMismatch));
|
|
68
67
|
},
|
|
69
|
-
|
|
68
|
+
onLocalPackageMismatch(input) {
|
|
70
69
|
return Effect.sync(() => (0, Function_1.pipe)(input, logHeader, logFixableMismatch));
|
|
71
70
|
},
|
|
72
71
|
onComplete() {
|
|
73
|
-
return Effect.unit
|
|
72
|
+
return Effect.unit;
|
|
74
73
|
},
|
|
75
74
|
};
|
|
76
75
|
function logHeader(input) {
|
|
@@ -81,12 +80,14 @@ function logHeader(input) {
|
|
|
81
80
|
}
|
|
82
81
|
function logFixableMismatch({ report, ctx }) {
|
|
83
82
|
ctx.isInvalid = true;
|
|
84
|
-
console.log((0, chalk_1.default) `{red %s %s} %s`, constants_1.ICON.cross, report.name,
|
|
83
|
+
console.log((0, chalk_1.default) `{red %s %s} %s`, constants_1.ICON.cross, report.name, listColouredSpecifiers(report.expectedVersion, report.instances));
|
|
85
84
|
}
|
|
86
85
|
function logUnfixableMismatch({ report, ctx, }) {
|
|
87
86
|
ctx.isInvalid = true;
|
|
88
|
-
console.log((0, chalk_1.default) `{red %s %s} %s`, constants_1.ICON.cross, report.name, (0,
|
|
89
|
-
.map((
|
|
87
|
+
console.log((0, chalk_1.default) `{red %s %s} %s`, constants_1.ICON.cross, report.name, (0, get_unique_specifiers_1.getUniqueSpecifiers)(report.instances)
|
|
88
|
+
.map((instance) => instance.getSemverSpecifier() !== null
|
|
89
|
+
? chalk_1.default.red(instance.specifier)
|
|
90
|
+
: chalk_1.default.yellow(instance.specifier))
|
|
90
91
|
.join(chalk_1.default.dim(', ')));
|
|
91
92
|
}
|
|
92
93
|
function logBanned({ report, ctx }) {
|
|
@@ -97,16 +98,17 @@ function logIgnored({ report }) {
|
|
|
97
98
|
console.log((0, chalk_1.default) `{dim -} {dim %s} {white is ignored in this version group}`, report.name);
|
|
98
99
|
}
|
|
99
100
|
function logValid({ report }) {
|
|
100
|
-
|
|
101
|
+
var _a, _b;
|
|
102
|
+
console.log((0, chalk_1.default) `{dim -} {white %s} {dim %s}`, report.name, (_b = (_a = report.instances) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.specifier);
|
|
101
103
|
}
|
|
102
|
-
function
|
|
103
|
-
return
|
|
104
|
+
function listColouredSpecifiers(pinVersion, instances) {
|
|
105
|
+
return getAllSpecifiers(pinVersion, instances)
|
|
104
106
|
.map((version) => withColour(pinVersion, version))
|
|
105
107
|
.join(chalk_1.default.dim(', '));
|
|
106
108
|
}
|
|
107
109
|
function withColour(pinVersion, version) {
|
|
108
110
|
return version === pinVersion ? chalk_1.default.green(version) : chalk_1.default.red(version);
|
|
109
111
|
}
|
|
110
|
-
function
|
|
111
|
-
return (0, uniq_1.uniq)([pinVersion].concat(instances.map((i) => i.
|
|
112
|
+
function getAllSpecifiers(pinVersion, instances) {
|
|
113
|
+
return (0, uniq_1.uniq)([pinVersion].concat(instances.map((i) => i.specifier)));
|
|
112
114
|
}
|
package/dist/bin-list/list.js
CHANGED
|
@@ -27,7 +27,7 @@ exports.list = void 0;
|
|
|
27
27
|
const Context = __importStar(require("@effect/data/Context"));
|
|
28
28
|
const Function_1 = require("@effect/data/Function");
|
|
29
29
|
const Effect = __importStar(require("@effect/io/Effect"));
|
|
30
|
-
const
|
|
30
|
+
const tag_1 = require("../config/tag");
|
|
31
31
|
const versions_1 = require("../create-program/versions");
|
|
32
32
|
const create_env_1 = require("../env/create-env");
|
|
33
33
|
const exit_if_invalid_1 = require("../env/exit-if-invalid");
|
|
@@ -37,6 +37,6 @@ const default_error_handlers_1 = require("../error-handlers/default-error-handle
|
|
|
37
37
|
const get_context_1 = require("../get-context");
|
|
38
38
|
const effects_1 = require("./effects");
|
|
39
39
|
function list(cli, env) {
|
|
40
|
-
return (0, Function_1.pipe)((0, get_context_1.getContext)(), Effect.flatMap((ctx) => (0, versions_1.createVersionsProgram)(ctx, effects_1.listEffects)), Effect.flatMap(exit_if_invalid_1.exitIfInvalid), Effect.catchTags((0, create_error_handlers_1.createErrorHandlers)(default_error_handlers_1.defaultErrorHandlers)), Effect.provideContext((0, Function_1.pipe)(Context.empty(), Context.add(
|
|
40
|
+
return (0, Function_1.pipe)((0, get_context_1.getContext)(), Effect.flatMap((ctx) => (0, versions_1.createVersionsProgram)(ctx, effects_1.listEffects)), Effect.flatMap(exit_if_invalid_1.exitIfInvalid), Effect.catchTags((0, create_error_handlers_1.createErrorHandlers)(default_error_handlers_1.defaultErrorHandlers)), Effect.provideContext((0, Function_1.pipe)(Context.empty(), Context.add(tag_1.CliConfigTag, cli), Context.add(tags_1.EnvTag, (0, create_env_1.createEnv)(env)))));
|
|
41
41
|
}
|
|
42
42
|
exports.list = list;
|
|
@@ -35,13 +35,13 @@ const constants_1 = require("../constants");
|
|
|
35
35
|
const log_group_header_1 = require("../lib/log-group-header");
|
|
36
36
|
exports.listMismatchesEffects = {
|
|
37
37
|
onFilteredOut() {
|
|
38
|
-
return Effect.unit
|
|
38
|
+
return Effect.unit;
|
|
39
39
|
},
|
|
40
40
|
onIgnored() {
|
|
41
|
-
return Effect.unit
|
|
41
|
+
return Effect.unit;
|
|
42
42
|
},
|
|
43
43
|
onValid() {
|
|
44
|
-
return Effect.unit
|
|
44
|
+
return Effect.unit;
|
|
45
45
|
},
|
|
46
46
|
onBanned(input) {
|
|
47
47
|
return Effect.sync(() => (0, Function_1.pipe)(input, logHeader, logBanned));
|
|
@@ -61,14 +61,14 @@ exports.listMismatchesEffects = {
|
|
|
61
61
|
onSnappedToMismatch(input) {
|
|
62
62
|
return Effect.sync(() => (0, Function_1.pipe)(input, logHeader, logSnappedToMismatch));
|
|
63
63
|
},
|
|
64
|
-
|
|
65
|
-
return Effect.sync(() => (0, Function_1.pipe)(input, logHeader,
|
|
64
|
+
onNonSemverMismatch(input) {
|
|
65
|
+
return Effect.sync(() => (0, Function_1.pipe)(input, logHeader, logNonSemverMismatch));
|
|
66
66
|
},
|
|
67
|
-
|
|
68
|
-
return Effect.sync(() => (0, Function_1.pipe)(input, logHeader,
|
|
67
|
+
onLocalPackageMismatch(input) {
|
|
68
|
+
return Effect.sync(() => (0, Function_1.pipe)(input, logHeader, logLocalPackageMismatch));
|
|
69
69
|
},
|
|
70
70
|
onComplete() {
|
|
71
|
-
return Effect.unit
|
|
71
|
+
return Effect.unit;
|
|
72
72
|
},
|
|
73
73
|
};
|
|
74
74
|
function logHeader(input) {
|
|
@@ -81,15 +81,15 @@ function logBanned({ report, ctx }) {
|
|
|
81
81
|
ctx.isInvalid = true;
|
|
82
82
|
console.log((0, chalk_1.default) ` {red %s} %s {dim is banned in this version group}`, constants_1.ICON.cross, report.name);
|
|
83
83
|
report.instances.forEach((instance) => {
|
|
84
|
-
console.log((0, chalk_1.default) ` {red %s} {dim in %s of %s}`, instance.
|
|
84
|
+
console.log((0, chalk_1.default) ` {red %s} {dim in %s of %s}`, instance.specifier, instance.strategy.path, instance.packageJsonFile.shortPath);
|
|
85
85
|
});
|
|
86
86
|
}
|
|
87
87
|
function logHighLowSemverMismatch({ report, ctx, }) {
|
|
88
88
|
ctx.isInvalid = true;
|
|
89
89
|
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._tag === 'LowestSemverMismatch' ? 'lowest' : 'highest');
|
|
90
90
|
report.instances.forEach((instance) => {
|
|
91
|
-
if (instance.
|
|
92
|
-
console.log((0, chalk_1.default) ` {red %s} {dim in %s of %s}`, instance.
|
|
91
|
+
if (instance.specifier !== report.expectedVersion) {
|
|
92
|
+
console.log((0, chalk_1.default) ` {red %s} {dim in %s of %s}`, instance.specifier, instance.strategy.path, instance.packageJsonFile.shortPath);
|
|
93
93
|
}
|
|
94
94
|
});
|
|
95
95
|
}
|
|
@@ -97,8 +97,8 @@ function logPinnedMismatch({ report, ctx }) {
|
|
|
97
97
|
ctx.isInvalid = true;
|
|
98
98
|
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);
|
|
99
99
|
report.instances.forEach((instance) => {
|
|
100
|
-
if (instance.
|
|
101
|
-
console.log((0, chalk_1.default) ` {red %s} {dim in %s of %s}`, instance.
|
|
100
|
+
if (instance.specifier !== report.expectedVersion) {
|
|
101
|
+
console.log((0, chalk_1.default) ` {red %s} {dim in %s of %s}`, instance.specifier, instance.strategy.path, instance.packageJsonFile.shortPath);
|
|
102
102
|
}
|
|
103
103
|
});
|
|
104
104
|
}
|
|
@@ -106,8 +106,8 @@ function logSnappedToMismatch({ report, ctx }) {
|
|
|
106
106
|
ctx.isInvalid = true;
|
|
107
107
|
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, report.snapTo.join(' || '));
|
|
108
108
|
report.instances.forEach((instance) => {
|
|
109
|
-
if (instance.
|
|
110
|
-
console.log((0, chalk_1.default) ` {red %s} {dim in %s of %s}`, instance.
|
|
109
|
+
if (instance.specifier !== report.expectedVersion) {
|
|
110
|
+
console.log((0, chalk_1.default) ` {red %s} {dim in %s of %s}`, instance.specifier, instance.strategy.path, instance.packageJsonFile.shortPath);
|
|
111
111
|
}
|
|
112
112
|
});
|
|
113
113
|
}
|
|
@@ -115,22 +115,22 @@ function logSameRangeMismatch({ report, ctx }) {
|
|
|
115
115
|
ctx.isInvalid = true;
|
|
116
116
|
console.log((0, chalk_1.default) `{yellow %s %s} {dim has mismatched versions under the "sameRange" policy which syncpack cannot auto fix}%s`, constants_1.ICON.panic, report.name, (0, chalk_1.default) `${os_1.EOL} use {blue syncpack prompt} to fix manually`);
|
|
117
117
|
report.instances.forEach((instance) => {
|
|
118
|
-
console.log((0, chalk_1.default) ` {yellow %s} {dim in %s of %s}`, instance.
|
|
118
|
+
console.log((0, chalk_1.default) ` {yellow %s} {dim in %s of %s}`, instance.specifier, instance.strategy.path, instance.packageJsonFile.shortPath);
|
|
119
119
|
});
|
|
120
120
|
}
|
|
121
|
-
function
|
|
121
|
+
function logNonSemverMismatch({ report, ctx }) {
|
|
122
122
|
ctx.isInvalid = true;
|
|
123
123
|
console.log((0, chalk_1.default) `{yellow %s %s} {dim has mismatched unsupported versions which syncpack cannot auto fix}%s`, constants_1.ICON.panic, report.name, (0, chalk_1.default) `${os_1.EOL} use {blue syncpack prompt} to fix manually`);
|
|
124
124
|
report.instances.forEach((instance) => {
|
|
125
|
-
console.log((0, chalk_1.default) ` {yellow %s} {dim in %s of %s}`, instance.
|
|
125
|
+
console.log((0, chalk_1.default) ` {yellow %s} {dim in %s of %s}`, instance.specifier, instance.strategy.path, instance.packageJsonFile.shortPath);
|
|
126
126
|
});
|
|
127
127
|
}
|
|
128
|
-
function
|
|
128
|
+
function logLocalPackageMismatch({ report, ctx }) {
|
|
129
129
|
ctx.isInvalid = true;
|
|
130
|
-
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.
|
|
130
|
+
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.localPackageInstance.packageJsonFile.shortPath);
|
|
131
131
|
report.instances.forEach((instance) => {
|
|
132
|
-
if (instance.
|
|
133
|
-
console.log((0, chalk_1.default) ` {red %s} {dim in %s of %s}`, instance.
|
|
132
|
+
if (instance.specifier !== report.expectedVersion) {
|
|
133
|
+
console.log((0, chalk_1.default) ` {red %s} {dim in %s of %s}`, instance.specifier, instance.strategy.path, instance.packageJsonFile.shortPath);
|
|
134
134
|
}
|
|
135
135
|
});
|
|
136
136
|
}
|
|
@@ -27,7 +27,7 @@ exports.listMismatches = void 0;
|
|
|
27
27
|
const Context = __importStar(require("@effect/data/Context"));
|
|
28
28
|
const Function_1 = require("@effect/data/Function");
|
|
29
29
|
const Effect = __importStar(require("@effect/io/Effect"));
|
|
30
|
-
const
|
|
30
|
+
const tag_1 = require("../config/tag");
|
|
31
31
|
const versions_1 = require("../create-program/versions");
|
|
32
32
|
const create_env_1 = require("../env/create-env");
|
|
33
33
|
const exit_if_invalid_1 = require("../env/exit-if-invalid");
|
|
@@ -37,6 +37,6 @@ const default_error_handlers_1 = require("../error-handlers/default-error-handle
|
|
|
37
37
|
const get_context_1 = require("../get-context");
|
|
38
38
|
const effects_1 = require("./effects");
|
|
39
39
|
function listMismatches(cli, env) {
|
|
40
|
-
return (0, Function_1.pipe)((0, get_context_1.getContext)(), Effect.flatMap((ctx) => (0, versions_1.createVersionsProgram)(ctx, effects_1.listMismatchesEffects)), Effect.flatMap(exit_if_invalid_1.exitIfInvalid), Effect.catchTags((0, create_error_handlers_1.createErrorHandlers)(default_error_handlers_1.defaultErrorHandlers)), Effect.provideContext((0, Function_1.pipe)(Context.empty(), Context.add(
|
|
40
|
+
return (0, Function_1.pipe)((0, get_context_1.getContext)(), Effect.flatMap((ctx) => (0, versions_1.createVersionsProgram)(ctx, effects_1.listMismatchesEffects)), Effect.flatMap(exit_if_invalid_1.exitIfInvalid), Effect.catchTags((0, create_error_handlers_1.createErrorHandlers)(default_error_handlers_1.defaultErrorHandlers)), Effect.provideContext((0, Function_1.pipe)(Context.empty(), Context.add(tag_1.CliConfigTag, cli), Context.add(tags_1.EnvTag, (0, create_env_1.createEnv)(env)))));
|
|
41
41
|
}
|
|
42
42
|
exports.listMismatches = listMismatches;
|
|
@@ -32,44 +32,44 @@ const Effect = __importStar(require("@effect/io/Effect"));
|
|
|
32
32
|
const chalk_1 = __importDefault(require("chalk"));
|
|
33
33
|
const constants_1 = require("../constants");
|
|
34
34
|
const tags_1 = require("../env/tags");
|
|
35
|
-
const
|
|
35
|
+
const get_unique_specifiers_1 = require("../get-version-groups/lib/get-unique-specifiers");
|
|
36
36
|
const log_group_header_1 = require("../lib/log-group-header");
|
|
37
37
|
exports.promptEffects = {
|
|
38
38
|
onFilteredOut() {
|
|
39
|
-
return Effect.unit
|
|
39
|
+
return Effect.unit;
|
|
40
40
|
},
|
|
41
41
|
onIgnored() {
|
|
42
|
-
return Effect.unit
|
|
42
|
+
return Effect.unit;
|
|
43
43
|
},
|
|
44
44
|
onValid() {
|
|
45
|
-
return Effect.unit
|
|
45
|
+
return Effect.unit;
|
|
46
46
|
},
|
|
47
47
|
onBanned() {
|
|
48
|
-
return Effect.unit
|
|
48
|
+
return Effect.unit;
|
|
49
49
|
},
|
|
50
50
|
onHighestSemverMismatch() {
|
|
51
|
-
return Effect.unit
|
|
51
|
+
return Effect.unit;
|
|
52
52
|
},
|
|
53
53
|
onLowestSemverMismatch() {
|
|
54
|
-
return Effect.unit
|
|
54
|
+
return Effect.unit;
|
|
55
55
|
},
|
|
56
56
|
onPinnedMismatch() {
|
|
57
|
-
return Effect.unit
|
|
57
|
+
return Effect.unit;
|
|
58
58
|
},
|
|
59
59
|
onSameRangeMismatch(input) {
|
|
60
60
|
return (0, Function_1.pipe)(Effect.sync(() => logHeader(input)), Effect.flatMap(askForNextVersion));
|
|
61
61
|
},
|
|
62
62
|
onSnappedToMismatch() {
|
|
63
|
-
return Effect.unit
|
|
63
|
+
return Effect.unit;
|
|
64
64
|
},
|
|
65
|
-
|
|
65
|
+
onNonSemverMismatch(input) {
|
|
66
66
|
return (0, Function_1.pipe)(Effect.sync(() => logHeader(input)), Effect.flatMap(askForNextVersion));
|
|
67
67
|
},
|
|
68
|
-
|
|
69
|
-
return Effect.unit
|
|
68
|
+
onLocalPackageMismatch() {
|
|
69
|
+
return Effect.unit;
|
|
70
70
|
},
|
|
71
71
|
onComplete() {
|
|
72
|
-
return Effect.unit
|
|
72
|
+
return Effect.unit;
|
|
73
73
|
},
|
|
74
74
|
};
|
|
75
75
|
function logHeader(input) {
|
|
@@ -85,7 +85,7 @@ function askForNextVersion({ report }) {
|
|
|
85
85
|
const env = yield* $(tags_1.EnvTag);
|
|
86
86
|
const choice = yield* $(env.askForChoice({
|
|
87
87
|
message: (0, chalk_1.default) `${report.name} {dim Choose a version to replace the others}`,
|
|
88
|
-
choices: [...(0,
|
|
88
|
+
choices: [...(0, get_unique_specifiers_1.getUniqueSpecifiers)(report.instances).map((i) => i.specifier), OTHER, SKIP],
|
|
89
89
|
}));
|
|
90
90
|
if (choice === SKIP)
|
|
91
91
|
return;
|
|
@@ -96,7 +96,7 @@ function askForNextVersion({ report }) {
|
|
|
96
96
|
: choice;
|
|
97
97
|
yield* $(Effect.sync(() => {
|
|
98
98
|
report.instances.forEach((instance) => {
|
|
99
|
-
instance.
|
|
99
|
+
instance.setSpecifier(nextVersion);
|
|
100
100
|
});
|
|
101
101
|
}));
|
|
102
102
|
}), Effect.catchTags({
|
|
@@ -27,7 +27,7 @@ exports.prompt = void 0;
|
|
|
27
27
|
const Context = __importStar(require("@effect/data/Context"));
|
|
28
28
|
const Function_1 = require("@effect/data/Function");
|
|
29
29
|
const Effect = __importStar(require("@effect/io/Effect"));
|
|
30
|
-
const
|
|
30
|
+
const tag_1 = require("../config/tag");
|
|
31
31
|
const versions_1 = require("../create-program/versions");
|
|
32
32
|
const create_env_1 = require("../env/create-env");
|
|
33
33
|
const tags_1 = require("../env/tags");
|
|
@@ -37,6 +37,6 @@ const default_error_handlers_1 = require("../error-handlers/default-error-handle
|
|
|
37
37
|
const get_context_1 = require("../get-context");
|
|
38
38
|
const effects_1 = require("./effects");
|
|
39
39
|
function prompt(cli, env) {
|
|
40
|
-
return (0, Function_1.pipe)((0, get_context_1.getContext)(), Effect.flatMap((ctx) => (0, versions_1.createVersionsProgram)(ctx, effects_1.promptEffects)), Effect.flatMap(write_if_changed_1.writeIfChanged), Effect.catchTags((0, create_error_handlers_1.createErrorHandlers)(default_error_handlers_1.defaultErrorHandlers)), Effect.provideContext((0, Function_1.pipe)(Context.empty(), Context.add(
|
|
40
|
+
return (0, Function_1.pipe)((0, get_context_1.getContext)(), Effect.flatMap((ctx) => (0, versions_1.createVersionsProgram)(ctx, effects_1.promptEffects)), Effect.flatMap(write_if_changed_1.writeIfChanged), Effect.catchTags((0, create_error_handlers_1.createErrorHandlers)(default_error_handlers_1.defaultErrorHandlers)), Effect.provideContext((0, Function_1.pipe)(Context.empty(), Context.add(tag_1.CliConfigTag, cli), Context.add(tags_1.EnvTag, (0, create_env_1.createEnv)(env)))));
|
|
41
41
|
}
|
|
42
42
|
exports.prompt = prompt;
|
|
@@ -32,30 +32,30 @@ const chalk_1 = __importDefault(require("chalk"));
|
|
|
32
32
|
const constants_1 = require("../constants");
|
|
33
33
|
exports.setSemverRangesEffects = {
|
|
34
34
|
onFilteredOut() {
|
|
35
|
-
return Effect.unit
|
|
35
|
+
return Effect.unit;
|
|
36
36
|
},
|
|
37
37
|
onIgnored() {
|
|
38
|
-
return Effect.unit
|
|
38
|
+
return Effect.unit;
|
|
39
39
|
},
|
|
40
40
|
onValid() {
|
|
41
|
-
return Effect.unit
|
|
41
|
+
return Effect.unit;
|
|
42
42
|
},
|
|
43
43
|
onSemverRangeMismatch(input) {
|
|
44
44
|
return Effect.sync(() => setVersions(input));
|
|
45
45
|
},
|
|
46
|
-
|
|
47
|
-
return Effect.sync(() =>
|
|
46
|
+
onNonSemverVersion(input) {
|
|
47
|
+
return Effect.sync(() => logNonSemverVersion(input));
|
|
48
48
|
},
|
|
49
|
-
|
|
49
|
+
onLocalPackageSemverRangeMismatch(input) {
|
|
50
50
|
return Effect.sync(() => setVersions(input));
|
|
51
51
|
},
|
|
52
52
|
onComplete() {
|
|
53
|
-
return Effect.unit
|
|
53
|
+
return Effect.unit;
|
|
54
54
|
},
|
|
55
55
|
};
|
|
56
56
|
function setVersions({ report }) {
|
|
57
|
-
report.instance.
|
|
57
|
+
report.instance.setSpecifier(report.expectedVersion);
|
|
58
58
|
}
|
|
59
|
-
function
|
|
60
|
-
console.log((0, chalk_1.default) `{yellow %s} %s {yellow %s} {dim ignored as a format which syncpack cannot apply semver ranges to}`, constants_1.ICON.panic, report.name, report.instance.
|
|
59
|
+
function logNonSemverVersion({ report }) {
|
|
60
|
+
console.log((0, chalk_1.default) `{yellow %s} %s {yellow %s} {dim ignored as a format which syncpack cannot apply semver ranges to}`, constants_1.ICON.panic, report.name, report.instance.specifier);
|
|
61
61
|
}
|
|
@@ -27,7 +27,7 @@ exports.setSemverRanges = void 0;
|
|
|
27
27
|
const Context = __importStar(require("@effect/data/Context"));
|
|
28
28
|
const Function_1 = require("@effect/data/Function");
|
|
29
29
|
const Effect = __importStar(require("@effect/io/Effect"));
|
|
30
|
-
const
|
|
30
|
+
const tag_1 = require("../config/tag");
|
|
31
31
|
const semver_ranges_1 = require("../create-program/semver-ranges");
|
|
32
32
|
const create_env_1 = require("../env/create-env");
|
|
33
33
|
const exit_if_invalid_1 = require("../env/exit-if-invalid");
|
|
@@ -38,6 +38,6 @@ const default_error_handlers_1 = require("../error-handlers/default-error-handle
|
|
|
38
38
|
const get_context_1 = require("../get-context");
|
|
39
39
|
const effects_1 = require("./effects");
|
|
40
40
|
function setSemverRanges(cli, env) {
|
|
41
|
-
return (0, Function_1.pipe)((0, get_context_1.getContext)(), Effect.flatMap((ctx) => (0, semver_ranges_1.createSemverRangesProgram)(ctx, effects_1.setSemverRangesEffects)), Effect.flatMap(write_if_changed_1.writeIfChanged), Effect.flatMap(exit_if_invalid_1.exitIfInvalid), Effect.catchTags((0, create_error_handlers_1.createErrorHandlers)(default_error_handlers_1.defaultErrorHandlers)), Effect.provideContext((0, Function_1.pipe)(Context.empty(), Context.add(
|
|
41
|
+
return (0, Function_1.pipe)((0, get_context_1.getContext)(), Effect.flatMap((ctx) => (0, semver_ranges_1.createSemverRangesProgram)(ctx, effects_1.setSemverRangesEffects)), Effect.flatMap(write_if_changed_1.writeIfChanged), Effect.flatMap(exit_if_invalid_1.exitIfInvalid), Effect.catchTags((0, create_error_handlers_1.createErrorHandlers)(default_error_handlers_1.defaultErrorHandlers)), Effect.provideContext((0, Function_1.pipe)(Context.empty(), Context.add(tag_1.CliConfigTag, cli), Context.add(tags_1.EnvTag, (0, create_env_1.createEnv)(env)))));
|
|
42
42
|
}
|
|
43
43
|
exports.setSemverRanges = setSemverRanges;
|