syncpack 12.3.0 → 12.3.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 (206) hide show
  1. package/dist/bin-fix-mismatches/fix-mismatches.d.ts +9 -9
  2. package/dist/bin-fix-mismatches/fix-mismatches.js +43 -54
  3. package/dist/bin-fix-mismatches/index.js +26 -31
  4. package/dist/bin-format/format.d.ts +6 -6
  5. package/dist/bin-format/format.js +27 -32
  6. package/dist/bin-format/index.js +20 -25
  7. package/dist/bin-lint/index.js +15 -20
  8. package/dist/bin-lint/lint.d.ts +4 -4
  9. package/dist/bin-lint/lint.js +28 -35
  10. package/dist/bin-lint-semver-ranges/index.js +24 -29
  11. package/dist/bin-lint-semver-ranges/lint-semver-ranges.d.ts +8 -8
  12. package/dist/bin-lint-semver-ranges/lint-semver-ranges.js +34 -44
  13. package/dist/bin-list/index.js +24 -29
  14. package/dist/bin-list/list.d.ts +7 -7
  15. package/dist/bin-list/list.js +55 -64
  16. package/dist/bin-list-mismatches/index.js +24 -29
  17. package/dist/bin-list-mismatches/list-mismatches.d.ts +10 -10
  18. package/dist/bin-list-mismatches/list-mismatches.js +62 -70
  19. package/dist/bin-prompt/index.js +26 -31
  20. package/dist/bin-prompt/prompt.d.ts +4 -4
  21. package/dist/bin-prompt/prompt.js +41 -48
  22. package/dist/bin-set-semver-ranges/index.js +26 -31
  23. package/dist/bin-set-semver-ranges/set-semver-ranges.d.ts +4 -4
  24. package/dist/bin-set-semver-ranges/set-semver-ranges.js +26 -30
  25. package/dist/bin-update/effects.d.ts +18 -18
  26. package/dist/bin-update/effects.js +77 -106
  27. package/dist/bin-update/index.js +23 -28
  28. package/dist/bin-update/update.d.ts +5 -5
  29. package/dist/bin-update/update.js +37 -45
  30. package/dist/bin.js +8 -5
  31. package/dist/config/get-custom-types.d.ts +9 -9
  32. package/dist/config/get-custom-types.js +22 -27
  33. package/dist/config/get-enabled-types.d.ts +8 -8
  34. package/dist/config/get-enabled-types.js +42 -48
  35. package/dist/config/get-filter.d.ts +1 -1
  36. package/dist/config/get-filter.js +6 -10
  37. package/dist/config/get-indent.d.ts +1 -1
  38. package/dist/config/get-indent.js +6 -10
  39. package/dist/config/get-sort-az.d.ts +1 -1
  40. package/dist/config/get-sort-az.js +6 -10
  41. package/dist/config/get-sort-exports.d.ts +1 -1
  42. package/dist/config/get-sort-exports.js +6 -10
  43. package/dist/config/get-sort-first.d.ts +1 -1
  44. package/dist/config/get-sort-first.js +6 -10
  45. package/dist/config/get-source.d.ts +1 -1
  46. package/dist/config/get-source.js +4 -8
  47. package/dist/config/tag.d.ts +1 -1
  48. package/dist/config/tag.js +2 -5
  49. package/dist/config/types.d.ts +2 -5
  50. package/dist/config/types.js +1 -2
  51. package/dist/constants.js +7 -10
  52. package/dist/error-handlers/default-error-handlers.d.ts +10 -10
  53. package/dist/error-handlers/default-error-handlers.js +55 -61
  54. package/dist/get-context/index.d.ts +5 -5
  55. package/dist/get-context/index.js +13 -17
  56. package/dist/get-context/lib/key-by.js +1 -5
  57. package/dist/get-instances/index.d.ts +7 -7
  58. package/dist/get-instances/index.js +19 -23
  59. package/dist/get-instances/instance.d.ts +7 -7
  60. package/dist/get-instances/instance.js +4 -8
  61. package/dist/get-package-json-files/get-file-paths.d.ts +7 -7
  62. package/dist/get-package-json-files/get-file-paths.js +10 -15
  63. package/dist/get-package-json-files/get-patterns/get-lerna-patterns.d.ts +2 -2
  64. package/dist/get-package-json-files/get-patterns/get-lerna-patterns.js +8 -12
  65. package/dist/get-package-json-files/get-patterns/get-pnpm-patterns.d.ts +2 -2
  66. package/dist/get-package-json-files/get-patterns/get-pnpm-patterns.js +8 -12
  67. package/dist/get-package-json-files/get-patterns/get-yarn-patterns.d.ts +2 -2
  68. package/dist/get-package-json-files/get-patterns/get-yarn-patterns.js +14 -18
  69. package/dist/get-package-json-files/get-patterns/index.d.ts +3 -3
  70. package/dist/get-package-json-files/get-patterns/index.js +11 -15
  71. package/dist/get-package-json-files/index.d.ts +8 -8
  72. package/dist/get-package-json-files/index.js +6 -10
  73. package/dist/get-package-json-files/package-json-file.d.ts +6 -6
  74. package/dist/get-package-json-files/package-json-file.js +8 -12
  75. package/dist/guards/can-add-to-group.d.ts +4 -4
  76. package/dist/guards/can-add-to-group.js +10 -14
  77. package/dist/guards/is-semver.js +3 -7
  78. package/dist/guards/is-valid-semver-range.d.ts +1 -1
  79. package/dist/guards/is-valid-semver-range.js +12 -16
  80. package/dist/index.d.ts +1 -1
  81. package/dist/index.js +1 -2
  82. package/dist/io/ask-for-choice.d.ts +5 -5
  83. package/dist/io/ask-for-choice.js +5 -9
  84. package/dist/io/ask-for-input.d.ts +5 -5
  85. package/dist/io/ask-for-input.js +5 -9
  86. package/dist/io/exit-if-invalid.d.ts +3 -3
  87. package/dist/io/exit-if-invalid.js +5 -9
  88. package/dist/io/glob-sync.d.ts +5 -5
  89. package/dist/io/glob-sync.js +4 -9
  90. package/dist/io/index.d.ts +8 -8
  91. package/dist/io/index.js +12 -38
  92. package/dist/io/read-config-file.d.ts +7 -0
  93. package/dist/io/read-config-file.js +22 -0
  94. package/dist/io/read-file-sync.d.ts +5 -5
  95. package/dist/io/read-file-sync.js +4 -9
  96. package/dist/io/read-json-file-sync.d.ts +8 -8
  97. package/dist/io/read-json-file-sync.js +10 -16
  98. package/dist/io/read-yaml-file-sync.d.ts +5 -5
  99. package/dist/io/read-yaml-file-sync.js +4 -8
  100. package/dist/io/to-json.d.ts +2 -2
  101. package/dist/io/to-json.js +8 -12
  102. package/dist/io/write-file-sync.d.ts +5 -5
  103. package/dist/io/write-file-sync.js +5 -10
  104. package/dist/io/write-if-changed.d.ts +4 -4
  105. package/dist/io/write-if-changed.js +9 -16
  106. package/dist/lib/format-repository-url.js +1 -5
  107. package/dist/lib/get-group-header.d.ts +2 -2
  108. package/dist/lib/get-group-header.js +4 -12
  109. package/dist/lib/get.d.ts +10 -10
  110. package/dist/lib/get.js +15 -19
  111. package/dist/lib/pad-start.js +1 -5
  112. package/dist/lib/ring-buffer.js +1 -5
  113. package/dist/lib/set-semver-range.d.ts +1 -1
  114. package/dist/lib/set-semver-range.js +8 -12
  115. package/dist/lib/show-help-on-error.js +3 -10
  116. package/dist/lib/sort-by-name.js +1 -5
  117. package/dist/lib/with-logger.d.ts +1 -1
  118. package/dist/lib/with-logger.js +17 -24
  119. package/dist/option.d.ts +1 -1
  120. package/dist/option.js +8 -14
  121. package/dist/report.d.ts +2 -2
  122. package/dist/report.js +2 -5
  123. package/dist/semver-group/create-semver-groups.d.ts +3 -3
  124. package/dist/semver-group/create-semver-groups.js +28 -32
  125. package/dist/semver-group/disabled.d.ts +11 -11
  126. package/dist/semver-group/disabled.js +6 -10
  127. package/dist/semver-group/filtered-out.d.ts +12 -12
  128. package/dist/semver-group/filtered-out.js +8 -12
  129. package/dist/semver-group/ignored.d.ts +11 -11
  130. package/dist/semver-group/ignored.js +6 -10
  131. package/dist/semver-group/index.d.ts +6 -7
  132. package/dist/semver-group/index.js +4 -7
  133. package/dist/semver-group/with-range.d.ts +11 -11
  134. package/dist/semver-group/with-range.js +13 -17
  135. package/dist/specifier/alias.d.ts +5 -5
  136. package/dist/specifier/alias.js +9 -13
  137. package/dist/specifier/base.d.ts +7 -7
  138. package/dist/specifier/base.js +9 -13
  139. package/dist/specifier/delete.d.ts +5 -5
  140. package/dist/specifier/delete.js +5 -9
  141. package/dist/specifier/exact.d.ts +6 -6
  142. package/dist/specifier/exact.js +7 -11
  143. package/dist/specifier/file.d.ts +1 -1
  144. package/dist/specifier/file.js +2 -6
  145. package/dist/specifier/hosted-git.d.ts +5 -5
  146. package/dist/specifier/hosted-git.js +9 -13
  147. package/dist/specifier/index.d.ts +13 -13
  148. package/dist/specifier/index.js +28 -31
  149. package/dist/specifier/latest.d.ts +6 -6
  150. package/dist/specifier/latest.js +7 -11
  151. package/dist/specifier/lib/non-semver-error.d.ts +5 -5
  152. package/dist/specifier/lib/non-semver-error.js +3 -7
  153. package/dist/specifier/lib/parse-specifier.d.ts +1 -1
  154. package/dist/specifier/lib/parse-specifier.js +4 -11
  155. package/dist/specifier/lib/specific-registry-result.js +1 -2
  156. package/dist/specifier/range.d.ts +6 -6
  157. package/dist/specifier/range.js +7 -11
  158. package/dist/specifier/tag.d.ts +2 -2
  159. package/dist/specifier/tag.js +2 -6
  160. package/dist/specifier/unsupported.d.ts +1 -1
  161. package/dist/specifier/unsupported.js +2 -6
  162. package/dist/specifier/url.d.ts +1 -1
  163. package/dist/specifier/url.js +2 -6
  164. package/dist/specifier/workspace-protocol.d.ts +7 -7
  165. package/dist/specifier/workspace-protocol.js +9 -13
  166. package/dist/strategy/lib/get-non-empty-string-prop.d.ts +2 -2
  167. package/dist/strategy/lib/get-non-empty-string-prop.js +6 -10
  168. package/dist/strategy/name-and-version-props.d.ts +4 -4
  169. package/dist/strategy/name-and-version-props.js +19 -23
  170. package/dist/strategy/named-version-string.d.ts +4 -4
  171. package/dist/strategy/named-version-string.js +20 -24
  172. package/dist/strategy/unnamed-version-string.d.ts +4 -4
  173. package/dist/strategy/unnamed-version-string.js +17 -21
  174. package/dist/strategy/versions-by-name.d.ts +4 -4
  175. package/dist/strategy/versions-by-name.js +11 -15
  176. package/dist/version-group/banned.d.ts +7 -7
  177. package/dist/version-group/banned.js +8 -12
  178. package/dist/version-group/create-version-groups.d.ts +3 -3
  179. package/dist/version-group/create-version-groups.js +34 -38
  180. package/dist/version-group/filtered-out.d.ts +8 -8
  181. package/dist/version-group/filtered-out.js +8 -12
  182. package/dist/version-group/ignored.d.ts +7 -7
  183. package/dist/version-group/ignored.js +6 -10
  184. package/dist/version-group/index.d.ts +9 -10
  185. package/dist/version-group/index.js +4 -7
  186. package/dist/version-group/lib/clean.js +4 -11
  187. package/dist/version-group/lib/delete.js +1 -4
  188. package/dist/version-group/lib/get-highest-version.d.ts +2 -2
  189. package/dist/version-group/lib/get-highest-version.js +3 -7
  190. package/dist/version-group/lib/get-lowest-version.d.ts +2 -2
  191. package/dist/version-group/lib/get-lowest-version.js +3 -7
  192. package/dist/version-group/lib/get-preferred-version.d.ts +4 -4
  193. package/dist/version-group/lib/get-preferred-version.js +17 -24
  194. package/dist/version-group/lib/get-range-score.js +13 -17
  195. package/dist/version-group/lib/group-by.js +1 -5
  196. package/dist/version-group/pinned.d.ts +7 -7
  197. package/dist/version-group/pinned.js +8 -12
  198. package/dist/version-group/same-range.d.ts +8 -8
  199. package/dist/version-group/same-range.js +23 -30
  200. package/dist/version-group/snapped-to.d.ts +7 -7
  201. package/dist/version-group/snapped-to.js +20 -24
  202. package/dist/version-group/standard.d.ts +7 -7
  203. package/dist/version-group/standard.js +29 -33
  204. package/package.json +30 -37
  205. package/dist/io/read-config-file-sync.d.ts +0 -7
  206. package/dist/io/read-config-file-sync.js +0 -26
@@ -1,11 +1,8 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.WorkspaceProtocolSpecifier = void 0;
4
- const effect_1 = require("effect");
5
- const _1 = require(".");
6
- const base_1 = require("./base");
1
+ import { Effect } from 'effect';
2
+ import { BaseSpecifier } from './base.js';
3
+ import { Specifier } from './index.js';
7
4
  /** Represents "workspace:*" and "workspace:~" */
8
- class WorkspaceProtocolSpecifier extends base_1.BaseSpecifier {
5
+ export class WorkspaceProtocolSpecifier extends BaseSpecifier {
9
6
  _tag = 'WorkspaceProtocol';
10
7
  /** The public name referenced in config */
11
8
  name = 'workspace-protocol';
@@ -16,23 +13,22 @@ class WorkspaceProtocolSpecifier extends base_1.BaseSpecifier {
16
13
  */
17
14
  getSemverEquivalent(ctx) {
18
15
  if (this.raw === 'workspace:*') {
19
- return effect_1.Effect.succeed('*');
16
+ return Effect.succeed('*');
20
17
  }
21
18
  if (this.raw === 'workspace:~' || this.raw === 'workspace:^') {
22
19
  const range = this.raw.replace('workspace:', '');
23
20
  const local = ctx.packageJsonFilesByName[this.instance.name];
24
21
  const version = local?.jsonFile?.contents?.version;
25
22
  if (version)
26
- return effect_1.Effect.succeed(`${range}${version}`);
23
+ return Effect.succeed(`${range}${version}`);
27
24
  }
28
- return effect_1.Effect.succeed('0.0.0');
25
+ return Effect.succeed('0.0.0');
29
26
  }
30
27
  // @TODO: this name is inaccurate, check how it is used and change logic or rename
31
28
  getSemver() {
32
- return effect_1.Effect.succeed(this.raw);
29
+ return Effect.succeed(this.raw);
33
30
  }
34
31
  setSemver(version) {
35
- return effect_1.Effect.succeed(_1.Specifier.create(this.instance, version));
32
+ return Effect.succeed(Specifier.create(this.instance, version));
36
33
  }
37
34
  }
38
- exports.WorkspaceProtocolSpecifier = WorkspaceProtocolSpecifier;
@@ -1,3 +1,3 @@
1
1
  import { Effect } from 'effect';
2
- import type { PackageJsonFile } from '../../get-package-json-files/package-json-file';
3
- export declare function getNonEmptyStringProp(propPath: string, file: PackageJsonFile): Effect.Effect<never, unknown, string>;
2
+ import type { PackageJsonFile } from '../../get-package-json-files/package-json-file.js';
3
+ export declare function getNonEmptyStringProp(propPath: string, file: PackageJsonFile): Effect.Effect<string, unknown>;
@@ -1,11 +1,7 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getNonEmptyStringProp = void 0;
4
- const effect_1 = require("effect");
5
- const is_non_empty_string_1 = require("tightrope/guard/is-non-empty-string");
6
- const get_1 = require("../../lib/get");
7
- const getOptionOfNonEmptyString = effect_1.Option.liftPredicate(is_non_empty_string_1.isNonEmptyString);
8
- function getNonEmptyStringProp(propPath, file) {
9
- return (0, effect_1.pipe)((0, get_1.get)(file.jsonFile.contents, ...propPath.split('.')), effect_1.Effect.flatMap((value) => getOptionOfNonEmptyString(value)), effect_1.Effect.tapError(() => effect_1.Effect.logDebug(`<${file.jsonFile.shortPath}>.${propPath} is not a non-empty string`)));
1
+ import { Effect, Option, pipe } from 'effect';
2
+ import { isNonEmptyString } from 'tightrope/guard/is-non-empty-string.js';
3
+ import { get } from '../../lib/get.js';
4
+ const getOptionOfNonEmptyString = Option.liftPredicate(isNonEmptyString);
5
+ export function getNonEmptyStringProp(propPath, file) {
6
+ return pipe(get(file.jsonFile.contents, ...propPath.split('.')), Effect.flatMap((value) => getOptionOfNonEmptyString(value)), Effect.tapError(() => Effect.logDebug(`<${file.jsonFile.shortPath}>.${propPath} is not a non-empty string`)));
10
7
  }
11
- exports.getNonEmptyStringProp = getNonEmptyStringProp;
@@ -1,12 +1,12 @@
1
1
  import { Effect } from 'effect';
2
- import type { PackageJsonFile } from '../get-package-json-files/package-json-file';
3
- import type { Delete } from '../version-group/lib/delete';
2
+ import type { PackageJsonFile } from '../get-package-json-files/package-json-file.js';
3
+ import type { Delete } from '../version-group/lib/delete.js';
4
4
  export declare class NameAndVersionPropsStrategy {
5
5
  _tag: string;
6
6
  name: string;
7
7
  path: string;
8
8
  namePath: string;
9
9
  constructor(name: string, path: string, namePath: string);
10
- read(file: PackageJsonFile): Effect.Effect<never, never, [string, string][]>;
11
- write(file: PackageJsonFile, [, version]: [string, string | Delete]): Effect.Effect<never, never, PackageJsonFile>;
10
+ read(file: PackageJsonFile): Effect.Effect<[string, string][]>;
11
+ write(file: PackageJsonFile, [, version]: [string, string | Delete]): Effect.Effect<PackageJsonFile>;
12
12
  }
@@ -1,13 +1,10 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.NameAndVersionPropsStrategy = void 0;
4
- const effect_1 = require("effect");
5
- const is_object_1 = require("tightrope/guard/is-object");
6
- const get_1 = require("../lib/get");
7
- const delete_1 = require("../version-group/lib/delete");
8
- const get_non_empty_string_prop_1 = require("./lib/get-non-empty-string-prop");
9
- const getOptionOfObject = effect_1.Option.liftPredicate((is_object_1.isObject));
10
- class NameAndVersionPropsStrategy {
1
+ import { Effect, identity, Option, pipe } from 'effect';
2
+ import { isObject } from 'tightrope/guard/is-object.js';
3
+ import { get } from '../lib/get.js';
4
+ import { DELETE } from '../version-group/lib/delete.js';
5
+ import { getNonEmptyStringProp } from './lib/get-non-empty-string-prop.js';
6
+ const getOptionOfObject = Option.liftPredicate((isObject));
7
+ export class NameAndVersionPropsStrategy {
11
8
  _tag = 'name~version';
12
9
  name;
13
10
  path;
@@ -18,11 +15,11 @@ class NameAndVersionPropsStrategy {
18
15
  this.namePath = namePath;
19
16
  }
20
17
  read(file) {
21
- return (0, effect_1.pipe)(effect_1.Effect.Do,
18
+ return pipe(Effect.Do,
22
19
  // get the name prop
23
- effect_1.Effect.bind('name', () => (0, get_non_empty_string_prop_1.getNonEmptyStringProp)(this.namePath, file)),
20
+ Effect.bind('name', () => getNonEmptyStringProp(this.namePath, file)),
24
21
  // add the version prop
25
- effect_1.Effect.bind('version', () => (0, effect_1.pipe)((0, get_non_empty_string_prop_1.getNonEmptyStringProp)(this.path, file),
22
+ Effect.bind('version', () => pipe(getNonEmptyStringProp(this.path, file),
26
23
  /**
27
24
  * In order to report a `MissingLocalVersion`, we need to ensure that
28
25
  * a value is returned for `local` package .version properties so we
@@ -34,31 +31,30 @@ class NameAndVersionPropsStrategy {
34
31
  * themselves.
35
32
  */
36
33
  this.name === 'local'
37
- ? effect_1.Effect.catchAll(() => effect_1.Effect.succeed('PACKAGE_JSON_HAS_NO_VERSION'))
38
- : effect_1.Effect.map(effect_1.identity))),
34
+ ? Effect.catchAll(() => Effect.succeed('PACKAGE_JSON_HAS_NO_VERSION'))
35
+ : Effect.map(identity))),
39
36
  // if both are non empty strings, we can return them
40
- effect_1.Effect.map(({ name, version }) => [[name, version]]), effect_1.Effect.tapError(() => effect_1.Effect.logDebug(`NameAndVersionPropsStrategy#${this.name} found nothing at <${file.jsonFile.shortPath}>.${this.path} & .${this.namePath}`)),
37
+ Effect.map(({ name, version }) => [[name, version]]), Effect.tapError(() => Effect.logDebug(`NameAndVersionPropsStrategy#${this.name} found nothing at <${file.jsonFile.shortPath}>.${this.path} & .${this.namePath}`)),
41
38
  // if either are invalid, default to empty
42
- effect_1.Effect.catchAll(() => effect_1.Effect.succeed([])));
39
+ Effect.catchAll(() => Effect.succeed([])));
43
40
  }
44
41
  write(file, [, version]) {
45
42
  const path = this.path;
46
43
  const { contents } = file.jsonFile;
47
44
  const isNestedPath = path.includes('.');
48
- const nextValue = version === delete_1.DELETE ? undefined : version;
45
+ const nextValue = version === DELETE ? undefined : version;
49
46
  if (isNestedPath) {
50
47
  const fullPath = path.split('.');
51
48
  const pathToParent = fullPath.slice(0, fullPath.length - 1).join('.');
52
49
  const key = fullPath.slice(-1).join('');
53
- return (0, effect_1.pipe)((0, get_1.get)(contents, ...pathToParent.split('.')), effect_1.Effect.flatMap(getOptionOfObject), effect_1.Effect.flatMap((parent) => effect_1.Effect.try(() => {
50
+ return pipe(get(contents, ...pathToParent.split('.')), Effect.flatMap(getOptionOfObject), Effect.flatMap((parent) => Effect.try(() => {
54
51
  parent[key] = nextValue;
55
- })), effect_1.Effect.tapError(() => effect_1.Effect.logDebug(`strategy ${this._tag} with name ${this.name} failed to write to <${file.jsonFile.shortPath}>.${this.path}`)), effect_1.Effect.catchAll(() => effect_1.Effect.succeed(file)), effect_1.Effect.map(() => file));
52
+ })), Effect.tapError(() => Effect.logDebug(`strategy ${this._tag} with name ${this.name} failed to write to <${file.jsonFile.shortPath}>.${this.path}`)), Effect.catchAll(() => Effect.succeed(file)), Effect.map(() => file));
56
53
  }
57
54
  else {
58
- return (0, effect_1.pipe)(getOptionOfObject(contents), effect_1.Effect.flatMap((parent) => effect_1.Effect.try(() => {
55
+ return pipe(getOptionOfObject(contents), Effect.flatMap((parent) => Effect.try(() => {
59
56
  parent[this.path] = nextValue;
60
- })), effect_1.Effect.tapError(() => effect_1.Effect.logDebug(`strategy ${this._tag} with name ${this.name} failed to write to <${file.jsonFile.shortPath}>.${this.path}`)), effect_1.Effect.catchAll(() => effect_1.Effect.succeed(file)), effect_1.Effect.map(() => file));
57
+ })), Effect.tapError(() => Effect.logDebug(`strategy ${this._tag} with name ${this.name} failed to write to <${file.jsonFile.shortPath}>.${this.path}`)), Effect.catchAll(() => Effect.succeed(file)), Effect.map(() => file));
61
58
  }
62
59
  }
63
60
  }
64
- exports.NameAndVersionPropsStrategy = NameAndVersionPropsStrategy;
@@ -1,11 +1,11 @@
1
1
  import { Effect } from 'effect';
2
- import type { PackageJsonFile } from '../get-package-json-files/package-json-file';
3
- import type { Delete } from '../version-group/lib/delete';
2
+ import type { PackageJsonFile } from '../get-package-json-files/package-json-file.js';
3
+ import type { Delete } from '../version-group/lib/delete.js';
4
4
  export declare class NamedVersionStringStrategy {
5
5
  _tag: string;
6
6
  name: string;
7
7
  path: string;
8
8
  constructor(name: string, path: string);
9
- read(file: PackageJsonFile): Effect.Effect<never, never, [string, string][]>;
10
- write(file: PackageJsonFile, [name, version]: [string, string | Delete]): Effect.Effect<never, never, PackageJsonFile>;
9
+ read(file: PackageJsonFile): Effect.Effect<[string, string][]>;
10
+ write(file: PackageJsonFile, [name, version]: [string, string | Delete]): Effect.Effect<PackageJsonFile>;
11
11
  }
@@ -1,15 +1,12 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.NamedVersionStringStrategy = void 0;
4
- const effect_1 = require("effect");
5
- const is_non_empty_object_1 = require("tightrope/guard/is-non-empty-object");
6
- const is_non_empty_string_1 = require("tightrope/guard/is-non-empty-string");
7
- const get_1 = require("../lib/get");
8
- const delete_1 = require("../version-group/lib/delete");
9
- const get_non_empty_string_prop_1 = require("./lib/get-non-empty-string-prop");
10
- const getOptionOfNonEmptyString = effect_1.Option.liftPredicate(is_non_empty_string_1.isNonEmptyString);
11
- const getOptionOfNonEmptyObject = effect_1.Option.liftPredicate((is_non_empty_object_1.isNonEmptyObject));
12
- class NamedVersionStringStrategy {
1
+ import { Effect, Option, pipe } from 'effect';
2
+ import { isNonEmptyObject } from 'tightrope/guard/is-non-empty-object.js';
3
+ import { isNonEmptyString } from 'tightrope/guard/is-non-empty-string.js';
4
+ import { get } from '../lib/get.js';
5
+ import { DELETE } from '../version-group/lib/delete.js';
6
+ import { getNonEmptyStringProp } from './lib/get-non-empty-string-prop.js';
7
+ const getOptionOfNonEmptyString = Option.liftPredicate(isNonEmptyString);
8
+ const getOptionOfNonEmptyObject = Option.liftPredicate((isNonEmptyObject));
9
+ export class NamedVersionStringStrategy {
13
10
  _tag = 'name@version';
14
11
  name;
15
12
  path;
@@ -19,35 +16,34 @@ class NamedVersionStringStrategy {
19
16
  }
20
17
  read(file) {
21
18
  const path = this.path;
22
- return (0, effect_1.pipe)(
19
+ return pipe(
23
20
  // get version prop
24
- (0, get_non_empty_string_prop_1.getNonEmptyStringProp)(path, file),
21
+ getNonEmptyStringProp(path, file),
25
22
  // if it is a non empty string, we can read it
26
- effect_1.Effect.map((value) => value.split(/@(.*)/)),
23
+ Effect.map((value) => value.split(/@(.*)/)),
27
24
  // check the string was properly formed
28
- effect_1.Effect.flatMap(([name, version]) => effect_1.Effect.all([getOptionOfNonEmptyString(name), getOptionOfNonEmptyString(version)])),
25
+ Effect.flatMap(([name, version]) => Effect.all([getOptionOfNonEmptyString(name), getOptionOfNonEmptyString(version)])),
29
26
  // return an array of one entry if valid
30
- effect_1.Effect.map(([name, version]) => [[name, version]]), effect_1.Effect.tapError(() => effect_1.Effect.logDebug(`NamedVersionStringStrategy#${this.name} found nothing at <${file.jsonFile.shortPath}>.${this.path}`)),
27
+ Effect.map(([name, version]) => [[name, version]]), Effect.tapError(() => Effect.logDebug(`NamedVersionStringStrategy#${this.name} found nothing at <${file.jsonFile.shortPath}>.${this.path}`)),
31
28
  // if value is invalid, default to empty
32
- effect_1.Effect.catchAll(() => effect_1.Effect.succeed([])));
29
+ Effect.catchAll(() => Effect.succeed([])));
33
30
  }
34
31
  write(file, [name, version]) {
35
32
  const { contents } = file.jsonFile;
36
33
  const isNestedPath = this.path.includes('.');
37
- const nextValue = version === delete_1.DELETE ? undefined : `${name}@${version}`;
34
+ const nextValue = version === DELETE ? undefined : `${name}@${version}`;
38
35
  if (isNestedPath) {
39
36
  const fullPath = this.path.split('.');
40
37
  const pathToParent = fullPath.slice(0, fullPath.length - 1).join('.');
41
38
  const key = fullPath.slice(-1).join('');
42
- return (0, effect_1.pipe)((0, get_1.get)(contents, ...pathToParent.split('.')), effect_1.Effect.flatMap(getOptionOfNonEmptyObject), effect_1.Effect.flatMap((parent) => effect_1.Effect.try(() => {
39
+ return pipe(get(contents, ...pathToParent.split('.')), Effect.flatMap(getOptionOfNonEmptyObject), Effect.flatMap((parent) => Effect.try(() => {
43
40
  parent[key] = nextValue;
44
- })), effect_1.Effect.tapError(() => effect_1.Effect.logDebug(`strategy ${this._tag} with name ${this.name} failed to write to <${file.jsonFile.shortPath}>.${this.path}`)), effect_1.Effect.catchAll(() => effect_1.Effect.succeed(file)), effect_1.Effect.map(() => file));
41
+ })), Effect.tapError(() => Effect.logDebug(`strategy ${this._tag} with name ${this.name} failed to write to <${file.jsonFile.shortPath}>.${this.path}`)), Effect.catchAll(() => Effect.succeed(file)), Effect.map(() => file));
45
42
  }
46
43
  else {
47
- return (0, effect_1.pipe)(getOptionOfNonEmptyObject(contents), effect_1.Effect.flatMap((parent) => effect_1.Effect.try(() => {
44
+ return pipe(getOptionOfNonEmptyObject(contents), Effect.flatMap((parent) => Effect.try(() => {
48
45
  parent[this.path] = nextValue;
49
- })), effect_1.Effect.tapError(() => effect_1.Effect.logDebug(`strategy ${this._tag} with name ${this.name} failed to write to <${file.jsonFile.shortPath}>.${this.path}`)), effect_1.Effect.catchAll(() => effect_1.Effect.succeed(file)), effect_1.Effect.map(() => file));
46
+ })), Effect.tapError(() => Effect.logDebug(`strategy ${this._tag} with name ${this.name} failed to write to <${file.jsonFile.shortPath}>.${this.path}`)), Effect.catchAll(() => Effect.succeed(file)), Effect.map(() => file));
50
47
  }
51
48
  }
52
49
  }
53
- exports.NamedVersionStringStrategy = NamedVersionStringStrategy;
@@ -1,11 +1,11 @@
1
1
  import { Effect } from 'effect';
2
- import type { PackageJsonFile } from '../get-package-json-files/package-json-file';
3
- import type { Delete } from '../version-group/lib/delete';
2
+ import type { PackageJsonFile } from '../get-package-json-files/package-json-file.js';
3
+ import type { Delete } from '../version-group/lib/delete.js';
4
4
  export declare class UnnamedVersionStringStrategy {
5
5
  _tag: string;
6
6
  name: string;
7
7
  path: string;
8
8
  constructor(name: string, path: string);
9
- read(file: PackageJsonFile): Effect.Effect<never, never, [string, string][]>;
10
- write(file: PackageJsonFile, [, version]: [string, string | Delete]): Effect.Effect<never, never, PackageJsonFile>;
9
+ read(file: PackageJsonFile): Effect.Effect<[string, string][]>;
10
+ write(file: PackageJsonFile, [, version]: [string, string | Delete]): Effect.Effect<PackageJsonFile>;
11
11
  }
@@ -1,13 +1,10 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.UnnamedVersionStringStrategy = void 0;
4
- const effect_1 = require("effect");
5
- const is_non_empty_object_1 = require("tightrope/guard/is-non-empty-object");
6
- const get_1 = require("../lib/get");
7
- const delete_1 = require("../version-group/lib/delete");
8
- const get_non_empty_string_prop_1 = require("./lib/get-non-empty-string-prop");
9
- const getOptionOfNonEmptyObject = effect_1.Option.liftPredicate((is_non_empty_object_1.isNonEmptyObject));
10
- class UnnamedVersionStringStrategy {
1
+ import { Effect, Option, pipe } from 'effect';
2
+ import { isNonEmptyObject } from 'tightrope/guard/is-non-empty-object.js';
3
+ import { get } from '../lib/get.js';
4
+ import { DELETE } from '../version-group/lib/delete.js';
5
+ import { getNonEmptyStringProp } from './lib/get-non-empty-string-prop.js';
6
+ const getOptionOfNonEmptyObject = Option.liftPredicate((isNonEmptyObject));
7
+ export class UnnamedVersionStringStrategy {
11
8
  _tag = 'version';
12
9
  name;
13
10
  path;
@@ -16,34 +13,33 @@ class UnnamedVersionStringStrategy {
16
13
  this.path = path;
17
14
  }
18
15
  read(file) {
19
- return (0, effect_1.pipe)(
16
+ return pipe(
20
17
  // get version prop
21
- (0, get_non_empty_string_prop_1.getNonEmptyStringProp)(this.path, file),
18
+ getNonEmptyStringProp(this.path, file),
22
19
  // if it is a non empty string, we can read it
23
- effect_1.Effect.map((version) => {
20
+ Effect.map((version) => {
24
21
  const name = this.path.split('.').slice(-1).join('');
25
22
  return [[name, version]];
26
- }), effect_1.Effect.tapError(() => effect_1.Effect.logDebug(`UnnamedVersionStringStrategy#${this.name} found nothing at <${file.jsonFile.shortPath}>.${this.path}`)),
23
+ }), Effect.tapError(() => Effect.logDebug(`UnnamedVersionStringStrategy#${this.name} found nothing at <${file.jsonFile.shortPath}>.${this.path}`)),
27
24
  // if value is invalid, default to empty
28
- effect_1.Effect.catchAll(() => effect_1.Effect.succeed([])));
25
+ Effect.catchAll(() => Effect.succeed([])));
29
26
  }
30
27
  write(file, [, version]) {
31
28
  const { contents } = file.jsonFile;
32
29
  const isNestedPath = this.path.includes('.');
33
- const nextValue = version === delete_1.DELETE ? undefined : version;
30
+ const nextValue = version === DELETE ? undefined : version;
34
31
  if (isNestedPath) {
35
32
  const fullPath = this.path.split('.');
36
33
  const pathToParent = fullPath.slice(0, fullPath.length - 1).join('.');
37
34
  const key = fullPath.slice(-1).join('');
38
- return (0, effect_1.pipe)((0, get_1.get)(contents, ...pathToParent.split('.')), effect_1.Effect.flatMap(getOptionOfNonEmptyObject), effect_1.Effect.flatMap((parent) => effect_1.Effect.try(() => {
35
+ return pipe(get(contents, ...pathToParent.split('.')), Effect.flatMap(getOptionOfNonEmptyObject), Effect.flatMap((parent) => Effect.try(() => {
39
36
  parent[key] = nextValue;
40
- })), effect_1.Effect.tapError(() => effect_1.Effect.logDebug(`strategy ${this._tag} with name ${this.name} failed to write to <${file.jsonFile.shortPath}>.${this.path}`)), effect_1.Effect.catchAll(() => effect_1.Effect.succeed(file)), effect_1.Effect.map(() => file));
37
+ })), Effect.tapError(() => Effect.logDebug(`strategy ${this._tag} with name ${this.name} failed to write to <${file.jsonFile.shortPath}>.${this.path}`)), Effect.catchAll(() => Effect.succeed(file)), Effect.map(() => file));
41
38
  }
42
39
  else {
43
- return (0, effect_1.pipe)(getOptionOfNonEmptyObject(contents), effect_1.Effect.flatMap((parent) => effect_1.Effect.try(() => {
40
+ return pipe(getOptionOfNonEmptyObject(contents), Effect.flatMap((parent) => Effect.try(() => {
44
41
  parent[this.path] = nextValue;
45
- })), effect_1.Effect.tapError(() => effect_1.Effect.logDebug(`strategy ${this._tag} with name ${this.name} failed to write to <${file.jsonFile.shortPath}>.${this.path}`)), effect_1.Effect.catchAll(() => effect_1.Effect.succeed(file)), effect_1.Effect.map(() => file));
42
+ })), Effect.tapError(() => Effect.logDebug(`strategy ${this._tag} with name ${this.name} failed to write to <${file.jsonFile.shortPath}>.${this.path}`)), Effect.catchAll(() => Effect.succeed(file)), Effect.map(() => file));
46
43
  }
47
44
  }
48
45
  }
49
- exports.UnnamedVersionStringStrategy = UnnamedVersionStringStrategy;
@@ -1,11 +1,11 @@
1
1
  import { Effect } from 'effect';
2
- import type { PackageJsonFile } from '../get-package-json-files/package-json-file';
3
- import type { Delete } from '../version-group/lib/delete';
2
+ import type { PackageJsonFile } from '../get-package-json-files/package-json-file.js';
3
+ import type { Delete } from '../version-group/lib/delete.js';
4
4
  export declare class VersionsByNameStrategy {
5
5
  _tag: string;
6
6
  name: string;
7
7
  path: string;
8
8
  constructor(name: string, path: string);
9
- read(file: PackageJsonFile): Effect.Effect<never, never, [string, string][]>;
10
- write(file: PackageJsonFile, [name, version]: [string, string | Delete]): Effect.Effect<never, never, PackageJsonFile>;
9
+ read(file: PackageJsonFile): Effect.Effect<[string, string][]>;
10
+ write(file: PackageJsonFile, [name, version]: [string, string | Delete]): Effect.Effect<PackageJsonFile>;
11
11
  }
@@ -1,12 +1,9 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.VersionsByNameStrategy = void 0;
4
- const effect_1 = require("effect");
5
- const is_non_empty_object_1 = require("tightrope/guard/is-non-empty-object");
6
- const get_1 = require("../lib/get");
7
- const delete_1 = require("../version-group/lib/delete");
8
- const getOptionOfNonEmptyObject = effect_1.Option.liftPredicate((is_non_empty_object_1.isNonEmptyObject));
9
- class VersionsByNameStrategy {
1
+ import { Effect, Option, pipe } from 'effect';
2
+ import { isNonEmptyObject } from 'tightrope/guard/is-non-empty-object.js';
3
+ import { get } from '../lib/get.js';
4
+ import { DELETE } from '../version-group/lib/delete.js';
5
+ const getOptionOfNonEmptyObject = Option.liftPredicate((isNonEmptyObject));
6
+ export class VersionsByNameStrategy {
10
7
  _tag = 'versionsByName';
11
8
  name;
12
9
  path;
@@ -15,15 +12,14 @@ class VersionsByNameStrategy {
15
12
  this.path = path;
16
13
  }
17
14
  read(file) {
18
- return (0, effect_1.pipe)((0, get_1.get)(file.jsonFile.contents, ...this.path.split('.')), effect_1.Effect.flatMap((value) => getOptionOfNonEmptyObject(value)), effect_1.Effect.map((obj) => Object.entries(obj)), effect_1.Effect.tapError(() => effect_1.Effect.logDebug(`VersionsByNameStrategy#${this.name} found nothing at <${file.jsonFile.shortPath}>.${this.path}`)),
15
+ return pipe(get(file.jsonFile.contents, ...this.path.split('.')), Effect.flatMap((value) => getOptionOfNonEmptyObject(value)), Effect.map((obj) => Object.entries(obj)), Effect.tapError(() => Effect.logDebug(`VersionsByNameStrategy#${this.name} found nothing at <${file.jsonFile.shortPath}>.${this.path}`)),
19
16
  // if value is invalid, default to empty
20
- effect_1.Effect.catchAll(() => effect_1.Effect.succeed([])));
17
+ Effect.catchAll(() => Effect.succeed([])));
21
18
  }
22
19
  write(file, [name, version]) {
23
- const nextValue = version === delete_1.DELETE ? undefined : version;
24
- return (0, effect_1.pipe)((0, get_1.get)(file.jsonFile.contents, ...this.path.split('.')), effect_1.Effect.flatMap(getOptionOfNonEmptyObject), effect_1.Effect.flatMap((parent) => effect_1.Effect.try(() => {
20
+ const nextValue = version === DELETE ? undefined : version;
21
+ return pipe(get(file.jsonFile.contents, ...this.path.split('.')), Effect.flatMap(getOptionOfNonEmptyObject), Effect.flatMap((parent) => Effect.try(() => {
25
22
  parent[name] = nextValue;
26
- })), effect_1.Effect.tapError(() => effect_1.Effect.logDebug(`strategy ${this._tag} with name ${this.name} failed to write to <${file.jsonFile.shortPath}>.${this.path}.${name}`)), effect_1.Effect.catchAll(() => effect_1.Effect.succeed(file)), effect_1.Effect.map(() => file));
23
+ })), Effect.tapError(() => Effect.logDebug(`strategy ${this._tag} with name ${this.name} failed to write to <${file.jsonFile.shortPath}>.${this.path}.${name}`)), Effect.catchAll(() => Effect.succeed(file)), Effect.map(() => file));
27
24
  }
28
25
  }
29
- exports.VersionsByNameStrategy = VersionsByNameStrategy;
@@ -1,10 +1,10 @@
1
- import { Data, Effect } from 'effect';
2
- import type { VersionGroupConfig } from '../config/types';
3
- import type { Instance } from '../get-instances/instance';
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/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> & {
1
+ import { Effect } from 'effect';
2
+ import type { VersionGroupConfig } from '../config/types.js';
3
+ import type { Instance } from '../get-instances/instance.js';
4
+ import { Report } from '../report.js';
5
+ declare const BannedVersionGroup_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").Equals<A, {}> extends true ? void : { readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }) => Readonly<A> & {
6
6
  readonly _tag: "Banned";
7
- }>;
7
+ };
8
8
  export declare class BannedVersionGroup extends BannedVersionGroup_base<{
9
9
  config: VersionGroupConfig.Banned;
10
10
  instances: Instance[];
@@ -12,6 +12,6 @@ export declare class BannedVersionGroup extends BannedVersionGroup_base<{
12
12
  groupType: string;
13
13
  constructor(config: VersionGroupConfig.Banned);
14
14
  canAdd(_: Instance): boolean;
15
- inspectAll(): Effect.Effect<never, never, Report.Version.Group[]>;
15
+ inspectAll(): Effect.Effect<Report.Version.Group[]>;
16
16
  }
17
17
  export {};
@@ -1,12 +1,9 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.BannedVersionGroup = void 0;
4
- const effect_1 = require("effect");
5
- const report_1 = require("../report");
6
- const specifier_1 = require("../specifier");
7
- const delete_1 = require("./lib/delete");
8
- const group_by_1 = require("./lib/group-by");
9
- class BannedVersionGroup extends effect_1.Data.TaggedClass('Banned') {
1
+ import { Data, Effect } from 'effect';
2
+ import { Report } from '../report.js';
3
+ import { Specifier } from '../specifier/index.js';
4
+ import { DELETE } from './lib/delete.js';
5
+ import { groupBy } from './lib/group-by.js';
6
+ export class BannedVersionGroup extends Data.TaggedClass('Banned') {
10
7
  groupType = 'versionGroup';
11
8
  constructor(config) {
12
9
  super({
@@ -18,13 +15,12 @@ class BannedVersionGroup extends effect_1.Data.TaggedClass('Banned') {
18
15
  return true;
19
16
  }
20
17
  inspectAll() {
21
- return effect_1.Effect.succeed(Object.entries((0, group_by_1.groupBy)('name', this.instances)).map(([name, instances]) => ({
18
+ return Effect.succeed(Object.entries(groupBy('name', this.instances)).map(([name, instances]) => ({
22
19
  name,
23
20
  reports: instances.map((instance) =>
24
21
  // ✘ package should not be used
25
22
  // ✓ is a mismatch we can auto-fix
26
- new report_1.Report.Banned(specifier_1.Specifier.create(instance, delete_1.DELETE))),
23
+ new Report.Banned(Specifier.create(instance, DELETE))),
27
24
  })));
28
25
  }
29
26
  }
30
- exports.BannedVersionGroup = BannedVersionGroup;
@@ -1,4 +1,4 @@
1
1
  import { Effect } from 'effect';
2
- import { VersionGroup } from '.';
3
- import type { Ctx } from '../get-context';
4
- export declare function createVersionGroups(ctx: Ctx): Effect.Effect<never, VersionGroup.ConfigError, VersionGroup.Any[]>;
2
+ import type { Ctx } from '../get-context/index.js';
3
+ import { VersionGroup } from './index.js';
4
+ export declare function createVersionGroups(ctx: Ctx): Effect.Effect<VersionGroup.Any[], VersionGroup.ConfigError>;
@@ -1,50 +1,47 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.createVersionGroups = void 0;
4
- const effect_1 = require("effect");
5
- const is_array_of_strings_1 = require("tightrope/guard/is-array-of-strings");
6
- const is_non_empty_array_1 = require("tightrope/guard/is-non-empty-array");
7
- const is_non_empty_string_1 = require("tightrope/guard/is-non-empty-string");
8
- const is_object_1 = require("tightrope/guard/is-object");
9
- const _1 = require(".");
10
- const banned_1 = require("./banned");
11
- const filtered_out_1 = require("./filtered-out");
12
- const ignored_1 = require("./ignored");
13
- const pinned_1 = require("./pinned");
14
- const same_range_1 = require("./same-range");
15
- const snapped_to_1 = require("./snapped-to");
16
- const standard_1 = require("./standard");
17
- function createVersionGroups(ctx) {
1
+ import { Effect } from 'effect';
2
+ import { isArrayOfStrings } from 'tightrope/guard/is-array-of-strings.js';
3
+ import { isNonEmptyArray } from 'tightrope/guard/is-non-empty-array.js';
4
+ import { isNonEmptyString } from 'tightrope/guard/is-non-empty-string.js';
5
+ import { isObject } from 'tightrope/guard/is-object.js';
6
+ import { BannedVersionGroup } from './banned.js';
7
+ import { FilteredOutVersionGroup } from './filtered-out.js';
8
+ import { IgnoredVersionGroup } from './ignored.js';
9
+ import { VersionGroup } from './index.js';
10
+ import { PinnedVersionGroup } from './pinned.js';
11
+ import { SameRangeVersionGroup } from './same-range.js';
12
+ import { SnappedToVersionGroup } from './snapped-to.js';
13
+ import { StandardVersionGroup } from './standard.js';
14
+ export function createVersionGroups(ctx) {
18
15
  const { rcFile } = ctx.config;
19
16
  const versionGroups = [
20
- effect_1.Effect.succeed(new filtered_out_1.FilteredOutVersionGroup(ctx)),
17
+ Effect.succeed(new FilteredOutVersionGroup(ctx)),
21
18
  ];
22
- if ((0, is_non_empty_array_1.isNonEmptyArray)(rcFile.versionGroups)) {
19
+ if (isNonEmptyArray(rcFile.versionGroups)) {
23
20
  rcFile.versionGroups.forEach((config) => {
24
- if (!(0, is_object_1.isObject)(config)) {
25
- return versionGroups.push(effect_1.Effect.fail(new _1.VersionGroup.ConfigError({
21
+ if (!isObject(config)) {
22
+ return versionGroups.push(Effect.fail(new VersionGroup.ConfigError({
26
23
  config,
27
24
  error: 'config is not an object',
28
25
  })));
29
26
  }
30
27
  const mutuallyExclusiveProps = ['isBanned', 'isIgnored', 'pinVersion', 'snapTo', 'policy'].filter((prop) => Boolean(config[prop]));
31
28
  if (mutuallyExclusiveProps.length > 1) {
32
- return versionGroups.push(effect_1.Effect.fail(new _1.VersionGroup.ConfigError({
29
+ return versionGroups.push(Effect.fail(new VersionGroup.ConfigError({
33
30
  config,
34
31
  error: `it's unclear what kind of version group you want, as it contains both ${mutuallyExclusiveProps.join(' and ')}`,
35
32
  })));
36
33
  }
37
- const label = (0, is_non_empty_string_1.isNonEmptyString)(config.label) ? config.label : '';
38
- const dependencyTypes = (0, is_array_of_strings_1.isArrayOfStrings)(config.dependencyTypes)
34
+ const label = isNonEmptyString(config.label) ? config.label : '';
35
+ const dependencyTypes = isArrayOfStrings(config.dependencyTypes)
39
36
  ? config.dependencyTypes
40
37
  : ['**'];
41
- const dependencies = (0, is_array_of_strings_1.isArrayOfStrings)(config.dependencies) ? config.dependencies : ['**'];
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)
38
+ const dependencies = isArrayOfStrings(config.dependencies) ? config.dependencies : ['**'];
39
+ const packages = isArrayOfStrings(config.packages) ? config.packages : ['**'];
40
+ const specifierTypes = isArrayOfStrings(config.specifierTypes)
44
41
  ? config.specifierTypes
45
42
  : ['**'];
46
43
  if (config.isBanned === true) {
47
- versionGroups.push(effect_1.Effect.succeed(new banned_1.BannedVersionGroup({
44
+ versionGroups.push(Effect.succeed(new BannedVersionGroup({
48
45
  dependencies,
49
46
  dependencyTypes,
50
47
  specifierTypes,
@@ -54,7 +51,7 @@ function createVersionGroups(ctx) {
54
51
  })));
55
52
  }
56
53
  else if (config.isIgnored === true) {
57
- versionGroups.push(effect_1.Effect.succeed(new ignored_1.IgnoredVersionGroup({
54
+ versionGroups.push(Effect.succeed(new IgnoredVersionGroup({
58
55
  dependencies,
59
56
  dependencyTypes,
60
57
  specifierTypes,
@@ -63,8 +60,8 @@ function createVersionGroups(ctx) {
63
60
  packages,
64
61
  })));
65
62
  }
66
- else if ((0, is_non_empty_string_1.isNonEmptyString)(config.pinVersion)) {
67
- versionGroups.push(effect_1.Effect.succeed(new pinned_1.PinnedVersionGroup({
63
+ else if (isNonEmptyString(config.pinVersion)) {
64
+ versionGroups.push(Effect.succeed(new PinnedVersionGroup({
68
65
  dependencies,
69
66
  dependencyTypes,
70
67
  specifierTypes,
@@ -73,8 +70,8 @@ function createVersionGroups(ctx) {
73
70
  pinVersion: config.pinVersion,
74
71
  })));
75
72
  }
76
- else if ((0, is_array_of_strings_1.isArrayOfStrings)(config.snapTo)) {
77
- versionGroups.push(effect_1.Effect.succeed(new snapped_to_1.SnappedToVersionGroup({
73
+ else if (isArrayOfStrings(config.snapTo)) {
74
+ versionGroups.push(Effect.succeed(new SnappedToVersionGroup({
78
75
  dependencies,
79
76
  dependencyTypes,
80
77
  specifierTypes,
@@ -84,7 +81,7 @@ function createVersionGroups(ctx) {
84
81
  })));
85
82
  }
86
83
  else if (config.policy === 'sameRange') {
87
- versionGroups.push(effect_1.Effect.succeed(new same_range_1.SameRangeVersionGroup(ctx, {
84
+ versionGroups.push(Effect.succeed(new SameRangeVersionGroup(ctx, {
88
85
  dependencies,
89
86
  dependencyTypes,
90
87
  specifierTypes,
@@ -94,7 +91,7 @@ function createVersionGroups(ctx) {
94
91
  })));
95
92
  }
96
93
  else {
97
- versionGroups.push(effect_1.Effect.succeed(new standard_1.StandardVersionGroup(false, {
94
+ versionGroups.push(Effect.succeed(new StandardVersionGroup(false, {
98
95
  dependencies,
99
96
  dependencyTypes,
100
97
  specifierTypes,
@@ -105,7 +102,7 @@ function createVersionGroups(ctx) {
105
102
  }
106
103
  });
107
104
  }
108
- versionGroups.push(effect_1.Effect.succeed(new standard_1.StandardVersionGroup(true, {
105
+ versionGroups.push(Effect.succeed(new StandardVersionGroup(true, {
109
106
  dependencies: ['**'],
110
107
  dependencyTypes: ['**'],
111
108
  specifierTypes: ['**'],
@@ -113,6 +110,5 @@ function createVersionGroups(ctx) {
113
110
  packages: ['**'],
114
111
  preferVersion: 'highestSemver',
115
112
  })));
116
- return effect_1.Effect.all(versionGroups);
113
+ return Effect.all(versionGroups);
117
114
  }
118
- exports.createVersionGroups = createVersionGroups;