@savvy-web/silk 3.0.3 → 3.0.5

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.
@@ -52,7 +52,6 @@ let module$1 = require("module");
52
52
  let semver_classes_range_js = require("semver/classes/range.js");
53
53
  semver_classes_range_js = __toESM(semver_classes_range_js, 1);
54
54
  let node_child_process = require("node:child_process");
55
- node_child_process = __toESM(node_child_process, 1);
56
55
  let node_stream_promises = require("node:stream/promises");
57
56
  let node_stream = require("node:stream");
58
57
  let node_readline = require("node:readline");
@@ -420,7 +419,7 @@ const trimTrailingSlashes = (s) => {
420
419
  return s.slice(0, end);
421
420
  };
422
421
  //#endregion
423
- //#region ../../node_modules/.pnpm/@effected+glob@0.1.1_effect@4.0.0-beta.98/node_modules/@effected/glob/internal/limits.js
422
+ //#region ../../node_modules/.pnpm/@effected+glob@0.2.0_effect@4.0.0-beta.99/node_modules/@effected/glob/internal/limits.js
424
423
  /** Hard cap on pattern length. Upstream minimatch's MAX_PATTERN_LENGTH (64KB). */
425
424
  const MAX_PATTERN_LENGTH = 1024 * 64;
426
425
  /** Default brace-expansion output budget. Upstream brace-expansion's EXPANSION_MAX. */
@@ -454,7 +453,7 @@ const assertCap = (name, value) => {
454
453
  return value;
455
454
  };
456
455
  //#endregion
457
- //#region ../../node_modules/.pnpm/@effected+glob@0.1.1_effect@4.0.0-beta.98/node_modules/@effected/glob/internal/unescape.js
456
+ //#region ../../node_modules/.pnpm/@effected+glob@0.2.0_effect@4.0.0-beta.99/node_modules/@effected/glob/internal/unescape.js
458
457
  /**
459
458
  * Un-escape a string that has been escaped with `escape`.
460
459
  *
@@ -477,11 +476,11 @@ const unescapePattern = (s, { windowsPathsNoEscape = false, magicalBraces = true
477
476
  return windowsPathsNoEscape ? s.replace(/\[([^/\\{}])\]/g, "$1") : s.replace(/((?!\\).|^)\[([^/\\{}])\]/g, "$1$2").replace(/\\([^/{}])/g, "$1");
478
477
  };
479
478
  //#endregion
480
- //#region ../../node_modules/.pnpm/@effected+glob@0.1.1_effect@4.0.0-beta.98/node_modules/@effected/glob/internal/types.js
479
+ //#region ../../node_modules/.pnpm/@effected+glob@0.2.0_effect@4.0.0-beta.99/node_modules/@effected/glob/internal/types.js
481
480
  /** The globstar marker in a compiled pattern set. */
482
481
  const GLOBSTAR = Symbol("globstar **");
483
482
  //#endregion
484
- //#region ../../node_modules/.pnpm/@effected+glob@0.1.1_effect@4.0.0-beta.98/node_modules/@effected/glob/internal/escape.js
483
+ //#region ../../node_modules/.pnpm/@effected+glob@0.2.0_effect@4.0.0-beta.99/node_modules/@effected/glob/internal/escape.js
485
484
  /**
486
485
  * Escape all magic characters in a glob pattern.
487
486
  *
@@ -499,13 +498,13 @@ const escapePattern = (s, { windowsPathsNoEscape = false, magicalBraces = false
499
498
  return windowsPathsNoEscape ? s.replace(/[?*()[\]]/g, "[$&]") : s.replace(/[?*()[\]\\]/g, "\\$&");
500
499
  };
501
500
  //#endregion
502
- //#region ../../node_modules/.pnpm/@effected+glob@0.1.1_effect@4.0.0-beta.98/node_modules/@effected/glob/internal/assertValidPattern.js
501
+ //#region ../../node_modules/.pnpm/@effected+glob@0.2.0_effect@4.0.0-beta.99/node_modules/@effected/glob/internal/assertValidPattern.js
503
502
  const assertValidPattern = (pattern) => {
504
503
  if (typeof pattern !== "string") throw new TypeError("invalid pattern");
505
504
  if (pattern.length > 65536) throw new GuardExceeded("PatternTooLong", MAX_PATTERN_LENGTH, pattern.length);
506
505
  };
507
506
  //#endregion
508
- //#region ../../node_modules/.pnpm/@effected+glob@0.1.1_effect@4.0.0-beta.98/node_modules/@effected/glob/internal/braceExpressions.js
507
+ //#region ../../node_modules/.pnpm/@effected+glob@0.2.0_effect@4.0.0-beta.99/node_modules/@effected/glob/internal/braceExpressions.js
509
508
  const posixClasses = {
510
509
  "[:alnum:]": ["\\p{L}\\p{Nl}\\p{Nd}", true],
511
510
  "[:alpha:]": ["\\p{L}\\p{Nl}", true],
@@ -628,7 +627,7 @@ const parseClass = (glob, position) => {
628
627
  ];
629
628
  };
630
629
  //#endregion
631
- //#region ../../node_modules/.pnpm/@effected+glob@0.1.1_effect@4.0.0-beta.98/node_modules/@effected/glob/internal/ast.js
630
+ //#region ../../node_modules/.pnpm/@effected+glob@0.2.0_effect@4.0.0-beta.99/node_modules/@effected/glob/internal/ast.js
632
631
  const types = /* @__PURE__ */ new Set([
633
632
  "!",
634
633
  "?",
@@ -1145,7 +1144,7 @@ var AST = class AST {
1145
1144
  }
1146
1145
  };
1147
1146
  //#endregion
1148
- //#region ../../node_modules/.pnpm/@effected+glob@0.1.1_effect@4.0.0-beta.98/node_modules/@effected/glob/internal/balancedMatch.js
1147
+ //#region ../../node_modules/.pnpm/@effected+glob@0.2.0_effect@4.0.0-beta.99/node_modules/@effected/glob/internal/balancedMatch.js
1149
1148
  const maybeMatch = (reg, str) => {
1150
1149
  const m = str.match(reg);
1151
1150
  return m ? m[0] : null;
@@ -1203,7 +1202,7 @@ const range = (a, b, str) => {
1203
1202
  return result;
1204
1203
  };
1205
1204
  //#endregion
1206
- //#region ../../node_modules/.pnpm/@effected+glob@0.1.1_effect@4.0.0-beta.98/node_modules/@effected/glob/internal/braceExpansion.js
1205
+ //#region ../../node_modules/.pnpm/@effected+glob@0.2.0_effect@4.0.0-beta.99/node_modules/@effected/glob/internal/braceExpansion.js
1207
1206
  const escSlash = `\0SLASH${Math.random()}\0`;
1208
1207
  const escOpen = `\0OPEN${Math.random()}\0`;
1209
1208
  const escClose = `\0CLOSE${Math.random()}\0`;
@@ -1350,7 +1349,7 @@ function expand_(str, max, isTopInput, depth) {
1350
1349
  }
1351
1350
  }
1352
1351
  //#endregion
1353
- //#region ../../node_modules/.pnpm/@effected+glob@0.1.1_effect@4.0.0-beta.98/node_modules/@effected/glob/internal/minimatch.js
1352
+ //#region ../../node_modules/.pnpm/@effected+glob@0.2.0_effect@4.0.0-beta.99/node_modules/@effected/glob/internal/minimatch.js
1354
1353
  const starDotExtRE = /^\*+([^+@!?*[(]*)$/;
1355
1354
  const starDotExtTest = (ext) => (f) => !f.startsWith(".") && f.endsWith(ext);
1356
1355
  const starDotExtTestDot = (ext) => (f) => f.endsWith(ext);
@@ -1921,7 +1920,7 @@ var Minimatch = class {
1921
1920
  }
1922
1921
  };
1923
1922
  //#endregion
1924
- //#region ../../node_modules/.pnpm/@effected+glob@0.1.1_effect@4.0.0-beta.98/node_modules/@effected/glob/GlobPattern.js
1923
+ //#region ../../node_modules/.pnpm/@effected+glob@0.2.0_effect@4.0.0-beta.99/node_modules/@effected/glob/GlobPattern.js
1925
1924
  /**
1926
1925
  * Typed failure raised when a glob pattern trips a compile-time guard:
1927
1926
  * over-length, brace-expansion budget exhaustion, or nesting past the depth
@@ -2050,17 +2049,30 @@ var GlobPattern = class GlobPattern extends effect.Schema.Class("GlobPattern")(e
2050
2049
  return this.#engine;
2051
2050
  }
2052
2051
  /**
2053
- * Compile a pattern under the given options — the package's fallible
2054
- * boundary. Guard trips (over-length, expansion budget, nesting depth)
2055
- * fail typed with {@link GlobPatternError}; invalid options never reach
2056
- * here (they throw at `GlobPatternOptions.make`, a wiring defect).
2052
+ * Compile a pattern under the given options, synchronously — the package's
2053
+ * fallible boundary in its primitive form. Compilation is pure
2054
+ * string→predicate work with no IO, no services and no async step, so the
2055
+ * sync form is the real primitive and {@link GlobPattern.compile} is
2056
+ * derived from it.
2057
+ *
2058
+ * Total: never throws for pattern input. Guard trips (over-length,
2059
+ * expansion budget, nesting depth) come back as a `Result` failure holding
2060
+ * {@link GlobPatternError}; invalid *options* never reach here (they throw
2061
+ * at `GlobPatternOptions.make`, a wiring defect).
2057
2062
  *
2058
2063
  * The pattern must also compile under DEFAULT options, whatever the
2059
2064
  * effective options are — permissive options (say `nobrace` over a brace
2060
2065
  * bomb) do not admit a defaults-rejected pattern; the same typed error
2061
2066
  * surfaces instead.
2067
+ *
2068
+ * @remarks
2069
+ * For synchronous call sites that cannot host an Effect — a lint-staged
2070
+ * handler, a config predicate — this removes the
2071
+ * `Effect.runSync(Effect.result(...))` escape hatch: pair it with
2072
+ * `Result.isSuccess` and read `.success` directly. Effect call sites should
2073
+ * prefer {@link GlobPattern.compile}, which carries the tracing span.
2062
2074
  */
2063
- static compile = effect.Effect.fn("GlobPattern.compile")(function* (source, options) {
2075
+ static compileResult(source, options) {
2064
2076
  const engineOptions = toEngineOptions(options);
2065
2077
  try {
2066
2078
  new Minimatch(source, {});
@@ -2068,16 +2080,30 @@ var GlobPattern = class GlobPattern extends effect.Schema.Class("GlobPattern")(e
2068
2080
  const pattern = new GlobPattern({ source });
2069
2081
  pattern.#engine = engine;
2070
2082
  pattern.#engineOptions = engineOptions;
2071
- return pattern;
2083
+ return effect.Result.succeed(pattern);
2072
2084
  } catch (e) {
2073
- if (isGuardExceeded(e)) return yield* new GlobPatternError({
2085
+ if (isGuardExceeded(e)) return effect.Result.fail(new GlobPatternError({
2074
2086
  pattern: source,
2075
2087
  reason: e.reason,
2076
2088
  limit: e.limit,
2077
2089
  actual: e.actual
2078
- });
2090
+ }));
2079
2091
  throw e;
2080
2092
  }
2093
+ }
2094
+ /**
2095
+ * Compile a pattern under the given options — the package's fallible
2096
+ * boundary, and the form Effect call sites should reach for. Guard trips
2097
+ * (over-length, expansion budget, nesting depth) fail typed with
2098
+ * {@link GlobPatternError}; invalid options never reach here (they throw at
2099
+ * `GlobPatternOptions.make`, a wiring defect).
2100
+ *
2101
+ * Defined in terms of {@link GlobPattern.compileResult} — synchronous
2102
+ * callers can use that variant directly. Same semantics, same errors; this
2103
+ * form adds only the `GlobPattern.compile` tracing span.
2104
+ */
2105
+ static compile = effect.Effect.fn("GlobPattern.compile")(function* (source, options) {
2106
+ return yield* effect.Effect.fromResult(GlobPattern.compileResult(source, options));
2081
2107
  });
2082
2108
  /**
2083
2109
  * Whether `candidate` matches this pattern. Total: never throws, never
@@ -2173,7 +2199,7 @@ var GlobPattern = class GlobPattern extends effect.Schema.Class("GlobPattern")(e
2173
2199
  })));
2174
2200
  };
2175
2201
  //#endregion
2176
- //#region ../../node_modules/.pnpm/@effected+glob@0.1.1_effect@4.0.0-beta.98/node_modules/@effected/glob/GlobSet.js
2202
+ //#region ../../node_modules/.pnpm/@effected+glob@0.2.0_effect@4.0.0-beta.99/node_modules/@effected/glob/GlobSet.js
2177
2203
  const exclusionTarget = (pattern) => pattern.startsWith("!") ? pattern.slice(1) : void 0;
2178
2204
  const allCompileUnderDefaults = (patterns) => {
2179
2205
  for (const pattern of patterns) {
@@ -2248,27 +2274,53 @@ var GlobSet = class GlobSet extends effect.Schema.Class("GlobSet")(effect.Schema
2248
2274
  return this.#literalSet;
2249
2275
  }
2250
2276
  /**
2251
- * Compile a pattern set — with {@link GlobPattern.compile}, the package's
2252
- * only other fallible boundary. Fails typed on the FIRST uncompilable
2253
- * member, with the error's `pattern` field naming the offending source
2254
- * pattern (bang included for exclusions).
2277
+ * Compile a pattern set, synchronously the primitive form, mirroring
2278
+ * {@link GlobPattern.compileResult}. Set compilation is pure
2279
+ * string→predicate work with no IO and no async step, so the sync form is
2280
+ * the real primitive and {@link GlobSet.compile} is derived from it.
2281
+ *
2282
+ * Total: never throws for pattern input. Fails on the FIRST uncompilable
2283
+ * member, coming back as a `Result` failure whose {@link GlobPatternError}
2284
+ * names the offending source pattern in `pattern` (bang included for
2285
+ * exclusions).
2286
+ *
2287
+ * @remarks
2288
+ * For synchronous call sites that cannot host an Effect — a lint-staged
2289
+ * handler, a config predicate — this removes the
2290
+ * `Effect.runSync(Effect.result(...))` escape hatch: pair it with
2291
+ * `Result.isSuccess` and read `.success` directly. Effect call sites should
2292
+ * prefer {@link GlobSet.compile}, which carries the tracing span.
2255
2293
  */
2256
- static compile = effect.Effect.fn("GlobSet.compile")(function* (patterns) {
2294
+ static compileResult(patterns) {
2257
2295
  for (const pattern of patterns) {
2258
2296
  const target = exclusionTarget(pattern) ?? pattern;
2259
2297
  try {
2260
2298
  new Minimatch(target, {});
2261
2299
  } catch (e) {
2262
- if (isGuardExceeded(e)) return yield* new GlobPatternError({
2300
+ if (isGuardExceeded(e)) return effect.Result.fail(new GlobPatternError({
2263
2301
  pattern,
2264
2302
  reason: e.reason,
2265
2303
  limit: e.limit,
2266
2304
  actual: e.actual
2267
- });
2305
+ }));
2268
2306
  throw e;
2269
2307
  }
2270
2308
  }
2271
- return new GlobSet({ patterns });
2309
+ return effect.Result.succeed(new GlobSet({ patterns }));
2310
+ }
2311
+ /**
2312
+ * Compile a pattern set — with {@link GlobPattern.compile}, the package's
2313
+ * only other fallible boundary, and the form Effect call sites should reach
2314
+ * for. Fails typed on the FIRST uncompilable member, with the error's
2315
+ * `pattern` field naming the offending source pattern (bang included for
2316
+ * exclusions).
2317
+ *
2318
+ * Defined in terms of {@link GlobSet.compileResult} — synchronous callers
2319
+ * can use that variant directly. Same semantics, same errors; this form
2320
+ * adds only the `GlobSet.compile` tracing span.
2321
+ */
2322
+ static compile = effect.Effect.fn("GlobSet.compile")(function* (patterns) {
2323
+ return yield* effect.Effect.fromResult(GlobSet.compileResult(patterns));
2272
2324
  });
2273
2325
  /**
2274
2326
  * Whether `candidate` matches the set: some include accepts it (literal
@@ -2301,7 +2353,7 @@ var GlobSet = class GlobSet extends effect.Schema.Class("GlobSet")(effect.Schema
2301
2353
  }
2302
2354
  };
2303
2355
  //#endregion
2304
- //#region ../../node_modules/.pnpm/@effected+lockfiles@0.1.4_@effected+jsonc@0.3.0_effect@4.0.0-beta.98__@effected+npm@0.2_7fc50d596abf9879356de67fd92b0252/node_modules/@effected/lockfiles/BunExtension.js
2356
+ //#region ../../node_modules/.pnpm/@effected+lockfiles@0.1.8_@effected+jsonc@0.5.0_effect@4.0.0-beta.99__@effected+npm@0.2_d9e647ebf030778b1166690cbf4c6aa9/node_modules/@effected/lockfiles/BunExtension.js
2305
2357
  /**
2306
2358
  * Extension data specific to bun lockfiles, attached to `Lockfile.extension`
2307
2359
  * when the format is `"bun"`.
@@ -2322,7 +2374,7 @@ var BunExtension = class extends effect.Schema.Class("BunExtension")({
2322
2374
  trustedDependencies: effect.Schema.optionalKey(effect.Schema.Array(effect.Schema.String))
2323
2375
  }) {};
2324
2376
  //#endregion
2325
- //#region ../../node_modules/.pnpm/@effected+npm@0.2.0_@effected+semver@0.1.0_effect@4.0.0-beta.98__effect@4.0.0-beta.98/node_modules/@effected/npm/CatalogResolver.js
2377
+ //#region ../../node_modules/.pnpm/@effected+npm@0.2.3_@effected+semver@0.2.0_effect@4.0.0-beta.99__effect@4.0.0-beta.99/node_modules/@effected/npm/CatalogResolver.js
2326
2378
  /**
2327
2379
  * Contract for resolving pnpm `catalog:` dependency specifiers to concrete
2328
2380
  * version ranges.
@@ -2368,7 +2420,7 @@ var CatalogResolver = class CatalogResolver extends effect.Context.Service()("@e
2368
2420
  static noop = effect.Layer.succeed(CatalogResolver, { rangeOf: () => effect.Effect.succeed(effect.Option.none()) });
2369
2421
  };
2370
2422
  //#endregion
2371
- //#region ../../node_modules/.pnpm/@effected+npm@0.2.0_@effected+semver@0.1.0_effect@4.0.0-beta.98__effect@4.0.0-beta.98/node_modules/@effected/npm/WorkspaceResolver.js
2423
+ //#region ../../node_modules/.pnpm/@effected+npm@0.2.3_@effected+semver@0.2.0_effect@4.0.0-beta.99__effect@4.0.0-beta.99/node_modules/@effected/npm/WorkspaceResolver.js
2372
2424
  /**
2373
2425
  * Raised when a `catalog:` or `workspace:` specifier cannot be resolved
2374
2426
  * because the resolution mechanism itself failed — not for an ordinary
@@ -2429,7 +2481,7 @@ var WorkspaceResolver = class WorkspaceResolver extends effect.Context.Service()
2429
2481
  static noop = effect.Layer.succeed(WorkspaceResolver, { versionOf: () => effect.Effect.succeed(effect.Option.none()) });
2430
2482
  };
2431
2483
  //#endregion
2432
- //#region ../../node_modules/.pnpm/@effected+npm@0.2.0_@effected+semver@0.1.0_effect@4.0.0-beta.98__effect@4.0.0-beta.98/node_modules/@effected/npm/CatalogAssemblyError.js
2484
+ //#region ../../node_modules/.pnpm/@effected+npm@0.2.3_@effected+semver@0.2.0_effect@4.0.0-beta.99__effect@4.0.0-beta.99/node_modules/@effected/npm/CatalogAssemblyError.js
2433
2485
  /**
2434
2486
  * Raised when a workspace's catalogs cannot be assembled — a `pnpm-workspace.yaml`
2435
2487
  * that is unreadable or not valid YAML, a root `package.json` `workspaces` field
@@ -2473,7 +2525,7 @@ var CatalogAssemblyError = class extends effect.Schema.TaggedErrorClass()("Catal
2473
2525
  }
2474
2526
  };
2475
2527
  //#endregion
2476
- //#region ../../node_modules/.pnpm/@effected+npm@0.2.0_@effected+semver@0.1.0_effect@4.0.0-beta.98__effect@4.0.0-beta.98/node_modules/@effected/npm/DependencySection.js
2528
+ //#region ../../node_modules/.pnpm/@effected+npm@0.2.3_@effected+semver@0.2.0_effect@4.0.0-beta.99__effect@4.0.0-beta.99/node_modules/@effected/npm/DependencySection.js
2477
2529
  /**
2478
2530
  * The short dependency kind: which dependency map an entry came from, named the
2479
2531
  * way consumers branch on it.
@@ -2505,7 +2557,7 @@ Object.fromEntries(Object.entries({
2505
2557
  optional: "optionalDependencies"
2506
2558
  }).map(([kind, field]) => [field, kind]));
2507
2559
  //#endregion
2508
- //#region ../../node_modules/.pnpm/@effected+semver@0.1.0_effect@4.0.0-beta.98/node_modules/@effected/semver/internal/desugar.js
2560
+ //#region ../../node_modules/.pnpm/@effected+semver@0.2.0_effect@4.0.0-beta.99/node_modules/@effected/semver/internal/desugar.js
2509
2561
  const sv = (major, minor, patch, prerelease = [], build = []) => ({
2510
2562
  major,
2511
2563
  minor,
@@ -2594,7 +2646,7 @@ const desugarHyphen = (lower, upper) => {
2594
2646
  return [comp(">=", lowerVersion)];
2595
2647
  };
2596
2648
  //#endregion
2597
- //#region ../../node_modules/.pnpm/@effected+semver@0.1.0_effect@4.0.0-beta.98/node_modules/@effected/semver/internal/grammar.js
2649
+ //#region ../../node_modules/.pnpm/@effected+semver@0.2.0_effect@4.0.0-beta.99/node_modules/@effected/semver/internal/grammar.js
2598
2650
  /** Private control-flow exception; never escapes the entry points. */
2599
2651
  var ParseFailure = class {
2600
2652
  position;
@@ -2989,7 +3041,7 @@ const formatComparator = (c) => {
2989
3041
  /** Print comparator sets as `a b || c d`. */
2990
3042
  const formatRange = (sets) => sets.map((set) => set.map(formatComparator).join(" ")).join(" || ");
2991
3043
  //#endregion
2992
- //#region ../../node_modules/.pnpm/@effected+semver@0.1.0_effect@4.0.0-beta.98/node_modules/@effected/semver/internal/order.js
3044
+ //#region ../../node_modules/.pnpm/@effected+semver@0.2.0_effect@4.0.0-beta.99/node_modules/@effected/semver/internal/order.js
2993
3045
  /**
2994
3046
  * Compare two prerelease identifiers per SemVer 2.0.0 §11: numeric
2995
3047
  * identifiers always have lower precedence than alphanumeric ones; numerics
@@ -3042,7 +3094,7 @@ const compareBuild = (a, b) => {
3042
3094
  return 0;
3043
3095
  };
3044
3096
  //#endregion
3045
- //#region ../../node_modules/.pnpm/@effected+semver@0.1.0_effect@4.0.0-beta.98/node_modules/@effected/semver/SemVer.js
3097
+ //#region ../../node_modules/.pnpm/@effected+semver@0.2.0_effect@4.0.0-beta.99/node_modules/@effected/semver/SemVer.js
3046
3098
  /**
3047
3099
  * Indicates that a string could not be parsed as a valid SemVer 2.0.0 version.
3048
3100
  *
@@ -3123,23 +3175,57 @@ var SemVer = class SemVer extends effect.Schema.Class("SemVer")({
3123
3175
  encode: (parts) => effect.Effect.succeed(formatVersion(parts))
3124
3176
  })));
3125
3177
  /**
3126
- * Parse a strict SemVer 2.0.0 version string.
3178
+ * Parse a strict SemVer 2.0.0 version string, synchronously, returning a
3179
+ * `Result` instead of an `Effect`.
3127
3180
  *
3128
3181
  * Rejects `v`/`V` prefixes, `=` prefixes, leading zeros on numeric
3129
3182
  * identifiers and partially consumed input.
3130
3183
  *
3184
+ * @remarks
3185
+ * {@link SemVer.parse} is defined in terms of this function; the two never
3186
+ * diverge. Reach for the `Effect` variant inside Effect code — it carries
3187
+ * the `SemVer.parse` tracing span — and for this one at synchronous
3188
+ * boundaries.
3189
+ *
3190
+ * @example
3191
+ * ```ts
3192
+ * import { SemVer } from "@effected/semver";
3193
+ * import { Result } from "effect";
3194
+ *
3195
+ * const ok = SemVer.parseResult("1.2.3");
3196
+ * if (Result.isSuccess(ok)) {
3197
+ * console.log(ok.success.major); // => 1
3198
+ * }
3199
+ *
3200
+ * const bad = SemVer.parseResult("v1.2.3");
3201
+ * if (Result.isFailure(bad)) {
3202
+ * console.log(bad.failure._tag); // => "InvalidVersionError"
3203
+ * }
3204
+ * ```
3205
+ *
3131
3206
  * @param input - the version string to parse
3132
- * @returns the parsed {@link SemVer}. Fails with {@link InvalidVersionError}
3133
- * when `input` is not a valid version string.
3207
+ * @returns a `Result` succeeding with the parsed {@link SemVer}, or failing
3208
+ * with {@link InvalidVersionError} when `input` is not a valid version
3209
+ * string.
3134
3210
  */
3135
- static parse = effect.Effect.fn("SemVer.parse")(function* (input) {
3211
+ static parseResult(input) {
3136
3212
  const result = parseVersion(input);
3137
- if (!result.ok) return yield* new InvalidVersionError({
3213
+ if (!result.ok) return effect.Result.fail(new InvalidVersionError({
3138
3214
  input: result.input,
3139
3215
  position: result.position
3140
- });
3141
- return SemVer.make(result.value);
3142
- });
3216
+ }));
3217
+ return effect.Result.succeed(SemVer.make(result.value));
3218
+ }
3219
+ /**
3220
+ * Parse a strict SemVer 2.0.0 version string. Defined in terms of
3221
+ * {@link SemVer.parseResult} — synchronous callers can use that variant
3222
+ * directly.
3223
+ *
3224
+ * @param input - the version string to parse
3225
+ * @returns the parsed {@link SemVer}. Fails with {@link InvalidVersionError}
3226
+ * when `input` is not a valid version string.
3227
+ */
3228
+ static parse = effect.Effect.fn("SemVer.parse")((input) => effect.Effect.fromResult(SemVer.parseResult(input)));
3143
3229
  /**
3144
3230
  * Positional convenience constructor: `SemVer.of(1, 2, 3)`.
3145
3231
  *
@@ -3443,7 +3529,7 @@ var SemVerBump = class {
3443
3529
  }
3444
3530
  };
3445
3531
  //#endregion
3446
- //#region ../../node_modules/.pnpm/@effected+semver@0.1.0_effect@4.0.0-beta.98/node_modules/@effected/semver/Comparator.js
3532
+ //#region ../../node_modules/.pnpm/@effected+semver@0.2.0_effect@4.0.0-beta.99/node_modules/@effected/semver/Comparator.js
3447
3533
  /**
3448
3534
  * Indicates that a string could not be parsed as a single comparator.
3449
3535
  *
@@ -3510,18 +3596,52 @@ var Comparator = class Comparator extends effect.Schema.Class("Comparator")({
3510
3596
  },
3511
3597
  encode: (parts) => effect.Effect.succeed(formatComparator(parts))
3512
3598
  })));
3513
- /** Parse a comparator string (e.g. `">=1.2.3"`). */
3514
- static parse = effect.Effect.fn("Comparator.parse")(function* (input) {
3599
+ /**
3600
+ * Parse a comparator string (e.g. `">=1.2.3"`), synchronously, returning a
3601
+ * `Result` instead of an `Effect`.
3602
+ *
3603
+ * @remarks
3604
+ * {@link Comparator.parse} is defined in terms of this function; the two
3605
+ * never diverge. Reach for the `Effect` variant inside Effect code — it
3606
+ * carries the `Comparator.parse` tracing span — and for this one at
3607
+ * synchronous boundaries.
3608
+ *
3609
+ * @example
3610
+ * ```ts
3611
+ * import { Comparator } from "@effected/semver";
3612
+ * import { Result } from "effect";
3613
+ *
3614
+ * const ok = Comparator.parseResult(">=1.2.3");
3615
+ * if (Result.isSuccess(ok)) {
3616
+ * console.log(ok.success.operator); // => ">="
3617
+ * }
3618
+ * ```
3619
+ *
3620
+ * @param input - the comparator string to parse
3621
+ * @returns a `Result` succeeding with the parsed {@link Comparator}, or
3622
+ * failing with {@link InvalidComparatorError}.
3623
+ */
3624
+ static parseResult(input) {
3515
3625
  const result = parseComparator(input);
3516
- if (!result.ok) return yield* new InvalidComparatorError({
3626
+ if (!result.ok) return effect.Result.fail(new InvalidComparatorError({
3517
3627
  input: result.input,
3518
3628
  position: result.position
3519
- });
3520
- return Comparator.make({
3629
+ }));
3630
+ return effect.Result.succeed(Comparator.make({
3521
3631
  operator: result.value.operator,
3522
3632
  version: SemVer.make(result.value.version)
3523
- });
3524
- });
3633
+ }));
3634
+ }
3635
+ /**
3636
+ * Parse a comparator string (e.g. `">=1.2.3"`). Defined in terms of
3637
+ * {@link Comparator.parseResult} — synchronous callers can use that variant
3638
+ * directly.
3639
+ *
3640
+ * @param input - the comparator string to parse
3641
+ * @returns the parsed {@link Comparator}. Fails with
3642
+ * {@link InvalidComparatorError}.
3643
+ */
3644
+ static parse = effect.Effect.fn("Comparator.parse")((input) => effect.Effect.fromResult(Comparator.parseResult(input)));
3525
3645
  /** Test whether a version satisfies this comparator. */
3526
3646
  test(version) {
3527
3647
  const cmp = version.compare(this.version);
@@ -3543,7 +3663,7 @@ var Comparator = class Comparator extends effect.Schema.Class("Comparator")({
3543
3663
  }
3544
3664
  };
3545
3665
  //#endregion
3546
- //#region ../../node_modules/.pnpm/@effected+semver@0.1.0_effect@4.0.0-beta.98/node_modules/@effected/semver/internal/normalize.js
3666
+ //#region ../../node_modules/.pnpm/@effected+semver@0.2.0_effect@4.0.0-beta.99/node_modules/@effected/semver/internal/normalize.js
3547
3667
  const operatorWeight = (op) => {
3548
3668
  switch (op) {
3549
3669
  case ">=": return 0;
@@ -3574,7 +3694,7 @@ const normalizeComparatorSet = (set) => sortComparators(removeDuplicates(set));
3574
3694
  /** Normalize every comparator set in a range: sort and deduplicate each independently. */
3575
3695
  const normalizeSets = (sets) => sets.map(normalizeComparatorSet);
3576
3696
  //#endregion
3577
- //#region ../../node_modules/.pnpm/@effected+semver@0.1.0_effect@4.0.0-beta.98/node_modules/@effected/semver/Range.js
3697
+ //#region ../../node_modules/.pnpm/@effected+semver@0.2.0_effect@4.0.0-beta.99/node_modules/@effected/semver/Range.js
3578
3698
  /**
3579
3699
  * Indicates that a string could not be parsed as a range expression.
3580
3700
  *
@@ -3634,18 +3754,51 @@ sets: effect.Schema.Array(effect.Schema.Array(Comparator)) }) {
3634
3754
  },
3635
3755
  encode: (parts) => effect.Effect.succeed(formatRange(parts.sets))
3636
3756
  })));
3637
- /** Parse a range expression and normalize its comparator sets. */
3638
- static parse = effect.Effect.fn("Range.parse")(function* (input) {
3757
+ /**
3758
+ * Parse a range expression and normalize its comparator sets,
3759
+ * synchronously, returning a `Result` instead of an `Effect`.
3760
+ *
3761
+ * @remarks
3762
+ * {@link Range.parse} is defined in terms of this function; the two never
3763
+ * diverge. Reach for the `Effect` variant inside Effect code — it carries
3764
+ * the `Range.parse` tracing span — and for this one at synchronous
3765
+ * boundaries.
3766
+ *
3767
+ * @example
3768
+ * ```ts
3769
+ * import { Range } from "@effected/semver";
3770
+ * import { Result } from "effect";
3771
+ *
3772
+ * const ok = Range.parseResult("^1.0.0");
3773
+ * if (Result.isSuccess(ok)) {
3774
+ * console.log(ok.success.toString()); // => ">=1.0.0 <2.0.0-0"
3775
+ * }
3776
+ * ```
3777
+ *
3778
+ * @param input - the range expression to parse
3779
+ * @returns a `Result` succeeding with the parsed {@link Range}, or failing
3780
+ * with {@link InvalidRangeError}.
3781
+ */
3782
+ static parseResult(input) {
3639
3783
  const result = parseRange$1(input);
3640
- if (!result.ok) return yield* new InvalidRangeError({
3784
+ if (!result.ok) return effect.Result.fail(new InvalidRangeError({
3641
3785
  input: result.input,
3642
3786
  position: result.position
3643
- });
3644
- return Range.make({ sets: normalizeSets(result.value).map((set) => set.map((c) => Comparator.make({
3787
+ }));
3788
+ return effect.Result.succeed(Range.make({ sets: normalizeSets(result.value).map((set) => set.map((c) => Comparator.make({
3645
3789
  operator: c.operator,
3646
3790
  version: SemVer.make(c.version)
3647
- }))) });
3648
- });
3791
+ }))) }));
3792
+ }
3793
+ /**
3794
+ * Parse a range expression and normalize its comparator sets. Defined in
3795
+ * terms of {@link Range.parseResult} — synchronous callers can use that
3796
+ * variant directly.
3797
+ *
3798
+ * @param input - the range expression to parse
3799
+ * @returns the parsed {@link Range}. Fails with {@link InvalidRangeError}.
3800
+ */
3801
+ static parse = effect.Effect.fn("Range.parse")((input) => effect.Effect.fromResult(Range.parseResult(input)));
3649
3802
  /**
3650
3803
  * Test whether a version satisfies a range; see {@link Range.test} for the
3651
3804
  * prerelease matching rule. Dual API.
@@ -3672,19 +3825,49 @@ sets: effect.Schema.Array(effect.Schema.Array(Comparator)) }) {
3672
3825
  static union = effect.Function.dual(2, (self, that) => Range.make({ sets: [...self.sets, ...that.sets] }));
3673
3826
  /**
3674
3827
  * Intersect two ranges via a cross-product of their comparator sets,
3675
- * keeping only satisfiable combinations. Fails with
3828
+ * keeping only satisfiable combinations, synchronously, returning a
3829
+ * `Result` instead of an `Effect`. Fails with
3676
3830
  * {@link UnsatisfiableConstraintError} when no satisfiable set remains —
3677
3831
  * an honest typed failure instead of an unsatisfiable range. Dual API.
3832
+ *
3833
+ * @remarks
3834
+ * {@link Range.intersect} is defined in terms of this function; the two
3835
+ * never diverge. Reach for the `Effect` variant inside Effect code — it
3836
+ * carries the `Range.intersect` tracing span — and for this one at
3837
+ * synchronous boundaries.
3838
+ *
3839
+ * @example
3840
+ * ```ts
3841
+ * import { Range } from "@effected/semver";
3842
+ * import { Result } from "effect";
3843
+ *
3844
+ * const a = Result.getOrThrow(Range.parseResult("^1.0.0"));
3845
+ * const b = Result.getOrThrow(Range.parseResult(">=1.5.0"));
3846
+ * const merged = Range.intersectResult(a, b);
3847
+ * if (Result.isSuccess(merged)) {
3848
+ * console.log(merged.success.toString()); // => ">=1.0.0 <2.0.0-0 >=1.5.0"
3849
+ * }
3850
+ * ```
3678
3851
  */
3679
- static intersect = effect.Function.dual(2, effect.Effect.fn("Range.intersect")(function* (self, that) {
3852
+ static intersectResult = effect.Function.dual(2, (self, that) => {
3680
3853
  const candidates = [];
3681
3854
  for (const setA of self.sets) for (const setB of that.sets) {
3682
3855
  const merged = [...setA, ...setB];
3683
3856
  if (isSetSatisfiable(merged)) candidates.push(merged);
3684
3857
  }
3685
- if (candidates.length === 0) return yield* new UnsatisfiableConstraintError({ constraints: [self, that] });
3686
- return Range.make({ sets: candidates });
3687
- }));
3858
+ if (candidates.length === 0) return effect.Result.fail(new UnsatisfiableConstraintError({ constraints: [self, that] }));
3859
+ return effect.Result.succeed(Range.make({ sets: candidates }));
3860
+ });
3861
+ /**
3862
+ * Intersect two ranges via a cross-product of their comparator sets,
3863
+ * keeping only satisfiable combinations. Fails with
3864
+ * {@link UnsatisfiableConstraintError} when no satisfiable set remains —
3865
+ * an honest typed failure instead of an unsatisfiable range. Dual API.
3866
+ *
3867
+ * Defined in terms of {@link Range.intersectResult} — synchronous callers
3868
+ * can use that variant directly.
3869
+ */
3870
+ static intersect = effect.Function.dual(2, effect.Effect.fn("Range.intersect")((self, that) => effect.Effect.fromResult(Range.intersectResult(self, that))));
3688
3871
  /**
3689
3872
  * Check whether every version matched by `sub` is also matched by `sup`.
3690
3873
  * Dual API.
@@ -3843,7 +4026,7 @@ const isComparatorSetSubset = (sub, sup) => {
3843
4026
  return true;
3844
4027
  };
3845
4028
  //#endregion
3846
- //#region ../../node_modules/.pnpm/@effected+npm@0.2.0_@effected+semver@0.1.0_effect@4.0.0-beta.98__effect@4.0.0-beta.98/node_modules/@effected/npm/DependencySpecifier.js
4029
+ //#region ../../node_modules/.pnpm/@effected+npm@0.2.3_@effected+semver@0.2.0_effect@4.0.0-beta.99__effect@4.0.0-beta.99/node_modules/@effected/npm/DependencySpecifier.js
3847
4030
  /**
3848
4031
  * Indicates that a string could not be parsed as a valid dependency specifier.
3849
4032
  *
@@ -4050,7 +4233,7 @@ const DependencySpecifier = Object.assign(brandedSpecifier, {
4050
4233
  FromString: fromString
4051
4234
  });
4052
4235
  //#endregion
4053
- //#region ../../node_modules/.pnpm/@effected+npm@0.2.0_@effected+semver@0.1.0_effect@4.0.0-beta.98__effect@4.0.0-beta.98/node_modules/@effected/npm/IntegrityHash.js
4236
+ //#region ../../node_modules/.pnpm/@effected+npm@0.2.3_@effected+semver@0.2.0_effect@4.0.0-beta.99__effect@4.0.0-beta.99/node_modules/@effected/npm/IntegrityHash.js
4054
4237
  const SRI_RE = /^(sha1|sha256|sha384|sha512)-[A-Za-z0-9+/]+={0,2}$/;
4055
4238
  const COREPACK_RE = /^(sha1|sha256|sha384|sha512)\.[0-9a-f]+$/;
4056
4239
  const YARN_RE = /^[0-9]+(c[0-9]+)?\/[0-9a-f]+$/;
@@ -4103,7 +4286,7 @@ const IntegrityHash = Object.assign(brandedIntegrity, {
4103
4286
  decode: decode$2
4104
4287
  });
4105
4288
  //#endregion
4106
- //#region ../../node_modules/.pnpm/@effected+lockfiles@0.1.4_@effected+jsonc@0.3.0_effect@4.0.0-beta.98__@effected+npm@0.2_7fc50d596abf9879356de67fd92b0252/node_modules/@effected/lockfiles/ImporterDependency.js
4289
+ //#region ../../node_modules/.pnpm/@effected+lockfiles@0.1.8_@effected+jsonc@0.5.0_effect@4.0.0-beta.99__@effected+npm@0.2_d9e647ebf030778b1166690cbf4c6aa9/node_modules/@effected/lockfiles/ImporterDependency.js
4107
4290
  /**
4108
4291
  * One declared dependency of one workspace importer, as the lockfile records it.
4109
4292
  *
@@ -4131,7 +4314,7 @@ var ImporterDependency = class extends effect.Schema.Class("ImporterDependency")
4131
4314
  depType: DependencyField
4132
4315
  }) {};
4133
4316
  //#endregion
4134
- //#region ../../node_modules/.pnpm/@effected+lockfiles@0.1.4_@effected+jsonc@0.3.0_effect@4.0.0-beta.98__@effected+npm@0.2_7fc50d596abf9879356de67fd92b0252/node_modules/@effected/lockfiles/LockfileImporter.js
4317
+ //#region ../../node_modules/.pnpm/@effected+lockfiles@0.1.8_@effected+jsonc@0.5.0_effect@4.0.0-beta.99__@effected+npm@0.2_d9e647ebf030778b1166690cbf4c6aa9/node_modules/@effected/lockfiles/LockfileImporter.js
4135
4318
  /**
4136
4319
  * One workspace importer's declared dependencies, as the lockfile records them.
4137
4320
  *
@@ -4155,7 +4338,7 @@ var LockfileImporter = class extends effect.Schema.Class("LockfileImporter")({
4155
4338
  dependencies: effect.Schema.Array(ImporterDependency)
4156
4339
  }) {};
4157
4340
  //#endregion
4158
- //#region ../../node_modules/.pnpm/@effected+lockfiles@0.1.4_@effected+jsonc@0.3.0_effect@4.0.0-beta.98__@effected+npm@0.2_7fc50d596abf9879356de67fd92b0252/node_modules/@effected/lockfiles/ResolvedPackage.js
4341
+ //#region ../../node_modules/.pnpm/@effected+lockfiles@0.1.8_@effected+jsonc@0.5.0_effect@4.0.0-beta.99__@effected+npm@0.2_d9e647ebf030778b1166690cbf4c6aa9/node_modules/@effected/lockfiles/ResolvedPackage.js
4159
4342
  const EMPTY_DEPENDENCIES = {};
4160
4343
  /**
4161
4344
  * A package resolved from a lockfile.
@@ -4190,7 +4373,7 @@ var ResolvedPackage = class extends effect.Schema.Class("ResolvedPackage")({
4190
4373
  dependencies: effect.Schema.Record(effect.Schema.String, effect.Schema.String).pipe(effect.Schema.withDecodingDefaultKey(effect.Effect.succeed(EMPTY_DEPENDENCIES)), effect.Schema.withConstructorDefault(effect.Effect.succeed(EMPTY_DEPENDENCIES)))
4191
4374
  }) {};
4192
4375
  //#endregion
4193
- //#region ../../node_modules/.pnpm/@effected+lockfiles@0.1.4_@effected+jsonc@0.3.0_effect@4.0.0-beta.98__@effected+npm@0.2_7fc50d596abf9879356de67fd92b0252/node_modules/@effected/lockfiles/WorkspaceDependency.js
4376
+ //#region ../../node_modules/.pnpm/@effected+lockfiles@0.1.8_@effected+jsonc@0.5.0_effect@4.0.0-beta.99__@effected+npm@0.2_d9e647ebf030778b1166690cbf4c6aa9/node_modules/@effected/lockfiles/WorkspaceDependency.js
4194
4377
  /**
4195
4378
  * A directed dependency edge between two workspace packages as recorded in
4196
4379
  * the lockfile.
@@ -4212,7 +4395,7 @@ var WorkspaceDependency = class extends effect.Schema.Class("WorkspaceDependency
4212
4395
  constraint: effect.Schema.String
4213
4396
  }) {};
4214
4397
  //#endregion
4215
- //#region ../../node_modules/.pnpm/@effected+lockfiles@0.1.4_@effected+jsonc@0.3.0_effect@4.0.0-beta.98__@effected+npm@0.2_7fc50d596abf9879356de67fd92b0252/node_modules/@effected/lockfiles/PnpmExtension.js
4398
+ //#region ../../node_modules/.pnpm/@effected+lockfiles@0.1.8_@effected+jsonc@0.5.0_effect@4.0.0-beta.99__@effected+npm@0.2_d9e647ebf030778b1166690cbf4c6aa9/node_modules/@effected/lockfiles/PnpmExtension.js
4216
4399
  /**
4217
4400
  * Extension data specific to pnpm lockfiles, attached to `Lockfile.extension`
4218
4401
  * when the format is `"pnpm"`.
@@ -4237,7 +4420,7 @@ var PnpmExtension = class extends effect.Schema.Class("PnpmExtension")({
4237
4420
  }))
4238
4421
  }) {};
4239
4422
  //#endregion
4240
- //#region ../../node_modules/.pnpm/@effected+lockfiles@0.1.4_@effected+jsonc@0.3.0_effect@4.0.0-beta.98__@effected+npm@0.2_7fc50d596abf9879356de67fd92b0252/node_modules/@effected/lockfiles/LockfileFormat.js
4423
+ //#region ../../node_modules/.pnpm/@effected+lockfiles@0.1.8_@effected+jsonc@0.5.0_effect@4.0.0-beta.99__@effected+npm@0.2_d9e647ebf030778b1166690cbf4c6aa9/node_modules/@effected/lockfiles/LockfileFormat.js
4241
4424
  /**
4242
4425
  * The lockfile formats this package parses: bun's `bun.lock` (JSONC), npm's
4243
4426
  * `package-lock.json` (v2/v3 JSON), pnpm's `pnpm-lock.yaml` and yarn Berry's
@@ -4271,7 +4454,7 @@ const FILENAMES = {
4271
4454
  */
4272
4455
  const filenameFor = (format) => FILENAMES[format];
4273
4456
  //#endregion
4274
- //#region ../../node_modules/.pnpm/@effected+lockfiles@0.1.4_@effected+jsonc@0.3.0_effect@4.0.0-beta.98__@effected+npm@0.2_7fc50d596abf9879356de67fd92b0252/node_modules/@effected/lockfiles/internal/shared.js
4457
+ //#region ../../node_modules/.pnpm/@effected+lockfiles@0.1.8_@effected+jsonc@0.5.0_effect@4.0.0-beta.99__@effected+npm@0.2_d9e647ebf030778b1166690cbf4c6aa9/node_modules/@effected/lockfiles/internal/shared.js
4275
4458
  /**
4276
4459
  * The four dependency sections of a manifest, in a stable order — the shared
4277
4460
  * dependency-sections table (v3's `DEP_SECTIONS`). Each entry is both the
@@ -4397,7 +4580,7 @@ const extractWorkspaceDeps = (workspaces, workspaceNames) => {
4397
4580
  return deps;
4398
4581
  };
4399
4582
  //#endregion
4400
- //#region ../../node_modules/.pnpm/@effected+jsonc@0.3.0_effect@4.0.0-beta.98/node_modules/@effected/jsonc/JsoncNode.js
4583
+ //#region ../../node_modules/.pnpm/@effected+jsonc@0.5.0_effect@4.0.0-beta.99/node_modules/@effected/jsonc/JsoncNode.js
4401
4584
  /**
4402
4585
  * Discriminator values for JSONC AST node types: the JSON value types
4403
4586
  * (`string`/`number`/`boolean`/`null`), the structural types
@@ -4572,7 +4755,7 @@ function evaluateNode(node, depth) {
4572
4755
  }
4573
4756
  }
4574
4757
  //#endregion
4575
- //#region ../../node_modules/.pnpm/@effected+jsonc@0.3.0_effect@4.0.0-beta.98/node_modules/@effected/jsonc/internal/scanner.js
4758
+ //#region ../../node_modules/.pnpm/@effected+jsonc@0.5.0_effect@4.0.0-beta.99/node_modules/@effected/jsonc/internal/scanner.js
4576
4759
  const isWhitespace = (ch) => ch === 32 || ch === 9 || ch === 11 || ch === 12 || ch === 160 || ch === 65279;
4577
4760
  const isLineBreak$1 = (ch) => ch === 10 || ch === 13 || ch === 8232 || ch === 8233;
4578
4761
  const isDigit$1 = (ch) => ch >= 48 && ch <= 57;
@@ -4868,7 +5051,7 @@ const createScanner$2 = (text, ignoreTrivia = false) => {
4868
5051
  };
4869
5052
  };
4870
5053
  //#endregion
4871
- //#region ../../node_modules/.pnpm/@effected+jsonc@0.3.0_effect@4.0.0-beta.98/node_modules/@effected/jsonc/internal/skip.js
5054
+ //#region ../../node_modules/.pnpm/@effected+jsonc@0.5.0_effect@4.0.0-beta.99/node_modules/@effected/jsonc/internal/skip.js
4872
5055
  /**
4873
5056
  * Iteratively consume the value beginning at the cursor's current token and
4874
5057
  * return its tight end offset (excludes trailing whitespace/comments).
@@ -4898,7 +5081,7 @@ const skipBalancedValue = (cursor) => {
4898
5081
  return end;
4899
5082
  };
4900
5083
  //#endregion
4901
- //#region ../../node_modules/.pnpm/@effected+jsonc@0.3.0_effect@4.0.0-beta.98/node_modules/@effected/jsonc/internal/parser.js
5084
+ //#region ../../node_modules/.pnpm/@effected+jsonc@0.5.0_effect@4.0.0-beta.99/node_modules/@effected/jsonc/internal/parser.js
4902
5085
  /**
4903
5086
  * The public parse-error code vocabulary. The facade builds its `@public`
4904
5087
  * `JsoncParseErrorCode` schema from this array; the parser produces these codes
@@ -5311,7 +5494,7 @@ const parseTree$2 = (text, flags) => {
5311
5494
  };
5312
5495
  };
5313
5496
  //#endregion
5314
- //#region ../../node_modules/.pnpm/@effected+jsonc@0.3.0_effect@4.0.0-beta.98/node_modules/@effected/jsonc/Jsonc.js
5497
+ //#region ../../node_modules/.pnpm/@effected+jsonc@0.5.0_effect@4.0.0-beta.99/node_modules/@effected/jsonc/Jsonc.js
5315
5498
  /**
5316
5499
  * The single public parse-error code vocabulary, appearing as the `code` field
5317
5500
  * of {@link JsoncParseErrorDetail}.
@@ -5356,6 +5539,47 @@ effect.Schema.Class("JsoncParseOptions")({
5356
5539
  allowTrailingComma: effect.Schema.optionalKey(effect.Schema.Boolean),
5357
5540
  allowEmptyContent: effect.Schema.optionalKey(effect.Schema.Boolean)
5358
5541
  });
5542
+ /**
5543
+ * The public stringify-error code vocabulary, appearing as the `code` field of
5544
+ * {@link JsoncStringifyError}:
5545
+ *
5546
+ * - `CircularReference` — the value contains a reference cycle, so no finite
5547
+ * JSON text exists for it.
5548
+ * - `BigIntValue` — the value contains a `bigint` (anywhere, top-level or
5549
+ * nested), which JSON cannot represent.
5550
+ * - `TopLevelUnrepresentable` — the top-level value (`undefined`, a function
5551
+ * or a symbol) serializes to no output at all.
5552
+ *
5553
+ * @public
5554
+ */
5555
+ const JsoncStringifyErrorCode = effect.Schema.Literals([
5556
+ "CircularReference",
5557
+ "BigIntValue",
5558
+ "TopLevelUnrepresentable"
5559
+ ]);
5560
+ effect.Schema.Class("JsoncStringifyOptions")({
5561
+ tabSize: effect.Schema.optionalKey(effect.Schema.Number),
5562
+ insertSpaces: effect.Schema.optionalKey(effect.Schema.Boolean)
5563
+ });
5564
+ /**
5565
+ * Stringification failure: a `JsoncStringifyErrorCode` naming the
5566
+ * failure mode, a human-readable `detail` (the engine's message for thrown
5567
+ * cases — on V8 the circular-reference message includes the offending property
5568
+ * path), and the offending `value`. Raised by {@link Jsonc.stringify},
5569
+ * {@link Jsonc.stringifyResult} and the encode direction of the schema
5570
+ * factories.
5571
+ *
5572
+ * @public
5573
+ */
5574
+ var JsoncStringifyError = class extends effect.Schema.TaggedErrorClass()("JsoncStringifyError", {
5575
+ code: JsoncStringifyErrorCode,
5576
+ detail: effect.Schema.String,
5577
+ value: effect.Schema.Unknown
5578
+ }) {
5579
+ get message() {
5580
+ return `JSONC stringify failed: ${this.code} — ${this.detail}`;
5581
+ }
5582
+ };
5359
5583
  const toFlags = (options) => options === void 0 ? {} : {
5360
5584
  disallowComments: options.disallowComments,
5361
5585
  allowTrailingComma: options.allowTrailingComma,
@@ -5495,9 +5719,57 @@ var Jsonc = class Jsonc {
5495
5719
  */
5496
5720
  static parse = effect.Effect.fn("Jsonc.parse")((text, options) => effect.Effect.fromResult(Jsonc.parseResult(text, options)));
5497
5721
  /**
5722
+ * Parse JSONC into an immutable {@link JsoncNode} AST, synchronously,
5723
+ * returning a `Result` instead of an `Effect`. `Option.none()` for empty
5724
+ * input (with `allowEmptyContent`); the aggregate {@link JsoncParseError}
5725
+ * for malformed input. Pure — parsing is fundamentally synchronous, so
5726
+ * non-Effect consumers (a plain config loader, a build script) can call
5727
+ * this directly instead of wrapping
5728
+ * `Effect.runSync(Effect.result(Jsonc.parseTree(text)))`.
5729
+ *
5730
+ * @remarks
5731
+ * {@link Jsonc.parseTree} is defined in terms of this function; the two
5732
+ * never diverge. Reach for the `Effect` variant inside Effect code — it
5733
+ * carries the `Jsonc.parseTree` tracing span — and for this one at
5734
+ * synchronous boundaries.
5735
+ *
5736
+ * @example
5737
+ * ```ts
5738
+ * import { Jsonc } from "@effected/jsonc";
5739
+ * import { Option, Result } from "effect";
5740
+ *
5741
+ * const ok = Jsonc.parseTreeResult('{ "port": 3000 // dev\n }');
5742
+ * if (Result.isSuccess(ok) && Option.isSome(ok.success)) {
5743
+ * console.log(ok.success.value.type); // => "object"
5744
+ * }
5745
+ *
5746
+ * const bad = Jsonc.parseTreeResult("{ bad }");
5747
+ * if (Result.isFailure(bad)) {
5748
+ * console.log(bad.failure._tag); // => "JsoncParseError"
5749
+ * }
5750
+ * ```
5751
+ *
5752
+ * @param text - The JSONC source to parse.
5753
+ * @param options - Optional {@link JsoncParseOptions}; defaults apply for
5754
+ * omitted fields.
5755
+ * @returns A `Result` succeeding with `Option.some(root)` (or
5756
+ * `Option.none()` for empty input), or failing with the aggregate
5757
+ * {@link JsoncParseError}.
5758
+ */
5759
+ static parseTreeResult(text, options) {
5760
+ const { root, errors } = parseTree$2(text, toFlags(options));
5761
+ if (errors.length > 0) return effect.Result.fail(new JsoncParseError({
5762
+ errors: toDetails(text, errors),
5763
+ input: text
5764
+ }));
5765
+ return effect.Result.succeed(root !== void 0 ? effect.Option.some(root) : effect.Option.none());
5766
+ }
5767
+ /**
5498
5768
  * Parse JSONC into an immutable {@link JsoncNode} AST. `Option.none()` for
5499
5769
  * empty input (with `allowEmptyContent`); the aggregate
5500
- * {@link JsoncParseError} for malformed input.
5770
+ * {@link JsoncParseError} for malformed input. Defined in terms of
5771
+ * {@link Jsonc.parseTreeResult} — synchronous callers can use that variant
5772
+ * directly.
5501
5773
  *
5502
5774
  * @param text - The JSONC source to parse.
5503
5775
  * @param options - Optional {@link JsoncParseOptions}; defaults apply for
@@ -5506,14 +5778,96 @@ var Jsonc = class Jsonc {
5506
5778
  * `Option.none()` for empty input), or fails with the aggregate
5507
5779
  * {@link JsoncParseError}.
5508
5780
  */
5509
- static parseTree = effect.Effect.fn("Jsonc.parseTree")(function* (text, options) {
5510
- const { root, errors } = parseTree$2(text, toFlags(options));
5511
- if (errors.length > 0) return yield* new JsoncParseError({
5512
- errors: toDetails(text, errors),
5513
- input: text
5514
- });
5515
- return root !== void 0 ? effect.Option.some(root) : effect.Option.none();
5516
- });
5781
+ static parseTree = effect.Effect.fn("Jsonc.parseTree")((text, options) => effect.Effect.fromResult(Jsonc.parseTreeResult(text, options)));
5782
+ /**
5783
+ * Stringify a plain JavaScript value as JSON text, synchronously, returning
5784
+ * a `Result` instead of an `Effect`. With no options the output is
5785
+ * byte-identical to `JSON.stringify(value, null, 2)`.
5786
+ *
5787
+ * Plain JSON emission: JSONC comments exist only in the document/edit layer
5788
+ * (`JsoncNode`, `JsoncEdit`, `JsoncFormatter`), so no comment survives — or
5789
+ * can be produced by — value-level stringification.
5790
+ *
5791
+ * Nested unrepresentable values follow `JSON.stringify`'s documented
5792
+ * semantics: `undefined`, functions and symbols are dropped from objects and
5793
+ * become `null` in arrays. The typed failure channel covers only the cases
5794
+ * where output would be absent or an exception thrown — see
5795
+ * `JsoncStringifyErrorCode`. A throwing `toJSON` method or getter is
5796
+ * caller code failing and rethrows as a defect, never a typed error.
5797
+ *
5798
+ * @remarks
5799
+ * {@link Jsonc.stringify} is defined in terms of this function; the two
5800
+ * never diverge. Reach for the `Effect` variant inside Effect code — it
5801
+ * carries the `Jsonc.stringify` tracing span — and for this one at
5802
+ * synchronous boundaries.
5803
+ *
5804
+ * @example
5805
+ * ```ts
5806
+ * import { Jsonc } from "@effected/jsonc";
5807
+ * import { Result } from "effect";
5808
+ *
5809
+ * const ok = Jsonc.stringifyResult({ port: 3000 });
5810
+ * if (Result.isSuccess(ok)) {
5811
+ * console.log(ok.success); // => '{\n "port": 3000\n}'
5812
+ * }
5813
+ *
5814
+ * const bad = Jsonc.stringifyResult(0n);
5815
+ * if (Result.isFailure(bad)) {
5816
+ * console.log(bad.failure.code); // => "BigIntValue"
5817
+ * }
5818
+ * ```
5819
+ *
5820
+ * @param value - The plain JavaScript value to stringify.
5821
+ * @param options - Optional {@link JsoncStringifyOptions}; defaults apply
5822
+ * for omitted fields.
5823
+ * @returns A `Result` succeeding with the JSON text, or failing with a
5824
+ * {@link JsoncStringifyError}.
5825
+ */
5826
+ static stringifyResult(value, options) {
5827
+ const space = options?.insertSpaces === false ? " " : options?.tabSize ?? 2;
5828
+ let text;
5829
+ try {
5830
+ text = JSON.stringify(value, null, space);
5831
+ } catch (defect) {
5832
+ if (defect instanceof TypeError) {
5833
+ if (/circular|cyclic/i.test(defect.message)) return effect.Result.fail(new JsoncStringifyError({
5834
+ code: "CircularReference",
5835
+ detail: defect.message,
5836
+ value
5837
+ }));
5838
+ if (/bigint/i.test(defect.message)) return effect.Result.fail(new JsoncStringifyError({
5839
+ code: "BigIntValue",
5840
+ detail: defect.message,
5841
+ value
5842
+ }));
5843
+ }
5844
+ throw defect;
5845
+ }
5846
+ if (text === void 0) return effect.Result.fail(new JsoncStringifyError({
5847
+ code: "TopLevelUnrepresentable",
5848
+ detail: "the top-level value (undefined, a function or a symbol) has no JSON representation",
5849
+ value
5850
+ }));
5851
+ return effect.Result.succeed(text);
5852
+ }
5853
+ /**
5854
+ * Stringify a plain JavaScript value as JSON text. With no options the
5855
+ * output is byte-identical to `JSON.stringify(value, null, 2)`. Fails with
5856
+ * {@link JsoncStringifyError} on circular references, `bigint` values and a
5857
+ * top-level value with no JSON representation; nested `undefined`, functions
5858
+ * and symbols follow `JSON.stringify`'s documented semantics (dropped from
5859
+ * objects, `null` in arrays). Comments are a document/edit-layer concern —
5860
+ * value-level stringification never emits them. Defined in terms of
5861
+ * {@link Jsonc.stringifyResult} — synchronous callers can use that variant
5862
+ * directly.
5863
+ *
5864
+ * @param value - The plain JavaScript value to stringify.
5865
+ * @param options - Optional {@link JsoncStringifyOptions}; defaults apply
5866
+ * for omitted fields.
5867
+ * @returns An `Effect` that succeeds with the JSON text, or fails with a
5868
+ * {@link JsoncStringifyError}.
5869
+ */
5870
+ static stringify = effect.Effect.fn("Jsonc.stringify")((value, options) => effect.Effect.fromResult(Jsonc.stringifyResult(value, options)));
5517
5871
  /**
5518
5872
  * Remove all comments from JSONC, producing valid JSON. Pass a `replaceCh`
5519
5873
  * (e.g. `" "`) to replace each comment character instead of deleting it,
@@ -5581,8 +5935,11 @@ var Jsonc = class Jsonc {
5581
5935
  }
5582
5936
  /**
5583
5937
  * A `Schema<unknown, string>` decoding JSONC with the given `options`
5584
- * (defaults when omitted). Encoding is `JSON.stringify` with 2-space indent,
5585
- * so comments do not survive a round-trip encode.
5938
+ * (defaults when omitted). Encoding is {@link Jsonc.stringifyResult} with
5939
+ * default options (2-space indent, byte-identical to
5940
+ * `JSON.stringify(value, null, 2)`), so comments do not survive a
5941
+ * round-trip encode; a {@link JsoncStringifyError} on the encode side
5942
+ * surfaces as a schema issue.
5586
5943
  *
5587
5944
  * @remarks
5588
5945
  * Schema-producing: each call returns a fresh schema whose derivation caches
@@ -5609,7 +5966,7 @@ var Jsonc = class Jsonc {
5609
5966
  }
5610
5967
  return effect.Effect.succeed(value);
5611
5968
  },
5612
- encode: (value) => effect.Effect.succeed(JSON.stringify(value, null, 2))
5969
+ encode: (value) => effect.Effect.fromResult(Jsonc.stringifyResult(value)).pipe(effect.Effect.mapError((error) => new effect.SchemaIssue.InvalidValue(effect.Option.some(value), { message: error.message })))
5613
5970
  })));
5614
5971
  }
5615
5972
  /**
@@ -5635,6 +5992,49 @@ var Jsonc = class Jsonc {
5635
5992
  static schema(target, options) {
5636
5993
  return Jsonc.fromString(options).pipe(effect.Schema.decodeTo(target));
5637
5994
  }
5995
+ /**
5996
+ * Bind a target schema to the JSONC codec once, yielding the composed
5997
+ * schema plus pre-derived `decode`/`encode` directions — the
5998
+ * {@link Jsonc.schema} composition without the generic `Schema` machinery
5999
+ * at every use site. Binds the plain form only: default
6000
+ * {@link JsoncParseOptions} on decode, default stringify options on encode.
6001
+ *
6002
+ * Both directions fail with `Schema.SchemaError`, exactly as
6003
+ * `Schema.decodeEffect`/`Schema.encodeEffect` over {@link Jsonc.schema}
6004
+ * would; the target's decoding/encoding service requirements flow through.
6005
+ *
6006
+ * @remarks
6007
+ * Schema-producing: each call composes a fresh schema and derives both
6008
+ * directions from it. Bind the result to a `const` — that single binding is
6009
+ * the point.
6010
+ *
6011
+ * @example
6012
+ * ```ts
6013
+ * import { Jsonc } from "@effected/jsonc";
6014
+ * import { Effect, Schema } from "effect";
6015
+ *
6016
+ * const Config = Schema.Struct({ port: Schema.Number });
6017
+ * const config = Jsonc.bind(Config);
6018
+ *
6019
+ * const program = Effect.gen(function* () {
6020
+ * const value = yield* config.decode('{ "port": 3000 // dev\n }');
6021
+ * const text = yield* config.encode(value);
6022
+ * return [value, text] as const;
6023
+ * });
6024
+ * ```
6025
+ *
6026
+ * @param target - The domain schema decoded values must satisfy.
6027
+ * @returns A {@link JsoncBoundCodec} carrying the composed schema and its
6028
+ * two pre-bound directions.
6029
+ */
6030
+ static bind(target) {
6031
+ const schema = Jsonc.schema(target);
6032
+ return {
6033
+ schema,
6034
+ decode: effect.Schema.decodeEffect(schema),
6035
+ encode: effect.Schema.encodeEffect(schema)
6036
+ };
6037
+ }
5638
6038
  };
5639
6039
  effect.Schema.Class("JsoncRange")({
5640
6040
  offset: effect.Schema.Number,
@@ -5678,7 +6078,8 @@ var JsoncEdit = class extends effect.Schema.Class("JsoncEdit")({
5678
6078
  /**
5679
6079
  * Apply `edits` to `text`, producing a new string. Edits are applied in
5680
6080
  * reverse-offset order so earlier offsets stay valid; the input `edits`
5681
- * array is not mutated. Pure and total.
6081
+ * array is not mutated. Overlapping edits are a programmer error and throw
6082
+ * as a defect — `JsoncFormatter` never produces them.
5682
6083
  *
5683
6084
  * @param text - The source text to edit.
5684
6085
  * @param edits - The edits to apply, in any order.
@@ -5686,13 +6087,18 @@ var JsoncEdit = class extends effect.Schema.Class("JsoncEdit")({
5686
6087
  */
5687
6088
  static applyAll(text, edits) {
5688
6089
  const sorted = [...edits].sort((a, b) => b.offset - a.offset);
6090
+ for (let i = 0; i + 1 < sorted.length; i++) {
6091
+ const upper = sorted[i];
6092
+ const lower = sorted[i + 1];
6093
+ if (lower.offset + lower.length > upper.offset) throw new Error(`JsoncEdit.applyAll received overlapping edits at offsets ${lower.offset} and ${upper.offset} — overlapping edits are a programmer error`);
6094
+ }
5689
6095
  let result = text;
5690
6096
  for (const edit of sorted) result = result.substring(0, edit.offset) + edit.content + result.substring(edit.offset + edit.length);
5691
6097
  return result;
5692
6098
  }
5693
6099
  };
5694
6100
  //#endregion
5695
- //#region ../../node_modules/.pnpm/@effected+jsonc@0.3.0_effect@4.0.0-beta.98/node_modules/@effected/jsonc/internal/navigate.js
6101
+ //#region ../../node_modules/.pnpm/@effected+jsonc@0.5.0_effect@4.0.0-beta.99/node_modules/@effected/jsonc/internal/navigate.js
5696
6102
  /**
5697
6103
  * Resolve `path` against `text`, returning where the target is (or where it
5698
6104
  * would be inserted). `path` must be non-empty — the whole-document case is
@@ -5819,7 +6225,7 @@ function navigate(text, path) {
5819
6225
  return { _tag: "NoOp" };
5820
6226
  }
5821
6227
  //#endregion
5822
- //#region ../../node_modules/.pnpm/@effected+jsonc@0.3.0_effect@4.0.0-beta.98/node_modules/@effected/jsonc/JsoncModifier.js
6228
+ //#region ../../node_modules/.pnpm/@effected+jsonc@0.5.0_effect@4.0.0-beta.99/node_modules/@effected/jsonc/JsoncModifier.js
5823
6229
  /**
5824
6230
  * Raised when `JsoncModifier.modify` cannot navigate the requested path: the
5825
6231
  * value at `depth` is not the container kind (`expected`) the next path segment
@@ -5947,7 +6353,7 @@ var JsoncModifier = class {
5947
6353
  });
5948
6354
  };
5949
6355
  //#endregion
5950
- //#region ../../node_modules/.pnpm/@effected+lockfiles@0.1.4_@effected+jsonc@0.3.0_effect@4.0.0-beta.98__@effected+npm@0.2_7fc50d596abf9879356de67fd92b0252/node_modules/@effected/lockfiles/internal/bun.js
6356
+ //#region ../../node_modules/.pnpm/@effected+lockfiles@0.1.8_@effected+jsonc@0.5.0_effect@4.0.0-beta.99__@effected+npm@0.2_d9e647ebf030778b1166690cbf4c6aa9/node_modules/@effected/lockfiles/internal/bun.js
5951
6357
  const DepRecord$2 = effect.Schema.optionalKey(effect.Schema.Record(effect.Schema.String, effect.Schema.String));
5952
6358
  const BunWorkspaceEntry = effect.Schema.Struct({
5953
6359
  name: effect.Schema.optionalKey(effect.Schema.String),
@@ -6040,7 +6446,7 @@ const toFields$3 = (raw) => effect.Effect.gen(function* () {
6040
6446
  };
6041
6447
  });
6042
6448
  //#endregion
6043
- //#region ../../node_modules/.pnpm/@effected+lockfiles@0.1.4_@effected+jsonc@0.3.0_effect@4.0.0-beta.98__@effected+npm@0.2_7fc50d596abf9879356de67fd92b0252/node_modules/@effected/lockfiles/internal/npm.js
6449
+ //#region ../../node_modules/.pnpm/@effected+lockfiles@0.1.8_@effected+jsonc@0.5.0_effect@4.0.0-beta.99__@effected+npm@0.2_d9e647ebf030778b1166690cbf4c6aa9/node_modules/@effected/lockfiles/internal/npm.js
6044
6450
  const DepRecord$1 = effect.Schema.optionalKey(effect.Schema.Record(effect.Schema.String, effect.Schema.String));
6045
6451
  const NpmPackageEntry = effect.Schema.Struct({
6046
6452
  name: effect.Schema.optionalKey(effect.Schema.String),
@@ -6138,7 +6544,7 @@ const toFields$2 = (raw) => effect.Effect.gen(function* () {
6138
6544
  };
6139
6545
  });
6140
6546
  //#endregion
6141
- //#region ../../node_modules/.pnpm/@effected+yaml@0.3.1_effect@4.0.0-beta.98/node_modules/@effected/yaml/YamlNode.js
6547
+ //#region ../../node_modules/.pnpm/@effected+yaml@0.5.0_effect@4.0.0-beta.99/node_modules/@effected/yaml/YamlNode.js
6142
6548
  /**
6143
6549
  * YAML scalar presentation styles.
6144
6550
  *
@@ -6158,6 +6564,16 @@ const ScalarStyle = effect.Schema.Literals([
6158
6564
  */
6159
6565
  const CollectionStyle = effect.Schema.Literals(["block", "flow"]);
6160
6566
  /**
6567
+ * Quote characters available to the stringifier's plain-scalar fallback: the
6568
+ * style a `plain`-styled scalar is rendered in when it turns out to require
6569
+ * quoting. Referenced by the `quoteStyle` field of `YamlStringifyOptions`;
6570
+ * unlike `ScalarStyle` it is a stringify-option vocabulary, never a property
6571
+ * of a composed node.
6572
+ *
6573
+ * @public
6574
+ */
6575
+ const QuoteStyle = effect.Schema.Literals(["single", "double"]);
6576
+ /**
6161
6577
  * Block-scalar chomping indicators (`-` strip, default clip, `+` keep).
6162
6578
  * Referenced by the {@link YamlScalar} `chomp` field schema.
6163
6579
  *
@@ -6530,7 +6946,7 @@ function nodeToValue(node, anchors, budget, counting = false) {
6530
6946
  return null;
6531
6947
  }
6532
6948
  //#endregion
6533
- //#region ../../node_modules/.pnpm/@effected+yaml@0.3.1_effect@4.0.0-beta.98/node_modules/@effected/yaml/internal/diagnostics.js
6949
+ //#region ../../node_modules/.pnpm/@effected+yaml@0.5.0_effect@4.0.0-beta.99/node_modules/@effected/yaml/internal/diagnostics.js
6534
6950
  /** Error codes emitted by the lexer stage. */
6535
6951
  const YAML_LEX_ERROR_CODES = [
6536
6952
  "UnexpectedCharacter",
@@ -6608,7 +7024,7 @@ function isFatalCode(code) {
6608
7024
  return FATAL_CODES.has(code);
6609
7025
  }
6610
7026
  //#endregion
6611
- //#region ../../node_modules/.pnpm/@effected+yaml@0.3.1_effect@4.0.0-beta.98/node_modules/@effected/yaml/YamlDiagnostic.js
7027
+ //#region ../../node_modules/.pnpm/@effected+yaml@0.5.0_effect@4.0.0-beta.99/node_modules/@effected/yaml/YamlDiagnostic.js
6612
7028
  /**
6613
7029
  * Error codes emitted by the lexer stage.
6614
7030
  *
@@ -6729,7 +7145,7 @@ function lineChar(text, offset) {
6729
7145
  };
6730
7146
  }
6731
7147
  //#endregion
6732
- //#region ../../node_modules/.pnpm/@effected+yaml@0.3.1_effect@4.0.0-beta.98/node_modules/@effected/yaml/internal/composer/anchors.js
7148
+ //#region ../../node_modules/.pnpm/@effected+yaml@0.5.0_effect@4.0.0-beta.99/node_modules/@effected/yaml/internal/composer/anchors.js
6733
7149
  /**
6734
7150
  * Check if a pending anchor is being applied to an alias node (invalid in YAML 1.2 §3.2.2).
6735
7151
  * Aliases represent references to existing anchored nodes and cannot have their own anchors.
@@ -6822,7 +7238,7 @@ function collectAnchors(node, anchors) {
6822
7238
  }
6823
7239
  }
6824
7240
  //#endregion
6825
- //#region ../../node_modules/.pnpm/@effected+yaml@0.3.1_effect@4.0.0-beta.98/node_modules/@effected/yaml/internal/lexer.js
7241
+ //#region ../../node_modules/.pnpm/@effected+yaml@0.5.0_effect@4.0.0-beta.99/node_modules/@effected/yaml/internal/lexer.js
6826
7242
  /**
6827
7243
  * Create a new YAML scanner for the given source text.
6828
7244
  *
@@ -7779,7 +8195,7 @@ function lexAll(text) {
7779
8195
  return tokens;
7780
8196
  }
7781
8197
  //#endregion
7782
- //#region ../../node_modules/.pnpm/@effected+yaml@0.3.1_effect@4.0.0-beta.98/node_modules/@effected/yaml/internal/cst-parser.js
8198
+ //#region ../../node_modules/.pnpm/@effected+yaml@0.5.0_effect@4.0.0-beta.99/node_modules/@effected/yaml/internal/cst-parser.js
7783
8199
  /**
7784
8200
  * Hardening: cap CST nesting so hostile inputs cannot overflow the stack
7785
8201
  * while the tree is being BUILT. Set slightly above the composer's
@@ -8491,7 +8907,7 @@ function parseCSTAll(text) {
8491
8907
  return parseDocuments(lexAll(text), text);
8492
8908
  }
8493
8909
  //#endregion
8494
- //#region ../../node_modules/.pnpm/@effected+yaml@0.3.1_effect@4.0.0-beta.98/node_modules/@effected/yaml/internal/composer/state.js
8910
+ //#region ../../node_modules/.pnpm/@effected+yaml@0.5.0_effect@4.0.0-beta.99/node_modules/@effected/yaml/internal/composer/state.js
8495
8911
  let lineStartsText;
8496
8912
  let lineStartsCache = [];
8497
8913
  function getLineStarts(text) {
@@ -8597,7 +9013,7 @@ function exitNesting(state) {
8597
9013
  state.depth--;
8598
9014
  }
8599
9015
  //#endregion
8600
- //#region ../../node_modules/.pnpm/@effected+yaml@0.3.1_effect@4.0.0-beta.98/node_modules/@effected/yaml/internal/composer/tags.js
9016
+ //#region ../../node_modules/.pnpm/@effected+yaml@0.5.0_effect@4.0.0-beta.99/node_modules/@effected/yaml/internal/composer/tags.js
8601
9017
  /**
8602
9018
  * Resolve a tag shorthand using the document's %TAG directives.
8603
9019
  * For example, with `%TAG !! tag:example.com,2000:app/`, the tag `!!int`
@@ -8683,7 +9099,7 @@ function validateTagHandlesInDocument(docCst, state) {
8683
9099
  }
8684
9100
  }
8685
9101
  //#endregion
8686
- //#region ../../node_modules/.pnpm/@effected+yaml@0.3.1_effect@4.0.0-beta.98/node_modules/@effected/yaml/internal/composer/scalars.js
9102
+ //#region ../../node_modules/.pnpm/@effected+yaml@0.5.0_effect@4.0.0-beta.99/node_modules/@effected/yaml/internal/composer/scalars.js
8687
9103
  const NULL_RE$1 = /^(?:null|Null|NULL|~)$/;
8688
9104
  const TRUE_RE$1 = /^(?:true|True|TRUE)$/;
8689
9105
  const FALSE_RE$1 = /^(?:false|False|FALSE)$/;
@@ -9561,7 +9977,7 @@ function shouldPreserveRaw(rawValue, value) {
9561
9977
  return false;
9562
9978
  }
9563
9979
  //#endregion
9564
- //#region ../../node_modules/.pnpm/@effected+yaml@0.3.1_effect@4.0.0-beta.98/node_modules/@effected/yaml/internal/composer/block.js
9980
+ //#region ../../node_modules/.pnpm/@effected+yaml@0.5.0_effect@4.0.0-beta.99/node_modules/@effected/yaml/internal/composer/block.js
9565
9981
  /**
9566
9982
  * Compose a block map from its CST children, with an optional external first key.
9567
9983
  *
@@ -10709,7 +11125,7 @@ function composeFlatBlockMap(children, startIdx, parentCst, state, externalFirst
10709
11125
  return map;
10710
11126
  }
10711
11127
  //#endregion
10712
- //#region ../../node_modules/.pnpm/@effected+yaml@0.3.1_effect@4.0.0-beta.98/node_modules/@effected/yaml/internal/composer/flow.js
11128
+ //#region ../../node_modules/.pnpm/@effected+yaml@0.5.0_effect@4.0.0-beta.99/node_modules/@effected/yaml/internal/composer/flow.js
10713
11129
  /**
10714
11130
  * Validate that flow collection entries are separated by commas.
10715
11131
  *
@@ -11101,7 +11517,7 @@ function composeFlowSeqInner(cst, state, meta, parentBlockColumn) {
11101
11517
  return seq;
11102
11518
  }
11103
11519
  //#endregion
11104
- //#region ../../node_modules/.pnpm/@effected+yaml@0.3.1_effect@4.0.0-beta.98/node_modules/@effected/yaml/internal/composer/document.js
11520
+ //#region ../../node_modules/.pnpm/@effected+yaml@0.5.0_effect@4.0.0-beta.99/node_modules/@effected/yaml/internal/composer/document.js
11105
11521
  /** The flow-composer dispatch wired into every state this module creates. */
11106
11522
  const FLOW = {
11107
11523
  composeFlowMap,
@@ -11767,7 +12183,7 @@ function composeAllDocuments(text, options) {
11767
12183
  };
11768
12184
  }
11769
12185
  //#endregion
11770
- //#region ../../node_modules/.pnpm/@effected+yaml@0.3.1_effect@4.0.0-beta.98/node_modules/@effected/yaml/internal/fold.js
12186
+ //#region ../../node_modules/.pnpm/@effected+yaml@0.5.0_effect@4.0.0-beta.99/node_modules/@effected/yaml/internal/fold.js
11771
12187
  /**
11772
12188
  * Column-based line folding for a single logical scalar line (YAML 1.2 flow
11773
12189
  * folding, §7.3 / §8.2.1). Breaks the content at "safe" single-space
@@ -12003,7 +12419,7 @@ function renderBlockFolded(s, indent) {
12003
12419
  return `>${indentIndicator}${chomp}\n${outputLines.join("\n")}`;
12004
12420
  }
12005
12421
  //#endregion
12006
- //#region ../../node_modules/.pnpm/@effected+yaml@0.3.1_effect@4.0.0-beta.98/node_modules/@effected/yaml/internal/stringifier.js
12422
+ //#region ../../node_modules/.pnpm/@effected+yaml@0.5.0_effect@4.0.0-beta.99/node_modules/@effected/yaml/internal/stringifier.js
12007
12423
  /**
12008
12424
  * Thrown by the stringifier on its failure paths (circular references). The
12009
12425
  * facade catches this and materializes the public stringify error.
@@ -12109,7 +12525,10 @@ function requiresQuoting(s, ignoreType = false) {
12109
12525
  if (s.includes(" #") || s.includes(" #")) return true;
12110
12526
  const last = s[s.length - 1];
12111
12527
  if (last === " " || last === " ") return true;
12112
- for (let i = 0; i < s.length; i++) if (isControlChar(s.charCodeAt(i))) return true;
12528
+ for (let i = 0; i < s.length; i++) {
12529
+ const code = s.charCodeAt(i);
12530
+ if (code === 9 || code === 13 || isControlChar(code)) return true;
12531
+ }
12113
12532
  return false;
12114
12533
  }
12115
12534
  /**
@@ -12166,11 +12585,13 @@ function renderSingleQuoted(s) {
12166
12585
  *
12167
12586
  * Multi-line strings are routed to block styles regardless of the requested
12168
12587
  * style (except double-quoted). For single-line strings, plain style delegates
12169
- * to {@link requiresQuoting} and falls back to double-quoted when the value
12170
- * would be ambiguous. Block literal and block folded styles are always
12171
- * accepted for single-line strings even though the output is unusual.
12588
+ * to {@link requiresQuoting} and falls back to `quoteStyle` (single-quoted by
12589
+ * default, double-quoted when the caller asked for it) or to double-quoted
12590
+ * regardless when the value needs YAML escapes single quotes cannot express.
12591
+ * Block literal and block folded styles are always accepted for single-line
12592
+ * strings even though the output is unusual.
12172
12593
  */
12173
- function renderString(s, style, indent, ignoreType = false, canonical = false, explicitChomp, parentPosition) {
12594
+ function renderString(s, style, indent, ignoreType = false, canonical = false, explicitChomp, parentPosition, quoteStyle = "single") {
12174
12595
  if (s.includes("\n")) {
12175
12596
  let hasControl = false;
12176
12597
  for (let i = 0; i < s.length; i++) {
@@ -12204,7 +12625,7 @@ function renderString(s, style, indent, ignoreType = false, canonical = false, e
12204
12625
  if (requiresQuoting(s, ignoreType)) {
12205
12626
  if (s.includes(" ") || s.includes("\r")) return renderDoubleQuoted(s, canonical);
12206
12627
  for (let i = 0; i < s.length; i++) if (isControlChar(s.charCodeAt(i))) return renderDoubleQuoted(s, canonical);
12207
- return renderSingleQuoted(s);
12628
+ return quoteStyle === "double" ? renderDoubleQuoted(s, canonical) : renderSingleQuoted(s);
12208
12629
  }
12209
12630
  return s;
12210
12631
  case "single-quoted": return renderSingleQuoted(s);
@@ -12244,6 +12665,7 @@ function createContext(options) {
12244
12665
  defaultCollectionStyle: options?.defaultCollectionStyle ?? "block",
12245
12666
  sortKeys: options?.sortKeys ?? false,
12246
12667
  indentSequences: options?.indentSequences ?? false,
12668
+ quoteStyle: options?.quoteStyle ?? "single",
12247
12669
  forceDefaultStyles: options?.forceDefaultStyles ?? false,
12248
12670
  seen: /* @__PURE__ */ new Set()
12249
12671
  };
@@ -12263,7 +12685,7 @@ function stringifyLines(value, ctx, depth, allowFold = true) {
12263
12685
  if (typeof value === "bigint") return [value.toString()];
12264
12686
  if (typeof value === "string") {
12265
12687
  const indentStr = " ".repeat(ctx.indent);
12266
- const rendered = renderString(value, ctx.defaultScalarStyle, indentStr, false, ctx.forceDefaultStyles);
12688
+ const rendered = renderString(value, ctx.defaultScalarStyle, indentStr, false, ctx.forceDefaultStyles, void 0, void 0, ctx.quoteStyle);
12267
12689
  return (allowFold && ctx.lineWidth > 0 ? foldRenderedScalar(rendered, indentStr, ctx.lineWidth) : rendered).split("\n");
12268
12690
  }
12269
12691
  if (Array.isArray(value)) {
@@ -12328,10 +12750,11 @@ function stringifyObjectLines(obj, ctx, depth) {
12328
12750
  const keys = Object.keys(obj);
12329
12751
  if (keys.length === 0) return ["{}"];
12330
12752
  if (ctx.sortKeys) keys.sort();
12753
+ const renderPlainKey = (k) => renderString(k, "plain", "", false, false, void 0, void 0, ctx.quoteStyle);
12331
12754
  if (ctx.defaultCollectionStyle === "flow") return [`{${keys.map((k) => {
12332
- return `${renderString(k, "plain", "")}: ${stringifyLines(obj[k], ctx, depth + 1, false).join(" ")}`;
12755
+ return `${renderPlainKey(k)}: ${stringifyLines(obj[k], ctx, depth + 1, false).join(" ")}`;
12333
12756
  }).join(", ")}}`];
12334
- const renderKey = (k) => k.includes("\n") ? renderDoubleQuoted(k, ctx.forceDefaultStyles) : renderString(k, "plain", "");
12757
+ const renderKey = (k) => k.includes("\n") ? renderDoubleQuoted(k, ctx.forceDefaultStyles) : renderPlainKey(k);
12335
12758
  const pad = " ".repeat(ctx.indent);
12336
12759
  const lines = [];
12337
12760
  for (const k of keys) {
@@ -12379,7 +12802,7 @@ effect.Schema.Class("YamlStringifyOptions")({
12379
12802
  * (`>`) scalars at approximately that column, never block-literal (`|`).
12380
12803
  *
12381
12804
  * Takes effect only through {@link Yaml.stringify} and
12382
- * {@link Yaml.stringifySync} — the two entry points that accept these
12805
+ * {@link Yaml.stringifyResult} — the two entry points that accept these
12383
12806
  * options on the value path. The schema factories ({@link Yaml.fromString},
12384
12807
  * {@link Yaml.schema}, {@link Yaml.YamlFromString}) encode with default
12385
12808
  * stringify options (`lineWidth` `0`), so their output never folds. The
@@ -12392,6 +12815,17 @@ effect.Schema.Class("YamlStringifyOptions")({
12392
12815
  defaultCollectionStyle: effect.Schema.optionalKey(CollectionStyle),
12393
12816
  sortKeys: effect.Schema.optionalKey(effect.Schema.Boolean),
12394
12817
  indentSequences: effect.Schema.optionalKey(effect.Schema.Boolean),
12818
+ /**
12819
+ * Quote style used when a `plain`-styled scalar requires quoting. Default
12820
+ * `"single"` — the released byte-compatible behavior. `"double"` renders
12821
+ * the same scalars double-quoted instead, matching the `yaml` npm
12822
+ * package's `singleQuote: false` output.
12823
+ *
12824
+ * Affects only the plain fallback: scalars that need no quoting stay
12825
+ * plain, and an explicit `defaultScalarStyle` of `"single-quoted"` or
12826
+ * `"double-quoted"` is unaffected.
12827
+ */
12828
+ quoteStyle: effect.Schema.optionalKey(QuoteStyle),
12395
12829
  finalNewline: effect.Schema.optionalKey(effect.Schema.Boolean),
12396
12830
  forceDefaultStyles: effect.Schema.optionalKey(effect.Schema.Boolean)
12397
12831
  });
@@ -12441,6 +12875,7 @@ const toStringifyInput = (options) => options === void 0 ? {} : {
12441
12875
  defaultCollectionStyle: options.defaultCollectionStyle,
12442
12876
  sortKeys: options.sortKeys,
12443
12877
  indentSequences: options.indentSequences,
12878
+ quoteStyle: options.quoteStyle,
12444
12879
  finalNewline: options.finalNewline,
12445
12880
  forceDefaultStyles: options.forceDefaultStyles
12446
12881
  };
@@ -12498,7 +12933,7 @@ const stringifyDefectToError = (defect, value) => {
12498
12933
  * mode (fatal diagnostics, duplicate keys, a "billion laughs" blow-up) yields
12499
12934
  * a `Failure` carrying a typed {@link YamlParseError} — never a throw.
12500
12935
  */
12501
- const parseSyncImpl = (text, options) => {
12936
+ const parseResultImpl = (text, options) => {
12502
12937
  const doc = composeFirstDocument(text, toParseInput(options));
12503
12938
  const failures = failureRecords(doc, options?.uniqueKeys ?? true);
12504
12939
  if (failures.length > 0) return effect.Result.fail(new YamlParseError({
@@ -12519,7 +12954,7 @@ const parseSyncImpl = (text, options) => {
12519
12954
  * recursion budget yields a `Failure` carrying a typed {@link YamlStringifyError},
12520
12955
  * never a thrown defect.
12521
12956
  */
12522
- const stringifySyncImpl = (value, options) => {
12957
+ const stringifyResultImpl = (value, options) => {
12523
12958
  try {
12524
12959
  return effect.Result.succeed(stringifyValue(value, toStringifyInput(options)));
12525
12960
  } catch (defect) {
@@ -12596,17 +13031,11 @@ var Yaml = class Yaml {
12596
13031
  * resolved size grows exponentially relative to `maxAliasCount`) also
12597
13032
  * fails through {@link YamlParseError} with an `AliasCountExceeded`
12598
13033
  * diagnostic, never as an unhandled defect.
13034
+ *
13035
+ * Defined in terms of {@link Yaml.parseResult} — synchronous callers can
13036
+ * use that variant directly.
12599
13037
  */
12600
- static parse = effect.Effect.fn("Yaml.parse")(function* (text, options) {
12601
- const doc = composeFirstDocument(text, toParseInput(options));
12602
- const failures = failureRecords(doc, options?.uniqueKeys ?? true);
12603
- if (failures.length > 0) return yield* new YamlParseError({
12604
- diagnostics: toDiagnostics(text, failures),
12605
- input: text
12606
- });
12607
- const anchors = /* @__PURE__ */ new Map();
12608
- return yield* extractDocumentValue(doc.contents, anchors, options?.maxAliasCount ?? 100, text);
12609
- });
13038
+ static parse = effect.Effect.fn("Yaml.parse")((text, options) => effect.Effect.fromResult(Yaml.parseResult(text, options)));
12610
13039
  /**
12611
13040
  * Parse a multi-document YAML stream into an array of plain JavaScript
12612
13041
  * values (one per document, in order). Any fatal diagnostic in any
@@ -12639,6 +13068,15 @@ var Yaml = class Yaml {
12639
13068
  * or on a value nested deeper than the stringifier's recursion budget
12640
13069
  * (`NestingDepthExceeded`) — both surface through the typed error channel
12641
13070
  * rather than as an unhandled stack-overflow defect.
13071
+ *
13072
+ * @remarks
13073
+ * A `"<<"` object key is emitted **quoted** (`'<<': …`). This is the
13074
+ * opposite of the document path ({@link YamlFormat.format} and
13075
+ * `YamlDocument#stringify`), which leaves a parsed plain `<<` key unquoted
13076
+ * so it keeps its merge-key meaning, and the asymmetry is deliberate: a
13077
+ * `"<<"` key on a plain JavaScript object is an ordinary string key that
13078
+ * never carried merge semantics, so emitting it plain would silently turn
13079
+ * ordinary data into a merge directive.
12642
13080
  */
12643
13081
  static stringify = effect.Effect.fn("Yaml.stringify")(function* (value, options) {
12644
13082
  return yield* stringifyOrFail(value, options);
@@ -12646,8 +13084,14 @@ var Yaml = class Yaml {
12646
13084
  /**
12647
13085
  * Synchronous single-document parse, returning a `Result` instead of
12648
13086
  * an `Effect`. A pure escape hatch for config-time callers that cannot
12649
- * `await` an Effect (a `vitest.config.ts` is the motivating case): it runs
12650
- * the same engine as {@link Yaml.parse} inline.
13087
+ * `await` an Effect (a `vitest.config.ts` is the motivating case).
13088
+ *
13089
+ * @remarks
13090
+ * This is the package's single parse path. {@link Yaml.parse} is defined in
13091
+ * terms of it (`Effect.fromResult` behind the named span), so the two
13092
+ * variants cannot diverge. Reach for the `Effect` variant inside Effect
13093
+ * code — it carries the `Yaml.parse` tracing span — and for this one at
13094
+ * synchronous boundaries.
12651
13095
  *
12652
13096
  * Preserves the package contract — malformed and adversarial input fails
12653
13097
  * typed, never as a defect. Fatal diagnostics, duplicate keys and a
@@ -12659,7 +13103,7 @@ var Yaml = class Yaml {
12659
13103
  * import { Yaml } from "@effected/yaml";
12660
13104
  * import { Result } from "effect";
12661
13105
  *
12662
- * const result = Yaml.parseSync("name: Alice\nage: 30");
13106
+ * const result = Yaml.parseResult("name: Alice\nage: 30");
12663
13107
  * if (Result.isSuccess(result)) {
12664
13108
  * result.success; // { name: "Alice", age: 30 }
12665
13109
  * } else {
@@ -12669,8 +13113,8 @@ var Yaml = class Yaml {
12669
13113
  *
12670
13114
  * @public
12671
13115
  */
12672
- static parseSync(text, options) {
12673
- return parseSyncImpl(text, options);
13116
+ static parseResult(text, options) {
13117
+ return parseResultImpl(text, options);
12674
13118
  }
12675
13119
  /**
12676
13120
  * Synchronous stringify, returning a `Result` instead of an `Effect`.
@@ -12687,7 +13131,7 @@ var Yaml = class Yaml {
12687
13131
  * import { Yaml } from "@effected/yaml";
12688
13132
  * import { Result } from "effect";
12689
13133
  *
12690
- * const result = Yaml.stringifySync({ name: "Alice" });
13134
+ * const result = Yaml.stringifyResult({ name: "Alice" });
12691
13135
  * if (Result.isFailure(result)) {
12692
13136
  * result.failure; // YamlStringifyError
12693
13137
  * } else {
@@ -12697,8 +13141,8 @@ var Yaml = class Yaml {
12697
13141
  *
12698
13142
  * @public
12699
13143
  */
12700
- static stringifySync(value, options) {
12701
- return stringifySyncImpl(value, options);
13144
+ static stringifyResult(value, options) {
13145
+ return stringifyResultImpl(value, options);
12702
13146
  }
12703
13147
  /**
12704
13148
  * Strip comments from YAML text. Without `replaceCh`, comment characters
@@ -12827,6 +13271,51 @@ var Yaml = class Yaml {
12827
13271
  static schema(target, options) {
12828
13272
  return Yaml.fromString(options).pipe(effect.Schema.decodeTo(target));
12829
13273
  }
13274
+ /**
13275
+ * Bind a target schema to the YAML codec once, yielding the composed
13276
+ * schema plus pre-derived `decode`/`encode` directions — the
13277
+ * {@link Yaml.schema} composition without the generic `Schema` machinery
13278
+ * at every use site. Binds the plain single-document form only: default
13279
+ * {@link YamlParseOptions} on decode, default stringify options on encode;
13280
+ * for multi-document streams compose over {@link Yaml.allFromString}
13281
+ * directly.
13282
+ *
13283
+ * Both directions fail with `Schema.SchemaError`, exactly as
13284
+ * `Schema.decodeEffect`/`Schema.encodeEffect` over {@link Yaml.schema}
13285
+ * would; the target's decoding/encoding service requirements flow through.
13286
+ *
13287
+ * @remarks
13288
+ * Schema-producing: each call composes a fresh schema and derives both
13289
+ * directions from it. Bind the result to a `const` — that single binding is
13290
+ * the point.
13291
+ *
13292
+ * @example
13293
+ * ```ts
13294
+ * import { Yaml } from "@effected/yaml";
13295
+ * import { Effect, Schema } from "effect";
13296
+ *
13297
+ * const Config = Schema.Struct({ port: Schema.Number });
13298
+ * const config = Yaml.bind(Config);
13299
+ *
13300
+ * const program = Effect.gen(function* () {
13301
+ * const value = yield* config.decode("port: 3000");
13302
+ * const text = yield* config.encode(value);
13303
+ * return [value, text] as const;
13304
+ * });
13305
+ * ```
13306
+ *
13307
+ * @param target - The domain schema decoded values must satisfy.
13308
+ * @returns A {@link YamlBoundCodec} carrying the composed schema and its
13309
+ * two pre-bound directions.
13310
+ */
13311
+ static bind(target) {
13312
+ const schema = Yaml.schema(target);
13313
+ return {
13314
+ schema,
13315
+ decode: effect.Schema.decodeEffect(schema),
13316
+ encode: effect.Schema.encodeEffect(schema)
13317
+ };
13318
+ }
12830
13319
  };
12831
13320
  /**
12832
13321
  * Parse for `equals`/`equalsValue`: any recorded error — fatal or not — or a
@@ -12879,7 +13368,7 @@ function deepEqualValues(a, b) {
12879
13368
  return false;
12880
13369
  }
12881
13370
  //#endregion
12882
- //#region ../../node_modules/.pnpm/@effected+lockfiles@0.1.4_@effected+jsonc@0.3.0_effect@4.0.0-beta.98__@effected+npm@0.2_7fc50d596abf9879356de67fd92b0252/node_modules/@effected/lockfiles/internal/documents.js
13371
+ //#region ../../node_modules/.pnpm/@effected+lockfiles@0.1.8_@effected+jsonc@0.5.0_effect@4.0.0-beta.99__@effected+npm@0.2_d9e647ebf030778b1166690cbf4c6aa9/node_modules/@effected/lockfiles/internal/documents.js
12883
13372
  /**
12884
13373
  * An empty YAML document composes to `null` (`Yaml.parseAll("")` is `[null]`,
12885
13374
  * and the trailing document of an env-only `pnpm-lock.yaml` is `null` too).
@@ -12949,7 +13438,7 @@ const selectSoleDocument = (content) => effect.Effect.gen(function* () {
12949
13438
  };
12950
13439
  });
12951
13440
  //#endregion
12952
- //#region ../../node_modules/.pnpm/@effected+lockfiles@0.1.4_@effected+jsonc@0.3.0_effect@4.0.0-beta.98__@effected+npm@0.2_7fc50d596abf9879356de67fd92b0252/node_modules/@effected/lockfiles/internal/pnpm.js
13441
+ //#region ../../node_modules/.pnpm/@effected+lockfiles@0.1.8_@effected+jsonc@0.5.0_effect@4.0.0-beta.99__@effected+npm@0.2_d9e647ebf030778b1166690cbf4c6aa9/node_modules/@effected/lockfiles/internal/pnpm.js
12953
13442
  const PnpmImporterDeps = effect.Schema.optionalKey(effect.Schema.Record(effect.Schema.String, effect.Schema.Struct({
12954
13443
  specifier: effect.Schema.String,
12955
13444
  version: effect.Schema.String
@@ -13075,7 +13564,7 @@ const toFields$1 = (raw) => effect.Effect.gen(function* () {
13075
13564
  };
13076
13565
  });
13077
13566
  //#endregion
13078
- //#region ../../node_modules/.pnpm/@effected+lockfiles@0.1.4_@effected+jsonc@0.3.0_effect@4.0.0-beta.98__@effected+npm@0.2_7fc50d596abf9879356de67fd92b0252/node_modules/@effected/lockfiles/internal/yarn.js
13567
+ //#region ../../node_modules/.pnpm/@effected+lockfiles@0.1.8_@effected+jsonc@0.5.0_effect@4.0.0-beta.99__@effected+npm@0.2_d9e647ebf030778b1166690cbf4c6aa9/node_modules/@effected/lockfiles/internal/yarn.js
13079
13568
  const YarnLockfileRaw = effect.Schema.Record(effect.Schema.String, effect.Schema.Unknown);
13080
13569
  const DepRecord = effect.Schema.optionalKey(effect.Schema.Record(effect.Schema.String, effect.Schema.String));
13081
13570
  const YarnEntry = effect.Schema.Struct({
@@ -13198,7 +13687,7 @@ const cleanYarnDeps = (deps) => {
13198
13687
  return Object.fromEntries(Object.entries(deps).map(([name, value]) => [name, value.startsWith("npm:") ? value.slice(4) : value]));
13199
13688
  };
13200
13689
  //#endregion
13201
- //#region ../../node_modules/.pnpm/@effected+lockfiles@0.1.4_@effected+jsonc@0.3.0_effect@4.0.0-beta.98__@effected+npm@0.2_7fc50d596abf9879356de67fd92b0252/node_modules/@effected/lockfiles/Lockfile.js
13690
+ //#region ../../node_modules/.pnpm/@effected+lockfiles@0.1.8_@effected+jsonc@0.5.0_effect@4.0.0-beta.99__@effected+npm@0.2_d9e647ebf030778b1166690cbf4c6aa9/node_modules/@effected/lockfiles/Lockfile.js
13202
13691
  const EMPTY_IMPORTERS = [];
13203
13692
  /**
13204
13693
  * Failure of `Lockfile.parse`: the given content is not a valid lockfile of
@@ -13442,7 +13931,7 @@ var Lockfile = class Lockfile extends effect.Schema.Class("Lockfile")({
13442
13931
  }
13443
13932
  };
13444
13933
  //#endregion
13445
- //#region ../../node_modules/.pnpm/@effected+lockfiles@0.1.4_@effected+jsonc@0.3.0_effect@4.0.0-beta.98__@effected+npm@0.2_7fc50d596abf9879356de67fd92b0252/node_modules/@effected/lockfiles/LockfileIntegrity.js
13934
+ //#region ../../node_modules/.pnpm/@effected+lockfiles@0.1.8_@effected+jsonc@0.5.0_effect@4.0.0-beta.99__@effected+npm@0.2_d9e647ebf030778b1166690cbf4c6aa9/node_modules/@effected/lockfiles/LockfileIntegrity.js
13446
13935
  /**
13447
13936
  * The minimal manifest shape {@link LockfileIntegrity.compare} checks a
13448
13937
  * lockfile against: a package name plus the four optional dependency maps.
@@ -13558,7 +14047,7 @@ var LockfileIntegrity = class LockfileIntegrity extends effect.Schema.Class("Loc
13558
14047
  }
13559
14048
  };
13560
14049
  //#endregion
13561
- //#region ../../node_modules/.pnpm/@effected+package-json@0.3.0_effect@4.0.0-beta.98/node_modules/@effected/package-json/Dependency.js
14050
+ //#region ../../node_modules/.pnpm/@effected+package-json@0.4.1_effect@4.0.0-beta.99/node_modules/@effected/package-json/Dependency.js
13562
14051
  /**
13563
14052
  * A resolved dependency entry pairing a package name with its version
13564
14053
  * specifier and the `kind` of map it came from (`@effected/npm`'s
@@ -13622,7 +14111,7 @@ var Dependency = class extends effect.Schema.Class("Dependency")({
13622
14111
  }
13623
14112
  };
13624
14113
  //#endregion
13625
- //#region ../../node_modules/.pnpm/@effected+package-json@0.3.0_effect@4.0.0-beta.98/node_modules/@effected/package-json/DevEngines.js
14114
+ //#region ../../node_modules/.pnpm/@effected+package-json@0.4.1_effect@4.0.0-beta.99/node_modules/@effected/package-json/DevEngines.js
13626
14115
  /**
13627
14116
  * A single `devEngines` constraint with a name and optional `version` / `onFail`.
13628
14117
  *
@@ -14647,7 +15136,7 @@ var require_parse$2 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
14647
15136
  };
14648
15137
  }));
14649
15138
  //#endregion
14650
- //#region ../../node_modules/.pnpm/@effected+package-json@0.3.0_effect@4.0.0-beta.98/node_modules/@effected/package-json/License.js
15139
+ //#region ../../node_modules/.pnpm/@effected+package-json@0.4.1_effect@4.0.0-beta.99/node_modules/@effected/package-json/License.js
14651
15140
  var import_spdx_expression_parse = /* @__PURE__ */ __toESM((/* @__PURE__ */ __commonJSMin(((exports, module) => {
14652
15141
  var scan = require_scan$1();
14653
15142
  var parse = require_parse$2();
@@ -14694,7 +15183,7 @@ const isValidSpdx = (value) => {
14694
15183
  */
14695
15184
  const SpdxLicense = effect.Schema.String.pipe(effect.Schema.check(effect.Schema.makeFilter((value) => isValidSpdx(value) ? void 0 : "Expected a valid SPDX license expression")), effect.Schema.brand("SpdxLicense"));
14696
15185
  //#endregion
14697
- //#region ../../node_modules/.pnpm/@effected+package-json@0.3.0_effect@4.0.0-beta.98/node_modules/@effected/package-json/PackageManager.js
15186
+ //#region ../../node_modules/.pnpm/@effected+package-json@0.4.1_effect@4.0.0-beta.99/node_modules/@effected/package-json/PackageManager.js
14698
15187
  const PACKAGE_MANAGER_RE = /^([a-z]+)@(\d+\.\d+\.\d+(?:-[a-zA-Z0-9._-]+)?)(?:\+(.+))?$/;
14699
15188
  /**
14700
15189
  * The `packageManager` field only ever carries corepack's `<algo>.<hex>`
@@ -14752,7 +15241,7 @@ var PackageManager = class PackageManager extends effect.Schema.Class("PackageMa
14752
15241
  }
14753
15242
  };
14754
15243
  //#endregion
14755
- //#region ../../node_modules/.pnpm/@effected+package-json@0.3.0_effect@4.0.0-beta.98/node_modules/@effected/package-json/PackageName.js
15244
+ //#region ../../node_modules/.pnpm/@effected+package-json@0.4.1_effect@4.0.0-beta.99/node_modules/@effected/package-json/PackageName.js
14756
15245
  /**
14757
15246
  * Indicates that a string could not be used as a valid npm package name.
14758
15247
  *
@@ -14810,7 +15299,7 @@ const PackageName = Object.assign(effect.Schema.Union([ScopedPackageName, Unscop
14810
15299
  isScoped
14811
15300
  });
14812
15301
  //#endregion
14813
- //#region ../../node_modules/.pnpm/@effected+package-json@0.3.0_effect@4.0.0-beta.98/node_modules/@effected/package-json/Person.js
15302
+ //#region ../../node_modules/.pnpm/@effected+package-json@0.4.1_effect@4.0.0-beta.99/node_modules/@effected/package-json/Person.js
14814
15303
  const parsePersonString = (input) => {
14815
15304
  const emailMatch = input.match(/<([^>]+)>/);
14816
15305
  const urlMatch = input.match(/\(([^)]+)\)/);
@@ -14824,8 +15313,56 @@ const parsePersonString = (input) => {
14824
15313
  ...urlMatch !== null ? { url: urlMatch[1] } : {}
14825
15314
  });
14826
15315
  };
15316
+ const serializePerson = (person) => {
15317
+ let result = person.name;
15318
+ if (person.email !== void 0) result += ` <${person.email}>`;
15319
+ if (person.url !== void 0) result += ` (${person.url})`;
15320
+ return result;
15321
+ };
15322
+ const wireForms = /* @__PURE__ */ new WeakMap();
15323
+ const rememberWire = (person, wire) => {
15324
+ wireForms.set(person, wire);
15325
+ return person;
15326
+ };
15327
+ const KNOWN_KEYS = /* @__PURE__ */ new Set([
15328
+ "name",
15329
+ "email",
15330
+ "url"
15331
+ ]);
15332
+ const sameRest = (a, b) => JSON.stringify(a ?? {}) === JSON.stringify(b ?? {});
15333
+ const isFaithful = (wire, person) => {
15334
+ if (typeof wire === "string") {
15335
+ const parsed = parsePersonString(wire);
15336
+ return parsed.name === person.name && parsed.email === person.email && parsed.url === person.url;
15337
+ }
15338
+ const rest = restOf(wire);
15339
+ return wire.name === person.name && wire.email === person.email && wire.url === person.url && sameRest(rest, person.rest);
15340
+ };
15341
+ const PersonFields = effect.Schema.Struct({
15342
+ name: effect.Schema.String,
15343
+ email: effect.Schema.optionalKey(effect.Schema.String),
15344
+ url: effect.Schema.optionalKey(effect.Schema.String)
15345
+ });
15346
+ const decodePersonFields = effect.Schema.decodeUnknownEffect(PersonFields);
15347
+ const restOf = (raw) => {
15348
+ const rest = {};
15349
+ for (const [key, value] of Object.entries(raw)) if (!KNOWN_KEYS.has(key)) rest[key] = value;
15350
+ return rest;
15351
+ };
15352
+ const encodePersonObject = (person) => {
15353
+ const wire = wireForms.get(person);
15354
+ if (wire !== void 0 && typeof wire !== "string" && isFaithful(wire, person)) return wire;
15355
+ const known = { name: person.name };
15356
+ if (person.email !== void 0) known.email = person.email;
15357
+ if (person.url !== void 0) known.url = person.url;
15358
+ return {
15359
+ ...person.rest ?? {},
15360
+ ...known
15361
+ };
15362
+ };
14827
15363
  /**
14828
- * A structured person object with `name` and optional `email` / `url`.
15364
+ * A structured person object with `name`, optional `email` / `url`, and a
15365
+ * `rest` catch-all preserving any additional keys across a read/write cycle.
14829
15366
  *
14830
15367
  * @public
14831
15368
  */
@@ -14835,29 +15372,77 @@ var Person = class Person extends effect.Schema.Class("Person")({
14835
15372
  /** The optional email address. */
14836
15373
  email: effect.Schema.optionalKey(effect.Schema.String),
14837
15374
  /** The optional homepage URL. */
14838
- url: effect.Schema.optionalKey(effect.Schema.String)
15375
+ url: effect.Schema.optionalKey(effect.Schema.String),
15376
+ /** Any additional keys, preserved verbatim and flattened back on encode. */
15377
+ rest: effect.Schema.optionalKey(effect.Schema.Record(effect.Schema.String, effect.Schema.Unknown))
14839
15378
  }) {
15379
+ /**
15380
+ * The object wire codec: an open JSON object ↔ a {@link Person}, partitioning
15381
+ * unknown keys into `rest` and flattening them back on encode so the on-disk
15382
+ * shape never carries a literal `rest` key.
15383
+ */
15384
+ static schema = effect.Schema.Record(effect.Schema.String, effect.Schema.Unknown).pipe(effect.Schema.decodeTo(effect.Schema.instanceOf(Person), effect.SchemaTransformation.transformOrFail({
15385
+ decode: (raw) => decodePersonFields(raw).pipe(effect.Effect.mapError((error) => error.issue), effect.Effect.map((fields) => {
15386
+ const rest = restOf(raw);
15387
+ return rememberWire(Person.make({
15388
+ ...fields,
15389
+ ...Object.keys(rest).length > 0 ? { rest } : {}
15390
+ }), raw);
15391
+ })),
15392
+ encode: (person) => effect.Effect.succeed(encodePersonObject(person))
15393
+ })));
14840
15394
  /**
14841
15395
  * Schema transformation between the `"Name <email> (url)"` shorthand string
14842
- * and a {@link Person}.
15396
+ * and a {@link Person}. Decoding remembers the input text so that encoding
15397
+ * reproduces it verbatim; see {@link Person.wireStringOf}.
14843
15398
  */
14844
15399
  static FromString = effect.Schema.String.pipe(effect.Schema.decodeTo(effect.Schema.instanceOf(Person), effect.SchemaTransformation.transform({
14845
- decode: (input) => parsePersonString(input),
15400
+ decode: (input) => rememberWire(parsePersonString(input), input),
14846
15401
  encode: (person) => {
14847
- let result = person.name;
14848
- if (person.email !== void 0) result += ` <${person.email}>`;
14849
- if (person.url !== void 0) result += ` (${person.url})`;
14850
- return result;
15402
+ const wire = wireForms.get(person);
15403
+ return typeof wire === "string" && isFaithful(wire, person) ? wire : serializePerson(person);
14851
15404
  }
14852
15405
  })));
14853
15406
  /**
14854
15407
  * The `author` / `contributors` value: either the shorthand string or the
14855
15408
  * structured object, always decoded to a {@link Person}.
15409
+ *
15410
+ * The wire form is preserved across a round trip — a person read from the
15411
+ * shorthand string encodes back to that string, byte for byte, and one read
15412
+ * from an object encodes back to an object with its unknown keys intact.
15413
+ * Formatting a manifest therefore never rewrites one legal encoding into the
15414
+ * other.
15415
+ *
15416
+ * Provenance belongs to the instance, so a person that is *rebuilt* (rather
15417
+ * than carried through unchanged) has none and encodes in the canonical
15418
+ * object form. Editing an unrelated field of the surrounding `Package`
15419
+ * carries the same person instance through and preserves its encoding.
14856
15420
  */
14857
- static FromValue = effect.Schema.Union([Person, Person.FromString]);
15421
+ static FromValue = effect.Schema.Union([Person.schema, effect.Schema.String]).pipe(effect.Schema.decodeTo(effect.Schema.instanceOf(Person), effect.SchemaTransformation.transform({
15422
+ decode: (input) => typeof input === "string" ? rememberWire(parsePersonString(input), input) : input,
15423
+ encode: (person) => {
15424
+ const wire = wireForms.get(person);
15425
+ return typeof wire === "string" && isFaithful(wire, person) ? wire : person;
15426
+ }
15427
+ })));
15428
+ /**
15429
+ * The shorthand text this person was decoded from, when it was decoded from
15430
+ * the string form and still matches its fields; `None` for a person built
15431
+ * from an object or by hand.
15432
+ *
15433
+ * Exposed so callers can tell which encoding a manifest used without
15434
+ * re-reading the file.
15435
+ *
15436
+ * @param person - the person to inspect
15437
+ * @returns the original shorthand text, or `None`
15438
+ */
15439
+ static wireStringOf(person) {
15440
+ const wire = wireForms.get(person);
15441
+ return typeof wire === "string" && isFaithful(wire, person) ? effect.Option.some(wire) : effect.Option.none();
15442
+ }
14858
15443
  };
14859
15444
  //#endregion
14860
- //#region ../../node_modules/.pnpm/@effected+package-json@0.3.0_effect@4.0.0-beta.98/node_modules/@effected/package-json/internal/format.js
15445
+ //#region ../../node_modules/.pnpm/@effected+package-json@0.4.1_effect@4.0.0-beta.99/node_modules/@effected/package-json/internal/format.js
14861
15446
  const KEY_INDEX = new Map([
14862
15447
  "$schema",
14863
15448
  "name",
@@ -15080,7 +15665,7 @@ const renderJson = (raw, options) => {
15080
15665
  return options.newline ? `${json}\n` : json;
15081
15666
  };
15082
15667
  //#endregion
15083
- //#region ../../node_modules/.pnpm/@effected+package-json@0.3.0_effect@4.0.0-beta.98/node_modules/@effected/package-json/Package.js
15668
+ //#region ../../node_modules/.pnpm/@effected+package-json@0.4.1_effect@4.0.0-beta.99/node_modules/@effected/package-json/Package.js
15084
15669
  const toHashMap = effect.SchemaTransformation.transform({
15085
15670
  decode: (record) => effect.HashMap.fromIterable(Object.entries(record)),
15086
15671
  encode: (map) => Object.fromEntries(effect.HashMap.toEntries(map))
@@ -15398,7 +15983,7 @@ var Package = class Package extends effect.Schema.Class("Package")({
15398
15983
  }
15399
15984
  };
15400
15985
  //#endregion
15401
- //#region ../../node_modules/.pnpm/@effected+workspaces@0.4.0_@effected+jsonc@0.3.0_effect@4.0.0-beta.98__effect@4.0.0-beta.98/node_modules/@effected/workspaces/WorkspacePackage.js
15986
+ //#region ../../node_modules/.pnpm/@effected+workspaces@0.5.2_@effected+jsonc@0.5.0_effect@4.0.0-beta.99__effect@4.0.0-beta.99/node_modules/@effected/workspaces/WorkspacePackage.js
15402
15987
  const EMPTY$1 = Object.freeze(Object.create(null));
15403
15988
  const EMPTY_MANIFEST = Object.freeze(Object.create(null));
15404
15989
  /**
@@ -15473,10 +16058,12 @@ var WorkspaceManifestError = class extends effect.Schema.TaggedErrorClass()("Wor
15473
16058
  * path: "/repo/packages/utils",
15474
16059
  * packageJsonPath: "/repo/packages/utils/package.json",
15475
16060
  * relativePath: "packages/utils",
16061
+ * workspaceRoot: "/repo",
15476
16062
  * });
15477
16063
  *
15478
16064
  * pkg.isRootWorkspace; // false
15479
16065
  * pkg.unscopedName; // "utils"
16066
+ * pkg.workspaceRoot; // "/repo"
15480
16067
  * ```
15481
16068
  *
15482
16069
  * @public
@@ -15492,6 +16079,21 @@ var WorkspacePackage = class WorkspacePackage extends effect.Schema.Class("Works
15492
16079
  packageJsonPath: effect.Schema.NonEmptyString,
15493
16080
  /** POSIX path relative to the workspace root; `"."` for the root package. */
15494
16081
  relativePath: effect.Schema.String,
16082
+ /**
16083
+ * Absolute path to the workspace root this package was discovered under.
16084
+ *
16085
+ * @remarks
16086
+ * Carried, not derived. Whoever built this value already knew the root —
16087
+ * `WorkspaceDiscovery` resolved it before enumerating, and the sync entry
16088
+ * point is handed it — so dropping it forced every consumer into per-package
16089
+ * root arithmetic (counting `relativePath` segments and re-ascending that
16090
+ * many `..`). That reconstruction is exact only while `path` and
16091
+ * `relativePath` agree, and it re-derives something the kit never had to
16092
+ * lose.
16093
+ *
16094
+ * For the root package this equals `path`, and `relativePath` is `"."`.
16095
+ */
16096
+ workspaceRoot: effect.Schema.NonEmptyString,
15495
16097
  /** Whether the package is marked private. */
15496
16098
  private: effect.Schema.Boolean.pipe(effect.Schema.withDecodingDefaultKey(effect.Effect.succeed(false)), effect.Schema.withConstructorDefault(effect.Effect.succeed(false))),
15497
16099
  /** Production dependencies. */
@@ -15660,7 +16262,7 @@ var WorkspacePackage = class WorkspacePackage extends effect.Schema.Class("Works
15660
16262
  }
15661
16263
  };
15662
16264
  //#endregion
15663
- //#region ../../node_modules/.pnpm/@effected+walker@0.2.1_@effected+glob@0.1.1_effect@4.0.0-beta.98__effect@4.0.0-beta.98/node_modules/@effected/walker/Descend.js
16265
+ //#region ../../node_modules/.pnpm/@effected+walker@0.3.1_@effected+glob@0.2.0_effect@4.0.0-beta.99__effect@4.0.0-beta.99/node_modules/@effected/walker/Descend.js
15664
16266
  /**
15665
16267
  * Typed failure raised by {@link descend}: a directory mid-walk was unreadable
15666
16268
  * (under `onUnreadable: "fail"`), or the walk descended past `maxDepth`. Depth
@@ -15795,7 +16397,97 @@ const descend = effect.Effect.fn("Walker.descend")(function* (pattern, options)
15795
16397
  return results;
15796
16398
  });
15797
16399
  //#endregion
15798
- //#region ../../node_modules/.pnpm/@effected+walker@0.2.1_@effected+glob@0.1.1_effect@4.0.0-beta.98__effect@4.0.0-beta.98/node_modules/@effected/walker/Walker.js
16400
+ //#region ../../node_modules/.pnpm/@effected+walker@0.3.1_@effected+glob@0.2.0_effect@4.0.0-beta.99__effect@4.0.0-beta.99/node_modules/@effected/walker/Expand.js
16401
+ /**
16402
+ * Typed failure raised by {@link compileAndExpand}: the single error the
16403
+ * compile+expand recipe fails with, so a caller catches one tag rather than
16404
+ * folding two error channels by hand.
16405
+ *
16406
+ * @remarks
16407
+ * One tag, two genuinely different causes — "your pattern is malformed" and
16408
+ * "that directory is unreadable" are different problems with different fixes,
16409
+ * so `cause` keeps the underlying typed error intact
16410
+ * rather than flattening it into a string. Discriminate on `cause._tag`
16411
+ * (`"GlobPatternError"` vs `"DescendError"`), or read
16412
+ * {@link GlobExpansionError.stage} when only the phase matters; either way the
16413
+ * original payload — a guard's `limit`/`actual`, a descent's `path` — is still
16414
+ * there. `cause` is also the native `Error` cause, so error chaining and
16415
+ * stack-printing work without extra wiring.
16416
+ *
16417
+ * @public
16418
+ */
16419
+ var GlobExpansionError = class extends effect.Schema.TaggedErrorClass()("GlobExpansionError", {
16420
+ /** The glob pattern's source text, as handed to {@link compileAndExpand}. */
16421
+ pattern: effect.Schema.String,
16422
+ /** The underlying typed failure, intact: a compile guard trip or a descent failure. */
16423
+ cause: effect.Schema.Union([GlobPatternError, DescendError])
16424
+ }) {
16425
+ /**
16426
+ * Which phase failed — `"compile"` when the pattern itself was rejected,
16427
+ * `"descend"` when the filesystem walk failed. A convenience over
16428
+ * `cause._tag` for callers that only need the phase.
16429
+ */
16430
+ get stage() {
16431
+ return this.cause._tag === "GlobPatternError" ? "compile" : "descend";
16432
+ }
16433
+ get message() {
16434
+ const shown = this.pattern.length > 64 ? `${this.pattern.slice(0, 64)}…` : this.pattern;
16435
+ return `glob expansion of ${JSON.stringify(shown)} failed during ${this.stage}: ${this.cause.message}`;
16436
+ }
16437
+ };
16438
+ /**
16439
+ * Compile a glob pattern and expand it against the filesystem in one call:
16440
+ * matching FILE paths relative to `options.cwd`, POSIX separators, sorted.
16441
+ *
16442
+ * @remarks
16443
+ * The recipe form of {@link descend}. Everything `descend` documents about
16444
+ * traversal holds unchanged — the literal fast-path, the negated-pattern walk
16445
+ * from `cwd`, files-only matching, symlink and prune handling, `maxDepth`,
16446
+ * `onUnreadable` — because this delegates to it. What this adds is the seam:
16447
+ * the pattern arrives as a string, and both failure modes arrive as one
16448
+ * {@link GlobExpansionError} with the underlying error preserved in `cause`.
16449
+ *
16450
+ * A missing base directory, a pattern that climbs above `cwd`, and a pattern
16451
+ * that simply matches nothing are all an EMPTY result, not a failure — zero
16452
+ * matches is a normal glob answer. Only a rejected pattern or a failed walk
16453
+ * produces an error.
16454
+ *
16455
+ * `FileSystem` and `Path` stay in the `R` channel and are **deliberately not
16456
+ * provided here**, even though hand-providing them is the friction this
16457
+ * recipe otherwise removes. `FileSystem` cannot be provided — a library that
16458
+ * picks its own filesystem cannot be tested against a fixture tree. Given
16459
+ * that, providing `Path` internally would not save the caller a layer (they
16460
+ * still supply `FileSystem`), and it would actively break win32: the walk
16461
+ * would join paths POSIX-style against a caller's win32 filesystem. The
16462
+ * consumer's platform layer stays the single place that choice is made.
16463
+ * Provide both once at the application boundary, not per call site.
16464
+ *
16465
+ * @example
16466
+ * ```ts
16467
+ * import { compileAndExpand } from "@effected/walker"
16468
+ * import { GlobPatternOptions } from "@effected/glob"
16469
+ *
16470
+ * const files = yield* compileAndExpand("packages/*​/src/**​/*.ts", {
16471
+ * cwd: "/repo",
16472
+ * glob: GlobPatternOptions.make({ dot: true })
16473
+ * })
16474
+ * ```
16475
+ *
16476
+ * @public
16477
+ */
16478
+ const compileAndExpand = effect.Effect.fn("Walker.compileAndExpand")(function* (pattern, options) {
16479
+ const compiled = GlobPattern.compileResult(pattern, options.glob);
16480
+ if (effect.Result.isFailure(compiled)) return yield* new GlobExpansionError({
16481
+ pattern,
16482
+ cause: compiled.failure
16483
+ });
16484
+ return yield* descend(compiled.success, options).pipe(effect.Effect.mapError((cause) => new GlobExpansionError({
16485
+ pattern,
16486
+ cause
16487
+ })));
16488
+ });
16489
+ //#endregion
16490
+ //#region ../../node_modules/.pnpm/@effected+walker@0.3.1_@effected+glob@0.2.0_effect@4.0.0-beta.99__effect@4.0.0-beta.99/node_modules/@effected/walker/Walker.js
15799
16491
  /**
15800
16492
  * Ascend from `start` toward the filesystem root, yielding each directory,
15801
16493
  * nearest first.
@@ -15809,17 +16501,28 @@ const descend = effect.Effect.fn("Walker.descend")(function* (pattern, options)
15809
16501
  * Bounded twice over: `dirname` is a fixpoint at the root, and `maxDepth` guards
15810
16502
  * a pathological `Path` implementation that never reaches one.
15811
16503
  *
16504
+ * `stopAt` is compared in normalized form — see {@link AscendOptions.stopAt}.
16505
+ * Raw string equality made the ceiling fail OPEN: an unnormalized ceiling
16506
+ * matched nothing and the ascent ran silently to the filesystem root, which is
16507
+ * the unbounded walk the option exists to prevent, with no error to notice it
16508
+ * by. A relative ceiling **dies** for the same reason — resolving one against
16509
+ * `process.cwd()` would reintroduce the silent-wrong-walk failure through a
16510
+ * different door. See {@link AscendOptions.stopAt} for why that is a defect
16511
+ * rather than a typed error; the error channel stays `never`.
16512
+ *
15812
16513
  * @public
15813
16514
  */
15814
16515
  const ascend = (start, options) => effect.Effect.gen(function* () {
15815
16516
  const path = yield* effect.Path.Path;
15816
16517
  const maxDepth = options?.maxDepth ?? 256;
15817
16518
  if (!Number.isInteger(maxDepth) || maxDepth < 1) return yield* effect.Effect.die(/* @__PURE__ */ new Error(`Walker.ascend: maxDepth must be a positive integer, received ${maxDepth}`));
16519
+ if (options?.stopAt !== void 0 && !path.isAbsolute(options.stopAt)) return yield* effect.Effect.die(/* @__PURE__ */ new Error(`Walker.ascend: stopAt must be an absolute path, received ${JSON.stringify(options.stopAt)} (ascending from ${JSON.stringify(start)})`));
16520
+ const ceiling = options?.stopAt === void 0 ? void 0 : path.resolve(options.stopAt);
15818
16521
  const dirs = [];
15819
16522
  let current = start;
15820
16523
  for (let depth = 0; depth < maxDepth; depth++) {
15821
16524
  dirs.push(current);
15822
- if (options?.stopAt !== void 0 && current === options.stopAt) break;
16525
+ if (ceiling !== void 0 && (current === ceiling || path.resolve(current) === ceiling)) break;
15823
16526
  const parent = path.dirname(current);
15824
16527
  if (parent === current) break;
15825
16528
  current = parent;
@@ -15885,7 +16588,7 @@ const Walker$1 = {
15885
16588
  findRoot: findRoot$1
15886
16589
  };
15887
16590
  //#endregion
15888
- //#region ../../node_modules/.pnpm/@effected+workspaces@0.4.0_@effected+jsonc@0.3.0_effect@4.0.0-beta.98__effect@4.0.0-beta.98/node_modules/@effected/workspaces/WorkspaceRoot.js
16591
+ //#region ../../node_modules/.pnpm/@effected+workspaces@0.5.2_@effected+jsonc@0.5.0_effect@4.0.0-beta.99__effect@4.0.0-beta.99/node_modules/@effected/workspaces/WorkspaceRoot.js
15889
16592
  /**
15890
16593
  * The marker filenames {@link WorkspaceRoot} probes for, in priority order.
15891
16594
  *
@@ -15905,11 +16608,22 @@ var WorkspaceRootNotFoundError = class extends effect.Schema.TaggedErrorClass()(
15905
16608
  /** The directory the ascent started from. */
15906
16609
  searchPath: effect.Schema.String,
15907
16610
  /** The marker filenames probed at each ancestor. */
15908
- markers: effect.Schema.Array(effect.Schema.String)
16611
+ markers: effect.Schema.Array(effect.Schema.String),
16612
+ /**
16613
+ * The resolved ceiling the ascent was bounded by, when one was supplied.
16614
+ *
16615
+ * @remarks
16616
+ * Absent means the ascent ran to the filesystem root. Its presence is what
16617
+ * lets a caller tell "there is no workspace root anywhere above me" from
16618
+ * "there is none below the ceiling I set" — two failures that otherwise
16619
+ * render identically.
16620
+ */
16621
+ stopAt: effect.Schema.optionalKey(effect.Schema.String)
15909
16622
  }) {
15910
- /** Renders the search path and probed markers into a one-line message. */
16623
+ /** Renders the search path, probed markers and any ceiling into a one-line message. */
15911
16624
  get message() {
15912
- return `No workspace root above ${this.searchPath} (looked for ${this.markers.join(", ")})`;
16625
+ const bound = this.stopAt === void 0 ? "" : ` up to ${this.stopAt}`;
16626
+ return `No workspace root above ${this.searchPath}${bound} (looked for ${this.markers.join(", ")})`;
15913
16627
  }
15914
16628
  };
15915
16629
  /**
@@ -15932,6 +16646,12 @@ const isWorkspaceRoot = (dir) => effect.Effect.gen(function* () {
15932
16646
  }).pipe(effect.Effect.orElseSucceed(() => ({})));
15933
16647
  return parsed.workspaces !== void 0 && parsed.workspaces !== null;
15934
16648
  });
16649
+ /** Whether `descendant` is `ancestor` itself or lies beneath it, on POSIX or win32 separators. */
16650
+ const isAtOrBelow = (descendant, ancestor) => {
16651
+ if (descendant === ancestor) return true;
16652
+ const prefix = ancestor.endsWith("/") || ancestor.endsWith("\\") ? ancestor : `${ancestor}/`;
16653
+ return descendant.startsWith(prefix) || descendant.startsWith(prefix.replace(/\/$/, "\\"));
16654
+ };
15935
16655
  /**
15936
16656
  * Locates the workspace root by ascending from a starting directory.
15937
16657
  *
@@ -15946,6 +16666,20 @@ const isWorkspaceRoot = (dir) => effect.Effect.gen(function* () {
15946
16666
  * });
15947
16667
  * ```
15948
16668
  *
16669
+ * @example
16670
+ * Bounded: an unmarked fixture directory fails typed instead of escaping into
16671
+ * the enclosing repository.
16672
+ *
16673
+ * ```ts
16674
+ * import { WorkspaceRoot } from "@effected/workspaces";
16675
+ * import { Effect } from "effect";
16676
+ *
16677
+ * const program = Effect.gen(function* () {
16678
+ * const roots = yield* WorkspaceRoot;
16679
+ * return yield* roots.find("/tmp/fixture/packages/a", { stopAt: "/tmp/fixture" });
16680
+ * });
16681
+ * ```
16682
+ *
15949
16683
  * @public
15950
16684
  */
15951
16685
  var WorkspaceRoot = class WorkspaceRoot extends effect.Context.Service()("@effected/workspaces/WorkspaceRoot") {
@@ -15953,24 +16687,95 @@ var WorkspaceRoot = class WorkspaceRoot extends effect.Context.Service()("@effec
15953
16687
  static make = effect.Effect.gen(function* () {
15954
16688
  const fs = yield* effect.FileSystem.FileSystem;
15955
16689
  const path = yield* effect.Path.Path;
15956
- const find = effect.Effect.fn("WorkspaceRoot.find")(function* (cwd) {
16690
+ const find = effect.Effect.fn("WorkspaceRoot.find")(function* (cwd, options) {
15957
16691
  const start = path.resolve(cwd);
15958
- const chain = yield* Walker$1.ascend(start);
16692
+ const ceiling = options?.stopAt === void 0 ? void 0 : path.resolve(options.stopAt);
16693
+ const chain = yield* Walker$1.ascend(start, {
16694
+ ...ceiling === void 0 ? {} : { stopAt: ceiling },
16695
+ ...options?.maxDepth === void 0 ? {} : { maxDepth: options.maxDepth }
16696
+ });
15959
16697
  const found = yield* Walker$1.findRoot(chain, isWorkspaceRoot);
15960
16698
  if (effect.Option.isNone(found)) return yield* effect.Effect.fail(new WorkspaceRootNotFoundError({
15961
16699
  searchPath: start,
15962
- markers: WORKSPACE_MARKERS
16700
+ markers: WORKSPACE_MARKERS,
16701
+ ...ceiling === void 0 ? {} : { stopAt: ceiling }
15963
16702
  }));
15964
16703
  yield* effect.Effect.logDebug("Workspace root found").pipe(effect.Effect.annotateLogs("workspace.root", found.value));
15965
16704
  return found.value;
15966
16705
  });
15967
- return { find: (cwd) => find(cwd).pipe(effect.Effect.provideService(effect.FileSystem.FileSystem, fs), effect.Effect.provideService(effect.Path.Path, path)) };
16706
+ return { find: (cwd, options) => find(cwd, options).pipe(effect.Effect.provideService(effect.FileSystem.FileSystem, fs), effect.Effect.provideService(effect.Path.Path, path)) };
15968
16707
  });
15969
16708
  /** The live layer. */
15970
16709
  static layer = effect.Layer.effect(WorkspaceRoot, WorkspaceRoot.make);
16710
+ /**
16711
+ * A test double resolving every `find` to `root`, with no filesystem.
16712
+ *
16713
+ * @remarks
16714
+ * The nine-copies-of-a-four-line-mock case — a `Layer.succeed` over a `find`
16715
+ * that ignores its arguments and succeeds with a fixed root is what consumers
16716
+ * were writing by hand. The difference is that this double **honours
16717
+ * `stopAt`**: a hand-rolled `find` that ignores the ceiling makes a bounded
16718
+ * call pass under test and fail against the live service, which is the
16719
+ * failure mode the option exists to catch. A `root` above the ceiling fails
16720
+ * here exactly as it would live, with the same
16721
+ * {@link WorkspaceRootNotFoundError}.
16722
+ *
16723
+ * The ceiling is `path.resolve`d through the injected `Path` service before
16724
+ * the comparison, exactly as the live `make` path does — so a `stopAt`
16725
+ * carrying `..` segments bounds the double identically to the live service,
16726
+ * not by raw string. This is why `makeTest` yields an `Effect` requiring
16727
+ * `Path`: it captures the service once at construction, the same shape as
16728
+ * `make`. Consumers reach for {@link WorkspaceRoot.layerTest}, which provides
16729
+ * `Path.layer` internally, so the requirement never surfaces at their call
16730
+ * site.
16731
+ *
16732
+ * `maxDepth` is deliberately NOT modelled: the double does not walk, so it has
16733
+ * no depth to cap, and pretending otherwise would encode a fiction. A suite
16734
+ * exercising the depth guard wants the live service over a fixture tree.
16735
+ *
16736
+ * @param root - The root every unbounded `find` resolves to.
16737
+ */
16738
+ static makeTest = (root) => effect.Effect.gen(function* () {
16739
+ const path = yield* effect.Path.Path;
16740
+ return { find: (cwd, options) => options?.stopAt !== void 0 && !isAtOrBelow(root, path.resolve(options.stopAt)) ? effect.Effect.fail(new WorkspaceRootNotFoundError({
16741
+ searchPath: cwd,
16742
+ markers: WORKSPACE_MARKERS,
16743
+ stopAt: options.stopAt
16744
+ })) : effect.Effect.succeed(root) };
16745
+ });
16746
+ /**
16747
+ * The test layer: {@link WorkspaceRoot.makeTest} with `Path.layer` provided.
16748
+ *
16749
+ * @remarks
16750
+ * `makeTest` requires `Path` to normalize the `stopAt` ceiling; this layer
16751
+ * supplies core's `Path.layer` internally, so the requirement never reaches a
16752
+ * consumer — the published type stays `Layer.Layer<WorkspaceRoot>`.
16753
+ *
16754
+ * A parameterized layer factory mints a **fresh reference per call**, and
16755
+ * layers memoize by reference — bind the result to a `const` and reuse it
16756
+ * rather than calling `layerTest(...)` at each composition site.
16757
+ *
16758
+ * Pair it with `WorkspaceDiscovery.layerTest` to stand up the whole discovery
16759
+ * path without a filesystem; between them there is nothing left for a
16760
+ * module-level mock of `@effected/workspaces` to do, and a provided layer
16761
+ * keeps the service graph — and its typed errors — intact.
16762
+ *
16763
+ * @example
16764
+ * ```ts
16765
+ * import { WorkspaceDiscovery, WorkspaceRoot } from "@effected/workspaces";
16766
+ * import { Effect } from "effect";
16767
+ *
16768
+ * const TestRoot = WorkspaceRoot.layerTest("/repo");
16769
+ * const TestDiscovery = WorkspaceDiscovery.layerTest({
16770
+ * listPackages: () => Effect.succeed([]),
16771
+ * });
16772
+ * // program.pipe(Effect.provide(TestRoot), Effect.provide(TestDiscovery))
16773
+ * ```
16774
+ */
16775
+ static layerTest = (root) => effect.Layer.effect(WorkspaceRoot, WorkspaceRoot.makeTest(root)).pipe(effect.Layer.provide(effect.Path.layer));
15971
16776
  };
15972
16777
  //#endregion
15973
- //#region ../../node_modules/.pnpm/@effected+workspaces@0.4.0_@effected+jsonc@0.3.0_effect@4.0.0-beta.98__effect@4.0.0-beta.98/node_modules/@effected/workspaces/internal/limits.js
16778
+ //#region ../../node_modules/.pnpm/@effected+workspaces@0.5.2_@effected+jsonc@0.5.0_effect@4.0.0-beta.99__effect@4.0.0-beta.99/node_modules/@effected/workspaces/internal/limits.js
15974
16779
  /**
15975
16780
  * Hard ceiling on directories the enumerator will visit for one pattern set.
15976
16781
  * Guards the pathological case a depth cap alone does not: a wide, shallow
@@ -15988,7 +16793,7 @@ const MAX_ENUMERATION_ENTRIES = 1e5;
15988
16793
  */
15989
16794
  const PRUNED_DIRECTORIES = /* @__PURE__ */ new Set([".git", "node_modules"]);
15990
16795
  //#endregion
15991
- //#region ../../node_modules/.pnpm/@effected+workspaces@0.4.0_@effected+jsonc@0.3.0_effect@4.0.0-beta.98__effect@4.0.0-beta.98/node_modules/@effected/workspaces/internal/traverse.js
16796
+ //#region ../../node_modules/.pnpm/@effected+workspaces@0.5.2_@effected+jsonc@0.5.0_effect@4.0.0-beta.99__effect@4.0.0-beta.99/node_modules/@effected/workspaces/internal/traverse.js
15992
16797
  /** Directory names never descended into. */
15993
16798
  const isPruned = (entry) => PRUNED_DIRECTORIES.has(entry);
15994
16799
  /** Join root-relative POSIX segments; `""` is the root itself. */
@@ -16078,7 +16883,7 @@ var Traversal = class {
16078
16883
  }
16079
16884
  };
16080
16885
  //#endregion
16081
- //#region ../../node_modules/.pnpm/@effected+workspaces@0.4.0_@effected+jsonc@0.3.0_effect@4.0.0-beta.98__effect@4.0.0-beta.98/node_modules/@effected/workspaces/internal/enumerate.js
16886
+ //#region ../../node_modules/.pnpm/@effected+workspaces@0.5.2_@effected+jsonc@0.5.0_effect@4.0.0-beta.99__effect@4.0.0-beta.99/node_modules/@effected/workspaces/internal/enumerate.js
16082
16887
  /** Strip a trailing slash from `GlobPattern.enumerationPrefix` to get a relative directory. */
16083
16888
  const baseOf = (pattern) => pattern.enumerationPrefix.replace(/\/$/, "");
16084
16889
  /**
@@ -16148,7 +16953,7 @@ const enumerate = (root, globs, options) => effect.Effect.gen(function* () {
16148
16953
  return results;
16149
16954
  });
16150
16955
  //#endregion
16151
- //#region ../../node_modules/.pnpm/@effected+workspaces@0.4.0_@effected+jsonc@0.3.0_effect@4.0.0-beta.98__effect@4.0.0-beta.98/node_modules/@effected/workspaces/internal/patterns.js
16956
+ //#region ../../node_modules/.pnpm/@effected+workspaces@0.5.2_@effected+jsonc@0.5.0_effect@4.0.0-beta.99__effect@4.0.0-beta.99/node_modules/@effected/workspaces/internal/patterns.js
16152
16957
  const stringsOf = (value) => Array.isArray(value) ? value.filter((entry) => typeof entry === "string") : void 0;
16153
16958
  /** The `packages:` list of a `pnpm-workspace.yaml` document. Total on a parsed document. */
16154
16959
  const pnpmPatternsOf = (document) => {
@@ -16205,7 +17010,7 @@ const readPatterns = (root) => effect.Effect.gen(function* () {
16205
17010
  return manifestPatternsOf(manifest);
16206
17011
  });
16207
17012
  //#endregion
16208
- //#region ../../node_modules/.pnpm/@effected+workspaces@0.4.0_@effected+jsonc@0.3.0_effect@4.0.0-beta.98__effect@4.0.0-beta.98/node_modules/@effected/workspaces/WorkspaceDiscovery.js
17013
+ //#region ../../node_modules/.pnpm/@effected+workspaces@0.5.2_@effected+jsonc@0.5.0_effect@4.0.0-beta.99__effect@4.0.0-beta.99/node_modules/@effected/workspaces/WorkspaceDiscovery.js
16209
17014
  /**
16210
17015
  * Raised when a workspace member's `package.json` cannot be read, parsed, or
16211
17016
  * used — it is missing, malformed, or lacks a `name` or `version`.
@@ -16383,6 +17188,7 @@ var WorkspaceDiscovery = class WorkspaceDiscovery extends effect.Context.Service
16383
17188
  path: directory,
16384
17189
  packageJsonPath,
16385
17190
  relativePath,
17191
+ workspaceRoot: root,
16386
17192
  manifestRecord: raw,
16387
17193
  ...typeof raw.private === "boolean" ? { private: raw.private } : {},
16388
17194
  ...isStringRecord$2(raw.dependencies) ? { dependencies: raw.dependencies } : {},
@@ -16540,6 +17346,7 @@ var WorkspaceDiscovery = class WorkspaceDiscovery extends effect.Context.Service
16540
17346
  * path: "/repo/packages/utils",
16541
17347
  * packageJsonPath: "/repo/packages/utils/package.json",
16542
17348
  * relativePath: "packages/utils",
17349
+ * workspaceRoot: "/repo",
16543
17350
  * }),
16544
17351
  * ]),
16545
17352
  * });
@@ -16637,7 +17444,7 @@ var WorkspaceDiscovery = class WorkspaceDiscovery extends effect.Context.Service
16637
17444
  };
16638
17445
  const isStringRecord$2 = (value) => value !== null && typeof value === "object" && !Array.isArray(value) && Object.values(value).every((entry) => typeof entry === "string");
16639
17446
  //#endregion
16640
- //#region ../../node_modules/.pnpm/@effected+workspaces@0.4.0_@effected+jsonc@0.3.0_effect@4.0.0-beta.98__effect@4.0.0-beta.98/node_modules/@effected/workspaces/DependencyGraph.js
17447
+ //#region ../../node_modules/.pnpm/@effected+workspaces@0.5.2_@effected+jsonc@0.5.0_effect@4.0.0-beta.99__effect@4.0.0-beta.99/node_modules/@effected/workspaces/DependencyGraph.js
16641
17448
  /**
16642
17449
  * Raised when the workspace dependency graph cannot be topologically ordered
16643
17450
  * because it contains a cycle.
@@ -16872,7 +17679,7 @@ const kahn = (edges) => {
16872
17679
  };
16873
17680
  };
16874
17681
  //#endregion
16875
- //#region ../../node_modules/.pnpm/@effected+git@0.4.0_effect@4.0.0-beta.98/node_modules/@effected/git/GitCommand.js
17682
+ //#region ../../node_modules/.pnpm/@effected+git@0.4.1_effect@4.0.0-beta.99/node_modules/@effected/git/GitCommand.js
16876
17683
  /**
16877
17684
  * Builds a `git` `ChildProcess.StandardCommand` with the argv this package
16878
17685
  * classifies against.
@@ -17291,7 +18098,7 @@ const GitCommand = {
17291
18098
  status
17292
18099
  };
17293
18100
  //#endregion
17294
- //#region ../../node_modules/.pnpm/@effected+git@0.4.0_effect@4.0.0-beta.98/node_modules/@effected/git/internal/run.js
18101
+ //#region ../../node_modules/.pnpm/@effected+git@0.4.1_effect@4.0.0-beta.99/node_modules/@effected/git/internal/run.js
17295
18102
  /**
17296
18103
  * Spawns `command` and collects its stdout, stderr, and exit code as a single
17297
18104
  * triple.
@@ -17318,7 +18125,7 @@ const runCollected = (command) => effect.Effect.scoped(effect.Effect.gen(functio
17318
18125
  };
17319
18126
  }));
17320
18127
  //#endregion
17321
- //#region ../../node_modules/.pnpm/@effected+git@0.4.0_effect@4.0.0-beta.98/node_modules/@effected/git/Git.js
18128
+ //#region ../../node_modules/.pnpm/@effected+git@0.4.1_effect@4.0.0-beta.99/node_modules/@effected/git/Git.js
17322
18129
  /** git's own ceiling: a run that has not answered in 30s is not going to. */
17323
18130
  const GIT_TIMEOUT = effect.Duration.seconds(30);
17324
18131
  /**
@@ -17330,7 +18137,7 @@ const GIT_TIMEOUT = effect.Duration.seconds(30);
17330
18137
  * `exitCode` and `stderr` are populated when git actually ran. `detail`
17331
18138
  * carries a human-readable explanation of an absorbed spawn-level
17332
18139
  * `PlatformError` or a per-run timeout — the two cases where git never
17333
- * produced an exit code at all. {@link GitCommandError.kind | `kind`}
18140
+ * produced an exit code at all. `kind`
17334
18141
  * discriminates a pre-spawn guard rejection (`"refused"`) from a genuine git
17335
18142
  * failure (`"failed"`) structurally, so composed retry/fallback logic never has
17336
18143
  * to parse the prose in `message` or `detail`.
@@ -18235,7 +19042,7 @@ var Git = class extends effect.Context.Service()("@effected/git/Git") {
18235
19042
  }));
18236
19043
  };
18237
19044
  //#endregion
18238
- //#region ../../node_modules/.pnpm/@effected+workspaces@0.4.0_@effected+jsonc@0.3.0_effect@4.0.0-beta.98__effect@4.0.0-beta.98/node_modules/@effected/workspaces/ChangeDetector.js
19045
+ //#region ../../node_modules/.pnpm/@effected+workspaces@0.5.2_@effected+jsonc@0.5.0_effect@4.0.0-beta.99__effect@4.0.0-beta.99/node_modules/@effected/workspaces/ChangeDetector.js
18239
19046
  /**
18240
19047
  * Which git refs to compare, and whether to fold in the working tree.
18241
19048
  *
@@ -18487,7 +19294,7 @@ function resolveFromCatalog(catalogs, wantedDependency) {
18487
19294
  };
18488
19295
  }
18489
19296
  //#endregion
18490
- //#region ../../node_modules/.pnpm/@effected+workspaces@0.4.0_@effected+jsonc@0.3.0_effect@4.0.0-beta.98__effect@4.0.0-beta.98/node_modules/@effected/workspaces/internal/catalogs.js
19297
+ //#region ../../node_modules/.pnpm/@effected+workspaces@0.5.2_@effected+jsonc@0.5.0_effect@4.0.0-beta.99__effect@4.0.0-beta.99/node_modules/@effected/workspaces/internal/catalogs.js
18491
19298
  /** Project a pnpm-workspace manifest's `catalog` / `catalogs` fields into a `Catalogs` map. */
18492
19299
  const inlineCatalogs = (manifest) => {
18493
19300
  if (manifest.catalog === void 0 && manifest.catalogs === void 0) return {};
@@ -18551,7 +19358,7 @@ const rangeOf = (catalogs, dependency, specifier) => {
18551
19358
  });
18552
19359
  };
18553
19360
  //#endregion
18554
- //#region ../../node_modules/.pnpm/@effected+workspaces@0.4.0_@effected+jsonc@0.3.0_effect@4.0.0-beta.98__effect@4.0.0-beta.98/node_modules/@effected/workspaces/ConfigDependencyHooks.js
19361
+ //#region ../../node_modules/.pnpm/@effected+workspaces@0.5.2_@effected+jsonc@0.5.0_effect@4.0.0-beta.99__effect@4.0.0-beta.99/node_modules/@effected/workspaces/ConfigDependencyHooks.js
18555
19362
  /** Whether `value` is a non-null, non-array object. */
18556
19363
  const isObject$2 = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
18557
19364
  /**
@@ -18645,9 +19452,13 @@ var ConfigDependencyHooks = class ConfigDependencyHooks extends effect.Context.S
18645
19452
  * `hooks`-source `CatalogAssemblyError`, never a silent skip.
18646
19453
  *
18647
19454
  * @remarks
18648
- * Node-coupled by design the `node:fs` / `node:path` / `node:url` imports are
18649
- * the sanctioned Node-only overlay, matching the other seams here. Only ever
18650
- * wired by `WorkspaceCatalogs.layerWithConfigDependencies`.
19455
+ * Runtime-coupled by design, not node-exclusive. The `import()` below loads
19456
+ * **and executes** a config dependency's pnpmfile in-process code execution,
19457
+ * not IO, so no `FileSystem` / `Path` service abstracts it. The `node:path` and
19458
+ * `node:url` imports (`join`, `pathToFileURL`) exist only to build the URL that
19459
+ * `import()` consumes; node and bun both implement those builtins and dynamic
19460
+ * import, so this layer runs on either runtime. Only ever wired by
19461
+ * `WorkspaceCatalogs.layerWithConfigDependencies`.
18651
19462
  */
18652
19463
  static layerLive = effect.Layer.succeed(ConfigDependencyHooks, { inject: (root, configDependencies, seed) => effect.Effect.gen(function* () {
18653
19464
  const names = Object.keys(configDependencies);
@@ -18696,7 +19507,7 @@ var ConfigDependencyHooks = class ConfigDependencyHooks extends effect.Context.S
18696
19507
  }) });
18697
19508
  };
18698
19509
  //#endregion
18699
- //#region ../../node_modules/.pnpm/@effected+workspaces@0.4.0_@effected+jsonc@0.3.0_effect@4.0.0-beta.98__effect@4.0.0-beta.98/node_modules/@effected/workspaces/PackageManagerName.js
19510
+ //#region ../../node_modules/.pnpm/@effected+workspaces@0.5.2_@effected+jsonc@0.5.0_effect@4.0.0-beta.99__effect@4.0.0-beta.99/node_modules/@effected/workspaces/PackageManagerName.js
18700
19511
  /**
18701
19512
  * The four package managers this package understands.
18702
19513
  *
@@ -18938,7 +19749,7 @@ var PackageManagerDetector = class PackageManagerDetector extends effect.Context
18938
19749
  static layer = effect.Layer.effect(PackageManagerDetector, PackageManagerDetector.make);
18939
19750
  };
18940
19751
  //#endregion
18941
- //#region ../../node_modules/.pnpm/@effected+workspaces@0.4.0_@effected+jsonc@0.3.0_effect@4.0.0-beta.98__effect@4.0.0-beta.98/node_modules/@effected/workspaces/LockfileReader.js
19752
+ //#region ../../node_modules/.pnpm/@effected+workspaces@0.5.2_@effected+jsonc@0.5.0_effect@4.0.0-beta.99__effect@4.0.0-beta.99/node_modules/@effected/workspaces/LockfileReader.js
18942
19753
  /**
18943
19754
  * Raised when the workspace's lockfile cannot be read off disk.
18944
19755
  *
@@ -19048,7 +19859,7 @@ var LockfileReader = class LockfileReader extends effect.Context.Service()("@eff
19048
19859
  static layer = (options) => effect.Layer.effect(LockfileReader, LockfileReader.make(options));
19049
19860
  };
19050
19861
  //#endregion
19051
- //#region ../../node_modules/.pnpm/@effected+workspaces@0.4.0_@effected+jsonc@0.3.0_effect@4.0.0-beta.98__effect@4.0.0-beta.98/node_modules/@effected/workspaces/Publishability.js
19862
+ //#region ../../node_modules/.pnpm/@effected+workspaces@0.5.2_@effected+jsonc@0.5.0_effect@4.0.0-beta.99__effect@4.0.0-beta.99/node_modules/@effected/workspaces/Publishability.js
19052
19863
  /** The public npm registry, used when `publishConfig.registry` says nothing. */
19053
19864
  const DEFAULT_REGISTRY = "https://registry.npmjs.org/";
19054
19865
  /**
@@ -19148,7 +19959,7 @@ var PublishabilityDetector = class PublishabilityDetector extends effect.Context
19148
19959
  }) });
19149
19960
  };
19150
19961
  //#endregion
19151
- //#region ../../node_modules/.pnpm/@effected+workspaces@0.4.0_@effected+jsonc@0.3.0_effect@4.0.0-beta.98__effect@4.0.0-beta.98/node_modules/@effected/workspaces/WorkspaceCatalogs.js
19962
+ //#region ../../node_modules/.pnpm/@effected+workspaces@0.5.2_@effected+jsonc@0.5.0_effect@4.0.0-beta.99__effect@4.0.0-beta.99/node_modules/@effected/workspaces/WorkspaceCatalogs.js
19152
19963
  /**
19153
19964
  * An immutable, fully-normalized catalog collection — the one catalog
19154
19965
  * resolution semantic in the package.
@@ -19532,7 +20343,7 @@ var WorkspaceCatalogs = class WorkspaceCatalogs extends effect.Context.Service()
19532
20343
  }));
19533
20344
  };
19534
20345
  //#endregion
19535
- //#region ../../node_modules/.pnpm/@effected+workspaces@0.4.0_@effected+jsonc@0.3.0_effect@4.0.0-beta.98__effect@4.0.0-beta.98/node_modules/@effected/workspaces/WorkspaceStateSnapshot.js
20346
+ //#region ../../node_modules/.pnpm/@effected+workspaces@0.5.2_@effected+jsonc@0.5.0_effect@4.0.0-beta.99__effect@4.0.0-beta.99/node_modules/@effected/workspaces/WorkspaceStateSnapshot.js
19536
20347
  const EMPTY = Object.freeze(Object.create(null));
19537
20348
  const DependencyMap = effect.Schema.Record(effect.Schema.String, effect.Schema.String).pipe(effect.Schema.withDecodingDefaultKey(effect.Effect.succeed(EMPTY)), effect.Schema.withConstructorDefault(effect.Effect.succeed(EMPTY)));
19538
20349
  /**
@@ -19697,7 +20508,7 @@ var WorkspaceStateSnapshot = class extends effect.Schema.Class("WorkspaceStateSn
19697
20508
  }
19698
20509
  };
19699
20510
  //#endregion
19700
- //#region ../../node_modules/.pnpm/@effected+workspaces@0.4.0_@effected+jsonc@0.3.0_effect@4.0.0-beta.98__effect@4.0.0-beta.98/node_modules/@effected/workspaces/WorkspaceSnapshots.js
20511
+ //#region ../../node_modules/.pnpm/@effected+workspaces@0.5.2_@effected+jsonc@0.5.0_effect@4.0.0-beta.99__effect@4.0.0-beta.99/node_modules/@effected/workspaces/WorkspaceSnapshots.js
19701
20512
  /** Whether `value` is a non-null, non-array object. */
19702
20513
  const isObject = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
19703
20514
  /** Whether every value in a record is a string — a usable dependency map. */
@@ -19889,7 +20700,7 @@ var WorkspaceSnapshots = class WorkspaceSnapshots extends effect.Context.Service
19889
20700
  static layer = (options) => effect.Layer.effect(WorkspaceSnapshots, WorkspaceSnapshots.make(options));
19890
20701
  };
19891
20702
  //#endregion
19892
- //#region ../../node_modules/.pnpm/@effected+workspaces@0.4.0_@effected+jsonc@0.3.0_effect@4.0.0-beta.98__effect@4.0.0-beta.98/node_modules/@effected/workspaces/Workspaces.js
20703
+ //#region ../../node_modules/.pnpm/@effected+workspaces@0.5.2_@effected+jsonc@0.5.0_effect@4.0.0-beta.99__effect@4.0.0-beta.99/node_modules/@effected/workspaces/Workspaces.js
19893
20704
  /**
19894
20705
  * Every service that needs only a filesystem: root, package-manager detection,
19895
20706
  * discovery, lockfile reading, catalogs and publishability.
@@ -20257,34 +21068,15 @@ effect.Layer.effect(PublishabilityDetector, effect.Effect.gen(function* () {
20257
21068
  }) };
20258
21069
  }));
20259
21070
  /**
20260
- * The workspace root a package was discovered against, derived from its own
20261
- * coordinates: `relativePath` is the package directory relative to the
20262
- * discovery root (POSIX, `"."` for the root package), so ascending one level
20263
- * per path segment from `pkg.path` lands exactly on that root.
20264
- *
20265
- * @remarks
20266
- * Derivation is deliberate — probing the filesystem for workspace markers
20267
- * (`WorkspaceRoot.find`) can walk PAST the intended root when that root
20268
- * carries no marker (a fixture tree, a bare directory) and land on an
20269
- * enclosing workspace, silently swapping in that outer root's
20270
- * `.changeset/config.json` and dropping the ignore/mode gating (the #209
20271
- * regression class). The discovery root needs no probing: whoever built the
20272
- * `WorkspacePackage` already knew it.
20273
- */
20274
- const packageRoot = (pkg) => {
20275
- const segments = pkg.relativePath.split("/").filter((segment) => segment !== "" && segment !== ".");
20276
- return segments.length === 0 ? pkg.path : (0, node_path.join)(pkg.path, ...segments.map(() => ".."));
20277
- };
20278
- /**
20279
21071
  * Ignore-aware override of `PublishabilityDetector`. `detect` short-circuits to `[]`
20280
21072
  * for changeset-ignored packages, then dispatches on `ChangesetConfig.mode`:
20281
21073
  * `none` → `[]`; `silk` → `SilkPublishability.detect`; `vanilla` → the library default.
20282
21074
  *
20283
21075
  * @remarks Requires `FileSystem` and {@link ChangesetConfig} at build.
20284
21076
  * The kit's `detect` contract no longer receives the workspace root, so the changeset
20285
- * lookups derive it per package from the package's own discovery coordinates
20286
- * (`pkg.path` ascended by `pkg.relativePath` — never a filesystem marker walk,
20287
- * which could escape an unmarked root and read the wrong `.changeset/config.json`).
21077
+ * lookups read it from `pkg.workspaceRoot` the discovery root the package was found
21078
+ * against, never a filesystem marker walk, which could escape an unmarked root and read
21079
+ * the wrong `.changeset/config.json`.
20288
21080
  *
20289
21081
  * @since 0.4.0
20290
21082
  * @public
@@ -20294,7 +21086,7 @@ const PublishabilityDetectorAdaptiveLive = effect.Layer.effect(PublishabilityDet
20294
21086
  const config = yield* ChangesetConfig;
20295
21087
  const vanilla = yield* effect.Effect.provide(PublishabilityDetector, PublishabilityDetector.layer);
20296
21088
  return { detect: (pkg) => effect.Effect.gen(function* () {
20297
- const root = packageRoot(pkg);
21089
+ const root = pkg.workspaceRoot;
20298
21090
  if (yield* config.isIgnored(pkg.name, root)) return [];
20299
21091
  const mode = yield* config.mode(root);
20300
21092
  if (mode === "none") return [];
@@ -21666,7 +22458,7 @@ function validateChangesetOptions(input) {
21666
22458
  })));
21667
22459
  }
21668
22460
  //#endregion
21669
- //#region ../../node_modules/.pnpm/@changesets+get-github-info@1.0.0-next.3/node_modules/@changesets/get-github-info/dist/index.mjs
22461
+ //#region ../../node_modules/.pnpm/@changesets+get-github-info@1.0.0-next.4/node_modules/@changesets/get-github-info/dist/index.mjs
21670
22462
  var import_dataloader = /* @__PURE__ */ __toESM((/* @__PURE__ */ __commonJSMin(((exports, module) => {
21671
22463
  /**
21672
22464
  * Copyright (c) 2019-present, GraphQL Foundation
@@ -23420,7 +24212,7 @@ function normalizeIdentifier(value) {
23420
24212
  return value.replace(/[\t\n\r ]+/g, " ").replace(/^ | $/g, "").toLowerCase().toUpperCase();
23421
24213
  }
23422
24214
  //#endregion
23423
- //#region ../../node_modules/.pnpm/mdast-util-gfm-footnote@2.1.0/node_modules/mdast-util-gfm-footnote/lib/index.js
24215
+ //#region ../../node_modules/.pnpm/mdast-util-gfm-footnote@2.1.0_supports-color@8.1.1/node_modules/mdast-util-gfm-footnote/lib/index.js
23424
24216
  /**
23425
24217
  * @import {
23426
24218
  * CompileContext,
@@ -23612,7 +24404,7 @@ function mapAll(line, index, blank) {
23612
24404
  return (blank ? "" : " ") + line;
23613
24405
  }
23614
24406
  //#endregion
23615
- //#region ../../node_modules/.pnpm/mdast-util-gfm-strikethrough@2.0.0/node_modules/mdast-util-gfm-strikethrough/lib/index.js
24407
+ //#region ../../node_modules/.pnpm/mdast-util-gfm-strikethrough@2.0.0_supports-color@8.1.1/node_modules/mdast-util-gfm-strikethrough/lib/index.js
23616
24408
  /**
23617
24409
  * @typedef {import('mdast').Delete} Delete
23618
24410
  *
@@ -28663,7 +29455,7 @@ function safeBound(value, config) {
28663
29455
  return safe(this, value, config);
28664
29456
  }
28665
29457
  //#endregion
28666
- //#region ../../node_modules/.pnpm/mdast-util-gfm-table@2.0.0/node_modules/mdast-util-gfm-table/lib/index.js
29458
+ //#region ../../node_modules/.pnpm/mdast-util-gfm-table@2.0.0_supports-color@8.1.1/node_modules/mdast-util-gfm-table/lib/index.js
28667
29459
  /**
28668
29460
  * @typedef {import('mdast').InlineCode} InlineCode
28669
29461
  * @typedef {import('mdast').Table} Table
@@ -28927,7 +29719,7 @@ function gfmTableToMarkdown(options) {
28927
29719
  }
28928
29720
  }
28929
29721
  //#endregion
28930
- //#region ../../node_modules/.pnpm/mdast-util-gfm-task-list-item@2.0.0/node_modules/mdast-util-gfm-task-list-item/lib/index.js
29722
+ //#region ../../node_modules/.pnpm/mdast-util-gfm-task-list-item@2.0.0_supports-color@8.1.1/node_modules/mdast-util-gfm-task-list-item/lib/index.js
28931
29723
  /**
28932
29724
  * @typedef {import('mdast').ListItem} ListItem
28933
29725
  * @typedef {import('mdast').Paragraph} Paragraph
@@ -29037,7 +29829,7 @@ function listItemWithTaskListItem(node, parent, state, info) {
29037
29829
  }
29038
29830
  }
29039
29831
  //#endregion
29040
- //#region ../../node_modules/.pnpm/mdast-util-gfm@3.1.0/node_modules/mdast-util-gfm/lib/index.js
29832
+ //#region ../../node_modules/.pnpm/mdast-util-gfm@3.1.0_supports-color@8.1.1/node_modules/mdast-util-gfm/lib/index.js
29041
29833
  /**
29042
29834
  * @import {Extension as FromMarkdownExtension} from 'mdast-util-from-markdown'
29043
29835
  * @import {Options} from 'mdast-util-gfm'
@@ -37121,7 +37913,7 @@ function gfm(options) {
37121
37913
  ]);
37122
37914
  }
37123
37915
  //#endregion
37124
- //#region ../../node_modules/.pnpm/remark-gfm@4.0.1/node_modules/remark-gfm/lib/index.js
37916
+ //#region ../../node_modules/.pnpm/remark-gfm@4.0.1_supports-color@8.1.1/node_modules/remark-gfm/lib/index.js
37125
37917
  /**
37126
37918
  * @import {Root} from 'mdast'
37127
37919
  * @import {Options} from 'remark-gfm'
@@ -37152,7 +37944,7 @@ function remarkGfm(options) {
37152
37944
  toMarkdownExtensions.push(gfmToMarkdown(settings));
37153
37945
  }
37154
37946
  //#endregion
37155
- //#region ../../node_modules/.pnpm/micromark@4.0.2/node_modules/micromark/lib/initialize/content.js
37947
+ //#region ../../node_modules/.pnpm/micromark@4.0.2_supports-color@8.1.1/node_modules/micromark/lib/initialize/content.js
37156
37948
  /**
37157
37949
  * @import {
37158
37950
  * InitialConstruct,
@@ -37219,7 +38011,7 @@ function initializeContent(effects) {
37219
38011
  }
37220
38012
  }
37221
38013
  //#endregion
37222
- //#region ../../node_modules/.pnpm/micromark@4.0.2/node_modules/micromark/lib/initialize/document.js
38014
+ //#region ../../node_modules/.pnpm/micromark@4.0.2_supports-color@8.1.1/node_modules/micromark/lib/initialize/document.js
37223
38015
  /**
37224
38016
  * @import {
37225
38017
  * Construct,
@@ -37435,7 +38227,7 @@ function tokenizeContainer(effects, ok, nok) {
37435
38227
  return factorySpace(effects, effects.attempt(this.parser.constructs.document, ok, nok), "linePrefix", this.parser.constructs.disable.null.includes("codeIndented") ? void 0 : 4);
37436
38228
  }
37437
38229
  //#endregion
37438
- //#region ../../node_modules/.pnpm/micromark@4.0.2/node_modules/micromark/lib/initialize/flow.js
38230
+ //#region ../../node_modules/.pnpm/micromark@4.0.2_supports-color@8.1.1/node_modules/micromark/lib/initialize/flow.js
37439
38231
  /**
37440
38232
  * @import {
37441
38233
  * InitialConstruct,
@@ -37482,7 +38274,7 @@ function initializeFlow(effects) {
37482
38274
  }
37483
38275
  }
37484
38276
  //#endregion
37485
- //#region ../../node_modules/.pnpm/micromark@4.0.2/node_modules/micromark/lib/initialize/text.js
38277
+ //#region ../../node_modules/.pnpm/micromark@4.0.2_supports-color@8.1.1/node_modules/micromark/lib/initialize/text.js
37486
38278
  /**
37487
38279
  * @import {
37488
38280
  * Code,
@@ -37659,7 +38451,7 @@ function resolveAllLineSuffixes(events, context) {
37659
38451
  return events;
37660
38452
  }
37661
38453
  //#endregion
37662
- //#region ../../node_modules/.pnpm/micromark@4.0.2/node_modules/micromark/lib/constructs.js
38454
+ //#region ../../node_modules/.pnpm/micromark@4.0.2_supports-color@8.1.1/node_modules/micromark/lib/constructs.js
37663
38455
  /**
37664
38456
  * @import {Extension} from 'micromark-util-types'
37665
38457
  */
@@ -37737,7 +38529,7 @@ const attentionMarkers = { null: [42, 95] };
37737
38529
  /** @satisfies {Extension['disable']} */
37738
38530
  const disable = { null: [] };
37739
38531
  //#endregion
37740
- //#region ../../node_modules/.pnpm/micromark@4.0.2/node_modules/micromark/lib/create-tokenizer.js
38532
+ //#region ../../node_modules/.pnpm/micromark@4.0.2_supports-color@8.1.1/node_modules/micromark/lib/create-tokenizer.js
37741
38533
  /**
37742
38534
  * @import {
37743
38535
  * Chunk,
@@ -38206,7 +38998,7 @@ function serializeChunks(chunks, expandTabs) {
38206
38998
  return result.join("");
38207
38999
  }
38208
39000
  //#endregion
38209
- //#region ../../node_modules/.pnpm/micromark@4.0.2/node_modules/micromark/lib/parse.js
39001
+ //#region ../../node_modules/.pnpm/micromark@4.0.2_supports-color@8.1.1/node_modules/micromark/lib/parse.js
38210
39002
  /**
38211
39003
  * @import {
38212
39004
  * Create,
@@ -38250,7 +39042,7 @@ function parse$1(options) {
38250
39042
  }
38251
39043
  }
38252
39044
  //#endregion
38253
- //#region ../../node_modules/.pnpm/micromark@4.0.2/node_modules/micromark/lib/postprocess.js
39045
+ //#region ../../node_modules/.pnpm/micromark@4.0.2_supports-color@8.1.1/node_modules/micromark/lib/postprocess.js
38254
39046
  /**
38255
39047
  * @import {Event} from 'micromark-util-types'
38256
39048
  */
@@ -38265,7 +39057,7 @@ function postprocess(events) {
38265
39057
  return events;
38266
39058
  }
38267
39059
  //#endregion
38268
- //#region ../../node_modules/.pnpm/micromark@4.0.2/node_modules/micromark/lib/preprocess.js
39060
+ //#region ../../node_modules/.pnpm/micromark@4.0.2_supports-color@8.1.1/node_modules/micromark/lib/preprocess.js
38269
39061
  /**
38270
39062
  * @import {Chunk, Code, Encoding, Value} from 'micromark-util-types'
38271
39063
  */
@@ -38430,7 +39222,7 @@ function index(value) {
38430
39222
  return value && typeof value === "number" ? value : 1;
38431
39223
  }
38432
39224
  //#endregion
38433
- //#region ../../node_modules/.pnpm/mdast-util-from-markdown@2.0.3/node_modules/mdast-util-from-markdown/lib/index.js
39225
+ //#region ../../node_modules/.pnpm/mdast-util-from-markdown@2.0.3_supports-color@8.1.1/node_modules/mdast-util-from-markdown/lib/index.js
38434
39226
  /**
38435
39227
  * @import {
38436
39228
  * Break,
@@ -39396,7 +40188,7 @@ function defaultOnError(left, right) {
39396
40188
  }) + ") is still open");
39397
40189
  }
39398
40190
  //#endregion
39399
- //#region ../../node_modules/.pnpm/remark-parse@11.0.0/node_modules/remark-parse/lib/index.js
40191
+ //#region ../../node_modules/.pnpm/remark-parse@11.0.0_supports-color@8.1.1/node_modules/remark-parse/lib/index.js
39400
40192
  /**
39401
40193
  * @typedef {import('mdast').Root} Root
39402
40194
  * @typedef {import('mdast-util-from-markdown').Options} FromMarkdownOptions
@@ -44867,25 +45659,15 @@ function normalizeLegacyOptions(options, configPath) {
44867
45659
  };
44868
45660
  }
44869
45661
  /** Match dotfiles, mirroring the former tinyglobby `dot: true` behavior. */
44870
- const GLOB_OPTIONS = GlobPatternOptions.make({ dot: true });
45662
+ const GLOB_OPTIONS$1 = GlobPatternOptions.make({ dot: true });
44871
45663
  /**
44872
- * Compile `glob` via `@effected/glob`, folding a compile-guard trip
44873
- * (over-length pattern, brace-expansion budget, nesting depth) into a
44874
- * {@link ConfigurationError} naming the offending glob on the typed channel.
44875
- */
44876
- function compileGlob(glob) {
44877
- return GlobPattern.compile(glob, GLOB_OPTIONS).pipe(effect.Effect.mapError((error) => new ConfigurationError({
44878
- field: "glob",
44879
- reason: `Invalid glob pattern ${JSON.stringify(glob)}: ${error.message}`
44880
- })));
44881
- }
44882
45664
  /**
44883
45665
  * Pure attribution helper: does `glob` (under this service's `dot: true`
44884
45666
  * semantics) match the repo-relative POSIX path `rel`? An uncompilable
44885
45667
  * pattern matches nothing.
44886
45668
  */
44887
45669
  function globMatchesRel(glob, rel) {
44888
- const result = effect.Effect.runSync(effect.Effect.result(GlobPattern.compile(glob, GLOB_OPTIONS)));
45670
+ const result = GlobPattern.compileResult(glob, GLOB_OPTIONS$1);
44889
45671
  return effect.Result.isSuccess(result) && result.success.matches(rel);
44890
45672
  }
44891
45673
  /**
@@ -44901,13 +45683,14 @@ function globMatchesRel(glob, rel) {
44901
45683
  * module already speaks POSIX-relative match paths).
44902
45684
  */
44903
45685
  function materializeGlob(glob, cwd) {
44904
- return compileGlob(glob).pipe(effect.Effect.flatMap((pattern) => descend(pattern, {
45686
+ return compileAndExpand(glob, {
44905
45687
  cwd,
44906
- onUnreadable: "skip"
45688
+ onUnreadable: "skip",
45689
+ glob: GLOB_OPTIONS$1
44907
45690
  }).pipe(effect.Effect.mapError((error) => new ConfigurationError({
44908
45691
  field: "glob",
44909
- reason: `Failed to materialize glob ${JSON.stringify(glob)}: ${error.message}`
44910
- })), effect.Effect.provide(effect.Path.layer))));
45692
+ reason: error.stage === "compile" ? `Invalid glob pattern ${JSON.stringify(glob)}: ${error.cause.message}` : `Failed to materialize glob ${JSON.stringify(glob)}: ${error.cause.message}`
45693
+ })), effect.Effect.provide(effect.Path.layer));
44911
45694
  }
44912
45695
  /**
44913
45696
  * Determine whether `child` is the same directory as `parent` or sits inside
@@ -46609,19 +47392,29 @@ var VersionFiles = class VersionFiles {
46609
47392
  }
46610
47393
  };
46611
47394
  /**
47395
+ * Match dotfiles, matching `ConfigInspector`'s glob dialect.
47396
+ *
47397
+ * @remarks
47398
+ * This module previously compiled with minimatch DEFAULTS while
47399
+ * `ConfigInspector` compiled with `dot: true`, so a wildcard segment matching
47400
+ * a dotted directory was attributed to a package but never materialized (or
47401
+ * the reverse). The two paths must agree: attribution and materialization
47402
+ * answer the same question about the same glob.
47403
+ */
47404
+ const GLOB_OPTIONS = GlobPatternOptions.make({ dot: true });
47405
+ /**
46612
47406
  * Expand a glob pattern against the filesystem, returning matching FILE paths
46613
47407
  * relative to `cwd` (POSIX separators), sorted by relative path.
46614
47408
  *
46615
47409
  * @remarks
46616
- * The walk is `@effected/walker`'s `descend` (literal fast path,
47410
+ * The walk is `@effected/walker`'s `compileAndExpand` (literal fast path,
46617
47411
  * `enumerationPrefix` bounding, `node_modules`/`.git` pruning), with
46618
47412
  * `onUnreadable: "skip"` preserving this module's silent-skip policy for
46619
- * unreadable directories. Matching semantics are minimatch DEFAULTS via the
46620
- * compiled pattern notably, wildcards do not match dotfiles, same as the
46621
- * previous `tinyglobby` defaults. An uncompilable pattern expands to no
46622
- * matches. `descend`'s `Path` requirement is satisfied internally with the
46623
- * core POSIX `Path.layer` this module already speaks POSIX relative match
46624
- * paths and node-bound absolute paths throughout.
47413
+ * unreadable directories. Matching semantics are {@link GLOB_OPTIONS}
47414
+ * wildcards DO match dotfiles, aligning this module with `ConfigInspector`. An
47415
+ * uncompilable pattern expands to no matches. The `Path` requirement is
47416
+ * satisfied internally with the core POSIX `Path.layer` this module already
47417
+ * speaks POSIX relative match paths and node-bound absolute paths throughout.
46625
47418
  *
46626
47419
  * @param source - The glob pattern, repo-relative
46627
47420
  * @param cwd - Absolute directory the pattern is resolved against
@@ -46630,13 +47423,11 @@ var VersionFiles = class VersionFiles {
46630
47423
  * @internal
46631
47424
  */
46632
47425
  function expandGlob(source, cwd) {
46633
- return effect.Effect.option(GlobPattern.compile(source)).pipe(effect.Effect.flatMap(effect.Option.match({
46634
- onNone: () => effect.Effect.succeed([]),
46635
- onSome: (pattern) => descend(pattern, {
46636
- cwd,
46637
- onUnreadable: "skip"
46638
- })
46639
- })), effect.Effect.provide(effect.Path.layer));
47426
+ return compileAndExpand(source, {
47427
+ cwd,
47428
+ onUnreadable: "skip",
47429
+ glob: GLOB_OPTIONS
47430
+ }).pipe(effect.Effect.catch((error) => error.stage === "compile" ? effect.Effect.succeed([]) : effect.Effect.fail(error)), effect.Effect.provide(effect.Path.layer));
46640
47431
  }
46641
47432
  /**
46642
47433
  * Read the `version` field from a `package.json` in the given directory.
@@ -57677,7 +58468,7 @@ function validatePackages(packages) {
57677
58468
  }
57678
58469
  }
57679
58470
  //#endregion
57680
- //#region ../../node_modules/.pnpm/@changesets+get-dependents-graph@3.0.0-next.6/node_modules/@changesets/get-dependents-graph/dist/index.mjs
58471
+ //#region ../../node_modules/.pnpm/@changesets+get-dependents-graph@3.0.0-next.7/node_modules/@changesets/get-dependents-graph/dist/index.mjs
57681
58472
  var src_default = new Proxy({}, { get(target, color) {
57682
58473
  target[color] ??= (text) => (0, node_util.styleText)(color, text);
57683
58474
  return target[color];
@@ -57797,14 +58588,14 @@ function getDependentsGraph(packages, opts) {
57797
58588
  return simplifiedDependentsGraph;
57798
58589
  }
57799
58590
  //#endregion
57800
- //#region ../../node_modules/.pnpm/@changesets+should-skip-package@1.0.0-next.6/node_modules/@changesets/should-skip-package/dist/index.mjs
58591
+ //#region ../../node_modules/.pnpm/@changesets+should-skip-package@1.0.0-next.7/node_modules/@changesets/should-skip-package/dist/index.mjs
57801
58592
  function shouldSkipPackage({ packageJson }, { ignore, allowPrivatePackages }) {
57802
58593
  if (ignore.includes(packageJson.name)) return true;
57803
58594
  if (packageJson.private && !allowPrivatePackages) return true;
57804
58595
  return !packageJson.version;
57805
58596
  }
57806
58597
  //#endregion
57807
- //#region ../../node_modules/.pnpm/@changesets+config@4.0.0-next.6/node_modules/@changesets/config/dist/index.mjs
58598
+ //#region ../../node_modules/.pnpm/@changesets+config@4.0.0-next.7/node_modules/@changesets/config/dist/index.mjs
57808
58599
  const DEFAULT_CONFIG = {
57809
58600
  lang: void 0,
57810
58601
  message: void 0,
@@ -58716,7 +59507,7 @@ async function readConfig(cwd, packages) {
58716
59507
  packages ??= await getPackages(cwd);
58717
59508
  return validateConfig(JSON.parse(await node_fs_promises.readFile(node_path.join(packages.rootDir, ".changeset", "config.json"), "utf8")), packages);
58718
59509
  }
58719
- var version = "4.0.0-next.6";
59510
+ var version = "4.0.0-next.7";
58720
59511
  const defaultConfig = normalizeWrittenConfig({
58721
59512
  packageNames: [],
58722
59513
  writtenConfig: parse(WrittenConfigSchema, {
@@ -59439,228 +60230,6 @@ function isMetadataYarnClassic(metadataPath) {
59439
60230
  return metadataPath.endsWith(".yarn_integrity");
59440
60231
  }
59441
60232
  //#endregion
59442
- //#region ../../node_modules/.pnpm/@changesets+format@0.1.0/node_modules/@changesets/format/dist/index.js
59443
- /**
59444
- * Traverse upwards from `startDir` to `stopDir` (inclusive), calling `cb` in each directory. If
59445
- * `cb` returns a non-null value, it'll stop and return that value.
59446
- */
59447
- function traverseUpwards(startDir, stopDir, cb) {
59448
- let dir = startDir;
59449
- while (dir) {
59450
- const result = cb(dir);
59451
- if (result !== void 0) return result;
59452
- if (dir === stopDir) break;
59453
- const nextDir = node_path.dirname(dir);
59454
- if (nextDir === dir) break;
59455
- dir = nextDir;
59456
- }
59457
- }
59458
- async function packageManagerExecute(packageManager, args, cwd) {
59459
- const cmd = resolveCommand(packageManager, "execute-local", args) ?? {
59460
- command: "npx",
59461
- args
59462
- };
59463
- return await spawnProcess(cmd.command, cmd.args, cwd);
59464
- }
59465
- async function spawnProcess(command, args, cwd) {
59466
- return new Promise((resolve, reject) => {
59467
- const child = node_child_process.spawn(command, args, { cwd });
59468
- let stderr = "";
59469
- child.stderr.on("data", (data) => {
59470
- stderr += data.toString();
59471
- });
59472
- child.on("exit", (code) => {
59473
- if (code === 0) resolve();
59474
- else reject(/* @__PURE__ */ new Error(`${command} exited with code ${code}. Stderr:\n${stderr}`));
59475
- });
59476
- child.on("error", (err) => {
59477
- reject(err);
59478
- });
59479
- });
59480
- }
59481
- const formatters = {
59482
- prettier: {
59483
- name: "prettier",
59484
- packageName: "prettier",
59485
- configFiles: [
59486
- ".prettierrc",
59487
- ".prettierrc.json",
59488
- ".prettierrc.yml",
59489
- ".prettierrc.yaml",
59490
- ".prettierrc.json5",
59491
- ".prettierrc.js",
59492
- "prettier.config.js",
59493
- ".prettierrc.ts",
59494
- "prettier.config.ts",
59495
- ".prettierrc.mjs",
59496
- "prettier.config.mjs",
59497
- ".prettierrc.mts",
59498
- "prettier.config.mts",
59499
- ".prettierrc.cjs",
59500
- "prettier.config.cjs",
59501
- ".prettierrc.cts",
59502
- "prettier.config.cts",
59503
- ".prettierrc.toml",
59504
- {
59505
- file: "package.json",
59506
- key: "prettier"
59507
- }
59508
- ],
59509
- async format(files, ctx) {
59510
- await packageManagerExecute(await ctx.getPackageManager(), [
59511
- "prettier",
59512
- "--write",
59513
- ...files
59514
- ], ctx.cwd);
59515
- }
59516
- },
59517
- biome: {
59518
- name: "biome",
59519
- packageName: "@biomejs/biome",
59520
- configFiles: [
59521
- "biome.json",
59522
- "biome.jsonc",
59523
- ".biome.json",
59524
- ".biome.jsonc"
59525
- ],
59526
- async format(files, ctx) {
59527
- await packageManagerExecute(await ctx.getPackageManager(), [
59528
- "@biomejs/biome",
59529
- "format",
59530
- "--write",
59531
- ...files
59532
- ], ctx.cwd);
59533
- }
59534
- },
59535
- oxfmt: {
59536
- name: "oxfmt",
59537
- packageName: "oxfmt",
59538
- configFiles: [
59539
- ".oxfmtrc.json",
59540
- ".oxfmtrc.jsonc",
59541
- "oxfmt.config.ts"
59542
- ],
59543
- async format(files, ctx) {
59544
- await packageManagerExecute(await ctx.getPackageManager(), [
59545
- "oxfmt",
59546
- "--write",
59547
- ...files
59548
- ], ctx.cwd);
59549
- }
59550
- },
59551
- deno: {
59552
- name: "deno",
59553
- configFiles: [
59554
- "deno.json",
59555
- "deno.jsonc",
59556
- {
59557
- file: "deno.json",
59558
- key: "fmt"
59559
- }
59560
- ],
59561
- async format(files, ctx) {
59562
- await spawnProcess("deno", ["fmt", ...files], ctx.cwd);
59563
- }
59564
- },
59565
- dprint: {
59566
- name: "dprint",
59567
- packageName: "dprint",
59568
- configFiles: [
59569
- "dprint.json",
59570
- "dprint.jsonc",
59571
- ".dprint.json",
59572
- ".dprint.jsonc"
59573
- ],
59574
- async format(files, ctx) {
59575
- await packageManagerExecute(await ctx.getPackageManager(), [
59576
- "dprint",
59577
- "fmt",
59578
- ...files
59579
- ], ctx.cwd);
59580
- }
59581
- }
59582
- };
59583
- const defaultDetectOrder = Object.freeze([
59584
- "dprint",
59585
- "deno",
59586
- "oxfmt",
59587
- "biome",
59588
- "prettier"
59589
- ]);
59590
- /**
59591
- * Detect the preferred formatter used in the project.
59592
- */
59593
- async function detect(options = {}) {
59594
- const cwd = options.cwd ? node_path.resolve(options.cwd) : process.cwd();
59595
- const stopDir = options.stopDir ? node_path.resolve(cwd, options.stopDir) : void 0;
59596
- const order = options.order ?? defaultDetectOrder;
59597
- let found = traverseUpwards(cwd, stopDir, (dir) => {
59598
- for (const formatterName of order) {
59599
- const formatter = formatters[formatterName];
59600
- for (const configFile of formatter.configFiles) if (typeof configFile === "string") {
59601
- const configFilePath = node_path.join(dir, configFile);
59602
- if (node_fs.existsSync(configFilePath)) return formatter.name;
59603
- } else if (checkConfigFileWithKeyExists(node_path.join(dir, configFile.file), configFile.key)) return formatter.name;
59604
- }
59605
- });
59606
- found ??= traverseUpwards(cwd, stopDir, (dir) => {
59607
- for (const formatterName of order) {
59608
- const formatter = formatters[formatterName];
59609
- if (formatter.packageName) {
59610
- const packagePath = node_path.join(dir, "node_modules", formatter.packageName);
59611
- if (node_fs.existsSync(packagePath)) return formatter.name;
59612
- }
59613
- }
59614
- });
59615
- return found;
59616
- }
59617
- function checkConfigFileWithKeyExists(configFile, key) {
59618
- try {
59619
- const content = node_fs.readFileSync(configFile, "utf-8");
59620
- return key in JSON.parse(content);
59621
- } catch {
59622
- return false;
59623
- }
59624
- }
59625
- /**
59626
- * Format the given patterns with a specified or auto-detected formatter. It returns `true` if a
59627
- * formatter is found and the formatting process passes, otherwise returns `false`.
59628
- */
59629
- async function format$1(patterns, options = {}) {
59630
- const formatterName = options.formatter ?? await detect({
59631
- cwd: options.cwd,
59632
- stopDir: options.stopDir
59633
- });
59634
- if (!formatterName) return false;
59635
- const formatter = formatters[formatterName];
59636
- const ctx = {
59637
- cwd: options.cwd ? node_path.resolve(options.cwd) : process.cwd(),
59638
- async getPackageManager() {
59639
- if (options.packageManager) return options.packageManager;
59640
- return (await detect$1({
59641
- cwd: options.cwd,
59642
- stopDir: options.stopDir
59643
- }))?.agent ?? "npm";
59644
- }
59645
- };
59646
- await formatter.format(patterns, ctx);
59647
- return true;
59648
- }
59649
- //#endregion
59650
- //#region ../../node_modules/.pnpm/@changesets+errors@1.0.0-next.3/node_modules/@changesets/errors/dist/index.mjs
59651
- var GitError = class extends Error {
59652
- code;
59653
- constructor(code, message) {
59654
- super(`${message}, exit code: ${code}`);
59655
- this.code = code;
59656
- }
59657
- };
59658
- var InternalError = class extends Error {
59659
- constructor(message) {
59660
- super(message);
59661
- }
59662
- };
59663
- //#endregion
59664
60233
  //#region ../../node_modules/.pnpm/tinyexec@1.2.4/node_modules/tinyexec/dist/main.mjs
59665
60234
  const h = /^path$/i;
59666
60235
  const g = {
@@ -59987,7 +60556,219 @@ const R = (e, t, n) => {
59987
60556
  };
59988
60557
  const z = R;
59989
60558
  //#endregion
59990
- //#region ../../node_modules/.pnpm/@changesets+git@4.0.0-next.6/node_modules/@changesets/git/dist/index.mjs
60559
+ //#region ../../node_modules/.pnpm/@changesets+format@0.1.1/node_modules/@changesets/format/dist/index.js
60560
+ /**
60561
+ * Traverse upwards from `startDir` to `stopDir` (inclusive), calling `cb` in each directory. If
60562
+ * `cb` returns a non-null value, it'll stop and return that value.
60563
+ */
60564
+ function traverseUpwards(startDir, stopDir, cb) {
60565
+ let dir = startDir;
60566
+ while (dir) {
60567
+ const result = cb(dir);
60568
+ if (result !== void 0) return result;
60569
+ if (dir === stopDir) break;
60570
+ const nextDir = node_path.dirname(dir);
60571
+ if (nextDir === dir) break;
60572
+ dir = nextDir;
60573
+ }
60574
+ }
60575
+ async function packageManagerExecute(packageManager, args, cwd) {
60576
+ const cmd = resolveCommand(packageManager, "execute-local", args) ?? {
60577
+ command: "npx",
60578
+ args
60579
+ };
60580
+ return await spawnProcess(cmd.command, cmd.args, cwd);
60581
+ }
60582
+ async function spawnProcess(command, args, cwd) {
60583
+ await z(command, args, {
60584
+ nodeOptions: { cwd },
60585
+ throwOnError: true
60586
+ });
60587
+ }
60588
+ const formatters = {
60589
+ prettier: {
60590
+ name: "prettier",
60591
+ packageName: "prettier",
60592
+ configFiles: [
60593
+ ".prettierrc",
60594
+ ".prettierrc.json",
60595
+ ".prettierrc.yml",
60596
+ ".prettierrc.yaml",
60597
+ ".prettierrc.json5",
60598
+ ".prettierrc.js",
60599
+ "prettier.config.js",
60600
+ ".prettierrc.ts",
60601
+ "prettier.config.ts",
60602
+ ".prettierrc.mjs",
60603
+ "prettier.config.mjs",
60604
+ ".prettierrc.mts",
60605
+ "prettier.config.mts",
60606
+ ".prettierrc.cjs",
60607
+ "prettier.config.cjs",
60608
+ ".prettierrc.cts",
60609
+ "prettier.config.cts",
60610
+ ".prettierrc.toml",
60611
+ {
60612
+ file: "package.json",
60613
+ key: "prettier"
60614
+ }
60615
+ ],
60616
+ async format(files, ctx) {
60617
+ await packageManagerExecute(await ctx.getPackageManager(), [
60618
+ "prettier",
60619
+ "--write",
60620
+ ...files
60621
+ ], ctx.cwd);
60622
+ }
60623
+ },
60624
+ biome: {
60625
+ name: "biome",
60626
+ packageName: "@biomejs/biome",
60627
+ configFiles: [
60628
+ "biome.json",
60629
+ "biome.jsonc",
60630
+ ".biome.json",
60631
+ ".biome.jsonc"
60632
+ ],
60633
+ async format(files, ctx) {
60634
+ await packageManagerExecute(await ctx.getPackageManager(), [
60635
+ "@biomejs/biome",
60636
+ "format",
60637
+ "--write",
60638
+ ...files
60639
+ ], ctx.cwd);
60640
+ }
60641
+ },
60642
+ oxfmt: {
60643
+ name: "oxfmt",
60644
+ packageName: "oxfmt",
60645
+ configFiles: [
60646
+ ".oxfmtrc.json",
60647
+ ".oxfmtrc.jsonc",
60648
+ "oxfmt.config.ts"
60649
+ ],
60650
+ async format(files, ctx) {
60651
+ await packageManagerExecute(await ctx.getPackageManager(), [
60652
+ "oxfmt",
60653
+ "--write",
60654
+ ...files
60655
+ ], ctx.cwd);
60656
+ }
60657
+ },
60658
+ deno: {
60659
+ name: "deno",
60660
+ configFiles: [
60661
+ "deno.json",
60662
+ "deno.jsonc",
60663
+ {
60664
+ file: "deno.json",
60665
+ key: "fmt"
60666
+ }
60667
+ ],
60668
+ async format(files, ctx) {
60669
+ await spawnProcess("deno", ["fmt", ...files], ctx.cwd);
60670
+ }
60671
+ },
60672
+ dprint: {
60673
+ name: "dprint",
60674
+ packageName: "dprint",
60675
+ configFiles: [
60676
+ "dprint.json",
60677
+ "dprint.jsonc",
60678
+ ".dprint.json",
60679
+ ".dprint.jsonc"
60680
+ ],
60681
+ async format(files, ctx) {
60682
+ await packageManagerExecute(await ctx.getPackageManager(), [
60683
+ "dprint",
60684
+ "fmt",
60685
+ ...files
60686
+ ], ctx.cwd);
60687
+ }
60688
+ }
60689
+ };
60690
+ const defaultDetectOrder = Object.freeze([
60691
+ "dprint",
60692
+ "deno",
60693
+ "oxfmt",
60694
+ "biome",
60695
+ "prettier"
60696
+ ]);
60697
+ /**
60698
+ * Detect the preferred formatter used in the project.
60699
+ */
60700
+ async function detect(options = {}) {
60701
+ const cwd = options.cwd ? node_path.resolve(options.cwd) : process.cwd();
60702
+ const stopDir = options.stopDir ? node_path.resolve(cwd, options.stopDir) : void 0;
60703
+ const order = options.order ?? defaultDetectOrder;
60704
+ let found = traverseUpwards(cwd, stopDir, (dir) => {
60705
+ for (const formatterName of order) {
60706
+ const formatter = formatters[formatterName];
60707
+ for (const configFile of formatter.configFiles) if (typeof configFile === "string") {
60708
+ const configFilePath = node_path.join(dir, configFile);
60709
+ if (node_fs.existsSync(configFilePath)) return formatter.name;
60710
+ } else if (checkConfigFileWithKeyExists(node_path.join(dir, configFile.file), configFile.key)) return formatter.name;
60711
+ }
60712
+ });
60713
+ found ??= traverseUpwards(cwd, stopDir, (dir) => {
60714
+ for (const formatterName of order) {
60715
+ const formatter = formatters[formatterName];
60716
+ if (formatter.packageName) {
60717
+ const packagePath = node_path.join(dir, "node_modules", formatter.packageName);
60718
+ if (node_fs.existsSync(packagePath)) return formatter.name;
60719
+ }
60720
+ }
60721
+ });
60722
+ return found;
60723
+ }
60724
+ function checkConfigFileWithKeyExists(configFile, key) {
60725
+ try {
60726
+ const content = node_fs.readFileSync(configFile, "utf-8");
60727
+ return key in JSON.parse(content);
60728
+ } catch {
60729
+ return false;
60730
+ }
60731
+ }
60732
+ /**
60733
+ * Format the given patterns with a specified or auto-detected formatter. It returns `true` if a
60734
+ * formatter is found and the formatting process passes, otherwise returns `false`.
60735
+ */
60736
+ async function format$1(patterns, options = {}) {
60737
+ const formatterName = options.formatter ?? await detect({
60738
+ cwd: options.cwd,
60739
+ stopDir: options.stopDir
60740
+ });
60741
+ if (!formatterName) return false;
60742
+ const formatter = formatters[formatterName];
60743
+ const ctx = {
60744
+ cwd: options.cwd ? node_path.resolve(options.cwd) : process.cwd(),
60745
+ async getPackageManager() {
60746
+ if (options.packageManager) return options.packageManager;
60747
+ return (await detect$1({
60748
+ cwd: options.cwd,
60749
+ stopDir: options.stopDir
60750
+ }))?.agent ?? "npm";
60751
+ }
60752
+ };
60753
+ await formatter.format(patterns, ctx);
60754
+ return true;
60755
+ }
60756
+ //#endregion
60757
+ //#region ../../node_modules/.pnpm/@changesets+errors@1.0.0-next.4/node_modules/@changesets/errors/dist/index.mjs
60758
+ var GitError = class extends Error {
60759
+ code;
60760
+ constructor(code, message) {
60761
+ super(`${message}, exit code: ${code}`);
60762
+ this.code = code;
60763
+ }
60764
+ };
60765
+ var InternalError = class extends Error {
60766
+ constructor(message) {
60767
+ super(message);
60768
+ }
60769
+ };
60770
+ //#endregion
60771
+ //#region ../../node_modules/.pnpm/@changesets+git@4.0.0-next.7/node_modules/@changesets/git/dist/index.mjs
59991
60772
  async function getDivergedCommit(cwd, ref) {
59992
60773
  const cmd = await z("git", [
59993
60774
  "merge-base",
@@ -62134,7 +62915,7 @@ function applyEdits(text, edits) {
62134
62915
  return text;
62135
62916
  }
62136
62917
  //#endregion
62137
- //#region ../../node_modules/.pnpm/@changesets+apply-release-plan@8.0.0-next.7/node_modules/@changesets/apply-release-plan/dist/index.mjs
62918
+ //#region ../../node_modules/.pnpm/@changesets+apply-release-plan@8.0.0-next.8/node_modules/@changesets/apply-release-plan/dist/index.mjs
62138
62919
  /**
62139
62920
  * A simple JSON editing utility that preserves formatting. They specified operation keys
62140
62921
  * must exist in the JSON for this implementation.
@@ -62275,13 +63056,8 @@ const DEPENDENCY_TYPES = [
62275
63056
  "peerDependencies",
62276
63057
  "optionalDependencies"
62277
63058
  ];
62278
- function versionPackage(release, versionsToUpdate, { cwd, updateInternalDependencies, onlyUpdatePeerDependentsWhenOutOfRange, bumpVersionsWithWorkspaceProtocolOnly, snapshot }) {
63059
+ function getDependencyVersionEdits(packageJson, versionsToUpdate, { cwd, updateInternalDependencies, onlyUpdatePeerDependentsWhenOutOfRange, bumpVersionsWithWorkspaceProtocolOnly, snapshot }) {
62279
63060
  const pkgJsonEdits = [];
62280
- const { newVersion, packageJson } = release;
62281
- pkgJsonEdits.push({
62282
- keys: ["version"],
62283
- value: newVersion
62284
- });
62285
63061
  for (const depType of DEPENDENCY_TYPES) {
62286
63062
  const deps = packageJson[depType];
62287
63063
  if (deps) for (const { name, version, oldVersion, type, dir } of versionsToUpdate) {
@@ -62315,10 +63091,7 @@ function versionPackage(release, versionsToUpdate, { cwd, updateInternalDependen
62315
63091
  }
62316
63092
  }
62317
63093
  }
62318
- return {
62319
- ...release,
62320
- pkgJsonEdits
62321
- };
63094
+ return pkgJsonEdits;
62322
63095
  }
62323
63096
  function getVersionRangeType(versionRange) {
62324
63097
  if (versionRange.charAt(0) === "^") return "^";
@@ -62348,6 +63121,13 @@ async function getFormatter(config, cwd) {
62348
63121
  });
62349
63122
  };
62350
63123
  }
63124
+ async function updatePackageJson(dir, edits) {
63125
+ if (edits.length === 0) return;
63126
+ const pkgJsonPath = node_path.resolve(dir, "package.json");
63127
+ const pkgUpdated = editJson(await node_fs_promises.readFile(pkgJsonPath, "utf8"), edits);
63128
+ await node_fs_promises.writeFile(pkgJsonPath, pkgUpdated);
63129
+ return pkgJsonPath;
63130
+ }
62351
63131
  async function applyReleasePlan(releasePlan, packages, config = defaultConfig, snapshot, contextDir = __dirname) {
62352
63132
  const cwd = packages.rootDir;
62353
63133
  const touchedFiles = [];
@@ -62376,22 +63156,21 @@ async function applyReleasePlan(releasePlan, packages, config = defaultConfig, s
62376
63156
  type,
62377
63157
  dir: packagesByName.get(name).dir
62378
63158
  }));
62379
- const finalisedRelease = releaseWithChangelogs.map((release) => {
62380
- return versionPackage(release, versionsToUpdate, {
62381
- cwd,
62382
- updateInternalDependencies: config.updateInternalDependencies,
62383
- onlyUpdatePeerDependentsWhenOutOfRange: config.___experimentalUnsafeOptions_WILL_CHANGE_IN_PATCH.onlyUpdatePeerDependentsWhenOutOfRange,
62384
- bumpVersionsWithWorkspaceProtocolOnly: config.bumpVersionsWithWorkspaceProtocolOnly,
62385
- snapshot
62386
- });
62387
- });
63159
+ const dependencyUpdateOptions = {
63160
+ cwd,
63161
+ updateInternalDependencies: config.updateInternalDependencies,
63162
+ onlyUpdatePeerDependentsWhenOutOfRange: config.___experimentalUnsafeOptions_WILL_CHANGE_IN_PATCH.onlyUpdatePeerDependentsWhenOutOfRange,
63163
+ bumpVersionsWithWorkspaceProtocolOnly: config.bumpVersionsWithWorkspaceProtocolOnly,
63164
+ snapshot
63165
+ };
62388
63166
  const filesToFormat = [];
62389
- for (const release of finalisedRelease) {
62390
- const { changelog, pkgJsonEdits, dir, name } = release;
62391
- const pkgJsonPath = node_path.resolve(dir, "package.json");
62392
- const pkgUpdated = editJson(await node_fs_promises.readFile(pkgJsonPath, "utf8"), pkgJsonEdits);
62393
- await node_fs_promises.writeFile(pkgJsonPath, pkgUpdated);
62394
- touchedFiles.push(pkgJsonPath);
63167
+ for (const release of releaseWithChangelogs) {
63168
+ const { changelog, dir, name, newVersion, packageJson } = release;
63169
+ const pkgJsonPath = await updatePackageJson(dir, [{
63170
+ keys: ["version"],
63171
+ value: newVersion
63172
+ }, ...getDependencyVersionEdits(packageJson, versionsToUpdate, dependencyUpdateOptions)]);
63173
+ if (pkgJsonPath) touchedFiles.push(pkgJsonPath);
62395
63174
  if (changelog && changelog.length > 0) {
62396
63175
  const changelogPath = node_path.resolve(dir, "CHANGELOG.md");
62397
63176
  await updateChangelog(changelogPath, changelog, name);
@@ -62399,6 +63178,11 @@ async function applyReleasePlan(releasePlan, packages, config = defaultConfig, s
62399
63178
  filesToFormat.push(changelogPath);
62400
63179
  }
62401
63180
  }
63181
+ if (packages.rootPackage) {
63182
+ const pkgJsonEdits = getDependencyVersionEdits(packages.rootPackage.packageJson, versionsToUpdate, dependencyUpdateOptions);
63183
+ const pkgJsonPath = await updatePackageJson(packages.rootPackage.dir, pkgJsonEdits);
63184
+ if (pkgJsonPath) touchedFiles.push(pkgJsonPath);
63185
+ }
62402
63186
  if (filesToFormat.length > 0) await (await getFormatter(config.format, cwd))(filesToFormat);
62403
63187
  if (releasePlan.preState == null || releasePlan.preState.mode === "exit") {
62404
63188
  const changesetFolder = node_path.resolve(cwd, ".changeset");
@@ -62489,7 +63273,7 @@ async function updateChangelog(changelogPath, changelog, name) {
62489
63273
  await node_fs_promises.writeFile(changelogPath, newChangelog);
62490
63274
  }
62491
63275
  //#endregion
62492
- //#region ../../node_modules/.pnpm/@changesets+assemble-release-plan@7.0.0-next.7/node_modules/@changesets/assemble-release-plan/dist/index.mjs
63276
+ //#region ../../node_modules/.pnpm/@changesets+assemble-release-plan@7.0.0-next.8/node_modules/@changesets/assemble-release-plan/dist/index.mjs
62493
63277
  function getHighestReleaseType(releases) {
62494
63278
  if (releases.length === 0) throw new Error(`Large internal Changesets error when calculating highest release type in the set of releases. Please contact the maintainers`);
62495
63279
  let highestReleaseType = "none";
@@ -62835,7 +63619,7 @@ function getPreInfo(changesets, packagesByName, config, preState) {
62835
63619
  };
62836
63620
  }
62837
63621
  //#endregion
62838
- //#region ../../node_modules/.pnpm/@changesets+pre@3.0.0-next.6/node_modules/@changesets/pre/dist/index.mjs
63622
+ //#region ../../node_modules/.pnpm/@changesets+pre@3.0.0-next.7/node_modules/@changesets/pre/dist/index.mjs
62839
63623
  async function outputFile(filePath, content) {
62840
63624
  await node_fs_promises.mkdir(node_path.dirname(filePath), { recursive: true });
62841
63625
  await node_fs_promises.writeFile(filePath, content, "utf8");
@@ -62864,7 +63648,7 @@ async function migratePreState(rootDir, preState) {
62864
63648
  return preState;
62865
63649
  }
62866
63650
  //#endregion
62867
- //#region ../../node_modules/.pnpm/@changesets+parse@1.0.0-next.7/node_modules/@changesets/parse/dist/index.mjs
63651
+ //#region ../../node_modules/.pnpm/@changesets+parse@1.0.0-next.8/node_modules/@changesets/parse/dist/index.mjs
62868
63652
  const mdRegex = /\s*---([^]*?)\r?\n\s*---(\s*(?:\n|$)[^]*)/;
62869
63653
  const EXAMPLE_FORMAT = `---\n"package-name": patch\n---`;
62870
63654
  const validVersionTypes = [
@@ -62917,7 +63701,7 @@ YAML error: ${e instanceof Error ? e.message : String(e)}\nFrontmatter content:\
62917
63701
  };
62918
63702
  }
62919
63703
  //#endregion
62920
- //#region ../../node_modules/.pnpm/@changesets+read@1.0.0-next.7/node_modules/@changesets/read/dist/index.mjs
63704
+ //#region ../../node_modules/.pnpm/@changesets+read@1.0.0-next.8/node_modules/@changesets/read/dist/index.mjs
62921
63705
  const ignoredMdFiles = [
62922
63706
  /^README\.md$/i,
62923
63707
  "AGENTS.md",
@@ -62950,7 +63734,7 @@ async function readChangesets(rootDir, sinceRef) {
62950
63734
  return await Promise.all(changesetContents);
62951
63735
  }
62952
63736
  //#endregion
62953
- //#region ../../node_modules/.pnpm/@changesets+get-release-plan@5.0.0-next.7/node_modules/@changesets/get-release-plan/dist/index.mjs
63737
+ //#region ../../node_modules/.pnpm/@changesets+get-release-plan@5.0.0-next.8/node_modules/@changesets/get-release-plan/dist/index.mjs
62954
63738
  async function getReleasePlan(cwd, sinceRef, passedConfig) {
62955
63739
  const packages = await getPackages(cwd);
62956
63740
  const configResult = await readConfig(packages.rootDir, packages);