syncpack 12.0.0 → 12.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/dist/bin-fix-mismatches/fix-mismatches.js +8 -19
- package/dist/bin-fix-mismatches/index.js +1 -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 +1 -1
- package/dist/bin-lint-semver-ranges/lint-semver-ranges.js +5 -5
- package/dist/bin-list/index.js +1 -1
- package/dist/bin-list/list.d.ts +2 -0
- package/dist/bin-list/list.js +76 -48
- package/dist/bin-list-mismatches/index.js +1 -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/prompt.js +7 -3
- package/dist/bin-set-semver-ranges/index.js +1 -1
- package/dist/config/get-custom-types.js +2 -1
- package/dist/config/types.d.ts +4 -5
- package/dist/constants.d.ts +39 -8
- package/dist/constants.js +31 -0
- 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 +1 -1
- package/dist/report.d.ts +64 -99
- package/dist/report.js +81 -16
- package/dist/schema.json +75 -74
- 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.js +4 -12
- package/dist/specifier/index.d.ts +1 -2
- package/dist/specifier/lib/parse-specifier.js +1 -1
- package/dist/specifier/workspace-protocol.js +3 -2
- package/dist/strategy/name-and-version-props.js +4 -4
- package/dist/version-group/banned.js +1 -3
- 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 +2 -2
- package/dist/version-group/same-range.js +5 -10
- package/dist/version-group/snapped-to.js +7 -17
- package/dist/version-group/standard.js +38 -49
- package/package.json +19 -13
|
@@ -27,235 +27,200 @@ function pipeline(ctx, io, errorHandlers) {
|
|
|
27
27
|
const { versionGroups } = yield* $((0, get_instances_1.getInstances)(ctx, io, errorHandlers));
|
|
28
28
|
let index = 0;
|
|
29
29
|
for (const group of versionGroups) {
|
|
30
|
-
const
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
continue;
|
|
37
|
-
}
|
|
30
|
+
const countByReportGroup = {
|
|
31
|
+
Excluded: 0,
|
|
32
|
+
Fixable: 0,
|
|
33
|
+
Unfixable: 0,
|
|
34
|
+
Valid: 0,
|
|
35
|
+
};
|
|
38
36
|
yield* $(effect_1.Effect.logInfo((0, get_group_header_1.getVersionGroupHeader)({ group, index })));
|
|
39
|
-
if (group._tag === 'Ignored') {
|
|
40
|
-
const msg = (0, chalk_1.default) `{gray ${(0, pad_start_1.padStart)(groupSize)} ${constants_1.ICON.rightArrow} ignored}`;
|
|
41
|
-
yield* $(effect_1.Effect.logInfo(msg));
|
|
42
|
-
index++;
|
|
43
|
-
continue;
|
|
44
|
-
}
|
|
45
37
|
for (const groupReport of yield* $(group.inspectAll())) {
|
|
46
38
|
for (const report of groupReport.reports) {
|
|
47
|
-
|
|
48
|
-
if (
|
|
49
|
-
validCount++;
|
|
50
|
-
}
|
|
51
|
-
else if (_tag === 'Banned') {
|
|
52
|
-
ctx.isInvalid = true;
|
|
53
|
-
yield* $(logBanned(report));
|
|
54
|
-
fixableCount++;
|
|
55
|
-
}
|
|
56
|
-
else if (_tag === 'HighestSemverMismatch') {
|
|
57
|
-
ctx.isInvalid = true;
|
|
58
|
-
yield* $(logHighestSemverMismatch(report));
|
|
59
|
-
fixableCount++;
|
|
60
|
-
}
|
|
61
|
-
else if (_tag === 'LocalPackageMismatch') {
|
|
62
|
-
ctx.isInvalid = true;
|
|
63
|
-
yield* $(logLocalPackageMismatch(report));
|
|
64
|
-
fixableCount++;
|
|
65
|
-
}
|
|
66
|
-
else if (_tag === 'LowestSemverMismatch') {
|
|
67
|
-
ctx.isInvalid = true;
|
|
68
|
-
yield* $(logLowestSemverMismatch(report));
|
|
69
|
-
fixableCount++;
|
|
70
|
-
}
|
|
71
|
-
else if (_tag === 'PinnedMismatch') {
|
|
72
|
-
ctx.isInvalid = true;
|
|
73
|
-
yield* $(logPinnedMismatch(report));
|
|
74
|
-
fixableCount++;
|
|
75
|
-
}
|
|
76
|
-
else if (_tag === 'SemverRangeMismatch') {
|
|
39
|
+
countByReportGroup[report._tagGroup]++;
|
|
40
|
+
if (report.isInvalid)
|
|
77
41
|
ctx.isInvalid = true;
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
else if (_tag === 'SnappedToMismatch') {
|
|
82
|
-
ctx.isInvalid = true;
|
|
83
|
-
yield* $(logSnappedToMismatch(report));
|
|
84
|
-
fixableCount++;
|
|
85
|
-
}
|
|
86
|
-
else if (_tag === 'MissingLocalVersion') {
|
|
87
|
-
ctx.isInvalid = true;
|
|
88
|
-
yield* $(logMissingLocalVersion(report));
|
|
89
|
-
unfixableCount++;
|
|
90
|
-
}
|
|
91
|
-
else if (_tag === 'MissingSnappedToMismatch') {
|
|
92
|
-
ctx.isInvalid = true;
|
|
93
|
-
yield* $(logMissingSnappedToMismatch(report));
|
|
94
|
-
unfixableCount++;
|
|
95
|
-
}
|
|
96
|
-
else if (_tag === 'UnsupportedMismatch') {
|
|
97
|
-
ctx.isInvalid = true;
|
|
98
|
-
yield* $(logUnsupportedMismatch(report));
|
|
99
|
-
unfixableCount++;
|
|
100
|
-
}
|
|
101
|
-
else if (_tag === 'SameRangeMismatch') {
|
|
102
|
-
ctx.isInvalid = true;
|
|
103
|
-
yield* $(logSameRangeMismatch(report));
|
|
104
|
-
unfixableCount++;
|
|
105
|
-
}
|
|
42
|
+
const logReport = onReportTag[report._tag];
|
|
43
|
+
if (logReport)
|
|
44
|
+
yield* $(logReport(report));
|
|
106
45
|
}
|
|
107
46
|
}
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
if (unfixableCount)
|
|
113
|
-
yield* $(logUnfixableSize(unfixableCount));
|
|
47
|
+
yield* $(onReportGroup.Valid(countByReportGroup.Valid));
|
|
48
|
+
yield* $(onReportGroup.Fixable(countByReportGroup.Fixable));
|
|
49
|
+
yield* $(onReportGroup.Unfixable(countByReportGroup.Unfixable));
|
|
50
|
+
yield* $(onReportGroup.Excluded(countByReportGroup.Excluded));
|
|
114
51
|
index++;
|
|
115
52
|
}
|
|
116
53
|
return ctx;
|
|
117
54
|
});
|
|
118
55
|
}
|
|
119
56
|
exports.pipeline = pipeline;
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
}
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
}
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
(0, chalk_1.default) `{red ${constants_1.ICON.cross}} ${name} {red
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
57
|
+
const onReportGroup = {
|
|
58
|
+
Excluded(amount) {
|
|
59
|
+
if (amount === 0)
|
|
60
|
+
return effect_1.Effect.unit;
|
|
61
|
+
const msg = (0, chalk_1.default) `{gray ${(0, pad_start_1.padStart)(amount)} ${constants_1.ICON.rightArrow} ignored}`;
|
|
62
|
+
return effect_1.Effect.logInfo(msg);
|
|
63
|
+
},
|
|
64
|
+
Fixable(amount) {
|
|
65
|
+
if (amount === 0)
|
|
66
|
+
return effect_1.Effect.unit;
|
|
67
|
+
const msg = (0, chalk_1.default) `${(0, pad_start_1.padStart)(amount)} {green ${constants_1.ICON.tick}} can be auto-fixed`;
|
|
68
|
+
return effect_1.Effect.logInfo(msg);
|
|
69
|
+
},
|
|
70
|
+
Unfixable(amount) {
|
|
71
|
+
if (amount === 0)
|
|
72
|
+
return effect_1.Effect.unit;
|
|
73
|
+
const msg = (0, chalk_1.default) `{red ${(0, pad_start_1.padStart)(amount)} ${constants_1.ICON.panic} can be fixed manually using} {blue syncpack prompt}`;
|
|
74
|
+
return effect_1.Effect.logInfo(msg);
|
|
75
|
+
},
|
|
76
|
+
Valid(amount) {
|
|
77
|
+
if (amount === 0)
|
|
78
|
+
return effect_1.Effect.unit;
|
|
79
|
+
const msg = (0, chalk_1.default) `${(0, pad_start_1.padStart)(amount)} {green ${constants_1.ICON.tick}} already valid`;
|
|
80
|
+
return effect_1.Effect.logInfo(msg);
|
|
81
|
+
},
|
|
82
|
+
};
|
|
83
|
+
const onReportTag = {
|
|
84
|
+
Banned(report) {
|
|
85
|
+
const _tag = report._tag;
|
|
86
|
+
const instance = report.fixable.instance;
|
|
87
|
+
const name = instance.name;
|
|
88
|
+
const jsonFile = instance.packageJsonFile.jsonFile;
|
|
89
|
+
const path = instance.strategy.path;
|
|
90
|
+
const shortPath = jsonFile.shortPath;
|
|
91
|
+
return effect_1.Effect.logInfo((0, chalk_1.default) `{red ${constants_1.ICON.cross}} ${name} {red banned} {gray ${shortPath} > ${path}} {blue [${_tag}]}`);
|
|
92
|
+
},
|
|
93
|
+
Disabled(_report) {
|
|
94
|
+
return effect_1.Effect.unit;
|
|
95
|
+
},
|
|
96
|
+
FilteredOut(_report) {
|
|
97
|
+
return effect_1.Effect.unit;
|
|
98
|
+
},
|
|
99
|
+
HighestSemverMismatch(report) {
|
|
100
|
+
const _tag = report._tag;
|
|
101
|
+
const fixable = report.fixable;
|
|
102
|
+
const instance = fixable.instance;
|
|
103
|
+
const jsonFile = instance.packageJsonFile.jsonFile;
|
|
104
|
+
const actual = instance.rawSpecifier;
|
|
105
|
+
const expected = fixable.raw;
|
|
106
|
+
const name = instance.name;
|
|
107
|
+
const path = instance.strategy.path;
|
|
108
|
+
const shortPath = jsonFile.shortPath;
|
|
109
|
+
return effect_1.Effect.logInfo((0, chalk_1.default) `{red ${constants_1.ICON.cross}} ${name} {red ${actual}} {dim ${constants_1.ICON.rightArrow}} {green ${expected}} {gray ${shortPath} > ${path}} {blue [${_tag}]}`);
|
|
110
|
+
},
|
|
111
|
+
Ignored(_report) {
|
|
112
|
+
return effect_1.Effect.unit;
|
|
113
|
+
},
|
|
114
|
+
LocalPackageMismatch(report) {
|
|
115
|
+
const _tag = report._tag;
|
|
116
|
+
const fixable = report.fixable;
|
|
117
|
+
const instance = fixable.instance;
|
|
118
|
+
const actual = instance.rawSpecifier;
|
|
119
|
+
const expected = fixable.raw;
|
|
120
|
+
const name = instance.name;
|
|
121
|
+
const path = instance.strategy.path;
|
|
122
|
+
const shortPath = instance.packageJsonFile.jsonFile.shortPath;
|
|
123
|
+
return effect_1.Effect.logInfo((0, chalk_1.default) `{red ${constants_1.ICON.cross}} ${name} {red ${actual}} {dim ${constants_1.ICON.rightArrow}} {green ${expected}} {gray ${shortPath} > ${path}} {blue [${_tag}]}`);
|
|
124
|
+
},
|
|
125
|
+
LowestSemverMismatch(report) {
|
|
126
|
+
const _tag = report._tag;
|
|
127
|
+
const fixable = report.fixable;
|
|
128
|
+
const instance = fixable.instance;
|
|
129
|
+
const actual = instance.rawSpecifier;
|
|
130
|
+
const expected = fixable.raw;
|
|
131
|
+
const name = instance.name;
|
|
132
|
+
const path = instance.strategy.path;
|
|
133
|
+
const shortPath = instance.packageJsonFile.jsonFile.shortPath;
|
|
134
|
+
return effect_1.Effect.logInfo((0, chalk_1.default) `{red ${constants_1.ICON.cross}} ${name} {red ${actual}} {dim ${constants_1.ICON.rightArrow}} {green ${expected}} {gray ${shortPath} > ${path}} {blue [${_tag}]}`);
|
|
135
|
+
},
|
|
136
|
+
MissingLocalVersion(report) {
|
|
137
|
+
const instance = report.unfixable;
|
|
138
|
+
const localPath = report.localInstance.packageJsonFile.jsonFile.shortPath;
|
|
139
|
+
const jsonFile = instance.packageJsonFile.jsonFile;
|
|
140
|
+
const actual = instance.rawSpecifier;
|
|
141
|
+
const name = instance.name;
|
|
142
|
+
const path = instance.strategy.path;
|
|
143
|
+
const shortPath = jsonFile.shortPath;
|
|
144
|
+
return effect_1.Effect.logInfo([
|
|
145
|
+
(0, chalk_1.default) `{red ${constants_1.ICON.cross}} ${name} {red ${actual}} {dim ${constants_1.ICON.rightArrow}} {red ???} {gray ${shortPath} > ${path}} {blue [MissingLocalVersion]}`,
|
|
146
|
+
(0, chalk_1.default) ` {red ${localPath} does not have a .version property which is exact semver}`,
|
|
147
|
+
].join(os_1.EOL));
|
|
148
|
+
},
|
|
149
|
+
MissingSnappedToMismatch(report) {
|
|
150
|
+
const instance = report.unfixable;
|
|
151
|
+
const jsonFile = instance.packageJsonFile.jsonFile;
|
|
152
|
+
const actual = instance.rawSpecifier;
|
|
153
|
+
const name = instance.name;
|
|
154
|
+
const path = instance.strategy.path;
|
|
155
|
+
const shortPath = jsonFile.shortPath;
|
|
156
|
+
return effect_1.Effect.logInfo([
|
|
157
|
+
(0, chalk_1.default) `{red ${constants_1.ICON.cross}} ${name} {red ${actual}} {dim ${constants_1.ICON.rightArrow}} {red ???} {gray ${shortPath} > ${path}} {blue [MissingSnappedToMismatch]}`,
|
|
158
|
+
(0, chalk_1.default) ` {red no package in this groups .snapTo array depend on ${name}}`,
|
|
159
|
+
].join(os_1.EOL));
|
|
160
|
+
},
|
|
161
|
+
PinnedMismatch(report) {
|
|
162
|
+
const _tag = report._tag;
|
|
163
|
+
const fixable = report.fixable;
|
|
164
|
+
const instance = fixable.instance;
|
|
165
|
+
const actual = instance.rawSpecifier;
|
|
166
|
+
const expected = fixable.raw;
|
|
167
|
+
const name = instance.name;
|
|
168
|
+
const path = instance.strategy.path;
|
|
169
|
+
const shortPath = instance.packageJsonFile.jsonFile.shortPath;
|
|
170
|
+
return effect_1.Effect.logInfo((0, chalk_1.default) `{red ${constants_1.ICON.cross}} ${name} {red ${actual}} {dim ${constants_1.ICON.rightArrow}} {green ${expected}} {gray ${shortPath} > ${path}} {blue [${_tag}]}`);
|
|
171
|
+
},
|
|
172
|
+
SameRangeMismatch(report) {
|
|
173
|
+
const instance = report.unfixable;
|
|
174
|
+
const jsonFile = instance.packageJsonFile.jsonFile;
|
|
175
|
+
const actual = instance.rawSpecifier;
|
|
176
|
+
const name = instance.name;
|
|
177
|
+
const path = instance.strategy.path;
|
|
178
|
+
const shortPath = jsonFile.shortPath;
|
|
179
|
+
const mismatches = report.mismatches;
|
|
180
|
+
return effect_1.Effect.logInfo([
|
|
181
|
+
(0, chalk_1.default) `{red ${constants_1.ICON.cross}} ${name} {red range ${actual} does not include ${mismatches.join(', ')}} {gray ${shortPath} > ${path}} {blue [SameRangeMismatch]}`,
|
|
182
|
+
(0, chalk_1.default) ` {gray use {blue syncpack prompt} to fix this manually}`,
|
|
183
|
+
].join(os_1.EOL));
|
|
184
|
+
},
|
|
185
|
+
SemverRangeMismatch(report) {
|
|
186
|
+
const _tag = report._tag;
|
|
187
|
+
const fixable = report.fixable;
|
|
188
|
+
const instance = fixable.instance;
|
|
189
|
+
const actual = instance.rawSpecifier;
|
|
190
|
+
const expected = fixable.raw;
|
|
191
|
+
const name = instance.name;
|
|
192
|
+
const path = instance.strategy.path;
|
|
193
|
+
const shortPath = instance.packageJsonFile.jsonFile.shortPath;
|
|
194
|
+
return effect_1.Effect.logInfo((0, chalk_1.default) `{red ${constants_1.ICON.cross}} ${name} {red ${actual}} {dim ${constants_1.ICON.rightArrow}} {green ${expected}} {gray ${shortPath} > ${path}} {blue [${_tag}]}`);
|
|
195
|
+
},
|
|
196
|
+
SnappedToMismatch(report) {
|
|
197
|
+
const _tag = report._tag;
|
|
198
|
+
const fixable = report.fixable;
|
|
199
|
+
const instance = fixable.instance;
|
|
200
|
+
const actual = instance.rawSpecifier;
|
|
201
|
+
const expected = fixable.raw;
|
|
202
|
+
const name = instance.name;
|
|
203
|
+
const path = instance.strategy.path;
|
|
204
|
+
const shortPath = instance.packageJsonFile.jsonFile.shortPath;
|
|
205
|
+
return effect_1.Effect.logInfo((0, chalk_1.default) `{red ${constants_1.ICON.cross}} ${name} {red ${actual}} {dim ${constants_1.ICON.rightArrow}} {green ${expected}} {gray ${shortPath} > ${path}} {blue [${_tag}]}`);
|
|
206
|
+
},
|
|
207
|
+
UnsupportedMismatch(report) {
|
|
208
|
+
const instance = report.unfixable;
|
|
209
|
+
const jsonFile = instance.packageJsonFile.jsonFile;
|
|
210
|
+
const actual = instance.rawSpecifier;
|
|
211
|
+
const name = instance.name;
|
|
212
|
+
const path = instance.strategy.path;
|
|
213
|
+
const shortPath = jsonFile.shortPath;
|
|
214
|
+
return effect_1.Effect.logInfo([
|
|
215
|
+
(0, chalk_1.default) `{red ${constants_1.ICON.cross}} ${name} {red ${actual}} {dim ${constants_1.ICON.rightArrow}} {red ???} {gray ${shortPath} > ${path}} {blue [UnsupportedMismatch]}`,
|
|
216
|
+
(0, chalk_1.default) ` {red use {blue syncpack prompt} to fix this manually}`,
|
|
217
|
+
].join(os_1.EOL));
|
|
218
|
+
},
|
|
219
|
+
Valid(_report) {
|
|
220
|
+
return effect_1.Effect.unit;
|
|
221
|
+
},
|
|
222
|
+
};
|
|
223
|
+
exports.logMissingLocalVersion = onReportTag.MissingLocalVersion;
|
|
224
|
+
exports.logMissingSnappedToMismatch = onReportTag.MissingSnappedToMismatch;
|
|
225
|
+
exports.logUnsupportedMismatch = onReportTag.UnsupportedMismatch;
|
|
226
|
+
exports.logSameRangeMismatch = onReportTag.SameRangeMismatch;
|
|
@@ -67,9 +67,13 @@ function isUnfixable(report) {
|
|
|
67
67
|
}
|
|
68
68
|
function askForNextVersion(groupReport, unfixable) {
|
|
69
69
|
return (0, effect_1.pipe)(effect_1.Effect.gen(function* ($) {
|
|
70
|
-
const choices = (0, uniq_1.uniq)(groupReport.reports.map((
|
|
71
|
-
|
|
72
|
-
|
|
70
|
+
const choices = (0, uniq_1.uniq)(groupReport.reports.map((report) => report._tagGroup === 'Fixable'
|
|
71
|
+
? report.fixable.raw
|
|
72
|
+
: report._tagGroup === 'Unfixable'
|
|
73
|
+
? report.unfixable.rawSpecifier
|
|
74
|
+
: report._tagGroup === 'Valid'
|
|
75
|
+
? report.specifier.raw
|
|
76
|
+
: null)).filter(is_string_1.isString);
|
|
73
77
|
const OTHER = chalk_1.default.dim('Other');
|
|
74
78
|
const SKIP = chalk_1.default.dim('Skip');
|
|
75
79
|
const QUIT = chalk_1.default.dim('Quit');
|
|
@@ -60,7 +60,7 @@ commander_1.program
|
|
|
60
60
|
.option(...option_1.option.types)
|
|
61
61
|
.option(...option_1.option.indent)
|
|
62
62
|
.parse(process.argv);
|
|
63
|
-
effect_1.Effect.
|
|
63
|
+
effect_1.Effect.runPromise((0, set_semver_ranges_1.setSemverRanges)({
|
|
64
64
|
io: io_1.io,
|
|
65
65
|
cli: {
|
|
66
66
|
configPath: commander_1.program.opts().config,
|
|
@@ -5,6 +5,7 @@ const effect_1 = require("effect");
|
|
|
5
5
|
const is_non_empty_object_1 = require("tightrope/guard/is-non-empty-object");
|
|
6
6
|
const is_non_empty_string_1 = require("tightrope/guard/is-non-empty-string");
|
|
7
7
|
const is_object_1 = require("tightrope/guard/is-object");
|
|
8
|
+
const constants_1 = require("../constants");
|
|
8
9
|
const name_and_version_props_1 = require("../strategy/name-and-version-props");
|
|
9
10
|
const named_version_string_1 = require("../strategy/named-version-string");
|
|
10
11
|
const unnamed_version_string_1 = require("../strategy/unnamed-version-string");
|
|
@@ -15,7 +16,7 @@ exports.InvalidCustomTypeError = InvalidCustomTypeError;
|
|
|
15
16
|
function getCustomTypes({ rcFile, }) {
|
|
16
17
|
if (!(0, is_non_empty_object_1.isNonEmptyObject)(rcFile.customTypes))
|
|
17
18
|
return effect_1.Effect.succeed([]);
|
|
18
|
-
return effect_1.Effect.all(Object.entries(rcFile.customTypes).map(([name, config]) => {
|
|
19
|
+
return effect_1.Effect.all([...Object.entries(rcFile.customTypes), ...Object.entries(constants_1.DEFAULT_CONFIG.customTypes)].map(([name, config]) => {
|
|
19
20
|
const ERR_OBJ = 'Invalid customType';
|
|
20
21
|
const ERR_PATH = 'Invalid customType.path';
|
|
21
22
|
const ERR_NAME_PATH = 'Invalid customType.namePath';
|
package/dist/config/types.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import type { Union } from 'ts-toolbelt';
|
|
2
1
|
/**
|
|
3
2
|
* Aliases for semver range formats supported by syncpack
|
|
4
3
|
*
|
|
@@ -18,7 +17,7 @@ import type { Union } from 'ts-toolbelt';
|
|
|
18
17
|
*
|
|
19
18
|
* @default ""
|
|
20
19
|
*/
|
|
21
|
-
export type SemverRange = '' | '*' | '>' | '>=' | '.x' | '<' | '<=' | '^' | '~';
|
|
20
|
+
export type SemverRange = '' | '*' | '>' | '>=' | '.x' | '<' | '<=' | '^' | '~' | 'workspace:';
|
|
22
21
|
export interface GroupConfig {
|
|
23
22
|
dependencies?: string[];
|
|
24
23
|
dependencyTypes?: string[];
|
|
@@ -35,7 +34,7 @@ export declare namespace SemverGroupConfig {
|
|
|
35
34
|
interface WithRange extends GroupConfig {
|
|
36
35
|
range: SemverRange;
|
|
37
36
|
}
|
|
38
|
-
type Any =
|
|
37
|
+
type Any = Disabled | Ignored | WithRange;
|
|
39
38
|
}
|
|
40
39
|
export declare namespace VersionGroupConfig {
|
|
41
40
|
interface Banned extends GroupConfig {
|
|
@@ -59,7 +58,7 @@ export declare namespace VersionGroupConfig {
|
|
|
59
58
|
interface Standard extends GroupConfig {
|
|
60
59
|
preferVersion?: 'highestSemver' | 'lowestSemver';
|
|
61
60
|
}
|
|
62
|
-
type Any =
|
|
61
|
+
type Any = Banned | Ignored | Pinned | SameRange | SnappedTo | Standard;
|
|
63
62
|
}
|
|
64
63
|
declare namespace CustomTypeConfig {
|
|
65
64
|
interface NameAndVersionProps {
|
|
@@ -79,7 +78,7 @@ declare namespace CustomTypeConfig {
|
|
|
79
78
|
path: string;
|
|
80
79
|
strategy: 'versionsByName';
|
|
81
80
|
}
|
|
82
|
-
type Any =
|
|
81
|
+
type Any = NameAndVersionProps | NamedVersionString | UnnamedVersionString | VersionsByName;
|
|
83
82
|
}
|
|
84
83
|
export interface CliConfig {
|
|
85
84
|
readonly configPath?: string;
|
package/dist/constants.d.ts
CHANGED
|
@@ -25,12 +25,43 @@ export declare const RANGE: {
|
|
|
25
25
|
};
|
|
26
26
|
export declare const INTERNAL_TYPES: readonly ["dev", "local", "overrides", "peer", "pnpmOverrides", "prod", "resolutions"];
|
|
27
27
|
export declare const DEFAULT_CONFIG: {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
28
|
+
customTypes: {
|
|
29
|
+
dev: {
|
|
30
|
+
strategy: "versionsByName";
|
|
31
|
+
path: string;
|
|
32
|
+
};
|
|
33
|
+
local: {
|
|
34
|
+
strategy: "name~version";
|
|
35
|
+
namePath: string;
|
|
36
|
+
path: string;
|
|
37
|
+
};
|
|
38
|
+
overrides: {
|
|
39
|
+
strategy: "versionsByName";
|
|
40
|
+
path: string;
|
|
41
|
+
};
|
|
42
|
+
peer: {
|
|
43
|
+
strategy: "versionsByName";
|
|
44
|
+
path: string;
|
|
45
|
+
};
|
|
46
|
+
pnpmOverrides: {
|
|
47
|
+
strategy: "versionsByName";
|
|
48
|
+
path: string;
|
|
49
|
+
};
|
|
50
|
+
prod: {
|
|
51
|
+
strategy: "versionsByName";
|
|
52
|
+
path: string;
|
|
53
|
+
};
|
|
54
|
+
resolutions: {
|
|
55
|
+
strategy: "versionsByName";
|
|
56
|
+
path: string;
|
|
57
|
+
};
|
|
58
|
+
};
|
|
59
|
+
dependencyTypes: string[];
|
|
60
|
+
filter: string;
|
|
61
|
+
indent: string;
|
|
62
|
+
semverGroups: never[];
|
|
63
|
+
sortAz: string[];
|
|
64
|
+
sortFirst: string[];
|
|
65
|
+
source: string[];
|
|
66
|
+
versionGroups: never[];
|
|
36
67
|
};
|
package/dist/constants.js
CHANGED
|
@@ -36,6 +36,37 @@ exports.INTERNAL_TYPES = [
|
|
|
36
36
|
'resolutions',
|
|
37
37
|
];
|
|
38
38
|
exports.DEFAULT_CONFIG = {
|
|
39
|
+
customTypes: {
|
|
40
|
+
dev: {
|
|
41
|
+
strategy: 'versionsByName',
|
|
42
|
+
path: 'devDependencies',
|
|
43
|
+
},
|
|
44
|
+
local: {
|
|
45
|
+
strategy: 'name~version',
|
|
46
|
+
namePath: 'name',
|
|
47
|
+
path: 'version',
|
|
48
|
+
},
|
|
49
|
+
overrides: {
|
|
50
|
+
strategy: 'versionsByName',
|
|
51
|
+
path: 'overrides',
|
|
52
|
+
},
|
|
53
|
+
peer: {
|
|
54
|
+
strategy: 'versionsByName',
|
|
55
|
+
path: 'peerDependencies',
|
|
56
|
+
},
|
|
57
|
+
pnpmOverrides: {
|
|
58
|
+
strategy: 'versionsByName',
|
|
59
|
+
path: 'pnpm.overrides',
|
|
60
|
+
},
|
|
61
|
+
prod: {
|
|
62
|
+
strategy: 'versionsByName',
|
|
63
|
+
path: 'dependencies',
|
|
64
|
+
},
|
|
65
|
+
resolutions: {
|
|
66
|
+
strategy: 'versionsByName',
|
|
67
|
+
path: 'resolutions',
|
|
68
|
+
},
|
|
69
|
+
},
|
|
39
70
|
dependencyTypes: ['**'],
|
|
40
71
|
filter: '.',
|
|
41
72
|
indent: ' ',
|
package/dist/io/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
|
-
import {
|
|
2
|
+
import { cosmiconfig } from 'cosmiconfig';
|
|
3
3
|
import { Context } from 'effect';
|
|
4
4
|
import { prompt } from 'enquirer';
|
|
5
5
|
import * as fs from 'fs';
|
|
@@ -7,7 +7,7 @@ import * as globby from 'globby';
|
|
|
7
7
|
import * as readYamlFile from 'read-yaml-file';
|
|
8
8
|
export interface Io {
|
|
9
9
|
cosmiconfig: {
|
|
10
|
-
|
|
10
|
+
cosmiconfig: typeof cosmiconfig;
|
|
11
11
|
};
|
|
12
12
|
enquirer: {
|
|
13
13
|
prompt: typeof prompt<any>;
|
package/dist/io/index.js
CHANGED
|
@@ -33,7 +33,7 @@ const readYamlFile = __importStar(require("read-yaml-file"));
|
|
|
33
33
|
exports.IoTag = effect_1.Context.Tag();
|
|
34
34
|
exports.io = {
|
|
35
35
|
cosmiconfig: {
|
|
36
|
-
|
|
36
|
+
cosmiconfig: cosmiconfig_1.cosmiconfig,
|
|
37
37
|
},
|
|
38
38
|
enquirer: {
|
|
39
39
|
prompt: enquirer_1.prompt,
|