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
|
@@ -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.raw;
|
|
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.raw;
|
|
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.raw;
|
|
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.raw;
|
|
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.raw;
|
|
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.raw;
|
|
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.raw;
|
|
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.raw;
|
|
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.raw;
|
|
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.raw;
|
|
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;
|
package/dist/bin-prompt/index.js
CHANGED
|
@@ -49,6 +49,7 @@ 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
|
.option(...option_1.option.indent)
|
|
54
55
|
.parse(process.argv);
|
|
@@ -58,6 +59,7 @@ effect_1.Effect.runPromise((0, prompt_1.prompt)({
|
|
|
58
59
|
configPath: commander_1.program.opts().config,
|
|
59
60
|
filter: commander_1.program.opts().filter,
|
|
60
61
|
source: commander_1.program.opts().source,
|
|
62
|
+
specs: commander_1.program.opts().specs,
|
|
61
63
|
types: commander_1.program.opts().types,
|
|
62
64
|
indent: commander_1.program.opts().indent,
|
|
63
65
|
},
|
|
@@ -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');
|
|
@@ -57,16 +57,18 @@ commander_1.program
|
|
|
57
57
|
.option(...option_1.option.source)
|
|
58
58
|
.option(...option_1.option.filter)
|
|
59
59
|
.option(...option_1.option.config)
|
|
60
|
+
.option(...option_1.option.specs)
|
|
60
61
|
.option(...option_1.option.types)
|
|
61
62
|
.option(...option_1.option.indent)
|
|
62
63
|
.parse(process.argv);
|
|
63
|
-
effect_1.Effect.
|
|
64
|
+
effect_1.Effect.runPromise((0, set_semver_ranges_1.setSemverRanges)({
|
|
64
65
|
io: io_1.io,
|
|
65
66
|
cli: {
|
|
66
67
|
configPath: commander_1.program.opts().config,
|
|
67
68
|
filter: commander_1.program.opts().filter,
|
|
68
69
|
indent: commander_1.program.opts().indent,
|
|
69
70
|
source: commander_1.program.opts().source,
|
|
71
|
+
specs: commander_1.program.opts().specs,
|
|
70
72
|
types: commander_1.program.opts().types,
|
|
71
73
|
},
|
|
72
74
|
}));
|
|
@@ -98,9 +98,9 @@ exports.updateEffects = {
|
|
|
98
98
|
inFlight.delete(format(instance));
|
|
99
99
|
const latest = versions?.latest;
|
|
100
100
|
if (latest) {
|
|
101
|
-
if ((0, gtr_1.default)(latest, instance.rawSpecifier, true)) {
|
|
101
|
+
if ((0, gtr_1.default)(latest, String(instance.rawSpecifier.raw), true)) {
|
|
102
102
|
outdatedCount++;
|
|
103
|
-
mostRecent.push((0, chalk_1.default) `${instance.name} {gray {red ${instance.rawSpecifier}} ${constants_1.ICON.rightArrow}} {green ${latest}}`);
|
|
103
|
+
mostRecent.push((0, chalk_1.default) `${instance.name} {gray {red ${instance.rawSpecifier.raw}} ${constants_1.ICON.rightArrow}} {green ${latest}}`);
|
|
104
104
|
}
|
|
105
105
|
else {
|
|
106
106
|
mostRecent.push((0, chalk_1.default) `{green ${instance.name}}`);
|
|
@@ -116,7 +116,7 @@ exports.updateEffects = {
|
|
|
116
116
|
/** After checking the registry, store this instance known to have newer versions available */
|
|
117
117
|
onOutdated(instance, latest) {
|
|
118
118
|
outdatedCount++;
|
|
119
|
-
mostRecent.push((0, chalk_1.default) `${instance.name} {gray {red ${instance.rawSpecifier}} ${constants_1.ICON.rightArrow}} {green ${latest}}`);
|
|
119
|
+
mostRecent.push((0, chalk_1.default) `${instance.name} {gray {red ${instance.rawSpecifier.raw}} ${constants_1.ICON.rightArrow}} {green ${latest}}`);
|
|
120
120
|
return effect_1.Effect.unit;
|
|
121
121
|
},
|
|
122
122
|
/** As the last request completes, remove the progress information */
|
|
@@ -208,14 +208,14 @@ function promptForReleaseType(releaseType, doState) {
|
|
|
208
208
|
choices: releases.map((updateable) => {
|
|
209
209
|
const spacingValue = 50 -
|
|
210
210
|
updateable.instance.name.length -
|
|
211
|
-
updateable.instance.rawSpecifier.length -
|
|
211
|
+
String(updateable.instance.rawSpecifier).length -
|
|
212
212
|
updateable.versions.latest.length;
|
|
213
213
|
const spacing = Array.from({ length: spacingValue }).fill(' ').join('');
|
|
214
214
|
const repoUrl = updateable.repoUrl
|
|
215
215
|
? (0, chalk_1.default) `${spacing} {white - ${updateable.repoUrl}}`
|
|
216
216
|
: '';
|
|
217
217
|
return {
|
|
218
|
-
title: (0, chalk_1.default) `${updateable.instance.name} {gray ${updateable.instance.rawSpecifier} ${constants_1.ICON.rightArrow}} {green ${updateable.versions.latest}} ${repoUrl}`,
|
|
218
|
+
title: (0, chalk_1.default) `${updateable.instance.name} {gray ${updateable.instance.rawSpecifier.raw} ${constants_1.ICON.rightArrow}} {green ${updateable.versions.latest}} ${repoUrl}`,
|
|
219
219
|
selected: true,
|
|
220
220
|
value: updateable,
|
|
221
221
|
};
|
|
@@ -235,7 +235,7 @@ function promptForReleaseType(releaseType, doState) {
|
|
|
235
235
|
}
|
|
236
236
|
function groupByReleaseType(releases) {
|
|
237
237
|
return effect_1.Effect.succeed(releases.reduce((releasesByType, release) => {
|
|
238
|
-
const previous = (0, set_semver_range_1.setSemverRange)('', release.instance.rawSpecifier);
|
|
238
|
+
const previous = (0, set_semver_range_1.setSemverRange)('', String(release.instance.rawSpecifier.raw));
|
|
239
239
|
const latest = release.versions.latest;
|
|
240
240
|
try {
|
|
241
241
|
const type = (0, semver_1.diff)(previous, latest);
|
package/dist/bin-update/index.js
CHANGED
|
@@ -47,11 +47,13 @@ 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
53
|
effect_1.Effect.runPromise((0, update_1.update)(io_1.io, {
|
|
53
54
|
configPath: commander_1.program.opts().config,
|
|
54
55
|
filter: commander_1.program.opts().filter,
|
|
55
56
|
source: commander_1.program.opts().source,
|
|
57
|
+
specs: commander_1.program.opts().specs,
|
|
56
58
|
types: commander_1.program.opts().types,
|
|
57
59
|
}));
|
|
@@ -26,8 +26,8 @@ function update(io, cli, effects = effects_1.updateEffects, errorHandlers = defa
|
|
|
26
26
|
if (!isVisitedByName[instance.name] &&
|
|
27
27
|
(instance.versionGroup._tag === 'SameRange' ||
|
|
28
28
|
instance.versionGroup._tag === 'Standard')) {
|
|
29
|
-
const specifier = specifier_1.Specifier.create(instance, instance.rawSpecifier);
|
|
30
|
-
if (specifier._tag === '
|
|
29
|
+
const specifier = specifier_1.Specifier.create(instance, instance.rawSpecifier.raw);
|
|
30
|
+
if (specifier._tag === 'Range' || specifier._tag === 'Exact') {
|
|
31
31
|
isVisitedByName[instance.name] = true;
|
|
32
32
|
updateable.push(instance);
|
|
33
33
|
}
|
|
@@ -39,7 +39,7 @@ function update(io, cli, effects = effects_1.updateEffects, errorHandlers = defa
|
|
|
39
39
|
onSuccess: ({ versions }) => effects_1.updateEffects.onFetchEnd(instance, versions),
|
|
40
40
|
}),
|
|
41
41
|
// move up to date dependencies to error channel
|
|
42
|
-
effect_1.Effect.flatMap((updateable) => (0, semver_1.gtr)(updateable.versions.latest, instance.rawSpecifier)
|
|
42
|
+
effect_1.Effect.flatMap((updateable) => (0, semver_1.gtr)(updateable.versions.latest, String(instance.rawSpecifier.raw))
|
|
43
43
|
? (0, effect_1.pipe)(effects_1.updateEffects.onOutdated(instance, updateable.versions.latest), effect_1.Effect.map(() => updateable))
|
|
44
44
|
: (0, effect_1.pipe)(effects_1.updateEffects.onUpToDate(instance), effect_1.Effect.flatMap(() => effect_1.Effect.fail(updateable)))),
|
|
45
45
|
// log error but don't catch it
|
|
@@ -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';
|