syncpack 12.1.0 → 12.3.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.
Files changed (70) hide show
  1. package/README.md +5 -5
  2. package/dist/bin-fix-mismatches/index.js +2 -0
  3. package/dist/bin-format/format.d.ts +2 -0
  4. package/dist/bin-format/format.js +66 -36
  5. package/dist/bin-lint/lint.js +40 -1
  6. package/dist/bin-lint-semver-ranges/index.js +2 -0
  7. package/dist/bin-lint-semver-ranges/lint-semver-ranges.js +2 -2
  8. package/dist/bin-list/index.js +2 -0
  9. package/dist/bin-list/list.js +2 -2
  10. package/dist/bin-list-mismatches/index.js +2 -0
  11. package/dist/bin-list-mismatches/list-mismatches.js +10 -10
  12. package/dist/bin-prompt/index.js +2 -0
  13. package/dist/bin-set-semver-ranges/index.js +2 -0
  14. package/dist/bin-update/effects.js +6 -6
  15. package/dist/bin-update/index.js +2 -0
  16. package/dist/bin-update/update.js +3 -3
  17. package/dist/config/get-filter.js +2 -1
  18. package/dist/config/get-indent.js +2 -1
  19. package/dist/config/get-sort-az.js +4 -11
  20. package/dist/config/get-sort-exports.d.ts +2 -0
  21. package/dist/config/get-sort-exports.js +12 -0
  22. package/dist/config/get-sort-first.js +4 -2
  23. package/dist/config/types.d.ts +25 -2
  24. package/dist/constants.d.ts +62 -23
  25. package/dist/constants.js +52 -32
  26. package/dist/get-instances/instance.d.ts +2 -1
  27. package/dist/get-instances/instance.js +4 -3
  28. package/dist/guards/can-add-to-group.js +14 -7
  29. package/dist/io/to-json.d.ts +9 -0
  30. package/dist/io/to-json.js +33 -0
  31. package/dist/io/write-if-changed.d.ts +0 -6
  32. package/dist/io/write-if-changed.js +3 -31
  33. package/dist/option.d.ts +1 -0
  34. package/dist/option.js +4 -0
  35. package/dist/schema.json +160 -12
  36. package/dist/semver-group/create-semver-groups.js +6 -0
  37. package/dist/semver-group/with-range.d.ts +1 -1
  38. package/dist/semver-group/with-range.js +3 -3
  39. package/dist/specifier/alias.d.ts +2 -0
  40. package/dist/specifier/alias.js +3 -1
  41. package/dist/specifier/base.d.ts +4 -2
  42. package/dist/specifier/base.js +3 -1
  43. package/dist/specifier/delete.d.ts +4 -2
  44. package/dist/specifier/delete.js +3 -1
  45. package/dist/specifier/{version.d.ts → exact.d.ts} +3 -1
  46. package/dist/specifier/{version.js → exact.js} +6 -4
  47. package/dist/specifier/file.d.ts +2 -0
  48. package/dist/specifier/file.js +3 -1
  49. package/dist/specifier/hosted-git.d.ts +2 -0
  50. package/dist/specifier/hosted-git.js +3 -1
  51. package/dist/specifier/index.d.ts +5 -3
  52. package/dist/specifier/index.js +7 -3
  53. package/dist/specifier/latest.d.ts +19 -0
  54. package/dist/specifier/latest.js +24 -0
  55. package/dist/specifier/range.d.ts +2 -1
  56. package/dist/specifier/range.js +3 -2
  57. package/dist/specifier/tag.d.ts +2 -0
  58. package/dist/specifier/tag.js +3 -1
  59. package/dist/specifier/unsupported.d.ts +2 -0
  60. package/dist/specifier/unsupported.js +3 -1
  61. package/dist/specifier/url.d.ts +2 -0
  62. package/dist/specifier/url.js +3 -1
  63. package/dist/specifier/workspace-protocol.d.ts +2 -0
  64. package/dist/specifier/workspace-protocol.js +3 -1
  65. package/dist/version-group/create-version-groups.js +11 -0
  66. package/dist/version-group/pinned.js +1 -1
  67. package/dist/version-group/same-range.js +5 -5
  68. package/dist/version-group/snapped-to.js +5 -5
  69. package/dist/version-group/standard.js +9 -9
  70. package/package.json +6 -6
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
- "type": "string"
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
- "type": "string"
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
- "type": "string"
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.SnappedTo"
225
+ "$ref": "#/definitions/VersionGroupConfig.SameRange"
144
226
  },
145
227
  {
146
- "$ref": "#/definitions/VersionGroupConfig.SameRange"
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
- "type": "string"
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
- "type": "string"
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
- "type": "string"
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
- "type": "string"
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
- "type": "string"
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
- "type": "string"
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,16 +465,31 @@
347
465
  },
348
466
  "dependencyTypes": {
349
467
  "items": {
350
- "type": "string"
468
+ "$ref": "#/definitions/DependencyType"
351
469
  },
352
470
  "type": "array"
353
471
  },
354
472
  "filter": {
355
473
  "type": "string"
356
474
  },
475
+ "formatBugs": {
476
+ "type": "boolean"
477
+ },
478
+ "formatRepository": {
479
+ "type": "boolean"
480
+ },
357
481
  "indent": {
358
482
  "type": "string"
359
483
  },
484
+ "lintFormatting": {
485
+ "type": "boolean"
486
+ },
487
+ "lintSemverRanges": {
488
+ "type": "boolean"
489
+ },
490
+ "lintVersions": {
491
+ "type": "boolean"
492
+ },
360
493
  "semverGroups": {
361
494
  "items": {
362
495
  "$ref": "#/definitions/SemverGroupConfig.Any"
@@ -369,18 +502,33 @@
369
502
  },
370
503
  "type": "array"
371
504
  },
505
+ "sortExports": {
506
+ "items": {
507
+ "type": "string"
508
+ },
509
+ "type": "array"
510
+ },
372
511
  "sortFirst": {
373
512
  "items": {
374
513
  "type": "string"
375
514
  },
376
515
  "type": "array"
377
516
  },
517
+ "sortPackages": {
518
+ "type": "boolean"
519
+ },
378
520
  "source": {
379
521
  "items": {
380
522
  "type": "string"
381
523
  },
382
524
  "type": "array"
383
525
  },
526
+ "specifierTypes": {
527
+ "items": {
528
+ "$ref": "#/definitions/SpecifierType"
529
+ },
530
+ "type": "array"
531
+ },
384
532
  "versionGroups": {
385
533
  "items": {
386
534
  "$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.UnsupportedMismatch | Report.SemverRangeMismatch | Report.Valid)[]>;
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 */
@@ -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 = 'AliasSpecifier';
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
@@ -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
  }
@@ -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 = 'BaseSpecifier';
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
  }
@@ -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 = 'DeleteSpecifier';
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 VersionSpecifier extends BaseSpecifier<T> {
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.VersionSpecifier = void 0;
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 VersionSpecifier extends base_1.BaseSpecifier {
13
- _tag = 'VersionSpecifier';
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.VersionSpecifier = VersionSpecifier;
25
+ exports.ExactSpecifier = ExactSpecifier;
@@ -3,4 +3,6 @@ import { BaseSpecifier } from './base';
3
3
  /** @example */
4
4
  export declare class FileSpecifier extends BaseSpecifier<FileResult> {
5
5
  _tag: string;
6
+ /** The public name referenced in config */
7
+ name: "file";
6
8
  }
@@ -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 = 'FileSpecifier';
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 = 'HostedGitSpecifier';
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 | VersionSpecifier | WorkspaceProtocolSpecifier;
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
  }
@@ -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.Version(data);
44
+ return new Specifier.Exact(data);
41
45
  if (type === 'range')
42
46
  return new Specifier.Range(data);
43
47
  if (type === 'workspaceProtocol')