@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.
- package/changesets-changelog.cjs +1313 -529
- package/changesets-changelog.d.cts +425 -40
- package/changesets-changelog.d.ts +425 -40
- package/changesets-changelog.js +1343 -535
- package/changesets-markdownlint.cjs +1313 -529
- package/changesets-markdownlint.d.cts +425 -40
- package/changesets-markdownlint.d.ts +425 -40
- package/changesets-markdownlint.js +1343 -535
- package/package.json +5 -5
- package/tsconfig/node/dist/tsconfig.tsbuildinfo +1 -1
|
@@ -56,7 +56,6 @@ let module$1 = require("module");
|
|
|
56
56
|
let semver_classes_range_js = require("semver/classes/range.js");
|
|
57
57
|
semver_classes_range_js = __toESM(semver_classes_range_js, 1);
|
|
58
58
|
let node_child_process = require("node:child_process");
|
|
59
|
-
node_child_process = __toESM(node_child_process, 1);
|
|
60
59
|
let node_stream_promises = require("node:stream/promises");
|
|
61
60
|
let node_stream = require("node:stream");
|
|
62
61
|
let node_readline = require("node:readline");
|
|
@@ -424,7 +423,7 @@ const trimTrailingSlashes = (s) => {
|
|
|
424
423
|
return s.slice(0, end);
|
|
425
424
|
};
|
|
426
425
|
//#endregion
|
|
427
|
-
//#region ../../node_modules/.pnpm/@effected+glob@0.
|
|
426
|
+
//#region ../../node_modules/.pnpm/@effected+glob@0.2.0_effect@4.0.0-beta.99/node_modules/@effected/glob/internal/limits.js
|
|
428
427
|
/** Hard cap on pattern length. Upstream minimatch's MAX_PATTERN_LENGTH (64KB). */
|
|
429
428
|
const MAX_PATTERN_LENGTH = 1024 * 64;
|
|
430
429
|
/** Default brace-expansion output budget. Upstream brace-expansion's EXPANSION_MAX. */
|
|
@@ -458,7 +457,7 @@ const assertCap = (name, value) => {
|
|
|
458
457
|
return value;
|
|
459
458
|
};
|
|
460
459
|
//#endregion
|
|
461
|
-
//#region ../../node_modules/.pnpm/@effected+glob@0.
|
|
460
|
+
//#region ../../node_modules/.pnpm/@effected+glob@0.2.0_effect@4.0.0-beta.99/node_modules/@effected/glob/internal/unescape.js
|
|
462
461
|
/**
|
|
463
462
|
* Un-escape a string that has been escaped with `escape`.
|
|
464
463
|
*
|
|
@@ -481,11 +480,11 @@ const unescapePattern = (s, { windowsPathsNoEscape = false, magicalBraces = true
|
|
|
481
480
|
return windowsPathsNoEscape ? s.replace(/\[([^/\\{}])\]/g, "$1") : s.replace(/((?!\\).|^)\[([^/\\{}])\]/g, "$1$2").replace(/\\([^/{}])/g, "$1");
|
|
482
481
|
};
|
|
483
482
|
//#endregion
|
|
484
|
-
//#region ../../node_modules/.pnpm/@effected+glob@0.
|
|
483
|
+
//#region ../../node_modules/.pnpm/@effected+glob@0.2.0_effect@4.0.0-beta.99/node_modules/@effected/glob/internal/types.js
|
|
485
484
|
/** The globstar marker in a compiled pattern set. */
|
|
486
485
|
const GLOBSTAR = Symbol("globstar **");
|
|
487
486
|
//#endregion
|
|
488
|
-
//#region ../../node_modules/.pnpm/@effected+glob@0.
|
|
487
|
+
//#region ../../node_modules/.pnpm/@effected+glob@0.2.0_effect@4.0.0-beta.99/node_modules/@effected/glob/internal/escape.js
|
|
489
488
|
/**
|
|
490
489
|
* Escape all magic characters in a glob pattern.
|
|
491
490
|
*
|
|
@@ -503,13 +502,13 @@ const escapePattern = (s, { windowsPathsNoEscape = false, magicalBraces = false
|
|
|
503
502
|
return windowsPathsNoEscape ? s.replace(/[?*()[\]]/g, "[$&]") : s.replace(/[?*()[\]\\]/g, "\\$&");
|
|
504
503
|
};
|
|
505
504
|
//#endregion
|
|
506
|
-
//#region ../../node_modules/.pnpm/@effected+glob@0.
|
|
505
|
+
//#region ../../node_modules/.pnpm/@effected+glob@0.2.0_effect@4.0.0-beta.99/node_modules/@effected/glob/internal/assertValidPattern.js
|
|
507
506
|
const assertValidPattern = (pattern) => {
|
|
508
507
|
if (typeof pattern !== "string") throw new TypeError("invalid pattern");
|
|
509
508
|
if (pattern.length > 65536) throw new GuardExceeded("PatternTooLong", MAX_PATTERN_LENGTH, pattern.length);
|
|
510
509
|
};
|
|
511
510
|
//#endregion
|
|
512
|
-
//#region ../../node_modules/.pnpm/@effected+glob@0.
|
|
511
|
+
//#region ../../node_modules/.pnpm/@effected+glob@0.2.0_effect@4.0.0-beta.99/node_modules/@effected/glob/internal/braceExpressions.js
|
|
513
512
|
const posixClasses = {
|
|
514
513
|
"[:alnum:]": ["\\p{L}\\p{Nl}\\p{Nd}", true],
|
|
515
514
|
"[:alpha:]": ["\\p{L}\\p{Nl}", true],
|
|
@@ -632,7 +631,7 @@ const parseClass = (glob, position) => {
|
|
|
632
631
|
];
|
|
633
632
|
};
|
|
634
633
|
//#endregion
|
|
635
|
-
//#region ../../node_modules/.pnpm/@effected+glob@0.
|
|
634
|
+
//#region ../../node_modules/.pnpm/@effected+glob@0.2.0_effect@4.0.0-beta.99/node_modules/@effected/glob/internal/ast.js
|
|
636
635
|
const types = /* @__PURE__ */ new Set([
|
|
637
636
|
"!",
|
|
638
637
|
"?",
|
|
@@ -1149,7 +1148,7 @@ var AST = class AST {
|
|
|
1149
1148
|
}
|
|
1150
1149
|
};
|
|
1151
1150
|
//#endregion
|
|
1152
|
-
//#region ../../node_modules/.pnpm/@effected+glob@0.
|
|
1151
|
+
//#region ../../node_modules/.pnpm/@effected+glob@0.2.0_effect@4.0.0-beta.99/node_modules/@effected/glob/internal/balancedMatch.js
|
|
1153
1152
|
const maybeMatch = (reg, str) => {
|
|
1154
1153
|
const m = str.match(reg);
|
|
1155
1154
|
return m ? m[0] : null;
|
|
@@ -1207,7 +1206,7 @@ const range = (a, b, str) => {
|
|
|
1207
1206
|
return result;
|
|
1208
1207
|
};
|
|
1209
1208
|
//#endregion
|
|
1210
|
-
//#region ../../node_modules/.pnpm/@effected+glob@0.
|
|
1209
|
+
//#region ../../node_modules/.pnpm/@effected+glob@0.2.0_effect@4.0.0-beta.99/node_modules/@effected/glob/internal/braceExpansion.js
|
|
1211
1210
|
const escSlash = `\0SLASH${Math.random()}\0`;
|
|
1212
1211
|
const escOpen = `\0OPEN${Math.random()}\0`;
|
|
1213
1212
|
const escClose = `\0CLOSE${Math.random()}\0`;
|
|
@@ -1354,7 +1353,7 @@ function expand_(str, max, isTopInput, depth) {
|
|
|
1354
1353
|
}
|
|
1355
1354
|
}
|
|
1356
1355
|
//#endregion
|
|
1357
|
-
//#region ../../node_modules/.pnpm/@effected+glob@0.
|
|
1356
|
+
//#region ../../node_modules/.pnpm/@effected+glob@0.2.0_effect@4.0.0-beta.99/node_modules/@effected/glob/internal/minimatch.js
|
|
1358
1357
|
const starDotExtRE = /^\*+([^+@!?*[(]*)$/;
|
|
1359
1358
|
const starDotExtTest = (ext) => (f) => !f.startsWith(".") && f.endsWith(ext);
|
|
1360
1359
|
const starDotExtTestDot = (ext) => (f) => f.endsWith(ext);
|
|
@@ -1925,7 +1924,7 @@ var Minimatch = class {
|
|
|
1925
1924
|
}
|
|
1926
1925
|
};
|
|
1927
1926
|
//#endregion
|
|
1928
|
-
//#region ../../node_modules/.pnpm/@effected+glob@0.
|
|
1927
|
+
//#region ../../node_modules/.pnpm/@effected+glob@0.2.0_effect@4.0.0-beta.99/node_modules/@effected/glob/GlobPattern.js
|
|
1929
1928
|
/**
|
|
1930
1929
|
* Typed failure raised when a glob pattern trips a compile-time guard:
|
|
1931
1930
|
* over-length, brace-expansion budget exhaustion, or nesting past the depth
|
|
@@ -2054,17 +2053,30 @@ var GlobPattern = class GlobPattern extends effect.Schema.Class("GlobPattern")(e
|
|
|
2054
2053
|
return this.#engine;
|
|
2055
2054
|
}
|
|
2056
2055
|
/**
|
|
2057
|
-
* Compile a pattern under the given options — the package's
|
|
2058
|
-
* boundary
|
|
2059
|
-
*
|
|
2060
|
-
*
|
|
2056
|
+
* Compile a pattern under the given options, synchronously — the package's
|
|
2057
|
+
* fallible boundary in its primitive form. Compilation is pure
|
|
2058
|
+
* string→predicate work with no IO, no services and no async step, so the
|
|
2059
|
+
* sync form is the real primitive and {@link GlobPattern.compile} is
|
|
2060
|
+
* derived from it.
|
|
2061
|
+
*
|
|
2062
|
+
* Total: never throws for pattern input. Guard trips (over-length,
|
|
2063
|
+
* expansion budget, nesting depth) come back as a `Result` failure holding
|
|
2064
|
+
* {@link GlobPatternError}; invalid *options* never reach here (they throw
|
|
2065
|
+
* at `GlobPatternOptions.make`, a wiring defect).
|
|
2061
2066
|
*
|
|
2062
2067
|
* The pattern must also compile under DEFAULT options, whatever the
|
|
2063
2068
|
* effective options are — permissive options (say `nobrace` over a brace
|
|
2064
2069
|
* bomb) do not admit a defaults-rejected pattern; the same typed error
|
|
2065
2070
|
* surfaces instead.
|
|
2071
|
+
*
|
|
2072
|
+
* @remarks
|
|
2073
|
+
* For synchronous call sites that cannot host an Effect — a lint-staged
|
|
2074
|
+
* handler, a config predicate — this removes the
|
|
2075
|
+
* `Effect.runSync(Effect.result(...))` escape hatch: pair it with
|
|
2076
|
+
* `Result.isSuccess` and read `.success` directly. Effect call sites should
|
|
2077
|
+
* prefer {@link GlobPattern.compile}, which carries the tracing span.
|
|
2066
2078
|
*/
|
|
2067
|
-
static
|
|
2079
|
+
static compileResult(source, options) {
|
|
2068
2080
|
const engineOptions = toEngineOptions(options);
|
|
2069
2081
|
try {
|
|
2070
2082
|
new Minimatch(source, {});
|
|
@@ -2072,16 +2084,30 @@ var GlobPattern = class GlobPattern extends effect.Schema.Class("GlobPattern")(e
|
|
|
2072
2084
|
const pattern = new GlobPattern({ source });
|
|
2073
2085
|
pattern.#engine = engine;
|
|
2074
2086
|
pattern.#engineOptions = engineOptions;
|
|
2075
|
-
return pattern;
|
|
2087
|
+
return effect.Result.succeed(pattern);
|
|
2076
2088
|
} catch (e) {
|
|
2077
|
-
if (isGuardExceeded(e)) return
|
|
2089
|
+
if (isGuardExceeded(e)) return effect.Result.fail(new GlobPatternError({
|
|
2078
2090
|
pattern: source,
|
|
2079
2091
|
reason: e.reason,
|
|
2080
2092
|
limit: e.limit,
|
|
2081
2093
|
actual: e.actual
|
|
2082
|
-
});
|
|
2094
|
+
}));
|
|
2083
2095
|
throw e;
|
|
2084
2096
|
}
|
|
2097
|
+
}
|
|
2098
|
+
/**
|
|
2099
|
+
* Compile a pattern under the given options — the package's fallible
|
|
2100
|
+
* boundary, and the form Effect call sites should reach for. Guard trips
|
|
2101
|
+
* (over-length, expansion budget, nesting depth) fail typed with
|
|
2102
|
+
* {@link GlobPatternError}; invalid options never reach here (they throw at
|
|
2103
|
+
* `GlobPatternOptions.make`, a wiring defect).
|
|
2104
|
+
*
|
|
2105
|
+
* Defined in terms of {@link GlobPattern.compileResult} — synchronous
|
|
2106
|
+
* callers can use that variant directly. Same semantics, same errors; this
|
|
2107
|
+
* form adds only the `GlobPattern.compile` tracing span.
|
|
2108
|
+
*/
|
|
2109
|
+
static compile = effect.Effect.fn("GlobPattern.compile")(function* (source, options) {
|
|
2110
|
+
return yield* effect.Effect.fromResult(GlobPattern.compileResult(source, options));
|
|
2085
2111
|
});
|
|
2086
2112
|
/**
|
|
2087
2113
|
* Whether `candidate` matches this pattern. Total: never throws, never
|
|
@@ -2177,7 +2203,7 @@ var GlobPattern = class GlobPattern extends effect.Schema.Class("GlobPattern")(e
|
|
|
2177
2203
|
})));
|
|
2178
2204
|
};
|
|
2179
2205
|
//#endregion
|
|
2180
|
-
//#region ../../node_modules/.pnpm/@effected+glob@0.
|
|
2206
|
+
//#region ../../node_modules/.pnpm/@effected+glob@0.2.0_effect@4.0.0-beta.99/node_modules/@effected/glob/GlobSet.js
|
|
2181
2207
|
const exclusionTarget = (pattern) => pattern.startsWith("!") ? pattern.slice(1) : void 0;
|
|
2182
2208
|
const allCompileUnderDefaults = (patterns) => {
|
|
2183
2209
|
for (const pattern of patterns) {
|
|
@@ -2252,27 +2278,53 @@ var GlobSet = class GlobSet extends effect.Schema.Class("GlobSet")(effect.Schema
|
|
|
2252
2278
|
return this.#literalSet;
|
|
2253
2279
|
}
|
|
2254
2280
|
/**
|
|
2255
|
-
* Compile a pattern set —
|
|
2256
|
-
*
|
|
2257
|
-
*
|
|
2258
|
-
*
|
|
2281
|
+
* Compile a pattern set, synchronously — the primitive form, mirroring
|
|
2282
|
+
* {@link GlobPattern.compileResult}. Set compilation is pure
|
|
2283
|
+
* string→predicate work with no IO and no async step, so the sync form is
|
|
2284
|
+
* the real primitive and {@link GlobSet.compile} is derived from it.
|
|
2285
|
+
*
|
|
2286
|
+
* Total: never throws for pattern input. Fails on the FIRST uncompilable
|
|
2287
|
+
* member, coming back as a `Result` failure whose {@link GlobPatternError}
|
|
2288
|
+
* names the offending source pattern in `pattern` (bang included for
|
|
2289
|
+
* exclusions).
|
|
2290
|
+
*
|
|
2291
|
+
* @remarks
|
|
2292
|
+
* For synchronous call sites that cannot host an Effect — a lint-staged
|
|
2293
|
+
* handler, a config predicate — this removes the
|
|
2294
|
+
* `Effect.runSync(Effect.result(...))` escape hatch: pair it with
|
|
2295
|
+
* `Result.isSuccess` and read `.success` directly. Effect call sites should
|
|
2296
|
+
* prefer {@link GlobSet.compile}, which carries the tracing span.
|
|
2259
2297
|
*/
|
|
2260
|
-
static
|
|
2298
|
+
static compileResult(patterns) {
|
|
2261
2299
|
for (const pattern of patterns) {
|
|
2262
2300
|
const target = exclusionTarget(pattern) ?? pattern;
|
|
2263
2301
|
try {
|
|
2264
2302
|
new Minimatch(target, {});
|
|
2265
2303
|
} catch (e) {
|
|
2266
|
-
if (isGuardExceeded(e)) return
|
|
2304
|
+
if (isGuardExceeded(e)) return effect.Result.fail(new GlobPatternError({
|
|
2267
2305
|
pattern,
|
|
2268
2306
|
reason: e.reason,
|
|
2269
2307
|
limit: e.limit,
|
|
2270
2308
|
actual: e.actual
|
|
2271
|
-
});
|
|
2309
|
+
}));
|
|
2272
2310
|
throw e;
|
|
2273
2311
|
}
|
|
2274
2312
|
}
|
|
2275
|
-
return new GlobSet({ patterns });
|
|
2313
|
+
return effect.Result.succeed(new GlobSet({ patterns }));
|
|
2314
|
+
}
|
|
2315
|
+
/**
|
|
2316
|
+
* Compile a pattern set — with {@link GlobPattern.compile}, the package's
|
|
2317
|
+
* only other fallible boundary, and the form Effect call sites should reach
|
|
2318
|
+
* for. Fails typed on the FIRST uncompilable member, with the error's
|
|
2319
|
+
* `pattern` field naming the offending source pattern (bang included for
|
|
2320
|
+
* exclusions).
|
|
2321
|
+
*
|
|
2322
|
+
* Defined in terms of {@link GlobSet.compileResult} — synchronous callers
|
|
2323
|
+
* can use that variant directly. Same semantics, same errors; this form
|
|
2324
|
+
* adds only the `GlobSet.compile` tracing span.
|
|
2325
|
+
*/
|
|
2326
|
+
static compile = effect.Effect.fn("GlobSet.compile")(function* (patterns) {
|
|
2327
|
+
return yield* effect.Effect.fromResult(GlobSet.compileResult(patterns));
|
|
2276
2328
|
});
|
|
2277
2329
|
/**
|
|
2278
2330
|
* Whether `candidate` matches the set: some include accepts it (literal
|
|
@@ -2305,7 +2357,7 @@ var GlobSet = class GlobSet extends effect.Schema.Class("GlobSet")(effect.Schema
|
|
|
2305
2357
|
}
|
|
2306
2358
|
};
|
|
2307
2359
|
//#endregion
|
|
2308
|
-
//#region ../../node_modules/.pnpm/@effected+lockfiles@0.1.
|
|
2360
|
+
//#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
|
|
2309
2361
|
/**
|
|
2310
2362
|
* Extension data specific to bun lockfiles, attached to `Lockfile.extension`
|
|
2311
2363
|
* when the format is `"bun"`.
|
|
@@ -2326,7 +2378,7 @@ var BunExtension = class extends effect.Schema.Class("BunExtension")({
|
|
|
2326
2378
|
trustedDependencies: effect.Schema.optionalKey(effect.Schema.Array(effect.Schema.String))
|
|
2327
2379
|
}) {};
|
|
2328
2380
|
//#endregion
|
|
2329
|
-
//#region ../../node_modules/.pnpm/@effected+npm@0.2.
|
|
2381
|
+
//#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
|
|
2330
2382
|
/**
|
|
2331
2383
|
* Contract for resolving pnpm `catalog:` dependency specifiers to concrete
|
|
2332
2384
|
* version ranges.
|
|
@@ -2372,7 +2424,7 @@ var CatalogResolver = class CatalogResolver extends effect.Context.Service()("@e
|
|
|
2372
2424
|
static noop = effect.Layer.succeed(CatalogResolver, { rangeOf: () => effect.Effect.succeed(effect.Option.none()) });
|
|
2373
2425
|
};
|
|
2374
2426
|
//#endregion
|
|
2375
|
-
//#region ../../node_modules/.pnpm/@effected+npm@0.2.
|
|
2427
|
+
//#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
|
|
2376
2428
|
/**
|
|
2377
2429
|
* Raised when a `catalog:` or `workspace:` specifier cannot be resolved
|
|
2378
2430
|
* because the resolution mechanism itself failed — not for an ordinary
|
|
@@ -2433,7 +2485,7 @@ var WorkspaceResolver = class WorkspaceResolver extends effect.Context.Service()
|
|
|
2433
2485
|
static noop = effect.Layer.succeed(WorkspaceResolver, { versionOf: () => effect.Effect.succeed(effect.Option.none()) });
|
|
2434
2486
|
};
|
|
2435
2487
|
//#endregion
|
|
2436
|
-
//#region ../../node_modules/.pnpm/@effected+npm@0.2.
|
|
2488
|
+
//#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
|
|
2437
2489
|
/**
|
|
2438
2490
|
* Raised when a workspace's catalogs cannot be assembled — a `pnpm-workspace.yaml`
|
|
2439
2491
|
* that is unreadable or not valid YAML, a root `package.json` `workspaces` field
|
|
@@ -2477,7 +2529,7 @@ var CatalogAssemblyError = class extends effect.Schema.TaggedErrorClass()("Catal
|
|
|
2477
2529
|
}
|
|
2478
2530
|
};
|
|
2479
2531
|
//#endregion
|
|
2480
|
-
//#region ../../node_modules/.pnpm/@effected+npm@0.2.
|
|
2532
|
+
//#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
|
|
2481
2533
|
/**
|
|
2482
2534
|
* The short dependency kind: which dependency map an entry came from, named the
|
|
2483
2535
|
* way consumers branch on it.
|
|
@@ -2509,7 +2561,7 @@ Object.fromEntries(Object.entries({
|
|
|
2509
2561
|
optional: "optionalDependencies"
|
|
2510
2562
|
}).map(([kind, field]) => [field, kind]));
|
|
2511
2563
|
//#endregion
|
|
2512
|
-
//#region ../../node_modules/.pnpm/@effected+semver@0.
|
|
2564
|
+
//#region ../../node_modules/.pnpm/@effected+semver@0.2.0_effect@4.0.0-beta.99/node_modules/@effected/semver/internal/desugar.js
|
|
2513
2565
|
const sv = (major, minor, patch, prerelease = [], build = []) => ({
|
|
2514
2566
|
major,
|
|
2515
2567
|
minor,
|
|
@@ -2598,7 +2650,7 @@ const desugarHyphen = (lower, upper) => {
|
|
|
2598
2650
|
return [comp(">=", lowerVersion)];
|
|
2599
2651
|
};
|
|
2600
2652
|
//#endregion
|
|
2601
|
-
//#region ../../node_modules/.pnpm/@effected+semver@0.
|
|
2653
|
+
//#region ../../node_modules/.pnpm/@effected+semver@0.2.0_effect@4.0.0-beta.99/node_modules/@effected/semver/internal/grammar.js
|
|
2602
2654
|
/** Private control-flow exception; never escapes the entry points. */
|
|
2603
2655
|
var ParseFailure = class {
|
|
2604
2656
|
position;
|
|
@@ -2993,7 +3045,7 @@ const formatComparator = (c) => {
|
|
|
2993
3045
|
/** Print comparator sets as `a b || c d`. */
|
|
2994
3046
|
const formatRange = (sets) => sets.map((set) => set.map(formatComparator).join(" ")).join(" || ");
|
|
2995
3047
|
//#endregion
|
|
2996
|
-
//#region ../../node_modules/.pnpm/@effected+semver@0.
|
|
3048
|
+
//#region ../../node_modules/.pnpm/@effected+semver@0.2.0_effect@4.0.0-beta.99/node_modules/@effected/semver/internal/order.js
|
|
2997
3049
|
/**
|
|
2998
3050
|
* Compare two prerelease identifiers per SemVer 2.0.0 §11: numeric
|
|
2999
3051
|
* identifiers always have lower precedence than alphanumeric ones; numerics
|
|
@@ -3046,7 +3098,7 @@ const compareBuild = (a, b) => {
|
|
|
3046
3098
|
return 0;
|
|
3047
3099
|
};
|
|
3048
3100
|
//#endregion
|
|
3049
|
-
//#region ../../node_modules/.pnpm/@effected+semver@0.
|
|
3101
|
+
//#region ../../node_modules/.pnpm/@effected+semver@0.2.0_effect@4.0.0-beta.99/node_modules/@effected/semver/SemVer.js
|
|
3050
3102
|
/**
|
|
3051
3103
|
* Indicates that a string could not be parsed as a valid SemVer 2.0.0 version.
|
|
3052
3104
|
*
|
|
@@ -3127,23 +3179,57 @@ var SemVer = class SemVer extends effect.Schema.Class("SemVer")({
|
|
|
3127
3179
|
encode: (parts) => effect.Effect.succeed(formatVersion(parts))
|
|
3128
3180
|
})));
|
|
3129
3181
|
/**
|
|
3130
|
-
* Parse a strict SemVer 2.0.0 version string
|
|
3182
|
+
* Parse a strict SemVer 2.0.0 version string, synchronously, returning a
|
|
3183
|
+
* `Result` instead of an `Effect`.
|
|
3131
3184
|
*
|
|
3132
3185
|
* Rejects `v`/`V` prefixes, `=` prefixes, leading zeros on numeric
|
|
3133
3186
|
* identifiers and partially consumed input.
|
|
3134
3187
|
*
|
|
3188
|
+
* @remarks
|
|
3189
|
+
* {@link SemVer.parse} is defined in terms of this function; the two never
|
|
3190
|
+
* diverge. Reach for the `Effect` variant inside Effect code — it carries
|
|
3191
|
+
* the `SemVer.parse` tracing span — and for this one at synchronous
|
|
3192
|
+
* boundaries.
|
|
3193
|
+
*
|
|
3194
|
+
* @example
|
|
3195
|
+
* ```ts
|
|
3196
|
+
* import { SemVer } from "@effected/semver";
|
|
3197
|
+
* import { Result } from "effect";
|
|
3198
|
+
*
|
|
3199
|
+
* const ok = SemVer.parseResult("1.2.3");
|
|
3200
|
+
* if (Result.isSuccess(ok)) {
|
|
3201
|
+
* console.log(ok.success.major); // => 1
|
|
3202
|
+
* }
|
|
3203
|
+
*
|
|
3204
|
+
* const bad = SemVer.parseResult("v1.2.3");
|
|
3205
|
+
* if (Result.isFailure(bad)) {
|
|
3206
|
+
* console.log(bad.failure._tag); // => "InvalidVersionError"
|
|
3207
|
+
* }
|
|
3208
|
+
* ```
|
|
3209
|
+
*
|
|
3135
3210
|
* @param input - the version string to parse
|
|
3136
|
-
* @returns the parsed {@link SemVer}
|
|
3137
|
-
* when `input` is not a valid version
|
|
3211
|
+
* @returns a `Result` succeeding with the parsed {@link SemVer}, or failing
|
|
3212
|
+
* with {@link InvalidVersionError} when `input` is not a valid version
|
|
3213
|
+
* string.
|
|
3138
3214
|
*/
|
|
3139
|
-
static
|
|
3215
|
+
static parseResult(input) {
|
|
3140
3216
|
const result = parseVersion(input);
|
|
3141
|
-
if (!result.ok) return
|
|
3217
|
+
if (!result.ok) return effect.Result.fail(new InvalidVersionError({
|
|
3142
3218
|
input: result.input,
|
|
3143
3219
|
position: result.position
|
|
3144
|
-
});
|
|
3145
|
-
return SemVer.make(result.value);
|
|
3146
|
-
}
|
|
3220
|
+
}));
|
|
3221
|
+
return effect.Result.succeed(SemVer.make(result.value));
|
|
3222
|
+
}
|
|
3223
|
+
/**
|
|
3224
|
+
* Parse a strict SemVer 2.0.0 version string. Defined in terms of
|
|
3225
|
+
* {@link SemVer.parseResult} — synchronous callers can use that variant
|
|
3226
|
+
* directly.
|
|
3227
|
+
*
|
|
3228
|
+
* @param input - the version string to parse
|
|
3229
|
+
* @returns the parsed {@link SemVer}. Fails with {@link InvalidVersionError}
|
|
3230
|
+
* when `input` is not a valid version string.
|
|
3231
|
+
*/
|
|
3232
|
+
static parse = effect.Effect.fn("SemVer.parse")((input) => effect.Effect.fromResult(SemVer.parseResult(input)));
|
|
3147
3233
|
/**
|
|
3148
3234
|
* Positional convenience constructor: `SemVer.of(1, 2, 3)`.
|
|
3149
3235
|
*
|
|
@@ -3447,7 +3533,7 @@ var SemVerBump = class {
|
|
|
3447
3533
|
}
|
|
3448
3534
|
};
|
|
3449
3535
|
//#endregion
|
|
3450
|
-
//#region ../../node_modules/.pnpm/@effected+semver@0.
|
|
3536
|
+
//#region ../../node_modules/.pnpm/@effected+semver@0.2.0_effect@4.0.0-beta.99/node_modules/@effected/semver/Comparator.js
|
|
3451
3537
|
/**
|
|
3452
3538
|
* Indicates that a string could not be parsed as a single comparator.
|
|
3453
3539
|
*
|
|
@@ -3514,18 +3600,52 @@ var Comparator = class Comparator extends effect.Schema.Class("Comparator")({
|
|
|
3514
3600
|
},
|
|
3515
3601
|
encode: (parts) => effect.Effect.succeed(formatComparator(parts))
|
|
3516
3602
|
})));
|
|
3517
|
-
/**
|
|
3518
|
-
|
|
3603
|
+
/**
|
|
3604
|
+
* Parse a comparator string (e.g. `">=1.2.3"`), synchronously, returning a
|
|
3605
|
+
* `Result` instead of an `Effect`.
|
|
3606
|
+
*
|
|
3607
|
+
* @remarks
|
|
3608
|
+
* {@link Comparator.parse} is defined in terms of this function; the two
|
|
3609
|
+
* never diverge. Reach for the `Effect` variant inside Effect code — it
|
|
3610
|
+
* carries the `Comparator.parse` tracing span — and for this one at
|
|
3611
|
+
* synchronous boundaries.
|
|
3612
|
+
*
|
|
3613
|
+
* @example
|
|
3614
|
+
* ```ts
|
|
3615
|
+
* import { Comparator } from "@effected/semver";
|
|
3616
|
+
* import { Result } from "effect";
|
|
3617
|
+
*
|
|
3618
|
+
* const ok = Comparator.parseResult(">=1.2.3");
|
|
3619
|
+
* if (Result.isSuccess(ok)) {
|
|
3620
|
+
* console.log(ok.success.operator); // => ">="
|
|
3621
|
+
* }
|
|
3622
|
+
* ```
|
|
3623
|
+
*
|
|
3624
|
+
* @param input - the comparator string to parse
|
|
3625
|
+
* @returns a `Result` succeeding with the parsed {@link Comparator}, or
|
|
3626
|
+
* failing with {@link InvalidComparatorError}.
|
|
3627
|
+
*/
|
|
3628
|
+
static parseResult(input) {
|
|
3519
3629
|
const result = parseComparator(input);
|
|
3520
|
-
if (!result.ok) return
|
|
3630
|
+
if (!result.ok) return effect.Result.fail(new InvalidComparatorError({
|
|
3521
3631
|
input: result.input,
|
|
3522
3632
|
position: result.position
|
|
3523
|
-
});
|
|
3524
|
-
return Comparator.make({
|
|
3633
|
+
}));
|
|
3634
|
+
return effect.Result.succeed(Comparator.make({
|
|
3525
3635
|
operator: result.value.operator,
|
|
3526
3636
|
version: SemVer.make(result.value.version)
|
|
3527
|
-
});
|
|
3528
|
-
}
|
|
3637
|
+
}));
|
|
3638
|
+
}
|
|
3639
|
+
/**
|
|
3640
|
+
* Parse a comparator string (e.g. `">=1.2.3"`). Defined in terms of
|
|
3641
|
+
* {@link Comparator.parseResult} — synchronous callers can use that variant
|
|
3642
|
+
* directly.
|
|
3643
|
+
*
|
|
3644
|
+
* @param input - the comparator string to parse
|
|
3645
|
+
* @returns the parsed {@link Comparator}. Fails with
|
|
3646
|
+
* {@link InvalidComparatorError}.
|
|
3647
|
+
*/
|
|
3648
|
+
static parse = effect.Effect.fn("Comparator.parse")((input) => effect.Effect.fromResult(Comparator.parseResult(input)));
|
|
3529
3649
|
/** Test whether a version satisfies this comparator. */
|
|
3530
3650
|
test(version) {
|
|
3531
3651
|
const cmp = version.compare(this.version);
|
|
@@ -3547,7 +3667,7 @@ var Comparator = class Comparator extends effect.Schema.Class("Comparator")({
|
|
|
3547
3667
|
}
|
|
3548
3668
|
};
|
|
3549
3669
|
//#endregion
|
|
3550
|
-
//#region ../../node_modules/.pnpm/@effected+semver@0.
|
|
3670
|
+
//#region ../../node_modules/.pnpm/@effected+semver@0.2.0_effect@4.0.0-beta.99/node_modules/@effected/semver/internal/normalize.js
|
|
3551
3671
|
const operatorWeight = (op) => {
|
|
3552
3672
|
switch (op) {
|
|
3553
3673
|
case ">=": return 0;
|
|
@@ -3578,7 +3698,7 @@ const normalizeComparatorSet = (set) => sortComparators(removeDuplicates(set));
|
|
|
3578
3698
|
/** Normalize every comparator set in a range: sort and deduplicate each independently. */
|
|
3579
3699
|
const normalizeSets = (sets) => sets.map(normalizeComparatorSet);
|
|
3580
3700
|
//#endregion
|
|
3581
|
-
//#region ../../node_modules/.pnpm/@effected+semver@0.
|
|
3701
|
+
//#region ../../node_modules/.pnpm/@effected+semver@0.2.0_effect@4.0.0-beta.99/node_modules/@effected/semver/Range.js
|
|
3582
3702
|
/**
|
|
3583
3703
|
* Indicates that a string could not be parsed as a range expression.
|
|
3584
3704
|
*
|
|
@@ -3638,18 +3758,51 @@ sets: effect.Schema.Array(effect.Schema.Array(Comparator)) }) {
|
|
|
3638
3758
|
},
|
|
3639
3759
|
encode: (parts) => effect.Effect.succeed(formatRange(parts.sets))
|
|
3640
3760
|
})));
|
|
3641
|
-
/**
|
|
3642
|
-
|
|
3761
|
+
/**
|
|
3762
|
+
* Parse a range expression and normalize its comparator sets,
|
|
3763
|
+
* synchronously, returning a `Result` instead of an `Effect`.
|
|
3764
|
+
*
|
|
3765
|
+
* @remarks
|
|
3766
|
+
* {@link Range.parse} is defined in terms of this function; the two never
|
|
3767
|
+
* diverge. Reach for the `Effect` variant inside Effect code — it carries
|
|
3768
|
+
* the `Range.parse` tracing span — and for this one at synchronous
|
|
3769
|
+
* boundaries.
|
|
3770
|
+
*
|
|
3771
|
+
* @example
|
|
3772
|
+
* ```ts
|
|
3773
|
+
* import { Range } from "@effected/semver";
|
|
3774
|
+
* import { Result } from "effect";
|
|
3775
|
+
*
|
|
3776
|
+
* const ok = Range.parseResult("^1.0.0");
|
|
3777
|
+
* if (Result.isSuccess(ok)) {
|
|
3778
|
+
* console.log(ok.success.toString()); // => ">=1.0.0 <2.0.0-0"
|
|
3779
|
+
* }
|
|
3780
|
+
* ```
|
|
3781
|
+
*
|
|
3782
|
+
* @param input - the range expression to parse
|
|
3783
|
+
* @returns a `Result` succeeding with the parsed {@link Range}, or failing
|
|
3784
|
+
* with {@link InvalidRangeError}.
|
|
3785
|
+
*/
|
|
3786
|
+
static parseResult(input) {
|
|
3643
3787
|
const result = parseRange$1(input);
|
|
3644
|
-
if (!result.ok) return
|
|
3788
|
+
if (!result.ok) return effect.Result.fail(new InvalidRangeError({
|
|
3645
3789
|
input: result.input,
|
|
3646
3790
|
position: result.position
|
|
3647
|
-
});
|
|
3648
|
-
return Range.make({ sets: normalizeSets(result.value).map((set) => set.map((c) => Comparator.make({
|
|
3791
|
+
}));
|
|
3792
|
+
return effect.Result.succeed(Range.make({ sets: normalizeSets(result.value).map((set) => set.map((c) => Comparator.make({
|
|
3649
3793
|
operator: c.operator,
|
|
3650
3794
|
version: SemVer.make(c.version)
|
|
3651
|
-
}))) });
|
|
3652
|
-
}
|
|
3795
|
+
}))) }));
|
|
3796
|
+
}
|
|
3797
|
+
/**
|
|
3798
|
+
* Parse a range expression and normalize its comparator sets. Defined in
|
|
3799
|
+
* terms of {@link Range.parseResult} — synchronous callers can use that
|
|
3800
|
+
* variant directly.
|
|
3801
|
+
*
|
|
3802
|
+
* @param input - the range expression to parse
|
|
3803
|
+
* @returns the parsed {@link Range}. Fails with {@link InvalidRangeError}.
|
|
3804
|
+
*/
|
|
3805
|
+
static parse = effect.Effect.fn("Range.parse")((input) => effect.Effect.fromResult(Range.parseResult(input)));
|
|
3653
3806
|
/**
|
|
3654
3807
|
* Test whether a version satisfies a range; see {@link Range.test} for the
|
|
3655
3808
|
* prerelease matching rule. Dual API.
|
|
@@ -3676,19 +3829,49 @@ sets: effect.Schema.Array(effect.Schema.Array(Comparator)) }) {
|
|
|
3676
3829
|
static union = effect.Function.dual(2, (self, that) => Range.make({ sets: [...self.sets, ...that.sets] }));
|
|
3677
3830
|
/**
|
|
3678
3831
|
* Intersect two ranges via a cross-product of their comparator sets,
|
|
3679
|
-
* keeping only satisfiable combinations
|
|
3832
|
+
* keeping only satisfiable combinations, synchronously, returning a
|
|
3833
|
+
* `Result` instead of an `Effect`. Fails with
|
|
3680
3834
|
* {@link UnsatisfiableConstraintError} when no satisfiable set remains —
|
|
3681
3835
|
* an honest typed failure instead of an unsatisfiable range. Dual API.
|
|
3836
|
+
*
|
|
3837
|
+
* @remarks
|
|
3838
|
+
* {@link Range.intersect} is defined in terms of this function; the two
|
|
3839
|
+
* never diverge. Reach for the `Effect` variant inside Effect code — it
|
|
3840
|
+
* carries the `Range.intersect` tracing span — and for this one at
|
|
3841
|
+
* synchronous boundaries.
|
|
3842
|
+
*
|
|
3843
|
+
* @example
|
|
3844
|
+
* ```ts
|
|
3845
|
+
* import { Range } from "@effected/semver";
|
|
3846
|
+
* import { Result } from "effect";
|
|
3847
|
+
*
|
|
3848
|
+
* const a = Result.getOrThrow(Range.parseResult("^1.0.0"));
|
|
3849
|
+
* const b = Result.getOrThrow(Range.parseResult(">=1.5.0"));
|
|
3850
|
+
* const merged = Range.intersectResult(a, b);
|
|
3851
|
+
* if (Result.isSuccess(merged)) {
|
|
3852
|
+
* console.log(merged.success.toString()); // => ">=1.0.0 <2.0.0-0 >=1.5.0"
|
|
3853
|
+
* }
|
|
3854
|
+
* ```
|
|
3682
3855
|
*/
|
|
3683
|
-
static
|
|
3856
|
+
static intersectResult = effect.Function.dual(2, (self, that) => {
|
|
3684
3857
|
const candidates = [];
|
|
3685
3858
|
for (const setA of self.sets) for (const setB of that.sets) {
|
|
3686
3859
|
const merged = [...setA, ...setB];
|
|
3687
3860
|
if (isSetSatisfiable(merged)) candidates.push(merged);
|
|
3688
3861
|
}
|
|
3689
|
-
if (candidates.length === 0) return
|
|
3690
|
-
return Range.make({ sets: candidates });
|
|
3691
|
-
})
|
|
3862
|
+
if (candidates.length === 0) return effect.Result.fail(new UnsatisfiableConstraintError({ constraints: [self, that] }));
|
|
3863
|
+
return effect.Result.succeed(Range.make({ sets: candidates }));
|
|
3864
|
+
});
|
|
3865
|
+
/**
|
|
3866
|
+
* Intersect two ranges via a cross-product of their comparator sets,
|
|
3867
|
+
* keeping only satisfiable combinations. Fails with
|
|
3868
|
+
* {@link UnsatisfiableConstraintError} when no satisfiable set remains —
|
|
3869
|
+
* an honest typed failure instead of an unsatisfiable range. Dual API.
|
|
3870
|
+
*
|
|
3871
|
+
* Defined in terms of {@link Range.intersectResult} — synchronous callers
|
|
3872
|
+
* can use that variant directly.
|
|
3873
|
+
*/
|
|
3874
|
+
static intersect = effect.Function.dual(2, effect.Effect.fn("Range.intersect")((self, that) => effect.Effect.fromResult(Range.intersectResult(self, that))));
|
|
3692
3875
|
/**
|
|
3693
3876
|
* Check whether every version matched by `sub` is also matched by `sup`.
|
|
3694
3877
|
* Dual API.
|
|
@@ -3847,7 +4030,7 @@ const isComparatorSetSubset = (sub, sup) => {
|
|
|
3847
4030
|
return true;
|
|
3848
4031
|
};
|
|
3849
4032
|
//#endregion
|
|
3850
|
-
//#region ../../node_modules/.pnpm/@effected+npm@0.2.
|
|
4033
|
+
//#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
|
|
3851
4034
|
/**
|
|
3852
4035
|
* Indicates that a string could not be parsed as a valid dependency specifier.
|
|
3853
4036
|
*
|
|
@@ -4054,7 +4237,7 @@ const DependencySpecifier = Object.assign(brandedSpecifier, {
|
|
|
4054
4237
|
FromString: fromString
|
|
4055
4238
|
});
|
|
4056
4239
|
//#endregion
|
|
4057
|
-
//#region ../../node_modules/.pnpm/@effected+npm@0.2.
|
|
4240
|
+
//#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
|
|
4058
4241
|
const SRI_RE = /^(sha1|sha256|sha384|sha512)-[A-Za-z0-9+/]+={0,2}$/;
|
|
4059
4242
|
const COREPACK_RE = /^(sha1|sha256|sha384|sha512)\.[0-9a-f]+$/;
|
|
4060
4243
|
const YARN_RE = /^[0-9]+(c[0-9]+)?\/[0-9a-f]+$/;
|
|
@@ -4107,7 +4290,7 @@ const IntegrityHash = Object.assign(brandedIntegrity, {
|
|
|
4107
4290
|
decode: decode$2
|
|
4108
4291
|
});
|
|
4109
4292
|
//#endregion
|
|
4110
|
-
//#region ../../node_modules/.pnpm/@effected+lockfiles@0.1.
|
|
4293
|
+
//#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
|
|
4111
4294
|
/**
|
|
4112
4295
|
* One declared dependency of one workspace importer, as the lockfile records it.
|
|
4113
4296
|
*
|
|
@@ -4135,7 +4318,7 @@ var ImporterDependency = class extends effect.Schema.Class("ImporterDependency")
|
|
|
4135
4318
|
depType: DependencyField
|
|
4136
4319
|
}) {};
|
|
4137
4320
|
//#endregion
|
|
4138
|
-
//#region ../../node_modules/.pnpm/@effected+lockfiles@0.1.
|
|
4321
|
+
//#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
|
|
4139
4322
|
/**
|
|
4140
4323
|
* One workspace importer's declared dependencies, as the lockfile records them.
|
|
4141
4324
|
*
|
|
@@ -4159,7 +4342,7 @@ var LockfileImporter = class extends effect.Schema.Class("LockfileImporter")({
|
|
|
4159
4342
|
dependencies: effect.Schema.Array(ImporterDependency)
|
|
4160
4343
|
}) {};
|
|
4161
4344
|
//#endregion
|
|
4162
|
-
//#region ../../node_modules/.pnpm/@effected+lockfiles@0.1.
|
|
4345
|
+
//#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
|
|
4163
4346
|
const EMPTY_DEPENDENCIES = {};
|
|
4164
4347
|
/**
|
|
4165
4348
|
* A package resolved from a lockfile.
|
|
@@ -4194,7 +4377,7 @@ var ResolvedPackage = class extends effect.Schema.Class("ResolvedPackage")({
|
|
|
4194
4377
|
dependencies: effect.Schema.Record(effect.Schema.String, effect.Schema.String).pipe(effect.Schema.withDecodingDefaultKey(effect.Effect.succeed(EMPTY_DEPENDENCIES)), effect.Schema.withConstructorDefault(effect.Effect.succeed(EMPTY_DEPENDENCIES)))
|
|
4195
4378
|
}) {};
|
|
4196
4379
|
//#endregion
|
|
4197
|
-
//#region ../../node_modules/.pnpm/@effected+lockfiles@0.1.
|
|
4380
|
+
//#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
|
|
4198
4381
|
/**
|
|
4199
4382
|
* A directed dependency edge between two workspace packages as recorded in
|
|
4200
4383
|
* the lockfile.
|
|
@@ -4216,7 +4399,7 @@ var WorkspaceDependency = class extends effect.Schema.Class("WorkspaceDependency
|
|
|
4216
4399
|
constraint: effect.Schema.String
|
|
4217
4400
|
}) {};
|
|
4218
4401
|
//#endregion
|
|
4219
|
-
//#region ../../node_modules/.pnpm/@effected+lockfiles@0.1.
|
|
4402
|
+
//#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
|
|
4220
4403
|
/**
|
|
4221
4404
|
* Extension data specific to pnpm lockfiles, attached to `Lockfile.extension`
|
|
4222
4405
|
* when the format is `"pnpm"`.
|
|
@@ -4241,7 +4424,7 @@ var PnpmExtension = class extends effect.Schema.Class("PnpmExtension")({
|
|
|
4241
4424
|
}))
|
|
4242
4425
|
}) {};
|
|
4243
4426
|
//#endregion
|
|
4244
|
-
//#region ../../node_modules/.pnpm/@effected+lockfiles@0.1.
|
|
4427
|
+
//#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
|
|
4245
4428
|
/**
|
|
4246
4429
|
* The lockfile formats this package parses: bun's `bun.lock` (JSONC), npm's
|
|
4247
4430
|
* `package-lock.json` (v2/v3 JSON), pnpm's `pnpm-lock.yaml` and yarn Berry's
|
|
@@ -4275,7 +4458,7 @@ const FILENAMES = {
|
|
|
4275
4458
|
*/
|
|
4276
4459
|
const filenameFor = (format) => FILENAMES[format];
|
|
4277
4460
|
//#endregion
|
|
4278
|
-
//#region ../../node_modules/.pnpm/@effected+lockfiles@0.1.
|
|
4461
|
+
//#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
|
|
4279
4462
|
/**
|
|
4280
4463
|
* The four dependency sections of a manifest, in a stable order — the shared
|
|
4281
4464
|
* dependency-sections table (v3's `DEP_SECTIONS`). Each entry is both the
|
|
@@ -4401,7 +4584,7 @@ const extractWorkspaceDeps = (workspaces, workspaceNames) => {
|
|
|
4401
4584
|
return deps;
|
|
4402
4585
|
};
|
|
4403
4586
|
//#endregion
|
|
4404
|
-
//#region ../../node_modules/.pnpm/@effected+jsonc@0.
|
|
4587
|
+
//#region ../../node_modules/.pnpm/@effected+jsonc@0.5.0_effect@4.0.0-beta.99/node_modules/@effected/jsonc/JsoncNode.js
|
|
4405
4588
|
/**
|
|
4406
4589
|
* Discriminator values for JSONC AST node types: the JSON value types
|
|
4407
4590
|
* (`string`/`number`/`boolean`/`null`), the structural types
|
|
@@ -4576,7 +4759,7 @@ function evaluateNode(node, depth) {
|
|
|
4576
4759
|
}
|
|
4577
4760
|
}
|
|
4578
4761
|
//#endregion
|
|
4579
|
-
//#region ../../node_modules/.pnpm/@effected+jsonc@0.
|
|
4762
|
+
//#region ../../node_modules/.pnpm/@effected+jsonc@0.5.0_effect@4.0.0-beta.99/node_modules/@effected/jsonc/internal/scanner.js
|
|
4580
4763
|
const isWhitespace = (ch) => ch === 32 || ch === 9 || ch === 11 || ch === 12 || ch === 160 || ch === 65279;
|
|
4581
4764
|
const isLineBreak$1 = (ch) => ch === 10 || ch === 13 || ch === 8232 || ch === 8233;
|
|
4582
4765
|
const isDigit$1 = (ch) => ch >= 48 && ch <= 57;
|
|
@@ -4872,7 +5055,7 @@ const createScanner$2 = (text, ignoreTrivia = false) => {
|
|
|
4872
5055
|
};
|
|
4873
5056
|
};
|
|
4874
5057
|
//#endregion
|
|
4875
|
-
//#region ../../node_modules/.pnpm/@effected+jsonc@0.
|
|
5058
|
+
//#region ../../node_modules/.pnpm/@effected+jsonc@0.5.0_effect@4.0.0-beta.99/node_modules/@effected/jsonc/internal/skip.js
|
|
4876
5059
|
/**
|
|
4877
5060
|
* Iteratively consume the value beginning at the cursor's current token and
|
|
4878
5061
|
* return its tight end offset (excludes trailing whitespace/comments).
|
|
@@ -4902,7 +5085,7 @@ const skipBalancedValue = (cursor) => {
|
|
|
4902
5085
|
return end;
|
|
4903
5086
|
};
|
|
4904
5087
|
//#endregion
|
|
4905
|
-
//#region ../../node_modules/.pnpm/@effected+jsonc@0.
|
|
5088
|
+
//#region ../../node_modules/.pnpm/@effected+jsonc@0.5.0_effect@4.0.0-beta.99/node_modules/@effected/jsonc/internal/parser.js
|
|
4906
5089
|
/**
|
|
4907
5090
|
* The public parse-error code vocabulary. The facade builds its `@public`
|
|
4908
5091
|
* `JsoncParseErrorCode` schema from this array; the parser produces these codes
|
|
@@ -5315,7 +5498,7 @@ const parseTree$2 = (text, flags) => {
|
|
|
5315
5498
|
};
|
|
5316
5499
|
};
|
|
5317
5500
|
//#endregion
|
|
5318
|
-
//#region ../../node_modules/.pnpm/@effected+jsonc@0.
|
|
5501
|
+
//#region ../../node_modules/.pnpm/@effected+jsonc@0.5.0_effect@4.0.0-beta.99/node_modules/@effected/jsonc/Jsonc.js
|
|
5319
5502
|
/**
|
|
5320
5503
|
* The single public parse-error code vocabulary, appearing as the `code` field
|
|
5321
5504
|
* of {@link JsoncParseErrorDetail}.
|
|
@@ -5360,6 +5543,47 @@ effect.Schema.Class("JsoncParseOptions")({
|
|
|
5360
5543
|
allowTrailingComma: effect.Schema.optionalKey(effect.Schema.Boolean),
|
|
5361
5544
|
allowEmptyContent: effect.Schema.optionalKey(effect.Schema.Boolean)
|
|
5362
5545
|
});
|
|
5546
|
+
/**
|
|
5547
|
+
* The public stringify-error code vocabulary, appearing as the `code` field of
|
|
5548
|
+
* {@link JsoncStringifyError}:
|
|
5549
|
+
*
|
|
5550
|
+
* - `CircularReference` — the value contains a reference cycle, so no finite
|
|
5551
|
+
* JSON text exists for it.
|
|
5552
|
+
* - `BigIntValue` — the value contains a `bigint` (anywhere, top-level or
|
|
5553
|
+
* nested), which JSON cannot represent.
|
|
5554
|
+
* - `TopLevelUnrepresentable` — the top-level value (`undefined`, a function
|
|
5555
|
+
* or a symbol) serializes to no output at all.
|
|
5556
|
+
*
|
|
5557
|
+
* @public
|
|
5558
|
+
*/
|
|
5559
|
+
const JsoncStringifyErrorCode = effect.Schema.Literals([
|
|
5560
|
+
"CircularReference",
|
|
5561
|
+
"BigIntValue",
|
|
5562
|
+
"TopLevelUnrepresentable"
|
|
5563
|
+
]);
|
|
5564
|
+
effect.Schema.Class("JsoncStringifyOptions")({
|
|
5565
|
+
tabSize: effect.Schema.optionalKey(effect.Schema.Number),
|
|
5566
|
+
insertSpaces: effect.Schema.optionalKey(effect.Schema.Boolean)
|
|
5567
|
+
});
|
|
5568
|
+
/**
|
|
5569
|
+
* Stringification failure: a `JsoncStringifyErrorCode` naming the
|
|
5570
|
+
* failure mode, a human-readable `detail` (the engine's message for thrown
|
|
5571
|
+
* cases — on V8 the circular-reference message includes the offending property
|
|
5572
|
+
* path), and the offending `value`. Raised by {@link Jsonc.stringify},
|
|
5573
|
+
* {@link Jsonc.stringifyResult} and the encode direction of the schema
|
|
5574
|
+
* factories.
|
|
5575
|
+
*
|
|
5576
|
+
* @public
|
|
5577
|
+
*/
|
|
5578
|
+
var JsoncStringifyError = class extends effect.Schema.TaggedErrorClass()("JsoncStringifyError", {
|
|
5579
|
+
code: JsoncStringifyErrorCode,
|
|
5580
|
+
detail: effect.Schema.String,
|
|
5581
|
+
value: effect.Schema.Unknown
|
|
5582
|
+
}) {
|
|
5583
|
+
get message() {
|
|
5584
|
+
return `JSONC stringify failed: ${this.code} — ${this.detail}`;
|
|
5585
|
+
}
|
|
5586
|
+
};
|
|
5363
5587
|
const toFlags = (options) => options === void 0 ? {} : {
|
|
5364
5588
|
disallowComments: options.disallowComments,
|
|
5365
5589
|
allowTrailingComma: options.allowTrailingComma,
|
|
@@ -5499,9 +5723,57 @@ var Jsonc = class Jsonc {
|
|
|
5499
5723
|
*/
|
|
5500
5724
|
static parse = effect.Effect.fn("Jsonc.parse")((text, options) => effect.Effect.fromResult(Jsonc.parseResult(text, options)));
|
|
5501
5725
|
/**
|
|
5726
|
+
* Parse JSONC into an immutable {@link JsoncNode} AST, synchronously,
|
|
5727
|
+
* returning a `Result` instead of an `Effect`. `Option.none()` for empty
|
|
5728
|
+
* input (with `allowEmptyContent`); the aggregate {@link JsoncParseError}
|
|
5729
|
+
* for malformed input. Pure — parsing is fundamentally synchronous, so
|
|
5730
|
+
* non-Effect consumers (a plain config loader, a build script) can call
|
|
5731
|
+
* this directly instead of wrapping
|
|
5732
|
+
* `Effect.runSync(Effect.result(Jsonc.parseTree(text)))`.
|
|
5733
|
+
*
|
|
5734
|
+
* @remarks
|
|
5735
|
+
* {@link Jsonc.parseTree} is defined in terms of this function; the two
|
|
5736
|
+
* never diverge. Reach for the `Effect` variant inside Effect code — it
|
|
5737
|
+
* carries the `Jsonc.parseTree` tracing span — and for this one at
|
|
5738
|
+
* synchronous boundaries.
|
|
5739
|
+
*
|
|
5740
|
+
* @example
|
|
5741
|
+
* ```ts
|
|
5742
|
+
* import { Jsonc } from "@effected/jsonc";
|
|
5743
|
+
* import { Option, Result } from "effect";
|
|
5744
|
+
*
|
|
5745
|
+
* const ok = Jsonc.parseTreeResult('{ "port": 3000 // dev\n }');
|
|
5746
|
+
* if (Result.isSuccess(ok) && Option.isSome(ok.success)) {
|
|
5747
|
+
* console.log(ok.success.value.type); // => "object"
|
|
5748
|
+
* }
|
|
5749
|
+
*
|
|
5750
|
+
* const bad = Jsonc.parseTreeResult("{ bad }");
|
|
5751
|
+
* if (Result.isFailure(bad)) {
|
|
5752
|
+
* console.log(bad.failure._tag); // => "JsoncParseError"
|
|
5753
|
+
* }
|
|
5754
|
+
* ```
|
|
5755
|
+
*
|
|
5756
|
+
* @param text - The JSONC source to parse.
|
|
5757
|
+
* @param options - Optional {@link JsoncParseOptions}; defaults apply for
|
|
5758
|
+
* omitted fields.
|
|
5759
|
+
* @returns A `Result` succeeding with `Option.some(root)` (or
|
|
5760
|
+
* `Option.none()` for empty input), or failing with the aggregate
|
|
5761
|
+
* {@link JsoncParseError}.
|
|
5762
|
+
*/
|
|
5763
|
+
static parseTreeResult(text, options) {
|
|
5764
|
+
const { root, errors } = parseTree$2(text, toFlags(options));
|
|
5765
|
+
if (errors.length > 0) return effect.Result.fail(new JsoncParseError({
|
|
5766
|
+
errors: toDetails(text, errors),
|
|
5767
|
+
input: text
|
|
5768
|
+
}));
|
|
5769
|
+
return effect.Result.succeed(root !== void 0 ? effect.Option.some(root) : effect.Option.none());
|
|
5770
|
+
}
|
|
5771
|
+
/**
|
|
5502
5772
|
* Parse JSONC into an immutable {@link JsoncNode} AST. `Option.none()` for
|
|
5503
5773
|
* empty input (with `allowEmptyContent`); the aggregate
|
|
5504
|
-
* {@link JsoncParseError} for malformed input.
|
|
5774
|
+
* {@link JsoncParseError} for malformed input. Defined in terms of
|
|
5775
|
+
* {@link Jsonc.parseTreeResult} — synchronous callers can use that variant
|
|
5776
|
+
* directly.
|
|
5505
5777
|
*
|
|
5506
5778
|
* @param text - The JSONC source to parse.
|
|
5507
5779
|
* @param options - Optional {@link JsoncParseOptions}; defaults apply for
|
|
@@ -5510,14 +5782,96 @@ var Jsonc = class Jsonc {
|
|
|
5510
5782
|
* `Option.none()` for empty input), or fails with the aggregate
|
|
5511
5783
|
* {@link JsoncParseError}.
|
|
5512
5784
|
*/
|
|
5513
|
-
static parseTree = effect.Effect.fn("Jsonc.parseTree")(
|
|
5514
|
-
|
|
5515
|
-
|
|
5516
|
-
|
|
5517
|
-
|
|
5518
|
-
|
|
5519
|
-
|
|
5520
|
-
|
|
5785
|
+
static parseTree = effect.Effect.fn("Jsonc.parseTree")((text, options) => effect.Effect.fromResult(Jsonc.parseTreeResult(text, options)));
|
|
5786
|
+
/**
|
|
5787
|
+
* Stringify a plain JavaScript value as JSON text, synchronously, returning
|
|
5788
|
+
* a `Result` instead of an `Effect`. With no options the output is
|
|
5789
|
+
* byte-identical to `JSON.stringify(value, null, 2)`.
|
|
5790
|
+
*
|
|
5791
|
+
* Plain JSON emission: JSONC comments exist only in the document/edit layer
|
|
5792
|
+
* (`JsoncNode`, `JsoncEdit`, `JsoncFormatter`), so no comment survives — or
|
|
5793
|
+
* can be produced by — value-level stringification.
|
|
5794
|
+
*
|
|
5795
|
+
* Nested unrepresentable values follow `JSON.stringify`'s documented
|
|
5796
|
+
* semantics: `undefined`, functions and symbols are dropped from objects and
|
|
5797
|
+
* become `null` in arrays. The typed failure channel covers only the cases
|
|
5798
|
+
* where output would be absent or an exception thrown — see
|
|
5799
|
+
* `JsoncStringifyErrorCode`. A throwing `toJSON` method or getter is
|
|
5800
|
+
* caller code failing and rethrows as a defect, never a typed error.
|
|
5801
|
+
*
|
|
5802
|
+
* @remarks
|
|
5803
|
+
* {@link Jsonc.stringify} is defined in terms of this function; the two
|
|
5804
|
+
* never diverge. Reach for the `Effect` variant inside Effect code — it
|
|
5805
|
+
* carries the `Jsonc.stringify` tracing span — and for this one at
|
|
5806
|
+
* synchronous boundaries.
|
|
5807
|
+
*
|
|
5808
|
+
* @example
|
|
5809
|
+
* ```ts
|
|
5810
|
+
* import { Jsonc } from "@effected/jsonc";
|
|
5811
|
+
* import { Result } from "effect";
|
|
5812
|
+
*
|
|
5813
|
+
* const ok = Jsonc.stringifyResult({ port: 3000 });
|
|
5814
|
+
* if (Result.isSuccess(ok)) {
|
|
5815
|
+
* console.log(ok.success); // => '{\n "port": 3000\n}'
|
|
5816
|
+
* }
|
|
5817
|
+
*
|
|
5818
|
+
* const bad = Jsonc.stringifyResult(0n);
|
|
5819
|
+
* if (Result.isFailure(bad)) {
|
|
5820
|
+
* console.log(bad.failure.code); // => "BigIntValue"
|
|
5821
|
+
* }
|
|
5822
|
+
* ```
|
|
5823
|
+
*
|
|
5824
|
+
* @param value - The plain JavaScript value to stringify.
|
|
5825
|
+
* @param options - Optional {@link JsoncStringifyOptions}; defaults apply
|
|
5826
|
+
* for omitted fields.
|
|
5827
|
+
* @returns A `Result` succeeding with the JSON text, or failing with a
|
|
5828
|
+
* {@link JsoncStringifyError}.
|
|
5829
|
+
*/
|
|
5830
|
+
static stringifyResult(value, options) {
|
|
5831
|
+
const space = options?.insertSpaces === false ? " " : options?.tabSize ?? 2;
|
|
5832
|
+
let text;
|
|
5833
|
+
try {
|
|
5834
|
+
text = JSON.stringify(value, null, space);
|
|
5835
|
+
} catch (defect) {
|
|
5836
|
+
if (defect instanceof TypeError) {
|
|
5837
|
+
if (/circular|cyclic/i.test(defect.message)) return effect.Result.fail(new JsoncStringifyError({
|
|
5838
|
+
code: "CircularReference",
|
|
5839
|
+
detail: defect.message,
|
|
5840
|
+
value
|
|
5841
|
+
}));
|
|
5842
|
+
if (/bigint/i.test(defect.message)) return effect.Result.fail(new JsoncStringifyError({
|
|
5843
|
+
code: "BigIntValue",
|
|
5844
|
+
detail: defect.message,
|
|
5845
|
+
value
|
|
5846
|
+
}));
|
|
5847
|
+
}
|
|
5848
|
+
throw defect;
|
|
5849
|
+
}
|
|
5850
|
+
if (text === void 0) return effect.Result.fail(new JsoncStringifyError({
|
|
5851
|
+
code: "TopLevelUnrepresentable",
|
|
5852
|
+
detail: "the top-level value (undefined, a function or a symbol) has no JSON representation",
|
|
5853
|
+
value
|
|
5854
|
+
}));
|
|
5855
|
+
return effect.Result.succeed(text);
|
|
5856
|
+
}
|
|
5857
|
+
/**
|
|
5858
|
+
* Stringify a plain JavaScript value as JSON text. With no options the
|
|
5859
|
+
* output is byte-identical to `JSON.stringify(value, null, 2)`. Fails with
|
|
5860
|
+
* {@link JsoncStringifyError} on circular references, `bigint` values and a
|
|
5861
|
+
* top-level value with no JSON representation; nested `undefined`, functions
|
|
5862
|
+
* and symbols follow `JSON.stringify`'s documented semantics (dropped from
|
|
5863
|
+
* objects, `null` in arrays). Comments are a document/edit-layer concern —
|
|
5864
|
+
* value-level stringification never emits them. Defined in terms of
|
|
5865
|
+
* {@link Jsonc.stringifyResult} — synchronous callers can use that variant
|
|
5866
|
+
* directly.
|
|
5867
|
+
*
|
|
5868
|
+
* @param value - The plain JavaScript value to stringify.
|
|
5869
|
+
* @param options - Optional {@link JsoncStringifyOptions}; defaults apply
|
|
5870
|
+
* for omitted fields.
|
|
5871
|
+
* @returns An `Effect` that succeeds with the JSON text, or fails with a
|
|
5872
|
+
* {@link JsoncStringifyError}.
|
|
5873
|
+
*/
|
|
5874
|
+
static stringify = effect.Effect.fn("Jsonc.stringify")((value, options) => effect.Effect.fromResult(Jsonc.stringifyResult(value, options)));
|
|
5521
5875
|
/**
|
|
5522
5876
|
* Remove all comments from JSONC, producing valid JSON. Pass a `replaceCh`
|
|
5523
5877
|
* (e.g. `" "`) to replace each comment character instead of deleting it,
|
|
@@ -5585,8 +5939,11 @@ var Jsonc = class Jsonc {
|
|
|
5585
5939
|
}
|
|
5586
5940
|
/**
|
|
5587
5941
|
* A `Schema<unknown, string>` decoding JSONC with the given `options`
|
|
5588
|
-
* (defaults when omitted). Encoding is
|
|
5589
|
-
*
|
|
5942
|
+
* (defaults when omitted). Encoding is {@link Jsonc.stringifyResult} with
|
|
5943
|
+
* default options (2-space indent, byte-identical to
|
|
5944
|
+
* `JSON.stringify(value, null, 2)`), so comments do not survive a
|
|
5945
|
+
* round-trip encode; a {@link JsoncStringifyError} on the encode side
|
|
5946
|
+
* surfaces as a schema issue.
|
|
5590
5947
|
*
|
|
5591
5948
|
* @remarks
|
|
5592
5949
|
* Schema-producing: each call returns a fresh schema whose derivation caches
|
|
@@ -5613,7 +5970,7 @@ var Jsonc = class Jsonc {
|
|
|
5613
5970
|
}
|
|
5614
5971
|
return effect.Effect.succeed(value);
|
|
5615
5972
|
},
|
|
5616
|
-
encode: (value) => effect.Effect.
|
|
5973
|
+
encode: (value) => effect.Effect.fromResult(Jsonc.stringifyResult(value)).pipe(effect.Effect.mapError((error) => new effect.SchemaIssue.InvalidValue(effect.Option.some(value), { message: error.message })))
|
|
5617
5974
|
})));
|
|
5618
5975
|
}
|
|
5619
5976
|
/**
|
|
@@ -5639,6 +5996,49 @@ var Jsonc = class Jsonc {
|
|
|
5639
5996
|
static schema(target, options) {
|
|
5640
5997
|
return Jsonc.fromString(options).pipe(effect.Schema.decodeTo(target));
|
|
5641
5998
|
}
|
|
5999
|
+
/**
|
|
6000
|
+
* Bind a target schema to the JSONC codec once, yielding the composed
|
|
6001
|
+
* schema plus pre-derived `decode`/`encode` directions — the
|
|
6002
|
+
* {@link Jsonc.schema} composition without the generic `Schema` machinery
|
|
6003
|
+
* at every use site. Binds the plain form only: default
|
|
6004
|
+
* {@link JsoncParseOptions} on decode, default stringify options on encode.
|
|
6005
|
+
*
|
|
6006
|
+
* Both directions fail with `Schema.SchemaError`, exactly as
|
|
6007
|
+
* `Schema.decodeEffect`/`Schema.encodeEffect` over {@link Jsonc.schema}
|
|
6008
|
+
* would; the target's decoding/encoding service requirements flow through.
|
|
6009
|
+
*
|
|
6010
|
+
* @remarks
|
|
6011
|
+
* Schema-producing: each call composes a fresh schema and derives both
|
|
6012
|
+
* directions from it. Bind the result to a `const` — that single binding is
|
|
6013
|
+
* the point.
|
|
6014
|
+
*
|
|
6015
|
+
* @example
|
|
6016
|
+
* ```ts
|
|
6017
|
+
* import { Jsonc } from "@effected/jsonc";
|
|
6018
|
+
* import { Effect, Schema } from "effect";
|
|
6019
|
+
*
|
|
6020
|
+
* const Config = Schema.Struct({ port: Schema.Number });
|
|
6021
|
+
* const config = Jsonc.bind(Config);
|
|
6022
|
+
*
|
|
6023
|
+
* const program = Effect.gen(function* () {
|
|
6024
|
+
* const value = yield* config.decode('{ "port": 3000 // dev\n }');
|
|
6025
|
+
* const text = yield* config.encode(value);
|
|
6026
|
+
* return [value, text] as const;
|
|
6027
|
+
* });
|
|
6028
|
+
* ```
|
|
6029
|
+
*
|
|
6030
|
+
* @param target - The domain schema decoded values must satisfy.
|
|
6031
|
+
* @returns A {@link JsoncBoundCodec} carrying the composed schema and its
|
|
6032
|
+
* two pre-bound directions.
|
|
6033
|
+
*/
|
|
6034
|
+
static bind(target) {
|
|
6035
|
+
const schema = Jsonc.schema(target);
|
|
6036
|
+
return {
|
|
6037
|
+
schema,
|
|
6038
|
+
decode: effect.Schema.decodeEffect(schema),
|
|
6039
|
+
encode: effect.Schema.encodeEffect(schema)
|
|
6040
|
+
};
|
|
6041
|
+
}
|
|
5642
6042
|
};
|
|
5643
6043
|
effect.Schema.Class("JsoncRange")({
|
|
5644
6044
|
offset: effect.Schema.Number,
|
|
@@ -5682,7 +6082,8 @@ var JsoncEdit = class extends effect.Schema.Class("JsoncEdit")({
|
|
|
5682
6082
|
/**
|
|
5683
6083
|
* Apply `edits` to `text`, producing a new string. Edits are applied in
|
|
5684
6084
|
* reverse-offset order so earlier offsets stay valid; the input `edits`
|
|
5685
|
-
* array is not mutated.
|
|
6085
|
+
* array is not mutated. Overlapping edits are a programmer error and throw
|
|
6086
|
+
* as a defect — `JsoncFormatter` never produces them.
|
|
5686
6087
|
*
|
|
5687
6088
|
* @param text - The source text to edit.
|
|
5688
6089
|
* @param edits - The edits to apply, in any order.
|
|
@@ -5690,13 +6091,18 @@ var JsoncEdit = class extends effect.Schema.Class("JsoncEdit")({
|
|
|
5690
6091
|
*/
|
|
5691
6092
|
static applyAll(text, edits) {
|
|
5692
6093
|
const sorted = [...edits].sort((a, b) => b.offset - a.offset);
|
|
6094
|
+
for (let i = 0; i + 1 < sorted.length; i++) {
|
|
6095
|
+
const upper = sorted[i];
|
|
6096
|
+
const lower = sorted[i + 1];
|
|
6097
|
+
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`);
|
|
6098
|
+
}
|
|
5693
6099
|
let result = text;
|
|
5694
6100
|
for (const edit of sorted) result = result.substring(0, edit.offset) + edit.content + result.substring(edit.offset + edit.length);
|
|
5695
6101
|
return result;
|
|
5696
6102
|
}
|
|
5697
6103
|
};
|
|
5698
6104
|
//#endregion
|
|
5699
|
-
//#region ../../node_modules/.pnpm/@effected+jsonc@0.
|
|
6105
|
+
//#region ../../node_modules/.pnpm/@effected+jsonc@0.5.0_effect@4.0.0-beta.99/node_modules/@effected/jsonc/internal/navigate.js
|
|
5700
6106
|
/**
|
|
5701
6107
|
* Resolve `path` against `text`, returning where the target is (or where it
|
|
5702
6108
|
* would be inserted). `path` must be non-empty — the whole-document case is
|
|
@@ -5823,7 +6229,7 @@ function navigate(text, path) {
|
|
|
5823
6229
|
return { _tag: "NoOp" };
|
|
5824
6230
|
}
|
|
5825
6231
|
//#endregion
|
|
5826
|
-
//#region ../../node_modules/.pnpm/@effected+jsonc@0.
|
|
6232
|
+
//#region ../../node_modules/.pnpm/@effected+jsonc@0.5.0_effect@4.0.0-beta.99/node_modules/@effected/jsonc/JsoncModifier.js
|
|
5827
6233
|
/**
|
|
5828
6234
|
* Raised when `JsoncModifier.modify` cannot navigate the requested path: the
|
|
5829
6235
|
* value at `depth` is not the container kind (`expected`) the next path segment
|
|
@@ -5951,7 +6357,7 @@ var JsoncModifier = class {
|
|
|
5951
6357
|
});
|
|
5952
6358
|
};
|
|
5953
6359
|
//#endregion
|
|
5954
|
-
//#region ../../node_modules/.pnpm/@effected+lockfiles@0.1.
|
|
6360
|
+
//#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
|
|
5955
6361
|
const DepRecord$2 = effect.Schema.optionalKey(effect.Schema.Record(effect.Schema.String, effect.Schema.String));
|
|
5956
6362
|
const BunWorkspaceEntry = effect.Schema.Struct({
|
|
5957
6363
|
name: effect.Schema.optionalKey(effect.Schema.String),
|
|
@@ -6044,7 +6450,7 @@ const toFields$3 = (raw) => effect.Effect.gen(function* () {
|
|
|
6044
6450
|
};
|
|
6045
6451
|
});
|
|
6046
6452
|
//#endregion
|
|
6047
|
-
//#region ../../node_modules/.pnpm/@effected+lockfiles@0.1.
|
|
6453
|
+
//#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
|
|
6048
6454
|
const DepRecord$1 = effect.Schema.optionalKey(effect.Schema.Record(effect.Schema.String, effect.Schema.String));
|
|
6049
6455
|
const NpmPackageEntry = effect.Schema.Struct({
|
|
6050
6456
|
name: effect.Schema.optionalKey(effect.Schema.String),
|
|
@@ -6142,7 +6548,7 @@ const toFields$2 = (raw) => effect.Effect.gen(function* () {
|
|
|
6142
6548
|
};
|
|
6143
6549
|
});
|
|
6144
6550
|
//#endregion
|
|
6145
|
-
//#region ../../node_modules/.pnpm/@effected+yaml@0.
|
|
6551
|
+
//#region ../../node_modules/.pnpm/@effected+yaml@0.5.0_effect@4.0.0-beta.99/node_modules/@effected/yaml/YamlNode.js
|
|
6146
6552
|
/**
|
|
6147
6553
|
* YAML scalar presentation styles.
|
|
6148
6554
|
*
|
|
@@ -6162,6 +6568,16 @@ const ScalarStyle = effect.Schema.Literals([
|
|
|
6162
6568
|
*/
|
|
6163
6569
|
const CollectionStyle = effect.Schema.Literals(["block", "flow"]);
|
|
6164
6570
|
/**
|
|
6571
|
+
* Quote characters available to the stringifier's plain-scalar fallback: the
|
|
6572
|
+
* style a `plain`-styled scalar is rendered in when it turns out to require
|
|
6573
|
+
* quoting. Referenced by the `quoteStyle` field of `YamlStringifyOptions`;
|
|
6574
|
+
* unlike `ScalarStyle` it is a stringify-option vocabulary, never a property
|
|
6575
|
+
* of a composed node.
|
|
6576
|
+
*
|
|
6577
|
+
* @public
|
|
6578
|
+
*/
|
|
6579
|
+
const QuoteStyle = effect.Schema.Literals(["single", "double"]);
|
|
6580
|
+
/**
|
|
6165
6581
|
* Block-scalar chomping indicators (`-` strip, default clip, `+` keep).
|
|
6166
6582
|
* Referenced by the {@link YamlScalar} `chomp` field schema.
|
|
6167
6583
|
*
|
|
@@ -6534,7 +6950,7 @@ function nodeToValue(node, anchors, budget, counting = false) {
|
|
|
6534
6950
|
return null;
|
|
6535
6951
|
}
|
|
6536
6952
|
//#endregion
|
|
6537
|
-
//#region ../../node_modules/.pnpm/@effected+yaml@0.
|
|
6953
|
+
//#region ../../node_modules/.pnpm/@effected+yaml@0.5.0_effect@4.0.0-beta.99/node_modules/@effected/yaml/internal/diagnostics.js
|
|
6538
6954
|
/** Error codes emitted by the lexer stage. */
|
|
6539
6955
|
const YAML_LEX_ERROR_CODES = [
|
|
6540
6956
|
"UnexpectedCharacter",
|
|
@@ -6612,7 +7028,7 @@ function isFatalCode(code) {
|
|
|
6612
7028
|
return FATAL_CODES.has(code);
|
|
6613
7029
|
}
|
|
6614
7030
|
//#endregion
|
|
6615
|
-
//#region ../../node_modules/.pnpm/@effected+yaml@0.
|
|
7031
|
+
//#region ../../node_modules/.pnpm/@effected+yaml@0.5.0_effect@4.0.0-beta.99/node_modules/@effected/yaml/YamlDiagnostic.js
|
|
6616
7032
|
/**
|
|
6617
7033
|
* Error codes emitted by the lexer stage.
|
|
6618
7034
|
*
|
|
@@ -6733,7 +7149,7 @@ function lineChar(text, offset) {
|
|
|
6733
7149
|
};
|
|
6734
7150
|
}
|
|
6735
7151
|
//#endregion
|
|
6736
|
-
//#region ../../node_modules/.pnpm/@effected+yaml@0.
|
|
7152
|
+
//#region ../../node_modules/.pnpm/@effected+yaml@0.5.0_effect@4.0.0-beta.99/node_modules/@effected/yaml/internal/composer/anchors.js
|
|
6737
7153
|
/**
|
|
6738
7154
|
* Check if a pending anchor is being applied to an alias node (invalid in YAML 1.2 §3.2.2).
|
|
6739
7155
|
* Aliases represent references to existing anchored nodes and cannot have their own anchors.
|
|
@@ -6826,7 +7242,7 @@ function collectAnchors(node, anchors) {
|
|
|
6826
7242
|
}
|
|
6827
7243
|
}
|
|
6828
7244
|
//#endregion
|
|
6829
|
-
//#region ../../node_modules/.pnpm/@effected+yaml@0.
|
|
7245
|
+
//#region ../../node_modules/.pnpm/@effected+yaml@0.5.0_effect@4.0.0-beta.99/node_modules/@effected/yaml/internal/lexer.js
|
|
6830
7246
|
/**
|
|
6831
7247
|
* Create a new YAML scanner for the given source text.
|
|
6832
7248
|
*
|
|
@@ -7783,7 +8199,7 @@ function lexAll(text) {
|
|
|
7783
8199
|
return tokens;
|
|
7784
8200
|
}
|
|
7785
8201
|
//#endregion
|
|
7786
|
-
//#region ../../node_modules/.pnpm/@effected+yaml@0.
|
|
8202
|
+
//#region ../../node_modules/.pnpm/@effected+yaml@0.5.0_effect@4.0.0-beta.99/node_modules/@effected/yaml/internal/cst-parser.js
|
|
7787
8203
|
/**
|
|
7788
8204
|
* Hardening: cap CST nesting so hostile inputs cannot overflow the stack
|
|
7789
8205
|
* while the tree is being BUILT. Set slightly above the composer's
|
|
@@ -8495,7 +8911,7 @@ function parseCSTAll(text) {
|
|
|
8495
8911
|
return parseDocuments(lexAll(text), text);
|
|
8496
8912
|
}
|
|
8497
8913
|
//#endregion
|
|
8498
|
-
//#region ../../node_modules/.pnpm/@effected+yaml@0.
|
|
8914
|
+
//#region ../../node_modules/.pnpm/@effected+yaml@0.5.0_effect@4.0.0-beta.99/node_modules/@effected/yaml/internal/composer/state.js
|
|
8499
8915
|
let lineStartsText;
|
|
8500
8916
|
let lineStartsCache = [];
|
|
8501
8917
|
function getLineStarts(text) {
|
|
@@ -8601,7 +9017,7 @@ function exitNesting(state) {
|
|
|
8601
9017
|
state.depth--;
|
|
8602
9018
|
}
|
|
8603
9019
|
//#endregion
|
|
8604
|
-
//#region ../../node_modules/.pnpm/@effected+yaml@0.
|
|
9020
|
+
//#region ../../node_modules/.pnpm/@effected+yaml@0.5.0_effect@4.0.0-beta.99/node_modules/@effected/yaml/internal/composer/tags.js
|
|
8605
9021
|
/**
|
|
8606
9022
|
* Resolve a tag shorthand using the document's %TAG directives.
|
|
8607
9023
|
* For example, with `%TAG !! tag:example.com,2000:app/`, the tag `!!int`
|
|
@@ -8687,7 +9103,7 @@ function validateTagHandlesInDocument(docCst, state) {
|
|
|
8687
9103
|
}
|
|
8688
9104
|
}
|
|
8689
9105
|
//#endregion
|
|
8690
|
-
//#region ../../node_modules/.pnpm/@effected+yaml@0.
|
|
9106
|
+
//#region ../../node_modules/.pnpm/@effected+yaml@0.5.0_effect@4.0.0-beta.99/node_modules/@effected/yaml/internal/composer/scalars.js
|
|
8691
9107
|
const NULL_RE$1 = /^(?:null|Null|NULL|~)$/;
|
|
8692
9108
|
const TRUE_RE$1 = /^(?:true|True|TRUE)$/;
|
|
8693
9109
|
const FALSE_RE$1 = /^(?:false|False|FALSE)$/;
|
|
@@ -9565,7 +9981,7 @@ function shouldPreserveRaw(rawValue, value) {
|
|
|
9565
9981
|
return false;
|
|
9566
9982
|
}
|
|
9567
9983
|
//#endregion
|
|
9568
|
-
//#region ../../node_modules/.pnpm/@effected+yaml@0.
|
|
9984
|
+
//#region ../../node_modules/.pnpm/@effected+yaml@0.5.0_effect@4.0.0-beta.99/node_modules/@effected/yaml/internal/composer/block.js
|
|
9569
9985
|
/**
|
|
9570
9986
|
* Compose a block map from its CST children, with an optional external first key.
|
|
9571
9987
|
*
|
|
@@ -10713,7 +11129,7 @@ function composeFlatBlockMap(children, startIdx, parentCst, state, externalFirst
|
|
|
10713
11129
|
return map;
|
|
10714
11130
|
}
|
|
10715
11131
|
//#endregion
|
|
10716
|
-
//#region ../../node_modules/.pnpm/@effected+yaml@0.
|
|
11132
|
+
//#region ../../node_modules/.pnpm/@effected+yaml@0.5.0_effect@4.0.0-beta.99/node_modules/@effected/yaml/internal/composer/flow.js
|
|
10717
11133
|
/**
|
|
10718
11134
|
* Validate that flow collection entries are separated by commas.
|
|
10719
11135
|
*
|
|
@@ -11105,7 +11521,7 @@ function composeFlowSeqInner(cst, state, meta, parentBlockColumn) {
|
|
|
11105
11521
|
return seq;
|
|
11106
11522
|
}
|
|
11107
11523
|
//#endregion
|
|
11108
|
-
//#region ../../node_modules/.pnpm/@effected+yaml@0.
|
|
11524
|
+
//#region ../../node_modules/.pnpm/@effected+yaml@0.5.0_effect@4.0.0-beta.99/node_modules/@effected/yaml/internal/composer/document.js
|
|
11109
11525
|
/** The flow-composer dispatch wired into every state this module creates. */
|
|
11110
11526
|
const FLOW = {
|
|
11111
11527
|
composeFlowMap,
|
|
@@ -11771,7 +12187,7 @@ function composeAllDocuments(text, options) {
|
|
|
11771
12187
|
};
|
|
11772
12188
|
}
|
|
11773
12189
|
//#endregion
|
|
11774
|
-
//#region ../../node_modules/.pnpm/@effected+yaml@0.
|
|
12190
|
+
//#region ../../node_modules/.pnpm/@effected+yaml@0.5.0_effect@4.0.0-beta.99/node_modules/@effected/yaml/internal/fold.js
|
|
11775
12191
|
/**
|
|
11776
12192
|
* Column-based line folding for a single logical scalar line (YAML 1.2 flow
|
|
11777
12193
|
* folding, §7.3 / §8.2.1). Breaks the content at "safe" single-space
|
|
@@ -12007,7 +12423,7 @@ function renderBlockFolded(s, indent) {
|
|
|
12007
12423
|
return `>${indentIndicator}${chomp}\n${outputLines.join("\n")}`;
|
|
12008
12424
|
}
|
|
12009
12425
|
//#endregion
|
|
12010
|
-
//#region ../../node_modules/.pnpm/@effected+yaml@0.
|
|
12426
|
+
//#region ../../node_modules/.pnpm/@effected+yaml@0.5.0_effect@4.0.0-beta.99/node_modules/@effected/yaml/internal/stringifier.js
|
|
12011
12427
|
/**
|
|
12012
12428
|
* Thrown by the stringifier on its failure paths (circular references). The
|
|
12013
12429
|
* facade catches this and materializes the public stringify error.
|
|
@@ -12113,7 +12529,10 @@ function requiresQuoting(s, ignoreType = false) {
|
|
|
12113
12529
|
if (s.includes(" #") || s.includes(" #")) return true;
|
|
12114
12530
|
const last = s[s.length - 1];
|
|
12115
12531
|
if (last === " " || last === " ") return true;
|
|
12116
|
-
for (let i = 0; i < s.length; i++)
|
|
12532
|
+
for (let i = 0; i < s.length; i++) {
|
|
12533
|
+
const code = s.charCodeAt(i);
|
|
12534
|
+
if (code === 9 || code === 13 || isControlChar(code)) return true;
|
|
12535
|
+
}
|
|
12117
12536
|
return false;
|
|
12118
12537
|
}
|
|
12119
12538
|
/**
|
|
@@ -12170,11 +12589,13 @@ function renderSingleQuoted(s) {
|
|
|
12170
12589
|
*
|
|
12171
12590
|
* Multi-line strings are routed to block styles regardless of the requested
|
|
12172
12591
|
* style (except double-quoted). For single-line strings, plain style delegates
|
|
12173
|
-
* to {@link requiresQuoting} and falls back to
|
|
12174
|
-
*
|
|
12175
|
-
*
|
|
12592
|
+
* to {@link requiresQuoting} and falls back to `quoteStyle` (single-quoted by
|
|
12593
|
+
* default, double-quoted when the caller asked for it) — or to double-quoted
|
|
12594
|
+
* regardless when the value needs YAML escapes single quotes cannot express.
|
|
12595
|
+
* Block literal and block folded styles are always accepted for single-line
|
|
12596
|
+
* strings even though the output is unusual.
|
|
12176
12597
|
*/
|
|
12177
|
-
function renderString(s, style, indent, ignoreType = false, canonical = false, explicitChomp, parentPosition) {
|
|
12598
|
+
function renderString(s, style, indent, ignoreType = false, canonical = false, explicitChomp, parentPosition, quoteStyle = "single") {
|
|
12178
12599
|
if (s.includes("\n")) {
|
|
12179
12600
|
let hasControl = false;
|
|
12180
12601
|
for (let i = 0; i < s.length; i++) {
|
|
@@ -12208,7 +12629,7 @@ function renderString(s, style, indent, ignoreType = false, canonical = false, e
|
|
|
12208
12629
|
if (requiresQuoting(s, ignoreType)) {
|
|
12209
12630
|
if (s.includes(" ") || s.includes("\r")) return renderDoubleQuoted(s, canonical);
|
|
12210
12631
|
for (let i = 0; i < s.length; i++) if (isControlChar(s.charCodeAt(i))) return renderDoubleQuoted(s, canonical);
|
|
12211
|
-
return renderSingleQuoted(s);
|
|
12632
|
+
return quoteStyle === "double" ? renderDoubleQuoted(s, canonical) : renderSingleQuoted(s);
|
|
12212
12633
|
}
|
|
12213
12634
|
return s;
|
|
12214
12635
|
case "single-quoted": return renderSingleQuoted(s);
|
|
@@ -12248,6 +12669,7 @@ function createContext(options) {
|
|
|
12248
12669
|
defaultCollectionStyle: options?.defaultCollectionStyle ?? "block",
|
|
12249
12670
|
sortKeys: options?.sortKeys ?? false,
|
|
12250
12671
|
indentSequences: options?.indentSequences ?? false,
|
|
12672
|
+
quoteStyle: options?.quoteStyle ?? "single",
|
|
12251
12673
|
forceDefaultStyles: options?.forceDefaultStyles ?? false,
|
|
12252
12674
|
seen: /* @__PURE__ */ new Set()
|
|
12253
12675
|
};
|
|
@@ -12267,7 +12689,7 @@ function stringifyLines(value, ctx, depth, allowFold = true) {
|
|
|
12267
12689
|
if (typeof value === "bigint") return [value.toString()];
|
|
12268
12690
|
if (typeof value === "string") {
|
|
12269
12691
|
const indentStr = " ".repeat(ctx.indent);
|
|
12270
|
-
const rendered = renderString(value, ctx.defaultScalarStyle, indentStr, false, ctx.forceDefaultStyles);
|
|
12692
|
+
const rendered = renderString(value, ctx.defaultScalarStyle, indentStr, false, ctx.forceDefaultStyles, void 0, void 0, ctx.quoteStyle);
|
|
12271
12693
|
return (allowFold && ctx.lineWidth > 0 ? foldRenderedScalar(rendered, indentStr, ctx.lineWidth) : rendered).split("\n");
|
|
12272
12694
|
}
|
|
12273
12695
|
if (Array.isArray(value)) {
|
|
@@ -12332,10 +12754,11 @@ function stringifyObjectLines(obj, ctx, depth) {
|
|
|
12332
12754
|
const keys = Object.keys(obj);
|
|
12333
12755
|
if (keys.length === 0) return ["{}"];
|
|
12334
12756
|
if (ctx.sortKeys) keys.sort();
|
|
12757
|
+
const renderPlainKey = (k) => renderString(k, "plain", "", false, false, void 0, void 0, ctx.quoteStyle);
|
|
12335
12758
|
if (ctx.defaultCollectionStyle === "flow") return [`{${keys.map((k) => {
|
|
12336
|
-
return `${
|
|
12759
|
+
return `${renderPlainKey(k)}: ${stringifyLines(obj[k], ctx, depth + 1, false).join(" ")}`;
|
|
12337
12760
|
}).join(", ")}}`];
|
|
12338
|
-
const renderKey = (k) => k.includes("\n") ? renderDoubleQuoted(k, ctx.forceDefaultStyles) :
|
|
12761
|
+
const renderKey = (k) => k.includes("\n") ? renderDoubleQuoted(k, ctx.forceDefaultStyles) : renderPlainKey(k);
|
|
12339
12762
|
const pad = " ".repeat(ctx.indent);
|
|
12340
12763
|
const lines = [];
|
|
12341
12764
|
for (const k of keys) {
|
|
@@ -12383,7 +12806,7 @@ effect.Schema.Class("YamlStringifyOptions")({
|
|
|
12383
12806
|
* (`>`) scalars at approximately that column, never block-literal (`|`).
|
|
12384
12807
|
*
|
|
12385
12808
|
* Takes effect only through {@link Yaml.stringify} and
|
|
12386
|
-
* {@link Yaml.
|
|
12809
|
+
* {@link Yaml.stringifyResult} — the two entry points that accept these
|
|
12387
12810
|
* options on the value path. The schema factories ({@link Yaml.fromString},
|
|
12388
12811
|
* {@link Yaml.schema}, {@link Yaml.YamlFromString}) encode with default
|
|
12389
12812
|
* stringify options (`lineWidth` `0`), so their output never folds. The
|
|
@@ -12396,6 +12819,17 @@ effect.Schema.Class("YamlStringifyOptions")({
|
|
|
12396
12819
|
defaultCollectionStyle: effect.Schema.optionalKey(CollectionStyle),
|
|
12397
12820
|
sortKeys: effect.Schema.optionalKey(effect.Schema.Boolean),
|
|
12398
12821
|
indentSequences: effect.Schema.optionalKey(effect.Schema.Boolean),
|
|
12822
|
+
/**
|
|
12823
|
+
* Quote style used when a `plain`-styled scalar requires quoting. Default
|
|
12824
|
+
* `"single"` — the released byte-compatible behavior. `"double"` renders
|
|
12825
|
+
* the same scalars double-quoted instead, matching the `yaml` npm
|
|
12826
|
+
* package's `singleQuote: false` output.
|
|
12827
|
+
*
|
|
12828
|
+
* Affects only the plain fallback: scalars that need no quoting stay
|
|
12829
|
+
* plain, and an explicit `defaultScalarStyle` of `"single-quoted"` or
|
|
12830
|
+
* `"double-quoted"` is unaffected.
|
|
12831
|
+
*/
|
|
12832
|
+
quoteStyle: effect.Schema.optionalKey(QuoteStyle),
|
|
12399
12833
|
finalNewline: effect.Schema.optionalKey(effect.Schema.Boolean),
|
|
12400
12834
|
forceDefaultStyles: effect.Schema.optionalKey(effect.Schema.Boolean)
|
|
12401
12835
|
});
|
|
@@ -12445,6 +12879,7 @@ const toStringifyInput = (options) => options === void 0 ? {} : {
|
|
|
12445
12879
|
defaultCollectionStyle: options.defaultCollectionStyle,
|
|
12446
12880
|
sortKeys: options.sortKeys,
|
|
12447
12881
|
indentSequences: options.indentSequences,
|
|
12882
|
+
quoteStyle: options.quoteStyle,
|
|
12448
12883
|
finalNewline: options.finalNewline,
|
|
12449
12884
|
forceDefaultStyles: options.forceDefaultStyles
|
|
12450
12885
|
};
|
|
@@ -12502,7 +12937,7 @@ const stringifyDefectToError = (defect, value) => {
|
|
|
12502
12937
|
* mode (fatal diagnostics, duplicate keys, a "billion laughs" blow-up) yields
|
|
12503
12938
|
* a `Failure` carrying a typed {@link YamlParseError} — never a throw.
|
|
12504
12939
|
*/
|
|
12505
|
-
const
|
|
12940
|
+
const parseResultImpl = (text, options) => {
|
|
12506
12941
|
const doc = composeFirstDocument(text, toParseInput(options));
|
|
12507
12942
|
const failures = failureRecords(doc, options?.uniqueKeys ?? true);
|
|
12508
12943
|
if (failures.length > 0) return effect.Result.fail(new YamlParseError({
|
|
@@ -12523,7 +12958,7 @@ const parseSyncImpl = (text, options) => {
|
|
|
12523
12958
|
* recursion budget yields a `Failure` carrying a typed {@link YamlStringifyError},
|
|
12524
12959
|
* never a thrown defect.
|
|
12525
12960
|
*/
|
|
12526
|
-
const
|
|
12961
|
+
const stringifyResultImpl = (value, options) => {
|
|
12527
12962
|
try {
|
|
12528
12963
|
return effect.Result.succeed(stringifyValue(value, toStringifyInput(options)));
|
|
12529
12964
|
} catch (defect) {
|
|
@@ -12600,17 +13035,11 @@ var Yaml = class Yaml {
|
|
|
12600
13035
|
* resolved size grows exponentially relative to `maxAliasCount`) also
|
|
12601
13036
|
* fails through {@link YamlParseError} with an `AliasCountExceeded`
|
|
12602
13037
|
* diagnostic, never as an unhandled defect.
|
|
13038
|
+
*
|
|
13039
|
+
* Defined in terms of {@link Yaml.parseResult} — synchronous callers can
|
|
13040
|
+
* use that variant directly.
|
|
12603
13041
|
*/
|
|
12604
|
-
static parse = effect.Effect.fn("Yaml.parse")(
|
|
12605
|
-
const doc = composeFirstDocument(text, toParseInput(options));
|
|
12606
|
-
const failures = failureRecords(doc, options?.uniqueKeys ?? true);
|
|
12607
|
-
if (failures.length > 0) return yield* new YamlParseError({
|
|
12608
|
-
diagnostics: toDiagnostics(text, failures),
|
|
12609
|
-
input: text
|
|
12610
|
-
});
|
|
12611
|
-
const anchors = /* @__PURE__ */ new Map();
|
|
12612
|
-
return yield* extractDocumentValue(doc.contents, anchors, options?.maxAliasCount ?? 100, text);
|
|
12613
|
-
});
|
|
13042
|
+
static parse = effect.Effect.fn("Yaml.parse")((text, options) => effect.Effect.fromResult(Yaml.parseResult(text, options)));
|
|
12614
13043
|
/**
|
|
12615
13044
|
* Parse a multi-document YAML stream into an array of plain JavaScript
|
|
12616
13045
|
* values (one per document, in order). Any fatal diagnostic in any
|
|
@@ -12643,6 +13072,15 @@ var Yaml = class Yaml {
|
|
|
12643
13072
|
* or on a value nested deeper than the stringifier's recursion budget
|
|
12644
13073
|
* (`NestingDepthExceeded`) — both surface through the typed error channel
|
|
12645
13074
|
* rather than as an unhandled stack-overflow defect.
|
|
13075
|
+
*
|
|
13076
|
+
* @remarks
|
|
13077
|
+
* A `"<<"` object key is emitted **quoted** (`'<<': …`). This is the
|
|
13078
|
+
* opposite of the document path ({@link YamlFormat.format} and
|
|
13079
|
+
* `YamlDocument#stringify`), which leaves a parsed plain `<<` key unquoted
|
|
13080
|
+
* so it keeps its merge-key meaning, and the asymmetry is deliberate: a
|
|
13081
|
+
* `"<<"` key on a plain JavaScript object is an ordinary string key that
|
|
13082
|
+
* never carried merge semantics, so emitting it plain would silently turn
|
|
13083
|
+
* ordinary data into a merge directive.
|
|
12646
13084
|
*/
|
|
12647
13085
|
static stringify = effect.Effect.fn("Yaml.stringify")(function* (value, options) {
|
|
12648
13086
|
return yield* stringifyOrFail(value, options);
|
|
@@ -12650,8 +13088,14 @@ var Yaml = class Yaml {
|
|
|
12650
13088
|
/**
|
|
12651
13089
|
* Synchronous single-document parse, returning a `Result` instead of
|
|
12652
13090
|
* an `Effect`. A pure escape hatch for config-time callers that cannot
|
|
12653
|
-
* `await` an Effect (a `vitest.config.ts` is the motivating case)
|
|
12654
|
-
*
|
|
13091
|
+
* `await` an Effect (a `vitest.config.ts` is the motivating case).
|
|
13092
|
+
*
|
|
13093
|
+
* @remarks
|
|
13094
|
+
* This is the package's single parse path. {@link Yaml.parse} is defined in
|
|
13095
|
+
* terms of it (`Effect.fromResult` behind the named span), so the two
|
|
13096
|
+
* variants cannot diverge. Reach for the `Effect` variant inside Effect
|
|
13097
|
+
* code — it carries the `Yaml.parse` tracing span — and for this one at
|
|
13098
|
+
* synchronous boundaries.
|
|
12655
13099
|
*
|
|
12656
13100
|
* Preserves the package contract — malformed and adversarial input fails
|
|
12657
13101
|
* typed, never as a defect. Fatal diagnostics, duplicate keys and a
|
|
@@ -12663,7 +13107,7 @@ var Yaml = class Yaml {
|
|
|
12663
13107
|
* import { Yaml } from "@effected/yaml";
|
|
12664
13108
|
* import { Result } from "effect";
|
|
12665
13109
|
*
|
|
12666
|
-
* const result = Yaml.
|
|
13110
|
+
* const result = Yaml.parseResult("name: Alice\nage: 30");
|
|
12667
13111
|
* if (Result.isSuccess(result)) {
|
|
12668
13112
|
* result.success; // { name: "Alice", age: 30 }
|
|
12669
13113
|
* } else {
|
|
@@ -12673,8 +13117,8 @@ var Yaml = class Yaml {
|
|
|
12673
13117
|
*
|
|
12674
13118
|
* @public
|
|
12675
13119
|
*/
|
|
12676
|
-
static
|
|
12677
|
-
return
|
|
13120
|
+
static parseResult(text, options) {
|
|
13121
|
+
return parseResultImpl(text, options);
|
|
12678
13122
|
}
|
|
12679
13123
|
/**
|
|
12680
13124
|
* Synchronous stringify, returning a `Result` instead of an `Effect`.
|
|
@@ -12691,7 +13135,7 @@ var Yaml = class Yaml {
|
|
|
12691
13135
|
* import { Yaml } from "@effected/yaml";
|
|
12692
13136
|
* import { Result } from "effect";
|
|
12693
13137
|
*
|
|
12694
|
-
* const result = Yaml.
|
|
13138
|
+
* const result = Yaml.stringifyResult({ name: "Alice" });
|
|
12695
13139
|
* if (Result.isFailure(result)) {
|
|
12696
13140
|
* result.failure; // YamlStringifyError
|
|
12697
13141
|
* } else {
|
|
@@ -12701,8 +13145,8 @@ var Yaml = class Yaml {
|
|
|
12701
13145
|
*
|
|
12702
13146
|
* @public
|
|
12703
13147
|
*/
|
|
12704
|
-
static
|
|
12705
|
-
return
|
|
13148
|
+
static stringifyResult(value, options) {
|
|
13149
|
+
return stringifyResultImpl(value, options);
|
|
12706
13150
|
}
|
|
12707
13151
|
/**
|
|
12708
13152
|
* Strip comments from YAML text. Without `replaceCh`, comment characters
|
|
@@ -12831,6 +13275,51 @@ var Yaml = class Yaml {
|
|
|
12831
13275
|
static schema(target, options) {
|
|
12832
13276
|
return Yaml.fromString(options).pipe(effect.Schema.decodeTo(target));
|
|
12833
13277
|
}
|
|
13278
|
+
/**
|
|
13279
|
+
* Bind a target schema to the YAML codec once, yielding the composed
|
|
13280
|
+
* schema plus pre-derived `decode`/`encode` directions — the
|
|
13281
|
+
* {@link Yaml.schema} composition without the generic `Schema` machinery
|
|
13282
|
+
* at every use site. Binds the plain single-document form only: default
|
|
13283
|
+
* {@link YamlParseOptions} on decode, default stringify options on encode;
|
|
13284
|
+
* for multi-document streams compose over {@link Yaml.allFromString}
|
|
13285
|
+
* directly.
|
|
13286
|
+
*
|
|
13287
|
+
* Both directions fail with `Schema.SchemaError`, exactly as
|
|
13288
|
+
* `Schema.decodeEffect`/`Schema.encodeEffect` over {@link Yaml.schema}
|
|
13289
|
+
* would; the target's decoding/encoding service requirements flow through.
|
|
13290
|
+
*
|
|
13291
|
+
* @remarks
|
|
13292
|
+
* Schema-producing: each call composes a fresh schema and derives both
|
|
13293
|
+
* directions from it. Bind the result to a `const` — that single binding is
|
|
13294
|
+
* the point.
|
|
13295
|
+
*
|
|
13296
|
+
* @example
|
|
13297
|
+
* ```ts
|
|
13298
|
+
* import { Yaml } from "@effected/yaml";
|
|
13299
|
+
* import { Effect, Schema } from "effect";
|
|
13300
|
+
*
|
|
13301
|
+
* const Config = Schema.Struct({ port: Schema.Number });
|
|
13302
|
+
* const config = Yaml.bind(Config);
|
|
13303
|
+
*
|
|
13304
|
+
* const program = Effect.gen(function* () {
|
|
13305
|
+
* const value = yield* config.decode("port: 3000");
|
|
13306
|
+
* const text = yield* config.encode(value);
|
|
13307
|
+
* return [value, text] as const;
|
|
13308
|
+
* });
|
|
13309
|
+
* ```
|
|
13310
|
+
*
|
|
13311
|
+
* @param target - The domain schema decoded values must satisfy.
|
|
13312
|
+
* @returns A {@link YamlBoundCodec} carrying the composed schema and its
|
|
13313
|
+
* two pre-bound directions.
|
|
13314
|
+
*/
|
|
13315
|
+
static bind(target) {
|
|
13316
|
+
const schema = Yaml.schema(target);
|
|
13317
|
+
return {
|
|
13318
|
+
schema,
|
|
13319
|
+
decode: effect.Schema.decodeEffect(schema),
|
|
13320
|
+
encode: effect.Schema.encodeEffect(schema)
|
|
13321
|
+
};
|
|
13322
|
+
}
|
|
12834
13323
|
};
|
|
12835
13324
|
/**
|
|
12836
13325
|
* Parse for `equals`/`equalsValue`: any recorded error — fatal or not — or a
|
|
@@ -12883,7 +13372,7 @@ function deepEqualValues(a, b) {
|
|
|
12883
13372
|
return false;
|
|
12884
13373
|
}
|
|
12885
13374
|
//#endregion
|
|
12886
|
-
//#region ../../node_modules/.pnpm/@effected+lockfiles@0.1.
|
|
13375
|
+
//#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
|
|
12887
13376
|
/**
|
|
12888
13377
|
* An empty YAML document composes to `null` (`Yaml.parseAll("")` is `[null]`,
|
|
12889
13378
|
* and the trailing document of an env-only `pnpm-lock.yaml` is `null` too).
|
|
@@ -12953,7 +13442,7 @@ const selectSoleDocument = (content) => effect.Effect.gen(function* () {
|
|
|
12953
13442
|
};
|
|
12954
13443
|
});
|
|
12955
13444
|
//#endregion
|
|
12956
|
-
//#region ../../node_modules/.pnpm/@effected+lockfiles@0.1.
|
|
13445
|
+
//#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
|
|
12957
13446
|
const PnpmImporterDeps = effect.Schema.optionalKey(effect.Schema.Record(effect.Schema.String, effect.Schema.Struct({
|
|
12958
13447
|
specifier: effect.Schema.String,
|
|
12959
13448
|
version: effect.Schema.String
|
|
@@ -13079,7 +13568,7 @@ const toFields$1 = (raw) => effect.Effect.gen(function* () {
|
|
|
13079
13568
|
};
|
|
13080
13569
|
});
|
|
13081
13570
|
//#endregion
|
|
13082
|
-
//#region ../../node_modules/.pnpm/@effected+lockfiles@0.1.
|
|
13571
|
+
//#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
|
|
13083
13572
|
const YarnLockfileRaw = effect.Schema.Record(effect.Schema.String, effect.Schema.Unknown);
|
|
13084
13573
|
const DepRecord = effect.Schema.optionalKey(effect.Schema.Record(effect.Schema.String, effect.Schema.String));
|
|
13085
13574
|
const YarnEntry = effect.Schema.Struct({
|
|
@@ -13202,7 +13691,7 @@ const cleanYarnDeps = (deps) => {
|
|
|
13202
13691
|
return Object.fromEntries(Object.entries(deps).map(([name, value]) => [name, value.startsWith("npm:") ? value.slice(4) : value]));
|
|
13203
13692
|
};
|
|
13204
13693
|
//#endregion
|
|
13205
|
-
//#region ../../node_modules/.pnpm/@effected+lockfiles@0.1.
|
|
13694
|
+
//#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
|
|
13206
13695
|
const EMPTY_IMPORTERS = [];
|
|
13207
13696
|
/**
|
|
13208
13697
|
* Failure of `Lockfile.parse`: the given content is not a valid lockfile of
|
|
@@ -13446,7 +13935,7 @@ var Lockfile = class Lockfile extends effect.Schema.Class("Lockfile")({
|
|
|
13446
13935
|
}
|
|
13447
13936
|
};
|
|
13448
13937
|
//#endregion
|
|
13449
|
-
//#region ../../node_modules/.pnpm/@effected+lockfiles@0.1.
|
|
13938
|
+
//#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
|
|
13450
13939
|
/**
|
|
13451
13940
|
* The minimal manifest shape {@link LockfileIntegrity.compare} checks a
|
|
13452
13941
|
* lockfile against: a package name plus the four optional dependency maps.
|
|
@@ -13562,7 +14051,7 @@ var LockfileIntegrity = class LockfileIntegrity extends effect.Schema.Class("Loc
|
|
|
13562
14051
|
}
|
|
13563
14052
|
};
|
|
13564
14053
|
//#endregion
|
|
13565
|
-
//#region ../../node_modules/.pnpm/@effected+package-json@0.
|
|
14054
|
+
//#region ../../node_modules/.pnpm/@effected+package-json@0.4.1_effect@4.0.0-beta.99/node_modules/@effected/package-json/Dependency.js
|
|
13566
14055
|
/**
|
|
13567
14056
|
* A resolved dependency entry pairing a package name with its version
|
|
13568
14057
|
* specifier and the `kind` of map it came from (`@effected/npm`'s
|
|
@@ -13626,7 +14115,7 @@ var Dependency = class extends effect.Schema.Class("Dependency")({
|
|
|
13626
14115
|
}
|
|
13627
14116
|
};
|
|
13628
14117
|
//#endregion
|
|
13629
|
-
//#region ../../node_modules/.pnpm/@effected+package-json@0.
|
|
14118
|
+
//#region ../../node_modules/.pnpm/@effected+package-json@0.4.1_effect@4.0.0-beta.99/node_modules/@effected/package-json/DevEngines.js
|
|
13630
14119
|
/**
|
|
13631
14120
|
* A single `devEngines` constraint with a name and optional `version` / `onFail`.
|
|
13632
14121
|
*
|
|
@@ -14651,7 +15140,7 @@ var require_parse$2 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
14651
15140
|
};
|
|
14652
15141
|
}));
|
|
14653
15142
|
//#endregion
|
|
14654
|
-
//#region ../../node_modules/.pnpm/@effected+package-json@0.
|
|
15143
|
+
//#region ../../node_modules/.pnpm/@effected+package-json@0.4.1_effect@4.0.0-beta.99/node_modules/@effected/package-json/License.js
|
|
14655
15144
|
var import_spdx_expression_parse = /* @__PURE__ */ __toESM((/* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
14656
15145
|
var scan = require_scan$1();
|
|
14657
15146
|
var parse = require_parse$2();
|
|
@@ -14698,7 +15187,7 @@ const isValidSpdx = (value) => {
|
|
|
14698
15187
|
*/
|
|
14699
15188
|
const SpdxLicense = effect.Schema.String.pipe(effect.Schema.check(effect.Schema.makeFilter((value) => isValidSpdx(value) ? void 0 : "Expected a valid SPDX license expression")), effect.Schema.brand("SpdxLicense"));
|
|
14700
15189
|
//#endregion
|
|
14701
|
-
//#region ../../node_modules/.pnpm/@effected+package-json@0.
|
|
15190
|
+
//#region ../../node_modules/.pnpm/@effected+package-json@0.4.1_effect@4.0.0-beta.99/node_modules/@effected/package-json/PackageManager.js
|
|
14702
15191
|
const PACKAGE_MANAGER_RE = /^([a-z]+)@(\d+\.\d+\.\d+(?:-[a-zA-Z0-9._-]+)?)(?:\+(.+))?$/;
|
|
14703
15192
|
/**
|
|
14704
15193
|
* The `packageManager` field only ever carries corepack's `<algo>.<hex>`
|
|
@@ -14756,7 +15245,7 @@ var PackageManager = class PackageManager extends effect.Schema.Class("PackageMa
|
|
|
14756
15245
|
}
|
|
14757
15246
|
};
|
|
14758
15247
|
//#endregion
|
|
14759
|
-
//#region ../../node_modules/.pnpm/@effected+package-json@0.
|
|
15248
|
+
//#region ../../node_modules/.pnpm/@effected+package-json@0.4.1_effect@4.0.0-beta.99/node_modules/@effected/package-json/PackageName.js
|
|
14760
15249
|
/**
|
|
14761
15250
|
* Indicates that a string could not be used as a valid npm package name.
|
|
14762
15251
|
*
|
|
@@ -14814,7 +15303,7 @@ const PackageName = Object.assign(effect.Schema.Union([ScopedPackageName, Unscop
|
|
|
14814
15303
|
isScoped
|
|
14815
15304
|
});
|
|
14816
15305
|
//#endregion
|
|
14817
|
-
//#region ../../node_modules/.pnpm/@effected+package-json@0.
|
|
15306
|
+
//#region ../../node_modules/.pnpm/@effected+package-json@0.4.1_effect@4.0.0-beta.99/node_modules/@effected/package-json/Person.js
|
|
14818
15307
|
const parsePersonString = (input) => {
|
|
14819
15308
|
const emailMatch = input.match(/<([^>]+)>/);
|
|
14820
15309
|
const urlMatch = input.match(/\(([^)]+)\)/);
|
|
@@ -14828,8 +15317,56 @@ const parsePersonString = (input) => {
|
|
|
14828
15317
|
...urlMatch !== null ? { url: urlMatch[1] } : {}
|
|
14829
15318
|
});
|
|
14830
15319
|
};
|
|
15320
|
+
const serializePerson = (person) => {
|
|
15321
|
+
let result = person.name;
|
|
15322
|
+
if (person.email !== void 0) result += ` <${person.email}>`;
|
|
15323
|
+
if (person.url !== void 0) result += ` (${person.url})`;
|
|
15324
|
+
return result;
|
|
15325
|
+
};
|
|
15326
|
+
const wireForms = /* @__PURE__ */ new WeakMap();
|
|
15327
|
+
const rememberWire = (person, wire) => {
|
|
15328
|
+
wireForms.set(person, wire);
|
|
15329
|
+
return person;
|
|
15330
|
+
};
|
|
15331
|
+
const KNOWN_KEYS = /* @__PURE__ */ new Set([
|
|
15332
|
+
"name",
|
|
15333
|
+
"email",
|
|
15334
|
+
"url"
|
|
15335
|
+
]);
|
|
15336
|
+
const sameRest = (a, b) => JSON.stringify(a ?? {}) === JSON.stringify(b ?? {});
|
|
15337
|
+
const isFaithful = (wire, person) => {
|
|
15338
|
+
if (typeof wire === "string") {
|
|
15339
|
+
const parsed = parsePersonString(wire);
|
|
15340
|
+
return parsed.name === person.name && parsed.email === person.email && parsed.url === person.url;
|
|
15341
|
+
}
|
|
15342
|
+
const rest = restOf(wire);
|
|
15343
|
+
return wire.name === person.name && wire.email === person.email && wire.url === person.url && sameRest(rest, person.rest);
|
|
15344
|
+
};
|
|
15345
|
+
const PersonFields = effect.Schema.Struct({
|
|
15346
|
+
name: effect.Schema.String,
|
|
15347
|
+
email: effect.Schema.optionalKey(effect.Schema.String),
|
|
15348
|
+
url: effect.Schema.optionalKey(effect.Schema.String)
|
|
15349
|
+
});
|
|
15350
|
+
const decodePersonFields = effect.Schema.decodeUnknownEffect(PersonFields);
|
|
15351
|
+
const restOf = (raw) => {
|
|
15352
|
+
const rest = {};
|
|
15353
|
+
for (const [key, value] of Object.entries(raw)) if (!KNOWN_KEYS.has(key)) rest[key] = value;
|
|
15354
|
+
return rest;
|
|
15355
|
+
};
|
|
15356
|
+
const encodePersonObject = (person) => {
|
|
15357
|
+
const wire = wireForms.get(person);
|
|
15358
|
+
if (wire !== void 0 && typeof wire !== "string" && isFaithful(wire, person)) return wire;
|
|
15359
|
+
const known = { name: person.name };
|
|
15360
|
+
if (person.email !== void 0) known.email = person.email;
|
|
15361
|
+
if (person.url !== void 0) known.url = person.url;
|
|
15362
|
+
return {
|
|
15363
|
+
...person.rest ?? {},
|
|
15364
|
+
...known
|
|
15365
|
+
};
|
|
15366
|
+
};
|
|
14831
15367
|
/**
|
|
14832
|
-
* A structured person object with `name
|
|
15368
|
+
* A structured person object with `name`, optional `email` / `url`, and a
|
|
15369
|
+
* `rest` catch-all preserving any additional keys across a read/write cycle.
|
|
14833
15370
|
*
|
|
14834
15371
|
* @public
|
|
14835
15372
|
*/
|
|
@@ -14839,29 +15376,77 @@ var Person = class Person extends effect.Schema.Class("Person")({
|
|
|
14839
15376
|
/** The optional email address. */
|
|
14840
15377
|
email: effect.Schema.optionalKey(effect.Schema.String),
|
|
14841
15378
|
/** The optional homepage URL. */
|
|
14842
|
-
url: effect.Schema.optionalKey(effect.Schema.String)
|
|
15379
|
+
url: effect.Schema.optionalKey(effect.Schema.String),
|
|
15380
|
+
/** Any additional keys, preserved verbatim and flattened back on encode. */
|
|
15381
|
+
rest: effect.Schema.optionalKey(effect.Schema.Record(effect.Schema.String, effect.Schema.Unknown))
|
|
14843
15382
|
}) {
|
|
15383
|
+
/**
|
|
15384
|
+
* The object wire codec: an open JSON object ↔ a {@link Person}, partitioning
|
|
15385
|
+
* unknown keys into `rest` and flattening them back on encode so the on-disk
|
|
15386
|
+
* shape never carries a literal `rest` key.
|
|
15387
|
+
*/
|
|
15388
|
+
static schema = effect.Schema.Record(effect.Schema.String, effect.Schema.Unknown).pipe(effect.Schema.decodeTo(effect.Schema.instanceOf(Person), effect.SchemaTransformation.transformOrFail({
|
|
15389
|
+
decode: (raw) => decodePersonFields(raw).pipe(effect.Effect.mapError((error) => error.issue), effect.Effect.map((fields) => {
|
|
15390
|
+
const rest = restOf(raw);
|
|
15391
|
+
return rememberWire(Person.make({
|
|
15392
|
+
...fields,
|
|
15393
|
+
...Object.keys(rest).length > 0 ? { rest } : {}
|
|
15394
|
+
}), raw);
|
|
15395
|
+
})),
|
|
15396
|
+
encode: (person) => effect.Effect.succeed(encodePersonObject(person))
|
|
15397
|
+
})));
|
|
14844
15398
|
/**
|
|
14845
15399
|
* Schema transformation between the `"Name <email> (url)"` shorthand string
|
|
14846
|
-
* and a {@link Person}.
|
|
15400
|
+
* and a {@link Person}. Decoding remembers the input text so that encoding
|
|
15401
|
+
* reproduces it verbatim; see {@link Person.wireStringOf}.
|
|
14847
15402
|
*/
|
|
14848
15403
|
static FromString = effect.Schema.String.pipe(effect.Schema.decodeTo(effect.Schema.instanceOf(Person), effect.SchemaTransformation.transform({
|
|
14849
|
-
decode: (input) => parsePersonString(input),
|
|
15404
|
+
decode: (input) => rememberWire(parsePersonString(input), input),
|
|
14850
15405
|
encode: (person) => {
|
|
14851
|
-
|
|
14852
|
-
|
|
14853
|
-
if (person.url !== void 0) result += ` (${person.url})`;
|
|
14854
|
-
return result;
|
|
15406
|
+
const wire = wireForms.get(person);
|
|
15407
|
+
return typeof wire === "string" && isFaithful(wire, person) ? wire : serializePerson(person);
|
|
14855
15408
|
}
|
|
14856
15409
|
})));
|
|
14857
15410
|
/**
|
|
14858
15411
|
* The `author` / `contributors` value: either the shorthand string or the
|
|
14859
15412
|
* structured object, always decoded to a {@link Person}.
|
|
15413
|
+
*
|
|
15414
|
+
* The wire form is preserved across a round trip — a person read from the
|
|
15415
|
+
* shorthand string encodes back to that string, byte for byte, and one read
|
|
15416
|
+
* from an object encodes back to an object with its unknown keys intact.
|
|
15417
|
+
* Formatting a manifest therefore never rewrites one legal encoding into the
|
|
15418
|
+
* other.
|
|
15419
|
+
*
|
|
15420
|
+
* Provenance belongs to the instance, so a person that is *rebuilt* (rather
|
|
15421
|
+
* than carried through unchanged) has none and encodes in the canonical
|
|
15422
|
+
* object form. Editing an unrelated field of the surrounding `Package`
|
|
15423
|
+
* carries the same person instance through and preserves its encoding.
|
|
14860
15424
|
*/
|
|
14861
|
-
static FromValue = effect.Schema.Union([Person,
|
|
15425
|
+
static FromValue = effect.Schema.Union([Person.schema, effect.Schema.String]).pipe(effect.Schema.decodeTo(effect.Schema.instanceOf(Person), effect.SchemaTransformation.transform({
|
|
15426
|
+
decode: (input) => typeof input === "string" ? rememberWire(parsePersonString(input), input) : input,
|
|
15427
|
+
encode: (person) => {
|
|
15428
|
+
const wire = wireForms.get(person);
|
|
15429
|
+
return typeof wire === "string" && isFaithful(wire, person) ? wire : person;
|
|
15430
|
+
}
|
|
15431
|
+
})));
|
|
15432
|
+
/**
|
|
15433
|
+
* The shorthand text this person was decoded from, when it was decoded from
|
|
15434
|
+
* the string form and still matches its fields; `None` for a person built
|
|
15435
|
+
* from an object or by hand.
|
|
15436
|
+
*
|
|
15437
|
+
* Exposed so callers can tell which encoding a manifest used without
|
|
15438
|
+
* re-reading the file.
|
|
15439
|
+
*
|
|
15440
|
+
* @param person - the person to inspect
|
|
15441
|
+
* @returns the original shorthand text, or `None`
|
|
15442
|
+
*/
|
|
15443
|
+
static wireStringOf(person) {
|
|
15444
|
+
const wire = wireForms.get(person);
|
|
15445
|
+
return typeof wire === "string" && isFaithful(wire, person) ? effect.Option.some(wire) : effect.Option.none();
|
|
15446
|
+
}
|
|
14862
15447
|
};
|
|
14863
15448
|
//#endregion
|
|
14864
|
-
//#region ../../node_modules/.pnpm/@effected+package-json@0.
|
|
15449
|
+
//#region ../../node_modules/.pnpm/@effected+package-json@0.4.1_effect@4.0.0-beta.99/node_modules/@effected/package-json/internal/format.js
|
|
14865
15450
|
const KEY_INDEX = new Map([
|
|
14866
15451
|
"$schema",
|
|
14867
15452
|
"name",
|
|
@@ -15084,7 +15669,7 @@ const renderJson = (raw, options) => {
|
|
|
15084
15669
|
return options.newline ? `${json}\n` : json;
|
|
15085
15670
|
};
|
|
15086
15671
|
//#endregion
|
|
15087
|
-
//#region ../../node_modules/.pnpm/@effected+package-json@0.
|
|
15672
|
+
//#region ../../node_modules/.pnpm/@effected+package-json@0.4.1_effect@4.0.0-beta.99/node_modules/@effected/package-json/Package.js
|
|
15088
15673
|
const toHashMap = effect.SchemaTransformation.transform({
|
|
15089
15674
|
decode: (record) => effect.HashMap.fromIterable(Object.entries(record)),
|
|
15090
15675
|
encode: (map) => Object.fromEntries(effect.HashMap.toEntries(map))
|
|
@@ -15402,7 +15987,7 @@ var Package = class Package extends effect.Schema.Class("Package")({
|
|
|
15402
15987
|
}
|
|
15403
15988
|
};
|
|
15404
15989
|
//#endregion
|
|
15405
|
-
//#region ../../node_modules/.pnpm/@effected+workspaces@0.
|
|
15990
|
+
//#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
|
|
15406
15991
|
const EMPTY$1 = Object.freeze(Object.create(null));
|
|
15407
15992
|
const EMPTY_MANIFEST = Object.freeze(Object.create(null));
|
|
15408
15993
|
/**
|
|
@@ -15477,10 +16062,12 @@ var WorkspaceManifestError = class extends effect.Schema.TaggedErrorClass()("Wor
|
|
|
15477
16062
|
* path: "/repo/packages/utils",
|
|
15478
16063
|
* packageJsonPath: "/repo/packages/utils/package.json",
|
|
15479
16064
|
* relativePath: "packages/utils",
|
|
16065
|
+
* workspaceRoot: "/repo",
|
|
15480
16066
|
* });
|
|
15481
16067
|
*
|
|
15482
16068
|
* pkg.isRootWorkspace; // false
|
|
15483
16069
|
* pkg.unscopedName; // "utils"
|
|
16070
|
+
* pkg.workspaceRoot; // "/repo"
|
|
15484
16071
|
* ```
|
|
15485
16072
|
*
|
|
15486
16073
|
* @public
|
|
@@ -15496,6 +16083,21 @@ var WorkspacePackage = class WorkspacePackage extends effect.Schema.Class("Works
|
|
|
15496
16083
|
packageJsonPath: effect.Schema.NonEmptyString,
|
|
15497
16084
|
/** POSIX path relative to the workspace root; `"."` for the root package. */
|
|
15498
16085
|
relativePath: effect.Schema.String,
|
|
16086
|
+
/**
|
|
16087
|
+
* Absolute path to the workspace root this package was discovered under.
|
|
16088
|
+
*
|
|
16089
|
+
* @remarks
|
|
16090
|
+
* Carried, not derived. Whoever built this value already knew the root —
|
|
16091
|
+
* `WorkspaceDiscovery` resolved it before enumerating, and the sync entry
|
|
16092
|
+
* point is handed it — so dropping it forced every consumer into per-package
|
|
16093
|
+
* root arithmetic (counting `relativePath` segments and re-ascending that
|
|
16094
|
+
* many `..`). That reconstruction is exact only while `path` and
|
|
16095
|
+
* `relativePath` agree, and it re-derives something the kit never had to
|
|
16096
|
+
* lose.
|
|
16097
|
+
*
|
|
16098
|
+
* For the root package this equals `path`, and `relativePath` is `"."`.
|
|
16099
|
+
*/
|
|
16100
|
+
workspaceRoot: effect.Schema.NonEmptyString,
|
|
15499
16101
|
/** Whether the package is marked private. */
|
|
15500
16102
|
private: effect.Schema.Boolean.pipe(effect.Schema.withDecodingDefaultKey(effect.Effect.succeed(false)), effect.Schema.withConstructorDefault(effect.Effect.succeed(false))),
|
|
15501
16103
|
/** Production dependencies. */
|
|
@@ -15664,7 +16266,7 @@ var WorkspacePackage = class WorkspacePackage extends effect.Schema.Class("Works
|
|
|
15664
16266
|
}
|
|
15665
16267
|
};
|
|
15666
16268
|
//#endregion
|
|
15667
|
-
//#region ../../node_modules/.pnpm/@effected+walker@0.
|
|
16269
|
+
//#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
|
|
15668
16270
|
/**
|
|
15669
16271
|
* Typed failure raised by {@link descend}: a directory mid-walk was unreadable
|
|
15670
16272
|
* (under `onUnreadable: "fail"`), or the walk descended past `maxDepth`. Depth
|
|
@@ -15799,7 +16401,97 @@ const descend = effect.Effect.fn("Walker.descend")(function* (pattern, options)
|
|
|
15799
16401
|
return results;
|
|
15800
16402
|
});
|
|
15801
16403
|
//#endregion
|
|
15802
|
-
//#region ../../node_modules/.pnpm/@effected+walker@0.
|
|
16404
|
+
//#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
|
|
16405
|
+
/**
|
|
16406
|
+
* Typed failure raised by {@link compileAndExpand}: the single error the
|
|
16407
|
+
* compile+expand recipe fails with, so a caller catches one tag rather than
|
|
16408
|
+
* folding two error channels by hand.
|
|
16409
|
+
*
|
|
16410
|
+
* @remarks
|
|
16411
|
+
* One tag, two genuinely different causes — "your pattern is malformed" and
|
|
16412
|
+
* "that directory is unreadable" are different problems with different fixes,
|
|
16413
|
+
* so `cause` keeps the underlying typed error intact
|
|
16414
|
+
* rather than flattening it into a string. Discriminate on `cause._tag`
|
|
16415
|
+
* (`"GlobPatternError"` vs `"DescendError"`), or read
|
|
16416
|
+
* {@link GlobExpansionError.stage} when only the phase matters; either way the
|
|
16417
|
+
* original payload — a guard's `limit`/`actual`, a descent's `path` — is still
|
|
16418
|
+
* there. `cause` is also the native `Error` cause, so error chaining and
|
|
16419
|
+
* stack-printing work without extra wiring.
|
|
16420
|
+
*
|
|
16421
|
+
* @public
|
|
16422
|
+
*/
|
|
16423
|
+
var GlobExpansionError = class extends effect.Schema.TaggedErrorClass()("GlobExpansionError", {
|
|
16424
|
+
/** The glob pattern's source text, as handed to {@link compileAndExpand}. */
|
|
16425
|
+
pattern: effect.Schema.String,
|
|
16426
|
+
/** The underlying typed failure, intact: a compile guard trip or a descent failure. */
|
|
16427
|
+
cause: effect.Schema.Union([GlobPatternError, DescendError])
|
|
16428
|
+
}) {
|
|
16429
|
+
/**
|
|
16430
|
+
* Which phase failed — `"compile"` when the pattern itself was rejected,
|
|
16431
|
+
* `"descend"` when the filesystem walk failed. A convenience over
|
|
16432
|
+
* `cause._tag` for callers that only need the phase.
|
|
16433
|
+
*/
|
|
16434
|
+
get stage() {
|
|
16435
|
+
return this.cause._tag === "GlobPatternError" ? "compile" : "descend";
|
|
16436
|
+
}
|
|
16437
|
+
get message() {
|
|
16438
|
+
const shown = this.pattern.length > 64 ? `${this.pattern.slice(0, 64)}…` : this.pattern;
|
|
16439
|
+
return `glob expansion of ${JSON.stringify(shown)} failed during ${this.stage}: ${this.cause.message}`;
|
|
16440
|
+
}
|
|
16441
|
+
};
|
|
16442
|
+
/**
|
|
16443
|
+
* Compile a glob pattern and expand it against the filesystem in one call:
|
|
16444
|
+
* matching FILE paths relative to `options.cwd`, POSIX separators, sorted.
|
|
16445
|
+
*
|
|
16446
|
+
* @remarks
|
|
16447
|
+
* The recipe form of {@link descend}. Everything `descend` documents about
|
|
16448
|
+
* traversal holds unchanged — the literal fast-path, the negated-pattern walk
|
|
16449
|
+
* from `cwd`, files-only matching, symlink and prune handling, `maxDepth`,
|
|
16450
|
+
* `onUnreadable` — because this delegates to it. What this adds is the seam:
|
|
16451
|
+
* the pattern arrives as a string, and both failure modes arrive as one
|
|
16452
|
+
* {@link GlobExpansionError} with the underlying error preserved in `cause`.
|
|
16453
|
+
*
|
|
16454
|
+
* A missing base directory, a pattern that climbs above `cwd`, and a pattern
|
|
16455
|
+
* that simply matches nothing are all an EMPTY result, not a failure — zero
|
|
16456
|
+
* matches is a normal glob answer. Only a rejected pattern or a failed walk
|
|
16457
|
+
* produces an error.
|
|
16458
|
+
*
|
|
16459
|
+
* `FileSystem` and `Path` stay in the `R` channel and are **deliberately not
|
|
16460
|
+
* provided here**, even though hand-providing them is the friction this
|
|
16461
|
+
* recipe otherwise removes. `FileSystem` cannot be provided — a library that
|
|
16462
|
+
* picks its own filesystem cannot be tested against a fixture tree. Given
|
|
16463
|
+
* that, providing `Path` internally would not save the caller a layer (they
|
|
16464
|
+
* still supply `FileSystem`), and it would actively break win32: the walk
|
|
16465
|
+
* would join paths POSIX-style against a caller's win32 filesystem. The
|
|
16466
|
+
* consumer's platform layer stays the single place that choice is made.
|
|
16467
|
+
* Provide both once at the application boundary, not per call site.
|
|
16468
|
+
*
|
|
16469
|
+
* @example
|
|
16470
|
+
* ```ts
|
|
16471
|
+
* import { compileAndExpand } from "@effected/walker"
|
|
16472
|
+
* import { GlobPatternOptions } from "@effected/glob"
|
|
16473
|
+
*
|
|
16474
|
+
* const files = yield* compileAndExpand("packages/*/src/**/*.ts", {
|
|
16475
|
+
* cwd: "/repo",
|
|
16476
|
+
* glob: GlobPatternOptions.make({ dot: true })
|
|
16477
|
+
* })
|
|
16478
|
+
* ```
|
|
16479
|
+
*
|
|
16480
|
+
* @public
|
|
16481
|
+
*/
|
|
16482
|
+
const compileAndExpand = effect.Effect.fn("Walker.compileAndExpand")(function* (pattern, options) {
|
|
16483
|
+
const compiled = GlobPattern.compileResult(pattern, options.glob);
|
|
16484
|
+
if (effect.Result.isFailure(compiled)) return yield* new GlobExpansionError({
|
|
16485
|
+
pattern,
|
|
16486
|
+
cause: compiled.failure
|
|
16487
|
+
});
|
|
16488
|
+
return yield* descend(compiled.success, options).pipe(effect.Effect.mapError((cause) => new GlobExpansionError({
|
|
16489
|
+
pattern,
|
|
16490
|
+
cause
|
|
16491
|
+
})));
|
|
16492
|
+
});
|
|
16493
|
+
//#endregion
|
|
16494
|
+
//#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
|
|
15803
16495
|
/**
|
|
15804
16496
|
* Ascend from `start` toward the filesystem root, yielding each directory,
|
|
15805
16497
|
* nearest first.
|
|
@@ -15813,17 +16505,28 @@ const descend = effect.Effect.fn("Walker.descend")(function* (pattern, options)
|
|
|
15813
16505
|
* Bounded twice over: `dirname` is a fixpoint at the root, and `maxDepth` guards
|
|
15814
16506
|
* a pathological `Path` implementation that never reaches one.
|
|
15815
16507
|
*
|
|
16508
|
+
* `stopAt` is compared in normalized form — see {@link AscendOptions.stopAt}.
|
|
16509
|
+
* Raw string equality made the ceiling fail OPEN: an unnormalized ceiling
|
|
16510
|
+
* matched nothing and the ascent ran silently to the filesystem root, which is
|
|
16511
|
+
* the unbounded walk the option exists to prevent, with no error to notice it
|
|
16512
|
+
* by. A relative ceiling **dies** for the same reason — resolving one against
|
|
16513
|
+
* `process.cwd()` would reintroduce the silent-wrong-walk failure through a
|
|
16514
|
+
* different door. See {@link AscendOptions.stopAt} for why that is a defect
|
|
16515
|
+
* rather than a typed error; the error channel stays `never`.
|
|
16516
|
+
*
|
|
15816
16517
|
* @public
|
|
15817
16518
|
*/
|
|
15818
16519
|
const ascend = (start, options) => effect.Effect.gen(function* () {
|
|
15819
16520
|
const path = yield* effect.Path.Path;
|
|
15820
16521
|
const maxDepth = options?.maxDepth ?? 256;
|
|
15821
16522
|
if (!Number.isInteger(maxDepth) || maxDepth < 1) return yield* effect.Effect.die(/* @__PURE__ */ new Error(`Walker.ascend: maxDepth must be a positive integer, received ${maxDepth}`));
|
|
16523
|
+
if (options?.stopAt !== void 0 && !path.isAbsolute(options.stopAt)) return yield* effect.Effect.die(/* @__PURE__ */ new Error(`Walker.ascend: stopAt must be an absolute path, received ${JSON.stringify(options.stopAt)} (ascending from ${JSON.stringify(start)})`));
|
|
16524
|
+
const ceiling = options?.stopAt === void 0 ? void 0 : path.resolve(options.stopAt);
|
|
15822
16525
|
const dirs = [];
|
|
15823
16526
|
let current = start;
|
|
15824
16527
|
for (let depth = 0; depth < maxDepth; depth++) {
|
|
15825
16528
|
dirs.push(current);
|
|
15826
|
-
if (
|
|
16529
|
+
if (ceiling !== void 0 && (current === ceiling || path.resolve(current) === ceiling)) break;
|
|
15827
16530
|
const parent = path.dirname(current);
|
|
15828
16531
|
if (parent === current) break;
|
|
15829
16532
|
current = parent;
|
|
@@ -15889,7 +16592,7 @@ const Walker$1 = {
|
|
|
15889
16592
|
findRoot: findRoot$1
|
|
15890
16593
|
};
|
|
15891
16594
|
//#endregion
|
|
15892
|
-
//#region ../../node_modules/.pnpm/@effected+workspaces@0.
|
|
16595
|
+
//#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
|
|
15893
16596
|
/**
|
|
15894
16597
|
* The marker filenames {@link WorkspaceRoot} probes for, in priority order.
|
|
15895
16598
|
*
|
|
@@ -15909,11 +16612,22 @@ var WorkspaceRootNotFoundError = class extends effect.Schema.TaggedErrorClass()(
|
|
|
15909
16612
|
/** The directory the ascent started from. */
|
|
15910
16613
|
searchPath: effect.Schema.String,
|
|
15911
16614
|
/** The marker filenames probed at each ancestor. */
|
|
15912
|
-
markers: effect.Schema.Array(effect.Schema.String)
|
|
16615
|
+
markers: effect.Schema.Array(effect.Schema.String),
|
|
16616
|
+
/**
|
|
16617
|
+
* The resolved ceiling the ascent was bounded by, when one was supplied.
|
|
16618
|
+
*
|
|
16619
|
+
* @remarks
|
|
16620
|
+
* Absent means the ascent ran to the filesystem root. Its presence is what
|
|
16621
|
+
* lets a caller tell "there is no workspace root anywhere above me" from
|
|
16622
|
+
* "there is none below the ceiling I set" — two failures that otherwise
|
|
16623
|
+
* render identically.
|
|
16624
|
+
*/
|
|
16625
|
+
stopAt: effect.Schema.optionalKey(effect.Schema.String)
|
|
15913
16626
|
}) {
|
|
15914
|
-
/** Renders the search path
|
|
16627
|
+
/** Renders the search path, probed markers and any ceiling into a one-line message. */
|
|
15915
16628
|
get message() {
|
|
15916
|
-
|
|
16629
|
+
const bound = this.stopAt === void 0 ? "" : ` up to ${this.stopAt}`;
|
|
16630
|
+
return `No workspace root above ${this.searchPath}${bound} (looked for ${this.markers.join(", ")})`;
|
|
15917
16631
|
}
|
|
15918
16632
|
};
|
|
15919
16633
|
/**
|
|
@@ -15936,6 +16650,12 @@ const isWorkspaceRoot = (dir) => effect.Effect.gen(function* () {
|
|
|
15936
16650
|
}).pipe(effect.Effect.orElseSucceed(() => ({})));
|
|
15937
16651
|
return parsed.workspaces !== void 0 && parsed.workspaces !== null;
|
|
15938
16652
|
});
|
|
16653
|
+
/** Whether `descendant` is `ancestor` itself or lies beneath it, on POSIX or win32 separators. */
|
|
16654
|
+
const isAtOrBelow = (descendant, ancestor) => {
|
|
16655
|
+
if (descendant === ancestor) return true;
|
|
16656
|
+
const prefix = ancestor.endsWith("/") || ancestor.endsWith("\\") ? ancestor : `${ancestor}/`;
|
|
16657
|
+
return descendant.startsWith(prefix) || descendant.startsWith(prefix.replace(/\/$/, "\\"));
|
|
16658
|
+
};
|
|
15939
16659
|
/**
|
|
15940
16660
|
* Locates the workspace root by ascending from a starting directory.
|
|
15941
16661
|
*
|
|
@@ -15950,6 +16670,20 @@ const isWorkspaceRoot = (dir) => effect.Effect.gen(function* () {
|
|
|
15950
16670
|
* });
|
|
15951
16671
|
* ```
|
|
15952
16672
|
*
|
|
16673
|
+
* @example
|
|
16674
|
+
* Bounded: an unmarked fixture directory fails typed instead of escaping into
|
|
16675
|
+
* the enclosing repository.
|
|
16676
|
+
*
|
|
16677
|
+
* ```ts
|
|
16678
|
+
* import { WorkspaceRoot } from "@effected/workspaces";
|
|
16679
|
+
* import { Effect } from "effect";
|
|
16680
|
+
*
|
|
16681
|
+
* const program = Effect.gen(function* () {
|
|
16682
|
+
* const roots = yield* WorkspaceRoot;
|
|
16683
|
+
* return yield* roots.find("/tmp/fixture/packages/a", { stopAt: "/tmp/fixture" });
|
|
16684
|
+
* });
|
|
16685
|
+
* ```
|
|
16686
|
+
*
|
|
15953
16687
|
* @public
|
|
15954
16688
|
*/
|
|
15955
16689
|
var WorkspaceRoot = class WorkspaceRoot extends effect.Context.Service()("@effected/workspaces/WorkspaceRoot") {
|
|
@@ -15957,24 +16691,95 @@ var WorkspaceRoot = class WorkspaceRoot extends effect.Context.Service()("@effec
|
|
|
15957
16691
|
static make = effect.Effect.gen(function* () {
|
|
15958
16692
|
const fs = yield* effect.FileSystem.FileSystem;
|
|
15959
16693
|
const path = yield* effect.Path.Path;
|
|
15960
|
-
const find = effect.Effect.fn("WorkspaceRoot.find")(function* (cwd) {
|
|
16694
|
+
const find = effect.Effect.fn("WorkspaceRoot.find")(function* (cwd, options) {
|
|
15961
16695
|
const start = path.resolve(cwd);
|
|
15962
|
-
const
|
|
16696
|
+
const ceiling = options?.stopAt === void 0 ? void 0 : path.resolve(options.stopAt);
|
|
16697
|
+
const chain = yield* Walker$1.ascend(start, {
|
|
16698
|
+
...ceiling === void 0 ? {} : { stopAt: ceiling },
|
|
16699
|
+
...options?.maxDepth === void 0 ? {} : { maxDepth: options.maxDepth }
|
|
16700
|
+
});
|
|
15963
16701
|
const found = yield* Walker$1.findRoot(chain, isWorkspaceRoot);
|
|
15964
16702
|
if (effect.Option.isNone(found)) return yield* effect.Effect.fail(new WorkspaceRootNotFoundError({
|
|
15965
16703
|
searchPath: start,
|
|
15966
|
-
markers: WORKSPACE_MARKERS
|
|
16704
|
+
markers: WORKSPACE_MARKERS,
|
|
16705
|
+
...ceiling === void 0 ? {} : { stopAt: ceiling }
|
|
15967
16706
|
}));
|
|
15968
16707
|
yield* effect.Effect.logDebug("Workspace root found").pipe(effect.Effect.annotateLogs("workspace.root", found.value));
|
|
15969
16708
|
return found.value;
|
|
15970
16709
|
});
|
|
15971
|
-
return { find: (cwd) => find(cwd).pipe(effect.Effect.provideService(effect.FileSystem.FileSystem, fs), effect.Effect.provideService(effect.Path.Path, path)) };
|
|
16710
|
+
return { find: (cwd, options) => find(cwd, options).pipe(effect.Effect.provideService(effect.FileSystem.FileSystem, fs), effect.Effect.provideService(effect.Path.Path, path)) };
|
|
15972
16711
|
});
|
|
15973
16712
|
/** The live layer. */
|
|
15974
16713
|
static layer = effect.Layer.effect(WorkspaceRoot, WorkspaceRoot.make);
|
|
16714
|
+
/**
|
|
16715
|
+
* A test double resolving every `find` to `root`, with no filesystem.
|
|
16716
|
+
*
|
|
16717
|
+
* @remarks
|
|
16718
|
+
* The nine-copies-of-a-four-line-mock case — a `Layer.succeed` over a `find`
|
|
16719
|
+
* that ignores its arguments and succeeds with a fixed root is what consumers
|
|
16720
|
+
* were writing by hand. The difference is that this double **honours
|
|
16721
|
+
* `stopAt`**: a hand-rolled `find` that ignores the ceiling makes a bounded
|
|
16722
|
+
* call pass under test and fail against the live service, which is the
|
|
16723
|
+
* failure mode the option exists to catch. A `root` above the ceiling fails
|
|
16724
|
+
* here exactly as it would live, with the same
|
|
16725
|
+
* {@link WorkspaceRootNotFoundError}.
|
|
16726
|
+
*
|
|
16727
|
+
* The ceiling is `path.resolve`d through the injected `Path` service before
|
|
16728
|
+
* the comparison, exactly as the live `make` path does — so a `stopAt`
|
|
16729
|
+
* carrying `..` segments bounds the double identically to the live service,
|
|
16730
|
+
* not by raw string. This is why `makeTest` yields an `Effect` requiring
|
|
16731
|
+
* `Path`: it captures the service once at construction, the same shape as
|
|
16732
|
+
* `make`. Consumers reach for {@link WorkspaceRoot.layerTest}, which provides
|
|
16733
|
+
* `Path.layer` internally, so the requirement never surfaces at their call
|
|
16734
|
+
* site.
|
|
16735
|
+
*
|
|
16736
|
+
* `maxDepth` is deliberately NOT modelled: the double does not walk, so it has
|
|
16737
|
+
* no depth to cap, and pretending otherwise would encode a fiction. A suite
|
|
16738
|
+
* exercising the depth guard wants the live service over a fixture tree.
|
|
16739
|
+
*
|
|
16740
|
+
* @param root - The root every unbounded `find` resolves to.
|
|
16741
|
+
*/
|
|
16742
|
+
static makeTest = (root) => effect.Effect.gen(function* () {
|
|
16743
|
+
const path = yield* effect.Path.Path;
|
|
16744
|
+
return { find: (cwd, options) => options?.stopAt !== void 0 && !isAtOrBelow(root, path.resolve(options.stopAt)) ? effect.Effect.fail(new WorkspaceRootNotFoundError({
|
|
16745
|
+
searchPath: cwd,
|
|
16746
|
+
markers: WORKSPACE_MARKERS,
|
|
16747
|
+
stopAt: options.stopAt
|
|
16748
|
+
})) : effect.Effect.succeed(root) };
|
|
16749
|
+
});
|
|
16750
|
+
/**
|
|
16751
|
+
* The test layer: {@link WorkspaceRoot.makeTest} with `Path.layer` provided.
|
|
16752
|
+
*
|
|
16753
|
+
* @remarks
|
|
16754
|
+
* `makeTest` requires `Path` to normalize the `stopAt` ceiling; this layer
|
|
16755
|
+
* supplies core's `Path.layer` internally, so the requirement never reaches a
|
|
16756
|
+
* consumer — the published type stays `Layer.Layer<WorkspaceRoot>`.
|
|
16757
|
+
*
|
|
16758
|
+
* A parameterized layer factory mints a **fresh reference per call**, and
|
|
16759
|
+
* layers memoize by reference — bind the result to a `const` and reuse it
|
|
16760
|
+
* rather than calling `layerTest(...)` at each composition site.
|
|
16761
|
+
*
|
|
16762
|
+
* Pair it with `WorkspaceDiscovery.layerTest` to stand up the whole discovery
|
|
16763
|
+
* path without a filesystem; between them there is nothing left for a
|
|
16764
|
+
* module-level mock of `@effected/workspaces` to do, and a provided layer
|
|
16765
|
+
* keeps the service graph — and its typed errors — intact.
|
|
16766
|
+
*
|
|
16767
|
+
* @example
|
|
16768
|
+
* ```ts
|
|
16769
|
+
* import { WorkspaceDiscovery, WorkspaceRoot } from "@effected/workspaces";
|
|
16770
|
+
* import { Effect } from "effect";
|
|
16771
|
+
*
|
|
16772
|
+
* const TestRoot = WorkspaceRoot.layerTest("/repo");
|
|
16773
|
+
* const TestDiscovery = WorkspaceDiscovery.layerTest({
|
|
16774
|
+
* listPackages: () => Effect.succeed([]),
|
|
16775
|
+
* });
|
|
16776
|
+
* // program.pipe(Effect.provide(TestRoot), Effect.provide(TestDiscovery))
|
|
16777
|
+
* ```
|
|
16778
|
+
*/
|
|
16779
|
+
static layerTest = (root) => effect.Layer.effect(WorkspaceRoot, WorkspaceRoot.makeTest(root)).pipe(effect.Layer.provide(effect.Path.layer));
|
|
15975
16780
|
};
|
|
15976
16781
|
//#endregion
|
|
15977
|
-
//#region ../../node_modules/.pnpm/@effected+workspaces@0.
|
|
16782
|
+
//#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
|
|
15978
16783
|
/**
|
|
15979
16784
|
* Hard ceiling on directories the enumerator will visit for one pattern set.
|
|
15980
16785
|
* Guards the pathological case a depth cap alone does not: a wide, shallow
|
|
@@ -15992,7 +16797,7 @@ const MAX_ENUMERATION_ENTRIES = 1e5;
|
|
|
15992
16797
|
*/
|
|
15993
16798
|
const PRUNED_DIRECTORIES = /* @__PURE__ */ new Set([".git", "node_modules"]);
|
|
15994
16799
|
//#endregion
|
|
15995
|
-
//#region ../../node_modules/.pnpm/@effected+workspaces@0.
|
|
16800
|
+
//#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
|
|
15996
16801
|
/** Directory names never descended into. */
|
|
15997
16802
|
const isPruned = (entry) => PRUNED_DIRECTORIES.has(entry);
|
|
15998
16803
|
/** Join root-relative POSIX segments; `""` is the root itself. */
|
|
@@ -16082,7 +16887,7 @@ var Traversal = class {
|
|
|
16082
16887
|
}
|
|
16083
16888
|
};
|
|
16084
16889
|
//#endregion
|
|
16085
|
-
//#region ../../node_modules/.pnpm/@effected+workspaces@0.
|
|
16890
|
+
//#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
|
|
16086
16891
|
/** Strip a trailing slash from `GlobPattern.enumerationPrefix` to get a relative directory. */
|
|
16087
16892
|
const baseOf = (pattern) => pattern.enumerationPrefix.replace(/\/$/, "");
|
|
16088
16893
|
/**
|
|
@@ -16152,7 +16957,7 @@ const enumerate = (root, globs, options) => effect.Effect.gen(function* () {
|
|
|
16152
16957
|
return results;
|
|
16153
16958
|
});
|
|
16154
16959
|
//#endregion
|
|
16155
|
-
//#region ../../node_modules/.pnpm/@effected+workspaces@0.
|
|
16960
|
+
//#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
|
|
16156
16961
|
const stringsOf = (value) => Array.isArray(value) ? value.filter((entry) => typeof entry === "string") : void 0;
|
|
16157
16962
|
/** The `packages:` list of a `pnpm-workspace.yaml` document. Total on a parsed document. */
|
|
16158
16963
|
const pnpmPatternsOf = (document) => {
|
|
@@ -16209,7 +17014,7 @@ const readPatterns = (root) => effect.Effect.gen(function* () {
|
|
|
16209
17014
|
return manifestPatternsOf(manifest);
|
|
16210
17015
|
});
|
|
16211
17016
|
//#endregion
|
|
16212
|
-
//#region ../../node_modules/.pnpm/@effected+workspaces@0.
|
|
17017
|
+
//#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
|
|
16213
17018
|
/**
|
|
16214
17019
|
* Raised when a workspace member's `package.json` cannot be read, parsed, or
|
|
16215
17020
|
* used — it is missing, malformed, or lacks a `name` or `version`.
|
|
@@ -16387,6 +17192,7 @@ var WorkspaceDiscovery = class WorkspaceDiscovery extends effect.Context.Service
|
|
|
16387
17192
|
path: directory,
|
|
16388
17193
|
packageJsonPath,
|
|
16389
17194
|
relativePath,
|
|
17195
|
+
workspaceRoot: root,
|
|
16390
17196
|
manifestRecord: raw,
|
|
16391
17197
|
...typeof raw.private === "boolean" ? { private: raw.private } : {},
|
|
16392
17198
|
...isStringRecord$2(raw.dependencies) ? { dependencies: raw.dependencies } : {},
|
|
@@ -16544,6 +17350,7 @@ var WorkspaceDiscovery = class WorkspaceDiscovery extends effect.Context.Service
|
|
|
16544
17350
|
* path: "/repo/packages/utils",
|
|
16545
17351
|
* packageJsonPath: "/repo/packages/utils/package.json",
|
|
16546
17352
|
* relativePath: "packages/utils",
|
|
17353
|
+
* workspaceRoot: "/repo",
|
|
16547
17354
|
* }),
|
|
16548
17355
|
* ]),
|
|
16549
17356
|
* });
|
|
@@ -16641,7 +17448,7 @@ var WorkspaceDiscovery = class WorkspaceDiscovery extends effect.Context.Service
|
|
|
16641
17448
|
};
|
|
16642
17449
|
const isStringRecord$2 = (value) => value !== null && typeof value === "object" && !Array.isArray(value) && Object.values(value).every((entry) => typeof entry === "string");
|
|
16643
17450
|
//#endregion
|
|
16644
|
-
//#region ../../node_modules/.pnpm/@effected+workspaces@0.
|
|
17451
|
+
//#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
|
|
16645
17452
|
/**
|
|
16646
17453
|
* Raised when the workspace dependency graph cannot be topologically ordered
|
|
16647
17454
|
* because it contains a cycle.
|
|
@@ -16876,7 +17683,7 @@ const kahn = (edges) => {
|
|
|
16876
17683
|
};
|
|
16877
17684
|
};
|
|
16878
17685
|
//#endregion
|
|
16879
|
-
//#region ../../node_modules/.pnpm/@effected+git@0.4.
|
|
17686
|
+
//#region ../../node_modules/.pnpm/@effected+git@0.4.1_effect@4.0.0-beta.99/node_modules/@effected/git/GitCommand.js
|
|
16880
17687
|
/**
|
|
16881
17688
|
* Builds a `git` `ChildProcess.StandardCommand` with the argv this package
|
|
16882
17689
|
* classifies against.
|
|
@@ -17295,7 +18102,7 @@ const GitCommand = {
|
|
|
17295
18102
|
status
|
|
17296
18103
|
};
|
|
17297
18104
|
//#endregion
|
|
17298
|
-
//#region ../../node_modules/.pnpm/@effected+git@0.4.
|
|
18105
|
+
//#region ../../node_modules/.pnpm/@effected+git@0.4.1_effect@4.0.0-beta.99/node_modules/@effected/git/internal/run.js
|
|
17299
18106
|
/**
|
|
17300
18107
|
* Spawns `command` and collects its stdout, stderr, and exit code as a single
|
|
17301
18108
|
* triple.
|
|
@@ -17322,7 +18129,7 @@ const runCollected = (command) => effect.Effect.scoped(effect.Effect.gen(functio
|
|
|
17322
18129
|
};
|
|
17323
18130
|
}));
|
|
17324
18131
|
//#endregion
|
|
17325
|
-
//#region ../../node_modules/.pnpm/@effected+git@0.4.
|
|
18132
|
+
//#region ../../node_modules/.pnpm/@effected+git@0.4.1_effect@4.0.0-beta.99/node_modules/@effected/git/Git.js
|
|
17326
18133
|
/** git's own ceiling: a run that has not answered in 30s is not going to. */
|
|
17327
18134
|
const GIT_TIMEOUT = effect.Duration.seconds(30);
|
|
17328
18135
|
/**
|
|
@@ -17334,7 +18141,7 @@ const GIT_TIMEOUT = effect.Duration.seconds(30);
|
|
|
17334
18141
|
* `exitCode` and `stderr` are populated when git actually ran. `detail`
|
|
17335
18142
|
* carries a human-readable explanation of an absorbed spawn-level
|
|
17336
18143
|
* `PlatformError` or a per-run timeout — the two cases where git never
|
|
17337
|
-
* produced an exit code at all.
|
|
18144
|
+
* produced an exit code at all. `kind`
|
|
17338
18145
|
* discriminates a pre-spawn guard rejection (`"refused"`) from a genuine git
|
|
17339
18146
|
* failure (`"failed"`) structurally, so composed retry/fallback logic never has
|
|
17340
18147
|
* to parse the prose in `message` or `detail`.
|
|
@@ -18239,7 +19046,7 @@ var Git = class extends effect.Context.Service()("@effected/git/Git") {
|
|
|
18239
19046
|
}));
|
|
18240
19047
|
};
|
|
18241
19048
|
//#endregion
|
|
18242
|
-
//#region ../../node_modules/.pnpm/@effected+workspaces@0.
|
|
19049
|
+
//#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
|
|
18243
19050
|
/**
|
|
18244
19051
|
* Which git refs to compare, and whether to fold in the working tree.
|
|
18245
19052
|
*
|
|
@@ -18491,7 +19298,7 @@ function resolveFromCatalog(catalogs, wantedDependency) {
|
|
|
18491
19298
|
};
|
|
18492
19299
|
}
|
|
18493
19300
|
//#endregion
|
|
18494
|
-
//#region ../../node_modules/.pnpm/@effected+workspaces@0.
|
|
19301
|
+
//#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
|
|
18495
19302
|
/** Project a pnpm-workspace manifest's `catalog` / `catalogs` fields into a `Catalogs` map. */
|
|
18496
19303
|
const inlineCatalogs = (manifest) => {
|
|
18497
19304
|
if (manifest.catalog === void 0 && manifest.catalogs === void 0) return {};
|
|
@@ -18555,7 +19362,7 @@ const rangeOf = (catalogs, dependency, specifier) => {
|
|
|
18555
19362
|
});
|
|
18556
19363
|
};
|
|
18557
19364
|
//#endregion
|
|
18558
|
-
//#region ../../node_modules/.pnpm/@effected+workspaces@0.
|
|
19365
|
+
//#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
|
|
18559
19366
|
/** Whether `value` is a non-null, non-array object. */
|
|
18560
19367
|
const isObject$2 = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
18561
19368
|
/**
|
|
@@ -18649,9 +19456,13 @@ var ConfigDependencyHooks = class ConfigDependencyHooks extends effect.Context.S
|
|
|
18649
19456
|
* `hooks`-source `CatalogAssemblyError`, never a silent skip.
|
|
18650
19457
|
*
|
|
18651
19458
|
* @remarks
|
|
18652
|
-
*
|
|
18653
|
-
*
|
|
18654
|
-
*
|
|
19459
|
+
* Runtime-coupled by design, not node-exclusive. The `import()` below loads
|
|
19460
|
+
* **and executes** a config dependency's pnpmfile in-process — code execution,
|
|
19461
|
+
* not IO, so no `FileSystem` / `Path` service abstracts it. The `node:path` and
|
|
19462
|
+
* `node:url` imports (`join`, `pathToFileURL`) exist only to build the URL that
|
|
19463
|
+
* `import()` consumes; node and bun both implement those builtins and dynamic
|
|
19464
|
+
* import, so this layer runs on either runtime. Only ever wired by
|
|
19465
|
+
* `WorkspaceCatalogs.layerWithConfigDependencies`.
|
|
18655
19466
|
*/
|
|
18656
19467
|
static layerLive = effect.Layer.succeed(ConfigDependencyHooks, { inject: (root, configDependencies, seed) => effect.Effect.gen(function* () {
|
|
18657
19468
|
const names = Object.keys(configDependencies);
|
|
@@ -18700,7 +19511,7 @@ var ConfigDependencyHooks = class ConfigDependencyHooks extends effect.Context.S
|
|
|
18700
19511
|
}) });
|
|
18701
19512
|
};
|
|
18702
19513
|
//#endregion
|
|
18703
|
-
//#region ../../node_modules/.pnpm/@effected+workspaces@0.
|
|
19514
|
+
//#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
|
|
18704
19515
|
/**
|
|
18705
19516
|
* The four package managers this package understands.
|
|
18706
19517
|
*
|
|
@@ -18942,7 +19753,7 @@ var PackageManagerDetector = class PackageManagerDetector extends effect.Context
|
|
|
18942
19753
|
static layer = effect.Layer.effect(PackageManagerDetector, PackageManagerDetector.make);
|
|
18943
19754
|
};
|
|
18944
19755
|
//#endregion
|
|
18945
|
-
//#region ../../node_modules/.pnpm/@effected+workspaces@0.
|
|
19756
|
+
//#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
|
|
18946
19757
|
/**
|
|
18947
19758
|
* Raised when the workspace's lockfile cannot be read off disk.
|
|
18948
19759
|
*
|
|
@@ -19052,7 +19863,7 @@ var LockfileReader = class LockfileReader extends effect.Context.Service()("@eff
|
|
|
19052
19863
|
static layer = (options) => effect.Layer.effect(LockfileReader, LockfileReader.make(options));
|
|
19053
19864
|
};
|
|
19054
19865
|
//#endregion
|
|
19055
|
-
//#region ../../node_modules/.pnpm/@effected+workspaces@0.
|
|
19866
|
+
//#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
|
|
19056
19867
|
/** The public npm registry, used when `publishConfig.registry` says nothing. */
|
|
19057
19868
|
const DEFAULT_REGISTRY = "https://registry.npmjs.org/";
|
|
19058
19869
|
/**
|
|
@@ -19152,7 +19963,7 @@ var PublishabilityDetector = class PublishabilityDetector extends effect.Context
|
|
|
19152
19963
|
}) });
|
|
19153
19964
|
};
|
|
19154
19965
|
//#endregion
|
|
19155
|
-
//#region ../../node_modules/.pnpm/@effected+workspaces@0.
|
|
19966
|
+
//#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
|
|
19156
19967
|
/**
|
|
19157
19968
|
* An immutable, fully-normalized catalog collection — the one catalog
|
|
19158
19969
|
* resolution semantic in the package.
|
|
@@ -19536,7 +20347,7 @@ var WorkspaceCatalogs = class WorkspaceCatalogs extends effect.Context.Service()
|
|
|
19536
20347
|
}));
|
|
19537
20348
|
};
|
|
19538
20349
|
//#endregion
|
|
19539
|
-
//#region ../../node_modules/.pnpm/@effected+workspaces@0.
|
|
20350
|
+
//#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
|
|
19540
20351
|
const EMPTY = Object.freeze(Object.create(null));
|
|
19541
20352
|
const DependencyMap = effect.Schema.Record(effect.Schema.String, effect.Schema.String).pipe(effect.Schema.withDecodingDefaultKey(effect.Effect.succeed(EMPTY)), effect.Schema.withConstructorDefault(effect.Effect.succeed(EMPTY)));
|
|
19542
20353
|
/**
|
|
@@ -19701,7 +20512,7 @@ var WorkspaceStateSnapshot = class extends effect.Schema.Class("WorkspaceStateSn
|
|
|
19701
20512
|
}
|
|
19702
20513
|
};
|
|
19703
20514
|
//#endregion
|
|
19704
|
-
//#region ../../node_modules/.pnpm/@effected+workspaces@0.
|
|
20515
|
+
//#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
|
|
19705
20516
|
/** Whether `value` is a non-null, non-array object. */
|
|
19706
20517
|
const isObject = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
19707
20518
|
/** Whether every value in a record is a string — a usable dependency map. */
|
|
@@ -19893,7 +20704,7 @@ var WorkspaceSnapshots = class WorkspaceSnapshots extends effect.Context.Service
|
|
|
19893
20704
|
static layer = (options) => effect.Layer.effect(WorkspaceSnapshots, WorkspaceSnapshots.make(options));
|
|
19894
20705
|
};
|
|
19895
20706
|
//#endregion
|
|
19896
|
-
//#region ../../node_modules/.pnpm/@effected+workspaces@0.
|
|
20707
|
+
//#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
|
|
19897
20708
|
/**
|
|
19898
20709
|
* Every service that needs only a filesystem: root, package-manager detection,
|
|
19899
20710
|
* discovery, lockfile reading, catalogs and publishability.
|
|
@@ -20261,34 +21072,15 @@ effect.Layer.effect(PublishabilityDetector, effect.Effect.gen(function* () {
|
|
|
20261
21072
|
}) };
|
|
20262
21073
|
}));
|
|
20263
21074
|
/**
|
|
20264
|
-
* The workspace root a package was discovered against, derived from its own
|
|
20265
|
-
* coordinates: `relativePath` is the package directory relative to the
|
|
20266
|
-
* discovery root (POSIX, `"."` for the root package), so ascending one level
|
|
20267
|
-
* per path segment from `pkg.path` lands exactly on that root.
|
|
20268
|
-
*
|
|
20269
|
-
* @remarks
|
|
20270
|
-
* Derivation is deliberate — probing the filesystem for workspace markers
|
|
20271
|
-
* (`WorkspaceRoot.find`) can walk PAST the intended root when that root
|
|
20272
|
-
* carries no marker (a fixture tree, a bare directory) and land on an
|
|
20273
|
-
* enclosing workspace, silently swapping in that outer root's
|
|
20274
|
-
* `.changeset/config.json` and dropping the ignore/mode gating (the #209
|
|
20275
|
-
* regression class). The discovery root needs no probing: whoever built the
|
|
20276
|
-
* `WorkspacePackage` already knew it.
|
|
20277
|
-
*/
|
|
20278
|
-
const packageRoot = (pkg) => {
|
|
20279
|
-
const segments = pkg.relativePath.split("/").filter((segment) => segment !== "" && segment !== ".");
|
|
20280
|
-
return segments.length === 0 ? pkg.path : (0, node_path.join)(pkg.path, ...segments.map(() => ".."));
|
|
20281
|
-
};
|
|
20282
|
-
/**
|
|
20283
21075
|
* Ignore-aware override of `PublishabilityDetector`. `detect` short-circuits to `[]`
|
|
20284
21076
|
* for changeset-ignored packages, then dispatches on `ChangesetConfig.mode`:
|
|
20285
21077
|
* `none` → `[]`; `silk` → `SilkPublishability.detect`; `vanilla` → the library default.
|
|
20286
21078
|
*
|
|
20287
21079
|
* @remarks Requires `FileSystem` and {@link ChangesetConfig} at build.
|
|
20288
21080
|
* The kit's `detect` contract no longer receives the workspace root, so the changeset
|
|
20289
|
-
* lookups
|
|
20290
|
-
*
|
|
20291
|
-
*
|
|
21081
|
+
* lookups read it from `pkg.workspaceRoot` — the discovery root the package was found
|
|
21082
|
+
* against, never a filesystem marker walk, which could escape an unmarked root and read
|
|
21083
|
+
* the wrong `.changeset/config.json`.
|
|
20292
21084
|
*
|
|
20293
21085
|
* @since 0.4.0
|
|
20294
21086
|
* @public
|
|
@@ -20298,7 +21090,7 @@ const PublishabilityDetectorAdaptiveLive = effect.Layer.effect(PublishabilityDet
|
|
|
20298
21090
|
const config = yield* ChangesetConfig;
|
|
20299
21091
|
const vanilla = yield* effect.Effect.provide(PublishabilityDetector, PublishabilityDetector.layer);
|
|
20300
21092
|
return { detect: (pkg) => effect.Effect.gen(function* () {
|
|
20301
|
-
const root =
|
|
21093
|
+
const root = pkg.workspaceRoot;
|
|
20302
21094
|
if (yield* config.isIgnored(pkg.name, root)) return [];
|
|
20303
21095
|
const mode = yield* config.mode(root);
|
|
20304
21096
|
if (mode === "none") return [];
|
|
@@ -21670,7 +22462,7 @@ function validateChangesetOptions(input) {
|
|
|
21670
22462
|
})));
|
|
21671
22463
|
}
|
|
21672
22464
|
//#endregion
|
|
21673
|
-
//#region ../../node_modules/.pnpm/@changesets+get-github-info@1.0.0-next.
|
|
22465
|
+
//#region ../../node_modules/.pnpm/@changesets+get-github-info@1.0.0-next.4/node_modules/@changesets/get-github-info/dist/index.mjs
|
|
21674
22466
|
var import_dataloader = /* @__PURE__ */ __toESM((/* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
21675
22467
|
/**
|
|
21676
22468
|
* Copyright (c) 2019-present, GraphQL Foundation
|
|
@@ -23424,7 +24216,7 @@ function normalizeIdentifier(value) {
|
|
|
23424
24216
|
return value.replace(/[\t\n\r ]+/g, " ").replace(/^ | $/g, "").toLowerCase().toUpperCase();
|
|
23425
24217
|
}
|
|
23426
24218
|
//#endregion
|
|
23427
|
-
//#region ../../node_modules/.pnpm/mdast-util-gfm-footnote@2.1.
|
|
24219
|
+
//#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
|
|
23428
24220
|
/**
|
|
23429
24221
|
* @import {
|
|
23430
24222
|
* CompileContext,
|
|
@@ -23616,7 +24408,7 @@ function mapAll(line, index, blank) {
|
|
|
23616
24408
|
return (blank ? "" : " ") + line;
|
|
23617
24409
|
}
|
|
23618
24410
|
//#endregion
|
|
23619
|
-
//#region ../../node_modules/.pnpm/mdast-util-gfm-strikethrough@2.0.
|
|
24411
|
+
//#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
|
|
23620
24412
|
/**
|
|
23621
24413
|
* @typedef {import('mdast').Delete} Delete
|
|
23622
24414
|
*
|
|
@@ -28667,7 +29459,7 @@ function safeBound(value, config) {
|
|
|
28667
29459
|
return safe(this, value, config);
|
|
28668
29460
|
}
|
|
28669
29461
|
//#endregion
|
|
28670
|
-
//#region ../../node_modules/.pnpm/mdast-util-gfm-table@2.0.
|
|
29462
|
+
//#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
|
|
28671
29463
|
/**
|
|
28672
29464
|
* @typedef {import('mdast').InlineCode} InlineCode
|
|
28673
29465
|
* @typedef {import('mdast').Table} Table
|
|
@@ -28931,7 +29723,7 @@ function gfmTableToMarkdown(options) {
|
|
|
28931
29723
|
}
|
|
28932
29724
|
}
|
|
28933
29725
|
//#endregion
|
|
28934
|
-
//#region ../../node_modules/.pnpm/mdast-util-gfm-task-list-item@2.0.
|
|
29726
|
+
//#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
|
|
28935
29727
|
/**
|
|
28936
29728
|
* @typedef {import('mdast').ListItem} ListItem
|
|
28937
29729
|
* @typedef {import('mdast').Paragraph} Paragraph
|
|
@@ -29041,7 +29833,7 @@ function listItemWithTaskListItem(node, parent, state, info) {
|
|
|
29041
29833
|
}
|
|
29042
29834
|
}
|
|
29043
29835
|
//#endregion
|
|
29044
|
-
//#region ../../node_modules/.pnpm/mdast-util-gfm@3.1.
|
|
29836
|
+
//#region ../../node_modules/.pnpm/mdast-util-gfm@3.1.0_supports-color@8.1.1/node_modules/mdast-util-gfm/lib/index.js
|
|
29045
29837
|
/**
|
|
29046
29838
|
* @import {Extension as FromMarkdownExtension} from 'mdast-util-from-markdown'
|
|
29047
29839
|
* @import {Options} from 'mdast-util-gfm'
|
|
@@ -37125,7 +37917,7 @@ function gfm(options) {
|
|
|
37125
37917
|
]);
|
|
37126
37918
|
}
|
|
37127
37919
|
//#endregion
|
|
37128
|
-
//#region ../../node_modules/.pnpm/remark-gfm@4.0.1/node_modules/remark-gfm/lib/index.js
|
|
37920
|
+
//#region ../../node_modules/.pnpm/remark-gfm@4.0.1_supports-color@8.1.1/node_modules/remark-gfm/lib/index.js
|
|
37129
37921
|
/**
|
|
37130
37922
|
* @import {Root} from 'mdast'
|
|
37131
37923
|
* @import {Options} from 'remark-gfm'
|
|
@@ -37156,7 +37948,7 @@ function remarkGfm(options) {
|
|
|
37156
37948
|
toMarkdownExtensions.push(gfmToMarkdown(settings));
|
|
37157
37949
|
}
|
|
37158
37950
|
//#endregion
|
|
37159
|
-
//#region ../../node_modules/.pnpm/micromark@4.0.
|
|
37951
|
+
//#region ../../node_modules/.pnpm/micromark@4.0.2_supports-color@8.1.1/node_modules/micromark/lib/initialize/content.js
|
|
37160
37952
|
/**
|
|
37161
37953
|
* @import {
|
|
37162
37954
|
* InitialConstruct,
|
|
@@ -37223,7 +38015,7 @@ function initializeContent(effects) {
|
|
|
37223
38015
|
}
|
|
37224
38016
|
}
|
|
37225
38017
|
//#endregion
|
|
37226
|
-
//#region ../../node_modules/.pnpm/micromark@4.0.
|
|
38018
|
+
//#region ../../node_modules/.pnpm/micromark@4.0.2_supports-color@8.1.1/node_modules/micromark/lib/initialize/document.js
|
|
37227
38019
|
/**
|
|
37228
38020
|
* @import {
|
|
37229
38021
|
* Construct,
|
|
@@ -37439,7 +38231,7 @@ function tokenizeContainer(effects, ok, nok) {
|
|
|
37439
38231
|
return factorySpace(effects, effects.attempt(this.parser.constructs.document, ok, nok), "linePrefix", this.parser.constructs.disable.null.includes("codeIndented") ? void 0 : 4);
|
|
37440
38232
|
}
|
|
37441
38233
|
//#endregion
|
|
37442
|
-
//#region ../../node_modules/.pnpm/micromark@4.0.
|
|
38234
|
+
//#region ../../node_modules/.pnpm/micromark@4.0.2_supports-color@8.1.1/node_modules/micromark/lib/initialize/flow.js
|
|
37443
38235
|
/**
|
|
37444
38236
|
* @import {
|
|
37445
38237
|
* InitialConstruct,
|
|
@@ -37486,7 +38278,7 @@ function initializeFlow(effects) {
|
|
|
37486
38278
|
}
|
|
37487
38279
|
}
|
|
37488
38280
|
//#endregion
|
|
37489
|
-
//#region ../../node_modules/.pnpm/micromark@4.0.
|
|
38281
|
+
//#region ../../node_modules/.pnpm/micromark@4.0.2_supports-color@8.1.1/node_modules/micromark/lib/initialize/text.js
|
|
37490
38282
|
/**
|
|
37491
38283
|
* @import {
|
|
37492
38284
|
* Code,
|
|
@@ -37663,7 +38455,7 @@ function resolveAllLineSuffixes(events, context) {
|
|
|
37663
38455
|
return events;
|
|
37664
38456
|
}
|
|
37665
38457
|
//#endregion
|
|
37666
|
-
//#region ../../node_modules/.pnpm/micromark@4.0.
|
|
38458
|
+
//#region ../../node_modules/.pnpm/micromark@4.0.2_supports-color@8.1.1/node_modules/micromark/lib/constructs.js
|
|
37667
38459
|
/**
|
|
37668
38460
|
* @import {Extension} from 'micromark-util-types'
|
|
37669
38461
|
*/
|
|
@@ -37741,7 +38533,7 @@ const attentionMarkers = { null: [42, 95] };
|
|
|
37741
38533
|
/** @satisfies {Extension['disable']} */
|
|
37742
38534
|
const disable = { null: [] };
|
|
37743
38535
|
//#endregion
|
|
37744
|
-
//#region ../../node_modules/.pnpm/micromark@4.0.
|
|
38536
|
+
//#region ../../node_modules/.pnpm/micromark@4.0.2_supports-color@8.1.1/node_modules/micromark/lib/create-tokenizer.js
|
|
37745
38537
|
/**
|
|
37746
38538
|
* @import {
|
|
37747
38539
|
* Chunk,
|
|
@@ -38210,7 +39002,7 @@ function serializeChunks(chunks, expandTabs) {
|
|
|
38210
39002
|
return result.join("");
|
|
38211
39003
|
}
|
|
38212
39004
|
//#endregion
|
|
38213
|
-
//#region ../../node_modules/.pnpm/micromark@4.0.
|
|
39005
|
+
//#region ../../node_modules/.pnpm/micromark@4.0.2_supports-color@8.1.1/node_modules/micromark/lib/parse.js
|
|
38214
39006
|
/**
|
|
38215
39007
|
* @import {
|
|
38216
39008
|
* Create,
|
|
@@ -38254,7 +39046,7 @@ function parse$1(options) {
|
|
|
38254
39046
|
}
|
|
38255
39047
|
}
|
|
38256
39048
|
//#endregion
|
|
38257
|
-
//#region ../../node_modules/.pnpm/micromark@4.0.
|
|
39049
|
+
//#region ../../node_modules/.pnpm/micromark@4.0.2_supports-color@8.1.1/node_modules/micromark/lib/postprocess.js
|
|
38258
39050
|
/**
|
|
38259
39051
|
* @import {Event} from 'micromark-util-types'
|
|
38260
39052
|
*/
|
|
@@ -38269,7 +39061,7 @@ function postprocess(events) {
|
|
|
38269
39061
|
return events;
|
|
38270
39062
|
}
|
|
38271
39063
|
//#endregion
|
|
38272
|
-
//#region ../../node_modules/.pnpm/micromark@4.0.
|
|
39064
|
+
//#region ../../node_modules/.pnpm/micromark@4.0.2_supports-color@8.1.1/node_modules/micromark/lib/preprocess.js
|
|
38273
39065
|
/**
|
|
38274
39066
|
* @import {Chunk, Code, Encoding, Value} from 'micromark-util-types'
|
|
38275
39067
|
*/
|
|
@@ -38434,7 +39226,7 @@ function index(value) {
|
|
|
38434
39226
|
return value && typeof value === "number" ? value : 1;
|
|
38435
39227
|
}
|
|
38436
39228
|
//#endregion
|
|
38437
|
-
//#region ../../node_modules/.pnpm/mdast-util-from-markdown@2.0.
|
|
39229
|
+
//#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
|
|
38438
39230
|
/**
|
|
38439
39231
|
* @import {
|
|
38440
39232
|
* Break,
|
|
@@ -39400,7 +40192,7 @@ function defaultOnError(left, right) {
|
|
|
39400
40192
|
}) + ") is still open");
|
|
39401
40193
|
}
|
|
39402
40194
|
//#endregion
|
|
39403
|
-
//#region ../../node_modules/.pnpm/remark-parse@11.0.
|
|
40195
|
+
//#region ../../node_modules/.pnpm/remark-parse@11.0.0_supports-color@8.1.1/node_modules/remark-parse/lib/index.js
|
|
39404
40196
|
/**
|
|
39405
40197
|
* @typedef {import('mdast').Root} Root
|
|
39406
40198
|
* @typedef {import('mdast-util-from-markdown').Options} FromMarkdownOptions
|
|
@@ -44871,25 +45663,15 @@ function normalizeLegacyOptions(options, configPath) {
|
|
|
44871
45663
|
};
|
|
44872
45664
|
}
|
|
44873
45665
|
/** Match dotfiles, mirroring the former tinyglobby `dot: true` behavior. */
|
|
44874
|
-
const GLOB_OPTIONS = GlobPatternOptions.make({ dot: true });
|
|
45666
|
+
const GLOB_OPTIONS$1 = GlobPatternOptions.make({ dot: true });
|
|
44875
45667
|
/**
|
|
44876
|
-
* Compile `glob` via `@effected/glob`, folding a compile-guard trip
|
|
44877
|
-
* (over-length pattern, brace-expansion budget, nesting depth) into a
|
|
44878
|
-
* {@link ConfigurationError} naming the offending glob on the typed channel.
|
|
44879
|
-
*/
|
|
44880
|
-
function compileGlob(glob) {
|
|
44881
|
-
return GlobPattern.compile(glob, GLOB_OPTIONS).pipe(effect.Effect.mapError((error) => new ConfigurationError({
|
|
44882
|
-
field: "glob",
|
|
44883
|
-
reason: `Invalid glob pattern ${JSON.stringify(glob)}: ${error.message}`
|
|
44884
|
-
})));
|
|
44885
|
-
}
|
|
44886
45668
|
/**
|
|
44887
45669
|
* Pure attribution helper: does `glob` (under this service's `dot: true`
|
|
44888
45670
|
* semantics) match the repo-relative POSIX path `rel`? An uncompilable
|
|
44889
45671
|
* pattern matches nothing.
|
|
44890
45672
|
*/
|
|
44891
45673
|
function globMatchesRel(glob, rel) {
|
|
44892
|
-
const result =
|
|
45674
|
+
const result = GlobPattern.compileResult(glob, GLOB_OPTIONS$1);
|
|
44893
45675
|
return effect.Result.isSuccess(result) && result.success.matches(rel);
|
|
44894
45676
|
}
|
|
44895
45677
|
/**
|
|
@@ -44905,13 +45687,14 @@ function globMatchesRel(glob, rel) {
|
|
|
44905
45687
|
* module already speaks POSIX-relative match paths).
|
|
44906
45688
|
*/
|
|
44907
45689
|
function materializeGlob(glob, cwd) {
|
|
44908
|
-
return
|
|
45690
|
+
return compileAndExpand(glob, {
|
|
44909
45691
|
cwd,
|
|
44910
|
-
onUnreadable: "skip"
|
|
45692
|
+
onUnreadable: "skip",
|
|
45693
|
+
glob: GLOB_OPTIONS$1
|
|
44911
45694
|
}).pipe(effect.Effect.mapError((error) => new ConfigurationError({
|
|
44912
45695
|
field: "glob",
|
|
44913
|
-
reason: `Failed to materialize glob ${JSON.stringify(glob)}: ${error.message}`
|
|
44914
|
-
})), effect.Effect.provide(effect.Path.layer))
|
|
45696
|
+
reason: error.stage === "compile" ? `Invalid glob pattern ${JSON.stringify(glob)}: ${error.cause.message}` : `Failed to materialize glob ${JSON.stringify(glob)}: ${error.cause.message}`
|
|
45697
|
+
})), effect.Effect.provide(effect.Path.layer));
|
|
44915
45698
|
}
|
|
44916
45699
|
/**
|
|
44917
45700
|
* Determine whether `child` is the same directory as `parent` or sits inside
|
|
@@ -46613,19 +47396,29 @@ var VersionFiles = class VersionFiles {
|
|
|
46613
47396
|
}
|
|
46614
47397
|
};
|
|
46615
47398
|
/**
|
|
47399
|
+
* Match dotfiles, matching `ConfigInspector`'s glob dialect.
|
|
47400
|
+
*
|
|
47401
|
+
* @remarks
|
|
47402
|
+
* This module previously compiled with minimatch DEFAULTS while
|
|
47403
|
+
* `ConfigInspector` compiled with `dot: true`, so a wildcard segment matching
|
|
47404
|
+
* a dotted directory was attributed to a package but never materialized (or
|
|
47405
|
+
* the reverse). The two paths must agree: attribution and materialization
|
|
47406
|
+
* answer the same question about the same glob.
|
|
47407
|
+
*/
|
|
47408
|
+
const GLOB_OPTIONS = GlobPatternOptions.make({ dot: true });
|
|
47409
|
+
/**
|
|
46616
47410
|
* Expand a glob pattern against the filesystem, returning matching FILE paths
|
|
46617
47411
|
* relative to `cwd` (POSIX separators), sorted by relative path.
|
|
46618
47412
|
*
|
|
46619
47413
|
* @remarks
|
|
46620
|
-
* The walk is `@effected/walker`'s `
|
|
47414
|
+
* The walk is `@effected/walker`'s `compileAndExpand` (literal fast path,
|
|
46621
47415
|
* `enumerationPrefix` bounding, `node_modules`/`.git` pruning), with
|
|
46622
47416
|
* `onUnreadable: "skip"` preserving this module's silent-skip policy for
|
|
46623
|
-
* unreadable directories. Matching semantics are
|
|
46624
|
-
*
|
|
46625
|
-
*
|
|
46626
|
-
*
|
|
46627
|
-
*
|
|
46628
|
-
* paths and node-bound absolute paths throughout.
|
|
47417
|
+
* unreadable directories. Matching semantics are {@link GLOB_OPTIONS} —
|
|
47418
|
+
* wildcards DO match dotfiles, aligning this module with `ConfigInspector`. An
|
|
47419
|
+
* uncompilable pattern expands to no matches. The `Path` requirement is
|
|
47420
|
+
* satisfied internally with the core POSIX `Path.layer` — this module already
|
|
47421
|
+
* speaks POSIX relative match paths and node-bound absolute paths throughout.
|
|
46629
47422
|
*
|
|
46630
47423
|
* @param source - The glob pattern, repo-relative
|
|
46631
47424
|
* @param cwd - Absolute directory the pattern is resolved against
|
|
@@ -46634,13 +47427,11 @@ var VersionFiles = class VersionFiles {
|
|
|
46634
47427
|
* @internal
|
|
46635
47428
|
*/
|
|
46636
47429
|
function expandGlob(source, cwd) {
|
|
46637
|
-
return
|
|
46638
|
-
|
|
46639
|
-
|
|
46640
|
-
|
|
46641
|
-
|
|
46642
|
-
})
|
|
46643
|
-
})), effect.Effect.provide(effect.Path.layer));
|
|
47430
|
+
return compileAndExpand(source, {
|
|
47431
|
+
cwd,
|
|
47432
|
+
onUnreadable: "skip",
|
|
47433
|
+
glob: GLOB_OPTIONS
|
|
47434
|
+
}).pipe(effect.Effect.catch((error) => error.stage === "compile" ? effect.Effect.succeed([]) : effect.Effect.fail(error)), effect.Effect.provide(effect.Path.layer));
|
|
46644
47435
|
}
|
|
46645
47436
|
/**
|
|
46646
47437
|
* Read the `version` field from a `package.json` in the given directory.
|
|
@@ -57681,7 +58472,7 @@ function validatePackages(packages) {
|
|
|
57681
58472
|
}
|
|
57682
58473
|
}
|
|
57683
58474
|
//#endregion
|
|
57684
|
-
//#region ../../node_modules/.pnpm/@changesets+get-dependents-graph@3.0.0-next.
|
|
58475
|
+
//#region ../../node_modules/.pnpm/@changesets+get-dependents-graph@3.0.0-next.7/node_modules/@changesets/get-dependents-graph/dist/index.mjs
|
|
57685
58476
|
var src_default = new Proxy({}, { get(target, color) {
|
|
57686
58477
|
target[color] ??= (text) => (0, node_util.styleText)(color, text);
|
|
57687
58478
|
return target[color];
|
|
@@ -57801,14 +58592,14 @@ function getDependentsGraph(packages, opts) {
|
|
|
57801
58592
|
return simplifiedDependentsGraph;
|
|
57802
58593
|
}
|
|
57803
58594
|
//#endregion
|
|
57804
|
-
//#region ../../node_modules/.pnpm/@changesets+should-skip-package@1.0.0-next.
|
|
58595
|
+
//#region ../../node_modules/.pnpm/@changesets+should-skip-package@1.0.0-next.7/node_modules/@changesets/should-skip-package/dist/index.mjs
|
|
57805
58596
|
function shouldSkipPackage({ packageJson }, { ignore, allowPrivatePackages }) {
|
|
57806
58597
|
if (ignore.includes(packageJson.name)) return true;
|
|
57807
58598
|
if (packageJson.private && !allowPrivatePackages) return true;
|
|
57808
58599
|
return !packageJson.version;
|
|
57809
58600
|
}
|
|
57810
58601
|
//#endregion
|
|
57811
|
-
//#region ../../node_modules/.pnpm/@changesets+config@4.0.0-next.
|
|
58602
|
+
//#region ../../node_modules/.pnpm/@changesets+config@4.0.0-next.7/node_modules/@changesets/config/dist/index.mjs
|
|
57812
58603
|
const DEFAULT_CONFIG = {
|
|
57813
58604
|
lang: void 0,
|
|
57814
58605
|
message: void 0,
|
|
@@ -58720,7 +59511,7 @@ async function readConfig(cwd, packages) {
|
|
|
58720
59511
|
packages ??= await getPackages(cwd);
|
|
58721
59512
|
return validateConfig(JSON.parse(await node_fs_promises.readFile(node_path.join(packages.rootDir, ".changeset", "config.json"), "utf8")), packages);
|
|
58722
59513
|
}
|
|
58723
|
-
var version = "4.0.0-next.
|
|
59514
|
+
var version = "4.0.0-next.7";
|
|
58724
59515
|
const defaultConfig = normalizeWrittenConfig({
|
|
58725
59516
|
packageNames: [],
|
|
58726
59517
|
writtenConfig: parse(WrittenConfigSchema, {
|
|
@@ -59443,228 +60234,6 @@ function isMetadataYarnClassic(metadataPath) {
|
|
|
59443
60234
|
return metadataPath.endsWith(".yarn_integrity");
|
|
59444
60235
|
}
|
|
59445
60236
|
//#endregion
|
|
59446
|
-
//#region ../../node_modules/.pnpm/@changesets+format@0.1.0/node_modules/@changesets/format/dist/index.js
|
|
59447
|
-
/**
|
|
59448
|
-
* Traverse upwards from `startDir` to `stopDir` (inclusive), calling `cb` in each directory. If
|
|
59449
|
-
* `cb` returns a non-null value, it'll stop and return that value.
|
|
59450
|
-
*/
|
|
59451
|
-
function traverseUpwards(startDir, stopDir, cb) {
|
|
59452
|
-
let dir = startDir;
|
|
59453
|
-
while (dir) {
|
|
59454
|
-
const result = cb(dir);
|
|
59455
|
-
if (result !== void 0) return result;
|
|
59456
|
-
if (dir === stopDir) break;
|
|
59457
|
-
const nextDir = node_path.dirname(dir);
|
|
59458
|
-
if (nextDir === dir) break;
|
|
59459
|
-
dir = nextDir;
|
|
59460
|
-
}
|
|
59461
|
-
}
|
|
59462
|
-
async function packageManagerExecute(packageManager, args, cwd) {
|
|
59463
|
-
const cmd = resolveCommand(packageManager, "execute-local", args) ?? {
|
|
59464
|
-
command: "npx",
|
|
59465
|
-
args
|
|
59466
|
-
};
|
|
59467
|
-
return await spawnProcess(cmd.command, cmd.args, cwd);
|
|
59468
|
-
}
|
|
59469
|
-
async function spawnProcess(command, args, cwd) {
|
|
59470
|
-
return new Promise((resolve, reject) => {
|
|
59471
|
-
const child = node_child_process.spawn(command, args, { cwd });
|
|
59472
|
-
let stderr = "";
|
|
59473
|
-
child.stderr.on("data", (data) => {
|
|
59474
|
-
stderr += data.toString();
|
|
59475
|
-
});
|
|
59476
|
-
child.on("exit", (code) => {
|
|
59477
|
-
if (code === 0) resolve();
|
|
59478
|
-
else reject(/* @__PURE__ */ new Error(`${command} exited with code ${code}. Stderr:\n${stderr}`));
|
|
59479
|
-
});
|
|
59480
|
-
child.on("error", (err) => {
|
|
59481
|
-
reject(err);
|
|
59482
|
-
});
|
|
59483
|
-
});
|
|
59484
|
-
}
|
|
59485
|
-
const formatters = {
|
|
59486
|
-
prettier: {
|
|
59487
|
-
name: "prettier",
|
|
59488
|
-
packageName: "prettier",
|
|
59489
|
-
configFiles: [
|
|
59490
|
-
".prettierrc",
|
|
59491
|
-
".prettierrc.json",
|
|
59492
|
-
".prettierrc.yml",
|
|
59493
|
-
".prettierrc.yaml",
|
|
59494
|
-
".prettierrc.json5",
|
|
59495
|
-
".prettierrc.js",
|
|
59496
|
-
"prettier.config.js",
|
|
59497
|
-
".prettierrc.ts",
|
|
59498
|
-
"prettier.config.ts",
|
|
59499
|
-
".prettierrc.mjs",
|
|
59500
|
-
"prettier.config.mjs",
|
|
59501
|
-
".prettierrc.mts",
|
|
59502
|
-
"prettier.config.mts",
|
|
59503
|
-
".prettierrc.cjs",
|
|
59504
|
-
"prettier.config.cjs",
|
|
59505
|
-
".prettierrc.cts",
|
|
59506
|
-
"prettier.config.cts",
|
|
59507
|
-
".prettierrc.toml",
|
|
59508
|
-
{
|
|
59509
|
-
file: "package.json",
|
|
59510
|
-
key: "prettier"
|
|
59511
|
-
}
|
|
59512
|
-
],
|
|
59513
|
-
async format(files, ctx) {
|
|
59514
|
-
await packageManagerExecute(await ctx.getPackageManager(), [
|
|
59515
|
-
"prettier",
|
|
59516
|
-
"--write",
|
|
59517
|
-
...files
|
|
59518
|
-
], ctx.cwd);
|
|
59519
|
-
}
|
|
59520
|
-
},
|
|
59521
|
-
biome: {
|
|
59522
|
-
name: "biome",
|
|
59523
|
-
packageName: "@biomejs/biome",
|
|
59524
|
-
configFiles: [
|
|
59525
|
-
"biome.json",
|
|
59526
|
-
"biome.jsonc",
|
|
59527
|
-
".biome.json",
|
|
59528
|
-
".biome.jsonc"
|
|
59529
|
-
],
|
|
59530
|
-
async format(files, ctx) {
|
|
59531
|
-
await packageManagerExecute(await ctx.getPackageManager(), [
|
|
59532
|
-
"@biomejs/biome",
|
|
59533
|
-
"format",
|
|
59534
|
-
"--write",
|
|
59535
|
-
...files
|
|
59536
|
-
], ctx.cwd);
|
|
59537
|
-
}
|
|
59538
|
-
},
|
|
59539
|
-
oxfmt: {
|
|
59540
|
-
name: "oxfmt",
|
|
59541
|
-
packageName: "oxfmt",
|
|
59542
|
-
configFiles: [
|
|
59543
|
-
".oxfmtrc.json",
|
|
59544
|
-
".oxfmtrc.jsonc",
|
|
59545
|
-
"oxfmt.config.ts"
|
|
59546
|
-
],
|
|
59547
|
-
async format(files, ctx) {
|
|
59548
|
-
await packageManagerExecute(await ctx.getPackageManager(), [
|
|
59549
|
-
"oxfmt",
|
|
59550
|
-
"--write",
|
|
59551
|
-
...files
|
|
59552
|
-
], ctx.cwd);
|
|
59553
|
-
}
|
|
59554
|
-
},
|
|
59555
|
-
deno: {
|
|
59556
|
-
name: "deno",
|
|
59557
|
-
configFiles: [
|
|
59558
|
-
"deno.json",
|
|
59559
|
-
"deno.jsonc",
|
|
59560
|
-
{
|
|
59561
|
-
file: "deno.json",
|
|
59562
|
-
key: "fmt"
|
|
59563
|
-
}
|
|
59564
|
-
],
|
|
59565
|
-
async format(files, ctx) {
|
|
59566
|
-
await spawnProcess("deno", ["fmt", ...files], ctx.cwd);
|
|
59567
|
-
}
|
|
59568
|
-
},
|
|
59569
|
-
dprint: {
|
|
59570
|
-
name: "dprint",
|
|
59571
|
-
packageName: "dprint",
|
|
59572
|
-
configFiles: [
|
|
59573
|
-
"dprint.json",
|
|
59574
|
-
"dprint.jsonc",
|
|
59575
|
-
".dprint.json",
|
|
59576
|
-
".dprint.jsonc"
|
|
59577
|
-
],
|
|
59578
|
-
async format(files, ctx) {
|
|
59579
|
-
await packageManagerExecute(await ctx.getPackageManager(), [
|
|
59580
|
-
"dprint",
|
|
59581
|
-
"fmt",
|
|
59582
|
-
...files
|
|
59583
|
-
], ctx.cwd);
|
|
59584
|
-
}
|
|
59585
|
-
}
|
|
59586
|
-
};
|
|
59587
|
-
const defaultDetectOrder = Object.freeze([
|
|
59588
|
-
"dprint",
|
|
59589
|
-
"deno",
|
|
59590
|
-
"oxfmt",
|
|
59591
|
-
"biome",
|
|
59592
|
-
"prettier"
|
|
59593
|
-
]);
|
|
59594
|
-
/**
|
|
59595
|
-
* Detect the preferred formatter used in the project.
|
|
59596
|
-
*/
|
|
59597
|
-
async function detect(options = {}) {
|
|
59598
|
-
const cwd = options.cwd ? node_path.resolve(options.cwd) : process.cwd();
|
|
59599
|
-
const stopDir = options.stopDir ? node_path.resolve(cwd, options.stopDir) : void 0;
|
|
59600
|
-
const order = options.order ?? defaultDetectOrder;
|
|
59601
|
-
let found = traverseUpwards(cwd, stopDir, (dir) => {
|
|
59602
|
-
for (const formatterName of order) {
|
|
59603
|
-
const formatter = formatters[formatterName];
|
|
59604
|
-
for (const configFile of formatter.configFiles) if (typeof configFile === "string") {
|
|
59605
|
-
const configFilePath = node_path.join(dir, configFile);
|
|
59606
|
-
if (node_fs.existsSync(configFilePath)) return formatter.name;
|
|
59607
|
-
} else if (checkConfigFileWithKeyExists(node_path.join(dir, configFile.file), configFile.key)) return formatter.name;
|
|
59608
|
-
}
|
|
59609
|
-
});
|
|
59610
|
-
found ??= traverseUpwards(cwd, stopDir, (dir) => {
|
|
59611
|
-
for (const formatterName of order) {
|
|
59612
|
-
const formatter = formatters[formatterName];
|
|
59613
|
-
if (formatter.packageName) {
|
|
59614
|
-
const packagePath = node_path.join(dir, "node_modules", formatter.packageName);
|
|
59615
|
-
if (node_fs.existsSync(packagePath)) return formatter.name;
|
|
59616
|
-
}
|
|
59617
|
-
}
|
|
59618
|
-
});
|
|
59619
|
-
return found;
|
|
59620
|
-
}
|
|
59621
|
-
function checkConfigFileWithKeyExists(configFile, key) {
|
|
59622
|
-
try {
|
|
59623
|
-
const content = node_fs.readFileSync(configFile, "utf-8");
|
|
59624
|
-
return key in JSON.parse(content);
|
|
59625
|
-
} catch {
|
|
59626
|
-
return false;
|
|
59627
|
-
}
|
|
59628
|
-
}
|
|
59629
|
-
/**
|
|
59630
|
-
* Format the given patterns with a specified or auto-detected formatter. It returns `true` if a
|
|
59631
|
-
* formatter is found and the formatting process passes, otherwise returns `false`.
|
|
59632
|
-
*/
|
|
59633
|
-
async function format$1(patterns, options = {}) {
|
|
59634
|
-
const formatterName = options.formatter ?? await detect({
|
|
59635
|
-
cwd: options.cwd,
|
|
59636
|
-
stopDir: options.stopDir
|
|
59637
|
-
});
|
|
59638
|
-
if (!formatterName) return false;
|
|
59639
|
-
const formatter = formatters[formatterName];
|
|
59640
|
-
const ctx = {
|
|
59641
|
-
cwd: options.cwd ? node_path.resolve(options.cwd) : process.cwd(),
|
|
59642
|
-
async getPackageManager() {
|
|
59643
|
-
if (options.packageManager) return options.packageManager;
|
|
59644
|
-
return (await detect$1({
|
|
59645
|
-
cwd: options.cwd,
|
|
59646
|
-
stopDir: options.stopDir
|
|
59647
|
-
}))?.agent ?? "npm";
|
|
59648
|
-
}
|
|
59649
|
-
};
|
|
59650
|
-
await formatter.format(patterns, ctx);
|
|
59651
|
-
return true;
|
|
59652
|
-
}
|
|
59653
|
-
//#endregion
|
|
59654
|
-
//#region ../../node_modules/.pnpm/@changesets+errors@1.0.0-next.3/node_modules/@changesets/errors/dist/index.mjs
|
|
59655
|
-
var GitError = class extends Error {
|
|
59656
|
-
code;
|
|
59657
|
-
constructor(code, message) {
|
|
59658
|
-
super(`${message}, exit code: ${code}`);
|
|
59659
|
-
this.code = code;
|
|
59660
|
-
}
|
|
59661
|
-
};
|
|
59662
|
-
var InternalError = class extends Error {
|
|
59663
|
-
constructor(message) {
|
|
59664
|
-
super(message);
|
|
59665
|
-
}
|
|
59666
|
-
};
|
|
59667
|
-
//#endregion
|
|
59668
60237
|
//#region ../../node_modules/.pnpm/tinyexec@1.2.4/node_modules/tinyexec/dist/main.mjs
|
|
59669
60238
|
const h = /^path$/i;
|
|
59670
60239
|
const g = {
|
|
@@ -59991,7 +60560,219 @@ const R = (e, t, n) => {
|
|
|
59991
60560
|
};
|
|
59992
60561
|
const z = R;
|
|
59993
60562
|
//#endregion
|
|
59994
|
-
//#region ../../node_modules/.pnpm/@changesets+
|
|
60563
|
+
//#region ../../node_modules/.pnpm/@changesets+format@0.1.1/node_modules/@changesets/format/dist/index.js
|
|
60564
|
+
/**
|
|
60565
|
+
* Traverse upwards from `startDir` to `stopDir` (inclusive), calling `cb` in each directory. If
|
|
60566
|
+
* `cb` returns a non-null value, it'll stop and return that value.
|
|
60567
|
+
*/
|
|
60568
|
+
function traverseUpwards(startDir, stopDir, cb) {
|
|
60569
|
+
let dir = startDir;
|
|
60570
|
+
while (dir) {
|
|
60571
|
+
const result = cb(dir);
|
|
60572
|
+
if (result !== void 0) return result;
|
|
60573
|
+
if (dir === stopDir) break;
|
|
60574
|
+
const nextDir = node_path.dirname(dir);
|
|
60575
|
+
if (nextDir === dir) break;
|
|
60576
|
+
dir = nextDir;
|
|
60577
|
+
}
|
|
60578
|
+
}
|
|
60579
|
+
async function packageManagerExecute(packageManager, args, cwd) {
|
|
60580
|
+
const cmd = resolveCommand(packageManager, "execute-local", args) ?? {
|
|
60581
|
+
command: "npx",
|
|
60582
|
+
args
|
|
60583
|
+
};
|
|
60584
|
+
return await spawnProcess(cmd.command, cmd.args, cwd);
|
|
60585
|
+
}
|
|
60586
|
+
async function spawnProcess(command, args, cwd) {
|
|
60587
|
+
await z(command, args, {
|
|
60588
|
+
nodeOptions: { cwd },
|
|
60589
|
+
throwOnError: true
|
|
60590
|
+
});
|
|
60591
|
+
}
|
|
60592
|
+
const formatters = {
|
|
60593
|
+
prettier: {
|
|
60594
|
+
name: "prettier",
|
|
60595
|
+
packageName: "prettier",
|
|
60596
|
+
configFiles: [
|
|
60597
|
+
".prettierrc",
|
|
60598
|
+
".prettierrc.json",
|
|
60599
|
+
".prettierrc.yml",
|
|
60600
|
+
".prettierrc.yaml",
|
|
60601
|
+
".prettierrc.json5",
|
|
60602
|
+
".prettierrc.js",
|
|
60603
|
+
"prettier.config.js",
|
|
60604
|
+
".prettierrc.ts",
|
|
60605
|
+
"prettier.config.ts",
|
|
60606
|
+
".prettierrc.mjs",
|
|
60607
|
+
"prettier.config.mjs",
|
|
60608
|
+
".prettierrc.mts",
|
|
60609
|
+
"prettier.config.mts",
|
|
60610
|
+
".prettierrc.cjs",
|
|
60611
|
+
"prettier.config.cjs",
|
|
60612
|
+
".prettierrc.cts",
|
|
60613
|
+
"prettier.config.cts",
|
|
60614
|
+
".prettierrc.toml",
|
|
60615
|
+
{
|
|
60616
|
+
file: "package.json",
|
|
60617
|
+
key: "prettier"
|
|
60618
|
+
}
|
|
60619
|
+
],
|
|
60620
|
+
async format(files, ctx) {
|
|
60621
|
+
await packageManagerExecute(await ctx.getPackageManager(), [
|
|
60622
|
+
"prettier",
|
|
60623
|
+
"--write",
|
|
60624
|
+
...files
|
|
60625
|
+
], ctx.cwd);
|
|
60626
|
+
}
|
|
60627
|
+
},
|
|
60628
|
+
biome: {
|
|
60629
|
+
name: "biome",
|
|
60630
|
+
packageName: "@biomejs/biome",
|
|
60631
|
+
configFiles: [
|
|
60632
|
+
"biome.json",
|
|
60633
|
+
"biome.jsonc",
|
|
60634
|
+
".biome.json",
|
|
60635
|
+
".biome.jsonc"
|
|
60636
|
+
],
|
|
60637
|
+
async format(files, ctx) {
|
|
60638
|
+
await packageManagerExecute(await ctx.getPackageManager(), [
|
|
60639
|
+
"@biomejs/biome",
|
|
60640
|
+
"format",
|
|
60641
|
+
"--write",
|
|
60642
|
+
...files
|
|
60643
|
+
], ctx.cwd);
|
|
60644
|
+
}
|
|
60645
|
+
},
|
|
60646
|
+
oxfmt: {
|
|
60647
|
+
name: "oxfmt",
|
|
60648
|
+
packageName: "oxfmt",
|
|
60649
|
+
configFiles: [
|
|
60650
|
+
".oxfmtrc.json",
|
|
60651
|
+
".oxfmtrc.jsonc",
|
|
60652
|
+
"oxfmt.config.ts"
|
|
60653
|
+
],
|
|
60654
|
+
async format(files, ctx) {
|
|
60655
|
+
await packageManagerExecute(await ctx.getPackageManager(), [
|
|
60656
|
+
"oxfmt",
|
|
60657
|
+
"--write",
|
|
60658
|
+
...files
|
|
60659
|
+
], ctx.cwd);
|
|
60660
|
+
}
|
|
60661
|
+
},
|
|
60662
|
+
deno: {
|
|
60663
|
+
name: "deno",
|
|
60664
|
+
configFiles: [
|
|
60665
|
+
"deno.json",
|
|
60666
|
+
"deno.jsonc",
|
|
60667
|
+
{
|
|
60668
|
+
file: "deno.json",
|
|
60669
|
+
key: "fmt"
|
|
60670
|
+
}
|
|
60671
|
+
],
|
|
60672
|
+
async format(files, ctx) {
|
|
60673
|
+
await spawnProcess("deno", ["fmt", ...files], ctx.cwd);
|
|
60674
|
+
}
|
|
60675
|
+
},
|
|
60676
|
+
dprint: {
|
|
60677
|
+
name: "dprint",
|
|
60678
|
+
packageName: "dprint",
|
|
60679
|
+
configFiles: [
|
|
60680
|
+
"dprint.json",
|
|
60681
|
+
"dprint.jsonc",
|
|
60682
|
+
".dprint.json",
|
|
60683
|
+
".dprint.jsonc"
|
|
60684
|
+
],
|
|
60685
|
+
async format(files, ctx) {
|
|
60686
|
+
await packageManagerExecute(await ctx.getPackageManager(), [
|
|
60687
|
+
"dprint",
|
|
60688
|
+
"fmt",
|
|
60689
|
+
...files
|
|
60690
|
+
], ctx.cwd);
|
|
60691
|
+
}
|
|
60692
|
+
}
|
|
60693
|
+
};
|
|
60694
|
+
const defaultDetectOrder = Object.freeze([
|
|
60695
|
+
"dprint",
|
|
60696
|
+
"deno",
|
|
60697
|
+
"oxfmt",
|
|
60698
|
+
"biome",
|
|
60699
|
+
"prettier"
|
|
60700
|
+
]);
|
|
60701
|
+
/**
|
|
60702
|
+
* Detect the preferred formatter used in the project.
|
|
60703
|
+
*/
|
|
60704
|
+
async function detect(options = {}) {
|
|
60705
|
+
const cwd = options.cwd ? node_path.resolve(options.cwd) : process.cwd();
|
|
60706
|
+
const stopDir = options.stopDir ? node_path.resolve(cwd, options.stopDir) : void 0;
|
|
60707
|
+
const order = options.order ?? defaultDetectOrder;
|
|
60708
|
+
let found = traverseUpwards(cwd, stopDir, (dir) => {
|
|
60709
|
+
for (const formatterName of order) {
|
|
60710
|
+
const formatter = formatters[formatterName];
|
|
60711
|
+
for (const configFile of formatter.configFiles) if (typeof configFile === "string") {
|
|
60712
|
+
const configFilePath = node_path.join(dir, configFile);
|
|
60713
|
+
if (node_fs.existsSync(configFilePath)) return formatter.name;
|
|
60714
|
+
} else if (checkConfigFileWithKeyExists(node_path.join(dir, configFile.file), configFile.key)) return formatter.name;
|
|
60715
|
+
}
|
|
60716
|
+
});
|
|
60717
|
+
found ??= traverseUpwards(cwd, stopDir, (dir) => {
|
|
60718
|
+
for (const formatterName of order) {
|
|
60719
|
+
const formatter = formatters[formatterName];
|
|
60720
|
+
if (formatter.packageName) {
|
|
60721
|
+
const packagePath = node_path.join(dir, "node_modules", formatter.packageName);
|
|
60722
|
+
if (node_fs.existsSync(packagePath)) return formatter.name;
|
|
60723
|
+
}
|
|
60724
|
+
}
|
|
60725
|
+
});
|
|
60726
|
+
return found;
|
|
60727
|
+
}
|
|
60728
|
+
function checkConfigFileWithKeyExists(configFile, key) {
|
|
60729
|
+
try {
|
|
60730
|
+
const content = node_fs.readFileSync(configFile, "utf-8");
|
|
60731
|
+
return key in JSON.parse(content);
|
|
60732
|
+
} catch {
|
|
60733
|
+
return false;
|
|
60734
|
+
}
|
|
60735
|
+
}
|
|
60736
|
+
/**
|
|
60737
|
+
* Format the given patterns with a specified or auto-detected formatter. It returns `true` if a
|
|
60738
|
+
* formatter is found and the formatting process passes, otherwise returns `false`.
|
|
60739
|
+
*/
|
|
60740
|
+
async function format$1(patterns, options = {}) {
|
|
60741
|
+
const formatterName = options.formatter ?? await detect({
|
|
60742
|
+
cwd: options.cwd,
|
|
60743
|
+
stopDir: options.stopDir
|
|
60744
|
+
});
|
|
60745
|
+
if (!formatterName) return false;
|
|
60746
|
+
const formatter = formatters[formatterName];
|
|
60747
|
+
const ctx = {
|
|
60748
|
+
cwd: options.cwd ? node_path.resolve(options.cwd) : process.cwd(),
|
|
60749
|
+
async getPackageManager() {
|
|
60750
|
+
if (options.packageManager) return options.packageManager;
|
|
60751
|
+
return (await detect$1({
|
|
60752
|
+
cwd: options.cwd,
|
|
60753
|
+
stopDir: options.stopDir
|
|
60754
|
+
}))?.agent ?? "npm";
|
|
60755
|
+
}
|
|
60756
|
+
};
|
|
60757
|
+
await formatter.format(patterns, ctx);
|
|
60758
|
+
return true;
|
|
60759
|
+
}
|
|
60760
|
+
//#endregion
|
|
60761
|
+
//#region ../../node_modules/.pnpm/@changesets+errors@1.0.0-next.4/node_modules/@changesets/errors/dist/index.mjs
|
|
60762
|
+
var GitError = class extends Error {
|
|
60763
|
+
code;
|
|
60764
|
+
constructor(code, message) {
|
|
60765
|
+
super(`${message}, exit code: ${code}`);
|
|
60766
|
+
this.code = code;
|
|
60767
|
+
}
|
|
60768
|
+
};
|
|
60769
|
+
var InternalError = class extends Error {
|
|
60770
|
+
constructor(message) {
|
|
60771
|
+
super(message);
|
|
60772
|
+
}
|
|
60773
|
+
};
|
|
60774
|
+
//#endregion
|
|
60775
|
+
//#region ../../node_modules/.pnpm/@changesets+git@4.0.0-next.7/node_modules/@changesets/git/dist/index.mjs
|
|
59995
60776
|
async function getDivergedCommit(cwd, ref) {
|
|
59996
60777
|
const cmd = await z("git", [
|
|
59997
60778
|
"merge-base",
|
|
@@ -62138,7 +62919,7 @@ function applyEdits(text, edits) {
|
|
|
62138
62919
|
return text;
|
|
62139
62920
|
}
|
|
62140
62921
|
//#endregion
|
|
62141
|
-
//#region ../../node_modules/.pnpm/@changesets+apply-release-plan@8.0.0-next.
|
|
62922
|
+
//#region ../../node_modules/.pnpm/@changesets+apply-release-plan@8.0.0-next.8/node_modules/@changesets/apply-release-plan/dist/index.mjs
|
|
62142
62923
|
/**
|
|
62143
62924
|
* A simple JSON editing utility that preserves formatting. They specified operation keys
|
|
62144
62925
|
* must exist in the JSON for this implementation.
|
|
@@ -62279,13 +63060,8 @@ const DEPENDENCY_TYPES = [
|
|
|
62279
63060
|
"peerDependencies",
|
|
62280
63061
|
"optionalDependencies"
|
|
62281
63062
|
];
|
|
62282
|
-
function
|
|
63063
|
+
function getDependencyVersionEdits(packageJson, versionsToUpdate, { cwd, updateInternalDependencies, onlyUpdatePeerDependentsWhenOutOfRange, bumpVersionsWithWorkspaceProtocolOnly, snapshot }) {
|
|
62283
63064
|
const pkgJsonEdits = [];
|
|
62284
|
-
const { newVersion, packageJson } = release;
|
|
62285
|
-
pkgJsonEdits.push({
|
|
62286
|
-
keys: ["version"],
|
|
62287
|
-
value: newVersion
|
|
62288
|
-
});
|
|
62289
63065
|
for (const depType of DEPENDENCY_TYPES) {
|
|
62290
63066
|
const deps = packageJson[depType];
|
|
62291
63067
|
if (deps) for (const { name, version, oldVersion, type, dir } of versionsToUpdate) {
|
|
@@ -62319,10 +63095,7 @@ function versionPackage(release, versionsToUpdate, { cwd, updateInternalDependen
|
|
|
62319
63095
|
}
|
|
62320
63096
|
}
|
|
62321
63097
|
}
|
|
62322
|
-
return
|
|
62323
|
-
...release,
|
|
62324
|
-
pkgJsonEdits
|
|
62325
|
-
};
|
|
63098
|
+
return pkgJsonEdits;
|
|
62326
63099
|
}
|
|
62327
63100
|
function getVersionRangeType(versionRange) {
|
|
62328
63101
|
if (versionRange.charAt(0) === "^") return "^";
|
|
@@ -62352,6 +63125,13 @@ async function getFormatter(config, cwd) {
|
|
|
62352
63125
|
});
|
|
62353
63126
|
};
|
|
62354
63127
|
}
|
|
63128
|
+
async function updatePackageJson(dir, edits) {
|
|
63129
|
+
if (edits.length === 0) return;
|
|
63130
|
+
const pkgJsonPath = node_path.resolve(dir, "package.json");
|
|
63131
|
+
const pkgUpdated = editJson(await node_fs_promises.readFile(pkgJsonPath, "utf8"), edits);
|
|
63132
|
+
await node_fs_promises.writeFile(pkgJsonPath, pkgUpdated);
|
|
63133
|
+
return pkgJsonPath;
|
|
63134
|
+
}
|
|
62355
63135
|
async function applyReleasePlan(releasePlan, packages, config = defaultConfig, snapshot, contextDir = __dirname) {
|
|
62356
63136
|
const cwd = packages.rootDir;
|
|
62357
63137
|
const touchedFiles = [];
|
|
@@ -62380,22 +63160,21 @@ async function applyReleasePlan(releasePlan, packages, config = defaultConfig, s
|
|
|
62380
63160
|
type,
|
|
62381
63161
|
dir: packagesByName.get(name).dir
|
|
62382
63162
|
}));
|
|
62383
|
-
const
|
|
62384
|
-
|
|
62385
|
-
|
|
62386
|
-
|
|
62387
|
-
|
|
62388
|
-
|
|
62389
|
-
|
|
62390
|
-
});
|
|
62391
|
-
});
|
|
63163
|
+
const dependencyUpdateOptions = {
|
|
63164
|
+
cwd,
|
|
63165
|
+
updateInternalDependencies: config.updateInternalDependencies,
|
|
63166
|
+
onlyUpdatePeerDependentsWhenOutOfRange: config.___experimentalUnsafeOptions_WILL_CHANGE_IN_PATCH.onlyUpdatePeerDependentsWhenOutOfRange,
|
|
63167
|
+
bumpVersionsWithWorkspaceProtocolOnly: config.bumpVersionsWithWorkspaceProtocolOnly,
|
|
63168
|
+
snapshot
|
|
63169
|
+
};
|
|
62392
63170
|
const filesToFormat = [];
|
|
62393
|
-
for (const release of
|
|
62394
|
-
const { changelog,
|
|
62395
|
-
const pkgJsonPath =
|
|
62396
|
-
|
|
62397
|
-
|
|
62398
|
-
|
|
63171
|
+
for (const release of releaseWithChangelogs) {
|
|
63172
|
+
const { changelog, dir, name, newVersion, packageJson } = release;
|
|
63173
|
+
const pkgJsonPath = await updatePackageJson(dir, [{
|
|
63174
|
+
keys: ["version"],
|
|
63175
|
+
value: newVersion
|
|
63176
|
+
}, ...getDependencyVersionEdits(packageJson, versionsToUpdate, dependencyUpdateOptions)]);
|
|
63177
|
+
if (pkgJsonPath) touchedFiles.push(pkgJsonPath);
|
|
62399
63178
|
if (changelog && changelog.length > 0) {
|
|
62400
63179
|
const changelogPath = node_path.resolve(dir, "CHANGELOG.md");
|
|
62401
63180
|
await updateChangelog(changelogPath, changelog, name);
|
|
@@ -62403,6 +63182,11 @@ async function applyReleasePlan(releasePlan, packages, config = defaultConfig, s
|
|
|
62403
63182
|
filesToFormat.push(changelogPath);
|
|
62404
63183
|
}
|
|
62405
63184
|
}
|
|
63185
|
+
if (packages.rootPackage) {
|
|
63186
|
+
const pkgJsonEdits = getDependencyVersionEdits(packages.rootPackage.packageJson, versionsToUpdate, dependencyUpdateOptions);
|
|
63187
|
+
const pkgJsonPath = await updatePackageJson(packages.rootPackage.dir, pkgJsonEdits);
|
|
63188
|
+
if (pkgJsonPath) touchedFiles.push(pkgJsonPath);
|
|
63189
|
+
}
|
|
62406
63190
|
if (filesToFormat.length > 0) await (await getFormatter(config.format, cwd))(filesToFormat);
|
|
62407
63191
|
if (releasePlan.preState == null || releasePlan.preState.mode === "exit") {
|
|
62408
63192
|
const changesetFolder = node_path.resolve(cwd, ".changeset");
|
|
@@ -62493,7 +63277,7 @@ async function updateChangelog(changelogPath, changelog, name) {
|
|
|
62493
63277
|
await node_fs_promises.writeFile(changelogPath, newChangelog);
|
|
62494
63278
|
}
|
|
62495
63279
|
//#endregion
|
|
62496
|
-
//#region ../../node_modules/.pnpm/@changesets+assemble-release-plan@7.0.0-next.
|
|
63280
|
+
//#region ../../node_modules/.pnpm/@changesets+assemble-release-plan@7.0.0-next.8/node_modules/@changesets/assemble-release-plan/dist/index.mjs
|
|
62497
63281
|
function getHighestReleaseType(releases) {
|
|
62498
63282
|
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`);
|
|
62499
63283
|
let highestReleaseType = "none";
|
|
@@ -62839,7 +63623,7 @@ function getPreInfo(changesets, packagesByName, config, preState) {
|
|
|
62839
63623
|
};
|
|
62840
63624
|
}
|
|
62841
63625
|
//#endregion
|
|
62842
|
-
//#region ../../node_modules/.pnpm/@changesets+pre@3.0.0-next.
|
|
63626
|
+
//#region ../../node_modules/.pnpm/@changesets+pre@3.0.0-next.7/node_modules/@changesets/pre/dist/index.mjs
|
|
62843
63627
|
async function outputFile(filePath, content) {
|
|
62844
63628
|
await node_fs_promises.mkdir(node_path.dirname(filePath), { recursive: true });
|
|
62845
63629
|
await node_fs_promises.writeFile(filePath, content, "utf8");
|
|
@@ -62868,7 +63652,7 @@ async function migratePreState(rootDir, preState) {
|
|
|
62868
63652
|
return preState;
|
|
62869
63653
|
}
|
|
62870
63654
|
//#endregion
|
|
62871
|
-
//#region ../../node_modules/.pnpm/@changesets+parse@1.0.0-next.
|
|
63655
|
+
//#region ../../node_modules/.pnpm/@changesets+parse@1.0.0-next.8/node_modules/@changesets/parse/dist/index.mjs
|
|
62872
63656
|
const mdRegex = /\s*---([^]*?)\r?\n\s*---(\s*(?:\n|$)[^]*)/;
|
|
62873
63657
|
const EXAMPLE_FORMAT = `---\n"package-name": patch\n---`;
|
|
62874
63658
|
const validVersionTypes = [
|
|
@@ -62921,7 +63705,7 @@ YAML error: ${e instanceof Error ? e.message : String(e)}\nFrontmatter content:\
|
|
|
62921
63705
|
};
|
|
62922
63706
|
}
|
|
62923
63707
|
//#endregion
|
|
62924
|
-
//#region ../../node_modules/.pnpm/@changesets+read@1.0.0-next.
|
|
63708
|
+
//#region ../../node_modules/.pnpm/@changesets+read@1.0.0-next.8/node_modules/@changesets/read/dist/index.mjs
|
|
62925
63709
|
const ignoredMdFiles = [
|
|
62926
63710
|
/^README\.md$/i,
|
|
62927
63711
|
"AGENTS.md",
|
|
@@ -62954,7 +63738,7 @@ async function readChangesets(rootDir, sinceRef) {
|
|
|
62954
63738
|
return await Promise.all(changesetContents);
|
|
62955
63739
|
}
|
|
62956
63740
|
//#endregion
|
|
62957
|
-
//#region ../../node_modules/.pnpm/@changesets+get-release-plan@5.0.0-next.
|
|
63741
|
+
//#region ../../node_modules/.pnpm/@changesets+get-release-plan@5.0.0-next.8/node_modules/@changesets/get-release-plan/dist/index.mjs
|
|
62958
63742
|
async function getReleasePlan(cwd, sinceRef, passedConfig) {
|
|
62959
63743
|
const packages = await getPackages(cwd);
|
|
62960
63744
|
const configResult = await readConfig(packages.rootDir, packages);
|