syncpack 12.2.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 (209) hide show
  1. package/README.md +5 -5
  2. package/dist/bin-fix-mismatches/fix-mismatches.d.ts +9 -9
  3. package/dist/bin-fix-mismatches/fix-mismatches.js +43 -54
  4. package/dist/bin-fix-mismatches/index.js +26 -31
  5. package/dist/bin-format/format.d.ts +6 -4
  6. package/dist/bin-format/format.js +78 -53
  7. package/dist/bin-format/index.js +20 -25
  8. package/dist/bin-lint/index.js +15 -20
  9. package/dist/bin-lint/lint.d.ts +4 -4
  10. package/dist/bin-lint/lint.js +51 -19
  11. package/dist/bin-lint-semver-ranges/index.js +24 -29
  12. package/dist/bin-lint-semver-ranges/lint-semver-ranges.d.ts +8 -8
  13. package/dist/bin-lint-semver-ranges/lint-semver-ranges.js +34 -44
  14. package/dist/bin-list/index.js +24 -29
  15. package/dist/bin-list/list.d.ts +7 -7
  16. package/dist/bin-list/list.js +55 -64
  17. package/dist/bin-list-mismatches/index.js +24 -29
  18. package/dist/bin-list-mismatches/list-mismatches.d.ts +10 -10
  19. package/dist/bin-list-mismatches/list-mismatches.js +62 -70
  20. package/dist/bin-prompt/index.js +26 -31
  21. package/dist/bin-prompt/prompt.d.ts +4 -4
  22. package/dist/bin-prompt/prompt.js +41 -48
  23. package/dist/bin-set-semver-ranges/index.js +26 -31
  24. package/dist/bin-set-semver-ranges/set-semver-ranges.d.ts +4 -4
  25. package/dist/bin-set-semver-ranges/set-semver-ranges.js +26 -30
  26. package/dist/bin-update/effects.d.ts +18 -18
  27. package/dist/bin-update/effects.js +77 -106
  28. package/dist/bin-update/index.js +23 -28
  29. package/dist/bin-update/update.d.ts +5 -5
  30. package/dist/bin-update/update.js +37 -45
  31. package/dist/bin.js +8 -5
  32. package/dist/config/get-custom-types.d.ts +9 -9
  33. package/dist/config/get-custom-types.js +22 -27
  34. package/dist/config/get-enabled-types.d.ts +8 -8
  35. package/dist/config/get-enabled-types.js +42 -48
  36. package/dist/config/get-filter.d.ts +1 -1
  37. package/dist/config/get-filter.js +6 -9
  38. package/dist/config/get-indent.d.ts +1 -1
  39. package/dist/config/get-indent.js +6 -9
  40. package/dist/config/get-sort-az.d.ts +1 -1
  41. package/dist/config/get-sort-az.js +6 -17
  42. package/dist/config/get-sort-exports.d.ts +2 -0
  43. package/dist/config/get-sort-exports.js +8 -0
  44. package/dist/config/get-sort-first.d.ts +1 -1
  45. package/dist/config/get-sort-first.js +6 -8
  46. package/dist/config/get-source.d.ts +1 -1
  47. package/dist/config/get-source.js +4 -8
  48. package/dist/config/tag.d.ts +1 -1
  49. package/dist/config/tag.js +2 -5
  50. package/dist/config/types.d.ts +16 -5
  51. package/dist/config/types.js +1 -2
  52. package/dist/constants.d.ts +7 -0
  53. package/dist/constants.js +25 -10
  54. package/dist/error-handlers/default-error-handlers.d.ts +10 -10
  55. package/dist/error-handlers/default-error-handlers.js +55 -61
  56. package/dist/get-context/index.d.ts +5 -5
  57. package/dist/get-context/index.js +13 -17
  58. package/dist/get-context/lib/key-by.js +1 -5
  59. package/dist/get-instances/index.d.ts +7 -7
  60. package/dist/get-instances/index.js +19 -23
  61. package/dist/get-instances/instance.d.ts +7 -7
  62. package/dist/get-instances/instance.js +4 -8
  63. package/dist/get-package-json-files/get-file-paths.d.ts +7 -7
  64. package/dist/get-package-json-files/get-file-paths.js +10 -15
  65. package/dist/get-package-json-files/get-patterns/get-lerna-patterns.d.ts +2 -2
  66. package/dist/get-package-json-files/get-patterns/get-lerna-patterns.js +8 -12
  67. package/dist/get-package-json-files/get-patterns/get-pnpm-patterns.d.ts +2 -2
  68. package/dist/get-package-json-files/get-patterns/get-pnpm-patterns.js +8 -12
  69. package/dist/get-package-json-files/get-patterns/get-yarn-patterns.d.ts +2 -2
  70. package/dist/get-package-json-files/get-patterns/get-yarn-patterns.js +14 -18
  71. package/dist/get-package-json-files/get-patterns/index.d.ts +3 -3
  72. package/dist/get-package-json-files/get-patterns/index.js +11 -15
  73. package/dist/get-package-json-files/index.d.ts +8 -8
  74. package/dist/get-package-json-files/index.js +6 -10
  75. package/dist/get-package-json-files/package-json-file.d.ts +6 -6
  76. package/dist/get-package-json-files/package-json-file.js +8 -12
  77. package/dist/guards/can-add-to-group.d.ts +4 -4
  78. package/dist/guards/can-add-to-group.js +10 -14
  79. package/dist/guards/is-semver.js +3 -7
  80. package/dist/guards/is-valid-semver-range.d.ts +1 -1
  81. package/dist/guards/is-valid-semver-range.js +12 -16
  82. package/dist/index.d.ts +1 -1
  83. package/dist/index.js +1 -2
  84. package/dist/io/ask-for-choice.d.ts +5 -5
  85. package/dist/io/ask-for-choice.js +5 -9
  86. package/dist/io/ask-for-input.d.ts +5 -5
  87. package/dist/io/ask-for-input.js +5 -9
  88. package/dist/io/exit-if-invalid.d.ts +3 -3
  89. package/dist/io/exit-if-invalid.js +5 -9
  90. package/dist/io/glob-sync.d.ts +5 -5
  91. package/dist/io/glob-sync.js +4 -9
  92. package/dist/io/index.d.ts +8 -8
  93. package/dist/io/index.js +12 -38
  94. package/dist/io/read-config-file.d.ts +7 -0
  95. package/dist/io/read-config-file.js +22 -0
  96. package/dist/io/read-file-sync.d.ts +5 -5
  97. package/dist/io/read-file-sync.js +4 -9
  98. package/dist/io/read-json-file-sync.d.ts +8 -8
  99. package/dist/io/read-json-file-sync.js +10 -16
  100. package/dist/io/read-yaml-file-sync.d.ts +5 -5
  101. package/dist/io/read-yaml-file-sync.js +4 -8
  102. package/dist/io/to-json.d.ts +9 -0
  103. package/dist/io/to-json.js +29 -0
  104. package/dist/io/write-file-sync.d.ts +5 -5
  105. package/dist/io/write-file-sync.js +5 -10
  106. package/dist/io/write-if-changed.d.ts +4 -10
  107. package/dist/io/write-if-changed.js +9 -44
  108. package/dist/lib/format-repository-url.js +1 -5
  109. package/dist/lib/get-group-header.d.ts +2 -2
  110. package/dist/lib/get-group-header.js +4 -12
  111. package/dist/lib/get.d.ts +10 -10
  112. package/dist/lib/get.js +15 -19
  113. package/dist/lib/pad-start.js +1 -5
  114. package/dist/lib/ring-buffer.js +1 -5
  115. package/dist/lib/set-semver-range.d.ts +1 -1
  116. package/dist/lib/set-semver-range.js +8 -12
  117. package/dist/lib/show-help-on-error.js +3 -10
  118. package/dist/lib/sort-by-name.js +1 -5
  119. package/dist/lib/with-logger.d.ts +1 -1
  120. package/dist/lib/with-logger.js +17 -24
  121. package/dist/option.d.ts +1 -1
  122. package/dist/option.js +8 -14
  123. package/dist/report.d.ts +2 -2
  124. package/dist/report.js +2 -5
  125. package/dist/schema.json +24 -0
  126. package/dist/semver-group/create-semver-groups.d.ts +3 -3
  127. package/dist/semver-group/create-semver-groups.js +28 -32
  128. package/dist/semver-group/disabled.d.ts +11 -11
  129. package/dist/semver-group/disabled.js +6 -10
  130. package/dist/semver-group/filtered-out.d.ts +12 -12
  131. package/dist/semver-group/filtered-out.js +8 -12
  132. package/dist/semver-group/ignored.d.ts +11 -11
  133. package/dist/semver-group/ignored.js +6 -10
  134. package/dist/semver-group/index.d.ts +6 -7
  135. package/dist/semver-group/index.js +4 -7
  136. package/dist/semver-group/with-range.d.ts +11 -11
  137. package/dist/semver-group/with-range.js +13 -17
  138. package/dist/specifier/alias.d.ts +5 -5
  139. package/dist/specifier/alias.js +9 -13
  140. package/dist/specifier/base.d.ts +7 -7
  141. package/dist/specifier/base.js +9 -13
  142. package/dist/specifier/delete.d.ts +5 -5
  143. package/dist/specifier/delete.js +5 -9
  144. package/dist/specifier/exact.d.ts +6 -6
  145. package/dist/specifier/exact.js +7 -11
  146. package/dist/specifier/file.d.ts +1 -1
  147. package/dist/specifier/file.js +2 -6
  148. package/dist/specifier/hosted-git.d.ts +5 -5
  149. package/dist/specifier/hosted-git.js +9 -13
  150. package/dist/specifier/index.d.ts +13 -13
  151. package/dist/specifier/index.js +28 -31
  152. package/dist/specifier/latest.d.ts +6 -6
  153. package/dist/specifier/latest.js +7 -11
  154. package/dist/specifier/lib/non-semver-error.d.ts +5 -5
  155. package/dist/specifier/lib/non-semver-error.js +3 -7
  156. package/dist/specifier/lib/parse-specifier.d.ts +1 -1
  157. package/dist/specifier/lib/parse-specifier.js +4 -11
  158. package/dist/specifier/lib/specific-registry-result.js +1 -2
  159. package/dist/specifier/range.d.ts +6 -6
  160. package/dist/specifier/range.js +7 -11
  161. package/dist/specifier/tag.d.ts +2 -2
  162. package/dist/specifier/tag.js +2 -6
  163. package/dist/specifier/unsupported.d.ts +1 -1
  164. package/dist/specifier/unsupported.js +2 -6
  165. package/dist/specifier/url.d.ts +1 -1
  166. package/dist/specifier/url.js +2 -6
  167. package/dist/specifier/workspace-protocol.d.ts +7 -7
  168. package/dist/specifier/workspace-protocol.js +9 -13
  169. package/dist/strategy/lib/get-non-empty-string-prop.d.ts +2 -2
  170. package/dist/strategy/lib/get-non-empty-string-prop.js +6 -10
  171. package/dist/strategy/name-and-version-props.d.ts +4 -4
  172. package/dist/strategy/name-and-version-props.js +19 -23
  173. package/dist/strategy/named-version-string.d.ts +4 -4
  174. package/dist/strategy/named-version-string.js +20 -24
  175. package/dist/strategy/unnamed-version-string.d.ts +4 -4
  176. package/dist/strategy/unnamed-version-string.js +17 -21
  177. package/dist/strategy/versions-by-name.d.ts +4 -4
  178. package/dist/strategy/versions-by-name.js +11 -15
  179. package/dist/version-group/banned.d.ts +7 -7
  180. package/dist/version-group/banned.js +8 -12
  181. package/dist/version-group/create-version-groups.d.ts +3 -3
  182. package/dist/version-group/create-version-groups.js +34 -38
  183. package/dist/version-group/filtered-out.d.ts +8 -8
  184. package/dist/version-group/filtered-out.js +8 -12
  185. package/dist/version-group/ignored.d.ts +7 -7
  186. package/dist/version-group/ignored.js +6 -10
  187. package/dist/version-group/index.d.ts +9 -10
  188. package/dist/version-group/index.js +4 -7
  189. package/dist/version-group/lib/clean.js +4 -11
  190. package/dist/version-group/lib/delete.js +1 -4
  191. package/dist/version-group/lib/get-highest-version.d.ts +2 -2
  192. package/dist/version-group/lib/get-highest-version.js +3 -7
  193. package/dist/version-group/lib/get-lowest-version.d.ts +2 -2
  194. package/dist/version-group/lib/get-lowest-version.js +3 -7
  195. package/dist/version-group/lib/get-preferred-version.d.ts +4 -4
  196. package/dist/version-group/lib/get-preferred-version.js +17 -24
  197. package/dist/version-group/lib/get-range-score.js +13 -17
  198. package/dist/version-group/lib/group-by.js +1 -5
  199. package/dist/version-group/pinned.d.ts +7 -7
  200. package/dist/version-group/pinned.js +8 -12
  201. package/dist/version-group/same-range.d.ts +8 -8
  202. package/dist/version-group/same-range.js +23 -30
  203. package/dist/version-group/snapped-to.d.ts +7 -7
  204. package/dist/version-group/snapped-to.js +20 -24
  205. package/dist/version-group/standard.d.ts +7 -7
  206. package/dist/version-group/standard.js +29 -33
  207. package/package.json +30 -37
  208. package/dist/io/read-config-file-sync.d.ts +0 -7
  209. package/dist/io/read-config-file-sync.js +0 -26
@@ -1,14 +1,10 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getFilePaths = exports.NoSourcesFoundError = void 0;
4
- const effect_1 = require("effect");
5
- const uniq_1 = require("tightrope/array/uniq");
6
- const is_non_empty_array_1 = require("tightrope/guard/is-non-empty-array");
7
- const glob_sync_1 = require("../io/glob-sync");
8
- const get_patterns_1 = require("./get-patterns");
9
- class NoSourcesFoundError extends effect_1.Data.TaggedClass('NoSourcesFoundError') {
1
+ import { Data, Effect, pipe } from 'effect';
2
+ import { uniq } from 'tightrope/array/uniq.js';
3
+ import { isNonEmptyArray } from 'tightrope/guard/is-non-empty-array.js';
4
+ import { globSync } from '../io/glob-sync.js';
5
+ import { getPatterns } from './get-patterns/index.js';
6
+ export class NoSourcesFoundError extends Data.TaggedClass('NoSourcesFoundError') {
10
7
  }
11
- exports.NoSourcesFoundError = NoSourcesFoundError;
12
8
  /**
13
9
  * Using --source options and/or config files on disk from
14
10
  * npm/pnpm/yarn/lerna, return an array of absolute paths to every package.json
@@ -16,12 +12,11 @@ exports.NoSourcesFoundError = NoSourcesFoundError;
16
12
  *
17
13
  * @returns Array of absolute file paths to package.json files
18
14
  */
19
- function getFilePaths(io, config) {
20
- return (0, effect_1.pipe)(effect_1.Effect.Do, effect_1.Effect.bind('patterns', () => (0, get_patterns_1.getPatterns)(io, config)), effect_1.Effect.bind('filePaths', ({ patterns }) => (0, glob_sync_1.globSync)(io, patterns)), effect_1.Effect.bind('flatFilePaths', ({ filePaths }) => effect_1.Effect.sync(() => (0, uniq_1.uniq)(filePaths.flat()))), effect_1.Effect.flatMap(({ flatFilePaths, patterns }) => (0, is_non_empty_array_1.isNonEmptyArray)(flatFilePaths)
21
- ? effect_1.Effect.succeed(flatFilePaths)
22
- : effect_1.Effect.fail(new NoSourcesFoundError({
15
+ export function getFilePaths(io, config) {
16
+ return pipe(Effect.Do, Effect.bind('patterns', () => getPatterns(io, config)), Effect.bind('filePaths', ({ patterns }) => globSync(io, patterns)), Effect.bind('flatFilePaths', ({ filePaths }) => Effect.sync(() => uniq(filePaths.flat()))), Effect.flatMap(({ flatFilePaths, patterns }) => isNonEmptyArray(flatFilePaths)
17
+ ? Effect.succeed(flatFilePaths)
18
+ : Effect.fail(new NoSourcesFoundError({
23
19
  CWD: io.process.cwd(),
24
20
  patterns,
25
21
  }))));
26
22
  }
27
- exports.getFilePaths = getFilePaths;
@@ -1,3 +1,3 @@
1
1
  import { Effect, Option as O } from 'effect';
2
- import type { Io } from '../../io';
3
- export declare function getLernaPatterns(io: Io): Effect.Effect<never, never, O.Option<string[]>>;
2
+ import type { Io } from '../../io/index.js';
3
+ export declare function getLernaPatterns(io: Io): Effect.Effect<O.Option<string[]>>;
@@ -1,14 +1,10 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getLernaPatterns = void 0;
4
- const effect_1 = require("effect");
5
- const path_1 = require("path");
6
- const is_array_of_strings_1 = require("tightrope/guard/is-array-of-strings");
7
- const read_json_file_sync_1 = require("../../io/read-json-file-sync");
8
- function getLernaPatterns(io) {
9
- return (0, effect_1.pipe)((0, read_json_file_sync_1.readJsonFileSync)(io, (0, path_1.join)(io.process.cwd(), 'lerna.json')), effect_1.Effect.map((file) => (0, is_array_of_strings_1.isArrayOfStrings)(file.contents.packages) ? effect_1.Option.some(file.contents.packages) : effect_1.Option.none()), effect_1.Effect.catchTags({
10
- ReadFileError: () => effect_1.Effect.succeed(effect_1.Option.none()),
11
- JsonParseError: () => effect_1.Effect.succeed(effect_1.Option.none()),
1
+ import { Effect, Option as O, pipe } from 'effect';
2
+ import { join } from 'path';
3
+ import { isArrayOfStrings } from 'tightrope/guard/is-array-of-strings.js';
4
+ import { readJsonFileSync } from '../../io/read-json-file-sync.js';
5
+ export function getLernaPatterns(io) {
6
+ return pipe(readJsonFileSync(io, join(io.process.cwd(), 'lerna.json')), Effect.map((file) => isArrayOfStrings(file.contents.packages) ? O.some(file.contents.packages) : O.none()), Effect.catchTags({
7
+ ReadFileError: () => Effect.succeed(O.none()),
8
+ JsonParseError: () => Effect.succeed(O.none()),
12
9
  }));
13
10
  }
14
- exports.getLernaPatterns = getLernaPatterns;
@@ -1,3 +1,3 @@
1
1
  import { Effect, Option as O } from 'effect';
2
- import { type Io } from '../../io';
3
- export declare function getPnpmPatterns(io: Io): Effect.Effect<never, never, O.Option<string[]>>;
2
+ import { type Io } from '../../io/index.js';
3
+ export declare function getPnpmPatterns(io: Io): Effect.Effect<O.Option<string[]>>;
@@ -1,18 +1,14 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getPnpmPatterns = void 0;
4
- const effect_1 = require("effect");
5
- const path_1 = require("path");
6
- const is_array_of_strings_1 = require("tightrope/guard/is-array-of-strings");
7
- const read_yaml_file_sync_1 = require("../../io/read-yaml-file-sync");
8
- function getPnpmPatterns(io) {
9
- return (0, effect_1.pipe)(
1
+ import { Effect, Option as O, pipe } from 'effect';
2
+ import { join } from 'path';
3
+ import { isArrayOfStrings } from 'tightrope/guard/is-array-of-strings.js';
4
+ import { readYamlFileSync } from '../../io/read-yaml-file-sync.js';
5
+ export function getPnpmPatterns(io) {
6
+ return pipe(
10
7
  // packages:
11
8
  // - "packages/**"
12
9
  // - "components/**"
13
10
  // - "!**/test/**"
14
- (0, read_yaml_file_sync_1.readYamlFileSync)(io, (0, path_1.join)(io.process.cwd(), 'pnpm-workspace.yaml')), effect_1.Effect.map((file) => ((0, is_array_of_strings_1.isArrayOfStrings)(file?.packages) ? effect_1.Option.some(file.packages) : effect_1.Option.none())), effect_1.Effect.catchTags({
15
- ReadYamlFileError: () => effect_1.Effect.succeed(effect_1.Option.none()),
11
+ readYamlFileSync(io, join(io.process.cwd(), 'pnpm-workspace.yaml')), Effect.map((file) => (isArrayOfStrings(file?.packages) ? O.some(file.packages) : O.none())), Effect.catchTags({
12
+ ReadYamlFileError: () => Effect.succeed(O.none()),
16
13
  }));
17
14
  }
18
- exports.getPnpmPatterns = getPnpmPatterns;
@@ -1,3 +1,3 @@
1
1
  import { Effect, Option as O } from 'effect';
2
- import type { Io } from '../../io';
3
- export declare function getYarnPatterns(io: Io): Effect.Effect<never, never, O.Option<string[]>>;
2
+ import type { Io } from '../../io/index.js';
3
+ export declare function getYarnPatterns(io: Io): Effect.Effect<O.Option<string[]>>;
@@ -1,20 +1,16 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getYarnPatterns = void 0;
4
- const effect_1 = require("effect");
5
- const path_1 = require("path");
6
- const is_array_of_strings_1 = require("tightrope/guard/is-array-of-strings");
7
- const is_non_empty_object_1 = require("tightrope/guard/is-non-empty-object");
8
- const read_json_file_sync_1 = require("../../io/read-json-file-sync");
9
- function getYarnPatterns(io) {
10
- return (0, effect_1.pipe)((0, read_json_file_sync_1.readJsonFileSync)(io, (0, path_1.join)(io.process.cwd(), 'package.json')), effect_1.Effect.map((file) => (0, is_non_empty_object_1.isNonEmptyObject)(file.contents.workspaces) &&
11
- (0, is_array_of_strings_1.isArrayOfStrings)(file.contents.workspaces.packages)
12
- ? effect_1.Option.some(file.contents.workspaces.packages)
13
- : (0, is_array_of_strings_1.isArrayOfStrings)(file.contents.workspaces)
14
- ? effect_1.Option.some(file.contents.workspaces)
15
- : effect_1.Option.none()), effect_1.Effect.catchTags({
16
- ReadFileError: () => effect_1.Effect.succeed(effect_1.Option.none()),
17
- JsonParseError: () => effect_1.Effect.succeed(effect_1.Option.none()),
1
+ import { Effect, Option as O, pipe } from 'effect';
2
+ import { join } from 'path';
3
+ import { isArrayOfStrings } from 'tightrope/guard/is-array-of-strings.js';
4
+ import { isNonEmptyObject } from 'tightrope/guard/is-non-empty-object.js';
5
+ import { readJsonFileSync } from '../../io/read-json-file-sync.js';
6
+ export function getYarnPatterns(io) {
7
+ return pipe(readJsonFileSync(io, join(io.process.cwd(), 'package.json')), Effect.map((file) => isNonEmptyObject(file.contents.workspaces) &&
8
+ isArrayOfStrings(file.contents.workspaces.packages)
9
+ ? O.some(file.contents.workspaces.packages)
10
+ : isArrayOfStrings(file.contents.workspaces)
11
+ ? O.some(file.contents.workspaces)
12
+ : O.none()), Effect.catchTags({
13
+ ReadFileError: () => Effect.succeed(O.none()),
14
+ JsonParseError: () => Effect.succeed(O.none()),
18
15
  }));
19
16
  }
20
- exports.getYarnPatterns = getYarnPatterns;
@@ -1,8 +1,8 @@
1
1
  import { Effect } from 'effect';
2
- import type { Ctx } from '../../get-context';
3
- import type { Io } from '../../io';
2
+ import type { Ctx } from '../../get-context/index.js';
3
+ import type { Io } from '../../io/index.js';
4
4
  /**
5
5
  * Find every glob pattern which should be used to find package.json files for
6
6
  * this monorepo.
7
7
  */
8
- export declare function getPatterns(io: Io, config: Ctx['config']): Effect.Effect<never, never, string[]>;
8
+ export declare function getPatterns(io: Io, config: Ctx['config']): Effect.Effect<string[]>;
@@ -1,27 +1,23 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getPatterns = void 0;
4
- const effect_1 = require("effect");
5
- const is_array_of_strings_1 = require("tightrope/guard/is-array-of-strings");
6
- const get_source_1 = require("../../config/get-source");
7
- const constants_1 = require("../../constants");
8
- const get_lerna_patterns_1 = require("./get-lerna-patterns");
9
- const get_pnpm_patterns_1 = require("./get-pnpm-patterns");
10
- const get_yarn_patterns_1 = require("./get-yarn-patterns");
1
+ import { Effect, Option as O, pipe } from 'effect';
2
+ import { isArrayOfStrings } from 'tightrope/guard/is-array-of-strings.js';
3
+ import { getSource } from '../../config/get-source.js';
4
+ import { DEFAULT_CONFIG } from '../../constants.js';
5
+ import { getLernaPatterns } from './get-lerna-patterns.js';
6
+ import { getPnpmPatterns } from './get-pnpm-patterns.js';
7
+ import { getYarnPatterns } from './get-yarn-patterns.js';
11
8
  /**
12
9
  * Find every glob pattern which should be used to find package.json files for
13
10
  * this monorepo.
14
11
  */
15
- function getPatterns(io, config) {
16
- return (0, effect_1.pipe)(getCliPatterns(), effect_1.Effect.flatMap((opt) => (effect_1.Option.isSome(opt) ? effect_1.Effect.succeed(opt) : getWorkspacePatterns())), effect_1.Effect.map(effect_1.Option.map(limitToPackageJson)), effect_1.Effect.map(effect_1.Option.getOrElse(() => [...constants_1.DEFAULT_CONFIG.source])));
12
+ export function getPatterns(io, config) {
13
+ return pipe(getCliPatterns(), Effect.flatMap((opt) => (O.isSome(opt) ? Effect.succeed(opt) : getWorkspacePatterns())), Effect.map(O.map(limitToPackageJson)), Effect.map(O.getOrElse(() => [...DEFAULT_CONFIG.source])));
17
14
  function getCliPatterns() {
18
- return (0, effect_1.pipe)(effect_1.Option.some((0, get_source_1.getSource)(config)), effect_1.Option.filter(is_array_of_strings_1.isArrayOfStrings), effect_1.Effect.succeed);
15
+ return pipe(O.some(getSource(config)), O.filter(isArrayOfStrings), Effect.succeed);
19
16
  }
20
17
  function getWorkspacePatterns() {
21
- return (0, effect_1.pipe)((0, get_yarn_patterns_1.getYarnPatterns)(io), effect_1.Effect.flatMap((opt) => (effect_1.Option.isSome(opt) ? effect_1.Effect.succeed(opt) : (0, get_pnpm_patterns_1.getPnpmPatterns)(io))), effect_1.Effect.flatMap((opt) => (effect_1.Option.isSome(opt) ? effect_1.Effect.succeed(opt) : (0, get_lerna_patterns_1.getLernaPatterns)(io))), effect_1.Effect.map(effect_1.Option.map((patterns) => ['package.json', ...patterns])));
18
+ return pipe(getYarnPatterns(io), Effect.flatMap((opt) => (O.isSome(opt) ? Effect.succeed(opt) : getPnpmPatterns(io))), Effect.flatMap((opt) => (O.isSome(opt) ? Effect.succeed(opt) : getLernaPatterns(io))), Effect.map(O.map((patterns) => ['package.json', ...patterns])));
22
19
  }
23
20
  function limitToPackageJson(patterns) {
24
21
  return patterns.map((pattern) => pattern.includes('package.json') ? pattern : `${pattern}/package.json`);
25
22
  }
26
23
  }
27
- exports.getPatterns = getPatterns;
@@ -1,10 +1,10 @@
1
1
  import { Effect } from 'effect';
2
- import type { Ctx } from '../get-context';
3
- import type { Io } from '../io';
4
- import type { GlobError } from '../io/glob-sync';
5
- import type { ReadFileError } from '../io/read-file-sync';
6
- import type { JsonParseError } from '../io/read-json-file-sync';
7
- import type { NoSourcesFoundError } from './get-file-paths';
8
- import { PackageJsonFile } from './package-json-file';
2
+ import type { Ctx } from '../get-context/index.js';
3
+ import type { GlobError } from '../io/glob-sync.js';
4
+ import type { Io } from '../io/index.js';
5
+ import type { ReadFileError } from '../io/read-file-sync.js';
6
+ import type { JsonParseError } from '../io/read-json-file-sync.js';
7
+ import type { NoSourcesFoundError } from './get-file-paths.js';
8
+ import { PackageJsonFile } from './package-json-file.js';
9
9
  /** Create an API for every package.json file needed. */
10
- export declare function getPackageJsonFiles(io: Io, config: Ctx['config']): Effect.Effect<never, NoSourcesFoundError | GlobError | ReadFileError | JsonParseError, PackageJsonFile[]>;
10
+ export declare function getPackageJsonFiles(io: Io, config: Ctx['config']): Effect.Effect<PackageJsonFile[], NoSourcesFoundError | GlobError | ReadFileError | JsonParseError>;
@@ -1,12 +1,8 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getPackageJsonFiles = void 0;
4
- const effect_1 = require("effect");
5
- const read_json_file_sync_1 = require("../io/read-json-file-sync");
6
- const get_file_paths_1 = require("./get-file-paths");
7
- const package_json_file_1 = require("./package-json-file");
1
+ import { Effect, pipe } from 'effect';
2
+ import { readJsonFileSync } from '../io/read-json-file-sync.js';
3
+ import { getFilePaths } from './get-file-paths.js';
4
+ import { PackageJsonFile } from './package-json-file.js';
8
5
  /** Create an API for every package.json file needed. */
9
- function getPackageJsonFiles(io, config) {
10
- return (0, effect_1.pipe)((0, get_file_paths_1.getFilePaths)(io, config), effect_1.Effect.flatMap((filePaths) => effect_1.Effect.all(filePaths.map((filePath) => (0, read_json_file_sync_1.readJsonFileSync)(io, filePath)))), effect_1.Effect.map((files) => files.map((file) => new package_json_file_1.PackageJsonFile(file, config))), effect_1.Effect.tap((files) => effect_1.Effect.logDebug(`${files.length} package.json files found`)));
6
+ export function getPackageJsonFiles(io, config) {
7
+ return pipe(getFilePaths(io, config), Effect.flatMap((filePaths) => Effect.all(filePaths.map((filePath) => readJsonFileSync(io, filePath)))), Effect.map((files) => files.map((file) => new PackageJsonFile(file, config))), Effect.tap((files) => Effect.logDebug(`${files.length} package.json files found`)));
11
8
  }
12
- exports.getPackageJsonFiles = getPackageJsonFiles;
@@ -1,9 +1,9 @@
1
1
  import { Effect } from 'effect';
2
- import type { RcFile } from '..';
3
- import type { Strategy } from '../config/get-custom-types';
4
- import type { Ctx } from '../get-context';
5
- import { Instance } from '../get-instances/instance';
6
- import type { JsonFile } from '../io/read-json-file-sync';
2
+ import type { Strategy } from '../config/get-custom-types.js';
3
+ import type { Ctx } from '../get-context/index.js';
4
+ import { Instance } from '../get-instances/instance.js';
5
+ import type { RcFile } from '../index.js';
6
+ import type { JsonFile } from '../io/read-json-file-sync.js';
7
7
  export type PackageJson = {
8
8
  bugs?: {
9
9
  url: string;
@@ -43,5 +43,5 @@ export declare class PackageJsonFile {
43
43
  /** the .name property from the package.json file */
44
44
  name: string | undefined;
45
45
  constructor(jsonFile: JsonFile<PackageJson>, config: Ctx['config']);
46
- getInstances(enabledTypes: Strategy.Any[]): Effect.Effect<never, never, Instance[]>;
46
+ getInstances(enabledTypes: Strategy.Any[]): Effect.Effect<Instance[]>;
47
47
  }
@@ -1,9 +1,6 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.PackageJsonFile = void 0;
4
- const effect_1 = require("effect");
5
- const instance_1 = require("../get-instances/instance");
6
- class PackageJsonFile {
1
+ import { Effect, pipe } from 'effect';
2
+ import { Instance } from '../get-instances/instance.js';
3
+ export class PackageJsonFile {
7
4
  /** resolved configuration */
8
5
  config;
9
6
  /** ensure only one set of instances is ever created and shared */
@@ -20,14 +17,13 @@ class PackageJsonFile {
20
17
  }
21
18
  getInstances(enabledTypes) {
22
19
  if (!this._instances) {
23
- return (0, effect_1.pipe)(effect_1.Effect.all(enabledTypes.map((strategy) => (0, effect_1.pipe)(strategy.read(this), effect_1.Effect.map((entries) => entries.map(([name, rawSpecifier]) => new instance_1.Instance(name, rawSpecifier, this, strategy)))))), effect_1.Effect.map((array) => array.flat()), effect_1.Effect.tapBoth({
24
- onSuccess: (instances) => effect_1.Effect.logDebug(`found ${instances.length} instances in <${this.jsonFile.shortPath}>`),
25
- onFailure: () => effect_1.Effect.logError(`failed to get instances from <${this.jsonFile.shortPath}>`),
26
- }), effect_1.Effect.catchAll(() => effect_1.Effect.succeed([])), effect_1.Effect.tap((instances) => effect_1.Effect.sync(() => {
20
+ return pipe(Effect.all(enabledTypes.map((strategy) => pipe(strategy.read(this), Effect.map((entries) => entries.map(([name, rawSpecifier]) => new Instance(name, rawSpecifier, this, strategy)))))), Effect.map((array) => array.flat()), Effect.tapBoth({
21
+ onSuccess: (instances) => Effect.logDebug(`found ${instances.length} instances in <${this.jsonFile.shortPath}>`),
22
+ onFailure: () => Effect.logError(`failed to get instances from <${this.jsonFile.shortPath}>`),
23
+ }), Effect.catchAll(() => Effect.succeed([])), Effect.tap((instances) => Effect.sync(() => {
27
24
  this._instances = instances;
28
25
  })));
29
26
  }
30
- return effect_1.Effect.succeed(this._instances);
27
+ return Effect.succeed(this._instances);
31
28
  }
32
29
  }
33
- exports.PackageJsonFile = PackageJsonFile;
@@ -1,5 +1,5 @@
1
- import type { Ctx } from '../get-context';
2
- import type { Instance } from '../get-instances/instance';
3
- import type { SemverGroup } from '../semver-group';
4
- import type { VersionGroup } from '../version-group';
1
+ import type { Ctx } from '../get-context/index.js';
2
+ import type { Instance } from '../get-instances/instance.js';
3
+ import type { SemverGroup } from '../semver-group/index.js';
4
+ import type { VersionGroup } from '../version-group/index.js';
5
5
  export declare function canAddToGroup(packageJsonFilesByName: Ctx['packageJsonFilesByName'], group: SemverGroup.Any | VersionGroup.Any, instance: Instance): boolean;
@@ -1,9 +1,6 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.canAddToGroup = void 0;
4
- const minimatch_1 = require("minimatch");
5
- const is_non_empty_array_1 = require("tightrope/guard/is-non-empty-array");
6
- function canAddToGroup(packageJsonFilesByName, group, instance) {
1
+ import { minimatch } from 'minimatch';
2
+ import { isNonEmptyArray } from 'tightrope/guard/is-non-empty-array.js';
3
+ export function canAddToGroup(packageJsonFilesByName, group, instance) {
7
4
  const { dependencies, dependencyTypes, packages, specifierTypes } = group.config;
8
5
  return (group.canAdd(instance) &&
9
6
  matchesDependencyTypes(dependencyTypes, instance) &&
@@ -11,22 +8,21 @@ function canAddToGroup(packageJsonFilesByName, group, instance) {
11
8
  matchesDependencies(packageJsonFilesByName, group, dependencies, instance) &&
12
9
  matchesSpecifierTypes(specifierTypes, instance));
13
10
  }
14
- exports.canAddToGroup = canAddToGroup;
15
11
  function matchesDependencies(packageJsonFilesByName, group, dependencies, instance) {
16
12
  // matches if not defined
17
- if (!(0, is_non_empty_array_1.isNonEmptyArray)(dependencies))
13
+ if (!isNonEmptyArray(dependencies))
18
14
  return true;
19
15
  return dependencies.some((pattern) => (pattern === '$LOCAL' &&
20
16
  instance.name in packageJsonFilesByName &&
21
17
  ((group.groupType === 'versionGroup' && instance.versionGroup === null) ||
22
18
  (group.groupType === 'semverGroup' && instance.semverGroup === null))) ||
23
- (0, minimatch_1.minimatch)(instance.name, pattern));
19
+ minimatch(instance.name, pattern));
24
20
  }
25
21
  function matchesPackages(packages, instance) {
26
22
  // matches if not defined
27
- if (!(0, is_non_empty_array_1.isNonEmptyArray)(packages))
23
+ if (!isNonEmptyArray(packages))
28
24
  return true;
29
- return packages.some((pattern) => (0, minimatch_1.minimatch)(instance.pkgName, pattern));
25
+ return packages.some((pattern) => minimatch(instance.pkgName, pattern));
30
26
  }
31
27
  function matchesDependencyTypes(dependencyTypes, instance) {
32
28
  return matchesKnownList(dependencyTypes, instance.strategy.name);
@@ -36,7 +32,7 @@ function matchesSpecifierTypes(specifierTypes, instance) {
36
32
  }
37
33
  function matchesKnownList(values, value) {
38
34
  // matches if not defined
39
- if (!(0, is_non_empty_array_1.isNonEmptyArray)(values))
35
+ if (!isNonEmptyArray(values))
40
36
  return true;
41
37
  if (values.join('') === '**')
42
38
  return true;
@@ -50,7 +46,7 @@ function matchesKnownList(values, value) {
50
46
  positive.push(name);
51
47
  }
52
48
  });
53
- if ((0, is_non_empty_array_1.isNonEmptyArray)(negative) && !negative.includes(value))
49
+ if (isNonEmptyArray(negative) && !negative.includes(value))
54
50
  return true;
55
- return (0, is_non_empty_array_1.isNonEmptyArray)(positive) && positive.includes(value);
51
+ return isNonEmptyArray(positive) && positive.includes(value);
56
52
  }
@@ -1,9 +1,6 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.isSemver = void 0;
4
- const is_string_1 = require("tightrope/guard/is-string");
1
+ import { isString } from 'tightrope/guard/is-string.js';
5
2
  /** @deprecated migrate to make better use of npm-package-arg */
6
- function isSemver(version) {
3
+ export function isSemver(version) {
7
4
  const range = '(~|\\^|>=|>|<=|<)?';
8
5
  const ints = '[0-9]+';
9
6
  const intsOrX = '([0-9]+|x)';
@@ -11,7 +8,6 @@ function isSemver(version) {
11
8
  const major = new RegExp(`^${range}${ints}$`);
12
9
  const minor = new RegExp(`^${range}${ints}${dot}${intsOrX}$`);
13
10
  const patch = new RegExp(`^${range}${ints}${dot}${intsOrX}${dot}${intsOrX}$`);
14
- return ((0, is_string_1.isString)(version) &&
11
+ return (isString(version) &&
15
12
  (version.search(major) !== -1 || version.search(minor) !== -1 || version.search(patch) !== -1));
16
13
  }
17
- exports.isSemver = isSemver;
@@ -1,3 +1,3 @@
1
- import type { SemverRange } from '../config/types';
1
+ import type { SemverRange } from '../config/types.js';
2
2
  /** @deprecated migrate to make better use of npm-package-arg */
3
3
  export declare function isValidSemverRange(value: unknown): value is SemverRange;
@@ -1,18 +1,14 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.isValidSemverRange = void 0;
4
- const constants_1 = require("../constants");
1
+ import { RANGE } from '../constants.js';
5
2
  /** @deprecated migrate to make better use of npm-package-arg */
6
- function isValidSemverRange(value) {
7
- return (value === constants_1.RANGE.ANY ||
8
- value === constants_1.RANGE.EXACT ||
9
- value === constants_1.RANGE.GT ||
10
- value === constants_1.RANGE.GTE ||
11
- value === constants_1.RANGE.LOOSE ||
12
- value === constants_1.RANGE.LT ||
13
- value === constants_1.RANGE.LTE ||
14
- value === constants_1.RANGE.MINOR ||
15
- value === constants_1.RANGE.PATCH ||
16
- value === constants_1.RANGE.WORKSPACE);
3
+ export function isValidSemverRange(value) {
4
+ return (value === RANGE.ANY ||
5
+ value === RANGE.EXACT ||
6
+ value === RANGE.GT ||
7
+ value === RANGE.GTE ||
8
+ value === RANGE.LOOSE ||
9
+ value === RANGE.LT ||
10
+ value === RANGE.LTE ||
11
+ value === RANGE.MINOR ||
12
+ value === RANGE.PATCH ||
13
+ value === RANGE.WORKSPACE);
17
14
  }
18
- exports.isValidSemverRange = isValidSemverRange;
package/dist/index.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- import type { RcConfig } from './config/types';
1
+ import type { RcConfig } from './config/types.js';
2
2
  export type RcFile = Partial<RcConfig>;
package/dist/index.js CHANGED
@@ -1,2 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ export {};
@@ -1,8 +1,8 @@
1
- import { Data, Effect } from 'effect';
2
- import type { Io } from '.';
3
- declare const AskForChoiceError_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 { Io } from './index.js';
3
+ declare const AskForChoiceError_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> & {
4
4
  readonly _tag: "AskForChoiceError";
5
- }>;
5
+ };
6
6
  declare class AskForChoiceError extends AskForChoiceError_base<{
7
7
  readonly error: string;
8
8
  }> {
@@ -10,5 +10,5 @@ declare class AskForChoiceError extends AskForChoiceError_base<{
10
10
  export declare function askForChoice(opts: {
11
11
  message: string;
12
12
  choices: string[];
13
- }): Effect.Effect<Io, AskForChoiceError, string>;
13
+ }): Effect.Effect<string, AskForChoiceError, Io>;
14
14
  export {};
@@ -1,12 +1,9 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.askForChoice = void 0;
4
- const effect_1 = require("effect");
5
- const _1 = require(".");
6
- class AskForChoiceError extends effect_1.Data.TaggedClass('AskForChoiceError') {
1
+ import { Data, Effect, pipe } from 'effect';
2
+ import { IoTag } from './index.js';
3
+ class AskForChoiceError extends Data.TaggedClass('AskForChoiceError') {
7
4
  }
8
- function askForChoice(opts) {
9
- return (0, effect_1.pipe)(_1.IoTag, effect_1.Effect.flatMap((io) => effect_1.Effect.tryPromise({
5
+ export function askForChoice(opts) {
6
+ return pipe(IoTag, Effect.flatMap((io) => Effect.tryPromise({
10
7
  try: () => io.enquirer
11
8
  .prompt({
12
9
  type: 'select',
@@ -18,4 +15,3 @@ function askForChoice(opts) {
18
15
  catch: (err) => new AskForChoiceError({ error: String(err) }),
19
16
  })));
20
17
  }
21
- exports.askForChoice = askForChoice;
@@ -1,13 +1,13 @@
1
- import { Data, Effect } from 'effect';
2
- import type { Io } from '.';
3
- declare const AskForInputError_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 { Io } from './index.js';
3
+ declare const AskForInputError_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> & {
4
4
  readonly _tag: "AskForInputError";
5
- }>;
5
+ };
6
6
  declare class AskForInputError extends AskForInputError_base<{
7
7
  readonly error: string;
8
8
  }> {
9
9
  }
10
10
  export declare function askForInput(opts: {
11
11
  message: string;
12
- }): Effect.Effect<Io, AskForInputError, string>;
12
+ }): Effect.Effect<string, AskForInputError, Io>;
13
13
  export {};
@@ -1,12 +1,9 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.askForInput = void 0;
4
- const effect_1 = require("effect");
5
- const _1 = require(".");
6
- class AskForInputError extends effect_1.Data.TaggedClass('AskForInputError') {
1
+ import { Data, Effect, pipe } from 'effect';
2
+ import { IoTag } from './index.js';
3
+ class AskForInputError extends Data.TaggedClass('AskForInputError') {
7
4
  }
8
- function askForInput(opts) {
9
- return (0, effect_1.pipe)(_1.IoTag, effect_1.Effect.flatMap((io) => effect_1.Effect.tryPromise({
5
+ export function askForInput(opts) {
6
+ return pipe(IoTag, Effect.flatMap((io) => Effect.tryPromise({
10
7
  try: () => io.enquirer.prompt({
11
8
  name: 'version',
12
9
  type: 'input',
@@ -15,4 +12,3 @@ function askForInput(opts) {
15
12
  catch: (err) => new AskForInputError({ error: String(err) }),
16
13
  })));
17
14
  }
18
- exports.askForInput = askForInput;
@@ -1,4 +1,4 @@
1
1
  import { Effect } from 'effect';
2
- import { type Io } from '.';
3
- import type { Ctx } from '../get-context';
4
- export declare function exitIfInvalid(ctx: Ctx): Effect.Effect<Io, never, Ctx>;
2
+ import type { Ctx } from '../get-context/index.js';
3
+ import { type Io } from './index.js';
4
+ export declare function exitIfInvalid(ctx: Ctx): Effect.Effect<Ctx, never, Io>;
@@ -1,13 +1,9 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.exitIfInvalid = void 0;
4
- const effect_1 = require("effect");
5
- const _1 = require(".");
6
- function exitIfInvalid(ctx) {
7
- return (0, effect_1.pipe)(_1.IoTag, effect_1.Effect.tap((io) => effect_1.Effect.sync(() => {
1
+ import { Effect, pipe } from 'effect';
2
+ import { IoTag } from './index.js';
3
+ export function exitIfInvalid(ctx) {
4
+ return pipe(IoTag, Effect.tap((io) => Effect.sync(() => {
8
5
  if (ctx.isInvalid) {
9
6
  io.process.exit(1);
10
7
  }
11
- })), effect_1.Effect.map(() => ctx));
8
+ })), Effect.map(() => ctx));
12
9
  }
13
- exports.exitIfInvalid = exitIfInvalid;
@@ -1,11 +1,11 @@
1
- import { Data, Effect } from 'effect';
2
- import type { Io } from '.';
3
- declare const GlobError_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 { Io } from './index.js';
3
+ declare const GlobError_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> & {
4
4
  readonly _tag: "GlobError";
5
- }>;
5
+ };
6
6
  export declare class GlobError extends GlobError_base<{
7
7
  readonly error: string;
8
8
  }> {
9
9
  }
10
- export declare function globSync(io: Io, patterns: string[]): Effect.Effect<never, GlobError, string[]>;
10
+ export declare function globSync(io: Io, patterns: string[]): Effect.Effect<string[], GlobError>;
11
11
  export {};
@@ -1,12 +1,8 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.globSync = exports.GlobError = void 0;
4
- const effect_1 = require("effect");
5
- class GlobError extends effect_1.Data.TaggedClass('GlobError') {
1
+ import { Data, Effect } from 'effect';
2
+ export class GlobError extends Data.TaggedClass('GlobError') {
6
3
  }
7
- exports.GlobError = GlobError;
8
- function globSync(io, patterns) {
9
- return effect_1.Effect.try({
4
+ export function globSync(io, patterns) {
5
+ return Effect.try({
10
6
  try: () => io.globby.sync(patterns, {
11
7
  absolute: true,
12
8
  cwd: io.process.cwd(),
@@ -16,4 +12,3 @@ function globSync(io, patterns) {
16
12
  catch: (err) => new GlobError({ error: String(err) }),
17
13
  });
18
14
  }
19
- exports.globSync = globSync;