@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.
@@ -18,7 +18,6 @@ import { basename as basename$1, dirname as dirname$1, isAbsolute as isAbsolute$
18
18
  import { fileURLToPath as fileURLToPath$1 } from "url";
19
19
  import { createRequire as createRequire$1 } from "module";
20
20
  import Range from "semver/classes/range.js";
21
- import * as cp from "node:child_process";
22
21
  import { spawn } from "node:child_process";
23
22
  import { pipeline } from "node:stream/promises";
24
23
  import { PassThrough } from "node:stream";
@@ -436,7 +435,7 @@ const trimTrailingSlashes = (s) => {
436
435
  };
437
436
 
438
437
  //#endregion
439
- //#region ../../node_modules/.pnpm/@effected+glob@0.1.1_effect@4.0.0-beta.98/node_modules/@effected/glob/internal/limits.js
438
+ //#region ../../node_modules/.pnpm/@effected+glob@0.2.0_effect@4.0.0-beta.99/node_modules/@effected/glob/internal/limits.js
440
439
  /** Hard cap on pattern length. Upstream minimatch's MAX_PATTERN_LENGTH (64KB). */
441
440
  const MAX_PATTERN_LENGTH = 1024 * 64;
442
441
  /** Default brace-expansion output budget. Upstream brace-expansion's EXPANSION_MAX. */
@@ -471,7 +470,7 @@ const assertCap = (name, value) => {
471
470
  };
472
471
 
473
472
  //#endregion
474
- //#region ../../node_modules/.pnpm/@effected+glob@0.1.1_effect@4.0.0-beta.98/node_modules/@effected/glob/internal/unescape.js
473
+ //#region ../../node_modules/.pnpm/@effected+glob@0.2.0_effect@4.0.0-beta.99/node_modules/@effected/glob/internal/unescape.js
475
474
  /**
476
475
  * Un-escape a string that has been escaped with `escape`.
477
476
  *
@@ -495,12 +494,12 @@ const unescapePattern = (s, { windowsPathsNoEscape = false, magicalBraces = true
495
494
  };
496
495
 
497
496
  //#endregion
498
- //#region ../../node_modules/.pnpm/@effected+glob@0.1.1_effect@4.0.0-beta.98/node_modules/@effected/glob/internal/types.js
497
+ //#region ../../node_modules/.pnpm/@effected+glob@0.2.0_effect@4.0.0-beta.99/node_modules/@effected/glob/internal/types.js
499
498
  /** The globstar marker in a compiled pattern set. */
500
499
  const GLOBSTAR = Symbol("globstar **");
501
500
 
502
501
  //#endregion
503
- //#region ../../node_modules/.pnpm/@effected+glob@0.1.1_effect@4.0.0-beta.98/node_modules/@effected/glob/internal/escape.js
502
+ //#region ../../node_modules/.pnpm/@effected+glob@0.2.0_effect@4.0.0-beta.99/node_modules/@effected/glob/internal/escape.js
504
503
  /**
505
504
  * Escape all magic characters in a glob pattern.
506
505
  *
@@ -519,14 +518,14 @@ const escapePattern = (s, { windowsPathsNoEscape = false, magicalBraces = false
519
518
  };
520
519
 
521
520
  //#endregion
522
- //#region ../../node_modules/.pnpm/@effected+glob@0.1.1_effect@4.0.0-beta.98/node_modules/@effected/glob/internal/assertValidPattern.js
521
+ //#region ../../node_modules/.pnpm/@effected+glob@0.2.0_effect@4.0.0-beta.99/node_modules/@effected/glob/internal/assertValidPattern.js
523
522
  const assertValidPattern = (pattern) => {
524
523
  if (typeof pattern !== "string") throw new TypeError("invalid pattern");
525
524
  if (pattern.length > 65536) throw new GuardExceeded("PatternTooLong", MAX_PATTERN_LENGTH, pattern.length);
526
525
  };
527
526
 
528
527
  //#endregion
529
- //#region ../../node_modules/.pnpm/@effected+glob@0.1.1_effect@4.0.0-beta.98/node_modules/@effected/glob/internal/braceExpressions.js
528
+ //#region ../../node_modules/.pnpm/@effected+glob@0.2.0_effect@4.0.0-beta.99/node_modules/@effected/glob/internal/braceExpressions.js
530
529
  const posixClasses = {
531
530
  "[:alnum:]": ["\\p{L}\\p{Nl}\\p{Nd}", true],
532
531
  "[:alpha:]": ["\\p{L}\\p{Nl}", true],
@@ -650,7 +649,7 @@ const parseClass = (glob, position) => {
650
649
  };
651
650
 
652
651
  //#endregion
653
- //#region ../../node_modules/.pnpm/@effected+glob@0.1.1_effect@4.0.0-beta.98/node_modules/@effected/glob/internal/ast.js
652
+ //#region ../../node_modules/.pnpm/@effected+glob@0.2.0_effect@4.0.0-beta.99/node_modules/@effected/glob/internal/ast.js
654
653
  const types = /* @__PURE__ */ new Set([
655
654
  "!",
656
655
  "?",
@@ -1168,7 +1167,7 @@ var AST = class AST {
1168
1167
  };
1169
1168
 
1170
1169
  //#endregion
1171
- //#region ../../node_modules/.pnpm/@effected+glob@0.1.1_effect@4.0.0-beta.98/node_modules/@effected/glob/internal/balancedMatch.js
1170
+ //#region ../../node_modules/.pnpm/@effected+glob@0.2.0_effect@4.0.0-beta.99/node_modules/@effected/glob/internal/balancedMatch.js
1172
1171
  const maybeMatch = (reg, str) => {
1173
1172
  const m = str.match(reg);
1174
1173
  return m ? m[0] : null;
@@ -1227,7 +1226,7 @@ const range = (a, b, str) => {
1227
1226
  };
1228
1227
 
1229
1228
  //#endregion
1230
- //#region ../../node_modules/.pnpm/@effected+glob@0.1.1_effect@4.0.0-beta.98/node_modules/@effected/glob/internal/braceExpansion.js
1229
+ //#region ../../node_modules/.pnpm/@effected+glob@0.2.0_effect@4.0.0-beta.99/node_modules/@effected/glob/internal/braceExpansion.js
1231
1230
  const escSlash = `\0SLASH${Math.random()}\0`;
1232
1231
  const escOpen = `\0OPEN${Math.random()}\0`;
1233
1232
  const escClose = `\0CLOSE${Math.random()}\0`;
@@ -1375,7 +1374,7 @@ function expand_(str, max, isTopInput, depth) {
1375
1374
  }
1376
1375
 
1377
1376
  //#endregion
1378
- //#region ../../node_modules/.pnpm/@effected+glob@0.1.1_effect@4.0.0-beta.98/node_modules/@effected/glob/internal/minimatch.js
1377
+ //#region ../../node_modules/.pnpm/@effected+glob@0.2.0_effect@4.0.0-beta.99/node_modules/@effected/glob/internal/minimatch.js
1379
1378
  const starDotExtRE = /^\*+([^+@!?*[(]*)$/;
1380
1379
  const starDotExtTest = (ext) => (f) => !f.startsWith(".") && f.endsWith(ext);
1381
1380
  const starDotExtTestDot = (ext) => (f) => f.endsWith(ext);
@@ -1947,7 +1946,7 @@ var Minimatch = class {
1947
1946
  };
1948
1947
 
1949
1948
  //#endregion
1950
- //#region ../../node_modules/.pnpm/@effected+glob@0.1.1_effect@4.0.0-beta.98/node_modules/@effected/glob/GlobPattern.js
1949
+ //#region ../../node_modules/.pnpm/@effected+glob@0.2.0_effect@4.0.0-beta.99/node_modules/@effected/glob/GlobPattern.js
1951
1950
  /**
1952
1951
  * Typed failure raised when a glob pattern trips a compile-time guard:
1953
1952
  * over-length, brace-expansion budget exhaustion, or nesting past the depth
@@ -2076,17 +2075,30 @@ var GlobPattern = class GlobPattern extends Schema.Class("GlobPattern")(Schema.S
2076
2075
  return this.#engine;
2077
2076
  }
2078
2077
  /**
2079
- * Compile a pattern under the given options — the package's fallible
2080
- * boundary. Guard trips (over-length, expansion budget, nesting depth)
2081
- * fail typed with {@link GlobPatternError}; invalid options never reach
2082
- * here (they throw at `GlobPatternOptions.make`, a wiring defect).
2078
+ * Compile a pattern under the given options, synchronously — the package's
2079
+ * fallible boundary in its primitive form. Compilation is pure
2080
+ * string→predicate work with no IO, no services and no async step, so the
2081
+ * sync form is the real primitive and {@link GlobPattern.compile} is
2082
+ * derived from it.
2083
+ *
2084
+ * Total: never throws for pattern input. Guard trips (over-length,
2085
+ * expansion budget, nesting depth) come back as a `Result` failure holding
2086
+ * {@link GlobPatternError}; invalid *options* never reach here (they throw
2087
+ * at `GlobPatternOptions.make`, a wiring defect).
2083
2088
  *
2084
2089
  * The pattern must also compile under DEFAULT options, whatever the
2085
2090
  * effective options are — permissive options (say `nobrace` over a brace
2086
2091
  * bomb) do not admit a defaults-rejected pattern; the same typed error
2087
2092
  * surfaces instead.
2093
+ *
2094
+ * @remarks
2095
+ * For synchronous call sites that cannot host an Effect — a lint-staged
2096
+ * handler, a config predicate — this removes the
2097
+ * `Effect.runSync(Effect.result(...))` escape hatch: pair it with
2098
+ * `Result.isSuccess` and read `.success` directly. Effect call sites should
2099
+ * prefer {@link GlobPattern.compile}, which carries the tracing span.
2088
2100
  */
2089
- static compile = Effect.fn("GlobPattern.compile")(function* (source, options) {
2101
+ static compileResult(source, options) {
2090
2102
  const engineOptions = toEngineOptions(options);
2091
2103
  try {
2092
2104
  new Minimatch(source, {});
@@ -2094,16 +2106,30 @@ var GlobPattern = class GlobPattern extends Schema.Class("GlobPattern")(Schema.S
2094
2106
  const pattern = new GlobPattern({ source });
2095
2107
  pattern.#engine = engine;
2096
2108
  pattern.#engineOptions = engineOptions;
2097
- return pattern;
2109
+ return Result.succeed(pattern);
2098
2110
  } catch (e) {
2099
- if (isGuardExceeded(e)) return yield* new GlobPatternError({
2111
+ if (isGuardExceeded(e)) return Result.fail(new GlobPatternError({
2100
2112
  pattern: source,
2101
2113
  reason: e.reason,
2102
2114
  limit: e.limit,
2103
2115
  actual: e.actual
2104
- });
2116
+ }));
2105
2117
  throw e;
2106
2118
  }
2119
+ }
2120
+ /**
2121
+ * Compile a pattern under the given options — the package's fallible
2122
+ * boundary, and the form Effect call sites should reach for. Guard trips
2123
+ * (over-length, expansion budget, nesting depth) fail typed with
2124
+ * {@link GlobPatternError}; invalid options never reach here (they throw at
2125
+ * `GlobPatternOptions.make`, a wiring defect).
2126
+ *
2127
+ * Defined in terms of {@link GlobPattern.compileResult} — synchronous
2128
+ * callers can use that variant directly. Same semantics, same errors; this
2129
+ * form adds only the `GlobPattern.compile` tracing span.
2130
+ */
2131
+ static compile = Effect.fn("GlobPattern.compile")(function* (source, options) {
2132
+ return yield* Effect.fromResult(GlobPattern.compileResult(source, options));
2107
2133
  });
2108
2134
  /**
2109
2135
  * Whether `candidate` matches this pattern. Total: never throws, never
@@ -2200,7 +2226,7 @@ var GlobPattern = class GlobPattern extends Schema.Class("GlobPattern")(Schema.S
2200
2226
  };
2201
2227
 
2202
2228
  //#endregion
2203
- //#region ../../node_modules/.pnpm/@effected+glob@0.1.1_effect@4.0.0-beta.98/node_modules/@effected/glob/GlobSet.js
2229
+ //#region ../../node_modules/.pnpm/@effected+glob@0.2.0_effect@4.0.0-beta.99/node_modules/@effected/glob/GlobSet.js
2204
2230
  const exclusionTarget = (pattern) => pattern.startsWith("!") ? pattern.slice(1) : void 0;
2205
2231
  const allCompileUnderDefaults = (patterns) => {
2206
2232
  for (const pattern of patterns) {
@@ -2275,27 +2301,53 @@ var GlobSet = class GlobSet extends Schema.Class("GlobSet")(Schema.Struct({ patt
2275
2301
  return this.#literalSet;
2276
2302
  }
2277
2303
  /**
2278
- * Compile a pattern set — with {@link GlobPattern.compile}, the package's
2279
- * only other fallible boundary. Fails typed on the FIRST uncompilable
2280
- * member, with the error's `pattern` field naming the offending source
2281
- * pattern (bang included for exclusions).
2304
+ * Compile a pattern set, synchronously the primitive form, mirroring
2305
+ * {@link GlobPattern.compileResult}. Set compilation is pure
2306
+ * string→predicate work with no IO and no async step, so the sync form is
2307
+ * the real primitive and {@link GlobSet.compile} is derived from it.
2308
+ *
2309
+ * Total: never throws for pattern input. Fails on the FIRST uncompilable
2310
+ * member, coming back as a `Result` failure whose {@link GlobPatternError}
2311
+ * names the offending source pattern in `pattern` (bang included for
2312
+ * exclusions).
2313
+ *
2314
+ * @remarks
2315
+ * For synchronous call sites that cannot host an Effect — a lint-staged
2316
+ * handler, a config predicate — this removes the
2317
+ * `Effect.runSync(Effect.result(...))` escape hatch: pair it with
2318
+ * `Result.isSuccess` and read `.success` directly. Effect call sites should
2319
+ * prefer {@link GlobSet.compile}, which carries the tracing span.
2282
2320
  */
2283
- static compile = Effect.fn("GlobSet.compile")(function* (patterns) {
2321
+ static compileResult(patterns) {
2284
2322
  for (const pattern of patterns) {
2285
2323
  const target = exclusionTarget(pattern) ?? pattern;
2286
2324
  try {
2287
2325
  new Minimatch(target, {});
2288
2326
  } catch (e) {
2289
- if (isGuardExceeded(e)) return yield* new GlobPatternError({
2327
+ if (isGuardExceeded(e)) return Result.fail(new GlobPatternError({
2290
2328
  pattern,
2291
2329
  reason: e.reason,
2292
2330
  limit: e.limit,
2293
2331
  actual: e.actual
2294
- });
2332
+ }));
2295
2333
  throw e;
2296
2334
  }
2297
2335
  }
2298
- return new GlobSet({ patterns });
2336
+ return Result.succeed(new GlobSet({ patterns }));
2337
+ }
2338
+ /**
2339
+ * Compile a pattern set — with {@link GlobPattern.compile}, the package's
2340
+ * only other fallible boundary, and the form Effect call sites should reach
2341
+ * for. Fails typed on the FIRST uncompilable member, with the error's
2342
+ * `pattern` field naming the offending source pattern (bang included for
2343
+ * exclusions).
2344
+ *
2345
+ * Defined in terms of {@link GlobSet.compileResult} — synchronous callers
2346
+ * can use that variant directly. Same semantics, same errors; this form
2347
+ * adds only the `GlobSet.compile` tracing span.
2348
+ */
2349
+ static compile = Effect.fn("GlobSet.compile")(function* (patterns) {
2350
+ return yield* Effect.fromResult(GlobSet.compileResult(patterns));
2299
2351
  });
2300
2352
  /**
2301
2353
  * Whether `candidate` matches the set: some include accepts it (literal
@@ -2329,7 +2381,7 @@ var GlobSet = class GlobSet extends Schema.Class("GlobSet")(Schema.Struct({ patt
2329
2381
  };
2330
2382
 
2331
2383
  //#endregion
2332
- //#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
2384
+ //#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
2333
2385
  /**
2334
2386
  * Extension data specific to bun lockfiles, attached to `Lockfile.extension`
2335
2387
  * when the format is `"bun"`.
@@ -2351,7 +2403,7 @@ var BunExtension = class extends Schema.Class("BunExtension")({
2351
2403
  }) {};
2352
2404
 
2353
2405
  //#endregion
2354
- //#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
2406
+ //#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
2355
2407
  /**
2356
2408
  * Contract for resolving pnpm `catalog:` dependency specifiers to concrete
2357
2409
  * version ranges.
@@ -2398,7 +2450,7 @@ var CatalogResolver = class CatalogResolver extends Context.Service()("@effected
2398
2450
  };
2399
2451
 
2400
2452
  //#endregion
2401
- //#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
2453
+ //#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
2402
2454
  /**
2403
2455
  * Raised when a `catalog:` or `workspace:` specifier cannot be resolved
2404
2456
  * because the resolution mechanism itself failed — not for an ordinary
@@ -2460,7 +2512,7 @@ var WorkspaceResolver = class WorkspaceResolver extends Context.Service()("@effe
2460
2512
  };
2461
2513
 
2462
2514
  //#endregion
2463
- //#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
2515
+ //#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
2464
2516
  /**
2465
2517
  * Raised when a workspace's catalogs cannot be assembled — a `pnpm-workspace.yaml`
2466
2518
  * that is unreadable or not valid YAML, a root `package.json` `workspaces` field
@@ -2505,7 +2557,7 @@ var CatalogAssemblyError = class extends Schema.TaggedErrorClass()("CatalogAssem
2505
2557
  };
2506
2558
 
2507
2559
  //#endregion
2508
- //#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
2560
+ //#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
2509
2561
  /**
2510
2562
  * The short dependency kind: which dependency map an entry came from, named the
2511
2563
  * way consumers branch on it.
@@ -2539,7 +2591,7 @@ const KIND_TO_FIELD = {
2539
2591
  const FIELD_TO_KIND = Object.fromEntries(Object.entries(KIND_TO_FIELD).map(([kind, field]) => [field, kind]));
2540
2592
 
2541
2593
  //#endregion
2542
- //#region ../../node_modules/.pnpm/@effected+semver@0.1.0_effect@4.0.0-beta.98/node_modules/@effected/semver/internal/desugar.js
2594
+ //#region ../../node_modules/.pnpm/@effected+semver@0.2.0_effect@4.0.0-beta.99/node_modules/@effected/semver/internal/desugar.js
2543
2595
  const sv = (major, minor, patch, prerelease = [], build = []) => ({
2544
2596
  major,
2545
2597
  minor,
@@ -2629,7 +2681,7 @@ const desugarHyphen = (lower, upper) => {
2629
2681
  };
2630
2682
 
2631
2683
  //#endregion
2632
- //#region ../../node_modules/.pnpm/@effected+semver@0.1.0_effect@4.0.0-beta.98/node_modules/@effected/semver/internal/grammar.js
2684
+ //#region ../../node_modules/.pnpm/@effected+semver@0.2.0_effect@4.0.0-beta.99/node_modules/@effected/semver/internal/grammar.js
2633
2685
  /** Private control-flow exception; never escapes the entry points. */
2634
2686
  var ParseFailure = class {
2635
2687
  position;
@@ -3025,7 +3077,7 @@ const formatComparator = (c) => {
3025
3077
  const formatRange = (sets) => sets.map((set) => set.map(formatComparator).join(" ")).join(" || ");
3026
3078
 
3027
3079
  //#endregion
3028
- //#region ../../node_modules/.pnpm/@effected+semver@0.1.0_effect@4.0.0-beta.98/node_modules/@effected/semver/internal/order.js
3080
+ //#region ../../node_modules/.pnpm/@effected+semver@0.2.0_effect@4.0.0-beta.99/node_modules/@effected/semver/internal/order.js
3029
3081
  /**
3030
3082
  * Compare two prerelease identifiers per SemVer 2.0.0 §11: numeric
3031
3083
  * identifiers always have lower precedence than alphanumeric ones; numerics
@@ -3079,7 +3131,7 @@ const compareBuild = (a, b) => {
3079
3131
  };
3080
3132
 
3081
3133
  //#endregion
3082
- //#region ../../node_modules/.pnpm/@effected+semver@0.1.0_effect@4.0.0-beta.98/node_modules/@effected/semver/SemVer.js
3134
+ //#region ../../node_modules/.pnpm/@effected+semver@0.2.0_effect@4.0.0-beta.99/node_modules/@effected/semver/SemVer.js
3083
3135
  /**
3084
3136
  * Indicates that a string could not be parsed as a valid SemVer 2.0.0 version.
3085
3137
  *
@@ -3160,23 +3212,57 @@ var SemVer = class SemVer extends Schema.Class("SemVer")({
3160
3212
  encode: (parts) => Effect.succeed(formatVersion(parts))
3161
3213
  })));
3162
3214
  /**
3163
- * Parse a strict SemVer 2.0.0 version string.
3215
+ * Parse a strict SemVer 2.0.0 version string, synchronously, returning a
3216
+ * `Result` instead of an `Effect`.
3164
3217
  *
3165
3218
  * Rejects `v`/`V` prefixes, `=` prefixes, leading zeros on numeric
3166
3219
  * identifiers and partially consumed input.
3167
3220
  *
3221
+ * @remarks
3222
+ * {@link SemVer.parse} is defined in terms of this function; the two never
3223
+ * diverge. Reach for the `Effect` variant inside Effect code — it carries
3224
+ * the `SemVer.parse` tracing span — and for this one at synchronous
3225
+ * boundaries.
3226
+ *
3227
+ * @example
3228
+ * ```ts
3229
+ * import { SemVer } from "@effected/semver";
3230
+ * import { Result } from "effect";
3231
+ *
3232
+ * const ok = SemVer.parseResult("1.2.3");
3233
+ * if (Result.isSuccess(ok)) {
3234
+ * console.log(ok.success.major); // => 1
3235
+ * }
3236
+ *
3237
+ * const bad = SemVer.parseResult("v1.2.3");
3238
+ * if (Result.isFailure(bad)) {
3239
+ * console.log(bad.failure._tag); // => "InvalidVersionError"
3240
+ * }
3241
+ * ```
3242
+ *
3168
3243
  * @param input - the version string to parse
3169
- * @returns the parsed {@link SemVer}. Fails with {@link InvalidVersionError}
3170
- * when `input` is not a valid version string.
3244
+ * @returns a `Result` succeeding with the parsed {@link SemVer}, or failing
3245
+ * with {@link InvalidVersionError} when `input` is not a valid version
3246
+ * string.
3171
3247
  */
3172
- static parse = Effect.fn("SemVer.parse")(function* (input) {
3248
+ static parseResult(input) {
3173
3249
  const result = parseVersion(input);
3174
- if (!result.ok) return yield* new InvalidVersionError({
3250
+ if (!result.ok) return Result.fail(new InvalidVersionError({
3175
3251
  input: result.input,
3176
3252
  position: result.position
3177
- });
3178
- return SemVer.make(result.value);
3179
- });
3253
+ }));
3254
+ return Result.succeed(SemVer.make(result.value));
3255
+ }
3256
+ /**
3257
+ * Parse a strict SemVer 2.0.0 version string. Defined in terms of
3258
+ * {@link SemVer.parseResult} — synchronous callers can use that variant
3259
+ * directly.
3260
+ *
3261
+ * @param input - the version string to parse
3262
+ * @returns the parsed {@link SemVer}. Fails with {@link InvalidVersionError}
3263
+ * when `input` is not a valid version string.
3264
+ */
3265
+ static parse = Effect.fn("SemVer.parse")((input) => Effect.fromResult(SemVer.parseResult(input)));
3180
3266
  /**
3181
3267
  * Positional convenience constructor: `SemVer.of(1, 2, 3)`.
3182
3268
  *
@@ -3481,7 +3567,7 @@ var SemVerBump = class {
3481
3567
  };
3482
3568
 
3483
3569
  //#endregion
3484
- //#region ../../node_modules/.pnpm/@effected+semver@0.1.0_effect@4.0.0-beta.98/node_modules/@effected/semver/Comparator.js
3570
+ //#region ../../node_modules/.pnpm/@effected+semver@0.2.0_effect@4.0.0-beta.99/node_modules/@effected/semver/Comparator.js
3485
3571
  /**
3486
3572
  * Indicates that a string could not be parsed as a single comparator.
3487
3573
  *
@@ -3548,18 +3634,52 @@ var Comparator = class Comparator extends Schema.Class("Comparator")({
3548
3634
  },
3549
3635
  encode: (parts) => Effect.succeed(formatComparator(parts))
3550
3636
  })));
3551
- /** Parse a comparator string (e.g. `">=1.2.3"`). */
3552
- static parse = Effect.fn("Comparator.parse")(function* (input) {
3637
+ /**
3638
+ * Parse a comparator string (e.g. `">=1.2.3"`), synchronously, returning a
3639
+ * `Result` instead of an `Effect`.
3640
+ *
3641
+ * @remarks
3642
+ * {@link Comparator.parse} is defined in terms of this function; the two
3643
+ * never diverge. Reach for the `Effect` variant inside Effect code — it
3644
+ * carries the `Comparator.parse` tracing span — and for this one at
3645
+ * synchronous boundaries.
3646
+ *
3647
+ * @example
3648
+ * ```ts
3649
+ * import { Comparator } from "@effected/semver";
3650
+ * import { Result } from "effect";
3651
+ *
3652
+ * const ok = Comparator.parseResult(">=1.2.3");
3653
+ * if (Result.isSuccess(ok)) {
3654
+ * console.log(ok.success.operator); // => ">="
3655
+ * }
3656
+ * ```
3657
+ *
3658
+ * @param input - the comparator string to parse
3659
+ * @returns a `Result` succeeding with the parsed {@link Comparator}, or
3660
+ * failing with {@link InvalidComparatorError}.
3661
+ */
3662
+ static parseResult(input) {
3553
3663
  const result = parseComparator(input);
3554
- if (!result.ok) return yield* new InvalidComparatorError({
3664
+ if (!result.ok) return Result.fail(new InvalidComparatorError({
3555
3665
  input: result.input,
3556
3666
  position: result.position
3557
- });
3558
- return Comparator.make({
3667
+ }));
3668
+ return Result.succeed(Comparator.make({
3559
3669
  operator: result.value.operator,
3560
3670
  version: SemVer.make(result.value.version)
3561
- });
3562
- });
3671
+ }));
3672
+ }
3673
+ /**
3674
+ * Parse a comparator string (e.g. `">=1.2.3"`). Defined in terms of
3675
+ * {@link Comparator.parseResult} — synchronous callers can use that variant
3676
+ * directly.
3677
+ *
3678
+ * @param input - the comparator string to parse
3679
+ * @returns the parsed {@link Comparator}. Fails with
3680
+ * {@link InvalidComparatorError}.
3681
+ */
3682
+ static parse = Effect.fn("Comparator.parse")((input) => Effect.fromResult(Comparator.parseResult(input)));
3563
3683
  /** Test whether a version satisfies this comparator. */
3564
3684
  test(version) {
3565
3685
  const cmp = version.compare(this.version);
@@ -3582,7 +3702,7 @@ var Comparator = class Comparator extends Schema.Class("Comparator")({
3582
3702
  };
3583
3703
 
3584
3704
  //#endregion
3585
- //#region ../../node_modules/.pnpm/@effected+semver@0.1.0_effect@4.0.0-beta.98/node_modules/@effected/semver/internal/normalize.js
3705
+ //#region ../../node_modules/.pnpm/@effected+semver@0.2.0_effect@4.0.0-beta.99/node_modules/@effected/semver/internal/normalize.js
3586
3706
  const operatorWeight = (op) => {
3587
3707
  switch (op) {
3588
3708
  case ">=": return 0;
@@ -3614,7 +3734,7 @@ const normalizeComparatorSet = (set) => sortComparators(removeDuplicates(set));
3614
3734
  const normalizeSets = (sets) => sets.map(normalizeComparatorSet);
3615
3735
 
3616
3736
  //#endregion
3617
- //#region ../../node_modules/.pnpm/@effected+semver@0.1.0_effect@4.0.0-beta.98/node_modules/@effected/semver/Range.js
3737
+ //#region ../../node_modules/.pnpm/@effected+semver@0.2.0_effect@4.0.0-beta.99/node_modules/@effected/semver/Range.js
3618
3738
  /**
3619
3739
  * Indicates that a string could not be parsed as a range expression.
3620
3740
  *
@@ -3674,18 +3794,51 @@ sets: Schema.Array(Schema.Array(Comparator)) }) {
3674
3794
  },
3675
3795
  encode: (parts) => Effect.succeed(formatRange(parts.sets))
3676
3796
  })));
3677
- /** Parse a range expression and normalize its comparator sets. */
3678
- static parse = Effect.fn("Range.parse")(function* (input) {
3797
+ /**
3798
+ * Parse a range expression and normalize its comparator sets,
3799
+ * synchronously, returning a `Result` instead of an `Effect`.
3800
+ *
3801
+ * @remarks
3802
+ * {@link Range.parse} is defined in terms of this function; the two never
3803
+ * diverge. Reach for the `Effect` variant inside Effect code — it carries
3804
+ * the `Range.parse` tracing span — and for this one at synchronous
3805
+ * boundaries.
3806
+ *
3807
+ * @example
3808
+ * ```ts
3809
+ * import { Range } from "@effected/semver";
3810
+ * import { Result } from "effect";
3811
+ *
3812
+ * const ok = Range.parseResult("^1.0.0");
3813
+ * if (Result.isSuccess(ok)) {
3814
+ * console.log(ok.success.toString()); // => ">=1.0.0 <2.0.0-0"
3815
+ * }
3816
+ * ```
3817
+ *
3818
+ * @param input - the range expression to parse
3819
+ * @returns a `Result` succeeding with the parsed {@link Range}, or failing
3820
+ * with {@link InvalidRangeError}.
3821
+ */
3822
+ static parseResult(input) {
3679
3823
  const result = parseRange$1(input);
3680
- if (!result.ok) return yield* new InvalidRangeError({
3824
+ if (!result.ok) return Result.fail(new InvalidRangeError({
3681
3825
  input: result.input,
3682
3826
  position: result.position
3683
- });
3684
- return Range.make({ sets: normalizeSets(result.value).map((set) => set.map((c) => Comparator.make({
3827
+ }));
3828
+ return Result.succeed(Range.make({ sets: normalizeSets(result.value).map((set) => set.map((c) => Comparator.make({
3685
3829
  operator: c.operator,
3686
3830
  version: SemVer.make(c.version)
3687
- }))) });
3688
- });
3831
+ }))) }));
3832
+ }
3833
+ /**
3834
+ * Parse a range expression and normalize its comparator sets. Defined in
3835
+ * terms of {@link Range.parseResult} — synchronous callers can use that
3836
+ * variant directly.
3837
+ *
3838
+ * @param input - the range expression to parse
3839
+ * @returns the parsed {@link Range}. Fails with {@link InvalidRangeError}.
3840
+ */
3841
+ static parse = Effect.fn("Range.parse")((input) => Effect.fromResult(Range.parseResult(input)));
3689
3842
  /**
3690
3843
  * Test whether a version satisfies a range; see {@link Range.test} for the
3691
3844
  * prerelease matching rule. Dual API.
@@ -3712,19 +3865,49 @@ sets: Schema.Array(Schema.Array(Comparator)) }) {
3712
3865
  static union = Function.dual(2, (self, that) => Range.make({ sets: [...self.sets, ...that.sets] }));
3713
3866
  /**
3714
3867
  * Intersect two ranges via a cross-product of their comparator sets,
3715
- * keeping only satisfiable combinations. Fails with
3868
+ * keeping only satisfiable combinations, synchronously, returning a
3869
+ * `Result` instead of an `Effect`. Fails with
3716
3870
  * {@link UnsatisfiableConstraintError} when no satisfiable set remains —
3717
3871
  * an honest typed failure instead of an unsatisfiable range. Dual API.
3872
+ *
3873
+ * @remarks
3874
+ * {@link Range.intersect} is defined in terms of this function; the two
3875
+ * never diverge. Reach for the `Effect` variant inside Effect code — it
3876
+ * carries the `Range.intersect` tracing span — and for this one at
3877
+ * synchronous boundaries.
3878
+ *
3879
+ * @example
3880
+ * ```ts
3881
+ * import { Range } from "@effected/semver";
3882
+ * import { Result } from "effect";
3883
+ *
3884
+ * const a = Result.getOrThrow(Range.parseResult("^1.0.0"));
3885
+ * const b = Result.getOrThrow(Range.parseResult(">=1.5.0"));
3886
+ * const merged = Range.intersectResult(a, b);
3887
+ * if (Result.isSuccess(merged)) {
3888
+ * console.log(merged.success.toString()); // => ">=1.0.0 <2.0.0-0 >=1.5.0"
3889
+ * }
3890
+ * ```
3718
3891
  */
3719
- static intersect = Function.dual(2, Effect.fn("Range.intersect")(function* (self, that) {
3892
+ static intersectResult = Function.dual(2, (self, that) => {
3720
3893
  const candidates = [];
3721
3894
  for (const setA of self.sets) for (const setB of that.sets) {
3722
3895
  const merged = [...setA, ...setB];
3723
3896
  if (isSetSatisfiable(merged)) candidates.push(merged);
3724
3897
  }
3725
- if (candidates.length === 0) return yield* new UnsatisfiableConstraintError({ constraints: [self, that] });
3726
- return Range.make({ sets: candidates });
3727
- }));
3898
+ if (candidates.length === 0) return Result.fail(new UnsatisfiableConstraintError({ constraints: [self, that] }));
3899
+ return Result.succeed(Range.make({ sets: candidates }));
3900
+ });
3901
+ /**
3902
+ * Intersect two ranges via a cross-product of their comparator sets,
3903
+ * keeping only satisfiable combinations. Fails with
3904
+ * {@link UnsatisfiableConstraintError} when no satisfiable set remains —
3905
+ * an honest typed failure instead of an unsatisfiable range. Dual API.
3906
+ *
3907
+ * Defined in terms of {@link Range.intersectResult} — synchronous callers
3908
+ * can use that variant directly.
3909
+ */
3910
+ static intersect = Function.dual(2, Effect.fn("Range.intersect")((self, that) => Effect.fromResult(Range.intersectResult(self, that))));
3728
3911
  /**
3729
3912
  * Check whether every version matched by `sub` is also matched by `sup`.
3730
3913
  * Dual API.
@@ -3884,7 +4067,7 @@ const isComparatorSetSubset = (sub, sup) => {
3884
4067
  };
3885
4068
 
3886
4069
  //#endregion
3887
- //#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
4070
+ //#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
3888
4071
  /**
3889
4072
  * Indicates that a string could not be parsed as a valid dependency specifier.
3890
4073
  *
@@ -4092,7 +4275,7 @@ const DependencySpecifier = Object.assign(brandedSpecifier, {
4092
4275
  });
4093
4276
 
4094
4277
  //#endregion
4095
- //#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
4278
+ //#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
4096
4279
  const SRI_RE = /^(sha1|sha256|sha384|sha512)-[A-Za-z0-9+/]+={0,2}$/;
4097
4280
  const COREPACK_RE = /^(sha1|sha256|sha384|sha512)\.[0-9a-f]+$/;
4098
4281
  const YARN_RE = /^[0-9]+(c[0-9]+)?\/[0-9a-f]+$/;
@@ -4146,7 +4329,7 @@ const IntegrityHash = Object.assign(brandedIntegrity, {
4146
4329
  });
4147
4330
 
4148
4331
  //#endregion
4149
- //#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
4332
+ //#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
4150
4333
  /**
4151
4334
  * One declared dependency of one workspace importer, as the lockfile records it.
4152
4335
  *
@@ -4175,7 +4358,7 @@ var ImporterDependency = class extends Schema.Class("ImporterDependency")({
4175
4358
  }) {};
4176
4359
 
4177
4360
  //#endregion
4178
- //#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
4361
+ //#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
4179
4362
  /**
4180
4363
  * One workspace importer's declared dependencies, as the lockfile records them.
4181
4364
  *
@@ -4200,7 +4383,7 @@ var LockfileImporter = class extends Schema.Class("LockfileImporter")({
4200
4383
  }) {};
4201
4384
 
4202
4385
  //#endregion
4203
- //#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
4386
+ //#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
4204
4387
  const EMPTY_DEPENDENCIES = {};
4205
4388
  /**
4206
4389
  * A package resolved from a lockfile.
@@ -4236,7 +4419,7 @@ var ResolvedPackage = class extends Schema.Class("ResolvedPackage")({
4236
4419
  }) {};
4237
4420
 
4238
4421
  //#endregion
4239
- //#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
4422
+ //#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
4240
4423
  /**
4241
4424
  * A directed dependency edge between two workspace packages as recorded in
4242
4425
  * the lockfile.
@@ -4259,7 +4442,7 @@ var WorkspaceDependency = class extends Schema.Class("WorkspaceDependency")({
4259
4442
  }) {};
4260
4443
 
4261
4444
  //#endregion
4262
- //#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
4445
+ //#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
4263
4446
  /**
4264
4447
  * Extension data specific to pnpm lockfiles, attached to `Lockfile.extension`
4265
4448
  * when the format is `"pnpm"`.
@@ -4285,7 +4468,7 @@ var PnpmExtension = class extends Schema.Class("PnpmExtension")({
4285
4468
  }) {};
4286
4469
 
4287
4470
  //#endregion
4288
- //#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
4471
+ //#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
4289
4472
  /**
4290
4473
  * The lockfile formats this package parses: bun's `bun.lock` (JSONC), npm's
4291
4474
  * `package-lock.json` (v2/v3 JSON), pnpm's `pnpm-lock.yaml` and yarn Berry's
@@ -4320,7 +4503,7 @@ const FILENAMES = {
4320
4503
  const filenameFor = (format) => FILENAMES[format];
4321
4504
 
4322
4505
  //#endregion
4323
- //#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
4506
+ //#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
4324
4507
  /**
4325
4508
  * The four dependency sections of a manifest, in a stable order — the shared
4326
4509
  * dependency-sections table (v3's `DEP_SECTIONS`). Each entry is both the
@@ -4447,7 +4630,7 @@ const extractWorkspaceDeps = (workspaces, workspaceNames) => {
4447
4630
  };
4448
4631
 
4449
4632
  //#endregion
4450
- //#region ../../node_modules/.pnpm/@effected+jsonc@0.3.0_effect@4.0.0-beta.98/node_modules/@effected/jsonc/JsoncNode.js
4633
+ //#region ../../node_modules/.pnpm/@effected+jsonc@0.5.0_effect@4.0.0-beta.99/node_modules/@effected/jsonc/JsoncNode.js
4451
4634
  /**
4452
4635
  * Discriminator values for JSONC AST node types: the JSON value types
4453
4636
  * (`string`/`number`/`boolean`/`null`), the structural types
@@ -4623,7 +4806,7 @@ function evaluateNode(node, depth) {
4623
4806
  }
4624
4807
 
4625
4808
  //#endregion
4626
- //#region ../../node_modules/.pnpm/@effected+jsonc@0.3.0_effect@4.0.0-beta.98/node_modules/@effected/jsonc/internal/scanner.js
4809
+ //#region ../../node_modules/.pnpm/@effected+jsonc@0.5.0_effect@4.0.0-beta.99/node_modules/@effected/jsonc/internal/scanner.js
4627
4810
  const isWhitespace = (ch) => ch === 32 || ch === 9 || ch === 11 || ch === 12 || ch === 160 || ch === 65279;
4628
4811
  const isLineBreak$1 = (ch) => ch === 10 || ch === 13 || ch === 8232 || ch === 8233;
4629
4812
  const isDigit$1 = (ch) => ch >= 48 && ch <= 57;
@@ -4920,7 +5103,7 @@ const createScanner$2 = (text, ignoreTrivia = false) => {
4920
5103
  };
4921
5104
 
4922
5105
  //#endregion
4923
- //#region ../../node_modules/.pnpm/@effected+jsonc@0.3.0_effect@4.0.0-beta.98/node_modules/@effected/jsonc/internal/skip.js
5106
+ //#region ../../node_modules/.pnpm/@effected+jsonc@0.5.0_effect@4.0.0-beta.99/node_modules/@effected/jsonc/internal/skip.js
4924
5107
  /**
4925
5108
  * Iteratively consume the value beginning at the cursor's current token and
4926
5109
  * return its tight end offset (excludes trailing whitespace/comments).
@@ -4951,7 +5134,7 @@ const skipBalancedValue = (cursor) => {
4951
5134
  };
4952
5135
 
4953
5136
  //#endregion
4954
- //#region ../../node_modules/.pnpm/@effected+jsonc@0.3.0_effect@4.0.0-beta.98/node_modules/@effected/jsonc/internal/parser.js
5137
+ //#region ../../node_modules/.pnpm/@effected+jsonc@0.5.0_effect@4.0.0-beta.99/node_modules/@effected/jsonc/internal/parser.js
4955
5138
  /**
4956
5139
  * The public parse-error code vocabulary. The facade builds its `@public`
4957
5140
  * `JsoncParseErrorCode` schema from this array; the parser produces these codes
@@ -5365,7 +5548,7 @@ const parseTree$2 = (text, flags) => {
5365
5548
  };
5366
5549
 
5367
5550
  //#endregion
5368
- //#region ../../node_modules/.pnpm/@effected+jsonc@0.3.0_effect@4.0.0-beta.98/node_modules/@effected/jsonc/Jsonc.js
5551
+ //#region ../../node_modules/.pnpm/@effected+jsonc@0.5.0_effect@4.0.0-beta.99/node_modules/@effected/jsonc/Jsonc.js
5369
5552
  /**
5370
5553
  * The single public parse-error code vocabulary, appearing as the `code` field
5371
5554
  * of {@link JsoncParseErrorDetail}.
@@ -5424,6 +5607,58 @@ var JsoncParseOptions = class extends Schema.Class("JsoncParseOptions")({
5424
5607
  allowTrailingComma: Schema.optionalKey(Schema.Boolean),
5425
5608
  allowEmptyContent: Schema.optionalKey(Schema.Boolean)
5426
5609
  }) {};
5610
+ /**
5611
+ * The public stringify-error code vocabulary, appearing as the `code` field of
5612
+ * {@link JsoncStringifyError}:
5613
+ *
5614
+ * - `CircularReference` — the value contains a reference cycle, so no finite
5615
+ * JSON text exists for it.
5616
+ * - `BigIntValue` — the value contains a `bigint` (anywhere, top-level or
5617
+ * nested), which JSON cannot represent.
5618
+ * - `TopLevelUnrepresentable` — the top-level value (`undefined`, a function
5619
+ * or a symbol) serializes to no output at all.
5620
+ *
5621
+ * @public
5622
+ */
5623
+ const JsoncStringifyErrorCode = Schema.Literals([
5624
+ "CircularReference",
5625
+ "BigIntValue",
5626
+ "TopLevelUnrepresentable"
5627
+ ]);
5628
+ /**
5629
+ * Options controlling stringify behavior. All fields are omissible; the
5630
+ * vocabulary matches `JsoncFormattingOptions`.
5631
+ *
5632
+ * - `tabSize` — the indent width in spaces when `insertSpaces` is `true`.
5633
+ * Defaults to `2`; `0` produces compact single-line output.
5634
+ * - `insertSpaces` — indent with spaces (`tabSize` of them) when `true`, or a
5635
+ * single tab character when `false`. Defaults to `true`.
5636
+ *
5637
+ * @public
5638
+ */
5639
+ var JsoncStringifyOptions = class extends Schema.Class("JsoncStringifyOptions")({
5640
+ tabSize: Schema.optionalKey(Schema.Number),
5641
+ insertSpaces: Schema.optionalKey(Schema.Boolean)
5642
+ }) {};
5643
+ /**
5644
+ * Stringification failure: a `JsoncStringifyErrorCode` naming the
5645
+ * failure mode, a human-readable `detail` (the engine's message for thrown
5646
+ * cases — on V8 the circular-reference message includes the offending property
5647
+ * path), and the offending `value`. Raised by {@link Jsonc.stringify},
5648
+ * {@link Jsonc.stringifyResult} and the encode direction of the schema
5649
+ * factories.
5650
+ *
5651
+ * @public
5652
+ */
5653
+ var JsoncStringifyError = class extends Schema.TaggedErrorClass()("JsoncStringifyError", {
5654
+ code: JsoncStringifyErrorCode,
5655
+ detail: Schema.String,
5656
+ value: Schema.Unknown
5657
+ }) {
5658
+ get message() {
5659
+ return `JSONC stringify failed: ${this.code} — ${this.detail}`;
5660
+ }
5661
+ };
5427
5662
  const toFlags = (options) => options === void 0 ? {} : {
5428
5663
  disallowComments: options.disallowComments,
5429
5664
  allowTrailingComma: options.allowTrailingComma,
@@ -5563,9 +5798,57 @@ var Jsonc = class Jsonc {
5563
5798
  */
5564
5799
  static parse = Effect.fn("Jsonc.parse")((text, options) => Effect.fromResult(Jsonc.parseResult(text, options)));
5565
5800
  /**
5801
+ * Parse JSONC into an immutable {@link JsoncNode} AST, synchronously,
5802
+ * returning a `Result` instead of an `Effect`. `Option.none()` for empty
5803
+ * input (with `allowEmptyContent`); the aggregate {@link JsoncParseError}
5804
+ * for malformed input. Pure — parsing is fundamentally synchronous, so
5805
+ * non-Effect consumers (a plain config loader, a build script) can call
5806
+ * this directly instead of wrapping
5807
+ * `Effect.runSync(Effect.result(Jsonc.parseTree(text)))`.
5808
+ *
5809
+ * @remarks
5810
+ * {@link Jsonc.parseTree} is defined in terms of this function; the two
5811
+ * never diverge. Reach for the `Effect` variant inside Effect code — it
5812
+ * carries the `Jsonc.parseTree` tracing span — and for this one at
5813
+ * synchronous boundaries.
5814
+ *
5815
+ * @example
5816
+ * ```ts
5817
+ * import { Jsonc } from "@effected/jsonc";
5818
+ * import { Option, Result } from "effect";
5819
+ *
5820
+ * const ok = Jsonc.parseTreeResult('{ "port": 3000 // dev\n }');
5821
+ * if (Result.isSuccess(ok) && Option.isSome(ok.success)) {
5822
+ * console.log(ok.success.value.type); // => "object"
5823
+ * }
5824
+ *
5825
+ * const bad = Jsonc.parseTreeResult("{ bad }");
5826
+ * if (Result.isFailure(bad)) {
5827
+ * console.log(bad.failure._tag); // => "JsoncParseError"
5828
+ * }
5829
+ * ```
5830
+ *
5831
+ * @param text - The JSONC source to parse.
5832
+ * @param options - Optional {@link JsoncParseOptions}; defaults apply for
5833
+ * omitted fields.
5834
+ * @returns A `Result` succeeding with `Option.some(root)` (or
5835
+ * `Option.none()` for empty input), or failing with the aggregate
5836
+ * {@link JsoncParseError}.
5837
+ */
5838
+ static parseTreeResult(text, options) {
5839
+ const { root, errors } = parseTree$2(text, toFlags(options));
5840
+ if (errors.length > 0) return Result.fail(new JsoncParseError({
5841
+ errors: toDetails(text, errors),
5842
+ input: text
5843
+ }));
5844
+ return Result.succeed(root !== void 0 ? Option.some(root) : Option.none());
5845
+ }
5846
+ /**
5566
5847
  * Parse JSONC into an immutable {@link JsoncNode} AST. `Option.none()` for
5567
5848
  * empty input (with `allowEmptyContent`); the aggregate
5568
- * {@link JsoncParseError} for malformed input.
5849
+ * {@link JsoncParseError} for malformed input. Defined in terms of
5850
+ * {@link Jsonc.parseTreeResult} — synchronous callers can use that variant
5851
+ * directly.
5569
5852
  *
5570
5853
  * @param text - The JSONC source to parse.
5571
5854
  * @param options - Optional {@link JsoncParseOptions}; defaults apply for
@@ -5574,14 +5857,96 @@ var Jsonc = class Jsonc {
5574
5857
  * `Option.none()` for empty input), or fails with the aggregate
5575
5858
  * {@link JsoncParseError}.
5576
5859
  */
5577
- static parseTree = Effect.fn("Jsonc.parseTree")(function* (text, options) {
5578
- const { root, errors } = parseTree$2(text, toFlags(options));
5579
- if (errors.length > 0) return yield* new JsoncParseError({
5580
- errors: toDetails(text, errors),
5581
- input: text
5582
- });
5583
- return root !== void 0 ? Option.some(root) : Option.none();
5584
- });
5860
+ static parseTree = Effect.fn("Jsonc.parseTree")((text, options) => Effect.fromResult(Jsonc.parseTreeResult(text, options)));
5861
+ /**
5862
+ * Stringify a plain JavaScript value as JSON text, synchronously, returning
5863
+ * a `Result` instead of an `Effect`. With no options the output is
5864
+ * byte-identical to `JSON.stringify(value, null, 2)`.
5865
+ *
5866
+ * Plain JSON emission: JSONC comments exist only in the document/edit layer
5867
+ * (`JsoncNode`, `JsoncEdit`, `JsoncFormatter`), so no comment survives — or
5868
+ * can be produced by — value-level stringification.
5869
+ *
5870
+ * Nested unrepresentable values follow `JSON.stringify`'s documented
5871
+ * semantics: `undefined`, functions and symbols are dropped from objects and
5872
+ * become `null` in arrays. The typed failure channel covers only the cases
5873
+ * where output would be absent or an exception thrown — see
5874
+ * `JsoncStringifyErrorCode`. A throwing `toJSON` method or getter is
5875
+ * caller code failing and rethrows as a defect, never a typed error.
5876
+ *
5877
+ * @remarks
5878
+ * {@link Jsonc.stringify} is defined in terms of this function; the two
5879
+ * never diverge. Reach for the `Effect` variant inside Effect code — it
5880
+ * carries the `Jsonc.stringify` tracing span — and for this one at
5881
+ * synchronous boundaries.
5882
+ *
5883
+ * @example
5884
+ * ```ts
5885
+ * import { Jsonc } from "@effected/jsonc";
5886
+ * import { Result } from "effect";
5887
+ *
5888
+ * const ok = Jsonc.stringifyResult({ port: 3000 });
5889
+ * if (Result.isSuccess(ok)) {
5890
+ * console.log(ok.success); // => '{\n "port": 3000\n}'
5891
+ * }
5892
+ *
5893
+ * const bad = Jsonc.stringifyResult(0n);
5894
+ * if (Result.isFailure(bad)) {
5895
+ * console.log(bad.failure.code); // => "BigIntValue"
5896
+ * }
5897
+ * ```
5898
+ *
5899
+ * @param value - The plain JavaScript value to stringify.
5900
+ * @param options - Optional {@link JsoncStringifyOptions}; defaults apply
5901
+ * for omitted fields.
5902
+ * @returns A `Result` succeeding with the JSON text, or failing with a
5903
+ * {@link JsoncStringifyError}.
5904
+ */
5905
+ static stringifyResult(value, options) {
5906
+ const space = options?.insertSpaces === false ? " " : options?.tabSize ?? 2;
5907
+ let text;
5908
+ try {
5909
+ text = JSON.stringify(value, null, space);
5910
+ } catch (defect) {
5911
+ if (defect instanceof TypeError) {
5912
+ if (/circular|cyclic/i.test(defect.message)) return Result.fail(new JsoncStringifyError({
5913
+ code: "CircularReference",
5914
+ detail: defect.message,
5915
+ value
5916
+ }));
5917
+ if (/bigint/i.test(defect.message)) return Result.fail(new JsoncStringifyError({
5918
+ code: "BigIntValue",
5919
+ detail: defect.message,
5920
+ value
5921
+ }));
5922
+ }
5923
+ throw defect;
5924
+ }
5925
+ if (text === void 0) return Result.fail(new JsoncStringifyError({
5926
+ code: "TopLevelUnrepresentable",
5927
+ detail: "the top-level value (undefined, a function or a symbol) has no JSON representation",
5928
+ value
5929
+ }));
5930
+ return Result.succeed(text);
5931
+ }
5932
+ /**
5933
+ * Stringify a plain JavaScript value as JSON text. With no options the
5934
+ * output is byte-identical to `JSON.stringify(value, null, 2)`. Fails with
5935
+ * {@link JsoncStringifyError} on circular references, `bigint` values and a
5936
+ * top-level value with no JSON representation; nested `undefined`, functions
5937
+ * and symbols follow `JSON.stringify`'s documented semantics (dropped from
5938
+ * objects, `null` in arrays). Comments are a document/edit-layer concern —
5939
+ * value-level stringification never emits them. Defined in terms of
5940
+ * {@link Jsonc.stringifyResult} — synchronous callers can use that variant
5941
+ * directly.
5942
+ *
5943
+ * @param value - The plain JavaScript value to stringify.
5944
+ * @param options - Optional {@link JsoncStringifyOptions}; defaults apply
5945
+ * for omitted fields.
5946
+ * @returns An `Effect` that succeeds with the JSON text, or fails with a
5947
+ * {@link JsoncStringifyError}.
5948
+ */
5949
+ static stringify = Effect.fn("Jsonc.stringify")((value, options) => Effect.fromResult(Jsonc.stringifyResult(value, options)));
5585
5950
  /**
5586
5951
  * Remove all comments from JSONC, producing valid JSON. Pass a `replaceCh`
5587
5952
  * (e.g. `" "`) to replace each comment character instead of deleting it,
@@ -5649,8 +6014,11 @@ var Jsonc = class Jsonc {
5649
6014
  }
5650
6015
  /**
5651
6016
  * A `Schema<unknown, string>` decoding JSONC with the given `options`
5652
- * (defaults when omitted). Encoding is `JSON.stringify` with 2-space indent,
5653
- * so comments do not survive a round-trip encode.
6017
+ * (defaults when omitted). Encoding is {@link Jsonc.stringifyResult} with
6018
+ * default options (2-space indent, byte-identical to
6019
+ * `JSON.stringify(value, null, 2)`), so comments do not survive a
6020
+ * round-trip encode; a {@link JsoncStringifyError} on the encode side
6021
+ * surfaces as a schema issue.
5654
6022
  *
5655
6023
  * @remarks
5656
6024
  * Schema-producing: each call returns a fresh schema whose derivation caches
@@ -5677,7 +6045,7 @@ var Jsonc = class Jsonc {
5677
6045
  }
5678
6046
  return Effect.succeed(value);
5679
6047
  },
5680
- encode: (value) => Effect.succeed(JSON.stringify(value, null, 2))
6048
+ encode: (value) => Effect.fromResult(Jsonc.stringifyResult(value)).pipe(Effect.mapError((error) => new SchemaIssue.InvalidValue(Option.some(value), { message: error.message })))
5681
6049
  })));
5682
6050
  }
5683
6051
  /**
@@ -5703,10 +6071,53 @@ var Jsonc = class Jsonc {
5703
6071
  static schema(target, options) {
5704
6072
  return Jsonc.fromString(options).pipe(Schema.decodeTo(target));
5705
6073
  }
6074
+ /**
6075
+ * Bind a target schema to the JSONC codec once, yielding the composed
6076
+ * schema plus pre-derived `decode`/`encode` directions — the
6077
+ * {@link Jsonc.schema} composition without the generic `Schema` machinery
6078
+ * at every use site. Binds the plain form only: default
6079
+ * {@link JsoncParseOptions} on decode, default stringify options on encode.
6080
+ *
6081
+ * Both directions fail with `Schema.SchemaError`, exactly as
6082
+ * `Schema.decodeEffect`/`Schema.encodeEffect` over {@link Jsonc.schema}
6083
+ * would; the target's decoding/encoding service requirements flow through.
6084
+ *
6085
+ * @remarks
6086
+ * Schema-producing: each call composes a fresh schema and derives both
6087
+ * directions from it. Bind the result to a `const` — that single binding is
6088
+ * the point.
6089
+ *
6090
+ * @example
6091
+ * ```ts
6092
+ * import { Jsonc } from "@effected/jsonc";
6093
+ * import { Effect, Schema } from "effect";
6094
+ *
6095
+ * const Config = Schema.Struct({ port: Schema.Number });
6096
+ * const config = Jsonc.bind(Config);
6097
+ *
6098
+ * const program = Effect.gen(function* () {
6099
+ * const value = yield* config.decode('{ "port": 3000 // dev\n }');
6100
+ * const text = yield* config.encode(value);
6101
+ * return [value, text] as const;
6102
+ * });
6103
+ * ```
6104
+ *
6105
+ * @param target - The domain schema decoded values must satisfy.
6106
+ * @returns A {@link JsoncBoundCodec} carrying the composed schema and its
6107
+ * two pre-bound directions.
6108
+ */
6109
+ static bind(target) {
6110
+ const schema = Jsonc.schema(target);
6111
+ return {
6112
+ schema,
6113
+ decode: Schema.decodeEffect(schema),
6114
+ encode: Schema.encodeEffect(schema)
6115
+ };
6116
+ }
5706
6117
  };
5707
6118
 
5708
6119
  //#endregion
5709
- //#region ../../node_modules/.pnpm/@effected+jsonc@0.3.0_effect@4.0.0-beta.98/node_modules/@effected/jsonc/JsoncEdit.js
6120
+ //#region ../../node_modules/.pnpm/@effected+jsonc@0.5.0_effect@4.0.0-beta.99/node_modules/@effected/jsonc/JsoncEdit.js
5710
6121
  /**
5711
6122
  * A range within a JSONC document, expressed as a zero-based character
5712
6123
  * `offset` and a `length` in UTF-16 code units. Pass to `JsoncFormatter.format`
@@ -5756,7 +6167,8 @@ var JsoncEdit = class extends Schema.Class("JsoncEdit")({
5756
6167
  /**
5757
6168
  * Apply `edits` to `text`, producing a new string. Edits are applied in
5758
6169
  * reverse-offset order so earlier offsets stay valid; the input `edits`
5759
- * array is not mutated. Pure and total.
6170
+ * array is not mutated. Overlapping edits are a programmer error and throw
6171
+ * as a defect — `JsoncFormatter` never produces them.
5760
6172
  *
5761
6173
  * @param text - The source text to edit.
5762
6174
  * @param edits - The edits to apply, in any order.
@@ -5764,6 +6176,11 @@ var JsoncEdit = class extends Schema.Class("JsoncEdit")({
5764
6176
  */
5765
6177
  static applyAll(text, edits) {
5766
6178
  const sorted = [...edits].sort((a, b) => b.offset - a.offset);
6179
+ for (let i = 0; i + 1 < sorted.length; i++) {
6180
+ const upper = sorted[i];
6181
+ const lower = sorted[i + 1];
6182
+ 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`);
6183
+ }
5767
6184
  let result = text;
5768
6185
  for (const edit of sorted) result = result.substring(0, edit.offset) + edit.content + result.substring(edit.offset + edit.length);
5769
6186
  return result;
@@ -5771,7 +6188,7 @@ var JsoncEdit = class extends Schema.Class("JsoncEdit")({
5771
6188
  };
5772
6189
 
5773
6190
  //#endregion
5774
- //#region ../../node_modules/.pnpm/@effected+jsonc@0.3.0_effect@4.0.0-beta.98/node_modules/@effected/jsonc/internal/navigate.js
6191
+ //#region ../../node_modules/.pnpm/@effected+jsonc@0.5.0_effect@4.0.0-beta.99/node_modules/@effected/jsonc/internal/navigate.js
5775
6192
  /**
5776
6193
  * Resolve `path` against `text`, returning where the target is (or where it
5777
6194
  * would be inserted). `path` must be non-empty — the whole-document case is
@@ -5899,7 +6316,7 @@ function navigate(text, path) {
5899
6316
  }
5900
6317
 
5901
6318
  //#endregion
5902
- //#region ../../node_modules/.pnpm/@effected+jsonc@0.3.0_effect@4.0.0-beta.98/node_modules/@effected/jsonc/JsoncModifier.js
6319
+ //#region ../../node_modules/.pnpm/@effected+jsonc@0.5.0_effect@4.0.0-beta.99/node_modules/@effected/jsonc/JsoncModifier.js
5903
6320
  /**
5904
6321
  * Raised when `JsoncModifier.modify` cannot navigate the requested path: the
5905
6322
  * value at `depth` is not the container kind (`expected`) the next path segment
@@ -6028,7 +6445,7 @@ var JsoncModifier = class {
6028
6445
  };
6029
6446
 
6030
6447
  //#endregion
6031
- //#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
6448
+ //#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
6032
6449
  const DepRecord$2 = Schema.optionalKey(Schema.Record(Schema.String, Schema.String));
6033
6450
  const BunWorkspaceEntry = Schema.Struct({
6034
6451
  name: Schema.optionalKey(Schema.String),
@@ -6122,7 +6539,7 @@ const toFields$3 = (raw) => Effect.gen(function* () {
6122
6539
  });
6123
6540
 
6124
6541
  //#endregion
6125
- //#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
6542
+ //#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
6126
6543
  const DepRecord$1 = Schema.optionalKey(Schema.Record(Schema.String, Schema.String));
6127
6544
  const NpmPackageEntry = Schema.Struct({
6128
6545
  name: Schema.optionalKey(Schema.String),
@@ -6221,7 +6638,7 @@ const toFields$2 = (raw) => Effect.gen(function* () {
6221
6638
  });
6222
6639
 
6223
6640
  //#endregion
6224
- //#region ../../node_modules/.pnpm/@effected+yaml@0.3.1_effect@4.0.0-beta.98/node_modules/@effected/yaml/YamlNode.js
6641
+ //#region ../../node_modules/.pnpm/@effected+yaml@0.5.0_effect@4.0.0-beta.99/node_modules/@effected/yaml/YamlNode.js
6225
6642
  /**
6226
6643
  * YAML scalar presentation styles.
6227
6644
  *
@@ -6241,6 +6658,16 @@ const ScalarStyle = Schema.Literals([
6241
6658
  */
6242
6659
  const CollectionStyle = Schema.Literals(["block", "flow"]);
6243
6660
  /**
6661
+ * Quote characters available to the stringifier's plain-scalar fallback: the
6662
+ * style a `plain`-styled scalar is rendered in when it turns out to require
6663
+ * quoting. Referenced by the `quoteStyle` field of `YamlStringifyOptions`;
6664
+ * unlike `ScalarStyle` it is a stringify-option vocabulary, never a property
6665
+ * of a composed node.
6666
+ *
6667
+ * @public
6668
+ */
6669
+ const QuoteStyle = Schema.Literals(["single", "double"]);
6670
+ /**
6244
6671
  * Block-scalar chomping indicators (`-` strip, default clip, `+` keep).
6245
6672
  * Referenced by the {@link YamlScalar} `chomp` field schema.
6246
6673
  *
@@ -6614,7 +7041,7 @@ function nodeToValue(node, anchors, budget, counting = false) {
6614
7041
  }
6615
7042
 
6616
7043
  //#endregion
6617
- //#region ../../node_modules/.pnpm/@effected+yaml@0.3.1_effect@4.0.0-beta.98/node_modules/@effected/yaml/internal/diagnostics.js
7044
+ //#region ../../node_modules/.pnpm/@effected+yaml@0.5.0_effect@4.0.0-beta.99/node_modules/@effected/yaml/internal/diagnostics.js
6618
7045
  /** Error codes emitted by the lexer stage. */
6619
7046
  const YAML_LEX_ERROR_CODES = [
6620
7047
  "UnexpectedCharacter",
@@ -6693,7 +7120,7 @@ function isFatalCode(code) {
6693
7120
  }
6694
7121
 
6695
7122
  //#endregion
6696
- //#region ../../node_modules/.pnpm/@effected+yaml@0.3.1_effect@4.0.0-beta.98/node_modules/@effected/yaml/YamlDiagnostic.js
7123
+ //#region ../../node_modules/.pnpm/@effected+yaml@0.5.0_effect@4.0.0-beta.99/node_modules/@effected/yaml/YamlDiagnostic.js
6697
7124
  /**
6698
7125
  * Error codes emitted by the lexer stage.
6699
7126
  *
@@ -6815,7 +7242,7 @@ function lineChar(text, offset) {
6815
7242
  }
6816
7243
 
6817
7244
  //#endregion
6818
- //#region ../../node_modules/.pnpm/@effected+yaml@0.3.1_effect@4.0.0-beta.98/node_modules/@effected/yaml/internal/composer/anchors.js
7245
+ //#region ../../node_modules/.pnpm/@effected+yaml@0.5.0_effect@4.0.0-beta.99/node_modules/@effected/yaml/internal/composer/anchors.js
6819
7246
  /**
6820
7247
  * Check if a pending anchor is being applied to an alias node (invalid in YAML 1.2 §3.2.2).
6821
7248
  * Aliases represent references to existing anchored nodes and cannot have their own anchors.
@@ -6909,7 +7336,7 @@ function collectAnchors(node, anchors) {
6909
7336
  }
6910
7337
 
6911
7338
  //#endregion
6912
- //#region ../../node_modules/.pnpm/@effected+yaml@0.3.1_effect@4.0.0-beta.98/node_modules/@effected/yaml/internal/lexer.js
7339
+ //#region ../../node_modules/.pnpm/@effected+yaml@0.5.0_effect@4.0.0-beta.99/node_modules/@effected/yaml/internal/lexer.js
6913
7340
  /**
6914
7341
  * Create a new YAML scanner for the given source text.
6915
7342
  *
@@ -7867,7 +8294,7 @@ function lexAll(text) {
7867
8294
  }
7868
8295
 
7869
8296
  //#endregion
7870
- //#region ../../node_modules/.pnpm/@effected+yaml@0.3.1_effect@4.0.0-beta.98/node_modules/@effected/yaml/internal/cst-parser.js
8297
+ //#region ../../node_modules/.pnpm/@effected+yaml@0.5.0_effect@4.0.0-beta.99/node_modules/@effected/yaml/internal/cst-parser.js
7871
8298
  /**
7872
8299
  * Hardening: cap CST nesting so hostile inputs cannot overflow the stack
7873
8300
  * while the tree is being BUILT. Set slightly above the composer's
@@ -8580,7 +9007,7 @@ function parseCSTAll(text) {
8580
9007
  }
8581
9008
 
8582
9009
  //#endregion
8583
- //#region ../../node_modules/.pnpm/@effected+yaml@0.3.1_effect@4.0.0-beta.98/node_modules/@effected/yaml/internal/composer/state.js
9010
+ //#region ../../node_modules/.pnpm/@effected+yaml@0.5.0_effect@4.0.0-beta.99/node_modules/@effected/yaml/internal/composer/state.js
8584
9011
  let lineStartsText;
8585
9012
  let lineStartsCache = [];
8586
9013
  function getLineStarts(text) {
@@ -8687,7 +9114,7 @@ function exitNesting(state) {
8687
9114
  }
8688
9115
 
8689
9116
  //#endregion
8690
- //#region ../../node_modules/.pnpm/@effected+yaml@0.3.1_effect@4.0.0-beta.98/node_modules/@effected/yaml/internal/composer/tags.js
9117
+ //#region ../../node_modules/.pnpm/@effected+yaml@0.5.0_effect@4.0.0-beta.99/node_modules/@effected/yaml/internal/composer/tags.js
8691
9118
  /**
8692
9119
  * Resolve a tag shorthand using the document's %TAG directives.
8693
9120
  * For example, with `%TAG !! tag:example.com,2000:app/`, the tag `!!int`
@@ -8774,7 +9201,7 @@ function validateTagHandlesInDocument(docCst, state) {
8774
9201
  }
8775
9202
 
8776
9203
  //#endregion
8777
- //#region ../../node_modules/.pnpm/@effected+yaml@0.3.1_effect@4.0.0-beta.98/node_modules/@effected/yaml/internal/composer/scalars.js
9204
+ //#region ../../node_modules/.pnpm/@effected+yaml@0.5.0_effect@4.0.0-beta.99/node_modules/@effected/yaml/internal/composer/scalars.js
8778
9205
  const NULL_RE$1 = /^(?:null|Null|NULL|~)$/;
8779
9206
  const TRUE_RE$1 = /^(?:true|True|TRUE)$/;
8780
9207
  const FALSE_RE$1 = /^(?:false|False|FALSE)$/;
@@ -9653,7 +10080,7 @@ function shouldPreserveRaw(rawValue, value) {
9653
10080
  }
9654
10081
 
9655
10082
  //#endregion
9656
- //#region ../../node_modules/.pnpm/@effected+yaml@0.3.1_effect@4.0.0-beta.98/node_modules/@effected/yaml/internal/composer/block.js
10083
+ //#region ../../node_modules/.pnpm/@effected+yaml@0.5.0_effect@4.0.0-beta.99/node_modules/@effected/yaml/internal/composer/block.js
9657
10084
  /**
9658
10085
  * Compose a block map from its CST children, with an optional external first key.
9659
10086
  *
@@ -10802,7 +11229,7 @@ function composeFlatBlockMap(children, startIdx, parentCst, state, externalFirst
10802
11229
  }
10803
11230
 
10804
11231
  //#endregion
10805
- //#region ../../node_modules/.pnpm/@effected+yaml@0.3.1_effect@4.0.0-beta.98/node_modules/@effected/yaml/internal/composer/flow.js
11232
+ //#region ../../node_modules/.pnpm/@effected+yaml@0.5.0_effect@4.0.0-beta.99/node_modules/@effected/yaml/internal/composer/flow.js
10806
11233
  /**
10807
11234
  * Validate that flow collection entries are separated by commas.
10808
11235
  *
@@ -11195,7 +11622,7 @@ function composeFlowSeqInner(cst, state, meta, parentBlockColumn) {
11195
11622
  }
11196
11623
 
11197
11624
  //#endregion
11198
- //#region ../../node_modules/.pnpm/@effected+yaml@0.3.1_effect@4.0.0-beta.98/node_modules/@effected/yaml/internal/composer/document.js
11625
+ //#region ../../node_modules/.pnpm/@effected+yaml@0.5.0_effect@4.0.0-beta.99/node_modules/@effected/yaml/internal/composer/document.js
11199
11626
  /** The flow-composer dispatch wired into every state this module creates. */
11200
11627
  const FLOW = {
11201
11628
  composeFlowMap,
@@ -11862,7 +12289,7 @@ function composeAllDocuments(text, options) {
11862
12289
  }
11863
12290
 
11864
12291
  //#endregion
11865
- //#region ../../node_modules/.pnpm/@effected+yaml@0.3.1_effect@4.0.0-beta.98/node_modules/@effected/yaml/internal/fold.js
12292
+ //#region ../../node_modules/.pnpm/@effected+yaml@0.5.0_effect@4.0.0-beta.99/node_modules/@effected/yaml/internal/fold.js
11866
12293
  /**
11867
12294
  * Column-based line folding for a single logical scalar line (YAML 1.2 flow
11868
12295
  * folding, §7.3 / §8.2.1). Breaks the content at "safe" single-space
@@ -12099,7 +12526,7 @@ function renderBlockFolded(s, indent) {
12099
12526
  }
12100
12527
 
12101
12528
  //#endregion
12102
- //#region ../../node_modules/.pnpm/@effected+yaml@0.3.1_effect@4.0.0-beta.98/node_modules/@effected/yaml/internal/stringifier.js
12529
+ //#region ../../node_modules/.pnpm/@effected+yaml@0.5.0_effect@4.0.0-beta.99/node_modules/@effected/yaml/internal/stringifier.js
12103
12530
  /**
12104
12531
  * Thrown by the stringifier on its failure paths (circular references). The
12105
12532
  * facade catches this and materializes the public stringify error.
@@ -12205,7 +12632,10 @@ function requiresQuoting(s, ignoreType = false) {
12205
12632
  if (s.includes(" #") || s.includes(" #")) return true;
12206
12633
  const last = s[s.length - 1];
12207
12634
  if (last === " " || last === " ") return true;
12208
- for (let i = 0; i < s.length; i++) if (isControlChar(s.charCodeAt(i))) return true;
12635
+ for (let i = 0; i < s.length; i++) {
12636
+ const code = s.charCodeAt(i);
12637
+ if (code === 9 || code === 13 || isControlChar(code)) return true;
12638
+ }
12209
12639
  return false;
12210
12640
  }
12211
12641
  /**
@@ -12262,11 +12692,13 @@ function renderSingleQuoted(s) {
12262
12692
  *
12263
12693
  * Multi-line strings are routed to block styles regardless of the requested
12264
12694
  * style (except double-quoted). For single-line strings, plain style delegates
12265
- * to {@link requiresQuoting} and falls back to double-quoted when the value
12266
- * would be ambiguous. Block literal and block folded styles are always
12267
- * accepted for single-line strings even though the output is unusual.
12695
+ * to {@link requiresQuoting} and falls back to `quoteStyle` (single-quoted by
12696
+ * default, double-quoted when the caller asked for it) or to double-quoted
12697
+ * regardless when the value needs YAML escapes single quotes cannot express.
12698
+ * Block literal and block folded styles are always accepted for single-line
12699
+ * strings even though the output is unusual.
12268
12700
  */
12269
- function renderString(s, style, indent, ignoreType = false, canonical = false, explicitChomp, parentPosition) {
12701
+ function renderString(s, style, indent, ignoreType = false, canonical = false, explicitChomp, parentPosition, quoteStyle = "single") {
12270
12702
  if (s.includes("\n")) {
12271
12703
  let hasControl = false;
12272
12704
  for (let i = 0; i < s.length; i++) {
@@ -12300,7 +12732,7 @@ function renderString(s, style, indent, ignoreType = false, canonical = false, e
12300
12732
  if (requiresQuoting(s, ignoreType)) {
12301
12733
  if (s.includes(" ") || s.includes("\r")) return renderDoubleQuoted(s, canonical);
12302
12734
  for (let i = 0; i < s.length; i++) if (isControlChar(s.charCodeAt(i))) return renderDoubleQuoted(s, canonical);
12303
- return renderSingleQuoted(s);
12735
+ return quoteStyle === "double" ? renderDoubleQuoted(s, canonical) : renderSingleQuoted(s);
12304
12736
  }
12305
12737
  return s;
12306
12738
  case "single-quoted": return renderSingleQuoted(s);
@@ -12340,6 +12772,7 @@ function createContext(options) {
12340
12772
  defaultCollectionStyle: options?.defaultCollectionStyle ?? "block",
12341
12773
  sortKeys: options?.sortKeys ?? false,
12342
12774
  indentSequences: options?.indentSequences ?? false,
12775
+ quoteStyle: options?.quoteStyle ?? "single",
12343
12776
  forceDefaultStyles: options?.forceDefaultStyles ?? false,
12344
12777
  seen: /* @__PURE__ */ new Set()
12345
12778
  };
@@ -12359,7 +12792,7 @@ function stringifyLines(value, ctx, depth, allowFold = true) {
12359
12792
  if (typeof value === "bigint") return [value.toString()];
12360
12793
  if (typeof value === "string") {
12361
12794
  const indentStr = " ".repeat(ctx.indent);
12362
- const rendered = renderString(value, ctx.defaultScalarStyle, indentStr, false, ctx.forceDefaultStyles);
12795
+ const rendered = renderString(value, ctx.defaultScalarStyle, indentStr, false, ctx.forceDefaultStyles, void 0, void 0, ctx.quoteStyle);
12363
12796
  return (allowFold && ctx.lineWidth > 0 ? foldRenderedScalar(rendered, indentStr, ctx.lineWidth) : rendered).split("\n");
12364
12797
  }
12365
12798
  if (Array.isArray(value)) {
@@ -12424,10 +12857,11 @@ function stringifyObjectLines(obj, ctx, depth) {
12424
12857
  const keys = Object.keys(obj);
12425
12858
  if (keys.length === 0) return ["{}"];
12426
12859
  if (ctx.sortKeys) keys.sort();
12860
+ const renderPlainKey = (k) => renderString(k, "plain", "", false, false, void 0, void 0, ctx.quoteStyle);
12427
12861
  if (ctx.defaultCollectionStyle === "flow") return [`{${keys.map((k) => {
12428
- return `${renderString(k, "plain", "")}: ${stringifyLines(obj[k], ctx, depth + 1, false).join(" ")}`;
12862
+ return `${renderPlainKey(k)}: ${stringifyLines(obj[k], ctx, depth + 1, false).join(" ")}`;
12429
12863
  }).join(", ")}}`];
12430
- const renderKey = (k) => k.includes("\n") ? renderDoubleQuoted(k, ctx.forceDefaultStyles) : renderString(k, "plain", "");
12864
+ const renderKey = (k) => k.includes("\n") ? renderDoubleQuoted(k, ctx.forceDefaultStyles) : renderPlainKey(k);
12431
12865
  const pad = " ".repeat(ctx.indent);
12432
12866
  const lines = [];
12433
12867
  for (const k of keys) {
@@ -12464,7 +12898,7 @@ function stringifyValue(value, options) {
12464
12898
  }
12465
12899
 
12466
12900
  //#endregion
12467
- //#region ../../node_modules/.pnpm/@effected+yaml@0.3.1_effect@4.0.0-beta.98/node_modules/@effected/yaml/Yaml.js
12901
+ //#region ../../node_modules/.pnpm/@effected+yaml@0.5.0_effect@4.0.0-beta.99/node_modules/@effected/yaml/Yaml.js
12468
12902
  /**
12469
12903
  * Options controlling parse behavior. All fields are omissible; absent fields
12470
12904
  * resolve to `strict` `true`, `maxAliasCount` `100` (the alias-based
@@ -12494,8 +12928,8 @@ var YamlParseOptions = class extends Schema.Class("YamlParseOptions")({
12494
12928
  * Options controlling stringify behavior. All fields are omissible; absent
12495
12929
  * fields resolve to `indent` `2`, `lineWidth` `0`, `defaultScalarStyle`
12496
12930
  * `"plain"`, `defaultCollectionStyle` `"block"`, `sortKeys` `false`,
12497
- * `indentSequences` `false`, `finalNewline` `true` and `forceDefaultStyles`
12498
- * `false`.
12931
+ * `indentSequences` `false`, `quoteStyle` `"single"`, `finalNewline` `true`
12932
+ * and `forceDefaultStyles` `false`.
12499
12933
  *
12500
12934
  * `lineWidth` controls column-based scalar folding. The default `0` (and any
12501
12935
  * value `<= 0`) never wraps, emitting byte-identical output to the historic
@@ -12512,6 +12946,18 @@ var YamlParseOptions = class extends Schema.Class("YamlParseOptions")({
12512
12946
  * matching the `yaml` npm package's default output. Top-level sequences stay
12513
12947
  * at column zero in both modes.
12514
12948
  *
12949
+ * `quoteStyle` selects the quote character used when a `plain`-styled scalar
12950
+ * (the `defaultScalarStyle` default) turns out to require quoting: `"single"`
12951
+ * (the default) emits `'@parcel/watcher'` — the kit's byte-compatible legacy
12952
+ * form — while `"double"` emits `"@parcel/watcher"`, matching the `yaml` npm
12953
+ * package's `singleQuote: false` output. It is a fallback selector only:
12954
+ * scalars that need no quoting stay plain, and an explicit
12955
+ * `defaultScalarStyle` of `"single-quoted"` or `"double-quoted"` still wins.
12956
+ * On that plain fallback path, values carrying a tab, a carriage return or
12957
+ * any other C0 control character are always emitted double-quoted whichever
12958
+ * `quoteStyle` is set, since only double quotes can escape them into a form
12959
+ * that round-trips exactly.
12960
+ *
12515
12961
  * Construct with the validated `YamlStringifyOptions.make({ ... })` static —
12516
12962
  * the kit convention (never `new`). Call sites that take a
12517
12963
  * `YamlStringifyOptions` also accept a structurally-matching plain literal.
@@ -12537,7 +12983,7 @@ var YamlStringifyOptions = class extends Schema.Class("YamlStringifyOptions")({
12537
12983
  * (`>`) scalars at approximately that column, never block-literal (`|`).
12538
12984
  *
12539
12985
  * Takes effect only through {@link Yaml.stringify} and
12540
- * {@link Yaml.stringifySync} — the two entry points that accept these
12986
+ * {@link Yaml.stringifyResult} — the two entry points that accept these
12541
12987
  * options on the value path. The schema factories ({@link Yaml.fromString},
12542
12988
  * {@link Yaml.schema}, {@link Yaml.YamlFromString}) encode with default
12543
12989
  * stringify options (`lineWidth` `0`), so their output never folds. The
@@ -12550,6 +12996,17 @@ var YamlStringifyOptions = class extends Schema.Class("YamlStringifyOptions")({
12550
12996
  defaultCollectionStyle: Schema.optionalKey(CollectionStyle),
12551
12997
  sortKeys: Schema.optionalKey(Schema.Boolean),
12552
12998
  indentSequences: Schema.optionalKey(Schema.Boolean),
12999
+ /**
13000
+ * Quote style used when a `plain`-styled scalar requires quoting. Default
13001
+ * `"single"` — the released byte-compatible behavior. `"double"` renders
13002
+ * the same scalars double-quoted instead, matching the `yaml` npm
13003
+ * package's `singleQuote: false` output.
13004
+ *
13005
+ * Affects only the plain fallback: scalars that need no quoting stay
13006
+ * plain, and an explicit `defaultScalarStyle` of `"single-quoted"` or
13007
+ * `"double-quoted"` is unaffected.
13008
+ */
13009
+ quoteStyle: Schema.optionalKey(QuoteStyle),
12553
13010
  finalNewline: Schema.optionalKey(Schema.Boolean),
12554
13011
  forceDefaultStyles: Schema.optionalKey(Schema.Boolean)
12555
13012
  }) {};
@@ -12599,6 +13056,7 @@ const toStringifyInput = (options) => options === void 0 ? {} : {
12599
13056
  defaultCollectionStyle: options.defaultCollectionStyle,
12600
13057
  sortKeys: options.sortKeys,
12601
13058
  indentSequences: options.indentSequences,
13059
+ quoteStyle: options.quoteStyle,
12602
13060
  finalNewline: options.finalNewline,
12603
13061
  forceDefaultStyles: options.forceDefaultStyles
12604
13062
  };
@@ -12656,7 +13114,7 @@ const stringifyDefectToError = (defect, value) => {
12656
13114
  * mode (fatal diagnostics, duplicate keys, a "billion laughs" blow-up) yields
12657
13115
  * a `Failure` carrying a typed {@link YamlParseError} — never a throw.
12658
13116
  */
12659
- const parseSyncImpl = (text, options) => {
13117
+ const parseResultImpl = (text, options) => {
12660
13118
  const doc = composeFirstDocument(text, toParseInput(options));
12661
13119
  const failures = failureRecords(doc, options?.uniqueKeys ?? true);
12662
13120
  if (failures.length > 0) return Result.fail(new YamlParseError({
@@ -12677,7 +13135,7 @@ const parseSyncImpl = (text, options) => {
12677
13135
  * recursion budget yields a `Failure` carrying a typed {@link YamlStringifyError},
12678
13136
  * never a thrown defect.
12679
13137
  */
12680
- const stringifySyncImpl = (value, options) => {
13138
+ const stringifyResultImpl = (value, options) => {
12681
13139
  try {
12682
13140
  return Result.succeed(stringifyValue(value, toStringifyInput(options)));
12683
13141
  } catch (defect) {
@@ -12754,17 +13212,11 @@ var Yaml = class Yaml {
12754
13212
  * resolved size grows exponentially relative to `maxAliasCount`) also
12755
13213
  * fails through {@link YamlParseError} with an `AliasCountExceeded`
12756
13214
  * diagnostic, never as an unhandled defect.
13215
+ *
13216
+ * Defined in terms of {@link Yaml.parseResult} — synchronous callers can
13217
+ * use that variant directly.
12757
13218
  */
12758
- static parse = Effect.fn("Yaml.parse")(function* (text, options) {
12759
- const doc = composeFirstDocument(text, toParseInput(options));
12760
- const failures = failureRecords(doc, options?.uniqueKeys ?? true);
12761
- if (failures.length > 0) return yield* new YamlParseError({
12762
- diagnostics: toDiagnostics(text, failures),
12763
- input: text
12764
- });
12765
- const anchors = /* @__PURE__ */ new Map();
12766
- return yield* extractDocumentValue(doc.contents, anchors, options?.maxAliasCount ?? 100, text);
12767
- });
13219
+ static parse = Effect.fn("Yaml.parse")((text, options) => Effect.fromResult(Yaml.parseResult(text, options)));
12768
13220
  /**
12769
13221
  * Parse a multi-document YAML stream into an array of plain JavaScript
12770
13222
  * values (one per document, in order). Any fatal diagnostic in any
@@ -12797,6 +13249,15 @@ var Yaml = class Yaml {
12797
13249
  * or on a value nested deeper than the stringifier's recursion budget
12798
13250
  * (`NestingDepthExceeded`) — both surface through the typed error channel
12799
13251
  * rather than as an unhandled stack-overflow defect.
13252
+ *
13253
+ * @remarks
13254
+ * A `"<<"` object key is emitted **quoted** (`'<<': …`). This is the
13255
+ * opposite of the document path ({@link YamlFormat.format} and
13256
+ * `YamlDocument#stringify`), which leaves a parsed plain `<<` key unquoted
13257
+ * so it keeps its merge-key meaning, and the asymmetry is deliberate: a
13258
+ * `"<<"` key on a plain JavaScript object is an ordinary string key that
13259
+ * never carried merge semantics, so emitting it plain would silently turn
13260
+ * ordinary data into a merge directive.
12800
13261
  */
12801
13262
  static stringify = Effect.fn("Yaml.stringify")(function* (value, options) {
12802
13263
  return yield* stringifyOrFail(value, options);
@@ -12804,8 +13265,14 @@ var Yaml = class Yaml {
12804
13265
  /**
12805
13266
  * Synchronous single-document parse, returning a `Result` instead of
12806
13267
  * an `Effect`. A pure escape hatch for config-time callers that cannot
12807
- * `await` an Effect (a `vitest.config.ts` is the motivating case): it runs
12808
- * the same engine as {@link Yaml.parse} inline.
13268
+ * `await` an Effect (a `vitest.config.ts` is the motivating case).
13269
+ *
13270
+ * @remarks
13271
+ * This is the package's single parse path. {@link Yaml.parse} is defined in
13272
+ * terms of it (`Effect.fromResult` behind the named span), so the two
13273
+ * variants cannot diverge. Reach for the `Effect` variant inside Effect
13274
+ * code — it carries the `Yaml.parse` tracing span — and for this one at
13275
+ * synchronous boundaries.
12809
13276
  *
12810
13277
  * Preserves the package contract — malformed and adversarial input fails
12811
13278
  * typed, never as a defect. Fatal diagnostics, duplicate keys and a
@@ -12817,7 +13284,7 @@ var Yaml = class Yaml {
12817
13284
  * import { Yaml } from "@effected/yaml";
12818
13285
  * import { Result } from "effect";
12819
13286
  *
12820
- * const result = Yaml.parseSync("name: Alice\nage: 30");
13287
+ * const result = Yaml.parseResult("name: Alice\nage: 30");
12821
13288
  * if (Result.isSuccess(result)) {
12822
13289
  * result.success; // { name: "Alice", age: 30 }
12823
13290
  * } else {
@@ -12827,8 +13294,8 @@ var Yaml = class Yaml {
12827
13294
  *
12828
13295
  * @public
12829
13296
  */
12830
- static parseSync(text, options) {
12831
- return parseSyncImpl(text, options);
13297
+ static parseResult(text, options) {
13298
+ return parseResultImpl(text, options);
12832
13299
  }
12833
13300
  /**
12834
13301
  * Synchronous stringify, returning a `Result` instead of an `Effect`.
@@ -12845,7 +13312,7 @@ var Yaml = class Yaml {
12845
13312
  * import { Yaml } from "@effected/yaml";
12846
13313
  * import { Result } from "effect";
12847
13314
  *
12848
- * const result = Yaml.stringifySync({ name: "Alice" });
13315
+ * const result = Yaml.stringifyResult({ name: "Alice" });
12849
13316
  * if (Result.isFailure(result)) {
12850
13317
  * result.failure; // YamlStringifyError
12851
13318
  * } else {
@@ -12855,8 +13322,8 @@ var Yaml = class Yaml {
12855
13322
  *
12856
13323
  * @public
12857
13324
  */
12858
- static stringifySync(value, options) {
12859
- return stringifySyncImpl(value, options);
13325
+ static stringifyResult(value, options) {
13326
+ return stringifyResultImpl(value, options);
12860
13327
  }
12861
13328
  /**
12862
13329
  * Strip comments from YAML text. Without `replaceCh`, comment characters
@@ -12985,6 +13452,51 @@ var Yaml = class Yaml {
12985
13452
  static schema(target, options) {
12986
13453
  return Yaml.fromString(options).pipe(Schema.decodeTo(target));
12987
13454
  }
13455
+ /**
13456
+ * Bind a target schema to the YAML codec once, yielding the composed
13457
+ * schema plus pre-derived `decode`/`encode` directions — the
13458
+ * {@link Yaml.schema} composition without the generic `Schema` machinery
13459
+ * at every use site. Binds the plain single-document form only: default
13460
+ * {@link YamlParseOptions} on decode, default stringify options on encode;
13461
+ * for multi-document streams compose over {@link Yaml.allFromString}
13462
+ * directly.
13463
+ *
13464
+ * Both directions fail with `Schema.SchemaError`, exactly as
13465
+ * `Schema.decodeEffect`/`Schema.encodeEffect` over {@link Yaml.schema}
13466
+ * would; the target's decoding/encoding service requirements flow through.
13467
+ *
13468
+ * @remarks
13469
+ * Schema-producing: each call composes a fresh schema and derives both
13470
+ * directions from it. Bind the result to a `const` — that single binding is
13471
+ * the point.
13472
+ *
13473
+ * @example
13474
+ * ```ts
13475
+ * import { Yaml } from "@effected/yaml";
13476
+ * import { Effect, Schema } from "effect";
13477
+ *
13478
+ * const Config = Schema.Struct({ port: Schema.Number });
13479
+ * const config = Yaml.bind(Config);
13480
+ *
13481
+ * const program = Effect.gen(function* () {
13482
+ * const value = yield* config.decode("port: 3000");
13483
+ * const text = yield* config.encode(value);
13484
+ * return [value, text] as const;
13485
+ * });
13486
+ * ```
13487
+ *
13488
+ * @param target - The domain schema decoded values must satisfy.
13489
+ * @returns A {@link YamlBoundCodec} carrying the composed schema and its
13490
+ * two pre-bound directions.
13491
+ */
13492
+ static bind(target) {
13493
+ const schema = Yaml.schema(target);
13494
+ return {
13495
+ schema,
13496
+ decode: Schema.decodeEffect(schema),
13497
+ encode: Schema.encodeEffect(schema)
13498
+ };
13499
+ }
12988
13500
  };
12989
13501
  /**
12990
13502
  * Parse for `equals`/`equalsValue`: any recorded error — fatal or not — or a
@@ -13038,7 +13550,7 @@ function deepEqualValues(a, b) {
13038
13550
  }
13039
13551
 
13040
13552
  //#endregion
13041
- //#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
13553
+ //#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
13042
13554
  /**
13043
13555
  * An empty YAML document composes to `null` (`Yaml.parseAll("")` is `[null]`,
13044
13556
  * and the trailing document of an env-only `pnpm-lock.yaml` is `null` too).
@@ -13109,7 +13621,7 @@ const selectSoleDocument = (content) => Effect.gen(function* () {
13109
13621
  });
13110
13622
 
13111
13623
  //#endregion
13112
- //#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
13624
+ //#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
13113
13625
  const PnpmImporterDeps = Schema.optionalKey(Schema.Record(Schema.String, Schema.Struct({
13114
13626
  specifier: Schema.String,
13115
13627
  version: Schema.String
@@ -13236,7 +13748,7 @@ const toFields$1 = (raw) => Effect.gen(function* () {
13236
13748
  });
13237
13749
 
13238
13750
  //#endregion
13239
- //#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
13751
+ //#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
13240
13752
  const YarnLockfileRaw = Schema.Record(Schema.String, Schema.Unknown);
13241
13753
  const DepRecord = Schema.optionalKey(Schema.Record(Schema.String, Schema.String));
13242
13754
  const YarnEntry = Schema.Struct({
@@ -13360,7 +13872,7 @@ const cleanYarnDeps = (deps) => {
13360
13872
  };
13361
13873
 
13362
13874
  //#endregion
13363
- //#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
13875
+ //#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
13364
13876
  const EMPTY_IMPORTERS = [];
13365
13877
  /**
13366
13878
  * Failure of `Lockfile.parse`: the given content is not a valid lockfile of
@@ -13605,7 +14117,7 @@ var Lockfile = class Lockfile extends Schema.Class("Lockfile")({
13605
14117
  };
13606
14118
 
13607
14119
  //#endregion
13608
- //#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
14120
+ //#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
13609
14121
  /**
13610
14122
  * The minimal manifest shape {@link LockfileIntegrity.compare} checks a
13611
14123
  * lockfile against: a package name plus the four optional dependency maps.
@@ -13722,7 +14234,7 @@ var LockfileIntegrity = class LockfileIntegrity extends Schema.Class("LockfileIn
13722
14234
  };
13723
14235
 
13724
14236
  //#endregion
13725
- //#region ../../node_modules/.pnpm/@effected+package-json@0.3.0_effect@4.0.0-beta.98/node_modules/@effected/package-json/Dependency.js
14237
+ //#region ../../node_modules/.pnpm/@effected+package-json@0.4.1_effect@4.0.0-beta.99/node_modules/@effected/package-json/Dependency.js
13726
14238
  /**
13727
14239
  * A resolved dependency entry pairing a package name with its version
13728
14240
  * specifier and the `kind` of map it came from (`@effected/npm`'s
@@ -13787,7 +14299,7 @@ var Dependency = class extends Schema.Class("Dependency")({
13787
14299
  };
13788
14300
 
13789
14301
  //#endregion
13790
- //#region ../../node_modules/.pnpm/@effected+package-json@0.3.0_effect@4.0.0-beta.98/node_modules/@effected/package-json/DevEngines.js
14302
+ //#region ../../node_modules/.pnpm/@effected+package-json@0.4.1_effect@4.0.0-beta.99/node_modules/@effected/package-json/DevEngines.js
13791
14303
  /**
13792
14304
  * A single `devEngines` constraint with a name and optional `version` / `onFail`.
13793
14305
  *
@@ -14828,7 +15340,7 @@ var require_spdx_expression_parse = /* @__PURE__ */ __commonJSMin(((exports, mod
14828
15340
  }));
14829
15341
 
14830
15342
  //#endregion
14831
- //#region ../../node_modules/.pnpm/@effected+package-json@0.3.0_effect@4.0.0-beta.98/node_modules/@effected/package-json/License.js
15343
+ //#region ../../node_modules/.pnpm/@effected+package-json@0.4.1_effect@4.0.0-beta.99/node_modules/@effected/package-json/License.js
14832
15344
  var import_spdx_expression_parse = /* @__PURE__ */ __toESM(require_spdx_expression_parse(), 1);
14833
15345
  /**
14834
15346
  * Indicates that a string is not a valid SPDX license identifier or expression.
@@ -14870,7 +15382,7 @@ const isValidSpdx = (value) => {
14870
15382
  const SpdxLicense = Schema.String.pipe(Schema.check(Schema.makeFilter((value) => isValidSpdx(value) ? void 0 : "Expected a valid SPDX license expression")), Schema.brand("SpdxLicense"));
14871
15383
 
14872
15384
  //#endregion
14873
- //#region ../../node_modules/.pnpm/@effected+package-json@0.3.0_effect@4.0.0-beta.98/node_modules/@effected/package-json/PackageManager.js
15385
+ //#region ../../node_modules/.pnpm/@effected+package-json@0.4.1_effect@4.0.0-beta.99/node_modules/@effected/package-json/PackageManager.js
14874
15386
  const PACKAGE_MANAGER_RE = /^([a-z]+)@(\d+\.\d+\.\d+(?:-[a-zA-Z0-9._-]+)?)(?:\+(.+))?$/;
14875
15387
  /**
14876
15388
  * The `packageManager` field only ever carries corepack's `<algo>.<hex>`
@@ -14929,7 +15441,7 @@ var PackageManager = class PackageManager extends Schema.Class("PackageManager")
14929
15441
  };
14930
15442
 
14931
15443
  //#endregion
14932
- //#region ../../node_modules/.pnpm/@effected+package-json@0.3.0_effect@4.0.0-beta.98/node_modules/@effected/package-json/PackageName.js
15444
+ //#region ../../node_modules/.pnpm/@effected+package-json@0.4.1_effect@4.0.0-beta.99/node_modules/@effected/package-json/PackageName.js
14933
15445
  /**
14934
15446
  * Indicates that a string could not be used as a valid npm package name.
14935
15447
  *
@@ -14988,7 +15500,7 @@ const PackageName = Object.assign(Schema.Union([ScopedPackageName, UnscopedPacka
14988
15500
  });
14989
15501
 
14990
15502
  //#endregion
14991
- //#region ../../node_modules/.pnpm/@effected+package-json@0.3.0_effect@4.0.0-beta.98/node_modules/@effected/package-json/Person.js
15503
+ //#region ../../node_modules/.pnpm/@effected+package-json@0.4.1_effect@4.0.0-beta.99/node_modules/@effected/package-json/Person.js
14992
15504
  const parsePersonString = (input) => {
14993
15505
  const emailMatch = input.match(/<([^>]+)>/);
14994
15506
  const urlMatch = input.match(/\(([^)]+)\)/);
@@ -15002,8 +15514,56 @@ const parsePersonString = (input) => {
15002
15514
  ...urlMatch !== null ? { url: urlMatch[1] } : {}
15003
15515
  });
15004
15516
  };
15517
+ const serializePerson = (person) => {
15518
+ let result = person.name;
15519
+ if (person.email !== void 0) result += ` <${person.email}>`;
15520
+ if (person.url !== void 0) result += ` (${person.url})`;
15521
+ return result;
15522
+ };
15523
+ const wireForms = /* @__PURE__ */ new WeakMap();
15524
+ const rememberWire = (person, wire) => {
15525
+ wireForms.set(person, wire);
15526
+ return person;
15527
+ };
15528
+ const KNOWN_KEYS = /* @__PURE__ */ new Set([
15529
+ "name",
15530
+ "email",
15531
+ "url"
15532
+ ]);
15533
+ const sameRest = (a, b) => JSON.stringify(a ?? {}) === JSON.stringify(b ?? {});
15534
+ const isFaithful = (wire, person) => {
15535
+ if (typeof wire === "string") {
15536
+ const parsed = parsePersonString(wire);
15537
+ return parsed.name === person.name && parsed.email === person.email && parsed.url === person.url;
15538
+ }
15539
+ const rest = restOf(wire);
15540
+ return wire.name === person.name && wire.email === person.email && wire.url === person.url && sameRest(rest, person.rest);
15541
+ };
15542
+ const PersonFields = Schema.Struct({
15543
+ name: Schema.String,
15544
+ email: Schema.optionalKey(Schema.String),
15545
+ url: Schema.optionalKey(Schema.String)
15546
+ });
15547
+ const decodePersonFields = Schema.decodeUnknownEffect(PersonFields);
15548
+ const restOf = (raw) => {
15549
+ const rest = {};
15550
+ for (const [key, value] of Object.entries(raw)) if (!KNOWN_KEYS.has(key)) rest[key] = value;
15551
+ return rest;
15552
+ };
15553
+ const encodePersonObject = (person) => {
15554
+ const wire = wireForms.get(person);
15555
+ if (wire !== void 0 && typeof wire !== "string" && isFaithful(wire, person)) return wire;
15556
+ const known = { name: person.name };
15557
+ if (person.email !== void 0) known.email = person.email;
15558
+ if (person.url !== void 0) known.url = person.url;
15559
+ return {
15560
+ ...person.rest ?? {},
15561
+ ...known
15562
+ };
15563
+ };
15005
15564
  /**
15006
- * A structured person object with `name` and optional `email` / `url`.
15565
+ * A structured person object with `name`, optional `email` / `url`, and a
15566
+ * `rest` catch-all preserving any additional keys across a read/write cycle.
15007
15567
  *
15008
15568
  * @public
15009
15569
  */
@@ -15013,30 +15573,78 @@ var Person = class Person extends Schema.Class("Person")({
15013
15573
  /** The optional email address. */
15014
15574
  email: Schema.optionalKey(Schema.String),
15015
15575
  /** The optional homepage URL. */
15016
- url: Schema.optionalKey(Schema.String)
15576
+ url: Schema.optionalKey(Schema.String),
15577
+ /** Any additional keys, preserved verbatim and flattened back on encode. */
15578
+ rest: Schema.optionalKey(Schema.Record(Schema.String, Schema.Unknown))
15017
15579
  }) {
15580
+ /**
15581
+ * The object wire codec: an open JSON object ↔ a {@link Person}, partitioning
15582
+ * unknown keys into `rest` and flattening them back on encode so the on-disk
15583
+ * shape never carries a literal `rest` key.
15584
+ */
15585
+ static schema = Schema.Record(Schema.String, Schema.Unknown).pipe(Schema.decodeTo(Schema.instanceOf(Person), SchemaTransformation.transformOrFail({
15586
+ decode: (raw) => decodePersonFields(raw).pipe(Effect.mapError((error) => error.issue), Effect.map((fields) => {
15587
+ const rest = restOf(raw);
15588
+ return rememberWire(Person.make({
15589
+ ...fields,
15590
+ ...Object.keys(rest).length > 0 ? { rest } : {}
15591
+ }), raw);
15592
+ })),
15593
+ encode: (person) => Effect.succeed(encodePersonObject(person))
15594
+ })));
15018
15595
  /**
15019
15596
  * Schema transformation between the `"Name <email> (url)"` shorthand string
15020
- * and a {@link Person}.
15597
+ * and a {@link Person}. Decoding remembers the input text so that encoding
15598
+ * reproduces it verbatim; see {@link Person.wireStringOf}.
15021
15599
  */
15022
15600
  static FromString = Schema.String.pipe(Schema.decodeTo(Schema.instanceOf(Person), SchemaTransformation.transform({
15023
- decode: (input) => parsePersonString(input),
15601
+ decode: (input) => rememberWire(parsePersonString(input), input),
15024
15602
  encode: (person) => {
15025
- let result = person.name;
15026
- if (person.email !== void 0) result += ` <${person.email}>`;
15027
- if (person.url !== void 0) result += ` (${person.url})`;
15028
- return result;
15603
+ const wire = wireForms.get(person);
15604
+ return typeof wire === "string" && isFaithful(wire, person) ? wire : serializePerson(person);
15029
15605
  }
15030
15606
  })));
15031
15607
  /**
15032
15608
  * The `author` / `contributors` value: either the shorthand string or the
15033
15609
  * structured object, always decoded to a {@link Person}.
15610
+ *
15611
+ * The wire form is preserved across a round trip — a person read from the
15612
+ * shorthand string encodes back to that string, byte for byte, and one read
15613
+ * from an object encodes back to an object with its unknown keys intact.
15614
+ * Formatting a manifest therefore never rewrites one legal encoding into the
15615
+ * other.
15616
+ *
15617
+ * Provenance belongs to the instance, so a person that is *rebuilt* (rather
15618
+ * than carried through unchanged) has none and encodes in the canonical
15619
+ * object form. Editing an unrelated field of the surrounding `Package`
15620
+ * carries the same person instance through and preserves its encoding.
15621
+ */
15622
+ static FromValue = Schema.Union([Person.schema, Schema.String]).pipe(Schema.decodeTo(Schema.instanceOf(Person), SchemaTransformation.transform({
15623
+ decode: (input) => typeof input === "string" ? rememberWire(parsePersonString(input), input) : input,
15624
+ encode: (person) => {
15625
+ const wire = wireForms.get(person);
15626
+ return typeof wire === "string" && isFaithful(wire, person) ? wire : person;
15627
+ }
15628
+ })));
15629
+ /**
15630
+ * The shorthand text this person was decoded from, when it was decoded from
15631
+ * the string form and still matches its fields; `None` for a person built
15632
+ * from an object or by hand.
15633
+ *
15634
+ * Exposed so callers can tell which encoding a manifest used without
15635
+ * re-reading the file.
15636
+ *
15637
+ * @param person - the person to inspect
15638
+ * @returns the original shorthand text, or `None`
15034
15639
  */
15035
- static FromValue = Schema.Union([Person, Person.FromString]);
15640
+ static wireStringOf(person) {
15641
+ const wire = wireForms.get(person);
15642
+ return typeof wire === "string" && isFaithful(wire, person) ? Option.some(wire) : Option.none();
15643
+ }
15036
15644
  };
15037
15645
 
15038
15646
  //#endregion
15039
- //#region ../../node_modules/.pnpm/@effected+package-json@0.3.0_effect@4.0.0-beta.98/node_modules/@effected/package-json/internal/format.js
15647
+ //#region ../../node_modules/.pnpm/@effected+package-json@0.4.1_effect@4.0.0-beta.99/node_modules/@effected/package-json/internal/format.js
15040
15648
  const KEY_INDEX = new Map([
15041
15649
  "$schema",
15042
15650
  "name",
@@ -15260,7 +15868,7 @@ const renderJson = (raw, options) => {
15260
15868
  };
15261
15869
 
15262
15870
  //#endregion
15263
- //#region ../../node_modules/.pnpm/@effected+package-json@0.3.0_effect@4.0.0-beta.98/node_modules/@effected/package-json/Package.js
15871
+ //#region ../../node_modules/.pnpm/@effected+package-json@0.4.1_effect@4.0.0-beta.99/node_modules/@effected/package-json/Package.js
15264
15872
  const toHashMap = SchemaTransformation.transform({
15265
15873
  decode: (record) => HashMap.fromIterable(Object.entries(record)),
15266
15874
  encode: (map) => Object.fromEntries(HashMap.toEntries(map))
@@ -15579,7 +16187,7 @@ var Package = class Package extends Schema.Class("Package")({
15579
16187
  };
15580
16188
 
15581
16189
  //#endregion
15582
- //#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
16190
+ //#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
15583
16191
  const EMPTY$1 = Object.freeze(Object.create(null));
15584
16192
  const EMPTY_MANIFEST = Object.freeze(Object.create(null));
15585
16193
  /**
@@ -15654,10 +16262,12 @@ var WorkspaceManifestError = class extends Schema.TaggedErrorClass()("WorkspaceM
15654
16262
  * path: "/repo/packages/utils",
15655
16263
  * packageJsonPath: "/repo/packages/utils/package.json",
15656
16264
  * relativePath: "packages/utils",
16265
+ * workspaceRoot: "/repo",
15657
16266
  * });
15658
16267
  *
15659
16268
  * pkg.isRootWorkspace; // false
15660
16269
  * pkg.unscopedName; // "utils"
16270
+ * pkg.workspaceRoot; // "/repo"
15661
16271
  * ```
15662
16272
  *
15663
16273
  * @public
@@ -15673,6 +16283,21 @@ var WorkspacePackage = class WorkspacePackage extends Schema.Class("WorkspacePac
15673
16283
  packageJsonPath: Schema.NonEmptyString,
15674
16284
  /** POSIX path relative to the workspace root; `"."` for the root package. */
15675
16285
  relativePath: Schema.String,
16286
+ /**
16287
+ * Absolute path to the workspace root this package was discovered under.
16288
+ *
16289
+ * @remarks
16290
+ * Carried, not derived. Whoever built this value already knew the root —
16291
+ * `WorkspaceDiscovery` resolved it before enumerating, and the sync entry
16292
+ * point is handed it — so dropping it forced every consumer into per-package
16293
+ * root arithmetic (counting `relativePath` segments and re-ascending that
16294
+ * many `..`). That reconstruction is exact only while `path` and
16295
+ * `relativePath` agree, and it re-derives something the kit never had to
16296
+ * lose.
16297
+ *
16298
+ * For the root package this equals `path`, and `relativePath` is `"."`.
16299
+ */
16300
+ workspaceRoot: Schema.NonEmptyString,
15676
16301
  /** Whether the package is marked private. */
15677
16302
  private: Schema.Boolean.pipe(Schema.withDecodingDefaultKey(Effect.succeed(false)), Schema.withConstructorDefault(Effect.succeed(false))),
15678
16303
  /** Production dependencies. */
@@ -15842,7 +16467,7 @@ var WorkspacePackage = class WorkspacePackage extends Schema.Class("WorkspacePac
15842
16467
  };
15843
16468
 
15844
16469
  //#endregion
15845
- //#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
16470
+ //#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
15846
16471
  /**
15847
16472
  * Typed failure raised by {@link descend}: a directory mid-walk was unreadable
15848
16473
  * (under `onUnreadable: "fail"`), or the walk descended past `maxDepth`. Depth
@@ -15978,7 +16603,98 @@ const descend = Effect.fn("Walker.descend")(function* (pattern, options) {
15978
16603
  });
15979
16604
 
15980
16605
  //#endregion
15981
- //#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
16606
+ //#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
16607
+ /**
16608
+ * Typed failure raised by {@link compileAndExpand}: the single error the
16609
+ * compile+expand recipe fails with, so a caller catches one tag rather than
16610
+ * folding two error channels by hand.
16611
+ *
16612
+ * @remarks
16613
+ * One tag, two genuinely different causes — "your pattern is malformed" and
16614
+ * "that directory is unreadable" are different problems with different fixes,
16615
+ * so `cause` keeps the underlying typed error intact
16616
+ * rather than flattening it into a string. Discriminate on `cause._tag`
16617
+ * (`"GlobPatternError"` vs `"DescendError"`), or read
16618
+ * {@link GlobExpansionError.stage} when only the phase matters; either way the
16619
+ * original payload — a guard's `limit`/`actual`, a descent's `path` — is still
16620
+ * there. `cause` is also the native `Error` cause, so error chaining and
16621
+ * stack-printing work without extra wiring.
16622
+ *
16623
+ * @public
16624
+ */
16625
+ var GlobExpansionError = class extends Schema.TaggedErrorClass()("GlobExpansionError", {
16626
+ /** The glob pattern's source text, as handed to {@link compileAndExpand}. */
16627
+ pattern: Schema.String,
16628
+ /** The underlying typed failure, intact: a compile guard trip or a descent failure. */
16629
+ cause: Schema.Union([GlobPatternError, DescendError])
16630
+ }) {
16631
+ /**
16632
+ * Which phase failed — `"compile"` when the pattern itself was rejected,
16633
+ * `"descend"` when the filesystem walk failed. A convenience over
16634
+ * `cause._tag` for callers that only need the phase.
16635
+ */
16636
+ get stage() {
16637
+ return this.cause._tag === "GlobPatternError" ? "compile" : "descend";
16638
+ }
16639
+ get message() {
16640
+ const shown = this.pattern.length > 64 ? `${this.pattern.slice(0, 64)}…` : this.pattern;
16641
+ return `glob expansion of ${JSON.stringify(shown)} failed during ${this.stage}: ${this.cause.message}`;
16642
+ }
16643
+ };
16644
+ /**
16645
+ * Compile a glob pattern and expand it against the filesystem in one call:
16646
+ * matching FILE paths relative to `options.cwd`, POSIX separators, sorted.
16647
+ *
16648
+ * @remarks
16649
+ * The recipe form of {@link descend}. Everything `descend` documents about
16650
+ * traversal holds unchanged — the literal fast-path, the negated-pattern walk
16651
+ * from `cwd`, files-only matching, symlink and prune handling, `maxDepth`,
16652
+ * `onUnreadable` — because this delegates to it. What this adds is the seam:
16653
+ * the pattern arrives as a string, and both failure modes arrive as one
16654
+ * {@link GlobExpansionError} with the underlying error preserved in `cause`.
16655
+ *
16656
+ * A missing base directory, a pattern that climbs above `cwd`, and a pattern
16657
+ * that simply matches nothing are all an EMPTY result, not a failure — zero
16658
+ * matches is a normal glob answer. Only a rejected pattern or a failed walk
16659
+ * produces an error.
16660
+ *
16661
+ * `FileSystem` and `Path` stay in the `R` channel and are **deliberately not
16662
+ * provided here**, even though hand-providing them is the friction this
16663
+ * recipe otherwise removes. `FileSystem` cannot be provided — a library that
16664
+ * picks its own filesystem cannot be tested against a fixture tree. Given
16665
+ * that, providing `Path` internally would not save the caller a layer (they
16666
+ * still supply `FileSystem`), and it would actively break win32: the walk
16667
+ * would join paths POSIX-style against a caller's win32 filesystem. The
16668
+ * consumer's platform layer stays the single place that choice is made.
16669
+ * Provide both once at the application boundary, not per call site.
16670
+ *
16671
+ * @example
16672
+ * ```ts
16673
+ * import { compileAndExpand } from "@effected/walker"
16674
+ * import { GlobPatternOptions } from "@effected/glob"
16675
+ *
16676
+ * const files = yield* compileAndExpand("packages/*​/src/**​/*.ts", {
16677
+ * cwd: "/repo",
16678
+ * glob: GlobPatternOptions.make({ dot: true })
16679
+ * })
16680
+ * ```
16681
+ *
16682
+ * @public
16683
+ */
16684
+ const compileAndExpand = Effect.fn("Walker.compileAndExpand")(function* (pattern, options) {
16685
+ const compiled = GlobPattern.compileResult(pattern, options.glob);
16686
+ if (Result.isFailure(compiled)) return yield* new GlobExpansionError({
16687
+ pattern,
16688
+ cause: compiled.failure
16689
+ });
16690
+ return yield* descend(compiled.success, options).pipe(Effect.mapError((cause) => new GlobExpansionError({
16691
+ pattern,
16692
+ cause
16693
+ })));
16694
+ });
16695
+
16696
+ //#endregion
16697
+ //#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
15982
16698
  /**
15983
16699
  * Ascend from `start` toward the filesystem root, yielding each directory,
15984
16700
  * nearest first.
@@ -15992,17 +16708,28 @@ const descend = Effect.fn("Walker.descend")(function* (pattern, options) {
15992
16708
  * Bounded twice over: `dirname` is a fixpoint at the root, and `maxDepth` guards
15993
16709
  * a pathological `Path` implementation that never reaches one.
15994
16710
  *
16711
+ * `stopAt` is compared in normalized form — see {@link AscendOptions.stopAt}.
16712
+ * Raw string equality made the ceiling fail OPEN: an unnormalized ceiling
16713
+ * matched nothing and the ascent ran silently to the filesystem root, which is
16714
+ * the unbounded walk the option exists to prevent, with no error to notice it
16715
+ * by. A relative ceiling **dies** for the same reason — resolving one against
16716
+ * `process.cwd()` would reintroduce the silent-wrong-walk failure through a
16717
+ * different door. See {@link AscendOptions.stopAt} for why that is a defect
16718
+ * rather than a typed error; the error channel stays `never`.
16719
+ *
15995
16720
  * @public
15996
16721
  */
15997
16722
  const ascend = (start, options) => Effect.gen(function* () {
15998
16723
  const path = yield* Path.Path;
15999
16724
  const maxDepth = options?.maxDepth ?? 256;
16000
16725
  if (!Number.isInteger(maxDepth) || maxDepth < 1) return yield* Effect.die(/* @__PURE__ */ new Error(`Walker.ascend: maxDepth must be a positive integer, received ${maxDepth}`));
16726
+ if (options?.stopAt !== void 0 && !path.isAbsolute(options.stopAt)) return yield* Effect.die(/* @__PURE__ */ new Error(`Walker.ascend: stopAt must be an absolute path, received ${JSON.stringify(options.stopAt)} (ascending from ${JSON.stringify(start)})`));
16727
+ const ceiling = options?.stopAt === void 0 ? void 0 : path.resolve(options.stopAt);
16001
16728
  const dirs = [];
16002
16729
  let current = start;
16003
16730
  for (let depth = 0; depth < maxDepth; depth++) {
16004
16731
  dirs.push(current);
16005
- if (options?.stopAt !== void 0 && current === options.stopAt) break;
16732
+ if (ceiling !== void 0 && (current === ceiling || path.resolve(current) === ceiling)) break;
16006
16733
  const parent = path.dirname(current);
16007
16734
  if (parent === current) break;
16008
16735
  current = parent;
@@ -16069,7 +16796,7 @@ const Walker$1 = {
16069
16796
  };
16070
16797
 
16071
16798
  //#endregion
16072
- //#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
16799
+ //#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
16073
16800
  /**
16074
16801
  * The marker filenames {@link WorkspaceRoot} probes for, in priority order.
16075
16802
  *
@@ -16089,11 +16816,22 @@ var WorkspaceRootNotFoundError = class extends Schema.TaggedErrorClass()("Worksp
16089
16816
  /** The directory the ascent started from. */
16090
16817
  searchPath: Schema.String,
16091
16818
  /** The marker filenames probed at each ancestor. */
16092
- markers: Schema.Array(Schema.String)
16819
+ markers: Schema.Array(Schema.String),
16820
+ /**
16821
+ * The resolved ceiling the ascent was bounded by, when one was supplied.
16822
+ *
16823
+ * @remarks
16824
+ * Absent means the ascent ran to the filesystem root. Its presence is what
16825
+ * lets a caller tell "there is no workspace root anywhere above me" from
16826
+ * "there is none below the ceiling I set" — two failures that otherwise
16827
+ * render identically.
16828
+ */
16829
+ stopAt: Schema.optionalKey(Schema.String)
16093
16830
  }) {
16094
- /** Renders the search path and probed markers into a one-line message. */
16831
+ /** Renders the search path, probed markers and any ceiling into a one-line message. */
16095
16832
  get message() {
16096
- return `No workspace root above ${this.searchPath} (looked for ${this.markers.join(", ")})`;
16833
+ const bound = this.stopAt === void 0 ? "" : ` up to ${this.stopAt}`;
16834
+ return `No workspace root above ${this.searchPath}${bound} (looked for ${this.markers.join(", ")})`;
16097
16835
  }
16098
16836
  };
16099
16837
  /**
@@ -16116,6 +16854,12 @@ const isWorkspaceRoot = (dir) => Effect.gen(function* () {
16116
16854
  }).pipe(Effect.orElseSucceed(() => ({})));
16117
16855
  return parsed.workspaces !== void 0 && parsed.workspaces !== null;
16118
16856
  });
16857
+ /** Whether `descendant` is `ancestor` itself or lies beneath it, on POSIX or win32 separators. */
16858
+ const isAtOrBelow = (descendant, ancestor) => {
16859
+ if (descendant === ancestor) return true;
16860
+ const prefix = ancestor.endsWith("/") || ancestor.endsWith("\\") ? ancestor : `${ancestor}/`;
16861
+ return descendant.startsWith(prefix) || descendant.startsWith(prefix.replace(/\/$/, "\\"));
16862
+ };
16119
16863
  /**
16120
16864
  * Locates the workspace root by ascending from a starting directory.
16121
16865
  *
@@ -16130,6 +16874,20 @@ const isWorkspaceRoot = (dir) => Effect.gen(function* () {
16130
16874
  * });
16131
16875
  * ```
16132
16876
  *
16877
+ * @example
16878
+ * Bounded: an unmarked fixture directory fails typed instead of escaping into
16879
+ * the enclosing repository.
16880
+ *
16881
+ * ```ts
16882
+ * import { WorkspaceRoot } from "@effected/workspaces";
16883
+ * import { Effect } from "effect";
16884
+ *
16885
+ * const program = Effect.gen(function* () {
16886
+ * const roots = yield* WorkspaceRoot;
16887
+ * return yield* roots.find("/tmp/fixture/packages/a", { stopAt: "/tmp/fixture" });
16888
+ * });
16889
+ * ```
16890
+ *
16133
16891
  * @public
16134
16892
  */
16135
16893
  var WorkspaceRoot = class WorkspaceRoot extends Context.Service()("@effected/workspaces/WorkspaceRoot") {
@@ -16137,25 +16895,96 @@ var WorkspaceRoot = class WorkspaceRoot extends Context.Service()("@effected/wor
16137
16895
  static make = Effect.gen(function* () {
16138
16896
  const fs = yield* FileSystem.FileSystem;
16139
16897
  const path = yield* Path.Path;
16140
- const find = Effect.fn("WorkspaceRoot.find")(function* (cwd) {
16898
+ const find = Effect.fn("WorkspaceRoot.find")(function* (cwd, options) {
16141
16899
  const start = path.resolve(cwd);
16142
- const chain = yield* Walker$1.ascend(start);
16900
+ const ceiling = options?.stopAt === void 0 ? void 0 : path.resolve(options.stopAt);
16901
+ const chain = yield* Walker$1.ascend(start, {
16902
+ ...ceiling === void 0 ? {} : { stopAt: ceiling },
16903
+ ...options?.maxDepth === void 0 ? {} : { maxDepth: options.maxDepth }
16904
+ });
16143
16905
  const found = yield* Walker$1.findRoot(chain, isWorkspaceRoot);
16144
16906
  if (Option.isNone(found)) return yield* Effect.fail(new WorkspaceRootNotFoundError({
16145
16907
  searchPath: start,
16146
- markers: WORKSPACE_MARKERS
16908
+ markers: WORKSPACE_MARKERS,
16909
+ ...ceiling === void 0 ? {} : { stopAt: ceiling }
16147
16910
  }));
16148
16911
  yield* Effect.logDebug("Workspace root found").pipe(Effect.annotateLogs("workspace.root", found.value));
16149
16912
  return found.value;
16150
16913
  });
16151
- return { find: (cwd) => find(cwd).pipe(Effect.provideService(FileSystem.FileSystem, fs), Effect.provideService(Path.Path, path)) };
16914
+ return { find: (cwd, options) => find(cwd, options).pipe(Effect.provideService(FileSystem.FileSystem, fs), Effect.provideService(Path.Path, path)) };
16152
16915
  });
16153
16916
  /** The live layer. */
16154
16917
  static layer = Layer.effect(WorkspaceRoot, WorkspaceRoot.make);
16918
+ /**
16919
+ * A test double resolving every `find` to `root`, with no filesystem.
16920
+ *
16921
+ * @remarks
16922
+ * The nine-copies-of-a-four-line-mock case — a `Layer.succeed` over a `find`
16923
+ * that ignores its arguments and succeeds with a fixed root is what consumers
16924
+ * were writing by hand. The difference is that this double **honours
16925
+ * `stopAt`**: a hand-rolled `find` that ignores the ceiling makes a bounded
16926
+ * call pass under test and fail against the live service, which is the
16927
+ * failure mode the option exists to catch. A `root` above the ceiling fails
16928
+ * here exactly as it would live, with the same
16929
+ * {@link WorkspaceRootNotFoundError}.
16930
+ *
16931
+ * The ceiling is `path.resolve`d through the injected `Path` service before
16932
+ * the comparison, exactly as the live `make` path does — so a `stopAt`
16933
+ * carrying `..` segments bounds the double identically to the live service,
16934
+ * not by raw string. This is why `makeTest` yields an `Effect` requiring
16935
+ * `Path`: it captures the service once at construction, the same shape as
16936
+ * `make`. Consumers reach for {@link WorkspaceRoot.layerTest}, which provides
16937
+ * `Path.layer` internally, so the requirement never surfaces at their call
16938
+ * site.
16939
+ *
16940
+ * `maxDepth` is deliberately NOT modelled: the double does not walk, so it has
16941
+ * no depth to cap, and pretending otherwise would encode a fiction. A suite
16942
+ * exercising the depth guard wants the live service over a fixture tree.
16943
+ *
16944
+ * @param root - The root every unbounded `find` resolves to.
16945
+ */
16946
+ static makeTest = (root) => Effect.gen(function* () {
16947
+ const path = yield* Path.Path;
16948
+ return { find: (cwd, options) => options?.stopAt !== void 0 && !isAtOrBelow(root, path.resolve(options.stopAt)) ? Effect.fail(new WorkspaceRootNotFoundError({
16949
+ searchPath: cwd,
16950
+ markers: WORKSPACE_MARKERS,
16951
+ stopAt: options.stopAt
16952
+ })) : Effect.succeed(root) };
16953
+ });
16954
+ /**
16955
+ * The test layer: {@link WorkspaceRoot.makeTest} with `Path.layer` provided.
16956
+ *
16957
+ * @remarks
16958
+ * `makeTest` requires `Path` to normalize the `stopAt` ceiling; this layer
16959
+ * supplies core's `Path.layer` internally, so the requirement never reaches a
16960
+ * consumer — the published type stays `Layer.Layer<WorkspaceRoot>`.
16961
+ *
16962
+ * A parameterized layer factory mints a **fresh reference per call**, and
16963
+ * layers memoize by reference — bind the result to a `const` and reuse it
16964
+ * rather than calling `layerTest(...)` at each composition site.
16965
+ *
16966
+ * Pair it with `WorkspaceDiscovery.layerTest` to stand up the whole discovery
16967
+ * path without a filesystem; between them there is nothing left for a
16968
+ * module-level mock of `@effected/workspaces` to do, and a provided layer
16969
+ * keeps the service graph — and its typed errors — intact.
16970
+ *
16971
+ * @example
16972
+ * ```ts
16973
+ * import { WorkspaceDiscovery, WorkspaceRoot } from "@effected/workspaces";
16974
+ * import { Effect } from "effect";
16975
+ *
16976
+ * const TestRoot = WorkspaceRoot.layerTest("/repo");
16977
+ * const TestDiscovery = WorkspaceDiscovery.layerTest({
16978
+ * listPackages: () => Effect.succeed([]),
16979
+ * });
16980
+ * // program.pipe(Effect.provide(TestRoot), Effect.provide(TestDiscovery))
16981
+ * ```
16982
+ */
16983
+ static layerTest = (root) => Layer.effect(WorkspaceRoot, WorkspaceRoot.makeTest(root)).pipe(Layer.provide(Path.layer));
16155
16984
  };
16156
16985
 
16157
16986
  //#endregion
16158
- //#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
16987
+ //#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
16159
16988
  /**
16160
16989
  * Hard ceiling on directories the enumerator will visit for one pattern set.
16161
16990
  * Guards the pathological case a depth cap alone does not: a wide, shallow
@@ -16174,7 +17003,7 @@ const MAX_ENUMERATION_ENTRIES = 1e5;
16174
17003
  const PRUNED_DIRECTORIES = /* @__PURE__ */ new Set([".git", "node_modules"]);
16175
17004
 
16176
17005
  //#endregion
16177
- //#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
17006
+ //#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
16178
17007
  /** Directory names never descended into. */
16179
17008
  const isPruned = (entry) => PRUNED_DIRECTORIES.has(entry);
16180
17009
  /** Join root-relative POSIX segments; `""` is the root itself. */
@@ -16265,7 +17094,7 @@ var Traversal = class {
16265
17094
  };
16266
17095
 
16267
17096
  //#endregion
16268
- //#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
17097
+ //#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
16269
17098
  /** Strip a trailing slash from `GlobPattern.enumerationPrefix` to get a relative directory. */
16270
17099
  const baseOf = (pattern) => pattern.enumerationPrefix.replace(/\/$/, "");
16271
17100
  /**
@@ -16336,7 +17165,7 @@ const enumerate = (root, globs, options) => Effect.gen(function* () {
16336
17165
  });
16337
17166
 
16338
17167
  //#endregion
16339
- //#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
17168
+ //#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
16340
17169
  const stringsOf = (value) => Array.isArray(value) ? value.filter((entry) => typeof entry === "string") : void 0;
16341
17170
  /** The `packages:` list of a `pnpm-workspace.yaml` document. Total on a parsed document. */
16342
17171
  const pnpmPatternsOf = (document) => {
@@ -16394,7 +17223,7 @@ const readPatterns = (root) => Effect.gen(function* () {
16394
17223
  });
16395
17224
 
16396
17225
  //#endregion
16397
- //#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
17226
+ //#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
16398
17227
  /**
16399
17228
  * Raised when a workspace member's `package.json` cannot be read, parsed, or
16400
17229
  * used — it is missing, malformed, or lacks a `name` or `version`.
@@ -16572,6 +17401,7 @@ var WorkspaceDiscovery = class WorkspaceDiscovery extends Context.Service()("@ef
16572
17401
  path: directory,
16573
17402
  packageJsonPath,
16574
17403
  relativePath,
17404
+ workspaceRoot: root,
16575
17405
  manifestRecord: raw,
16576
17406
  ...typeof raw.private === "boolean" ? { private: raw.private } : {},
16577
17407
  ...isStringRecord$2(raw.dependencies) ? { dependencies: raw.dependencies } : {},
@@ -16729,6 +17559,7 @@ var WorkspaceDiscovery = class WorkspaceDiscovery extends Context.Service()("@ef
16729
17559
  * path: "/repo/packages/utils",
16730
17560
  * packageJsonPath: "/repo/packages/utils/package.json",
16731
17561
  * relativePath: "packages/utils",
17562
+ * workspaceRoot: "/repo",
16732
17563
  * }),
16733
17564
  * ]),
16734
17565
  * });
@@ -16827,7 +17658,7 @@ var WorkspaceDiscovery = class WorkspaceDiscovery extends Context.Service()("@ef
16827
17658
  const isStringRecord$2 = (value) => value !== null && typeof value === "object" && !Array.isArray(value) && Object.values(value).every((entry) => typeof entry === "string");
16828
17659
 
16829
17660
  //#endregion
16830
- //#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
17661
+ //#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
16831
17662
  /**
16832
17663
  * Raised when the workspace dependency graph cannot be topologically ordered
16833
17664
  * because it contains a cycle.
@@ -17063,7 +17894,7 @@ const kahn = (edges) => {
17063
17894
  };
17064
17895
 
17065
17896
  //#endregion
17066
- //#region ../../node_modules/.pnpm/@effected+git@0.4.0_effect@4.0.0-beta.98/node_modules/@effected/git/GitCommand.js
17897
+ //#region ../../node_modules/.pnpm/@effected+git@0.4.1_effect@4.0.0-beta.99/node_modules/@effected/git/GitCommand.js
17067
17898
  /**
17068
17899
  * Builds a `git` `ChildProcess.StandardCommand` with the argv this package
17069
17900
  * classifies against.
@@ -17483,7 +18314,7 @@ const GitCommand = {
17483
18314
  };
17484
18315
 
17485
18316
  //#endregion
17486
- //#region ../../node_modules/.pnpm/@effected+git@0.4.0_effect@4.0.0-beta.98/node_modules/@effected/git/internal/run.js
18317
+ //#region ../../node_modules/.pnpm/@effected+git@0.4.1_effect@4.0.0-beta.99/node_modules/@effected/git/internal/run.js
17487
18318
  /**
17488
18319
  * Spawns `command` and collects its stdout, stderr, and exit code as a single
17489
18320
  * triple.
@@ -17511,7 +18342,7 @@ const runCollected = (command) => Effect.scoped(Effect.gen(function* () {
17511
18342
  }));
17512
18343
 
17513
18344
  //#endregion
17514
- //#region ../../node_modules/.pnpm/@effected+git@0.4.0_effect@4.0.0-beta.98/node_modules/@effected/git/Git.js
18345
+ //#region ../../node_modules/.pnpm/@effected+git@0.4.1_effect@4.0.0-beta.99/node_modules/@effected/git/Git.js
17515
18346
  /** git's own ceiling: a run that has not answered in 30s is not going to. */
17516
18347
  const GIT_TIMEOUT = Duration.seconds(30);
17517
18348
  /**
@@ -17523,7 +18354,7 @@ const GIT_TIMEOUT = Duration.seconds(30);
17523
18354
  * `exitCode` and `stderr` are populated when git actually ran. `detail`
17524
18355
  * carries a human-readable explanation of an absorbed spawn-level
17525
18356
  * `PlatformError` or a per-run timeout — the two cases where git never
17526
- * produced an exit code at all. {@link GitCommandError.kind | `kind`}
18357
+ * produced an exit code at all. `kind`
17527
18358
  * discriminates a pre-spawn guard rejection (`"refused"`) from a genuine git
17528
18359
  * failure (`"failed"`) structurally, so composed retry/fallback logic never has
17529
18360
  * to parse the prose in `message` or `detail`.
@@ -18429,7 +19260,7 @@ var Git = class extends Context.Service()("@effected/git/Git") {
18429
19260
  };
18430
19261
 
18431
19262
  //#endregion
18432
- //#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
19263
+ //#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
18433
19264
  /**
18434
19265
  * Which git refs to compare, and whether to fold in the working tree.
18435
19266
  *
@@ -18711,7 +19542,7 @@ function resolveFromCatalog(catalogs, wantedDependency) {
18711
19542
  }
18712
19543
 
18713
19544
  //#endregion
18714
- //#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
19545
+ //#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
18715
19546
  /** Project a pnpm-workspace manifest's `catalog` / `catalogs` fields into a `Catalogs` map. */
18716
19547
  const inlineCatalogs = (manifest) => {
18717
19548
  if (manifest.catalog === void 0 && manifest.catalogs === void 0) return {};
@@ -18776,7 +19607,7 @@ const rangeOf = (catalogs, dependency, specifier) => {
18776
19607
  };
18777
19608
 
18778
19609
  //#endregion
18779
- //#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
19610
+ //#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
18780
19611
  /** Whether `value` is a non-null, non-array object. */
18781
19612
  const isObject$2 = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
18782
19613
  /**
@@ -18870,9 +19701,13 @@ var ConfigDependencyHooks = class ConfigDependencyHooks extends Context.Service(
18870
19701
  * `hooks`-source `CatalogAssemblyError`, never a silent skip.
18871
19702
  *
18872
19703
  * @remarks
18873
- * Node-coupled by design the `node:fs` / `node:path` / `node:url` imports are
18874
- * the sanctioned Node-only overlay, matching the other seams here. Only ever
18875
- * wired by `WorkspaceCatalogs.layerWithConfigDependencies`.
19704
+ * Runtime-coupled by design, not node-exclusive. The `import()` below loads
19705
+ * **and executes** a config dependency's pnpmfile in-process code execution,
19706
+ * not IO, so no `FileSystem` / `Path` service abstracts it. The `node:path` and
19707
+ * `node:url` imports (`join`, `pathToFileURL`) exist only to build the URL that
19708
+ * `import()` consumes; node and bun both implement those builtins and dynamic
19709
+ * import, so this layer runs on either runtime. Only ever wired by
19710
+ * `WorkspaceCatalogs.layerWithConfigDependencies`.
18876
19711
  */
18877
19712
  static layerLive = Layer.succeed(ConfigDependencyHooks, { inject: (root, configDependencies, seed) => Effect.gen(function* () {
18878
19713
  const names = Object.keys(configDependencies);
@@ -18922,7 +19757,7 @@ var ConfigDependencyHooks = class ConfigDependencyHooks extends Context.Service(
18922
19757
  };
18923
19758
 
18924
19759
  //#endregion
18925
- //#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
19760
+ //#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
18926
19761
  /**
18927
19762
  * The four package managers this package understands.
18928
19763
  *
@@ -19165,7 +20000,7 @@ var PackageManagerDetector = class PackageManagerDetector extends Context.Servic
19165
20000
  };
19166
20001
 
19167
20002
  //#endregion
19168
- //#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
20003
+ //#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
19169
20004
  /**
19170
20005
  * Raised when the workspace's lockfile cannot be read off disk.
19171
20006
  *
@@ -19276,7 +20111,7 @@ var LockfileReader = class LockfileReader extends Context.Service()("@effected/w
19276
20111
  };
19277
20112
 
19278
20113
  //#endregion
19279
- //#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
20114
+ //#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
19280
20115
  /** The public npm registry, used when `publishConfig.registry` says nothing. */
19281
20116
  const DEFAULT_REGISTRY = "https://registry.npmjs.org/";
19282
20117
  /**
@@ -19377,7 +20212,7 @@ var PublishabilityDetector = class PublishabilityDetector extends Context.Servic
19377
20212
  };
19378
20213
 
19379
20214
  //#endregion
19380
- //#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
20215
+ //#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
19381
20216
  /**
19382
20217
  * An immutable, fully-normalized catalog collection — the one catalog
19383
20218
  * resolution semantic in the package.
@@ -19762,7 +20597,7 @@ var WorkspaceCatalogs = class WorkspaceCatalogs extends Context.Service()("@effe
19762
20597
  };
19763
20598
 
19764
20599
  //#endregion
19765
- //#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
20600
+ //#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
19766
20601
  const EMPTY = Object.freeze(Object.create(null));
19767
20602
  const DependencyMap = Schema.Record(Schema.String, Schema.String).pipe(Schema.withDecodingDefaultKey(Effect.succeed(EMPTY)), Schema.withConstructorDefault(Effect.succeed(EMPTY)));
19768
20603
  /**
@@ -19928,7 +20763,7 @@ var WorkspaceStateSnapshot = class extends Schema.Class("WorkspaceStateSnapshot"
19928
20763
  };
19929
20764
 
19930
20765
  //#endregion
19931
- //#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
20766
+ //#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
19932
20767
  /** Whether `value` is a non-null, non-array object. */
19933
20768
  const isObject = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
19934
20769
  /** Whether every value in a record is a string — a usable dependency map. */
@@ -20121,7 +20956,7 @@ var WorkspaceSnapshots = class WorkspaceSnapshots extends Context.Service()("@ef
20121
20956
  };
20122
20957
 
20123
20958
  //#endregion
20124
- //#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
20959
+ //#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
20125
20960
  /**
20126
20961
  * Every service that needs only a filesystem: root, package-manager detection,
20127
20962
  * discovery, lockfile reading, catalogs and publishability.
@@ -20499,34 +21334,15 @@ const SilkPublishabilityDetectorLive = Layer.effect(PublishabilityDetector, Effe
20499
21334
  }) };
20500
21335
  }));
20501
21336
  /**
20502
- * The workspace root a package was discovered against, derived from its own
20503
- * coordinates: `relativePath` is the package directory relative to the
20504
- * discovery root (POSIX, `"."` for the root package), so ascending one level
20505
- * per path segment from `pkg.path` lands exactly on that root.
20506
- *
20507
- * @remarks
20508
- * Derivation is deliberate — probing the filesystem for workspace markers
20509
- * (`WorkspaceRoot.find`) can walk PAST the intended root when that root
20510
- * carries no marker (a fixture tree, a bare directory) and land on an
20511
- * enclosing workspace, silently swapping in that outer root's
20512
- * `.changeset/config.json` and dropping the ignore/mode gating (the #209
20513
- * regression class). The discovery root needs no probing: whoever built the
20514
- * `WorkspacePackage` already knew it.
20515
- */
20516
- const packageRoot = (pkg) => {
20517
- const segments = pkg.relativePath.split("/").filter((segment) => segment !== "" && segment !== ".");
20518
- return segments.length === 0 ? pkg.path : join(pkg.path, ...segments.map(() => ".."));
20519
- };
20520
- /**
20521
21337
  * Ignore-aware override of `PublishabilityDetector`. `detect` short-circuits to `[]`
20522
21338
  * for changeset-ignored packages, then dispatches on `ChangesetConfig.mode`:
20523
21339
  * `none` → `[]`; `silk` → `SilkPublishability.detect`; `vanilla` → the library default.
20524
21340
  *
20525
21341
  * @remarks Requires `FileSystem` and {@link ChangesetConfig} at build.
20526
21342
  * The kit's `detect` contract no longer receives the workspace root, so the changeset
20527
- * lookups derive it per package from the package's own discovery coordinates
20528
- * (`pkg.path` ascended by `pkg.relativePath` — never a filesystem marker walk,
20529
- * which could escape an unmarked root and read the wrong `.changeset/config.json`).
21343
+ * lookups read it from `pkg.workspaceRoot` the discovery root the package was found
21344
+ * against, never a filesystem marker walk, which could escape an unmarked root and read
21345
+ * the wrong `.changeset/config.json`.
20530
21346
  *
20531
21347
  * @since 0.4.0
20532
21348
  * @public
@@ -20536,7 +21352,7 @@ const PublishabilityDetectorAdaptiveLive = Layer.effect(PublishabilityDetector,
20536
21352
  const config = yield* ChangesetConfig;
20537
21353
  const vanilla = yield* Effect.provide(PublishabilityDetector, PublishabilityDetector.layer);
20538
21354
  return { detect: (pkg) => Effect.gen(function* () {
20539
- const root = packageRoot(pkg);
21355
+ const root = pkg.workspaceRoot;
20540
21356
  if (yield* config.isIgnored(pkg.name, root)) return [];
20541
21357
  const mode = yield* config.mode(root);
20542
21358
  if (mode === "none") return [];
@@ -22126,7 +22942,7 @@ var require_dataloader = /* @__PURE__ */ __commonJSMin(((exports, module) => {
22126
22942
  }));
22127
22943
 
22128
22944
  //#endregion
22129
- //#region ../../node_modules/.pnpm/@changesets+get-github-info@1.0.0-next.3/node_modules/@changesets/get-github-info/dist/index.mjs
22945
+ //#region ../../node_modules/.pnpm/@changesets+get-github-info@1.0.0-next.4/node_modules/@changesets/get-github-info/dist/index.mjs
22130
22946
  var import_dataloader = /* @__PURE__ */ __toESM(require_dataloader(), 1);
22131
22947
  async function readEnvFile() {
22132
22948
  const envFile = path$1.resolve(process.cwd(), ".env");
@@ -23698,7 +24514,7 @@ function normalizeIdentifier(value) {
23698
24514
  }
23699
24515
 
23700
24516
  //#endregion
23701
- //#region ../../node_modules/.pnpm/mdast-util-gfm-footnote@2.1.0/node_modules/mdast-util-gfm-footnote/lib/index.js
24517
+ //#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
23702
24518
  /**
23703
24519
  * @import {
23704
24520
  * CompileContext,
@@ -23891,7 +24707,7 @@ function mapAll(line, index, blank) {
23891
24707
  }
23892
24708
 
23893
24709
  //#endregion
23894
- //#region ../../node_modules/.pnpm/mdast-util-gfm-strikethrough@2.0.0/node_modules/mdast-util-gfm-strikethrough/lib/index.js
24710
+ //#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
23895
24711
  /**
23896
24712
  * @typedef {import('mdast').Delete} Delete
23897
24713
  *
@@ -29001,7 +29817,7 @@ function safeBound(value, config) {
29001
29817
  }
29002
29818
 
29003
29819
  //#endregion
29004
- //#region ../../node_modules/.pnpm/mdast-util-gfm-table@2.0.0/node_modules/mdast-util-gfm-table/lib/index.js
29820
+ //#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
29005
29821
  /**
29006
29822
  * @typedef {import('mdast').InlineCode} InlineCode
29007
29823
  * @typedef {import('mdast').Table} Table
@@ -29267,7 +30083,7 @@ function gfmTableToMarkdown(options) {
29267
30083
  }
29268
30084
 
29269
30085
  //#endregion
29270
- //#region ../../node_modules/.pnpm/mdast-util-gfm-task-list-item@2.0.0/node_modules/mdast-util-gfm-task-list-item/lib/index.js
30086
+ //#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
29271
30087
  /**
29272
30088
  * @typedef {import('mdast').ListItem} ListItem
29273
30089
  * @typedef {import('mdast').Paragraph} Paragraph
@@ -29378,7 +30194,7 @@ function listItemWithTaskListItem(node, parent, state, info) {
29378
30194
  }
29379
30195
 
29380
30196
  //#endregion
29381
- //#region ../../node_modules/.pnpm/mdast-util-gfm@3.1.0/node_modules/mdast-util-gfm/lib/index.js
30197
+ //#region ../../node_modules/.pnpm/mdast-util-gfm@3.1.0_supports-color@8.1.1/node_modules/mdast-util-gfm/lib/index.js
29382
30198
  /**
29383
30199
  * @import {Extension as FromMarkdownExtension} from 'mdast-util-from-markdown'
29384
30200
  * @import {Options} from 'mdast-util-gfm'
@@ -37504,7 +38320,7 @@ function gfm(options) {
37504
38320
  }
37505
38321
 
37506
38322
  //#endregion
37507
- //#region ../../node_modules/.pnpm/remark-gfm@4.0.1/node_modules/remark-gfm/lib/index.js
38323
+ //#region ../../node_modules/.pnpm/remark-gfm@4.0.1_supports-color@8.1.1/node_modules/remark-gfm/lib/index.js
37508
38324
  /**
37509
38325
  * @import {Root} from 'mdast'
37510
38326
  * @import {Options} from 'remark-gfm'
@@ -37536,7 +38352,7 @@ function remarkGfm(options) {
37536
38352
  }
37537
38353
 
37538
38354
  //#endregion
37539
- //#region ../../node_modules/.pnpm/micromark@4.0.2/node_modules/micromark/lib/initialize/content.js
38355
+ //#region ../../node_modules/.pnpm/micromark@4.0.2_supports-color@8.1.1/node_modules/micromark/lib/initialize/content.js
37540
38356
  /**
37541
38357
  * @import {
37542
38358
  * InitialConstruct,
@@ -37604,7 +38420,7 @@ function initializeContent(effects) {
37604
38420
  }
37605
38421
 
37606
38422
  //#endregion
37607
- //#region ../../node_modules/.pnpm/micromark@4.0.2/node_modules/micromark/lib/initialize/document.js
38423
+ //#region ../../node_modules/.pnpm/micromark@4.0.2_supports-color@8.1.1/node_modules/micromark/lib/initialize/document.js
37608
38424
  /**
37609
38425
  * @import {
37610
38426
  * Construct,
@@ -37821,7 +38637,7 @@ function tokenizeContainer(effects, ok, nok) {
37821
38637
  }
37822
38638
 
37823
38639
  //#endregion
37824
- //#region ../../node_modules/.pnpm/micromark@4.0.2/node_modules/micromark/lib/initialize/flow.js
38640
+ //#region ../../node_modules/.pnpm/micromark@4.0.2_supports-color@8.1.1/node_modules/micromark/lib/initialize/flow.js
37825
38641
  /**
37826
38642
  * @import {
37827
38643
  * InitialConstruct,
@@ -37869,7 +38685,7 @@ function initializeFlow(effects) {
37869
38685
  }
37870
38686
 
37871
38687
  //#endregion
37872
- //#region ../../node_modules/.pnpm/micromark@4.0.2/node_modules/micromark/lib/initialize/text.js
38688
+ //#region ../../node_modules/.pnpm/micromark@4.0.2_supports-color@8.1.1/node_modules/micromark/lib/initialize/text.js
37873
38689
  /**
37874
38690
  * @import {
37875
38691
  * Code,
@@ -38047,7 +38863,7 @@ function resolveAllLineSuffixes(events, context) {
38047
38863
  }
38048
38864
 
38049
38865
  //#endregion
38050
- //#region ../../node_modules/.pnpm/micromark@4.0.2/node_modules/micromark/lib/constructs.js
38866
+ //#region ../../node_modules/.pnpm/micromark@4.0.2_supports-color@8.1.1/node_modules/micromark/lib/constructs.js
38051
38867
  /**
38052
38868
  * @import {Extension} from 'micromark-util-types'
38053
38869
  */
@@ -38126,7 +38942,7 @@ const attentionMarkers = { null: [42, 95] };
38126
38942
  const disable = { null: [] };
38127
38943
 
38128
38944
  //#endregion
38129
- //#region ../../node_modules/.pnpm/micromark@4.0.2/node_modules/micromark/lib/create-tokenizer.js
38945
+ //#region ../../node_modules/.pnpm/micromark@4.0.2_supports-color@8.1.1/node_modules/micromark/lib/create-tokenizer.js
38130
38946
  /**
38131
38947
  * @import {
38132
38948
  * Chunk,
@@ -38596,7 +39412,7 @@ function serializeChunks(chunks, expandTabs) {
38596
39412
  }
38597
39413
 
38598
39414
  //#endregion
38599
- //#region ../../node_modules/.pnpm/micromark@4.0.2/node_modules/micromark/lib/parse.js
39415
+ //#region ../../node_modules/.pnpm/micromark@4.0.2_supports-color@8.1.1/node_modules/micromark/lib/parse.js
38600
39416
  /**
38601
39417
  * @import {
38602
39418
  * Create,
@@ -38641,7 +39457,7 @@ function parse$1(options) {
38641
39457
  }
38642
39458
 
38643
39459
  //#endregion
38644
- //#region ../../node_modules/.pnpm/micromark@4.0.2/node_modules/micromark/lib/postprocess.js
39460
+ //#region ../../node_modules/.pnpm/micromark@4.0.2_supports-color@8.1.1/node_modules/micromark/lib/postprocess.js
38645
39461
  /**
38646
39462
  * @import {Event} from 'micromark-util-types'
38647
39463
  */
@@ -38657,7 +39473,7 @@ function postprocess(events) {
38657
39473
  }
38658
39474
 
38659
39475
  //#endregion
38660
- //#region ../../node_modules/.pnpm/micromark@4.0.2/node_modules/micromark/lib/preprocess.js
39476
+ //#region ../../node_modules/.pnpm/micromark@4.0.2_supports-color@8.1.1/node_modules/micromark/lib/preprocess.js
38661
39477
  /**
38662
39478
  * @import {Chunk, Code, Encoding, Value} from 'micromark-util-types'
38663
39479
  */
@@ -38824,7 +39640,7 @@ function index(value) {
38824
39640
  }
38825
39641
 
38826
39642
  //#endregion
38827
- //#region ../../node_modules/.pnpm/mdast-util-from-markdown@2.0.3/node_modules/mdast-util-from-markdown/lib/index.js
39643
+ //#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
38828
39644
  /**
38829
39645
  * @import {
38830
39646
  * Break,
@@ -39791,7 +40607,7 @@ function defaultOnError(left, right) {
39791
40607
  }
39792
40608
 
39793
40609
  //#endregion
39794
- //#region ../../node_modules/.pnpm/remark-parse@11.0.0/node_modules/remark-parse/lib/index.js
40610
+ //#region ../../node_modules/.pnpm/remark-parse@11.0.0_supports-color@8.1.1/node_modules/remark-parse/lib/index.js
39795
40611
  /**
39796
40612
  * @typedef {import('mdast').Root} Root
39797
40613
  * @typedef {import('mdast-util-from-markdown').Options} FromMarkdownOptions
@@ -45333,25 +46149,15 @@ function normalizeLegacyOptions(options, configPath) {
45333
46149
  };
45334
46150
  }
45335
46151
  /** Match dotfiles, mirroring the former tinyglobby `dot: true` behavior. */
45336
- const GLOB_OPTIONS = GlobPatternOptions.make({ dot: true });
46152
+ const GLOB_OPTIONS$1 = GlobPatternOptions.make({ dot: true });
45337
46153
  /**
45338
- * Compile `glob` via `@effected/glob`, folding a compile-guard trip
45339
- * (over-length pattern, brace-expansion budget, nesting depth) into a
45340
- * {@link ConfigurationError} naming the offending glob on the typed channel.
45341
- */
45342
- function compileGlob(glob) {
45343
- return GlobPattern.compile(glob, GLOB_OPTIONS).pipe(Effect.mapError((error) => new ConfigurationError({
45344
- field: "glob",
45345
- reason: `Invalid glob pattern ${JSON.stringify(glob)}: ${error.message}`
45346
- })));
45347
- }
45348
46154
  /**
45349
46155
  * Pure attribution helper: does `glob` (under this service's `dot: true`
45350
46156
  * semantics) match the repo-relative POSIX path `rel`? An uncompilable
45351
46157
  * pattern matches nothing.
45352
46158
  */
45353
46159
  function globMatchesRel(glob, rel) {
45354
- const result = Effect.runSync(Effect.result(GlobPattern.compile(glob, GLOB_OPTIONS)));
46160
+ const result = GlobPattern.compileResult(glob, GLOB_OPTIONS$1);
45355
46161
  return Result.isSuccess(result) && result.success.matches(rel);
45356
46162
  }
45357
46163
  /**
@@ -45367,13 +46173,14 @@ function globMatchesRel(glob, rel) {
45367
46173
  * module already speaks POSIX-relative match paths).
45368
46174
  */
45369
46175
  function materializeGlob(glob, cwd) {
45370
- return compileGlob(glob).pipe(Effect.flatMap((pattern) => descend(pattern, {
46176
+ return compileAndExpand(glob, {
45371
46177
  cwd,
45372
- onUnreadable: "skip"
46178
+ onUnreadable: "skip",
46179
+ glob: GLOB_OPTIONS$1
45373
46180
  }).pipe(Effect.mapError((error) => new ConfigurationError({
45374
46181
  field: "glob",
45375
- reason: `Failed to materialize glob ${JSON.stringify(glob)}: ${error.message}`
45376
- })), Effect.provide(Path.layer))));
46182
+ reason: error.stage === "compile" ? `Invalid glob pattern ${JSON.stringify(glob)}: ${error.cause.message}` : `Failed to materialize glob ${JSON.stringify(glob)}: ${error.cause.message}`
46183
+ })), Effect.provide(Path.layer));
45377
46184
  }
45378
46185
  /**
45379
46186
  * Determine whether `child` is the same directory as `parent` or sits inside
@@ -47084,19 +47891,29 @@ var VersionFiles = class VersionFiles {
47084
47891
  }
47085
47892
  };
47086
47893
  /**
47894
+ * Match dotfiles, matching `ConfigInspector`'s glob dialect.
47895
+ *
47896
+ * @remarks
47897
+ * This module previously compiled with minimatch DEFAULTS while
47898
+ * `ConfigInspector` compiled with `dot: true`, so a wildcard segment matching
47899
+ * a dotted directory was attributed to a package but never materialized (or
47900
+ * the reverse). The two paths must agree: attribution and materialization
47901
+ * answer the same question about the same glob.
47902
+ */
47903
+ const GLOB_OPTIONS = GlobPatternOptions.make({ dot: true });
47904
+ /**
47087
47905
  * Expand a glob pattern against the filesystem, returning matching FILE paths
47088
47906
  * relative to `cwd` (POSIX separators), sorted by relative path.
47089
47907
  *
47090
47908
  * @remarks
47091
- * The walk is `@effected/walker`'s `descend` (literal fast path,
47909
+ * The walk is `@effected/walker`'s `compileAndExpand` (literal fast path,
47092
47910
  * `enumerationPrefix` bounding, `node_modules`/`.git` pruning), with
47093
47911
  * `onUnreadable: "skip"` preserving this module's silent-skip policy for
47094
- * unreadable directories. Matching semantics are minimatch DEFAULTS via the
47095
- * compiled pattern notably, wildcards do not match dotfiles, same as the
47096
- * previous `tinyglobby` defaults. An uncompilable pattern expands to no
47097
- * matches. `descend`'s `Path` requirement is satisfied internally with the
47098
- * core POSIX `Path.layer` this module already speaks POSIX relative match
47099
- * paths and node-bound absolute paths throughout.
47912
+ * unreadable directories. Matching semantics are {@link GLOB_OPTIONS}
47913
+ * wildcards DO match dotfiles, aligning this module with `ConfigInspector`. An
47914
+ * uncompilable pattern expands to no matches. The `Path` requirement is
47915
+ * satisfied internally with the core POSIX `Path.layer` this module already
47916
+ * speaks POSIX relative match paths and node-bound absolute paths throughout.
47100
47917
  *
47101
47918
  * @param source - The glob pattern, repo-relative
47102
47919
  * @param cwd - Absolute directory the pattern is resolved against
@@ -47105,13 +47922,11 @@ var VersionFiles = class VersionFiles {
47105
47922
  * @internal
47106
47923
  */
47107
47924
  function expandGlob(source, cwd) {
47108
- return Effect.option(GlobPattern.compile(source)).pipe(Effect.flatMap(Option.match({
47109
- onNone: () => Effect.succeed([]),
47110
- onSome: (pattern) => descend(pattern, {
47111
- cwd,
47112
- onUnreadable: "skip"
47113
- })
47114
- })), Effect.provide(Path.layer));
47925
+ return compileAndExpand(source, {
47926
+ cwd,
47927
+ onUnreadable: "skip",
47928
+ glob: GLOB_OPTIONS
47929
+ }).pipe(Effect.catch((error) => error.stage === "compile" ? Effect.succeed([]) : Effect.fail(error)), Effect.provide(Path.layer));
47115
47930
  }
47116
47931
  /**
47117
47932
  * Read the `version` field from a `package.json` in the given directory.
@@ -58262,7 +59077,7 @@ function validatePackages(packages) {
58262
59077
  }
58263
59078
 
58264
59079
  //#endregion
58265
- //#region ../../node_modules/.pnpm/@changesets+get-dependents-graph@3.0.0-next.6/node_modules/@changesets/get-dependents-graph/dist/index.mjs
59080
+ //#region ../../node_modules/.pnpm/@changesets+get-dependents-graph@3.0.0-next.7/node_modules/@changesets/get-dependents-graph/dist/index.mjs
58266
59081
  var src_default = new Proxy({}, { get(target, color) {
58267
59082
  target[color] ??= (text) => styleText(color, text);
58268
59083
  return target[color];
@@ -58383,7 +59198,7 @@ function getDependentsGraph(packages, opts) {
58383
59198
  }
58384
59199
 
58385
59200
  //#endregion
58386
- //#region ../../node_modules/.pnpm/@changesets+should-skip-package@1.0.0-next.6/node_modules/@changesets/should-skip-package/dist/index.mjs
59201
+ //#region ../../node_modules/.pnpm/@changesets+should-skip-package@1.0.0-next.7/node_modules/@changesets/should-skip-package/dist/index.mjs
58387
59202
  function shouldSkipPackage({ packageJson }, { ignore, allowPrivatePackages }) {
58388
59203
  if (ignore.includes(packageJson.name)) return true;
58389
59204
  if (packageJson.private && !allowPrivatePackages) return true;
@@ -58391,7 +59206,7 @@ function shouldSkipPackage({ packageJson }, { ignore, allowPrivatePackages }) {
58391
59206
  }
58392
59207
 
58393
59208
  //#endregion
58394
- //#region ../../node_modules/.pnpm/@changesets+config@4.0.0-next.6/node_modules/@changesets/config/dist/index.mjs
59209
+ //#region ../../node_modules/.pnpm/@changesets+config@4.0.0-next.7/node_modules/@changesets/config/dist/index.mjs
58395
59210
  const DEFAULT_CONFIG = {
58396
59211
  lang: void 0,
58397
59212
  message: void 0,
@@ -59303,7 +60118,7 @@ async function readConfig(cwd, packages) {
59303
60118
  packages ??= await getPackages(cwd);
59304
60119
  return validateConfig(JSON.parse(await fs$1.readFile(path$1.join(packages.rootDir, ".changeset", "config.json"), "utf8")), packages);
59305
60120
  }
59306
- var version = "4.0.0-next.6";
60121
+ var version = "4.0.0-next.7";
59307
60122
  const defaultWrittenConfig = {
59308
60123
  ["$schema"]: `https://unpkg.com/@changesets/config@${version}/schema.json`,
59309
60124
  baseBranch: "main",
@@ -60030,230 +60845,6 @@ function isMetadataYarnClassic(metadataPath) {
60030
60845
  return metadataPath.endsWith(".yarn_integrity");
60031
60846
  }
60032
60847
 
60033
- //#endregion
60034
- //#region ../../node_modules/.pnpm/@changesets+format@0.1.0/node_modules/@changesets/format/dist/index.js
60035
- /**
60036
- * Traverse upwards from `startDir` to `stopDir` (inclusive), calling `cb` in each directory. If
60037
- * `cb` returns a non-null value, it'll stop and return that value.
60038
- */
60039
- function traverseUpwards(startDir, stopDir, cb) {
60040
- let dir = startDir;
60041
- while (dir) {
60042
- const result = cb(dir);
60043
- if (result !== void 0) return result;
60044
- if (dir === stopDir) break;
60045
- const nextDir = path$1.dirname(dir);
60046
- if (nextDir === dir) break;
60047
- dir = nextDir;
60048
- }
60049
- }
60050
- async function packageManagerExecute(packageManager, args, cwd) {
60051
- const cmd = resolveCommand(packageManager, "execute-local", args) ?? {
60052
- command: "npx",
60053
- args
60054
- };
60055
- return await spawnProcess(cmd.command, cmd.args, cwd);
60056
- }
60057
- async function spawnProcess(command, args, cwd) {
60058
- return new Promise((resolve, reject) => {
60059
- const child = cp.spawn(command, args, { cwd });
60060
- let stderr = "";
60061
- child.stderr.on("data", (data) => {
60062
- stderr += data.toString();
60063
- });
60064
- child.on("exit", (code) => {
60065
- if (code === 0) resolve();
60066
- else reject(/* @__PURE__ */ new Error(`${command} exited with code ${code}. Stderr:\n${stderr}`));
60067
- });
60068
- child.on("error", (err) => {
60069
- reject(err);
60070
- });
60071
- });
60072
- }
60073
- const formatters = {
60074
- prettier: {
60075
- name: "prettier",
60076
- packageName: "prettier",
60077
- configFiles: [
60078
- ".prettierrc",
60079
- ".prettierrc.json",
60080
- ".prettierrc.yml",
60081
- ".prettierrc.yaml",
60082
- ".prettierrc.json5",
60083
- ".prettierrc.js",
60084
- "prettier.config.js",
60085
- ".prettierrc.ts",
60086
- "prettier.config.ts",
60087
- ".prettierrc.mjs",
60088
- "prettier.config.mjs",
60089
- ".prettierrc.mts",
60090
- "prettier.config.mts",
60091
- ".prettierrc.cjs",
60092
- "prettier.config.cjs",
60093
- ".prettierrc.cts",
60094
- "prettier.config.cts",
60095
- ".prettierrc.toml",
60096
- {
60097
- file: "package.json",
60098
- key: "prettier"
60099
- }
60100
- ],
60101
- async format(files, ctx) {
60102
- await packageManagerExecute(await ctx.getPackageManager(), [
60103
- "prettier",
60104
- "--write",
60105
- ...files
60106
- ], ctx.cwd);
60107
- }
60108
- },
60109
- biome: {
60110
- name: "biome",
60111
- packageName: "@biomejs/biome",
60112
- configFiles: [
60113
- "biome.json",
60114
- "biome.jsonc",
60115
- ".biome.json",
60116
- ".biome.jsonc"
60117
- ],
60118
- async format(files, ctx) {
60119
- await packageManagerExecute(await ctx.getPackageManager(), [
60120
- "@biomejs/biome",
60121
- "format",
60122
- "--write",
60123
- ...files
60124
- ], ctx.cwd);
60125
- }
60126
- },
60127
- oxfmt: {
60128
- name: "oxfmt",
60129
- packageName: "oxfmt",
60130
- configFiles: [
60131
- ".oxfmtrc.json",
60132
- ".oxfmtrc.jsonc",
60133
- "oxfmt.config.ts"
60134
- ],
60135
- async format(files, ctx) {
60136
- await packageManagerExecute(await ctx.getPackageManager(), [
60137
- "oxfmt",
60138
- "--write",
60139
- ...files
60140
- ], ctx.cwd);
60141
- }
60142
- },
60143
- deno: {
60144
- name: "deno",
60145
- configFiles: [
60146
- "deno.json",
60147
- "deno.jsonc",
60148
- {
60149
- file: "deno.json",
60150
- key: "fmt"
60151
- }
60152
- ],
60153
- async format(files, ctx) {
60154
- await spawnProcess("deno", ["fmt", ...files], ctx.cwd);
60155
- }
60156
- },
60157
- dprint: {
60158
- name: "dprint",
60159
- packageName: "dprint",
60160
- configFiles: [
60161
- "dprint.json",
60162
- "dprint.jsonc",
60163
- ".dprint.json",
60164
- ".dprint.jsonc"
60165
- ],
60166
- async format(files, ctx) {
60167
- await packageManagerExecute(await ctx.getPackageManager(), [
60168
- "dprint",
60169
- "fmt",
60170
- ...files
60171
- ], ctx.cwd);
60172
- }
60173
- }
60174
- };
60175
- const defaultDetectOrder = Object.freeze([
60176
- "dprint",
60177
- "deno",
60178
- "oxfmt",
60179
- "biome",
60180
- "prettier"
60181
- ]);
60182
- /**
60183
- * Detect the preferred formatter used in the project.
60184
- */
60185
- async function detect(options = {}) {
60186
- const cwd = options.cwd ? path$1.resolve(options.cwd) : process.cwd();
60187
- const stopDir = options.stopDir ? path$1.resolve(cwd, options.stopDir) : void 0;
60188
- const order = options.order ?? defaultDetectOrder;
60189
- let found = traverseUpwards(cwd, stopDir, (dir) => {
60190
- for (const formatterName of order) {
60191
- const formatter = formatters[formatterName];
60192
- for (const configFile of formatter.configFiles) if (typeof configFile === "string") {
60193
- const configFilePath = path$1.join(dir, configFile);
60194
- if (fs.existsSync(configFilePath)) return formatter.name;
60195
- } else if (checkConfigFileWithKeyExists(path$1.join(dir, configFile.file), configFile.key)) return formatter.name;
60196
- }
60197
- });
60198
- found ??= traverseUpwards(cwd, stopDir, (dir) => {
60199
- for (const formatterName of order) {
60200
- const formatter = formatters[formatterName];
60201
- if (formatter.packageName) {
60202
- const packagePath = path$1.join(dir, "node_modules", formatter.packageName);
60203
- if (fs.existsSync(packagePath)) return formatter.name;
60204
- }
60205
- }
60206
- });
60207
- return found;
60208
- }
60209
- function checkConfigFileWithKeyExists(configFile, key) {
60210
- try {
60211
- const content = fs.readFileSync(configFile, "utf-8");
60212
- return key in JSON.parse(content);
60213
- } catch {
60214
- return false;
60215
- }
60216
- }
60217
- /**
60218
- * Format the given patterns with a specified or auto-detected formatter. It returns `true` if a
60219
- * formatter is found and the formatting process passes, otherwise returns `false`.
60220
- */
60221
- async function format$1(patterns, options = {}) {
60222
- const formatterName = options.formatter ?? await detect({
60223
- cwd: options.cwd,
60224
- stopDir: options.stopDir
60225
- });
60226
- if (!formatterName) return false;
60227
- const formatter = formatters[formatterName];
60228
- const ctx = {
60229
- cwd: options.cwd ? path$1.resolve(options.cwd) : process.cwd(),
60230
- async getPackageManager() {
60231
- if (options.packageManager) return options.packageManager;
60232
- return (await detect$1({
60233
- cwd: options.cwd,
60234
- stopDir: options.stopDir
60235
- }))?.agent ?? "npm";
60236
- }
60237
- };
60238
- await formatter.format(patterns, ctx);
60239
- return true;
60240
- }
60241
-
60242
- //#endregion
60243
- //#region ../../node_modules/.pnpm/@changesets+errors@1.0.0-next.3/node_modules/@changesets/errors/dist/index.mjs
60244
- var GitError = class extends Error {
60245
- code;
60246
- constructor(code, message) {
60247
- super(`${message}, exit code: ${code}`);
60248
- this.code = code;
60249
- }
60250
- };
60251
- var InternalError = class extends Error {
60252
- constructor(message) {
60253
- super(message);
60254
- }
60255
- };
60256
-
60257
60848
  //#endregion
60258
60849
  //#region ../../node_modules/.pnpm/tinyexec@1.2.4/node_modules/tinyexec/dist/main.mjs
60259
60850
  const h = /^path$/i;
@@ -60582,7 +61173,221 @@ const R = (e, t, n) => {
60582
61173
  const z = R;
60583
61174
 
60584
61175
  //#endregion
60585
- //#region ../../node_modules/.pnpm/@changesets+git@4.0.0-next.6/node_modules/@changesets/git/dist/index.mjs
61176
+ //#region ../../node_modules/.pnpm/@changesets+format@0.1.1/node_modules/@changesets/format/dist/index.js
61177
+ /**
61178
+ * Traverse upwards from `startDir` to `stopDir` (inclusive), calling `cb` in each directory. If
61179
+ * `cb` returns a non-null value, it'll stop and return that value.
61180
+ */
61181
+ function traverseUpwards(startDir, stopDir, cb) {
61182
+ let dir = startDir;
61183
+ while (dir) {
61184
+ const result = cb(dir);
61185
+ if (result !== void 0) return result;
61186
+ if (dir === stopDir) break;
61187
+ const nextDir = path$1.dirname(dir);
61188
+ if (nextDir === dir) break;
61189
+ dir = nextDir;
61190
+ }
61191
+ }
61192
+ async function packageManagerExecute(packageManager, args, cwd) {
61193
+ const cmd = resolveCommand(packageManager, "execute-local", args) ?? {
61194
+ command: "npx",
61195
+ args
61196
+ };
61197
+ return await spawnProcess(cmd.command, cmd.args, cwd);
61198
+ }
61199
+ async function spawnProcess(command, args, cwd) {
61200
+ await z(command, args, {
61201
+ nodeOptions: { cwd },
61202
+ throwOnError: true
61203
+ });
61204
+ }
61205
+ const formatters = {
61206
+ prettier: {
61207
+ name: "prettier",
61208
+ packageName: "prettier",
61209
+ configFiles: [
61210
+ ".prettierrc",
61211
+ ".prettierrc.json",
61212
+ ".prettierrc.yml",
61213
+ ".prettierrc.yaml",
61214
+ ".prettierrc.json5",
61215
+ ".prettierrc.js",
61216
+ "prettier.config.js",
61217
+ ".prettierrc.ts",
61218
+ "prettier.config.ts",
61219
+ ".prettierrc.mjs",
61220
+ "prettier.config.mjs",
61221
+ ".prettierrc.mts",
61222
+ "prettier.config.mts",
61223
+ ".prettierrc.cjs",
61224
+ "prettier.config.cjs",
61225
+ ".prettierrc.cts",
61226
+ "prettier.config.cts",
61227
+ ".prettierrc.toml",
61228
+ {
61229
+ file: "package.json",
61230
+ key: "prettier"
61231
+ }
61232
+ ],
61233
+ async format(files, ctx) {
61234
+ await packageManagerExecute(await ctx.getPackageManager(), [
61235
+ "prettier",
61236
+ "--write",
61237
+ ...files
61238
+ ], ctx.cwd);
61239
+ }
61240
+ },
61241
+ biome: {
61242
+ name: "biome",
61243
+ packageName: "@biomejs/biome",
61244
+ configFiles: [
61245
+ "biome.json",
61246
+ "biome.jsonc",
61247
+ ".biome.json",
61248
+ ".biome.jsonc"
61249
+ ],
61250
+ async format(files, ctx) {
61251
+ await packageManagerExecute(await ctx.getPackageManager(), [
61252
+ "@biomejs/biome",
61253
+ "format",
61254
+ "--write",
61255
+ ...files
61256
+ ], ctx.cwd);
61257
+ }
61258
+ },
61259
+ oxfmt: {
61260
+ name: "oxfmt",
61261
+ packageName: "oxfmt",
61262
+ configFiles: [
61263
+ ".oxfmtrc.json",
61264
+ ".oxfmtrc.jsonc",
61265
+ "oxfmt.config.ts"
61266
+ ],
61267
+ async format(files, ctx) {
61268
+ await packageManagerExecute(await ctx.getPackageManager(), [
61269
+ "oxfmt",
61270
+ "--write",
61271
+ ...files
61272
+ ], ctx.cwd);
61273
+ }
61274
+ },
61275
+ deno: {
61276
+ name: "deno",
61277
+ configFiles: [
61278
+ "deno.json",
61279
+ "deno.jsonc",
61280
+ {
61281
+ file: "deno.json",
61282
+ key: "fmt"
61283
+ }
61284
+ ],
61285
+ async format(files, ctx) {
61286
+ await spawnProcess("deno", ["fmt", ...files], ctx.cwd);
61287
+ }
61288
+ },
61289
+ dprint: {
61290
+ name: "dprint",
61291
+ packageName: "dprint",
61292
+ configFiles: [
61293
+ "dprint.json",
61294
+ "dprint.jsonc",
61295
+ ".dprint.json",
61296
+ ".dprint.jsonc"
61297
+ ],
61298
+ async format(files, ctx) {
61299
+ await packageManagerExecute(await ctx.getPackageManager(), [
61300
+ "dprint",
61301
+ "fmt",
61302
+ ...files
61303
+ ], ctx.cwd);
61304
+ }
61305
+ }
61306
+ };
61307
+ const defaultDetectOrder = Object.freeze([
61308
+ "dprint",
61309
+ "deno",
61310
+ "oxfmt",
61311
+ "biome",
61312
+ "prettier"
61313
+ ]);
61314
+ /**
61315
+ * Detect the preferred formatter used in the project.
61316
+ */
61317
+ async function detect(options = {}) {
61318
+ const cwd = options.cwd ? path$1.resolve(options.cwd) : process.cwd();
61319
+ const stopDir = options.stopDir ? path$1.resolve(cwd, options.stopDir) : void 0;
61320
+ const order = options.order ?? defaultDetectOrder;
61321
+ let found = traverseUpwards(cwd, stopDir, (dir) => {
61322
+ for (const formatterName of order) {
61323
+ const formatter = formatters[formatterName];
61324
+ for (const configFile of formatter.configFiles) if (typeof configFile === "string") {
61325
+ const configFilePath = path$1.join(dir, configFile);
61326
+ if (fs.existsSync(configFilePath)) return formatter.name;
61327
+ } else if (checkConfigFileWithKeyExists(path$1.join(dir, configFile.file), configFile.key)) return formatter.name;
61328
+ }
61329
+ });
61330
+ found ??= traverseUpwards(cwd, stopDir, (dir) => {
61331
+ for (const formatterName of order) {
61332
+ const formatter = formatters[formatterName];
61333
+ if (formatter.packageName) {
61334
+ const packagePath = path$1.join(dir, "node_modules", formatter.packageName);
61335
+ if (fs.existsSync(packagePath)) return formatter.name;
61336
+ }
61337
+ }
61338
+ });
61339
+ return found;
61340
+ }
61341
+ function checkConfigFileWithKeyExists(configFile, key) {
61342
+ try {
61343
+ const content = fs.readFileSync(configFile, "utf-8");
61344
+ return key in JSON.parse(content);
61345
+ } catch {
61346
+ return false;
61347
+ }
61348
+ }
61349
+ /**
61350
+ * Format the given patterns with a specified or auto-detected formatter. It returns `true` if a
61351
+ * formatter is found and the formatting process passes, otherwise returns `false`.
61352
+ */
61353
+ async function format$1(patterns, options = {}) {
61354
+ const formatterName = options.formatter ?? await detect({
61355
+ cwd: options.cwd,
61356
+ stopDir: options.stopDir
61357
+ });
61358
+ if (!formatterName) return false;
61359
+ const formatter = formatters[formatterName];
61360
+ const ctx = {
61361
+ cwd: options.cwd ? path$1.resolve(options.cwd) : process.cwd(),
61362
+ async getPackageManager() {
61363
+ if (options.packageManager) return options.packageManager;
61364
+ return (await detect$1({
61365
+ cwd: options.cwd,
61366
+ stopDir: options.stopDir
61367
+ }))?.agent ?? "npm";
61368
+ }
61369
+ };
61370
+ await formatter.format(patterns, ctx);
61371
+ return true;
61372
+ }
61373
+
61374
+ //#endregion
61375
+ //#region ../../node_modules/.pnpm/@changesets+errors@1.0.0-next.4/node_modules/@changesets/errors/dist/index.mjs
61376
+ var GitError = class extends Error {
61377
+ code;
61378
+ constructor(code, message) {
61379
+ super(`${message}, exit code: ${code}`);
61380
+ this.code = code;
61381
+ }
61382
+ };
61383
+ var InternalError = class extends Error {
61384
+ constructor(message) {
61385
+ super(message);
61386
+ }
61387
+ };
61388
+
61389
+ //#endregion
61390
+ //#region ../../node_modules/.pnpm/@changesets+git@4.0.0-next.7/node_modules/@changesets/git/dist/index.mjs
60586
61391
  async function getDivergedCommit(cwd, ref) {
60587
61392
  const cmd = await z("git", [
60588
61393
  "merge-base",
@@ -62754,7 +63559,7 @@ function applyEdits(text, edits) {
62754
63559
  }
62755
63560
 
62756
63561
  //#endregion
62757
- //#region ../../node_modules/.pnpm/@changesets+apply-release-plan@8.0.0-next.7/node_modules/@changesets/apply-release-plan/dist/index.mjs
63562
+ //#region ../../node_modules/.pnpm/@changesets+apply-release-plan@8.0.0-next.8/node_modules/@changesets/apply-release-plan/dist/index.mjs
62758
63563
  /**
62759
63564
  * A simple JSON editing utility that preserves formatting. They specified operation keys
62760
63565
  * must exist in the JSON for this implementation.
@@ -62895,13 +63700,8 @@ const DEPENDENCY_TYPES = [
62895
63700
  "peerDependencies",
62896
63701
  "optionalDependencies"
62897
63702
  ];
62898
- function versionPackage(release, versionsToUpdate, { cwd, updateInternalDependencies, onlyUpdatePeerDependentsWhenOutOfRange, bumpVersionsWithWorkspaceProtocolOnly, snapshot }) {
63703
+ function getDependencyVersionEdits(packageJson, versionsToUpdate, { cwd, updateInternalDependencies, onlyUpdatePeerDependentsWhenOutOfRange, bumpVersionsWithWorkspaceProtocolOnly, snapshot }) {
62899
63704
  const pkgJsonEdits = [];
62900
- const { newVersion, packageJson } = release;
62901
- pkgJsonEdits.push({
62902
- keys: ["version"],
62903
- value: newVersion
62904
- });
62905
63705
  for (const depType of DEPENDENCY_TYPES) {
62906
63706
  const deps = packageJson[depType];
62907
63707
  if (deps) for (const { name, version, oldVersion, type, dir } of versionsToUpdate) {
@@ -62935,10 +63735,7 @@ function versionPackage(release, versionsToUpdate, { cwd, updateInternalDependen
62935
63735
  }
62936
63736
  }
62937
63737
  }
62938
- return {
62939
- ...release,
62940
- pkgJsonEdits
62941
- };
63738
+ return pkgJsonEdits;
62942
63739
  }
62943
63740
  function getVersionRangeType(versionRange) {
62944
63741
  if (versionRange.charAt(0) === "^") return "^";
@@ -62969,6 +63766,13 @@ async function getFormatter(config, cwd) {
62969
63766
  });
62970
63767
  };
62971
63768
  }
63769
+ async function updatePackageJson(dir, edits) {
63770
+ if (edits.length === 0) return;
63771
+ const pkgJsonPath = path$1.resolve(dir, "package.json");
63772
+ const pkgUpdated = editJson(await fs$1.readFile(pkgJsonPath, "utf8"), edits);
63773
+ await fs$1.writeFile(pkgJsonPath, pkgUpdated);
63774
+ return pkgJsonPath;
63775
+ }
62972
63776
  async function applyReleasePlan(releasePlan, packages, config = defaultConfig, snapshot, contextDir = import.meta.dirname) {
62973
63777
  const cwd = packages.rootDir;
62974
63778
  const touchedFiles = [];
@@ -62997,22 +63801,21 @@ async function applyReleasePlan(releasePlan, packages, config = defaultConfig, s
62997
63801
  type,
62998
63802
  dir: packagesByName.get(name).dir
62999
63803
  }));
63000
- const finalisedRelease = releaseWithChangelogs.map((release) => {
63001
- return versionPackage(release, versionsToUpdate, {
63002
- cwd,
63003
- updateInternalDependencies: config.updateInternalDependencies,
63004
- onlyUpdatePeerDependentsWhenOutOfRange: config.___experimentalUnsafeOptions_WILL_CHANGE_IN_PATCH.onlyUpdatePeerDependentsWhenOutOfRange,
63005
- bumpVersionsWithWorkspaceProtocolOnly: config.bumpVersionsWithWorkspaceProtocolOnly,
63006
- snapshot
63007
- });
63008
- });
63804
+ const dependencyUpdateOptions = {
63805
+ cwd,
63806
+ updateInternalDependencies: config.updateInternalDependencies,
63807
+ onlyUpdatePeerDependentsWhenOutOfRange: config.___experimentalUnsafeOptions_WILL_CHANGE_IN_PATCH.onlyUpdatePeerDependentsWhenOutOfRange,
63808
+ bumpVersionsWithWorkspaceProtocolOnly: config.bumpVersionsWithWorkspaceProtocolOnly,
63809
+ snapshot
63810
+ };
63009
63811
  const filesToFormat = [];
63010
- for (const release of finalisedRelease) {
63011
- const { changelog, pkgJsonEdits, dir, name } = release;
63012
- const pkgJsonPath = path$1.resolve(dir, "package.json");
63013
- const pkgUpdated = editJson(await fs$1.readFile(pkgJsonPath, "utf8"), pkgJsonEdits);
63014
- await fs$1.writeFile(pkgJsonPath, pkgUpdated);
63015
- touchedFiles.push(pkgJsonPath);
63812
+ for (const release of releaseWithChangelogs) {
63813
+ const { changelog, dir, name, newVersion, packageJson } = release;
63814
+ const pkgJsonPath = await updatePackageJson(dir, [{
63815
+ keys: ["version"],
63816
+ value: newVersion
63817
+ }, ...getDependencyVersionEdits(packageJson, versionsToUpdate, dependencyUpdateOptions)]);
63818
+ if (pkgJsonPath) touchedFiles.push(pkgJsonPath);
63016
63819
  if (changelog && changelog.length > 0) {
63017
63820
  const changelogPath = path$1.resolve(dir, "CHANGELOG.md");
63018
63821
  await updateChangelog(changelogPath, changelog, name);
@@ -63020,6 +63823,11 @@ async function applyReleasePlan(releasePlan, packages, config = defaultConfig, s
63020
63823
  filesToFormat.push(changelogPath);
63021
63824
  }
63022
63825
  }
63826
+ if (packages.rootPackage) {
63827
+ const pkgJsonEdits = getDependencyVersionEdits(packages.rootPackage.packageJson, versionsToUpdate, dependencyUpdateOptions);
63828
+ const pkgJsonPath = await updatePackageJson(packages.rootPackage.dir, pkgJsonEdits);
63829
+ if (pkgJsonPath) touchedFiles.push(pkgJsonPath);
63830
+ }
63023
63831
  if (filesToFormat.length > 0) await (await getFormatter(config.format, cwd))(filesToFormat);
63024
63832
  if (releasePlan.preState == null || releasePlan.preState.mode === "exit") {
63025
63833
  const changesetFolder = path$1.resolve(cwd, ".changeset");
@@ -63111,7 +63919,7 @@ async function updateChangelog(changelogPath, changelog, name) {
63111
63919
  }
63112
63920
 
63113
63921
  //#endregion
63114
- //#region ../../node_modules/.pnpm/@changesets+assemble-release-plan@7.0.0-next.7/node_modules/@changesets/assemble-release-plan/dist/index.mjs
63922
+ //#region ../../node_modules/.pnpm/@changesets+assemble-release-plan@7.0.0-next.8/node_modules/@changesets/assemble-release-plan/dist/index.mjs
63115
63923
  function getHighestReleaseType(releases) {
63116
63924
  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`);
63117
63925
  let highestReleaseType = "none";
@@ -63458,7 +64266,7 @@ function getPreInfo(changesets, packagesByName, config, preState) {
63458
64266
  }
63459
64267
 
63460
64268
  //#endregion
63461
- //#region ../../node_modules/.pnpm/@changesets+pre@3.0.0-next.6/node_modules/@changesets/pre/dist/index.mjs
64269
+ //#region ../../node_modules/.pnpm/@changesets+pre@3.0.0-next.7/node_modules/@changesets/pre/dist/index.mjs
63462
64270
  async function outputFile(filePath, content) {
63463
64271
  await fs$1.mkdir(path$1.dirname(filePath), { recursive: true });
63464
64272
  await fs$1.writeFile(filePath, content, "utf8");
@@ -63488,7 +64296,7 @@ async function migratePreState(rootDir, preState) {
63488
64296
  }
63489
64297
 
63490
64298
  //#endregion
63491
- //#region ../../node_modules/.pnpm/@changesets+parse@1.0.0-next.7/node_modules/@changesets/parse/dist/index.mjs
64299
+ //#region ../../node_modules/.pnpm/@changesets+parse@1.0.0-next.8/node_modules/@changesets/parse/dist/index.mjs
63492
64300
  const mdRegex = /\s*---([^]*?)\r?\n\s*---(\s*(?:\n|$)[^]*)/;
63493
64301
  const EXAMPLE_FORMAT = `---\n"package-name": patch\n---`;
63494
64302
  const validVersionTypes = [
@@ -63542,7 +64350,7 @@ YAML error: ${e instanceof Error ? e.message : String(e)}\nFrontmatter content:\
63542
64350
  }
63543
64351
 
63544
64352
  //#endregion
63545
- //#region ../../node_modules/.pnpm/@changesets+read@1.0.0-next.7/node_modules/@changesets/read/dist/index.mjs
64353
+ //#region ../../node_modules/.pnpm/@changesets+read@1.0.0-next.8/node_modules/@changesets/read/dist/index.mjs
63546
64354
  const ignoredMdFiles = [
63547
64355
  /^README\.md$/i,
63548
64356
  "AGENTS.md",
@@ -63576,7 +64384,7 @@ async function readChangesets(rootDir, sinceRef) {
63576
64384
  }
63577
64385
 
63578
64386
  //#endregion
63579
- //#region ../../node_modules/.pnpm/@changesets+get-release-plan@5.0.0-next.7/node_modules/@changesets/get-release-plan/dist/index.mjs
64387
+ //#region ../../node_modules/.pnpm/@changesets+get-release-plan@5.0.0-next.8/node_modules/@changesets/get-release-plan/dist/index.mjs
63580
64388
  async function getReleasePlan(cwd, sinceRef, passedConfig) {
63581
64389
  const packages = await getPackages(cwd);
63582
64390
  const configResult = await readConfig(packages.rootDir, packages);