syncpack 12.0.0-alpha.0 → 12.0.0-alpha.1

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 (71) hide show
  1. package/README.md +24 -26
  2. package/dist/bin-fix-mismatches/fix-mismatches.js +6 -1
  3. package/dist/bin-format/format.js +6 -1
  4. package/dist/bin-prompt/prompt.js +6 -1
  5. package/dist/bin-set-semver-ranges/set-semver-ranges.js +6 -1
  6. package/dist/bin-update/effects.d.ts +4 -4
  7. package/dist/bin-update/update.js +6 -1
  8. package/dist/config/get-custom-types.d.ts +1 -1
  9. package/dist/config/get-enabled-types.d.ts +2 -2
  10. package/dist/constants.d.ts +0 -2
  11. package/dist/constants.js +1 -2
  12. package/dist/error-handlers/default-error-handlers.d.ts +0 -13
  13. package/dist/error-handlers/default-error-handlers.js +1 -20
  14. package/dist/get-instances/instance.js +14 -0
  15. package/dist/get-package-json-files/get-file-paths.d.ts +1 -1
  16. package/dist/get-package-json-files/package-json-file.js +8 -0
  17. package/dist/io/ask-for-choice.d.ts +2 -2
  18. package/dist/io/ask-for-choice.js +1 -2
  19. package/dist/io/ask-for-input.d.ts +2 -2
  20. package/dist/io/ask-for-input.js +1 -2
  21. package/dist/io/glob-sync.d.ts +1 -1
  22. package/dist/io/read-file-sync.d.ts +1 -1
  23. package/dist/io/read-json-file-sync.d.ts +2 -2
  24. package/dist/io/read-yaml-file-sync.d.ts +2 -2
  25. package/dist/io/read-yaml-file-sync.js +1 -2
  26. package/dist/io/write-file-sync.d.ts +1 -1
  27. package/dist/lib/ring-buffer.js +2 -0
  28. package/dist/report.d.ts +15 -15
  29. package/dist/semver-group/disabled.d.ts +1 -1
  30. package/dist/semver-group/disabled.js +1 -1
  31. package/dist/semver-group/filtered-out.d.ts +1 -1
  32. package/dist/semver-group/filtered-out.js +1 -1
  33. package/dist/semver-group/ignored.d.ts +1 -1
  34. package/dist/semver-group/ignored.js +1 -1
  35. package/dist/semver-group/index.d.ts +1 -1
  36. package/dist/semver-group/with-range.d.ts +1 -1
  37. package/dist/semver-group/with-range.js +1 -1
  38. package/dist/specifier/alias.js +1 -4
  39. package/dist/specifier/base.js +20 -2
  40. package/dist/specifier/delete.js +6 -4
  41. package/dist/specifier/file.js +1 -4
  42. package/dist/specifier/hosted-git.js +1 -4
  43. package/dist/specifier/lib/non-semver-error.d.ts +1 -1
  44. package/dist/specifier/range.js +1 -4
  45. package/dist/specifier/tag.js +1 -4
  46. package/dist/specifier/unsupported.js +1 -4
  47. package/dist/specifier/url.js +1 -5
  48. package/dist/specifier/version.js +1 -4
  49. package/dist/specifier/workspace-protocol.js +1 -4
  50. package/dist/strategy/name-and-version-props.js +4 -1
  51. package/dist/strategy/named-version-string.js +3 -1
  52. package/dist/strategy/unnamed-version-string.js +3 -1
  53. package/dist/strategy/versions-by-name.js +3 -1
  54. package/dist/version-group/banned.d.ts +1 -1
  55. package/dist/version-group/banned.js +1 -1
  56. package/dist/version-group/filtered-out.d.ts +1 -1
  57. package/dist/version-group/filtered-out.js +1 -1
  58. package/dist/version-group/ignored.d.ts +1 -1
  59. package/dist/version-group/ignored.js +1 -1
  60. package/dist/version-group/index.d.ts +1 -1
  61. package/dist/version-group/pinned.d.ts +1 -1
  62. package/dist/version-group/pinned.js +1 -1
  63. package/dist/version-group/same-range.d.ts +1 -1
  64. package/dist/version-group/same-range.js +1 -1
  65. package/dist/version-group/snapped-to.d.ts +1 -1
  66. package/dist/version-group/snapped-to.js +1 -1
  67. package/dist/version-group/standard.d.ts +1 -1
  68. package/dist/version-group/standard.js +1 -1
  69. package/package.json +29 -30
  70. package/dist/create-program/effects.d.ts +0 -62
  71. package/dist/create-program/effects.js +0 -2
package/dist/report.d.ts CHANGED
@@ -37,7 +37,7 @@ export declare namespace Report {
37
37
  type Any = Union.Strict<Report.MissingLocalVersion | Report.MissingSnappedToMismatch | Report.UnsupportedMismatch | Report.SameRangeMismatch>;
38
38
  }
39
39
  }
40
- const Disabled_base: new <A extends Record<string, any>>(args: import("effect/Types").Equals<Omit<A, keyof import("effect/dist/declarations/src/Equal").Equal>, {}> extends true ? void : Omit<A, keyof import("effect/dist/declarations/src/Equal").Equal>) => Data.Data<A & {
40
+ const Disabled_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").Equals<Omit<A, keyof import("effect/Equal").Equal>, {}> extends true ? void : { readonly [P in keyof A as P extends "_tag" | keyof import("effect/Equal").Equal ? never : P]: A[P]; }) => Data.Data<Readonly<A> & {
41
41
  readonly _tag: "Disabled";
42
42
  }>;
43
43
  /** Semver Groups are disabled by default */
@@ -45,7 +45,7 @@ export declare namespace Report {
45
45
  readonly instance: Instance;
46
46
  }> {
47
47
  }
48
- const FilteredOut_base: new <A extends Record<string, any>>(args: import("effect/Types").Equals<Omit<A, keyof import("effect/dist/declarations/src/Equal").Equal>, {}> extends true ? void : Omit<A, keyof import("effect/dist/declarations/src/Equal").Equal>) => Data.Data<A & {
48
+ const FilteredOut_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").Equals<Omit<A, keyof import("effect/Equal").Equal>, {}> extends true ? void : { readonly [P in keyof A as P extends "_tag" | keyof import("effect/Equal").Equal ? never : P]: A[P]; }) => Data.Data<Readonly<A> & {
49
49
  readonly _tag: "FilteredOut";
50
50
  }>;
51
51
  /** Has a name which does not match the `--filter` RegExp */
@@ -53,7 +53,7 @@ export declare namespace Report {
53
53
  readonly instance: Instance;
54
54
  }> {
55
55
  }
56
- const Ignored_base: new <A extends Record<string, any>>(args: import("effect/Types").Equals<Omit<A, keyof import("effect/dist/declarations/src/Equal").Equal>, {}> extends true ? void : Omit<A, keyof import("effect/dist/declarations/src/Equal").Equal>) => Data.Data<A & {
56
+ const Ignored_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").Equals<Omit<A, keyof import("effect/Equal").Equal>, {}> extends true ? void : { readonly [P in keyof A as P extends "_tag" | keyof import("effect/Equal").Equal ? never : P]: A[P]; }) => Data.Data<Readonly<A> & {
57
57
  readonly _tag: "Ignored";
58
58
  }>;
59
59
  /** Is in an ignored version group */
@@ -61,7 +61,7 @@ export declare namespace Report {
61
61
  readonly instance: Instance;
62
62
  }> {
63
63
  }
64
- const Valid_base: new <A extends Record<string, any>>(args: import("effect/Types").Equals<Omit<A, keyof import("effect/dist/declarations/src/Equal").Equal>, {}> extends true ? void : Omit<A, keyof import("effect/dist/declarations/src/Equal").Equal>) => Data.Data<A & {
64
+ const Valid_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").Equals<Omit<A, keyof import("effect/Equal").Equal>, {}> extends true ? void : { readonly [P in keyof A as P extends "_tag" | keyof import("effect/Equal").Equal ? never : P]: A[P]; }) => Data.Data<Readonly<A> & {
65
65
  readonly _tag: "Valid";
66
66
  }>;
67
67
  /** Version satisfies the rules of its version group */
@@ -69,7 +69,7 @@ export declare namespace Report {
69
69
  readonly specifier: Specifier.Any;
70
70
  }> {
71
71
  }
72
- const Banned_base: new <A extends Record<string, any>>(args: import("effect/Types").Equals<Omit<A, keyof import("effect/dist/declarations/src/Equal").Equal>, {}> extends true ? void : Omit<A, keyof import("effect/dist/declarations/src/Equal").Equal>) => Data.Data<A & {
72
+ const Banned_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").Equals<Omit<A, keyof import("effect/Equal").Equal>, {}> extends true ? void : { readonly [P in keyof A as P extends "_tag" | keyof import("effect/Equal").Equal ? never : P]: A[P]; }) => Data.Data<Readonly<A> & {
73
73
  readonly _tag: "Banned";
74
74
  }>;
75
75
  /** Must be removed */
@@ -77,7 +77,7 @@ export declare namespace Report {
77
77
  readonly fixable: Specifier.Any;
78
78
  }> {
79
79
  }
80
- const HighestSemverMismatch_base: new <A extends Record<string, any>>(args: import("effect/Types").Equals<Omit<A, keyof import("effect/dist/declarations/src/Equal").Equal>, {}> extends true ? void : Omit<A, keyof import("effect/dist/declarations/src/Equal").Equal>) => Data.Data<A & {
80
+ const HighestSemverMismatch_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").Equals<Omit<A, keyof import("effect/Equal").Equal>, {}> extends true ? void : { readonly [P in keyof A as P extends "_tag" | keyof import("effect/Equal").Equal ? never : P]: A[P]; }) => Data.Data<Readonly<A> & {
81
81
  readonly _tag: "HighestSemverMismatch";
82
82
  }>;
83
83
  /** Version mismatches and should use a higher version found on another */
@@ -85,7 +85,7 @@ export declare namespace Report {
85
85
  readonly fixable: Specifier.Any;
86
86
  }> {
87
87
  }
88
- const LocalPackageMismatch_base: new <A extends Record<string, any>>(args: import("effect/Types").Equals<Omit<A, keyof import("effect/dist/declarations/src/Equal").Equal>, {}> extends true ? void : Omit<A, keyof import("effect/dist/declarations/src/Equal").Equal>) => Data.Data<A & {
88
+ const LocalPackageMismatch_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").Equals<Omit<A, keyof import("effect/Equal").Equal>, {}> extends true ? void : { readonly [P in keyof A as P extends "_tag" | keyof import("effect/Equal").Equal ? never : P]: A[P]; }) => Data.Data<Readonly<A> & {
89
89
  readonly _tag: "LocalPackageMismatch";
90
90
  }>;
91
91
  /** Version mismatches the `.version` of the package developed in this repo */
@@ -94,7 +94,7 @@ export declare namespace Report {
94
94
  readonly localInstance: Instance;
95
95
  }> {
96
96
  }
97
- const LowestSemverMismatch_base: new <A extends Record<string, any>>(args: import("effect/Types").Equals<Omit<A, keyof import("effect/dist/declarations/src/Equal").Equal>, {}> extends true ? void : Omit<A, keyof import("effect/dist/declarations/src/Equal").Equal>) => Data.Data<A & {
97
+ const LowestSemverMismatch_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").Equals<Omit<A, keyof import("effect/Equal").Equal>, {}> extends true ? void : { readonly [P in keyof A as P extends "_tag" | keyof import("effect/Equal").Equal ? never : P]: A[P]; }) => Data.Data<Readonly<A> & {
98
98
  readonly _tag: "LowestSemverMismatch";
99
99
  }>;
100
100
  /** Version mismatches and should use a lower version found on another */
@@ -102,7 +102,7 @@ export declare namespace Report {
102
102
  readonly fixable: Specifier.Any;
103
103
  }> {
104
104
  }
105
- const PinnedMismatch_base: new <A extends Record<string, any>>(args: import("effect/Types").Equals<Omit<A, keyof import("effect/dist/declarations/src/Equal").Equal>, {}> extends true ? void : Omit<A, keyof import("effect/dist/declarations/src/Equal").Equal>) => Data.Data<A & {
105
+ const PinnedMismatch_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").Equals<Omit<A, keyof import("effect/Equal").Equal>, {}> extends true ? void : { readonly [P in keyof A as P extends "_tag" | keyof import("effect/Equal").Equal ? never : P]: A[P]; }) => Data.Data<Readonly<A> & {
106
106
  readonly _tag: "PinnedMismatch";
107
107
  }>;
108
108
  /** Version is not identical to the `pinVersion` of its Pinned version group */
@@ -110,7 +110,7 @@ export declare namespace Report {
110
110
  readonly fixable: Specifier.Any;
111
111
  }> {
112
112
  }
113
- const SemverRangeMismatch_base: new <A extends Record<string, any>>(args: import("effect/Types").Equals<Omit<A, keyof import("effect/dist/declarations/src/Equal").Equal>, {}> extends true ? void : Omit<A, keyof import("effect/dist/declarations/src/Equal").Equal>) => Data.Data<A & {
113
+ const SemverRangeMismatch_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").Equals<Omit<A, keyof import("effect/Equal").Equal>, {}> extends true ? void : { readonly [P in keyof A as P extends "_tag" | keyof import("effect/Equal").Equal ? never : P]: A[P]; }) => Data.Data<Readonly<A> & {
114
114
  readonly _tag: "SemverRangeMismatch";
115
115
  }>;
116
116
  /** Version is identical but the semver range does not match its semver group */
@@ -118,7 +118,7 @@ export declare namespace Report {
118
118
  readonly fixable: Specifier.Any;
119
119
  }> {
120
120
  }
121
- const SnappedToMismatch_base: new <A extends Record<string, any>>(args: import("effect/Types").Equals<Omit<A, keyof import("effect/dist/declarations/src/Equal").Equal>, {}> extends true ? void : Omit<A, keyof import("effect/dist/declarations/src/Equal").Equal>) => Data.Data<A & {
121
+ const SnappedToMismatch_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").Equals<Omit<A, keyof import("effect/Equal").Equal>, {}> extends true ? void : { readonly [P in keyof A as P extends "_tag" | keyof import("effect/Equal").Equal ? never : P]: A[P]; }) => Data.Data<Readonly<A> & {
122
122
  readonly _tag: "SnappedToMismatch";
123
123
  }>;
124
124
  /** Version mismatches the version used by the packages in the `snapTo` array */
@@ -127,7 +127,7 @@ export declare namespace Report {
127
127
  readonly localInstance: Instance;
128
128
  }> {
129
129
  }
130
- const MissingLocalVersion_base: new <A extends Record<string, any>>(args: import("effect/Types").Equals<Omit<A, keyof import("effect/dist/declarations/src/Equal").Equal>, {}> extends true ? void : Omit<A, keyof import("effect/dist/declarations/src/Equal").Equal>) => Data.Data<A & {
130
+ const MissingLocalVersion_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").Equals<Omit<A, keyof import("effect/Equal").Equal>, {}> extends true ? void : { readonly [P in keyof A as P extends "_tag" | keyof import("effect/Equal").Equal ? never : P]: A[P]; }) => Data.Data<Readonly<A> & {
131
131
  readonly _tag: "MissingLocalVersion";
132
132
  }>;
133
133
  /** Dependency should match a local package.json which is missing a .version */
@@ -136,7 +136,7 @@ export declare namespace Report {
136
136
  readonly unfixable: Instance;
137
137
  }> {
138
138
  }
139
- const MissingSnappedToMismatch_base: new <A extends Record<string, any>>(args: import("effect/Types").Equals<Omit<A, keyof import("effect/dist/declarations/src/Equal").Equal>, {}> extends true ? void : Omit<A, keyof import("effect/dist/declarations/src/Equal").Equal>) => Data.Data<A & {
139
+ const MissingSnappedToMismatch_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").Equals<Omit<A, keyof import("effect/Equal").Equal>, {}> extends true ? void : { readonly [P in keyof A as P extends "_tag" | keyof import("effect/Equal").Equal ? never : P]: A[P]; }) => Data.Data<Readonly<A> & {
140
140
  readonly _tag: "MissingSnappedToMismatch";
141
141
  }>;
142
142
  /** Dependency is not present in any of the packages in the `snapTo` array */
@@ -144,7 +144,7 @@ export declare namespace Report {
144
144
  readonly unfixable: Instance;
145
145
  }> {
146
146
  }
147
- const SameRangeMismatch_base: new <A extends Record<string, any>>(args: import("effect/Types").Equals<Omit<A, keyof import("effect/dist/declarations/src/Equal").Equal>, {}> extends true ? void : Omit<A, keyof import("effect/dist/declarations/src/Equal").Equal>) => Data.Data<A & {
147
+ const SameRangeMismatch_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").Equals<Omit<A, keyof import("effect/Equal").Equal>, {}> extends true ? void : { readonly [P in keyof A as P extends "_tag" | keyof import("effect/Equal").Equal ? never : P]: A[P]; }) => Data.Data<Readonly<A> & {
148
148
  readonly _tag: "SameRangeMismatch";
149
149
  }>;
150
150
  /** Specifier does not cover the specifiers of every other instance in this group */
@@ -154,7 +154,7 @@ export declare namespace Report {
154
154
  readonly mismatches: string[];
155
155
  }> {
156
156
  }
157
- const UnsupportedMismatch_base: new <A extends Record<string, any>>(args: import("effect/Types").Equals<Omit<A, keyof import("effect/dist/declarations/src/Equal").Equal>, {}> extends true ? void : Omit<A, keyof import("effect/dist/declarations/src/Equal").Equal>) => Data.Data<A & {
157
+ const UnsupportedMismatch_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").Equals<Omit<A, keyof import("effect/Equal").Equal>, {}> extends true ? void : { readonly [P in keyof A as P extends "_tag" | keyof import("effect/Equal").Equal ? never : P]: A[P]; }) => Data.Data<Readonly<A> & {
158
158
  readonly _tag: "UnsupportedMismatch";
159
159
  }>;
160
160
  /** Version mismatches and is not semver, syncpack cannot guess what to do */
@@ -4,7 +4,7 @@ import type { Instance } from '../get-instances/instance';
4
4
  import { Report } from '../report';
5
5
  import type { Specifier } from '../specifier';
6
6
  import type { NonSemverError } from '../specifier/lib/non-semver-error';
7
- declare const DisabledSemverGroup_base: new <A extends Record<string, any>>(args: import("effect/Types").Equals<Omit<A, keyof import("effect/dist/declarations/src/Equal").Equal>, {}> extends true ? void : Omit<A, keyof import("effect/dist/declarations/src/Equal").Equal>) => Data.Data<A & {
7
+ declare const DisabledSemverGroup_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").Equals<Omit<A, keyof import("effect/Equal").Equal>, {}> extends true ? void : { readonly [P in keyof A as P extends "_tag" | keyof import("effect/Equal").Equal ? never : P]: A[P]; }) => Data.Data<Readonly<A> & {
8
8
  readonly _tag: "Disabled";
9
9
  }>;
10
10
  /**
@@ -8,13 +8,13 @@ const report_1 = require("../report");
8
8
  * instance is assigned to this group. This group will allow anything.
9
9
  */
10
10
  class DisabledSemverGroup extends effect_1.Data.TaggedClass('Disabled') {
11
+ groupType = 'semverGroup';
11
12
  constructor(isCatchAll, config) {
12
13
  super({
13
14
  config,
14
15
  instances: [],
15
16
  isCatchAll,
16
17
  });
17
- this.groupType = 'semverGroup';
18
18
  }
19
19
  canAdd(_) {
20
20
  return true;
@@ -5,7 +5,7 @@ import type { Instance } from '../get-instances/instance';
5
5
  import { Report } from '../report';
6
6
  import type { Specifier } from '../specifier';
7
7
  import type { NonSemverError } from '../specifier/lib/non-semver-error';
8
- declare const FilteredOutSemverGroup_base: new <A extends Record<string, any>>(args: import("effect/Types").Equals<Omit<A, keyof import("effect/dist/declarations/src/Equal").Equal>, {}> extends true ? void : Omit<A, keyof import("effect/dist/declarations/src/Equal").Equal>) => Data.Data<A & {
8
+ declare const FilteredOutSemverGroup_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").Equals<Omit<A, keyof import("effect/Equal").Equal>, {}> extends true ? void : { readonly [P in keyof A as P extends "_tag" | keyof import("effect/Equal").Equal ? never : P]: A[P]; }) => Data.Data<Readonly<A> & {
9
9
  readonly _tag: "FilteredOut";
10
10
  }>;
11
11
  /**
@@ -9,6 +9,7 @@ const report_1 = require("../report");
9
9
  * group and nothing will be changed.
10
10
  */
11
11
  class FilteredOutSemverGroup extends effect_1.Data.TaggedClass('FilteredOut') {
12
+ groupType = 'semverGroup';
12
13
  constructor(ctx) {
13
14
  super({
14
15
  config: {
@@ -20,7 +21,6 @@ class FilteredOutSemverGroup extends effect_1.Data.TaggedClass('FilteredOut') {
20
21
  filter: (0, get_filter_1.getFilter)(ctx.config),
21
22
  instances: [],
22
23
  });
23
- this.groupType = 'semverGroup';
24
24
  }
25
25
  canAdd(instance) {
26
26
  return instance.name.search(new RegExp(this.filter)) === -1;
@@ -4,7 +4,7 @@ import type { Instance } from '../get-instances/instance';
4
4
  import { Report } from '../report';
5
5
  import type { Specifier } from '../specifier';
6
6
  import type { NonSemverError } from '../specifier/lib/non-semver-error';
7
- declare const IgnoredSemverGroup_base: new <A extends Record<string, any>>(args: import("effect/Types").Equals<Omit<A, keyof import("effect/dist/declarations/src/Equal").Equal>, {}> extends true ? void : Omit<A, keyof import("effect/dist/declarations/src/Equal").Equal>) => Data.Data<A & {
7
+ declare const IgnoredSemverGroup_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").Equals<Omit<A, keyof import("effect/Equal").Equal>, {}> extends true ? void : { readonly [P in keyof A as P extends "_tag" | keyof import("effect/Equal").Equal ? never : P]: A[P]; }) => Data.Data<Readonly<A> & {
8
8
  readonly _tag: "Ignored";
9
9
  }>;
10
10
  /** Every instance in this group is ignored and nothing will be changed */
@@ -5,12 +5,12 @@ const effect_1 = require("effect");
5
5
  const report_1 = require("../report");
6
6
  /** Every instance in this group is ignored and nothing will be changed */
7
7
  class IgnoredSemverGroup extends effect_1.Data.TaggedClass('Ignored') {
8
+ groupType = 'semverGroup';
8
9
  constructor(config) {
9
10
  super({
10
11
  config,
11
12
  instances: [],
12
13
  });
13
- this.groupType = 'semverGroup';
14
14
  }
15
15
  canAdd(_) {
16
16
  return true;
@@ -10,7 +10,7 @@ export declare namespace SemverGroup {
10
10
  export type Ignored = IgnoredSemverGroup;
11
11
  export type WithRange = WithRangeSemverGroup;
12
12
  export type Any = Union.Strict<Disabled | FilteredOut | Ignored | WithRange>;
13
- const ConfigError_base: new <A extends Record<string, any>>(args: import("effect/Types").Equals<Omit<A, keyof import("effect/dist/declarations/src/Equal").Equal>, {}> extends true ? void : Omit<A, keyof import("effect/dist/declarations/src/Equal").Equal>) => Data.Data<A & {
13
+ const ConfigError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").Equals<Omit<A, keyof import("effect/Equal").Equal>, {}> extends true ? void : { readonly [P in keyof A as P extends "_tag" | keyof import("effect/Equal").Equal ? never : P]: A[P]; }) => Data.Data<Readonly<A> & {
14
14
  readonly _tag: "SemverGroupConfigError";
15
15
  }>;
16
16
  export class ConfigError extends ConfigError_base<{
@@ -4,7 +4,7 @@ import type { Instance } from '../get-instances/instance';
4
4
  import { Report } from '../report';
5
5
  import { Specifier } from '../specifier';
6
6
  import type { NonSemverError } from '../specifier/lib/non-semver-error';
7
- declare const WithRangeSemverGroup_base: new <A extends Record<string, any>>(args: import("effect/Types").Equals<Omit<A, keyof import("effect/dist/declarations/src/Equal").Equal>, {}> extends true ? void : Omit<A, keyof import("effect/dist/declarations/src/Equal").Equal>) => Data.Data<A & {
7
+ declare const WithRangeSemverGroup_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").Equals<Omit<A, keyof import("effect/Equal").Equal>, {}> extends true ? void : { readonly [P in keyof A as P extends "_tag" | keyof import("effect/Equal").Equal ? never : P]: A[P]; }) => Data.Data<Readonly<A> & {
8
8
  readonly _tag: "WithRange";
9
9
  }>;
10
10
  export declare class WithRangeSemverGroup extends WithRangeSemverGroup_base<{
@@ -6,13 +6,13 @@ const set_semver_range_1 = require("../lib/set-semver-range");
6
6
  const report_1 = require("../report");
7
7
  const specifier_1 = require("../specifier");
8
8
  class WithRangeSemverGroup extends effect_1.Data.TaggedClass('WithRange') {
9
+ groupType = 'semverGroup';
9
10
  constructor(isCatchAll, config) {
10
11
  super({
11
12
  config,
12
13
  instances: [],
13
14
  isCatchAll,
14
15
  });
15
- this.groupType = 'semverGroup';
16
16
  this.getFixed = this.getFixed.bind(this);
17
17
  }
18
18
  canAdd(_) {
@@ -7,10 +7,7 @@ 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
- constructor() {
11
- super(...arguments);
12
- this._tag = 'AliasSpecifier';
13
- }
10
+ _tag = 'AliasSpecifier';
14
11
  /** Return the version portion if it is valid semver */
15
12
  getSemver() {
16
13
  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,9 +6,27 @@ const _1 = require(".");
6
6
  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
+ /** should be overridden by sub classes */
10
+ _tag = 'BaseSpecifier';
11
+ /** The raw semver/workspace:/git etc version value */
12
+ raw;
13
+ /**
14
+ * A `Specifier` describes the version specifier (eg "^1.4.4") of a given
15
+ * instance.
16
+ *
17
+ * Initially there will be a `Specifier` which describes the version as it is
18
+ * on disk, but other `Specifier`s will need to be created which reflect what
19
+ * the version should be once fixed – first for the instance's version group
20
+ * and second for its semver group.
21
+ *
22
+ * The intermediate and final variants of `Specifier` could differ along the
23
+ * way and whether we're linting the current state of the monorepo or
24
+ * determining whether possible fixes will ultimately still have a valid
25
+ * version and range, each one has a reference back to the original `Instance`
26
+ * for writing back to it when we do finally commit our fixes once verified.
27
+ */
28
+ instance;
9
29
  constructor(data) {
10
- /** should be overridden by sub classes */
11
- this._tag = 'BaseSpecifier';
12
30
  this.raw = data.raw;
13
31
  this.instance = data.instance;
14
32
  }
@@ -4,13 +4,15 @@ 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';
8
+ raw;
9
+ instance;
7
10
  constructor(data) {
8
- this._tag = 'DeleteSpecifier';
9
- this.getSemver = base_1.BaseSpecifier.prototype.getSemver;
10
- this.setSemver = base_1.BaseSpecifier.prototype.setSemver;
11
- this.replaceWith = base_1.BaseSpecifier.prototype.replaceWith;
12
11
  this.raw = data.raw;
13
12
  this.instance = data.instance;
14
13
  }
14
+ getSemver = base_1.BaseSpecifier.prototype.getSemver;
15
+ setSemver = base_1.BaseSpecifier.prototype.setSemver;
16
+ replaceWith = base_1.BaseSpecifier.prototype.replaceWith;
15
17
  }
16
18
  exports.DeleteSpecifier = DeleteSpecifier;
@@ -4,9 +4,6 @@ exports.FileSpecifier = void 0;
4
4
  const base_1 = require("./base");
5
5
  /** @example */
6
6
  class FileSpecifier extends base_1.BaseSpecifier {
7
- constructor() {
8
- super(...arguments);
9
- this._tag = 'FileSpecifier';
10
- }
7
+ _tag = 'FileSpecifier';
11
8
  }
12
9
  exports.FileSpecifier = FileSpecifier;
@@ -8,10 +8,7 @@ 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
- constructor() {
12
- super(...arguments);
13
- this._tag = 'HostedGitSpecifier';
14
- }
11
+ _tag = 'HostedGitSpecifier';
15
12
  /** Return the git tag if it is valid semver */
16
13
  getSemver() {
17
14
  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)));
@@ -1,6 +1,6 @@
1
1
  import { Data, Effect } from 'effect';
2
2
  import type { Specifier } from '..';
3
- declare const NonSemverError_base: new <A extends Record<string, any>>(args: import("effect/Types").Equals<Omit<A, keyof import("effect/dist/declarations/src/Equal").Equal>, {}> extends true ? void : Omit<A, keyof import("effect/dist/declarations/src/Equal").Equal>) => Data.Data<A & {
3
+ declare const NonSemverError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").Equals<Omit<A, keyof import("effect/Equal").Equal>, {}> extends true ? void : { readonly [P in keyof A as P extends "_tag" | keyof import("effect/Equal").Equal ? never : P]: A[P]; }) => Data.Data<Readonly<A> & {
4
4
  readonly _tag: "NonSemverError";
5
5
  }>;
6
6
  export declare class NonSemverError extends NonSemverError_base<{
@@ -10,10 +10,7 @@ const non_semver_error_1 = require("./lib/non-semver-error");
10
10
  * @example "^1.2.3"
11
11
  */
12
12
  class RangeSpecifier extends base_1.BaseSpecifier {
13
- constructor() {
14
- super(...arguments);
15
- this._tag = 'RangeSpecifier';
16
- }
13
+ _tag = 'RangeSpecifier';
17
14
  /** Return the semver version including the range */
18
15
  getSemver() {
19
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.fetchSpec));
@@ -7,9 +7,6 @@ const base_1 = require("./base");
7
7
  * @example "made-up-by-some-dev"
8
8
  */
9
9
  class TagSpecifier extends base_1.BaseSpecifier {
10
- constructor() {
11
- super(...arguments);
12
- this._tag = 'TagSpecifier';
13
- }
10
+ _tag = 'TagSpecifier';
14
11
  }
15
12
  exports.TagSpecifier = TagSpecifier;
@@ -4,9 +4,6 @@ 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
- constructor() {
8
- super(...arguments);
9
- this._tag = 'UnsupportedSpecifier';
10
- }
7
+ _tag = 'UnsupportedSpecifier';
11
8
  }
12
9
  exports.UnsupportedSpecifier = UnsupportedSpecifier;
@@ -4,10 +4,6 @@ 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
- constructor() {
8
- super(...arguments);
9
- this._tag = 'UrlSpecifier';
10
- // @TODO: If file name is semver, return that in getSemver()
11
- }
7
+ _tag = 'UrlSpecifier';
12
8
  }
13
9
  exports.UrlSpecifier = UrlSpecifier;
@@ -10,10 +10,7 @@ const non_semver_error_1 = require("./lib/non-semver-error");
10
10
  * @example "1.4.4"
11
11
  */
12
12
  class VersionSpecifier extends base_1.BaseSpecifier {
13
- constructor() {
14
- super(...arguments);
15
- this._tag = 'VersionSpecifier';
16
- }
13
+ _tag = 'VersionSpecifier';
17
14
  /** Return the semver version */
18
15
  getSemver() {
19
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.fetchSpec));
@@ -6,10 +6,7 @@ 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
- constructor() {
10
- super(...arguments);
11
- this._tag = 'WorkspaceProtocolSpecifier';
12
- }
9
+ _tag = 'WorkspaceProtocolSpecifier';
13
10
  /**
14
11
  * Return an equivalent value which actually is semver, so that it can be used
15
12
  * with tools which expect values which conform to the spec. This value is
@@ -8,8 +8,11 @@ const delete_1 = require("../version-group/lib/delete");
8
8
  const get_non_empty_string_prop_1 = require("./lib/get-non-empty-string-prop");
9
9
  const getOptionOfObject = effect_1.Option.liftPredicate((is_object_1.isObject));
10
10
  class NameAndVersionPropsStrategy {
11
+ _tag = 'name~version';
12
+ name;
13
+ path;
14
+ namePath;
11
15
  constructor(name, path, namePath) {
12
- this._tag = 'name~version';
13
16
  this.name = name;
14
17
  this.path = path;
15
18
  this.namePath = namePath;
@@ -10,8 +10,10 @@ const get_non_empty_string_prop_1 = require("./lib/get-non-empty-string-prop");
10
10
  const getOptionOfNonEmptyString = effect_1.Option.liftPredicate(is_non_empty_string_1.isNonEmptyString);
11
11
  const getOptionOfNonEmptyObject = effect_1.Option.liftPredicate((is_non_empty_object_1.isNonEmptyObject));
12
12
  class NamedVersionStringStrategy {
13
+ _tag = 'name@version';
14
+ name;
15
+ path;
13
16
  constructor(name, path) {
14
- this._tag = 'name@version';
15
17
  this.name = name;
16
18
  this.path = path;
17
19
  }
@@ -8,8 +8,10 @@ const delete_1 = require("../version-group/lib/delete");
8
8
  const get_non_empty_string_prop_1 = require("./lib/get-non-empty-string-prop");
9
9
  const getOptionOfNonEmptyObject = effect_1.Option.liftPredicate((is_non_empty_object_1.isNonEmptyObject));
10
10
  class UnnamedVersionStringStrategy {
11
+ _tag = 'version';
12
+ name;
13
+ path;
11
14
  constructor(name, path) {
12
- this._tag = 'version';
13
15
  this.name = name;
14
16
  this.path = path;
15
17
  }
@@ -7,8 +7,10 @@ const get_1 = require("../lib/get");
7
7
  const delete_1 = require("../version-group/lib/delete");
8
8
  const getOptionOfNonEmptyObject = effect_1.Option.liftPredicate((is_non_empty_object_1.isNonEmptyObject));
9
9
  class VersionsByNameStrategy {
10
+ _tag = 'versionsByName';
11
+ name;
12
+ path;
10
13
  constructor(name, path) {
11
- this._tag = 'versionsByName';
12
14
  this.name = name;
13
15
  this.path = path;
14
16
  }
@@ -2,7 +2,7 @@ import { Data, Effect } from 'effect';
2
2
  import type { VersionGroupConfig } from '../config/types';
3
3
  import type { Instance } from '../get-instances/instance';
4
4
  import { Report } from '../report';
5
- declare const BannedVersionGroup_base: new <A extends Record<string, any>>(args: import("effect/Types").Equals<Omit<A, keyof import("effect/dist/declarations/src/Equal").Equal>, {}> extends true ? void : Omit<A, keyof import("effect/dist/declarations/src/Equal").Equal>) => Data.Data<A & {
5
+ declare const BannedVersionGroup_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").Equals<Omit<A, keyof import("effect/Equal").Equal>, {}> extends true ? void : { readonly [P in keyof A as P extends "_tag" | keyof import("effect/Equal").Equal ? never : P]: A[P]; }) => Data.Data<Readonly<A> & {
6
6
  readonly _tag: "Banned";
7
7
  }>;
8
8
  export declare class BannedVersionGroup extends BannedVersionGroup_base<{
@@ -7,12 +7,12 @@ const specifier_1 = require("../specifier");
7
7
  const delete_1 = require("./lib/delete");
8
8
  const group_by_1 = require("./lib/group-by");
9
9
  class BannedVersionGroup extends effect_1.Data.TaggedClass('Banned') {
10
+ groupType = 'versionGroup';
10
11
  constructor(config) {
11
12
  super({
12
13
  config,
13
14
  instances: [],
14
15
  });
15
- this.groupType = 'versionGroup';
16
16
  }
17
17
  canAdd(_) {
18
18
  return true;
@@ -3,7 +3,7 @@ import type { GroupConfig } from '../config/types';
3
3
  import type { Ctx } from '../get-context';
4
4
  import type { Instance } from '../get-instances/instance';
5
5
  import { Report } from '../report';
6
- declare const FilteredOutVersionGroup_base: new <A extends Record<string, any>>(args: import("effect/Types").Equals<Omit<A, keyof import("effect/dist/declarations/src/Equal").Equal>, {}> extends true ? void : Omit<A, keyof import("effect/dist/declarations/src/Equal").Equal>) => Data.Data<A & {
6
+ declare const FilteredOutVersionGroup_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").Equals<Omit<A, keyof import("effect/Equal").Equal>, {}> extends true ? void : { readonly [P in keyof A as P extends "_tag" | keyof import("effect/Equal").Equal ? never : P]: A[P]; }) => Data.Data<Readonly<A> & {
7
7
  readonly _tag: "FilteredOut";
8
8
  }>;
9
9
  export declare class FilteredOutVersionGroup extends FilteredOutVersionGroup_base<{
@@ -6,6 +6,7 @@ const get_filter_1 = require("../config/get-filter");
6
6
  const report_1 = require("../report");
7
7
  const group_by_1 = require("./lib/group-by");
8
8
  class FilteredOutVersionGroup extends effect_1.Data.TaggedClass('FilteredOut') {
9
+ groupType = 'versionGroup';
9
10
  constructor(ctx) {
10
11
  super({
11
12
  config: {
@@ -17,7 +18,6 @@ class FilteredOutVersionGroup extends effect_1.Data.TaggedClass('FilteredOut') {
17
18
  filter: (0, get_filter_1.getFilter)(ctx.config),
18
19
  instances: [],
19
20
  });
20
- this.groupType = 'versionGroup';
21
21
  }
22
22
  canAdd(instance) {
23
23
  return instance.name.search(new RegExp(this.filter)) === -1;
@@ -2,7 +2,7 @@ import { Data, Effect } from 'effect';
2
2
  import type { VersionGroupConfig } from '../config/types';
3
3
  import type { Instance } from '../get-instances/instance';
4
4
  import { Report } from '../report';
5
- declare const IgnoredVersionGroup_base: new <A extends Record<string, any>>(args: import("effect/Types").Equals<Omit<A, keyof import("effect/dist/declarations/src/Equal").Equal>, {}> extends true ? void : Omit<A, keyof import("effect/dist/declarations/src/Equal").Equal>) => Data.Data<A & {
5
+ declare const IgnoredVersionGroup_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").Equals<Omit<A, keyof import("effect/Equal").Equal>, {}> extends true ? void : { readonly [P in keyof A as P extends "_tag" | keyof import("effect/Equal").Equal ? never : P]: A[P]; }) => Data.Data<Readonly<A> & {
6
6
  readonly _tag: "Ignored";
7
7
  }>;
8
8
  export declare class IgnoredVersionGroup extends IgnoredVersionGroup_base<{
@@ -5,12 +5,12 @@ const effect_1 = require("effect");
5
5
  const report_1 = require("../report");
6
6
  const group_by_1 = require("./lib/group-by");
7
7
  class IgnoredVersionGroup extends effect_1.Data.TaggedClass('Ignored') {
8
+ groupType = 'versionGroup';
8
9
  constructor(config) {
9
10
  super({
10
11
  config,
11
12
  instances: [],
12
13
  });
13
- this.groupType = 'versionGroup';
14
14
  }
15
15
  canAdd(_) {
16
16
  return true;
@@ -16,7 +16,7 @@ export declare namespace VersionGroup {
16
16
  export type SnappedTo = SnappedToVersionGroup;
17
17
  export type Standard = StandardVersionGroup;
18
18
  export type Any = Union.Strict<Banned | FilteredOut | Ignored | Pinned | SameRange | SnappedTo | Standard>;
19
- const ConfigError_base: new <A extends Record<string, any>>(args: import("effect/Types").Equals<Omit<A, keyof import("effect/dist/declarations/src/Equal").Equal>, {}> extends true ? void : Omit<A, keyof import("effect/dist/declarations/src/Equal").Equal>) => Data.Data<A & {
19
+ const ConfigError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").Equals<Omit<A, keyof import("effect/Equal").Equal>, {}> extends true ? void : { readonly [P in keyof A as P extends "_tag" | keyof import("effect/Equal").Equal ? never : P]: A[P]; }) => Data.Data<Readonly<A> & {
20
20
  readonly _tag: "VersionGroupConfigError";
21
21
  }>;
22
22
  export class ConfigError extends ConfigError_base<{
@@ -2,7 +2,7 @@ import { Data, Effect } from 'effect';
2
2
  import type { VersionGroupConfig } from '../config/types';
3
3
  import type { Instance } from '../get-instances/instance';
4
4
  import { Report } from '../report';
5
- declare const PinnedVersionGroup_base: new <A extends Record<string, any>>(args: import("effect/Types").Equals<Omit<A, keyof import("effect/dist/declarations/src/Equal").Equal>, {}> extends true ? void : Omit<A, keyof import("effect/dist/declarations/src/Equal").Equal>) => Data.Data<A & {
5
+ declare const PinnedVersionGroup_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").Equals<Omit<A, keyof import("effect/Equal").Equal>, {}> extends true ? void : { readonly [P in keyof A as P extends "_tag" | keyof import("effect/Equal").Equal ? never : P]: A[P]; }) => Data.Data<Readonly<A> & {
6
6
  readonly _tag: "Pinned";
7
7
  }>;
8
8
  export declare class PinnedVersionGroup extends PinnedVersionGroup_base<{
@@ -6,12 +6,12 @@ const report_1 = require("../report");
6
6
  const specifier_1 = require("../specifier");
7
7
  const group_by_1 = require("./lib/group-by");
8
8
  class PinnedVersionGroup extends effect_1.Data.TaggedClass('Pinned') {
9
+ groupType = 'versionGroup';
9
10
  constructor(config) {
10
11
  super({
11
12
  config,
12
13
  instances: [],
13
14
  });
14
- this.groupType = 'versionGroup';
15
15
  }
16
16
  canAdd(_) {
17
17
  return true;