syncpack 12.1.0 → 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/index.js +2 -0
- package/dist/bin-lint-semver-ranges/index.js +2 -0
- package/dist/bin-lint-semver-ranges/lint-semver-ranges.js +2 -2
- package/dist/bin-list/index.js +2 -0
- package/dist/bin-list/list.js +2 -2
- package/dist/bin-list-mismatches/index.js +2 -0
- package/dist/bin-list-mismatches/list-mismatches.js +10 -10
- package/dist/bin-prompt/index.js +2 -0
- package/dist/bin-set-semver-ranges/index.js +2 -0
- 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/types.d.ts +11 -2
- package/dist/constants.d.ts +55 -23
- package/dist/constants.js +34 -32
- 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/option.d.ts +1 -0
- package/dist/option.js +4 -0
- package/dist/schema.json +136 -12
- package/dist/semver-group/create-semver-groups.js +6 -0
- package/dist/semver-group/with-range.d.ts +1 -1
- package/dist/semver-group/with-range.js +3 -3
- 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 -3
- 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/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 +3 -1
- package/dist/version-group/create-version-groups.js +11 -0
- package/dist/version-group/pinned.js +1 -1
- package/dist/version-group/same-range.js +5 -5
- package/dist/version-group/snapped-to.js +5 -5
- package/dist/version-group/standard.js +9 -9
- package/package.json +6 -6
package/dist/option.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ export declare const option: {
|
|
|
3
3
|
readonly filter: readonly ["-f, --filter [pattern]", string];
|
|
4
4
|
readonly indent: readonly ["-i, --indent [value]", `override indentation. defaults to "${string}"`];
|
|
5
5
|
readonly source: readonly ["-s, --source [pattern]", "glob pattern for package.json files to read from", typeof collect, string[]];
|
|
6
|
+
readonly specs: readonly ["-s, --specs <names>", string];
|
|
6
7
|
readonly types: readonly ["-t, --types <names>", string];
|
|
7
8
|
};
|
|
8
9
|
declare function collect(value: string, previous: string[]): string[];
|
package/dist/option.js
CHANGED
|
@@ -19,6 +19,10 @@ exports.option = {
|
|
|
19
19
|
collect,
|
|
20
20
|
[],
|
|
21
21
|
],
|
|
22
|
+
specs: [
|
|
23
|
+
'-s, --specs <names>',
|
|
24
|
+
(0, chalk_1.default) `only include dependencies whose version specifier match these types (eg. {yellow specs=latest,range,workspace-protocol})`,
|
|
25
|
+
],
|
|
22
26
|
types: [
|
|
23
27
|
'-t, --types <names>',
|
|
24
28
|
(0, chalk_1.default) `only include dependencies matching these types (eg. {yellow types=dev,prod,myCustomType})`,
|
package/dist/schema.json
CHANGED
|
@@ -2,6 +2,34 @@
|
|
|
2
2
|
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
3
|
"additionalProperties": false,
|
|
4
4
|
"definitions": {
|
|
5
|
+
"DependencyType": {
|
|
6
|
+
"anyOf": [
|
|
7
|
+
{
|
|
8
|
+
"additionalProperties": false,
|
|
9
|
+
"properties": {},
|
|
10
|
+
"type": "object"
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
"enum": [
|
|
14
|
+
"!dev",
|
|
15
|
+
"!local",
|
|
16
|
+
"!overrides",
|
|
17
|
+
"!peer",
|
|
18
|
+
"!pnpmOverrides",
|
|
19
|
+
"!prod",
|
|
20
|
+
"!resolutions",
|
|
21
|
+
"dev",
|
|
22
|
+
"local",
|
|
23
|
+
"overrides",
|
|
24
|
+
"peer",
|
|
25
|
+
"pnpmOverrides",
|
|
26
|
+
"prod",
|
|
27
|
+
"resolutions"
|
|
28
|
+
],
|
|
29
|
+
"type": "string"
|
|
30
|
+
}
|
|
31
|
+
]
|
|
32
|
+
},
|
|
5
33
|
"Record<string,CustomTypeConfig.Any>": {
|
|
6
34
|
"additionalProperties": false,
|
|
7
35
|
"type": "object"
|
|
@@ -30,7 +58,7 @@
|
|
|
30
58
|
},
|
|
31
59
|
"dependencyTypes": {
|
|
32
60
|
"items": {
|
|
33
|
-
"
|
|
61
|
+
"$ref": "#/definitions/DependencyType"
|
|
34
62
|
},
|
|
35
63
|
"type": "array"
|
|
36
64
|
},
|
|
@@ -46,6 +74,12 @@
|
|
|
46
74
|
"type": "string"
|
|
47
75
|
},
|
|
48
76
|
"type": "array"
|
|
77
|
+
},
|
|
78
|
+
"specifierTypes": {
|
|
79
|
+
"items": {
|
|
80
|
+
"$ref": "#/definitions/SpecifierType"
|
|
81
|
+
},
|
|
82
|
+
"type": "array"
|
|
49
83
|
}
|
|
50
84
|
},
|
|
51
85
|
"type": "object"
|
|
@@ -61,7 +95,7 @@
|
|
|
61
95
|
},
|
|
62
96
|
"dependencyTypes": {
|
|
63
97
|
"items": {
|
|
64
|
-
"
|
|
98
|
+
"$ref": "#/definitions/DependencyType"
|
|
65
99
|
},
|
|
66
100
|
"type": "array"
|
|
67
101
|
},
|
|
@@ -77,6 +111,12 @@
|
|
|
77
111
|
"type": "string"
|
|
78
112
|
},
|
|
79
113
|
"type": "array"
|
|
114
|
+
},
|
|
115
|
+
"specifierTypes": {
|
|
116
|
+
"items": {
|
|
117
|
+
"$ref": "#/definitions/SpecifierType"
|
|
118
|
+
},
|
|
119
|
+
"type": "array"
|
|
80
120
|
}
|
|
81
121
|
},
|
|
82
122
|
"type": "object"
|
|
@@ -92,7 +132,7 @@
|
|
|
92
132
|
},
|
|
93
133
|
"dependencyTypes": {
|
|
94
134
|
"items": {
|
|
95
|
-
"
|
|
135
|
+
"$ref": "#/definitions/DependencyType"
|
|
96
136
|
},
|
|
97
137
|
"type": "array"
|
|
98
138
|
},
|
|
@@ -107,6 +147,12 @@
|
|
|
107
147
|
},
|
|
108
148
|
"range": {
|
|
109
149
|
"$ref": "#/definitions/SemverRange"
|
|
150
|
+
},
|
|
151
|
+
"specifierTypes": {
|
|
152
|
+
"items": {
|
|
153
|
+
"$ref": "#/definitions/SpecifierType"
|
|
154
|
+
},
|
|
155
|
+
"type": "array"
|
|
110
156
|
}
|
|
111
157
|
},
|
|
112
158
|
"type": "object"
|
|
@@ -128,6 +174,42 @@
|
|
|
128
174
|
],
|
|
129
175
|
"type": "string"
|
|
130
176
|
},
|
|
177
|
+
"SpecifierType": {
|
|
178
|
+
"anyOf": [
|
|
179
|
+
{
|
|
180
|
+
"additionalProperties": false,
|
|
181
|
+
"properties": {},
|
|
182
|
+
"type": "object"
|
|
183
|
+
},
|
|
184
|
+
{
|
|
185
|
+
"enum": [
|
|
186
|
+
"!alias",
|
|
187
|
+
"!delete",
|
|
188
|
+
"!exact",
|
|
189
|
+
"!file",
|
|
190
|
+
"!hosted-git",
|
|
191
|
+
"!latest",
|
|
192
|
+
"!range",
|
|
193
|
+
"!tag",
|
|
194
|
+
"!unsupported",
|
|
195
|
+
"!url",
|
|
196
|
+
"!workspace-protocol",
|
|
197
|
+
"alias",
|
|
198
|
+
"delete",
|
|
199
|
+
"exact",
|
|
200
|
+
"file",
|
|
201
|
+
"hosted-git",
|
|
202
|
+
"latest",
|
|
203
|
+
"range",
|
|
204
|
+
"tag",
|
|
205
|
+
"unsupported",
|
|
206
|
+
"url",
|
|
207
|
+
"workspace-protocol"
|
|
208
|
+
],
|
|
209
|
+
"type": "string"
|
|
210
|
+
}
|
|
211
|
+
]
|
|
212
|
+
},
|
|
131
213
|
"VersionGroupConfig.Any": {
|
|
132
214
|
"anyOf": [
|
|
133
215
|
{
|
|
@@ -140,10 +222,10 @@
|
|
|
140
222
|
"$ref": "#/definitions/VersionGroupConfig.Pinned"
|
|
141
223
|
},
|
|
142
224
|
{
|
|
143
|
-
"$ref": "#/definitions/VersionGroupConfig.
|
|
225
|
+
"$ref": "#/definitions/VersionGroupConfig.SameRange"
|
|
144
226
|
},
|
|
145
227
|
{
|
|
146
|
-
"$ref": "#/definitions/VersionGroupConfig.
|
|
228
|
+
"$ref": "#/definitions/VersionGroupConfig.SnappedTo"
|
|
147
229
|
},
|
|
148
230
|
{
|
|
149
231
|
"$ref": "#/definitions/VersionGroupConfig.Standard"
|
|
@@ -161,7 +243,7 @@
|
|
|
161
243
|
},
|
|
162
244
|
"dependencyTypes": {
|
|
163
245
|
"items": {
|
|
164
|
-
"
|
|
246
|
+
"$ref": "#/definitions/DependencyType"
|
|
165
247
|
},
|
|
166
248
|
"type": "array"
|
|
167
249
|
},
|
|
@@ -177,6 +259,12 @@
|
|
|
177
259
|
"type": "string"
|
|
178
260
|
},
|
|
179
261
|
"type": "array"
|
|
262
|
+
},
|
|
263
|
+
"specifierTypes": {
|
|
264
|
+
"items": {
|
|
265
|
+
"$ref": "#/definitions/SpecifierType"
|
|
266
|
+
},
|
|
267
|
+
"type": "array"
|
|
180
268
|
}
|
|
181
269
|
},
|
|
182
270
|
"type": "object"
|
|
@@ -192,7 +280,7 @@
|
|
|
192
280
|
},
|
|
193
281
|
"dependencyTypes": {
|
|
194
282
|
"items": {
|
|
195
|
-
"
|
|
283
|
+
"$ref": "#/definitions/DependencyType"
|
|
196
284
|
},
|
|
197
285
|
"type": "array"
|
|
198
286
|
},
|
|
@@ -208,6 +296,12 @@
|
|
|
208
296
|
"type": "string"
|
|
209
297
|
},
|
|
210
298
|
"type": "array"
|
|
299
|
+
},
|
|
300
|
+
"specifierTypes": {
|
|
301
|
+
"items": {
|
|
302
|
+
"$ref": "#/definitions/SpecifierType"
|
|
303
|
+
},
|
|
304
|
+
"type": "array"
|
|
211
305
|
}
|
|
212
306
|
},
|
|
213
307
|
"type": "object"
|
|
@@ -223,7 +317,7 @@
|
|
|
223
317
|
},
|
|
224
318
|
"dependencyTypes": {
|
|
225
319
|
"items": {
|
|
226
|
-
"
|
|
320
|
+
"$ref": "#/definitions/DependencyType"
|
|
227
321
|
},
|
|
228
322
|
"type": "array"
|
|
229
323
|
},
|
|
@@ -238,6 +332,12 @@
|
|
|
238
332
|
},
|
|
239
333
|
"pinVersion": {
|
|
240
334
|
"type": "string"
|
|
335
|
+
},
|
|
336
|
+
"specifierTypes": {
|
|
337
|
+
"items": {
|
|
338
|
+
"$ref": "#/definitions/SpecifierType"
|
|
339
|
+
},
|
|
340
|
+
"type": "array"
|
|
241
341
|
}
|
|
242
342
|
},
|
|
243
343
|
"type": "object"
|
|
@@ -253,7 +353,7 @@
|
|
|
253
353
|
},
|
|
254
354
|
"dependencyTypes": {
|
|
255
355
|
"items": {
|
|
256
|
-
"
|
|
356
|
+
"$ref": "#/definitions/DependencyType"
|
|
257
357
|
},
|
|
258
358
|
"type": "array"
|
|
259
359
|
},
|
|
@@ -269,6 +369,12 @@
|
|
|
269
369
|
"policy": {
|
|
270
370
|
"const": "sameRange",
|
|
271
371
|
"type": "string"
|
|
372
|
+
},
|
|
373
|
+
"specifierTypes": {
|
|
374
|
+
"items": {
|
|
375
|
+
"$ref": "#/definitions/SpecifierType"
|
|
376
|
+
},
|
|
377
|
+
"type": "array"
|
|
272
378
|
}
|
|
273
379
|
},
|
|
274
380
|
"type": "object"
|
|
@@ -284,7 +390,7 @@
|
|
|
284
390
|
},
|
|
285
391
|
"dependencyTypes": {
|
|
286
392
|
"items": {
|
|
287
|
-
"
|
|
393
|
+
"$ref": "#/definitions/DependencyType"
|
|
288
394
|
},
|
|
289
395
|
"type": "array"
|
|
290
396
|
},
|
|
@@ -302,6 +408,12 @@
|
|
|
302
408
|
"type": "string"
|
|
303
409
|
},
|
|
304
410
|
"type": "array"
|
|
411
|
+
},
|
|
412
|
+
"specifierTypes": {
|
|
413
|
+
"items": {
|
|
414
|
+
"$ref": "#/definitions/SpecifierType"
|
|
415
|
+
},
|
|
416
|
+
"type": "array"
|
|
305
417
|
}
|
|
306
418
|
},
|
|
307
419
|
"type": "object"
|
|
@@ -317,7 +429,7 @@
|
|
|
317
429
|
},
|
|
318
430
|
"dependencyTypes": {
|
|
319
431
|
"items": {
|
|
320
|
-
"
|
|
432
|
+
"$ref": "#/definitions/DependencyType"
|
|
321
433
|
},
|
|
322
434
|
"type": "array"
|
|
323
435
|
},
|
|
@@ -336,6 +448,12 @@
|
|
|
336
448
|
"lowestSemver"
|
|
337
449
|
],
|
|
338
450
|
"type": "string"
|
|
451
|
+
},
|
|
452
|
+
"specifierTypes": {
|
|
453
|
+
"items": {
|
|
454
|
+
"$ref": "#/definitions/SpecifierType"
|
|
455
|
+
},
|
|
456
|
+
"type": "array"
|
|
339
457
|
}
|
|
340
458
|
},
|
|
341
459
|
"type": "object"
|
|
@@ -347,7 +465,7 @@
|
|
|
347
465
|
},
|
|
348
466
|
"dependencyTypes": {
|
|
349
467
|
"items": {
|
|
350
|
-
"
|
|
468
|
+
"$ref": "#/definitions/DependencyType"
|
|
351
469
|
},
|
|
352
470
|
"type": "array"
|
|
353
471
|
},
|
|
@@ -381,6 +499,12 @@
|
|
|
381
499
|
},
|
|
382
500
|
"type": "array"
|
|
383
501
|
},
|
|
502
|
+
"specifierTypes": {
|
|
503
|
+
"items": {
|
|
504
|
+
"$ref": "#/definitions/SpecifierType"
|
|
505
|
+
},
|
|
506
|
+
"type": "array"
|
|
507
|
+
},
|
|
384
508
|
"versionGroups": {
|
|
385
509
|
"items": {
|
|
386
510
|
"$ref": "#/definitions/VersionGroupConfig.Any"
|
|
@@ -45,10 +45,14 @@ function createSemverGroups(ctx) {
|
|
|
45
45
|
: ['**'];
|
|
46
46
|
const dependencies = (0, is_array_of_strings_1.isArrayOfStrings)(config.dependencies) ? config.dependencies : ['**'];
|
|
47
47
|
const packages = (0, is_array_of_strings_1.isArrayOfStrings)(config.packages) ? config.packages : ['**'];
|
|
48
|
+
const specifierTypes = (0, is_array_of_strings_1.isArrayOfStrings)(config.specifierTypes)
|
|
49
|
+
? config.specifierTypes
|
|
50
|
+
: ['**'];
|
|
48
51
|
if (config.isIgnored === true) {
|
|
49
52
|
semverGroups.push(effect_1.Effect.succeed(new ignored_1.IgnoredSemverGroup({
|
|
50
53
|
dependencies,
|
|
51
54
|
dependencyTypes,
|
|
55
|
+
specifierTypes,
|
|
52
56
|
isIgnored: true,
|
|
53
57
|
label,
|
|
54
58
|
packages,
|
|
@@ -58,6 +62,7 @@ function createSemverGroups(ctx) {
|
|
|
58
62
|
semverGroups.push(effect_1.Effect.succeed(new with_range_1.WithRangeSemverGroup(false, {
|
|
59
63
|
dependencies,
|
|
60
64
|
dependencyTypes,
|
|
65
|
+
specifierTypes,
|
|
61
66
|
label,
|
|
62
67
|
packages,
|
|
63
68
|
range: config.range,
|
|
@@ -68,6 +73,7 @@ function createSemverGroups(ctx) {
|
|
|
68
73
|
semverGroups.push(effect_1.Effect.succeed(new disabled_1.DisabledSemverGroup(true, {
|
|
69
74
|
dependencies: ['**'],
|
|
70
75
|
dependencyTypes: ['**'],
|
|
76
|
+
specifierTypes: ['**'],
|
|
71
77
|
label: 'Default Semver Group',
|
|
72
78
|
packages: ['**'],
|
|
73
79
|
isDisabled: true,
|
|
@@ -16,7 +16,7 @@ export declare class WithRangeSemverGroup extends WithRangeSemverGroup_base<{
|
|
|
16
16
|
constructor(isCatchAll: boolean, config: SemverGroupConfig.WithRange);
|
|
17
17
|
canAdd(_: Instance): boolean;
|
|
18
18
|
getFixed(specifier: Specifier.Any): Effect.Effect<never, NonSemverError, Specifier.Any>;
|
|
19
|
-
inspectAll(): Effect.Effect<never, never, (Report.
|
|
19
|
+
inspectAll(): Effect.Effect<never, never, (Report.SemverRangeMismatch | Report.UnsupportedMismatch | Report.Valid)[]>;
|
|
20
20
|
inspect(instance: Instance): Effect.Effect<never, never, Report.UnsupportedMismatch | Report.SemverRangeMismatch | Report.Valid>;
|
|
21
21
|
}
|
|
22
22
|
export {};
|
|
@@ -25,17 +25,17 @@ class WithRangeSemverGroup extends effect_1.Data.TaggedClass('WithRange') {
|
|
|
25
25
|
return effect_1.Effect.all(this.instances.map((instance) => this.inspect(instance)));
|
|
26
26
|
}
|
|
27
27
|
inspect(instance) {
|
|
28
|
-
const current = specifier_1.Specifier.create(instance, instance.rawSpecifier);
|
|
28
|
+
const current = specifier_1.Specifier.create(instance, instance.rawSpecifier.raw);
|
|
29
29
|
return (0, effect_1.pipe)(this.getFixed(current), effect_1.Effect.match({
|
|
30
30
|
// if range is fixable
|
|
31
31
|
onSuccess: (valid) =>
|
|
32
32
|
// if it is pinned and matches its pin
|
|
33
33
|
instance.versionGroup._tag === 'Pinned' &&
|
|
34
|
-
instance.rawSpecifier === instance.versionGroup.config.pinVersion
|
|
34
|
+
instance.rawSpecifier.raw === instance.versionGroup.config.pinVersion
|
|
35
35
|
? // the pinned version takes precendence and is a match
|
|
36
36
|
new report_1.Report.Valid(current)
|
|
37
37
|
: // if it is already like this on disk
|
|
38
|
-
instance.rawSpecifier === valid.raw
|
|
38
|
+
instance.rawSpecifier.raw === valid.raw
|
|
39
39
|
? // it is a match
|
|
40
40
|
new report_1.Report.Valid(current)
|
|
41
41
|
: // it is a mismatch and should be this one
|
|
@@ -7,6 +7,8 @@ type T = AliasResult;
|
|
|
7
7
|
/** @example "npm:imageoptim-cli@3.1.7" */
|
|
8
8
|
export declare class AliasSpecifier extends BaseSpecifier<T> {
|
|
9
9
|
_tag: string;
|
|
10
|
+
/** The public name referenced in config */
|
|
11
|
+
name: "alias";
|
|
10
12
|
/** Return the version portion if it is valid semver */
|
|
11
13
|
getSemver(): Effect.Effect<never, NonSemverError, string>;
|
|
12
14
|
/** Get a new `Specifier` from the given semver version applied to this one */
|
package/dist/specifier/alias.js
CHANGED
|
@@ -7,7 +7,9 @@ const base_1 = require("./base");
|
|
|
7
7
|
const non_semver_error_1 = require("./lib/non-semver-error");
|
|
8
8
|
/** @example "npm:imageoptim-cli@3.1.7" */
|
|
9
9
|
class AliasSpecifier extends base_1.BaseSpecifier {
|
|
10
|
-
_tag = '
|
|
10
|
+
_tag = 'Alias';
|
|
11
|
+
/** The public name referenced in config */
|
|
12
|
+
name = 'alias';
|
|
11
13
|
/** Return the version portion if it is valid semver */
|
|
12
14
|
getSemver() {
|
|
13
15
|
return (0, effect_1.pipe)(this.parse(), effect_1.Effect.mapError(() => new non_semver_error_1.NonSemverError({ specifier: this })), effect_1.Effect.map((parsed) => parsed.subSpec), effect_1.Effect.flatMap((subSpec) => ['range', 'version'].includes(subSpec.type) && subSpec.fetchSpec !== null
|
package/dist/specifier/base.d.ts
CHANGED
|
@@ -6,6 +6,8 @@ import type { NpmPackageArgResult } from './lib/parse-specifier';
|
|
|
6
6
|
export declare class BaseSpecifier<T extends NpmPackageArgResult | unknown> {
|
|
7
7
|
/** should be overridden by sub classes */
|
|
8
8
|
_tag: string;
|
|
9
|
+
/** should be overridden by sub classes */
|
|
10
|
+
name: string;
|
|
9
11
|
/** The raw semver/workspace:/git etc version value */
|
|
10
12
|
raw: string;
|
|
11
13
|
/**
|
|
@@ -31,9 +33,9 @@ export declare class BaseSpecifier<T extends NpmPackageArgResult | unknown> {
|
|
|
31
33
|
*/
|
|
32
34
|
protected parse(): Effect.Effect<never, unknown, T>;
|
|
33
35
|
/** Return the version portion if it is valid semver */
|
|
34
|
-
getSemver(): Effect.Effect<never, NonSemverError, string>;
|
|
36
|
+
getSemver(this: Specifier.Any): Effect.Effect<never, NonSemverError, string>;
|
|
35
37
|
/** Get a new `Specifier` from the given semver version applied to this one */
|
|
36
|
-
setSemver(_version: string): Effect.Effect<never, NonSemverError, Specifier.Any>;
|
|
38
|
+
setSemver(this: Specifier.Any, _version: string): Effect.Effect<never, NonSemverError, Specifier.Any>;
|
|
37
39
|
/** Apply the given specifier to a new one with this instance bound to it */
|
|
38
40
|
replaceWith<T extends Specifier.Any>(specifier: T): T;
|
|
39
41
|
}
|
package/dist/specifier/base.js
CHANGED
|
@@ -7,7 +7,9 @@ const non_semver_error_1 = require("./lib/non-semver-error");
|
|
|
7
7
|
const parse_specifier_1 = require("./lib/parse-specifier");
|
|
8
8
|
class BaseSpecifier {
|
|
9
9
|
/** should be overridden by sub classes */
|
|
10
|
-
_tag = '
|
|
10
|
+
_tag = 'Base';
|
|
11
|
+
/** should be overridden by sub classes */
|
|
12
|
+
name = 'base';
|
|
11
13
|
/** The raw semver/workspace:/git etc version value */
|
|
12
14
|
raw;
|
|
13
15
|
/**
|
|
@@ -3,13 +3,15 @@ import type { Delete } from '../version-group/lib/delete';
|
|
|
3
3
|
/** A instance which should be deleted */
|
|
4
4
|
export declare class DeleteSpecifier {
|
|
5
5
|
_tag: string;
|
|
6
|
+
/** The public name referenced in config */
|
|
7
|
+
name: "delete";
|
|
6
8
|
raw: Delete;
|
|
7
9
|
instance: Instance;
|
|
8
10
|
constructor(data: {
|
|
9
11
|
raw: Delete;
|
|
10
12
|
instance: Instance;
|
|
11
13
|
});
|
|
12
|
-
getSemver: () => import("effect/Effect").Effect<never, import("./lib/non-semver-error").NonSemverError, string>;
|
|
13
|
-
setSemver: (_version: string) => import("effect/Effect").Effect<never, import("./lib/non-semver-error").NonSemverError, import(".").Specifier.Any>;
|
|
14
|
+
getSemver: (this: import(".").Specifier.Any) => import("effect/Effect").Effect<never, import("./lib/non-semver-error").NonSemverError, string>;
|
|
15
|
+
setSemver: (this: import(".").Specifier.Any, _version: string) => import("effect/Effect").Effect<never, import("./lib/non-semver-error").NonSemverError, import(".").Specifier.Any>;
|
|
14
16
|
replaceWith: <T extends import(".").Specifier.Any>(specifier: T) => T;
|
|
15
17
|
}
|
package/dist/specifier/delete.js
CHANGED
|
@@ -4,7 +4,9 @@ exports.DeleteSpecifier = void 0;
|
|
|
4
4
|
const base_1 = require("./base");
|
|
5
5
|
/** A instance which should be deleted */
|
|
6
6
|
class DeleteSpecifier {
|
|
7
|
-
_tag = '
|
|
7
|
+
_tag = 'Delete';
|
|
8
|
+
/** The public name referenced in config */
|
|
9
|
+
name = 'delete';
|
|
8
10
|
raw;
|
|
9
11
|
instance;
|
|
10
12
|
constructor(data) {
|
|
@@ -8,8 +8,10 @@ type T = SpecificRegistryResult<'version'>;
|
|
|
8
8
|
* An exact semver version
|
|
9
9
|
* @example "1.4.4"
|
|
10
10
|
*/
|
|
11
|
-
export declare class
|
|
11
|
+
export declare class ExactSpecifier extends BaseSpecifier<T> {
|
|
12
12
|
_tag: string;
|
|
13
|
+
/** The public name referenced in config */
|
|
14
|
+
name: "exact";
|
|
13
15
|
/** Return the semver version */
|
|
14
16
|
getSemver(): Effect.Effect<never, NonSemverError, string>;
|
|
15
17
|
/** Get a new `Specifier` from the given semver version applied to this one */
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.ExactSpecifier = void 0;
|
|
4
4
|
const effect_1 = require("effect");
|
|
5
5
|
const _1 = require(".");
|
|
6
6
|
const base_1 = require("./base");
|
|
@@ -9,8 +9,10 @@ const non_semver_error_1 = require("./lib/non-semver-error");
|
|
|
9
9
|
* An exact semver version
|
|
10
10
|
* @example "1.4.4"
|
|
11
11
|
*/
|
|
12
|
-
class
|
|
13
|
-
_tag = '
|
|
12
|
+
class ExactSpecifier extends base_1.BaseSpecifier {
|
|
13
|
+
_tag = 'Exact';
|
|
14
|
+
/** The public name referenced in config */
|
|
15
|
+
name = 'exact';
|
|
14
16
|
/** Return the semver version */
|
|
15
17
|
getSemver() {
|
|
16
18
|
return (0, effect_1.pipe)(this.parse(), effect_1.Effect.mapError(() => new non_semver_error_1.NonSemverError({ specifier: this })), effect_1.Effect.map((parsed) => parsed.fetchSpec));
|
|
@@ -20,4 +22,4 @@ class VersionSpecifier extends base_1.BaseSpecifier {
|
|
|
20
22
|
return effect_1.Effect.succeed(_1.Specifier.create(this.instance, version));
|
|
21
23
|
}
|
|
22
24
|
}
|
|
23
|
-
exports.
|
|
25
|
+
exports.ExactSpecifier = ExactSpecifier;
|
package/dist/specifier/file.d.ts
CHANGED
package/dist/specifier/file.js
CHANGED
|
@@ -4,6 +4,8 @@ exports.FileSpecifier = void 0;
|
|
|
4
4
|
const base_1 = require("./base");
|
|
5
5
|
/** @example */
|
|
6
6
|
class FileSpecifier extends base_1.BaseSpecifier {
|
|
7
|
-
_tag = '
|
|
7
|
+
_tag = 'File';
|
|
8
|
+
/** The public name referenced in config */
|
|
9
|
+
name = 'file';
|
|
8
10
|
}
|
|
9
11
|
exports.FileSpecifier = FileSpecifier;
|
|
@@ -6,6 +6,8 @@ import { NonSemverError } from './lib/non-semver-error';
|
|
|
6
6
|
/** @example "git+https://github.com/user/foo" */
|
|
7
7
|
export declare class HostedGitSpecifier extends BaseSpecifier<HostedGitResult> {
|
|
8
8
|
_tag: string;
|
|
9
|
+
/** The public name referenced in config */
|
|
10
|
+
name: "hosted-git";
|
|
9
11
|
/** Return the git tag if it is valid semver */
|
|
10
12
|
getSemver(): Effect.Effect<never, NonSemverError, string>;
|
|
11
13
|
/** Get a new `Specifier` from the given semver version applied to this one */
|
|
@@ -8,7 +8,9 @@ const base_1 = require("./base");
|
|
|
8
8
|
const non_semver_error_1 = require("./lib/non-semver-error");
|
|
9
9
|
/** @example "git+https://github.com/user/foo" */
|
|
10
10
|
class HostedGitSpecifier extends base_1.BaseSpecifier {
|
|
11
|
-
_tag = '
|
|
11
|
+
_tag = 'HostedGit';
|
|
12
|
+
/** The public name referenced in config */
|
|
13
|
+
name = 'hosted-git';
|
|
12
14
|
/** Return the git tag if it is valid semver */
|
|
13
15
|
getSemver() {
|
|
14
16
|
return (0, effect_1.pipe)(this.parse(), effect_1.Effect.mapError(() => new non_semver_error_1.NonSemverError({ specifier: this })), effect_1.Effect.map((parsed) => parsed.gitCommittish || ''), effect_1.Effect.flatMap((gitCommittish) => (0, is_semver_1.isSemver)(gitCommittish) ? effect_1.Effect.succeed(gitCommittish) : non_semver_error_1.NonSemverError.asEffect(this)));
|
|
@@ -2,25 +2,27 @@ import type { Instance } from '../get-instances/instance';
|
|
|
2
2
|
import { type Delete } from '../version-group/lib/delete';
|
|
3
3
|
import { AliasSpecifier } from './alias';
|
|
4
4
|
import { DeleteSpecifier } from './delete';
|
|
5
|
+
import { ExactSpecifier } from './exact';
|
|
5
6
|
import { FileSpecifier } from './file';
|
|
6
7
|
import { HostedGitSpecifier } from './hosted-git';
|
|
8
|
+
import { LatestSpecifier } from './latest';
|
|
7
9
|
import { RangeSpecifier } from './range';
|
|
8
10
|
import { TagSpecifier } from './tag';
|
|
9
11
|
import { UnsupportedSpecifier } from './unsupported';
|
|
10
12
|
import { UrlSpecifier } from './url';
|
|
11
|
-
import { VersionSpecifier } from './version';
|
|
12
13
|
import { WorkspaceProtocolSpecifier } from './workspace-protocol';
|
|
13
14
|
export declare namespace Specifier {
|
|
14
15
|
const Alias: typeof AliasSpecifier;
|
|
15
16
|
const Delete: typeof DeleteSpecifier;
|
|
17
|
+
const Exact: typeof ExactSpecifier;
|
|
16
18
|
const File: typeof FileSpecifier;
|
|
17
19
|
const HostedGit: typeof HostedGitSpecifier;
|
|
20
|
+
const Latest: typeof LatestSpecifier;
|
|
18
21
|
const Range: typeof RangeSpecifier;
|
|
19
22
|
const Tag: typeof TagSpecifier;
|
|
20
23
|
const Unsupported: typeof UnsupportedSpecifier;
|
|
21
24
|
const Url: typeof UrlSpecifier;
|
|
22
|
-
const Version: typeof VersionSpecifier;
|
|
23
25
|
const WorkspaceProtocol: typeof WorkspaceProtocolSpecifier;
|
|
24
|
-
type Any = AliasSpecifier | DeleteSpecifier | FileSpecifier | HostedGitSpecifier | RangeSpecifier | TagSpecifier | UnsupportedSpecifier | UrlSpecifier |
|
|
26
|
+
type Any = AliasSpecifier | DeleteSpecifier | ExactSpecifier | FileSpecifier | HostedGitSpecifier | LatestSpecifier | RangeSpecifier | TagSpecifier | UnsupportedSpecifier | UrlSpecifier | WorkspaceProtocolSpecifier;
|
|
25
27
|
function create(instance: Instance, raw: string | Delete): Specifier.Any;
|
|
26
28
|
}
|
package/dist/specifier/index.js
CHANGED
|
@@ -4,26 +4,28 @@ exports.Specifier = void 0;
|
|
|
4
4
|
const delete_1 = require("../version-group/lib/delete");
|
|
5
5
|
const alias_1 = require("./alias");
|
|
6
6
|
const delete_2 = require("./delete");
|
|
7
|
+
const exact_1 = require("./exact");
|
|
7
8
|
const file_1 = require("./file");
|
|
8
9
|
const hosted_git_1 = require("./hosted-git");
|
|
10
|
+
const latest_1 = require("./latest");
|
|
9
11
|
const parse_specifier_1 = require("./lib/parse-specifier");
|
|
10
12
|
const range_1 = require("./range");
|
|
11
13
|
const tag_1 = require("./tag");
|
|
12
14
|
const unsupported_1 = require("./unsupported");
|
|
13
15
|
const url_1 = require("./url");
|
|
14
|
-
const version_1 = require("./version");
|
|
15
16
|
const workspace_protocol_1 = require("./workspace-protocol");
|
|
16
17
|
var Specifier;
|
|
17
18
|
(function (Specifier) {
|
|
18
19
|
Specifier.Alias = alias_1.AliasSpecifier;
|
|
19
20
|
Specifier.Delete = delete_2.DeleteSpecifier;
|
|
21
|
+
Specifier.Exact = exact_1.ExactSpecifier;
|
|
20
22
|
Specifier.File = file_1.FileSpecifier;
|
|
21
23
|
Specifier.HostedGit = hosted_git_1.HostedGitSpecifier;
|
|
24
|
+
Specifier.Latest = latest_1.LatestSpecifier;
|
|
22
25
|
Specifier.Range = range_1.RangeSpecifier;
|
|
23
26
|
Specifier.Tag = tag_1.TagSpecifier;
|
|
24
27
|
Specifier.Unsupported = unsupported_1.UnsupportedSpecifier;
|
|
25
28
|
Specifier.Url = url_1.UrlSpecifier;
|
|
26
|
-
Specifier.Version = version_1.VersionSpecifier;
|
|
27
29
|
Specifier.WorkspaceProtocol = workspace_protocol_1.WorkspaceProtocolSpecifier;
|
|
28
30
|
function create(instance, raw) {
|
|
29
31
|
if (raw === delete_1.DELETE)
|
|
@@ -36,8 +38,10 @@ var Specifier;
|
|
|
36
38
|
const parsed = (0, parse_specifier_1.parseSpecifier)(instance.name, raw, instance.packageJsonFile);
|
|
37
39
|
const type = parsed.type;
|
|
38
40
|
const data = { instance, raw };
|
|
41
|
+
if (raw === '*')
|
|
42
|
+
return new Specifier.Latest(data);
|
|
39
43
|
if (type === 'version')
|
|
40
|
-
return new Specifier.
|
|
44
|
+
return new Specifier.Exact(data);
|
|
41
45
|
if (type === 'range')
|
|
42
46
|
return new Specifier.Range(data);
|
|
43
47
|
if (type === 'workspaceProtocol')
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Effect } from 'effect';
|
|
2
|
+
import { Specifier } from '.';
|
|
3
|
+
import { BaseSpecifier } from './base';
|
|
4
|
+
import { NonSemverError } from './lib/non-semver-error';
|
|
5
|
+
import type { SpecificRegistryResult } from './lib/specific-registry-result';
|
|
6
|
+
type T = SpecificRegistryResult<'range'>;
|
|
7
|
+
/**
|
|
8
|
+
* @example "*"
|
|
9
|
+
*/
|
|
10
|
+
export declare class LatestSpecifier extends BaseSpecifier<T> {
|
|
11
|
+
_tag: string;
|
|
12
|
+
/** The public name referenced in config */
|
|
13
|
+
name: "latest";
|
|
14
|
+
/** Return the semver version including the range */
|
|
15
|
+
getSemver(): Effect.Effect<never, NonSemverError, string>;
|
|
16
|
+
/** Get a new `Specifier` from the given semver version applied to this one */
|
|
17
|
+
setSemver(version: string): Effect.Effect<never, never, Specifier.Any>;
|
|
18
|
+
}
|
|
19
|
+
export {};
|