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.
Files changed (57) hide show
  1. package/README.md +5 -5
  2. package/dist/bin-fix-mismatches/index.js +2 -0
  3. package/dist/bin-lint-semver-ranges/index.js +2 -0
  4. package/dist/bin-lint-semver-ranges/lint-semver-ranges.js +2 -2
  5. package/dist/bin-list/index.js +2 -0
  6. package/dist/bin-list/list.js +2 -2
  7. package/dist/bin-list-mismatches/index.js +2 -0
  8. package/dist/bin-list-mismatches/list-mismatches.js +10 -10
  9. package/dist/bin-prompt/index.js +2 -0
  10. package/dist/bin-set-semver-ranges/index.js +2 -0
  11. package/dist/bin-update/effects.js +6 -6
  12. package/dist/bin-update/index.js +2 -0
  13. package/dist/bin-update/update.js +3 -3
  14. package/dist/config/types.d.ts +11 -2
  15. package/dist/constants.d.ts +55 -23
  16. package/dist/constants.js +34 -32
  17. package/dist/get-instances/instance.d.ts +2 -1
  18. package/dist/get-instances/instance.js +4 -3
  19. package/dist/guards/can-add-to-group.js +14 -7
  20. package/dist/option.d.ts +1 -0
  21. package/dist/option.js +4 -0
  22. package/dist/schema.json +136 -12
  23. package/dist/semver-group/create-semver-groups.js +6 -0
  24. package/dist/semver-group/with-range.d.ts +1 -1
  25. package/dist/semver-group/with-range.js +3 -3
  26. package/dist/specifier/alias.d.ts +2 -0
  27. package/dist/specifier/alias.js +3 -1
  28. package/dist/specifier/base.d.ts +4 -2
  29. package/dist/specifier/base.js +3 -1
  30. package/dist/specifier/delete.d.ts +4 -2
  31. package/dist/specifier/delete.js +3 -1
  32. package/dist/specifier/{version.d.ts → exact.d.ts} +3 -1
  33. package/dist/specifier/{version.js → exact.js} +6 -4
  34. package/dist/specifier/file.d.ts +2 -0
  35. package/dist/specifier/file.js +3 -1
  36. package/dist/specifier/hosted-git.d.ts +2 -0
  37. package/dist/specifier/hosted-git.js +3 -1
  38. package/dist/specifier/index.d.ts +5 -3
  39. package/dist/specifier/index.js +7 -3
  40. package/dist/specifier/latest.d.ts +19 -0
  41. package/dist/specifier/latest.js +24 -0
  42. package/dist/specifier/range.d.ts +2 -1
  43. package/dist/specifier/range.js +3 -2
  44. package/dist/specifier/tag.d.ts +2 -0
  45. package/dist/specifier/tag.js +3 -1
  46. package/dist/specifier/unsupported.d.ts +2 -0
  47. package/dist/specifier/unsupported.js +3 -1
  48. package/dist/specifier/url.d.ts +2 -0
  49. package/dist/specifier/url.js +3 -1
  50. package/dist/specifier/workspace-protocol.d.ts +2 -0
  51. package/dist/specifier/workspace-protocol.js +3 -1
  52. package/dist/version-group/create-version-groups.js +11 -0
  53. package/dist/version-group/pinned.js +1 -1
  54. package/dist/version-group/same-range.js +5 -5
  55. package/dist/version-group/snapped-to.js +5 -5
  56. package/dist/version-group/standard.js +9 -9
  57. package/package.json +6 -6
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.LatestSpecifier = void 0;
4
+ const effect_1 = require("effect");
5
+ const _1 = require(".");
6
+ const base_1 = require("./base");
7
+ const non_semver_error_1 = require("./lib/non-semver-error");
8
+ /**
9
+ * @example "*"
10
+ */
11
+ class LatestSpecifier extends base_1.BaseSpecifier {
12
+ _tag = 'Latest';
13
+ /** The public name referenced in config */
14
+ name = 'latest';
15
+ /** Return the semver version including the range */
16
+ getSemver() {
17
+ 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));
18
+ }
19
+ /** Get a new `Specifier` from the given semver version applied to this one */
20
+ setSemver(version) {
21
+ return effect_1.Effect.succeed(_1.Specifier.create(this.instance, version));
22
+ }
23
+ }
24
+ exports.LatestSpecifier = LatestSpecifier;
@@ -5,11 +5,12 @@ import { NonSemverError } from './lib/non-semver-error';
5
5
  import type { SpecificRegistryResult } from './lib/specific-registry-result';
6
6
  type T = SpecificRegistryResult<'range'>;
7
7
  /**
8
- * @example "*"
9
8
  * @example "^1.2.3"
10
9
  */
11
10
  export declare class RangeSpecifier extends BaseSpecifier<T> {
12
11
  _tag: string;
12
+ /** The public name referenced in config */
13
+ name: "range";
13
14
  /** Return the semver version including the range */
14
15
  getSemver(): Effect.Effect<never, NonSemverError, string>;
15
16
  /** Get a new `Specifier` from the given semver version applied to this one */
@@ -6,11 +6,12 @@ const _1 = require(".");
6
6
  const base_1 = require("./base");
7
7
  const non_semver_error_1 = require("./lib/non-semver-error");
8
8
  /**
9
- * @example "*"
10
9
  * @example "^1.2.3"
11
10
  */
12
11
  class RangeSpecifier extends base_1.BaseSpecifier {
13
- _tag = 'RangeSpecifier';
12
+ _tag = 'Range';
13
+ /** The public name referenced in config */
14
+ name = 'range';
14
15
  /** Return the semver version including the range */
15
16
  getSemver() {
16
17
  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));
@@ -6,4 +6,6 @@ import type { SpecificRegistryResult } from './lib/specific-registry-result';
6
6
  */
7
7
  export declare class TagSpecifier extends BaseSpecifier<SpecificRegistryResult<'tag'>> {
8
8
  _tag: string;
9
+ /** The public name referenced in config */
10
+ name: "tag";
9
11
  }
@@ -7,6 +7,8 @@ const base_1 = require("./base");
7
7
  * @example "made-up-by-some-dev"
8
8
  */
9
9
  class TagSpecifier extends base_1.BaseSpecifier {
10
- _tag = 'TagSpecifier';
10
+ _tag = 'Tag';
11
+ /** The public name referenced in config */
12
+ name = 'tag';
11
13
  }
12
14
  exports.TagSpecifier = TagSpecifier;
@@ -2,4 +2,6 @@ import { BaseSpecifier } from './base';
2
2
  /** A specifier not supported by the `npm` package manager */
3
3
  export declare class UnsupportedSpecifier extends BaseSpecifier<unknown> {
4
4
  _tag: string;
5
+ /** The public name referenced in config */
6
+ name: "unsupported";
5
7
  }
@@ -4,6 +4,8 @@ exports.UnsupportedSpecifier = void 0;
4
4
  const base_1 = require("./base");
5
5
  /** A specifier not supported by the `npm` package manager */
6
6
  class UnsupportedSpecifier extends base_1.BaseSpecifier {
7
- _tag = 'UnsupportedSpecifier';
7
+ _tag = 'Unsupported';
8
+ /** The public name referenced in config */
9
+ name = 'unsupported';
8
10
  }
9
11
  exports.UnsupportedSpecifier = UnsupportedSpecifier;
@@ -3,4 +3,6 @@ import { BaseSpecifier } from './base';
3
3
  /** @example "http://x.com/foo.tgz" */
4
4
  export declare class UrlSpecifier extends BaseSpecifier<URLResult> {
5
5
  _tag: string;
6
+ /** The public name referenced in config */
7
+ name: "url";
6
8
  }
@@ -4,6 +4,8 @@ exports.UrlSpecifier = void 0;
4
4
  const base_1 = require("./base");
5
5
  /** @example "http://x.com/foo.tgz" */
6
6
  class UrlSpecifier extends base_1.BaseSpecifier {
7
- _tag = 'UrlSpecifier';
7
+ _tag = 'Url';
8
+ /** The public name referenced in config */
9
+ name = 'url';
8
10
  }
9
11
  exports.UrlSpecifier = UrlSpecifier;
@@ -6,6 +6,8 @@ import type { WorkspaceProtocolResult } from './lib/parse-specifier';
6
6
  /** Represents "workspace:*" and "workspace:~" */
7
7
  export declare class WorkspaceProtocolSpecifier extends BaseSpecifier<WorkspaceProtocolResult> {
8
8
  _tag: string;
9
+ /** The public name referenced in config */
10
+ name: "workspace-protocol";
9
11
  /**
10
12
  * Return an equivalent value which actually is semver, so that it can be used
11
13
  * with tools which expect values which conform to the spec. This value is
@@ -6,7 +6,9 @@ const _1 = require(".");
6
6
  const base_1 = require("./base");
7
7
  /** Represents "workspace:*" and "workspace:~" */
8
8
  class WorkspaceProtocolSpecifier extends base_1.BaseSpecifier {
9
- _tag = 'WorkspaceProtocolSpecifier';
9
+ _tag = 'WorkspaceProtocol';
10
+ /** The public name referenced in config */
11
+ name = 'workspace-protocol';
10
12
  /**
11
13
  * Return an equivalent value which actually is semver, so that it can be used
12
14
  * with tools which expect values which conform to the spec. This value is
@@ -40,10 +40,14 @@ function createVersionGroups(ctx) {
40
40
  : ['**'];
41
41
  const dependencies = (0, is_array_of_strings_1.isArrayOfStrings)(config.dependencies) ? config.dependencies : ['**'];
42
42
  const packages = (0, is_array_of_strings_1.isArrayOfStrings)(config.packages) ? config.packages : ['**'];
43
+ const specifierTypes = (0, is_array_of_strings_1.isArrayOfStrings)(config.specifierTypes)
44
+ ? config.specifierTypes
45
+ : ['**'];
43
46
  if (config.isBanned === true) {
44
47
  versionGroups.push(effect_1.Effect.succeed(new banned_1.BannedVersionGroup({
45
48
  dependencies,
46
49
  dependencyTypes,
50
+ specifierTypes,
47
51
  isBanned: true,
48
52
  label,
49
53
  packages,
@@ -53,6 +57,7 @@ function createVersionGroups(ctx) {
53
57
  versionGroups.push(effect_1.Effect.succeed(new ignored_1.IgnoredVersionGroup({
54
58
  dependencies,
55
59
  dependencyTypes,
60
+ specifierTypes,
56
61
  isIgnored: true,
57
62
  label,
58
63
  packages,
@@ -62,6 +67,7 @@ function createVersionGroups(ctx) {
62
67
  versionGroups.push(effect_1.Effect.succeed(new pinned_1.PinnedVersionGroup({
63
68
  dependencies,
64
69
  dependencyTypes,
70
+ specifierTypes,
65
71
  label,
66
72
  packages,
67
73
  pinVersion: config.pinVersion,
@@ -71,6 +77,7 @@ function createVersionGroups(ctx) {
71
77
  versionGroups.push(effect_1.Effect.succeed(new snapped_to_1.SnappedToVersionGroup({
72
78
  dependencies,
73
79
  dependencyTypes,
80
+ specifierTypes,
74
81
  label,
75
82
  packages,
76
83
  snapTo: config.snapTo,
@@ -80,6 +87,7 @@ function createVersionGroups(ctx) {
80
87
  versionGroups.push(effect_1.Effect.succeed(new same_range_1.SameRangeVersionGroup(ctx, {
81
88
  dependencies,
82
89
  dependencyTypes,
90
+ specifierTypes,
83
91
  label,
84
92
  packages,
85
93
  policy: config.policy,
@@ -89,6 +97,7 @@ function createVersionGroups(ctx) {
89
97
  versionGroups.push(effect_1.Effect.succeed(new standard_1.StandardVersionGroup(false, {
90
98
  dependencies,
91
99
  dependencyTypes,
100
+ specifierTypes,
92
101
  label,
93
102
  packages,
94
103
  preferVersion: config.preferVersion === 'lowestSemver' ? 'lowestSemver' : 'highestSemver',
@@ -98,6 +107,8 @@ function createVersionGroups(ctx) {
98
107
  }
99
108
  versionGroups.push(effect_1.Effect.succeed(new standard_1.StandardVersionGroup(true, {
100
109
  dependencies: ['**'],
110
+ dependencyTypes: ['**'],
111
+ specifierTypes: ['**'],
101
112
  label: 'Default Version Group',
102
113
  packages: ['**'],
103
114
  preferVersion: 'highestSemver',
@@ -17,7 +17,7 @@ class PinnedVersionGroup extends effect_1.Data.TaggedClass('Pinned') {
17
17
  return true;
18
18
  }
19
19
  inspectAll() {
20
- return effect_1.Effect.all(Object.entries((0, group_by_1.groupBy)('name', this.instances)).map(([name, instances]) => (0, effect_1.pipe)(instances, effect_1.Effect.forEach((instance) => (0, effect_1.pipe)(effect_1.Effect.succeed(specifier_1.Specifier.create(instance, this.config.pinVersion)), effect_1.Effect.map((expected) => instance.rawSpecifier === expected.raw
20
+ return effect_1.Effect.all(Object.entries((0, group_by_1.groupBy)('name', this.instances)).map(([name, instances]) => (0, effect_1.pipe)(instances, effect_1.Effect.forEach((instance) => (0, effect_1.pipe)(effect_1.Effect.succeed(specifier_1.Specifier.create(instance, this.config.pinVersion)), effect_1.Effect.map((expected) => instance.rawSpecifier.raw === expected.raw
21
21
  ? // ✓ pinned takes precedence over any semver group
22
22
  // ✓ current version matches expected
23
23
  new report_1.Report.Valid(expected)
@@ -23,7 +23,7 @@ class SameRangeVersionGroup extends effect_1.Data.TaggedClass('SameRange') {
23
23
  return true;
24
24
  }
25
25
  inspectAll() {
26
- return effect_1.Effect.all(Object.entries((0, group_by_1.groupBy)('name', this.instances)).flatMap(([name, instances]) => (0, effect_1.pipe)(instances, effect_1.Effect.partition((instance) => (0, effect_1.pipe)(effect_1.Effect.succeed(specifier_1.Specifier.create(instance, instance.rawSpecifier)), effect_1.Effect.flatMap((specifier) => (0, effect_1.pipe)(specifier.getSemver(), effect_1.Effect.matchEffect({
26
+ return effect_1.Effect.all(Object.entries((0, group_by_1.groupBy)('name', this.instances)).flatMap(([name, instances]) => (0, effect_1.pipe)(instances, effect_1.Effect.partition((instance) => (0, effect_1.pipe)(effect_1.Effect.succeed(specifier_1.Specifier.create(instance, instance.rawSpecifier.raw)), effect_1.Effect.flatMap((specifier) => (0, effect_1.pipe)(specifier.getSemver(), effect_1.Effect.matchEffect({
27
27
  onFailure: () => effect_1.Effect.fail(
28
28
  // ✘ expected version is not semver
29
29
  // ✘ is a mismatch we can't auto-fix
@@ -34,7 +34,7 @@ class SameRangeVersionGroup extends effect_1.Data.TaggedClass('SameRange') {
34
34
  // ✘ expected version is not fixable by its semver group
35
35
  // ✘ is a mismatch we can't auto-fix
36
36
  new report_1.Report.UnsupportedMismatch(specifier.instance)),
37
- onSuccess: (valid) => specifier.instance.rawSpecifier === valid.raw
37
+ onSuccess: (valid) => specifier.instance.rawSpecifier.raw === valid.raw
38
38
  ? effect_1.Effect.succeed(
39
39
  // ✓ expected version is semver
40
40
  // ✓ expected version matches its semver group
@@ -72,7 +72,7 @@ class SameRangeVersionGroup extends effect_1.Data.TaggedClass('SameRange') {
72
72
  // ✓ current version matches expected
73
73
  // ! is not the original local package
74
74
  // ✘ current specifier does not match every other specifier
75
- return new report_1.Report.SameRangeMismatch(thisMatch.specifier.instance, (0, uniq_1.uniq)(mismatches.map((report) => report.specifier.instance.rawSpecifier)));
75
+ return new report_1.Report.SameRangeMismatch(thisMatch.specifier.instance, (0, uniq_1.uniq)(mismatches.map((report) => String(report.specifier.instance.rawSpecifier.raw))));
76
76
  })
77
77
  : // ✘ not every instance is valid on its own
78
78
  // ! report on their validity individually ! when all are valid
@@ -93,10 +93,10 @@ function matchesRange(ctx, a, b) {
93
93
  }
94
94
  /** Get the semver version synchronously from a specifier known to contain semver */
95
95
  function unwrapSemver(ctx, specifier) {
96
- if (specifier._tag === 'RangeSpecifier' || specifier._tag === 'VersionSpecifier') {
96
+ if (specifier._tag === 'Range' || specifier._tag === 'Exact') {
97
97
  return specifier.raw;
98
98
  }
99
- if (specifier._tag === 'WorkspaceProtocolSpecifier') {
99
+ if (specifier._tag === 'WorkspaceProtocol') {
100
100
  return effect_1.Effect.runSync(specifier.getSemverEquivalent(ctx));
101
101
  }
102
102
  return effect_1.Effect.runSync(specifier.getSemver());
@@ -22,14 +22,14 @@ class SnappedToVersionGroup extends effect_1.Data.TaggedClass('SnappedTo') {
22
22
  // ✘ none of the snapTo packages contain this dependency
23
23
  // ✘ is a user configuration error we can't auto-fix
24
24
  new report_1.Report.MissingSnappedToMismatch(instance))),
25
- onSuccess: (expected) => (0, effect_1.pipe)(instances, effect_1.Effect.forEach((instance) => (0, effect_1.pipe)(effect_1.Effect.Do, effect_1.Effect.bind('specifier', () => effect_1.Effect.succeed(specifier_1.Specifier.create(instance, instance.rawSpecifier))), effect_1.Effect.bind('expected', () => effect_1.Effect.succeed(specifier_1.Specifier.create(instance, expected.rawSpecifier))), effect_1.Effect.flatMap(({ expected, specifier }) => (0, effect_1.pipe)(expected.getSemver(), effect_1.Effect.matchEffect({
25
+ onSuccess: (expected) => (0, effect_1.pipe)(instances, effect_1.Effect.forEach((instance) => (0, effect_1.pipe)(effect_1.Effect.Do, effect_1.Effect.bind('specifier', () => effect_1.Effect.succeed(specifier_1.Specifier.create(instance, instance.rawSpecifier.raw))), effect_1.Effect.bind('expected', () => effect_1.Effect.succeed(specifier_1.Specifier.create(instance, expected.rawSpecifier.raw))), effect_1.Effect.flatMap(({ expected, specifier }) => (0, effect_1.pipe)(expected.getSemver(), effect_1.Effect.matchEffect({
26
26
  onFailure: () => (0, effect_1.pipe)(specifier.replaceWith(expected), specifier.instance.semverGroup.getFixed, effect_1.Effect.match({
27
27
  onFailure: () =>
28
28
  // ✘ expected version is not semver
29
29
  // ✘ semver group expects semver
30
30
  // ✘ is a mismatch we can't auto-fix
31
31
  new report_1.Report.UnsupportedMismatch(specifier.instance),
32
- onSuccess: (valid) => specifier.instance.rawSpecifier === valid.raw
32
+ onSuccess: (valid) => specifier.instance.rawSpecifier.raw === valid.raw
33
33
  ? // ! expected version is not semver
34
34
  // ✓ semver group is disabled/ignored
35
35
  // ✓ current version matches expected
@@ -47,7 +47,7 @@ class SnappedToVersionGroup extends effect_1.Data.TaggedClass('SnappedTo') {
47
47
  // ✘ is a mismatch we can't auto-fix
48
48
  // ✘ this should be impossible - we already proved the local version is exact semver
49
49
  new report_1.Report.UnsupportedMismatch(specifier.instance),
50
- onSuccess: (valid) => specifier.instance.rawSpecifier === valid.raw
50
+ onSuccess: (valid) => specifier.instance.rawSpecifier.raw === valid.raw
51
51
  ? // ✓ expected version is semver
52
52
  // ✓ expected version matches its semver group
53
53
  // ✓ current version matches expected
@@ -65,8 +65,8 @@ class SnappedToVersionGroup extends effect_1.Data.TaggedClass('SnappedTo') {
65
65
  exports.SnappedToVersionGroup = SnappedToVersionGroup;
66
66
  function findSnappedToInstance(name, snapTo, instances) {
67
67
  for (const instance of instances) {
68
- if (snapTo.includes(instance.pkgName) && instance.rawSpecifier) {
69
- return (0, effect_1.pipe)(effect_1.Effect.succeed(instance), effect_1.Effect.tap(() => effect_1.Effect.logDebug(`found snapped to version ${instance.rawSpecifier} for ${name} in <${instance.packageJsonFile.jsonFile.shortPath}>`)));
68
+ if (snapTo.includes(instance.pkgName) && instance.rawSpecifier.raw) {
69
+ return (0, effect_1.pipe)(effect_1.Effect.succeed(instance), effect_1.Effect.tap(() => effect_1.Effect.logDebug(`found snapped to version ${String(instance.rawSpecifier.raw)} for ${name} in <${instance.packageJsonFile.jsonFile.shortPath}>`)));
70
70
  }
71
71
  }
72
72
  return (0, effect_1.pipe)(effect_1.Effect.fail('getSnappedTo found nothing'), effect_1.Effect.tapError(() => effect_1.Effect.logError(`failed to get snapped to version for ${name} using ${JSON.stringify(snapTo)}`)));
@@ -23,8 +23,8 @@ class StandardVersionGroup extends effect_1.Data.TaggedClass('Standard') {
23
23
  return effect_1.Effect.all(Object.entries((0, group_by_1.groupBy)('name', this.instances)).flatMap(([name, instances]) => {
24
24
  const localInstance = getLocalInstance(instances);
25
25
  if (localInstance) {
26
- const localVersion = localInstance?.rawSpecifier;
27
- return (0, effect_1.pipe)(effect_1.Effect.succeed(specifier_1.Specifier.create(localInstance, localVersion)), effect_1.Effect.flatMap((local) => effect_1.Effect.all(local._tag !== 'VersionSpecifier' && instances.length > 1
26
+ const localVersion = localInstance?.rawSpecifier.raw;
27
+ return (0, effect_1.pipe)(effect_1.Effect.succeed(specifier_1.Specifier.create(localInstance, localVersion)), effect_1.Effect.flatMap((local) => effect_1.Effect.all(local._tag !== 'Exact' && instances.length > 1
28
28
  ? instances.map((instance) =>
29
29
  // ! dependency is a package developed in this repo
30
30
  // ✘ local package has an invalid .version property
@@ -32,7 +32,7 @@ class StandardVersionGroup extends effect_1.Data.TaggedClass('Standard') {
32
32
  effect_1.Effect.succeed(new report_1.Report.MissingLocalVersion(instance, localInstance)))
33
33
  : instances.flatMap((instance) =>
34
34
  // instances.flatMap((instance) =>
35
- (0, effect_1.pipe)(effect_1.Effect.succeed(specifier_1.Specifier.create(instance, instance.rawSpecifier)), effect_1.Effect.flatMap((specifier) => specifier.instance === localInstance
35
+ (0, effect_1.pipe)(effect_1.Effect.succeed(specifier_1.Specifier.create(instance, instance.rawSpecifier.raw)), effect_1.Effect.flatMap((specifier) => specifier.instance === localInstance
36
36
  ? // ✓ this is the local package which the others should match
37
37
  // ! its version must always remain as exact semver
38
38
  // ! other instances need to be adjusted for their semver groups
@@ -44,7 +44,7 @@ class StandardVersionGroup extends effect_1.Data.TaggedClass('Standard') {
44
44
  // ✘ is a mismatch we can't auto-fix
45
45
  // ✘ this should be impossible - we already proved the local version is exact semver
46
46
  new report_1.Report.UnsupportedMismatch(specifier.instance),
47
- onSuccess: (valid) => specifier.instance.rawSpecifier === valid.raw
47
+ onSuccess: (valid) => specifier.instance.rawSpecifier.raw === valid.raw
48
48
  ? // ! is not the local package instance
49
49
  // ✓ local version matches this semver group
50
50
  // ✓ current version matches local
@@ -65,9 +65,9 @@ class StandardVersionGroup extends effect_1.Data.TaggedClass('Standard') {
65
65
  const PreferredMismatch = this.config.preferVersion === 'lowestSemver'
66
66
  ? report_1.Report.LowestSemverMismatch
67
67
  : report_1.Report.HighestSemverMismatch;
68
- return (0, effect_1.pipe)(effect_1.Effect.succeed(instances.map((instance) => specifier_1.Specifier.create(instance, instance.rawSpecifier))), effect_1.Effect.flatMap((specifiers) => (0, effect_1.pipe)((0, get_preferred_version_1.getPreferredVersion)(this.config.preferVersion, specifiers), effect_1.Effect.matchEffect({
69
- onFailure: () => effect_1.Effect.succeed((0, uniq_1.uniq)(specifiers.map((specifier) => specifier.instance.rawSpecifier)).length ===
70
- 1
68
+ return (0, effect_1.pipe)(effect_1.Effect.succeed(instances.map((instance) => specifier_1.Specifier.create(instance, instance.rawSpecifier.raw))), effect_1.Effect.flatMap((specifiers) => (0, effect_1.pipe)((0, get_preferred_version_1.getPreferredVersion)(this.config.preferVersion, specifiers), effect_1.Effect.matchEffect({
69
+ onFailure: () => effect_1.Effect.succeed((0, uniq_1.uniq)(specifiers.map((specifier) => specifier.instance.rawSpecifier.raw))
70
+ .length === 1
71
71
  ? specifiers.map((specifier) =>
72
72
  // ✘ not every version is semver
73
73
  // ✓ every version is identical
@@ -85,12 +85,12 @@ class StandardVersionGroup extends effect_1.Data.TaggedClass('Standard') {
85
85
  // ✘ is a mismatch we can't auto-fix
86
86
  // ✘ this should be impossible - any valid semver is fixable by a semver group
87
87
  new report_1.Report.UnsupportedMismatch(current.instance),
88
- onSuccess: (expectedRange) => current.instance.rawSpecifier === expectedRange.raw
88
+ onSuccess: (expectedRange) => current.instance.rawSpecifier.raw === expectedRange.raw
89
89
  ? // ✓ every version is semver
90
90
  // ✓ current version matches expected semver
91
91
  // ✓ current version matches expected version
92
92
  new report_1.Report.Valid(current)
93
- : current.instance.rawSpecifier === expectedVersion.raw
93
+ : current.instance.rawSpecifier.raw === expectedVersion.raw
94
94
  ? // ✓ every version is semver
95
95
  // ✓ current version matches expected version
96
96
  // ✘ current version does not match expected semver
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "syncpack",
3
3
  "description": "Consistent dependency versions in large JavaScript Monorepos",
4
- "version": "12.1.0",
4
+ "version": "12.2.0",
5
5
  "author": "Jamie Mason <jamie@foldleft.io> (https://github.com/JamieMason)",
6
6
  "bin": {
7
7
  "syncpack": "dist/bin.js",
@@ -33,7 +33,7 @@
33
33
  "Tom Fletcher (https://github.com/tom-fletcher)"
34
34
  ],
35
35
  "dependencies": {
36
- "@effect/schema": "0.56.0",
36
+ "@effect/schema": "0.56.1",
37
37
  "chalk": "4.1.2",
38
38
  "commander": "11.1.0",
39
39
  "cosmiconfig": "9.0.0",
@@ -53,19 +53,19 @@
53
53
  "devDependencies": {
54
54
  "@release-it/conventional-changelog": "8.0.1",
55
55
  "@tsconfig/node18": "18.2.2",
56
- "@types/node": "20.10.5",
56
+ "@types/node": "20.10.6",
57
57
  "@types/npm-package-arg": "6.1.4",
58
58
  "@types/prompts": "2.4.9",
59
59
  "@types/semver": "7.5.6",
60
- "@typescript-eslint/eslint-plugin": "6.15.0",
61
- "@typescript-eslint/parser": "6.15.0",
60
+ "@typescript-eslint/eslint-plugin": "6.16.0",
61
+ "@typescript-eslint/parser": "6.16.0",
62
62
  "@vitest/coverage-v8": "1.1.0",
63
63
  "auto-changelog": "2.4.0",
64
64
  "eslint": "8.56.0",
65
65
  "eslint-plugin-import": "2.29.1",
66
66
  "memfs": "4.6.0",
67
67
  "prettier": "3.1.1",
68
- "prettier-plugin-astro": "0.12.2",
68
+ "prettier-plugin-astro": "0.12.3",
69
69
  "quill-delta": "5.1.0",
70
70
  "release-it": "17.0.1",
71
71
  "rxjs": "7.8.1",