syncpack 12.0.1 → 12.2.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 +5 -5
- package/dist/bin-fix-mismatches/fix-mismatches.js +8 -19
- package/dist/bin-fix-mismatches/index.js +3 -1
- package/dist/bin-format/index.js +1 -1
- package/dist/bin-lint/index.js +1 -1
- package/dist/bin-lint-semver-ranges/index.js +3 -1
- package/dist/bin-lint-semver-ranges/lint-semver-ranges.js +7 -7
- package/dist/bin-list/index.js +3 -1
- package/dist/bin-list/list.d.ts +2 -0
- package/dist/bin-list/list.js +78 -50
- package/dist/bin-list-mismatches/index.js +3 -1
- package/dist/bin-list-mismatches/list-mismatches.d.ts +4 -5
- package/dist/bin-list-mismatches/list-mismatches.js +185 -220
- package/dist/bin-prompt/index.js +2 -0
- package/dist/bin-prompt/prompt.js +7 -3
- package/dist/bin-set-semver-ranges/index.js +3 -1
- package/dist/bin-update/effects.js +6 -6
- package/dist/bin-update/index.js +2 -0
- package/dist/bin-update/update.js +3 -3
- package/dist/config/get-custom-types.js +2 -1
- package/dist/config/types.d.ts +15 -7
- package/dist/constants.d.ts +71 -8
- package/dist/constants.js +34 -1
- package/dist/get-instances/instance.d.ts +2 -1
- package/dist/get-instances/instance.js +4 -3
- package/dist/guards/can-add-to-group.js +14 -7
- package/dist/io/index.d.ts +2 -2
- package/dist/io/index.js +1 -1
- package/dist/io/read-config-file-sync.js +1 -1
- package/dist/option.d.ts +2 -1
- package/dist/option.js +4 -0
- package/dist/report.d.ts +64 -99
- package/dist/report.js +81 -16
- package/dist/schema.json +202 -77
- package/dist/semver-group/create-semver-groups.js +6 -0
- package/dist/semver-group/disabled.js +1 -3
- package/dist/semver-group/filtered-out.js +1 -3
- package/dist/semver-group/ignored.js +1 -3
- package/dist/semver-group/index.d.ts +1 -2
- package/dist/semver-group/with-range.d.ts +1 -1
- package/dist/semver-group/with-range.js +7 -15
- package/dist/specifier/alias.d.ts +2 -0
- package/dist/specifier/alias.js +3 -1
- package/dist/specifier/base.d.ts +4 -2
- package/dist/specifier/base.js +3 -1
- package/dist/specifier/delete.d.ts +4 -2
- package/dist/specifier/delete.js +3 -1
- package/dist/specifier/{version.d.ts → exact.d.ts} +3 -1
- package/dist/specifier/{version.js → exact.js} +6 -4
- package/dist/specifier/file.d.ts +2 -0
- package/dist/specifier/file.js +3 -1
- package/dist/specifier/hosted-git.d.ts +2 -0
- package/dist/specifier/hosted-git.js +3 -1
- package/dist/specifier/index.d.ts +5 -4
- package/dist/specifier/index.js +7 -3
- package/dist/specifier/latest.d.ts +19 -0
- package/dist/specifier/latest.js +24 -0
- package/dist/specifier/lib/parse-specifier.js +1 -1
- package/dist/specifier/range.d.ts +2 -1
- package/dist/specifier/range.js +3 -2
- package/dist/specifier/tag.d.ts +2 -0
- package/dist/specifier/tag.js +3 -1
- package/dist/specifier/unsupported.d.ts +2 -0
- package/dist/specifier/unsupported.js +3 -1
- package/dist/specifier/url.d.ts +2 -0
- package/dist/specifier/url.js +3 -1
- package/dist/specifier/workspace-protocol.d.ts +2 -0
- package/dist/specifier/workspace-protocol.js +6 -3
- package/dist/strategy/name-and-version-props.js +4 -4
- package/dist/version-group/banned.js +1 -3
- package/dist/version-group/create-version-groups.js +11 -0
- package/dist/version-group/filtered-out.js +1 -1
- package/dist/version-group/ignored.js +1 -1
- package/dist/version-group/index.d.ts +1 -2
- package/dist/version-group/pinned.js +3 -3
- package/dist/version-group/same-range.js +9 -14
- package/dist/version-group/snapped-to.js +12 -22
- package/dist/version-group/standard.js +44 -55
- package/package.json +7 -7
package/README.md
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
# syncpack
|
|
2
2
|
|
|
3
|
-
>
|
|
3
|
+
<center>
|
|
4
|
+
<img src="https://jamiemason.github.io/syncpack/logo.svg" width="200" height="179" alt="" />
|
|
5
|
+
<div>Consistent dependency versions in large JavaScript Monorepos.</div>
|
|
6
|
+
<div><a href="https://jamiemason.github.io/syncpack">https://jamiemason.github.io/syncpack</a></div>
|
|
7
|
+
</center>
|
|
4
8
|
|
|
5
9
|
## Installation
|
|
6
10
|
|
|
@@ -8,10 +12,6 @@
|
|
|
8
12
|
npm install --save-dev syncpack
|
|
9
13
|
```
|
|
10
14
|
|
|
11
|
-
## Documentation
|
|
12
|
-
|
|
13
|
-
Full information can be found in the documentation at https://jamiemason.github.io/syncpack/.
|
|
14
|
-
|
|
15
15
|
## Commands
|
|
16
16
|
|
|
17
17
|
### [fix-mismatches](https://jamiemason.github.io/syncpack/command/fix-mismatches)
|
|
@@ -43,38 +43,27 @@ function fixMismatches({ io, cli, errorHandlers = default_error_handlers_1.defau
|
|
|
43
43
|
}
|
|
44
44
|
for (const groupReport of yield* $(group.inspectAll())) {
|
|
45
45
|
for (const report of groupReport.reports) {
|
|
46
|
-
|
|
47
|
-
if (_tag === 'Valid') {
|
|
46
|
+
if (report._tagGroup === 'Valid') {
|
|
48
47
|
validCount++;
|
|
49
48
|
}
|
|
50
|
-
else if (
|
|
51
|
-
_tag === 'HighestSemverMismatch' ||
|
|
52
|
-
_tag === 'LocalPackageMismatch' ||
|
|
53
|
-
_tag === 'LowestSemverMismatch' ||
|
|
54
|
-
_tag === 'PinnedMismatch' ||
|
|
55
|
-
_tag === 'SemverRangeMismatch' ||
|
|
56
|
-
_tag === 'SnappedToMismatch') {
|
|
49
|
+
else if (report._tagGroup === 'Fixable') {
|
|
57
50
|
fixedCount++;
|
|
58
51
|
yield* $(fixMismatch(report));
|
|
59
52
|
}
|
|
60
|
-
else if (
|
|
53
|
+
else if (report._tagGroup === 'Unfixable') {
|
|
61
54
|
ctx.isInvalid = true;
|
|
62
55
|
unfixableCount++;
|
|
56
|
+
}
|
|
57
|
+
if (report._tag === 'MissingLocalVersion') {
|
|
63
58
|
yield* $((0, list_mismatches_1.logMissingLocalVersion)(report));
|
|
64
59
|
}
|
|
65
|
-
else if (_tag === 'MissingSnappedToMismatch') {
|
|
66
|
-
ctx.isInvalid = true;
|
|
67
|
-
unfixableCount++;
|
|
60
|
+
else if (report._tag === 'MissingSnappedToMismatch') {
|
|
68
61
|
yield* $((0, list_mismatches_1.logMissingSnappedToMismatch)(report));
|
|
69
62
|
}
|
|
70
|
-
else if (_tag === 'UnsupportedMismatch') {
|
|
71
|
-
ctx.isInvalid = true;
|
|
72
|
-
unfixableCount++;
|
|
63
|
+
else if (report._tag === 'UnsupportedMismatch') {
|
|
73
64
|
yield* $((0, list_mismatches_1.logUnsupportedMismatch)(report));
|
|
74
65
|
}
|
|
75
|
-
else if (_tag === 'SameRangeMismatch') {
|
|
76
|
-
ctx.isInvalid = true;
|
|
77
|
-
unfixableCount++;
|
|
66
|
+
else if (report._tag === 'SameRangeMismatch') {
|
|
78
67
|
yield* $((0, list_mismatches_1.logSameRangeMismatch)(report));
|
|
79
68
|
}
|
|
80
69
|
}
|
|
@@ -51,17 +51,19 @@ Reference:
|
|
|
51
51
|
commander_1.program
|
|
52
52
|
.option(...option_1.option.source)
|
|
53
53
|
.option(...option_1.option.filter)
|
|
54
|
+
.option(...option_1.option.specs)
|
|
54
55
|
.option(...option_1.option.types)
|
|
55
56
|
.option(...option_1.option.config)
|
|
56
57
|
.option(...option_1.option.indent)
|
|
57
58
|
.parse(process.argv);
|
|
58
|
-
effect_1.Effect.
|
|
59
|
+
effect_1.Effect.runPromise((0, fix_mismatches_1.fixMismatches)({
|
|
59
60
|
io: io_1.io,
|
|
60
61
|
cli: {
|
|
61
62
|
configPath: commander_1.program.opts().config,
|
|
62
63
|
filter: commander_1.program.opts().filter,
|
|
63
64
|
indent: commander_1.program.opts().indent,
|
|
64
65
|
source: commander_1.program.opts().source,
|
|
66
|
+
specs: commander_1.program.opts().specs,
|
|
65
67
|
types: commander_1.program.opts().types,
|
|
66
68
|
},
|
|
67
69
|
}));
|
package/dist/bin-format/index.js
CHANGED
|
@@ -48,7 +48,7 @@ commander_1.program
|
|
|
48
48
|
.option(...option_1.option.config)
|
|
49
49
|
.option(...option_1.option.indent)
|
|
50
50
|
.parse(process.argv);
|
|
51
|
-
effect_1.Effect.
|
|
51
|
+
effect_1.Effect.runPromise((0, format_1.format)({
|
|
52
52
|
io: io_1.io,
|
|
53
53
|
cli: {
|
|
54
54
|
configPath: commander_1.program.opts().config,
|
package/dist/bin-lint/index.js
CHANGED
|
@@ -35,7 +35,7 @@ Reference:
|
|
|
35
35
|
});
|
|
36
36
|
(0, show_help_on_error_1.showHelpOnError)(commander_1.program);
|
|
37
37
|
commander_1.program.option(...option_1.option.config).parse(process.argv);
|
|
38
|
-
effect_1.Effect.
|
|
38
|
+
effect_1.Effect.runPromise((0, lint_1.lint)({
|
|
39
39
|
io: io_1.io,
|
|
40
40
|
cli: {
|
|
41
41
|
configPath: commander_1.program.opts().config,
|
|
@@ -55,14 +55,16 @@ commander_1.program
|
|
|
55
55
|
.option(...option_1.option.source)
|
|
56
56
|
.option(...option_1.option.filter)
|
|
57
57
|
.option(...option_1.option.config)
|
|
58
|
+
.option(...option_1.option.specs)
|
|
58
59
|
.option(...option_1.option.types)
|
|
59
60
|
.parse(process.argv);
|
|
60
|
-
effect_1.Effect.
|
|
61
|
+
effect_1.Effect.runPromise((0, lint_semver_ranges_1.lintSemverRanges)({
|
|
61
62
|
io: io_1.io,
|
|
62
63
|
cli: {
|
|
63
64
|
configPath: commander_1.program.opts().config,
|
|
64
65
|
filter: commander_1.program.opts().filter,
|
|
65
66
|
source: commander_1.program.opts().source,
|
|
67
|
+
specs: commander_1.program.opts().specs,
|
|
66
68
|
types: commander_1.program.opts().types,
|
|
67
69
|
},
|
|
68
70
|
}));
|
|
@@ -43,17 +43,17 @@ function pipeline(ctx, io, errorHandlers) {
|
|
|
43
43
|
yield* $(effect_1.Effect.logInfo((0, get_group_header_1.getSemverGroupHeader)({ group, index })));
|
|
44
44
|
for (const instance of group.instances) {
|
|
45
45
|
const report = yield* $(group.inspect(instance));
|
|
46
|
+
if (report._tag === 'Valid') {
|
|
47
|
+
validCount++;
|
|
48
|
+
continue;
|
|
49
|
+
}
|
|
50
|
+
ctx.isInvalid = true;
|
|
46
51
|
if (report._tag === 'SemverRangeMismatch') {
|
|
47
|
-
ctx.isInvalid = true;
|
|
48
52
|
yield* $(logSemverRangeMismatch(report));
|
|
49
53
|
}
|
|
50
54
|
else if (report._tag === 'UnsupportedMismatch') {
|
|
51
|
-
ctx.isInvalid = true;
|
|
52
55
|
yield* $(logUnsupportedMismatch(report));
|
|
53
56
|
}
|
|
54
|
-
else {
|
|
55
|
-
validCount++;
|
|
56
|
-
}
|
|
57
57
|
}
|
|
58
58
|
}
|
|
59
59
|
if (validCount > 0)
|
|
@@ -84,7 +84,7 @@ function logSemverRangeMismatch(report) {
|
|
|
84
84
|
const _tag = report._tag;
|
|
85
85
|
const instance = report.fixable.instance;
|
|
86
86
|
const name = instance.name;
|
|
87
|
-
const actual = instance.rawSpecifier;
|
|
87
|
+
const actual = instance.rawSpecifier.raw;
|
|
88
88
|
const expected = report.fixable.raw;
|
|
89
89
|
const propPath = instance.strategy.path;
|
|
90
90
|
const filePath = instance.packageJsonFile.jsonFile.shortPath;
|
|
@@ -94,7 +94,7 @@ function logUnsupportedMismatch(report) {
|
|
|
94
94
|
const _tag = report._tag;
|
|
95
95
|
const instance = report.unfixable;
|
|
96
96
|
const name = instance.name;
|
|
97
|
-
const actual = instance.rawSpecifier;
|
|
97
|
+
const actual = instance.rawSpecifier.raw;
|
|
98
98
|
const propPath = instance.strategy.path;
|
|
99
99
|
const filePath = instance.packageJsonFile.jsonFile.shortPath;
|
|
100
100
|
return effect_1.Effect.logInfo((0, chalk_1.default) `{red ${constants_1.ICON.cross} name {white ${name}} or version {white ${actual}} are not supported} {gray ${filePath} > ${propPath}} {blue [${_tag}]}`);
|
package/dist/bin-list/index.js
CHANGED
|
@@ -47,14 +47,16 @@ commander_1.program
|
|
|
47
47
|
.option(...option_1.option.source)
|
|
48
48
|
.option(...option_1.option.filter)
|
|
49
49
|
.option(...option_1.option.config)
|
|
50
|
+
.option(...option_1.option.specs)
|
|
50
51
|
.option(...option_1.option.types)
|
|
51
52
|
.parse(process.argv);
|
|
52
|
-
effect_1.Effect.
|
|
53
|
+
effect_1.Effect.runPromise((0, list_1.list)({
|
|
53
54
|
io: io_1.io,
|
|
54
55
|
cli: {
|
|
55
56
|
configPath: commander_1.program.opts().config,
|
|
56
57
|
filter: commander_1.program.opts().filter,
|
|
57
58
|
source: commander_1.program.opts().source,
|
|
59
|
+
specs: commander_1.program.opts().specs,
|
|
58
60
|
types: commander_1.program.opts().types,
|
|
59
61
|
},
|
|
60
62
|
}));
|
package/dist/bin-list/list.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Effect } from 'effect';
|
|
2
2
|
import { type CliConfig } from '../config/types';
|
|
3
3
|
import type { ErrorHandlers } from '../error-handlers/default-error-handlers';
|
|
4
|
+
import type { Ctx } from '../get-context';
|
|
4
5
|
import type { Io } from '../io';
|
|
5
6
|
interface Input {
|
|
6
7
|
io: Io;
|
|
@@ -8,5 +9,6 @@ interface Input {
|
|
|
8
9
|
errorHandlers?: ErrorHandlers;
|
|
9
10
|
}
|
|
10
11
|
export declare function list({ io, cli, errorHandlers }: Input): Effect.Effect<never, never, unknown>;
|
|
12
|
+
export declare function pipeline(ctx: Ctx, io: Io, errorHandlers: ErrorHandlers): Effect.Effect<never, never, Ctx>;
|
|
11
13
|
export declare function logOtherCommands(): Effect.Effect<never, never, void>;
|
|
12
14
|
export {};
|
package/dist/bin-list/list.js
CHANGED
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.logOtherCommands = exports.list = void 0;
|
|
6
|
+
exports.logOtherCommands = exports.pipeline = exports.list = void 0;
|
|
7
7
|
const chalk_1 = __importDefault(require("chalk"));
|
|
8
8
|
const effect_1 = require("effect");
|
|
9
9
|
const os_1 = require("os");
|
|
@@ -18,32 +18,19 @@ const get_group_header_1 = require("../lib/get-group-header");
|
|
|
18
18
|
const pad_start_1 = require("../lib/pad-start");
|
|
19
19
|
const with_logger_1 = require("../lib/with-logger");
|
|
20
20
|
function list({ io, cli, errorHandlers = default_error_handlers_1.defaultErrorHandlers }) {
|
|
21
|
-
return (0, effect_1.pipe)((0, get_context_1.getContext)({ io, cli, errorHandlers }), effect_1.Effect.flatMap((ctx) => effect_1.Effect.
|
|
21
|
+
return (0, effect_1.pipe)((0, get_context_1.getContext)({ io, cli, errorHandlers }), effect_1.Effect.flatMap((ctx) => pipeline(ctx, io, errorHandlers)), effect_1.Effect.flatMap(exit_if_invalid_1.exitIfInvalid), effect_1.Effect.provide((0, effect_1.pipe)(effect_1.Context.empty(), effect_1.Context.add(tag_1.CliConfigTag, cli), effect_1.Context.add(io_1.IoTag, io))), with_logger_1.withLogger);
|
|
22
|
+
}
|
|
23
|
+
exports.list = list;
|
|
24
|
+
function pipeline(ctx, io, errorHandlers) {
|
|
25
|
+
return effect_1.Effect.gen(function* ($) {
|
|
22
26
|
const { versionGroups } = yield* $((0, get_instances_1.getInstances)(ctx, io, errorHandlers));
|
|
23
27
|
let index = 0;
|
|
24
28
|
for (const group of versionGroups) {
|
|
25
|
-
const groupSize = group.instances.length;
|
|
26
|
-
if (group._tag === 'FilteredOut') {
|
|
27
|
-
index++;
|
|
28
|
-
continue;
|
|
29
|
-
}
|
|
30
29
|
yield* $(effect_1.Effect.logInfo((0, get_group_header_1.getVersionGroupHeader)({ group, index })));
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
index++;
|
|
36
|
-
continue;
|
|
37
|
-
}
|
|
38
|
-
if (group._tag === 'Banned') {
|
|
39
|
-
for (const groupReport of yield* $(group.inspectAll())) {
|
|
40
|
-
const name = groupReport.name;
|
|
41
|
-
const usages = `${(0, pad_start_1.padStart)(groupReport.reports.length)}x`;
|
|
42
|
-
const invalidLabel = (0, chalk_1.default) `{gray ${usages}} {red ${name}}{gray :}`;
|
|
43
|
-
const msg = (0, chalk_1.default) `${invalidLabel} {red banned}`;
|
|
44
|
-
yield* $(effect_1.Effect.logInfo(msg));
|
|
45
|
-
}
|
|
46
|
-
ctx.isInvalid = true;
|
|
30
|
+
yield* $(onGroupTag[group._tag](group));
|
|
31
|
+
if (group._tag === 'Banned' || group._tag === 'FilteredOut' || group._tag === 'Ignored') {
|
|
32
|
+
if (group._tag === 'Banned')
|
|
33
|
+
ctx.isInvalid = true;
|
|
47
34
|
index++;
|
|
48
35
|
continue;
|
|
49
36
|
}
|
|
@@ -51,28 +38,22 @@ function list({ io, cli, errorHandlers = default_error_handlers_1.defaultErrorHa
|
|
|
51
38
|
const matches = new Set();
|
|
52
39
|
const mismatches = new Set();
|
|
53
40
|
for (const report of groupReport.reports) {
|
|
54
|
-
|
|
55
|
-
if (_tag === 'Valid') {
|
|
56
|
-
const actual = report.specifier.raw;
|
|
57
|
-
matches.add(report.specifier._tag === 'UnsupportedSpecifier'
|
|
58
|
-
? (0, chalk_1.default) `{gray ${actual}} {blue [UnsupportedMismatch]}`
|
|
59
|
-
: (0, chalk_1.default) `{gray ${actual}}`);
|
|
60
|
-
}
|
|
61
|
-
else if (_tag === 'HighestSemverMismatch' ||
|
|
62
|
-
_tag === 'LocalPackageMismatch' ||
|
|
63
|
-
_tag === 'LowestSemverMismatch' ||
|
|
64
|
-
_tag === 'PinnedMismatch' ||
|
|
65
|
-
_tag === 'SemverRangeMismatch' ||
|
|
66
|
-
_tag === 'SnappedToMismatch') {
|
|
67
|
-
mismatches.add(getLogForFixable(report));
|
|
68
|
-
ctx.isInvalid = true;
|
|
69
|
-
}
|
|
70
|
-
else if (_tag === 'MissingLocalVersion' ||
|
|
71
|
-
_tag === 'MissingSnappedToMismatch' ||
|
|
72
|
-
_tag === 'UnsupportedMismatch' ||
|
|
73
|
-
_tag === 'SameRangeMismatch') {
|
|
74
|
-
mismatches.add(getLogForUnfixable(report));
|
|
41
|
+
if (report.isInvalid)
|
|
75
42
|
ctx.isInvalid = true;
|
|
43
|
+
switch (report._tagGroup) {
|
|
44
|
+
case 'Valid': {
|
|
45
|
+
const actual = report.specifier.raw;
|
|
46
|
+
matches.add((0, chalk_1.default) `{gray ${actual}}`);
|
|
47
|
+
break;
|
|
48
|
+
}
|
|
49
|
+
case 'Fixable': {
|
|
50
|
+
mismatches.add(getLogForFixable(report));
|
|
51
|
+
break;
|
|
52
|
+
}
|
|
53
|
+
case 'Unfixable': {
|
|
54
|
+
mismatches.add(getLogForUnfixable(report));
|
|
55
|
+
break;
|
|
56
|
+
}
|
|
76
57
|
}
|
|
77
58
|
}
|
|
78
59
|
if (mismatches.size === 0) {
|
|
@@ -86,9 +67,56 @@ function list({ io, cli, errorHandlers = default_error_handlers_1.defaultErrorHa
|
|
|
86
67
|
}
|
|
87
68
|
yield* $(logOtherCommands());
|
|
88
69
|
return ctx;
|
|
89
|
-
})
|
|
70
|
+
});
|
|
90
71
|
}
|
|
91
|
-
exports.
|
|
72
|
+
exports.pipeline = pipeline;
|
|
73
|
+
const onGroupTag = {
|
|
74
|
+
Banned(group) {
|
|
75
|
+
return effect_1.Effect.gen(function* ($) {
|
|
76
|
+
for (const groupReport of yield* $(group.inspectAll())) {
|
|
77
|
+
const name = groupReport.name;
|
|
78
|
+
const usages = `${(0, pad_start_1.padStart)(groupReport.reports.length)}x`;
|
|
79
|
+
const invalidLabel = (0, chalk_1.default) `{gray ${usages}} {red ${name}}`;
|
|
80
|
+
const msg = (0, chalk_1.default) `${invalidLabel} {gray [Banned]}`;
|
|
81
|
+
yield* $(effect_1.Effect.logInfo(msg));
|
|
82
|
+
}
|
|
83
|
+
});
|
|
84
|
+
},
|
|
85
|
+
FilteredOut(group) {
|
|
86
|
+
return effect_1.Effect.gen(function* ($) {
|
|
87
|
+
for (const groupReport of yield* $(group.inspectAll())) {
|
|
88
|
+
const name = groupReport.name;
|
|
89
|
+
const usages = `${(0, pad_start_1.padStart)(groupReport.reports.length)}x`;
|
|
90
|
+
const invalidLabel = (0, chalk_1.default) `{gray ${usages}} {gray ${name}}`;
|
|
91
|
+
const msg = (0, chalk_1.default) `${invalidLabel} {gray [FilteredOut]}`;
|
|
92
|
+
yield* $(effect_1.Effect.logInfo(msg));
|
|
93
|
+
}
|
|
94
|
+
});
|
|
95
|
+
},
|
|
96
|
+
Ignored(group) {
|
|
97
|
+
return effect_1.Effect.gen(function* ($) {
|
|
98
|
+
for (const groupReport of yield* $(group.inspectAll())) {
|
|
99
|
+
const name = groupReport.name;
|
|
100
|
+
const usages = `${(0, pad_start_1.padStart)(groupReport.reports.length)}x`;
|
|
101
|
+
const invalidLabel = (0, chalk_1.default) `{gray ${usages}} {gray ${name}}`;
|
|
102
|
+
const msg = (0, chalk_1.default) `${invalidLabel} {gray [Ignored]}`;
|
|
103
|
+
yield* $(effect_1.Effect.logInfo(msg));
|
|
104
|
+
}
|
|
105
|
+
});
|
|
106
|
+
},
|
|
107
|
+
Pinned(_group) {
|
|
108
|
+
return effect_1.Effect.unit;
|
|
109
|
+
},
|
|
110
|
+
SameRange(_group) {
|
|
111
|
+
return effect_1.Effect.unit;
|
|
112
|
+
},
|
|
113
|
+
SnappedTo(_group) {
|
|
114
|
+
return effect_1.Effect.unit;
|
|
115
|
+
},
|
|
116
|
+
Standard(_group) {
|
|
117
|
+
return effect_1.Effect.unit;
|
|
118
|
+
},
|
|
119
|
+
};
|
|
92
120
|
function logMatchingReport(groupReport, messages) {
|
|
93
121
|
const name = groupReport.name;
|
|
94
122
|
const usages = `${(0, pad_start_1.padStart)(groupReport.reports.length)}x`;
|
|
@@ -104,14 +132,14 @@ function logMismatchingReport(groupReport, messages) {
|
|
|
104
132
|
}
|
|
105
133
|
function getLogForFixable(report) {
|
|
106
134
|
const _tag = report._tag;
|
|
107
|
-
const actual = report.fixable.instance.rawSpecifier;
|
|
135
|
+
const actual = report.fixable.instance.rawSpecifier.raw;
|
|
108
136
|
const expected = report.fixable.raw;
|
|
109
|
-
return (0, chalk_1.default) `{red ${actual}} {gray ${constants_1.ICON.rightArrow}} {green ${expected}} {
|
|
137
|
+
return (0, chalk_1.default) `{red ${actual}} {gray ${constants_1.ICON.rightArrow}} {green ${expected}} {gray [${_tag}]}`;
|
|
110
138
|
}
|
|
111
139
|
function getLogForUnfixable(report) {
|
|
112
140
|
const _tag = report._tag;
|
|
113
|
-
const actual = report.unfixable.rawSpecifier;
|
|
114
|
-
return (0, chalk_1.default) `{red ${actual}} {gray ${constants_1.ICON.rightArrow}} {
|
|
141
|
+
const actual = report.unfixable.rawSpecifier.raw;
|
|
142
|
+
return (0, chalk_1.default) `{red ${actual}} {gray ${constants_1.ICON.rightArrow}} {gray [${_tag}]}`;
|
|
115
143
|
}
|
|
116
144
|
function logOtherCommands() {
|
|
117
145
|
return effect_1.Effect.logInfo([
|
|
@@ -49,14 +49,16 @@ commander_1.program
|
|
|
49
49
|
.option(...option_1.option.source)
|
|
50
50
|
.option(...option_1.option.filter)
|
|
51
51
|
.option(...option_1.option.config)
|
|
52
|
+
.option(...option_1.option.specs)
|
|
52
53
|
.option(...option_1.option.types)
|
|
53
54
|
.parse(process.argv);
|
|
54
|
-
effect_1.Effect.
|
|
55
|
+
effect_1.Effect.runPromise((0, list_mismatches_1.listMismatches)({
|
|
55
56
|
io: io_1.io,
|
|
56
57
|
cli: {
|
|
57
58
|
configPath: commander_1.program.opts().config,
|
|
58
59
|
filter: commander_1.program.opts().filter,
|
|
59
60
|
source: commander_1.program.opts().source,
|
|
61
|
+
specs: commander_1.program.opts().specs,
|
|
60
62
|
types: commander_1.program.opts().types,
|
|
61
63
|
},
|
|
62
64
|
}));
|
|
@@ -3,7 +3,6 @@ import { type CliConfig } from '../config/types';
|
|
|
3
3
|
import type { ErrorHandlers } from '../error-handlers/default-error-handlers';
|
|
4
4
|
import type { Ctx } from '../get-context';
|
|
5
5
|
import type { Io } from '../io';
|
|
6
|
-
import type { Report } from '../report';
|
|
7
6
|
interface Input {
|
|
8
7
|
io: Io;
|
|
9
8
|
cli: Partial<CliConfig>;
|
|
@@ -12,8 +11,8 @@ interface Input {
|
|
|
12
11
|
export declare function listMismatches({ io, cli, errorHandlers }: Input): Effect.Effect<never, never, unknown>;
|
|
13
12
|
/** Exported to be reused by `syncpack lint` */
|
|
14
13
|
export declare function pipeline(ctx: Ctx, io: Io, errorHandlers: ErrorHandlers): Effect.Effect<never, never, Ctx>;
|
|
15
|
-
export declare
|
|
16
|
-
export declare
|
|
17
|
-
export declare
|
|
18
|
-
export declare
|
|
14
|
+
export declare const logMissingLocalVersion: (report: any) => Effect.Effect<never, never, void>;
|
|
15
|
+
export declare const logMissingSnappedToMismatch: (report: any) => Effect.Effect<never, never, void>;
|
|
16
|
+
export declare const logUnsupportedMismatch: (report: any) => Effect.Effect<never, never, void>;
|
|
17
|
+
export declare const logSameRangeMismatch: (report: any) => Effect.Effect<never, never, void>;
|
|
19
18
|
export {};
|