@savvy-web/silk 3.0.4 → 3.0.6
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 +1073 -257
- package/changesets-changelog.d.cts +596 -37
- package/changesets-changelog.d.ts +596 -37
- package/changesets-changelog.js +1091 -261
- package/changesets-markdownlint.cjs +1073 -257
- package/changesets-markdownlint.d.cts +596 -37
- package/changesets-markdownlint.d.ts +596 -37
- package/changesets-markdownlint.js +1091 -261
- package/package.json +6 -6
- package/tsconfig/node/dist/tsconfig.tsbuildinfo +1 -1
|
@@ -435,7 +435,7 @@ const trimTrailingSlashes = (s) => {
|
|
|
435
435
|
};
|
|
436
436
|
|
|
437
437
|
//#endregion
|
|
438
|
-
//#region ../../node_modules/.pnpm/@effected+glob@0.
|
|
438
|
+
//#region ../../node_modules/.pnpm/@effected+glob@0.2.0_effect@4.0.0-beta.99/node_modules/@effected/glob/internal/limits.js
|
|
439
439
|
/** Hard cap on pattern length. Upstream minimatch's MAX_PATTERN_LENGTH (64KB). */
|
|
440
440
|
const MAX_PATTERN_LENGTH = 1024 * 64;
|
|
441
441
|
/** Default brace-expansion output budget. Upstream brace-expansion's EXPANSION_MAX. */
|
|
@@ -470,7 +470,7 @@ const assertCap = (name, value) => {
|
|
|
470
470
|
};
|
|
471
471
|
|
|
472
472
|
//#endregion
|
|
473
|
-
//#region ../../node_modules/.pnpm/@effected+glob@0.
|
|
473
|
+
//#region ../../node_modules/.pnpm/@effected+glob@0.2.0_effect@4.0.0-beta.99/node_modules/@effected/glob/internal/unescape.js
|
|
474
474
|
/**
|
|
475
475
|
* Un-escape a string that has been escaped with `escape`.
|
|
476
476
|
*
|
|
@@ -494,12 +494,12 @@ const unescapePattern = (s, { windowsPathsNoEscape = false, magicalBraces = true
|
|
|
494
494
|
};
|
|
495
495
|
|
|
496
496
|
//#endregion
|
|
497
|
-
//#region ../../node_modules/.pnpm/@effected+glob@0.
|
|
497
|
+
//#region ../../node_modules/.pnpm/@effected+glob@0.2.0_effect@4.0.0-beta.99/node_modules/@effected/glob/internal/types.js
|
|
498
498
|
/** The globstar marker in a compiled pattern set. */
|
|
499
499
|
const GLOBSTAR = Symbol("globstar **");
|
|
500
500
|
|
|
501
501
|
//#endregion
|
|
502
|
-
//#region ../../node_modules/.pnpm/@effected+glob@0.
|
|
502
|
+
//#region ../../node_modules/.pnpm/@effected+glob@0.2.0_effect@4.0.0-beta.99/node_modules/@effected/glob/internal/escape.js
|
|
503
503
|
/**
|
|
504
504
|
* Escape all magic characters in a glob pattern.
|
|
505
505
|
*
|
|
@@ -518,14 +518,14 @@ const escapePattern = (s, { windowsPathsNoEscape = false, magicalBraces = false
|
|
|
518
518
|
};
|
|
519
519
|
|
|
520
520
|
//#endregion
|
|
521
|
-
//#region ../../node_modules/.pnpm/@effected+glob@0.
|
|
521
|
+
//#region ../../node_modules/.pnpm/@effected+glob@0.2.0_effect@4.0.0-beta.99/node_modules/@effected/glob/internal/assertValidPattern.js
|
|
522
522
|
const assertValidPattern = (pattern) => {
|
|
523
523
|
if (typeof pattern !== "string") throw new TypeError("invalid pattern");
|
|
524
524
|
if (pattern.length > 65536) throw new GuardExceeded("PatternTooLong", MAX_PATTERN_LENGTH, pattern.length);
|
|
525
525
|
};
|
|
526
526
|
|
|
527
527
|
//#endregion
|
|
528
|
-
//#region ../../node_modules/.pnpm/@effected+glob@0.
|
|
528
|
+
//#region ../../node_modules/.pnpm/@effected+glob@0.2.0_effect@4.0.0-beta.99/node_modules/@effected/glob/internal/braceExpressions.js
|
|
529
529
|
const posixClasses = {
|
|
530
530
|
"[:alnum:]": ["\\p{L}\\p{Nl}\\p{Nd}", true],
|
|
531
531
|
"[:alpha:]": ["\\p{L}\\p{Nl}", true],
|
|
@@ -649,7 +649,7 @@ const parseClass = (glob, position) => {
|
|
|
649
649
|
};
|
|
650
650
|
|
|
651
651
|
//#endregion
|
|
652
|
-
//#region ../../node_modules/.pnpm/@effected+glob@0.
|
|
652
|
+
//#region ../../node_modules/.pnpm/@effected+glob@0.2.0_effect@4.0.0-beta.99/node_modules/@effected/glob/internal/ast.js
|
|
653
653
|
const types = /* @__PURE__ */ new Set([
|
|
654
654
|
"!",
|
|
655
655
|
"?",
|
|
@@ -1167,7 +1167,7 @@ var AST = class AST {
|
|
|
1167
1167
|
};
|
|
1168
1168
|
|
|
1169
1169
|
//#endregion
|
|
1170
|
-
//#region ../../node_modules/.pnpm/@effected+glob@0.
|
|
1170
|
+
//#region ../../node_modules/.pnpm/@effected+glob@0.2.0_effect@4.0.0-beta.99/node_modules/@effected/glob/internal/balancedMatch.js
|
|
1171
1171
|
const maybeMatch = (reg, str) => {
|
|
1172
1172
|
const m = str.match(reg);
|
|
1173
1173
|
return m ? m[0] : null;
|
|
@@ -1226,7 +1226,7 @@ const range = (a, b, str) => {
|
|
|
1226
1226
|
};
|
|
1227
1227
|
|
|
1228
1228
|
//#endregion
|
|
1229
|
-
//#region ../../node_modules/.pnpm/@effected+glob@0.
|
|
1229
|
+
//#region ../../node_modules/.pnpm/@effected+glob@0.2.0_effect@4.0.0-beta.99/node_modules/@effected/glob/internal/braceExpansion.js
|
|
1230
1230
|
const escSlash = `\0SLASH${Math.random()}\0`;
|
|
1231
1231
|
const escOpen = `\0OPEN${Math.random()}\0`;
|
|
1232
1232
|
const escClose = `\0CLOSE${Math.random()}\0`;
|
|
@@ -1374,7 +1374,7 @@ function expand_(str, max, isTopInput, depth) {
|
|
|
1374
1374
|
}
|
|
1375
1375
|
|
|
1376
1376
|
//#endregion
|
|
1377
|
-
//#region ../../node_modules/.pnpm/@effected+glob@0.
|
|
1377
|
+
//#region ../../node_modules/.pnpm/@effected+glob@0.2.0_effect@4.0.0-beta.99/node_modules/@effected/glob/internal/minimatch.js
|
|
1378
1378
|
const starDotExtRE = /^\*+([^+@!?*[(]*)$/;
|
|
1379
1379
|
const starDotExtTest = (ext) => (f) => !f.startsWith(".") && f.endsWith(ext);
|
|
1380
1380
|
const starDotExtTestDot = (ext) => (f) => f.endsWith(ext);
|
|
@@ -1946,7 +1946,7 @@ var Minimatch = class {
|
|
|
1946
1946
|
};
|
|
1947
1947
|
|
|
1948
1948
|
//#endregion
|
|
1949
|
-
//#region ../../node_modules/.pnpm/@effected+glob@0.
|
|
1949
|
+
//#region ../../node_modules/.pnpm/@effected+glob@0.2.0_effect@4.0.0-beta.99/node_modules/@effected/glob/GlobPattern.js
|
|
1950
1950
|
/**
|
|
1951
1951
|
* Typed failure raised when a glob pattern trips a compile-time guard:
|
|
1952
1952
|
* over-length, brace-expansion budget exhaustion, or nesting past the depth
|
|
@@ -2075,17 +2075,30 @@ var GlobPattern = class GlobPattern extends Schema.Class("GlobPattern")(Schema.S
|
|
|
2075
2075
|
return this.#engine;
|
|
2076
2076
|
}
|
|
2077
2077
|
/**
|
|
2078
|
-
* Compile a pattern under the given options — the package's
|
|
2079
|
-
* boundary
|
|
2080
|
-
*
|
|
2081
|
-
*
|
|
2078
|
+
* Compile a pattern under the given options, synchronously — the package's
|
|
2079
|
+
* fallible boundary in its primitive form. Compilation is pure
|
|
2080
|
+
* string→predicate work with no IO, no services and no async step, so the
|
|
2081
|
+
* sync form is the real primitive and {@link GlobPattern.compile} is
|
|
2082
|
+
* derived from it.
|
|
2083
|
+
*
|
|
2084
|
+
* Total: never throws for pattern input. Guard trips (over-length,
|
|
2085
|
+
* expansion budget, nesting depth) come back as a `Result` failure holding
|
|
2086
|
+
* {@link GlobPatternError}; invalid *options* never reach here (they throw
|
|
2087
|
+
* at `GlobPatternOptions.make`, a wiring defect).
|
|
2082
2088
|
*
|
|
2083
2089
|
* The pattern must also compile under DEFAULT options, whatever the
|
|
2084
2090
|
* effective options are — permissive options (say `nobrace` over a brace
|
|
2085
2091
|
* bomb) do not admit a defaults-rejected pattern; the same typed error
|
|
2086
2092
|
* surfaces instead.
|
|
2093
|
+
*
|
|
2094
|
+
* @remarks
|
|
2095
|
+
* For synchronous call sites that cannot host an Effect — a lint-staged
|
|
2096
|
+
* handler, a config predicate — this removes the
|
|
2097
|
+
* `Effect.runSync(Effect.result(...))` escape hatch: pair it with
|
|
2098
|
+
* `Result.isSuccess` and read `.success` directly. Effect call sites should
|
|
2099
|
+
* prefer {@link GlobPattern.compile}, which carries the tracing span.
|
|
2087
2100
|
*/
|
|
2088
|
-
static
|
|
2101
|
+
static compileResult(source, options) {
|
|
2089
2102
|
const engineOptions = toEngineOptions(options);
|
|
2090
2103
|
try {
|
|
2091
2104
|
new Minimatch(source, {});
|
|
@@ -2093,16 +2106,30 @@ var GlobPattern = class GlobPattern extends Schema.Class("GlobPattern")(Schema.S
|
|
|
2093
2106
|
const pattern = new GlobPattern({ source });
|
|
2094
2107
|
pattern.#engine = engine;
|
|
2095
2108
|
pattern.#engineOptions = engineOptions;
|
|
2096
|
-
return pattern;
|
|
2109
|
+
return Result.succeed(pattern);
|
|
2097
2110
|
} catch (e) {
|
|
2098
|
-
if (isGuardExceeded(e)) return
|
|
2111
|
+
if (isGuardExceeded(e)) return Result.fail(new GlobPatternError({
|
|
2099
2112
|
pattern: source,
|
|
2100
2113
|
reason: e.reason,
|
|
2101
2114
|
limit: e.limit,
|
|
2102
2115
|
actual: e.actual
|
|
2103
|
-
});
|
|
2116
|
+
}));
|
|
2104
2117
|
throw e;
|
|
2105
2118
|
}
|
|
2119
|
+
}
|
|
2120
|
+
/**
|
|
2121
|
+
* Compile a pattern under the given options — the package's fallible
|
|
2122
|
+
* boundary, and the form Effect call sites should reach for. Guard trips
|
|
2123
|
+
* (over-length, expansion budget, nesting depth) fail typed with
|
|
2124
|
+
* {@link GlobPatternError}; invalid options never reach here (they throw at
|
|
2125
|
+
* `GlobPatternOptions.make`, a wiring defect).
|
|
2126
|
+
*
|
|
2127
|
+
* Defined in terms of {@link GlobPattern.compileResult} — synchronous
|
|
2128
|
+
* callers can use that variant directly. Same semantics, same errors; this
|
|
2129
|
+
* form adds only the `GlobPattern.compile` tracing span.
|
|
2130
|
+
*/
|
|
2131
|
+
static compile = Effect.fn("GlobPattern.compile")(function* (source, options) {
|
|
2132
|
+
return yield* Effect.fromResult(GlobPattern.compileResult(source, options));
|
|
2106
2133
|
});
|
|
2107
2134
|
/**
|
|
2108
2135
|
* Whether `candidate` matches this pattern. Total: never throws, never
|
|
@@ -2199,7 +2226,7 @@ var GlobPattern = class GlobPattern extends Schema.Class("GlobPattern")(Schema.S
|
|
|
2199
2226
|
};
|
|
2200
2227
|
|
|
2201
2228
|
//#endregion
|
|
2202
|
-
//#region ../../node_modules/.pnpm/@effected+glob@0.
|
|
2229
|
+
//#region ../../node_modules/.pnpm/@effected+glob@0.2.0_effect@4.0.0-beta.99/node_modules/@effected/glob/GlobSet.js
|
|
2203
2230
|
const exclusionTarget = (pattern) => pattern.startsWith("!") ? pattern.slice(1) : void 0;
|
|
2204
2231
|
const allCompileUnderDefaults = (patterns) => {
|
|
2205
2232
|
for (const pattern of patterns) {
|
|
@@ -2274,27 +2301,53 @@ var GlobSet = class GlobSet extends Schema.Class("GlobSet")(Schema.Struct({ patt
|
|
|
2274
2301
|
return this.#literalSet;
|
|
2275
2302
|
}
|
|
2276
2303
|
/**
|
|
2277
|
-
* Compile a pattern set —
|
|
2278
|
-
*
|
|
2279
|
-
*
|
|
2280
|
-
*
|
|
2304
|
+
* Compile a pattern set, synchronously — the primitive form, mirroring
|
|
2305
|
+
* {@link GlobPattern.compileResult}. Set compilation is pure
|
|
2306
|
+
* string→predicate work with no IO and no async step, so the sync form is
|
|
2307
|
+
* the real primitive and {@link GlobSet.compile} is derived from it.
|
|
2308
|
+
*
|
|
2309
|
+
* Total: never throws for pattern input. Fails on the FIRST uncompilable
|
|
2310
|
+
* member, coming back as a `Result` failure whose {@link GlobPatternError}
|
|
2311
|
+
* names the offending source pattern in `pattern` (bang included for
|
|
2312
|
+
* exclusions).
|
|
2313
|
+
*
|
|
2314
|
+
* @remarks
|
|
2315
|
+
* For synchronous call sites that cannot host an Effect — a lint-staged
|
|
2316
|
+
* handler, a config predicate — this removes the
|
|
2317
|
+
* `Effect.runSync(Effect.result(...))` escape hatch: pair it with
|
|
2318
|
+
* `Result.isSuccess` and read `.success` directly. Effect call sites should
|
|
2319
|
+
* prefer {@link GlobSet.compile}, which carries the tracing span.
|
|
2281
2320
|
*/
|
|
2282
|
-
static
|
|
2321
|
+
static compileResult(patterns) {
|
|
2283
2322
|
for (const pattern of patterns) {
|
|
2284
2323
|
const target = exclusionTarget(pattern) ?? pattern;
|
|
2285
2324
|
try {
|
|
2286
2325
|
new Minimatch(target, {});
|
|
2287
2326
|
} catch (e) {
|
|
2288
|
-
if (isGuardExceeded(e)) return
|
|
2327
|
+
if (isGuardExceeded(e)) return Result.fail(new GlobPatternError({
|
|
2289
2328
|
pattern,
|
|
2290
2329
|
reason: e.reason,
|
|
2291
2330
|
limit: e.limit,
|
|
2292
2331
|
actual: e.actual
|
|
2293
|
-
});
|
|
2332
|
+
}));
|
|
2294
2333
|
throw e;
|
|
2295
2334
|
}
|
|
2296
2335
|
}
|
|
2297
|
-
return new GlobSet({ patterns });
|
|
2336
|
+
return Result.succeed(new GlobSet({ patterns }));
|
|
2337
|
+
}
|
|
2338
|
+
/**
|
|
2339
|
+
* Compile a pattern set — with {@link GlobPattern.compile}, the package's
|
|
2340
|
+
* only other fallible boundary, and the form Effect call sites should reach
|
|
2341
|
+
* for. Fails typed on the FIRST uncompilable member, with the error's
|
|
2342
|
+
* `pattern` field naming the offending source pattern (bang included for
|
|
2343
|
+
* exclusions).
|
|
2344
|
+
*
|
|
2345
|
+
* Defined in terms of {@link GlobSet.compileResult} — synchronous callers
|
|
2346
|
+
* can use that variant directly. Same semantics, same errors; this form
|
|
2347
|
+
* adds only the `GlobSet.compile` tracing span.
|
|
2348
|
+
*/
|
|
2349
|
+
static compile = Effect.fn("GlobSet.compile")(function* (patterns) {
|
|
2350
|
+
return yield* Effect.fromResult(GlobSet.compileResult(patterns));
|
|
2298
2351
|
});
|
|
2299
2352
|
/**
|
|
2300
2353
|
* Whether `candidate` matches the set: some include accepts it (literal
|
|
@@ -2328,7 +2381,7 @@ var GlobSet = class GlobSet extends Schema.Class("GlobSet")(Schema.Struct({ patt
|
|
|
2328
2381
|
};
|
|
2329
2382
|
|
|
2330
2383
|
//#endregion
|
|
2331
|
-
//#region ../../node_modules/.pnpm/@effected+lockfiles@0.1.
|
|
2384
|
+
//#region ../../node_modules/.pnpm/@effected+lockfiles@0.1.9_@effected+jsonc@0.5.0_effect@4.0.0-beta.99__@effected+npm@0.3_d470055e7ca4b6a23d413cae592e2835/node_modules/@effected/lockfiles/BunExtension.js
|
|
2332
2385
|
/**
|
|
2333
2386
|
* Extension data specific to bun lockfiles, attached to `Lockfile.extension`
|
|
2334
2387
|
* when the format is `"bun"`.
|
|
@@ -2350,7 +2403,7 @@ var BunExtension = class extends Schema.Class("BunExtension")({
|
|
|
2350
2403
|
}) {};
|
|
2351
2404
|
|
|
2352
2405
|
//#endregion
|
|
2353
|
-
//#region ../../node_modules/.pnpm/@effected+npm@0.
|
|
2406
|
+
//#region ../../node_modules/.pnpm/@effected+npm@0.3.0_@effected+semver@0.2.0_effect@4.0.0-beta.99__effect@4.0.0-beta.99/node_modules/@effected/npm/CatalogResolver.js
|
|
2354
2407
|
/**
|
|
2355
2408
|
* Contract for resolving pnpm `catalog:` dependency specifiers to concrete
|
|
2356
2409
|
* version ranges.
|
|
@@ -2397,7 +2450,7 @@ var CatalogResolver = class CatalogResolver extends Context.Service()("@effected
|
|
|
2397
2450
|
};
|
|
2398
2451
|
|
|
2399
2452
|
//#endregion
|
|
2400
|
-
//#region ../../node_modules/.pnpm/@effected+npm@0.
|
|
2453
|
+
//#region ../../node_modules/.pnpm/@effected+npm@0.3.0_@effected+semver@0.2.0_effect@4.0.0-beta.99__effect@4.0.0-beta.99/node_modules/@effected/npm/WorkspaceResolver.js
|
|
2401
2454
|
/**
|
|
2402
2455
|
* Raised when a `catalog:` or `workspace:` specifier cannot be resolved
|
|
2403
2456
|
* because the resolution mechanism itself failed — not for an ordinary
|
|
@@ -2459,7 +2512,7 @@ var WorkspaceResolver = class WorkspaceResolver extends Context.Service()("@effe
|
|
|
2459
2512
|
};
|
|
2460
2513
|
|
|
2461
2514
|
//#endregion
|
|
2462
|
-
//#region ../../node_modules/.pnpm/@effected+npm@0.
|
|
2515
|
+
//#region ../../node_modules/.pnpm/@effected+npm@0.3.0_@effected+semver@0.2.0_effect@4.0.0-beta.99__effect@4.0.0-beta.99/node_modules/@effected/npm/CatalogAssemblyError.js
|
|
2463
2516
|
/**
|
|
2464
2517
|
* Raised when a workspace's catalogs cannot be assembled — a `pnpm-workspace.yaml`
|
|
2465
2518
|
* that is unreadable or not valid YAML, a root `package.json` `workspaces` field
|
|
@@ -2504,7 +2557,7 @@ var CatalogAssemblyError = class extends Schema.TaggedErrorClass()("CatalogAssem
|
|
|
2504
2557
|
};
|
|
2505
2558
|
|
|
2506
2559
|
//#endregion
|
|
2507
|
-
//#region ../../node_modules/.pnpm/@effected+npm@0.
|
|
2560
|
+
//#region ../../node_modules/.pnpm/@effected+npm@0.3.0_@effected+semver@0.2.0_effect@4.0.0-beta.99__effect@4.0.0-beta.99/node_modules/@effected/npm/DependencySection.js
|
|
2508
2561
|
/**
|
|
2509
2562
|
* The short dependency kind: which dependency map an entry came from, named the
|
|
2510
2563
|
* way consumers branch on it.
|
|
@@ -2538,7 +2591,7 @@ const KIND_TO_FIELD = {
|
|
|
2538
2591
|
const FIELD_TO_KIND = Object.fromEntries(Object.entries(KIND_TO_FIELD).map(([kind, field]) => [field, kind]));
|
|
2539
2592
|
|
|
2540
2593
|
//#endregion
|
|
2541
|
-
//#region ../../node_modules/.pnpm/@effected+semver@0.
|
|
2594
|
+
//#region ../../node_modules/.pnpm/@effected+semver@0.2.0_effect@4.0.0-beta.99/node_modules/@effected/semver/internal/desugar.js
|
|
2542
2595
|
const sv = (major, minor, patch, prerelease = [], build = []) => ({
|
|
2543
2596
|
major,
|
|
2544
2597
|
minor,
|
|
@@ -2628,7 +2681,7 @@ const desugarHyphen = (lower, upper) => {
|
|
|
2628
2681
|
};
|
|
2629
2682
|
|
|
2630
2683
|
//#endregion
|
|
2631
|
-
//#region ../../node_modules/.pnpm/@effected+semver@0.
|
|
2684
|
+
//#region ../../node_modules/.pnpm/@effected+semver@0.2.0_effect@4.0.0-beta.99/node_modules/@effected/semver/internal/grammar.js
|
|
2632
2685
|
/** Private control-flow exception; never escapes the entry points. */
|
|
2633
2686
|
var ParseFailure = class {
|
|
2634
2687
|
position;
|
|
@@ -3024,7 +3077,7 @@ const formatComparator = (c) => {
|
|
|
3024
3077
|
const formatRange = (sets) => sets.map((set) => set.map(formatComparator).join(" ")).join(" || ");
|
|
3025
3078
|
|
|
3026
3079
|
//#endregion
|
|
3027
|
-
//#region ../../node_modules/.pnpm/@effected+semver@0.
|
|
3080
|
+
//#region ../../node_modules/.pnpm/@effected+semver@0.2.0_effect@4.0.0-beta.99/node_modules/@effected/semver/internal/order.js
|
|
3028
3081
|
/**
|
|
3029
3082
|
* Compare two prerelease identifiers per SemVer 2.0.0 §11: numeric
|
|
3030
3083
|
* identifiers always have lower precedence than alphanumeric ones; numerics
|
|
@@ -3078,7 +3131,7 @@ const compareBuild = (a, b) => {
|
|
|
3078
3131
|
};
|
|
3079
3132
|
|
|
3080
3133
|
//#endregion
|
|
3081
|
-
//#region ../../node_modules/.pnpm/@effected+semver@0.
|
|
3134
|
+
//#region ../../node_modules/.pnpm/@effected+semver@0.2.0_effect@4.0.0-beta.99/node_modules/@effected/semver/SemVer.js
|
|
3082
3135
|
/**
|
|
3083
3136
|
* Indicates that a string could not be parsed as a valid SemVer 2.0.0 version.
|
|
3084
3137
|
*
|
|
@@ -3159,23 +3212,57 @@ var SemVer = class SemVer extends Schema.Class("SemVer")({
|
|
|
3159
3212
|
encode: (parts) => Effect.succeed(formatVersion(parts))
|
|
3160
3213
|
})));
|
|
3161
3214
|
/**
|
|
3162
|
-
* Parse a strict SemVer 2.0.0 version string
|
|
3215
|
+
* Parse a strict SemVer 2.0.0 version string, synchronously, returning a
|
|
3216
|
+
* `Result` instead of an `Effect`.
|
|
3163
3217
|
*
|
|
3164
3218
|
* Rejects `v`/`V` prefixes, `=` prefixes, leading zeros on numeric
|
|
3165
3219
|
* identifiers and partially consumed input.
|
|
3166
3220
|
*
|
|
3221
|
+
* @remarks
|
|
3222
|
+
* {@link SemVer.parse} is defined in terms of this function; the two never
|
|
3223
|
+
* diverge. Reach for the `Effect` variant inside Effect code — it carries
|
|
3224
|
+
* the `SemVer.parse` tracing span — and for this one at synchronous
|
|
3225
|
+
* boundaries.
|
|
3226
|
+
*
|
|
3227
|
+
* @example
|
|
3228
|
+
* ```ts
|
|
3229
|
+
* import { SemVer } from "@effected/semver";
|
|
3230
|
+
* import { Result } from "effect";
|
|
3231
|
+
*
|
|
3232
|
+
* const ok = SemVer.parseResult("1.2.3");
|
|
3233
|
+
* if (Result.isSuccess(ok)) {
|
|
3234
|
+
* console.log(ok.success.major); // => 1
|
|
3235
|
+
* }
|
|
3236
|
+
*
|
|
3237
|
+
* const bad = SemVer.parseResult("v1.2.3");
|
|
3238
|
+
* if (Result.isFailure(bad)) {
|
|
3239
|
+
* console.log(bad.failure._tag); // => "InvalidVersionError"
|
|
3240
|
+
* }
|
|
3241
|
+
* ```
|
|
3242
|
+
*
|
|
3167
3243
|
* @param input - the version string to parse
|
|
3168
|
-
* @returns the parsed {@link SemVer}
|
|
3169
|
-
* when `input` is not a valid version
|
|
3244
|
+
* @returns a `Result` succeeding with the parsed {@link SemVer}, or failing
|
|
3245
|
+
* with {@link InvalidVersionError} when `input` is not a valid version
|
|
3246
|
+
* string.
|
|
3170
3247
|
*/
|
|
3171
|
-
static
|
|
3248
|
+
static parseResult(input) {
|
|
3172
3249
|
const result = parseVersion(input);
|
|
3173
|
-
if (!result.ok) return
|
|
3250
|
+
if (!result.ok) return Result.fail(new InvalidVersionError({
|
|
3174
3251
|
input: result.input,
|
|
3175
3252
|
position: result.position
|
|
3176
|
-
});
|
|
3177
|
-
return SemVer.make(result.value);
|
|
3178
|
-
}
|
|
3253
|
+
}));
|
|
3254
|
+
return Result.succeed(SemVer.make(result.value));
|
|
3255
|
+
}
|
|
3256
|
+
/**
|
|
3257
|
+
* Parse a strict SemVer 2.0.0 version string. Defined in terms of
|
|
3258
|
+
* {@link SemVer.parseResult} — synchronous callers can use that variant
|
|
3259
|
+
* directly.
|
|
3260
|
+
*
|
|
3261
|
+
* @param input - the version string to parse
|
|
3262
|
+
* @returns the parsed {@link SemVer}. Fails with {@link InvalidVersionError}
|
|
3263
|
+
* when `input` is not a valid version string.
|
|
3264
|
+
*/
|
|
3265
|
+
static parse = Effect.fn("SemVer.parse")((input) => Effect.fromResult(SemVer.parseResult(input)));
|
|
3179
3266
|
/**
|
|
3180
3267
|
* Positional convenience constructor: `SemVer.of(1, 2, 3)`.
|
|
3181
3268
|
*
|
|
@@ -3480,7 +3567,7 @@ var SemVerBump = class {
|
|
|
3480
3567
|
};
|
|
3481
3568
|
|
|
3482
3569
|
//#endregion
|
|
3483
|
-
//#region ../../node_modules/.pnpm/@effected+semver@0.
|
|
3570
|
+
//#region ../../node_modules/.pnpm/@effected+semver@0.2.0_effect@4.0.0-beta.99/node_modules/@effected/semver/Comparator.js
|
|
3484
3571
|
/**
|
|
3485
3572
|
* Indicates that a string could not be parsed as a single comparator.
|
|
3486
3573
|
*
|
|
@@ -3547,18 +3634,52 @@ var Comparator = class Comparator extends Schema.Class("Comparator")({
|
|
|
3547
3634
|
},
|
|
3548
3635
|
encode: (parts) => Effect.succeed(formatComparator(parts))
|
|
3549
3636
|
})));
|
|
3550
|
-
/**
|
|
3551
|
-
|
|
3637
|
+
/**
|
|
3638
|
+
* Parse a comparator string (e.g. `">=1.2.3"`), synchronously, returning a
|
|
3639
|
+
* `Result` instead of an `Effect`.
|
|
3640
|
+
*
|
|
3641
|
+
* @remarks
|
|
3642
|
+
* {@link Comparator.parse} is defined in terms of this function; the two
|
|
3643
|
+
* never diverge. Reach for the `Effect` variant inside Effect code — it
|
|
3644
|
+
* carries the `Comparator.parse` tracing span — and for this one at
|
|
3645
|
+
* synchronous boundaries.
|
|
3646
|
+
*
|
|
3647
|
+
* @example
|
|
3648
|
+
* ```ts
|
|
3649
|
+
* import { Comparator } from "@effected/semver";
|
|
3650
|
+
* import { Result } from "effect";
|
|
3651
|
+
*
|
|
3652
|
+
* const ok = Comparator.parseResult(">=1.2.3");
|
|
3653
|
+
* if (Result.isSuccess(ok)) {
|
|
3654
|
+
* console.log(ok.success.operator); // => ">="
|
|
3655
|
+
* }
|
|
3656
|
+
* ```
|
|
3657
|
+
*
|
|
3658
|
+
* @param input - the comparator string to parse
|
|
3659
|
+
* @returns a `Result` succeeding with the parsed {@link Comparator}, or
|
|
3660
|
+
* failing with {@link InvalidComparatorError}.
|
|
3661
|
+
*/
|
|
3662
|
+
static parseResult(input) {
|
|
3552
3663
|
const result = parseComparator(input);
|
|
3553
|
-
if (!result.ok) return
|
|
3664
|
+
if (!result.ok) return Result.fail(new InvalidComparatorError({
|
|
3554
3665
|
input: result.input,
|
|
3555
3666
|
position: result.position
|
|
3556
|
-
});
|
|
3557
|
-
return Comparator.make({
|
|
3667
|
+
}));
|
|
3668
|
+
return Result.succeed(Comparator.make({
|
|
3558
3669
|
operator: result.value.operator,
|
|
3559
3670
|
version: SemVer.make(result.value.version)
|
|
3560
|
-
});
|
|
3561
|
-
}
|
|
3671
|
+
}));
|
|
3672
|
+
}
|
|
3673
|
+
/**
|
|
3674
|
+
* Parse a comparator string (e.g. `">=1.2.3"`). Defined in terms of
|
|
3675
|
+
* {@link Comparator.parseResult} — synchronous callers can use that variant
|
|
3676
|
+
* directly.
|
|
3677
|
+
*
|
|
3678
|
+
* @param input - the comparator string to parse
|
|
3679
|
+
* @returns the parsed {@link Comparator}. Fails with
|
|
3680
|
+
* {@link InvalidComparatorError}.
|
|
3681
|
+
*/
|
|
3682
|
+
static parse = Effect.fn("Comparator.parse")((input) => Effect.fromResult(Comparator.parseResult(input)));
|
|
3562
3683
|
/** Test whether a version satisfies this comparator. */
|
|
3563
3684
|
test(version) {
|
|
3564
3685
|
const cmp = version.compare(this.version);
|
|
@@ -3581,7 +3702,7 @@ var Comparator = class Comparator extends Schema.Class("Comparator")({
|
|
|
3581
3702
|
};
|
|
3582
3703
|
|
|
3583
3704
|
//#endregion
|
|
3584
|
-
//#region ../../node_modules/.pnpm/@effected+semver@0.
|
|
3705
|
+
//#region ../../node_modules/.pnpm/@effected+semver@0.2.0_effect@4.0.0-beta.99/node_modules/@effected/semver/internal/normalize.js
|
|
3585
3706
|
const operatorWeight = (op) => {
|
|
3586
3707
|
switch (op) {
|
|
3587
3708
|
case ">=": return 0;
|
|
@@ -3613,7 +3734,7 @@ const normalizeComparatorSet = (set) => sortComparators(removeDuplicates(set));
|
|
|
3613
3734
|
const normalizeSets = (sets) => sets.map(normalizeComparatorSet);
|
|
3614
3735
|
|
|
3615
3736
|
//#endregion
|
|
3616
|
-
//#region ../../node_modules/.pnpm/@effected+semver@0.
|
|
3737
|
+
//#region ../../node_modules/.pnpm/@effected+semver@0.2.0_effect@4.0.0-beta.99/node_modules/@effected/semver/Range.js
|
|
3617
3738
|
/**
|
|
3618
3739
|
* Indicates that a string could not be parsed as a range expression.
|
|
3619
3740
|
*
|
|
@@ -3673,18 +3794,51 @@ sets: Schema.Array(Schema.Array(Comparator)) }) {
|
|
|
3673
3794
|
},
|
|
3674
3795
|
encode: (parts) => Effect.succeed(formatRange(parts.sets))
|
|
3675
3796
|
})));
|
|
3676
|
-
/**
|
|
3677
|
-
|
|
3797
|
+
/**
|
|
3798
|
+
* Parse a range expression and normalize its comparator sets,
|
|
3799
|
+
* synchronously, returning a `Result` instead of an `Effect`.
|
|
3800
|
+
*
|
|
3801
|
+
* @remarks
|
|
3802
|
+
* {@link Range.parse} is defined in terms of this function; the two never
|
|
3803
|
+
* diverge. Reach for the `Effect` variant inside Effect code — it carries
|
|
3804
|
+
* the `Range.parse` tracing span — and for this one at synchronous
|
|
3805
|
+
* boundaries.
|
|
3806
|
+
*
|
|
3807
|
+
* @example
|
|
3808
|
+
* ```ts
|
|
3809
|
+
* import { Range } from "@effected/semver";
|
|
3810
|
+
* import { Result } from "effect";
|
|
3811
|
+
*
|
|
3812
|
+
* const ok = Range.parseResult("^1.0.0");
|
|
3813
|
+
* if (Result.isSuccess(ok)) {
|
|
3814
|
+
* console.log(ok.success.toString()); // => ">=1.0.0 <2.0.0-0"
|
|
3815
|
+
* }
|
|
3816
|
+
* ```
|
|
3817
|
+
*
|
|
3818
|
+
* @param input - the range expression to parse
|
|
3819
|
+
* @returns a `Result` succeeding with the parsed {@link Range}, or failing
|
|
3820
|
+
* with {@link InvalidRangeError}.
|
|
3821
|
+
*/
|
|
3822
|
+
static parseResult(input) {
|
|
3678
3823
|
const result = parseRange$1(input);
|
|
3679
|
-
if (!result.ok) return
|
|
3824
|
+
if (!result.ok) return Result.fail(new InvalidRangeError({
|
|
3680
3825
|
input: result.input,
|
|
3681
3826
|
position: result.position
|
|
3682
|
-
});
|
|
3683
|
-
return Range.make({ sets: normalizeSets(result.value).map((set) => set.map((c) => Comparator.make({
|
|
3827
|
+
}));
|
|
3828
|
+
return Result.succeed(Range.make({ sets: normalizeSets(result.value).map((set) => set.map((c) => Comparator.make({
|
|
3684
3829
|
operator: c.operator,
|
|
3685
3830
|
version: SemVer.make(c.version)
|
|
3686
|
-
}))) });
|
|
3687
|
-
}
|
|
3831
|
+
}))) }));
|
|
3832
|
+
}
|
|
3833
|
+
/**
|
|
3834
|
+
* Parse a range expression and normalize its comparator sets. Defined in
|
|
3835
|
+
* terms of {@link Range.parseResult} — synchronous callers can use that
|
|
3836
|
+
* variant directly.
|
|
3837
|
+
*
|
|
3838
|
+
* @param input - the range expression to parse
|
|
3839
|
+
* @returns the parsed {@link Range}. Fails with {@link InvalidRangeError}.
|
|
3840
|
+
*/
|
|
3841
|
+
static parse = Effect.fn("Range.parse")((input) => Effect.fromResult(Range.parseResult(input)));
|
|
3688
3842
|
/**
|
|
3689
3843
|
* Test whether a version satisfies a range; see {@link Range.test} for the
|
|
3690
3844
|
* prerelease matching rule. Dual API.
|
|
@@ -3711,19 +3865,49 @@ sets: Schema.Array(Schema.Array(Comparator)) }) {
|
|
|
3711
3865
|
static union = Function.dual(2, (self, that) => Range.make({ sets: [...self.sets, ...that.sets] }));
|
|
3712
3866
|
/**
|
|
3713
3867
|
* Intersect two ranges via a cross-product of their comparator sets,
|
|
3714
|
-
* keeping only satisfiable combinations
|
|
3868
|
+
* keeping only satisfiable combinations, synchronously, returning a
|
|
3869
|
+
* `Result` instead of an `Effect`. Fails with
|
|
3715
3870
|
* {@link UnsatisfiableConstraintError} when no satisfiable set remains —
|
|
3716
3871
|
* an honest typed failure instead of an unsatisfiable range. Dual API.
|
|
3872
|
+
*
|
|
3873
|
+
* @remarks
|
|
3874
|
+
* {@link Range.intersect} is defined in terms of this function; the two
|
|
3875
|
+
* never diverge. Reach for the `Effect` variant inside Effect code — it
|
|
3876
|
+
* carries the `Range.intersect` tracing span — and for this one at
|
|
3877
|
+
* synchronous boundaries.
|
|
3878
|
+
*
|
|
3879
|
+
* @example
|
|
3880
|
+
* ```ts
|
|
3881
|
+
* import { Range } from "@effected/semver";
|
|
3882
|
+
* import { Result } from "effect";
|
|
3883
|
+
*
|
|
3884
|
+
* const a = Result.getOrThrow(Range.parseResult("^1.0.0"));
|
|
3885
|
+
* const b = Result.getOrThrow(Range.parseResult(">=1.5.0"));
|
|
3886
|
+
* const merged = Range.intersectResult(a, b);
|
|
3887
|
+
* if (Result.isSuccess(merged)) {
|
|
3888
|
+
* console.log(merged.success.toString()); // => ">=1.0.0 <2.0.0-0 >=1.5.0"
|
|
3889
|
+
* }
|
|
3890
|
+
* ```
|
|
3717
3891
|
*/
|
|
3718
|
-
static
|
|
3892
|
+
static intersectResult = Function.dual(2, (self, that) => {
|
|
3719
3893
|
const candidates = [];
|
|
3720
3894
|
for (const setA of self.sets) for (const setB of that.sets) {
|
|
3721
3895
|
const merged = [...setA, ...setB];
|
|
3722
3896
|
if (isSetSatisfiable(merged)) candidates.push(merged);
|
|
3723
3897
|
}
|
|
3724
|
-
if (candidates.length === 0) return
|
|
3725
|
-
return Range.make({ sets: candidates });
|
|
3726
|
-
})
|
|
3898
|
+
if (candidates.length === 0) return Result.fail(new UnsatisfiableConstraintError({ constraints: [self, that] }));
|
|
3899
|
+
return Result.succeed(Range.make({ sets: candidates }));
|
|
3900
|
+
});
|
|
3901
|
+
/**
|
|
3902
|
+
* Intersect two ranges via a cross-product of their comparator sets,
|
|
3903
|
+
* keeping only satisfiable combinations. Fails with
|
|
3904
|
+
* {@link UnsatisfiableConstraintError} when no satisfiable set remains —
|
|
3905
|
+
* an honest typed failure instead of an unsatisfiable range. Dual API.
|
|
3906
|
+
*
|
|
3907
|
+
* Defined in terms of {@link Range.intersectResult} — synchronous callers
|
|
3908
|
+
* can use that variant directly.
|
|
3909
|
+
*/
|
|
3910
|
+
static intersect = Function.dual(2, Effect.fn("Range.intersect")((self, that) => Effect.fromResult(Range.intersectResult(self, that))));
|
|
3727
3911
|
/**
|
|
3728
3912
|
* Check whether every version matched by `sub` is also matched by `sup`.
|
|
3729
3913
|
* Dual API.
|
|
@@ -3883,7 +4067,7 @@ const isComparatorSetSubset = (sub, sup) => {
|
|
|
3883
4067
|
};
|
|
3884
4068
|
|
|
3885
4069
|
//#endregion
|
|
3886
|
-
//#region ../../node_modules/.pnpm/@effected+npm@0.
|
|
4070
|
+
//#region ../../node_modules/.pnpm/@effected+npm@0.3.0_@effected+semver@0.2.0_effect@4.0.0-beta.99__effect@4.0.0-beta.99/node_modules/@effected/npm/DependencySpecifier.js
|
|
3887
4071
|
/**
|
|
3888
4072
|
* Indicates that a string could not be parsed as a valid dependency specifier.
|
|
3889
4073
|
*
|
|
@@ -4091,7 +4275,7 @@ const DependencySpecifier = Object.assign(brandedSpecifier, {
|
|
|
4091
4275
|
});
|
|
4092
4276
|
|
|
4093
4277
|
//#endregion
|
|
4094
|
-
//#region ../../node_modules/.pnpm/@effected+npm@0.
|
|
4278
|
+
//#region ../../node_modules/.pnpm/@effected+npm@0.3.0_@effected+semver@0.2.0_effect@4.0.0-beta.99__effect@4.0.0-beta.99/node_modules/@effected/npm/IntegrityHash.js
|
|
4095
4279
|
const SRI_RE = /^(sha1|sha256|sha384|sha512)-[A-Za-z0-9+/]+={0,2}$/;
|
|
4096
4280
|
const COREPACK_RE = /^(sha1|sha256|sha384|sha512)\.[0-9a-f]+$/;
|
|
4097
4281
|
const YARN_RE = /^[0-9]+(c[0-9]+)?\/[0-9a-f]+$/;
|
|
@@ -4145,7 +4329,176 @@ const IntegrityHash = Object.assign(brandedIntegrity, {
|
|
|
4145
4329
|
});
|
|
4146
4330
|
|
|
4147
4331
|
//#endregion
|
|
4148
|
-
//#region ../../node_modules/.pnpm/@effected+
|
|
4332
|
+
//#region ../../node_modules/.pnpm/@effected+npm@0.3.0_@effected+semver@0.2.0_effect@4.0.0-beta.99__effect@4.0.0-beta.99/node_modules/@effected/npm/ReleaseAgeGate.js
|
|
4333
|
+
const MS_PER_MINUTE = 6e4;
|
|
4334
|
+
/**
|
|
4335
|
+
* A source's partial contribution to a {@link ReleaseAgeGate}: the effective
|
|
4336
|
+
* gate is assembled from more than one place (inline `pnpm-workspace.yaml`
|
|
4337
|
+
* keys, replayed `updateConfig` hooks, `pnpm config get` output), and each
|
|
4338
|
+
* source may set the age, the exclude list, both, or neither. Absent fields
|
|
4339
|
+
* contribute nothing to the combination.
|
|
4340
|
+
*
|
|
4341
|
+
* Deliberately permissive: unlike {@link ReleaseAgeGate} it does not constrain
|
|
4342
|
+
* `ageMinutes` to be non-negative, because the raw values arrive from arbitrary
|
|
4343
|
+
* config sources and {@link ReleaseAgeGate.combine} is the single authority
|
|
4344
|
+
* that clamps them.
|
|
4345
|
+
*
|
|
4346
|
+
* @public
|
|
4347
|
+
*/
|
|
4348
|
+
const PartialReleaseAgeGate = Schema.Struct({
|
|
4349
|
+
/** Minutes a release must age; absent means this source sets no age. */
|
|
4350
|
+
ageMinutes: Schema.optionalKey(Schema.Number),
|
|
4351
|
+
/** Exempt package-name patterns; absent means this source adds no exemptions. */
|
|
4352
|
+
exclude: Schema.optionalKey(Schema.Array(Schema.String))
|
|
4353
|
+
});
|
|
4354
|
+
const AgeMinutes = Schema.Number.check(Schema.isGreaterThanOrEqualTo(0), Schema.isFinite());
|
|
4355
|
+
const matchesPattern = (name, pattern) => {
|
|
4356
|
+
if (pattern === name) return true;
|
|
4357
|
+
if (!pattern.includes("*")) return false;
|
|
4358
|
+
let nameIndex = 0;
|
|
4359
|
+
let patternIndex = 0;
|
|
4360
|
+
let starIndex = -1;
|
|
4361
|
+
let retryNameIndex = 0;
|
|
4362
|
+
while (nameIndex < name.length) if (pattern[patternIndex] === "*") {
|
|
4363
|
+
starIndex = patternIndex;
|
|
4364
|
+
patternIndex += 1;
|
|
4365
|
+
retryNameIndex = nameIndex;
|
|
4366
|
+
} else if (pattern[patternIndex] === name[nameIndex]) {
|
|
4367
|
+
patternIndex += 1;
|
|
4368
|
+
nameIndex += 1;
|
|
4369
|
+
} else if (starIndex !== -1) {
|
|
4370
|
+
patternIndex = starIndex + 1;
|
|
4371
|
+
retryNameIndex += 1;
|
|
4372
|
+
nameIndex = retryNameIndex;
|
|
4373
|
+
} else return false;
|
|
4374
|
+
while (pattern[patternIndex] === "*") patternIndex += 1;
|
|
4375
|
+
return patternIndex === pattern.length;
|
|
4376
|
+
};
|
|
4377
|
+
const matchesExclude = (name, patterns) => patterns.some((pattern) => matchesPattern(name, pattern));
|
|
4378
|
+
/**
|
|
4379
|
+
* pnpm's publish-time release-age gate: the number of minutes a published
|
|
4380
|
+
* version must age before it is eligible, and the set of package-name patterns
|
|
4381
|
+
* exempt from the gate. Mirrors pnpm's `minimumReleaseAge` /
|
|
4382
|
+
* `minimumReleaseAgeExclude` config so a resolver can drop too-young candidate
|
|
4383
|
+
* versions before picking, avoiding `ERR_PNPM_NO_MATURE_MATCHING_VERSION`.
|
|
4384
|
+
*
|
|
4385
|
+
* `ageMinutes` is constrained non-negative and finite; a `ReleaseAgeGate` with
|
|
4386
|
+
* `ageMinutes <= 0` is an inert gate that filters nothing. Assemble a gate from
|
|
4387
|
+
* multiple config sources with {@link ReleaseAgeGate.combine}, and apply it to
|
|
4388
|
+
* a package's candidate versions with {@link ReleaseAgeGate.filterVersions}.
|
|
4389
|
+
*
|
|
4390
|
+
* @example
|
|
4391
|
+
* ```ts
|
|
4392
|
+
* import { ReleaseAgeGate } from "@effected/npm";
|
|
4393
|
+
*
|
|
4394
|
+
* const gate = ReleaseAgeGate.combine(
|
|
4395
|
+
* { ageMinutes: 1440 },
|
|
4396
|
+
* { exclude: ["@my-scope/*"] },
|
|
4397
|
+
* );
|
|
4398
|
+
* // gate.ageMinutes === 1440, gate.exclude === ["@my-scope/*"]
|
|
4399
|
+
*
|
|
4400
|
+
* const eligible = gate.filterVersions(
|
|
4401
|
+
* ["1.0.0", "1.0.1"],
|
|
4402
|
+
* { "1.0.0": "2020-01-01T00:00:00Z", "1.0.1": "2026-07-21T00:00:00Z" },
|
|
4403
|
+
* "prettier",
|
|
4404
|
+
* Date.now(),
|
|
4405
|
+
* );
|
|
4406
|
+
* ```
|
|
4407
|
+
*
|
|
4408
|
+
* @public
|
|
4409
|
+
*/
|
|
4410
|
+
var ReleaseAgeGate = class ReleaseAgeGate extends Schema.Class("ReleaseAgeGate")({
|
|
4411
|
+
/** Minutes a published version must age before it is eligible (non-negative, finite). */
|
|
4412
|
+
ageMinutes: AgeMinutes,
|
|
4413
|
+
/** Package-name patterns exempt from the gate (exact names or `*`-globs). */
|
|
4414
|
+
exclude: Schema.Array(Schema.String)
|
|
4415
|
+
}) {
|
|
4416
|
+
/**
|
|
4417
|
+
* Combine partial contributions from multiple sources into one effective
|
|
4418
|
+
* gate: **strictest age wins** (the maximum of the contributed ages,
|
|
4419
|
+
* clamped to be non-negative) and the exclude sets **union** (deduplicated,
|
|
4420
|
+
* insertion order preserved). A contribution's absent field adds nothing; a
|
|
4421
|
+
* negative or non-finite contributed age is ignored by the clamp. With no
|
|
4422
|
+
* contributions (or only empty ones) the result is the inert zero gate
|
|
4423
|
+
* (`ageMinutes: 0`, `exclude: []`).
|
|
4424
|
+
*
|
|
4425
|
+
* `combine` is total — it never throws on a fractional, negative, or
|
|
4426
|
+
* non-finite contribution — which is why {@link (PartialReleaseAgeGate:variable)}
|
|
4427
|
+
* does not constrain its `ageMinutes` and this method owns the clamp.
|
|
4428
|
+
*
|
|
4429
|
+
* @param contributions - the partial gates to merge, one per source.
|
|
4430
|
+
*/
|
|
4431
|
+
static combine(...contributions) {
|
|
4432
|
+
const ages = contributions.map((contribution) => contribution.ageMinutes).filter((age) => typeof age === "number" && Number.isFinite(age));
|
|
4433
|
+
const ageMinutes = ages.length > 0 ? Math.max(0, ...ages) : 0;
|
|
4434
|
+
const exclude = [...new Set(contributions.flatMap((contribution) => contribution.exclude ?? []))];
|
|
4435
|
+
return ReleaseAgeGate.make({
|
|
4436
|
+
ageMinutes,
|
|
4437
|
+
exclude
|
|
4438
|
+
});
|
|
4439
|
+
}
|
|
4440
|
+
/**
|
|
4441
|
+
* Whether a package name matches any of `patterns`, using pnpm's
|
|
4442
|
+
* `@pnpm/matcher` semantics: an exact-name match, or a `*`-glob where `*`
|
|
4443
|
+
* matches any run of characters **including `/`** — so a bare `*` matches a
|
|
4444
|
+
* scoped name like `@scope/pkg`, and `@scope/*` matches every package in a
|
|
4445
|
+
* scope.
|
|
4446
|
+
*
|
|
4447
|
+
* @remarks
|
|
4448
|
+
* This is deliberately **NOT** `@effected/glob`'s minimatch dialect, in
|
|
4449
|
+
* which `*` refuses to cross `/` (there `*` matches `pkg` but not
|
|
4450
|
+
* `@scope/pkg`, and you would need `**`). pnpm treats the package name as a
|
|
4451
|
+
* flat string, so this matcher does too. Do not "fix" this to route through
|
|
4452
|
+
* `@effected/glob`: it would silently change which packages a gate exempts
|
|
4453
|
+
* and diverge from pnpm's own behavior.
|
|
4454
|
+
*
|
|
4455
|
+
* @param name - the package name to test.
|
|
4456
|
+
* @param patterns - the exclude patterns (exact names or `*`-globs).
|
|
4457
|
+
*/
|
|
4458
|
+
static matchesExclude(name, patterns) {
|
|
4459
|
+
return matchesExclude(name, patterns);
|
|
4460
|
+
}
|
|
4461
|
+
/**
|
|
4462
|
+
* Whether this gate exempts the given package name from the release-age
|
|
4463
|
+
* check — `ReleaseAgeGate.matchesExclude(name, this.exclude)`.
|
|
4464
|
+
*
|
|
4465
|
+
* @param name - the package name to test.
|
|
4466
|
+
*/
|
|
4467
|
+
isExcluded(name) {
|
|
4468
|
+
return matchesExclude(name, this.exclude);
|
|
4469
|
+
}
|
|
4470
|
+
/**
|
|
4471
|
+
* Filter a package's candidate versions to those old enough to pass the
|
|
4472
|
+
* gate, given each version's publish timestamp and a caller-supplied `now`.
|
|
4473
|
+
*
|
|
4474
|
+
* A version is kept when it has a parseable publish timestamp at or before
|
|
4475
|
+
* the cutoff (`now - ageMinutes * 60000`). A version with a **missing or
|
|
4476
|
+
* unparseable** timestamp in `times` is **dropped** — matching pnpm's strict
|
|
4477
|
+
* posture: a version whose age cannot be established is treated as too young.
|
|
4478
|
+
* The clock is the caller's; this method reads no wall clock.
|
|
4479
|
+
*
|
|
4480
|
+
* Returns all versions unchanged (a no-op) when the gate is inert
|
|
4481
|
+
* (`ageMinutes <= 0`) or the package name is excluded.
|
|
4482
|
+
*
|
|
4483
|
+
* @param versions - the candidate version strings.
|
|
4484
|
+
* @param times - a map from version string to its ISO-8601 publish date.
|
|
4485
|
+
* @param name - the package name (checked against the gate's `exclude` list).
|
|
4486
|
+
* @param now - the current time in epoch milliseconds (the caller's clock).
|
|
4487
|
+
*/
|
|
4488
|
+
filterVersions(versions, times, name, now) {
|
|
4489
|
+
if (this.ageMinutes <= 0 || this.isExcluded(name)) return versions;
|
|
4490
|
+
const cutoff = now - this.ageMinutes * MS_PER_MINUTE;
|
|
4491
|
+
return versions.filter((version) => {
|
|
4492
|
+
const time = times[version];
|
|
4493
|
+
if (time === void 0) return false;
|
|
4494
|
+
const published = Date.parse(time);
|
|
4495
|
+
return Number.isFinite(published) && published <= cutoff;
|
|
4496
|
+
});
|
|
4497
|
+
}
|
|
4498
|
+
};
|
|
4499
|
+
|
|
4500
|
+
//#endregion
|
|
4501
|
+
//#region ../../node_modules/.pnpm/@effected+lockfiles@0.1.9_@effected+jsonc@0.5.0_effect@4.0.0-beta.99__@effected+npm@0.3_d470055e7ca4b6a23d413cae592e2835/node_modules/@effected/lockfiles/ImporterDependency.js
|
|
4149
4502
|
/**
|
|
4150
4503
|
* One declared dependency of one workspace importer, as the lockfile records it.
|
|
4151
4504
|
*
|
|
@@ -4174,7 +4527,7 @@ var ImporterDependency = class extends Schema.Class("ImporterDependency")({
|
|
|
4174
4527
|
}) {};
|
|
4175
4528
|
|
|
4176
4529
|
//#endregion
|
|
4177
|
-
//#region ../../node_modules/.pnpm/@effected+lockfiles@0.1.
|
|
4530
|
+
//#region ../../node_modules/.pnpm/@effected+lockfiles@0.1.9_@effected+jsonc@0.5.0_effect@4.0.0-beta.99__@effected+npm@0.3_d470055e7ca4b6a23d413cae592e2835/node_modules/@effected/lockfiles/LockfileImporter.js
|
|
4178
4531
|
/**
|
|
4179
4532
|
* One workspace importer's declared dependencies, as the lockfile records them.
|
|
4180
4533
|
*
|
|
@@ -4199,7 +4552,7 @@ var LockfileImporter = class extends Schema.Class("LockfileImporter")({
|
|
|
4199
4552
|
}) {};
|
|
4200
4553
|
|
|
4201
4554
|
//#endregion
|
|
4202
|
-
//#region ../../node_modules/.pnpm/@effected+lockfiles@0.1.
|
|
4555
|
+
//#region ../../node_modules/.pnpm/@effected+lockfiles@0.1.9_@effected+jsonc@0.5.0_effect@4.0.0-beta.99__@effected+npm@0.3_d470055e7ca4b6a23d413cae592e2835/node_modules/@effected/lockfiles/ResolvedPackage.js
|
|
4203
4556
|
const EMPTY_DEPENDENCIES = {};
|
|
4204
4557
|
/**
|
|
4205
4558
|
* A package resolved from a lockfile.
|
|
@@ -4235,7 +4588,7 @@ var ResolvedPackage = class extends Schema.Class("ResolvedPackage")({
|
|
|
4235
4588
|
}) {};
|
|
4236
4589
|
|
|
4237
4590
|
//#endregion
|
|
4238
|
-
//#region ../../node_modules/.pnpm/@effected+lockfiles@0.1.
|
|
4591
|
+
//#region ../../node_modules/.pnpm/@effected+lockfiles@0.1.9_@effected+jsonc@0.5.0_effect@4.0.0-beta.99__@effected+npm@0.3_d470055e7ca4b6a23d413cae592e2835/node_modules/@effected/lockfiles/WorkspaceDependency.js
|
|
4239
4592
|
/**
|
|
4240
4593
|
* A directed dependency edge between two workspace packages as recorded in
|
|
4241
4594
|
* the lockfile.
|
|
@@ -4258,7 +4611,7 @@ var WorkspaceDependency = class extends Schema.Class("WorkspaceDependency")({
|
|
|
4258
4611
|
}) {};
|
|
4259
4612
|
|
|
4260
4613
|
//#endregion
|
|
4261
|
-
//#region ../../node_modules/.pnpm/@effected+lockfiles@0.1.
|
|
4614
|
+
//#region ../../node_modules/.pnpm/@effected+lockfiles@0.1.9_@effected+jsonc@0.5.0_effect@4.0.0-beta.99__@effected+npm@0.3_d470055e7ca4b6a23d413cae592e2835/node_modules/@effected/lockfiles/PnpmExtension.js
|
|
4262
4615
|
/**
|
|
4263
4616
|
* Extension data specific to pnpm lockfiles, attached to `Lockfile.extension`
|
|
4264
4617
|
* when the format is `"pnpm"`.
|
|
@@ -4284,7 +4637,7 @@ var PnpmExtension = class extends Schema.Class("PnpmExtension")({
|
|
|
4284
4637
|
}) {};
|
|
4285
4638
|
|
|
4286
4639
|
//#endregion
|
|
4287
|
-
//#region ../../node_modules/.pnpm/@effected+lockfiles@0.1.
|
|
4640
|
+
//#region ../../node_modules/.pnpm/@effected+lockfiles@0.1.9_@effected+jsonc@0.5.0_effect@4.0.0-beta.99__@effected+npm@0.3_d470055e7ca4b6a23d413cae592e2835/node_modules/@effected/lockfiles/LockfileFormat.js
|
|
4288
4641
|
/**
|
|
4289
4642
|
* The lockfile formats this package parses: bun's `bun.lock` (JSONC), npm's
|
|
4290
4643
|
* `package-lock.json` (v2/v3 JSON), pnpm's `pnpm-lock.yaml` and yarn Berry's
|
|
@@ -4319,7 +4672,7 @@ const FILENAMES = {
|
|
|
4319
4672
|
const filenameFor = (format) => FILENAMES[format];
|
|
4320
4673
|
|
|
4321
4674
|
//#endregion
|
|
4322
|
-
//#region ../../node_modules/.pnpm/@effected+lockfiles@0.1.
|
|
4675
|
+
//#region ../../node_modules/.pnpm/@effected+lockfiles@0.1.9_@effected+jsonc@0.5.0_effect@4.0.0-beta.99__@effected+npm@0.3_d470055e7ca4b6a23d413cae592e2835/node_modules/@effected/lockfiles/internal/shared.js
|
|
4323
4676
|
/**
|
|
4324
4677
|
* The four dependency sections of a manifest, in a stable order — the shared
|
|
4325
4678
|
* dependency-sections table (v3's `DEP_SECTIONS`). Each entry is both the
|
|
@@ -4446,7 +4799,7 @@ const extractWorkspaceDeps = (workspaces, workspaceNames) => {
|
|
|
4446
4799
|
};
|
|
4447
4800
|
|
|
4448
4801
|
//#endregion
|
|
4449
|
-
//#region ../../node_modules/.pnpm/@effected+jsonc@0.
|
|
4802
|
+
//#region ../../node_modules/.pnpm/@effected+jsonc@0.5.0_effect@4.0.0-beta.99/node_modules/@effected/jsonc/JsoncNode.js
|
|
4450
4803
|
/**
|
|
4451
4804
|
* Discriminator values for JSONC AST node types: the JSON value types
|
|
4452
4805
|
* (`string`/`number`/`boolean`/`null`), the structural types
|
|
@@ -4622,7 +4975,7 @@ function evaluateNode(node, depth) {
|
|
|
4622
4975
|
}
|
|
4623
4976
|
|
|
4624
4977
|
//#endregion
|
|
4625
|
-
//#region ../../node_modules/.pnpm/@effected+jsonc@0.
|
|
4978
|
+
//#region ../../node_modules/.pnpm/@effected+jsonc@0.5.0_effect@4.0.0-beta.99/node_modules/@effected/jsonc/internal/scanner.js
|
|
4626
4979
|
const isWhitespace = (ch) => ch === 32 || ch === 9 || ch === 11 || ch === 12 || ch === 160 || ch === 65279;
|
|
4627
4980
|
const isLineBreak$1 = (ch) => ch === 10 || ch === 13 || ch === 8232 || ch === 8233;
|
|
4628
4981
|
const isDigit$1 = (ch) => ch >= 48 && ch <= 57;
|
|
@@ -4919,7 +5272,7 @@ const createScanner$2 = (text, ignoreTrivia = false) => {
|
|
|
4919
5272
|
};
|
|
4920
5273
|
|
|
4921
5274
|
//#endregion
|
|
4922
|
-
//#region ../../node_modules/.pnpm/@effected+jsonc@0.
|
|
5275
|
+
//#region ../../node_modules/.pnpm/@effected+jsonc@0.5.0_effect@4.0.0-beta.99/node_modules/@effected/jsonc/internal/skip.js
|
|
4923
5276
|
/**
|
|
4924
5277
|
* Iteratively consume the value beginning at the cursor's current token and
|
|
4925
5278
|
* return its tight end offset (excludes trailing whitespace/comments).
|
|
@@ -4950,7 +5303,7 @@ const skipBalancedValue = (cursor) => {
|
|
|
4950
5303
|
};
|
|
4951
5304
|
|
|
4952
5305
|
//#endregion
|
|
4953
|
-
//#region ../../node_modules/.pnpm/@effected+jsonc@0.
|
|
5306
|
+
//#region ../../node_modules/.pnpm/@effected+jsonc@0.5.0_effect@4.0.0-beta.99/node_modules/@effected/jsonc/internal/parser.js
|
|
4954
5307
|
/**
|
|
4955
5308
|
* The public parse-error code vocabulary. The facade builds its `@public`
|
|
4956
5309
|
* `JsoncParseErrorCode` schema from this array; the parser produces these codes
|
|
@@ -5364,7 +5717,7 @@ const parseTree$2 = (text, flags) => {
|
|
|
5364
5717
|
};
|
|
5365
5718
|
|
|
5366
5719
|
//#endregion
|
|
5367
|
-
//#region ../../node_modules/.pnpm/@effected+jsonc@0.
|
|
5720
|
+
//#region ../../node_modules/.pnpm/@effected+jsonc@0.5.0_effect@4.0.0-beta.99/node_modules/@effected/jsonc/Jsonc.js
|
|
5368
5721
|
/**
|
|
5369
5722
|
* The single public parse-error code vocabulary, appearing as the `code` field
|
|
5370
5723
|
* of {@link JsoncParseErrorDetail}.
|
|
@@ -5614,9 +5967,57 @@ var Jsonc = class Jsonc {
|
|
|
5614
5967
|
*/
|
|
5615
5968
|
static parse = Effect.fn("Jsonc.parse")((text, options) => Effect.fromResult(Jsonc.parseResult(text, options)));
|
|
5616
5969
|
/**
|
|
5970
|
+
* Parse JSONC into an immutable {@link JsoncNode} AST, synchronously,
|
|
5971
|
+
* returning a `Result` instead of an `Effect`. `Option.none()` for empty
|
|
5972
|
+
* input (with `allowEmptyContent`); the aggregate {@link JsoncParseError}
|
|
5973
|
+
* for malformed input. Pure — parsing is fundamentally synchronous, so
|
|
5974
|
+
* non-Effect consumers (a plain config loader, a build script) can call
|
|
5975
|
+
* this directly instead of wrapping
|
|
5976
|
+
* `Effect.runSync(Effect.result(Jsonc.parseTree(text)))`.
|
|
5977
|
+
*
|
|
5978
|
+
* @remarks
|
|
5979
|
+
* {@link Jsonc.parseTree} is defined in terms of this function; the two
|
|
5980
|
+
* never diverge. Reach for the `Effect` variant inside Effect code — it
|
|
5981
|
+
* carries the `Jsonc.parseTree` tracing span — and for this one at
|
|
5982
|
+
* synchronous boundaries.
|
|
5983
|
+
*
|
|
5984
|
+
* @example
|
|
5985
|
+
* ```ts
|
|
5986
|
+
* import { Jsonc } from "@effected/jsonc";
|
|
5987
|
+
* import { Option, Result } from "effect";
|
|
5988
|
+
*
|
|
5989
|
+
* const ok = Jsonc.parseTreeResult('{ "port": 3000 // dev\n }');
|
|
5990
|
+
* if (Result.isSuccess(ok) && Option.isSome(ok.success)) {
|
|
5991
|
+
* console.log(ok.success.value.type); // => "object"
|
|
5992
|
+
* }
|
|
5993
|
+
*
|
|
5994
|
+
* const bad = Jsonc.parseTreeResult("{ bad }");
|
|
5995
|
+
* if (Result.isFailure(bad)) {
|
|
5996
|
+
* console.log(bad.failure._tag); // => "JsoncParseError"
|
|
5997
|
+
* }
|
|
5998
|
+
* ```
|
|
5999
|
+
*
|
|
6000
|
+
* @param text - The JSONC source to parse.
|
|
6001
|
+
* @param options - Optional {@link JsoncParseOptions}; defaults apply for
|
|
6002
|
+
* omitted fields.
|
|
6003
|
+
* @returns A `Result` succeeding with `Option.some(root)` (or
|
|
6004
|
+
* `Option.none()` for empty input), or failing with the aggregate
|
|
6005
|
+
* {@link JsoncParseError}.
|
|
6006
|
+
*/
|
|
6007
|
+
static parseTreeResult(text, options) {
|
|
6008
|
+
const { root, errors } = parseTree$2(text, toFlags(options));
|
|
6009
|
+
if (errors.length > 0) return Result.fail(new JsoncParseError({
|
|
6010
|
+
errors: toDetails(text, errors),
|
|
6011
|
+
input: text
|
|
6012
|
+
}));
|
|
6013
|
+
return Result.succeed(root !== void 0 ? Option.some(root) : Option.none());
|
|
6014
|
+
}
|
|
6015
|
+
/**
|
|
5617
6016
|
* Parse JSONC into an immutable {@link JsoncNode} AST. `Option.none()` for
|
|
5618
6017
|
* empty input (with `allowEmptyContent`); the aggregate
|
|
5619
|
-
* {@link JsoncParseError} for malformed input.
|
|
6018
|
+
* {@link JsoncParseError} for malformed input. Defined in terms of
|
|
6019
|
+
* {@link Jsonc.parseTreeResult} — synchronous callers can use that variant
|
|
6020
|
+
* directly.
|
|
5620
6021
|
*
|
|
5621
6022
|
* @param text - The JSONC source to parse.
|
|
5622
6023
|
* @param options - Optional {@link JsoncParseOptions}; defaults apply for
|
|
@@ -5625,14 +6026,7 @@ var Jsonc = class Jsonc {
|
|
|
5625
6026
|
* `Option.none()` for empty input), or fails with the aggregate
|
|
5626
6027
|
* {@link JsoncParseError}.
|
|
5627
6028
|
*/
|
|
5628
|
-
static parseTree = Effect.fn("Jsonc.parseTree")(
|
|
5629
|
-
const { root, errors } = parseTree$2(text, toFlags(options));
|
|
5630
|
-
if (errors.length > 0) return yield* new JsoncParseError({
|
|
5631
|
-
errors: toDetails(text, errors),
|
|
5632
|
-
input: text
|
|
5633
|
-
});
|
|
5634
|
-
return root !== void 0 ? Option.some(root) : Option.none();
|
|
5635
|
-
});
|
|
6029
|
+
static parseTree = Effect.fn("Jsonc.parseTree")((text, options) => Effect.fromResult(Jsonc.parseTreeResult(text, options)));
|
|
5636
6030
|
/**
|
|
5637
6031
|
* Stringify a plain JavaScript value as JSON text, synchronously, returning
|
|
5638
6032
|
* a `Result` instead of an `Effect`. With no options the output is
|
|
@@ -5892,7 +6286,7 @@ var Jsonc = class Jsonc {
|
|
|
5892
6286
|
};
|
|
5893
6287
|
|
|
5894
6288
|
//#endregion
|
|
5895
|
-
//#region ../../node_modules/.pnpm/@effected+jsonc@0.
|
|
6289
|
+
//#region ../../node_modules/.pnpm/@effected+jsonc@0.5.0_effect@4.0.0-beta.99/node_modules/@effected/jsonc/JsoncEdit.js
|
|
5896
6290
|
/**
|
|
5897
6291
|
* A range within a JSONC document, expressed as a zero-based character
|
|
5898
6292
|
* `offset` and a `length` in UTF-16 code units. Pass to `JsoncFormatter.format`
|
|
@@ -5963,7 +6357,7 @@ var JsoncEdit = class extends Schema.Class("JsoncEdit")({
|
|
|
5963
6357
|
};
|
|
5964
6358
|
|
|
5965
6359
|
//#endregion
|
|
5966
|
-
//#region ../../node_modules/.pnpm/@effected+jsonc@0.
|
|
6360
|
+
//#region ../../node_modules/.pnpm/@effected+jsonc@0.5.0_effect@4.0.0-beta.99/node_modules/@effected/jsonc/internal/navigate.js
|
|
5967
6361
|
/**
|
|
5968
6362
|
* Resolve `path` against `text`, returning where the target is (or where it
|
|
5969
6363
|
* would be inserted). `path` must be non-empty — the whole-document case is
|
|
@@ -6091,7 +6485,7 @@ function navigate(text, path) {
|
|
|
6091
6485
|
}
|
|
6092
6486
|
|
|
6093
6487
|
//#endregion
|
|
6094
|
-
//#region ../../node_modules/.pnpm/@effected+jsonc@0.
|
|
6488
|
+
//#region ../../node_modules/.pnpm/@effected+jsonc@0.5.0_effect@4.0.0-beta.99/node_modules/@effected/jsonc/JsoncModifier.js
|
|
6095
6489
|
/**
|
|
6096
6490
|
* Raised when `JsoncModifier.modify` cannot navigate the requested path: the
|
|
6097
6491
|
* value at `depth` is not the container kind (`expected`) the next path segment
|
|
@@ -6220,7 +6614,7 @@ var JsoncModifier = class {
|
|
|
6220
6614
|
};
|
|
6221
6615
|
|
|
6222
6616
|
//#endregion
|
|
6223
|
-
//#region ../../node_modules/.pnpm/@effected+lockfiles@0.1.
|
|
6617
|
+
//#region ../../node_modules/.pnpm/@effected+lockfiles@0.1.9_@effected+jsonc@0.5.0_effect@4.0.0-beta.99__@effected+npm@0.3_d470055e7ca4b6a23d413cae592e2835/node_modules/@effected/lockfiles/internal/bun.js
|
|
6224
6618
|
const DepRecord$2 = Schema.optionalKey(Schema.Record(Schema.String, Schema.String));
|
|
6225
6619
|
const BunWorkspaceEntry = Schema.Struct({
|
|
6226
6620
|
name: Schema.optionalKey(Schema.String),
|
|
@@ -6314,7 +6708,7 @@ const toFields$3 = (raw) => Effect.gen(function* () {
|
|
|
6314
6708
|
});
|
|
6315
6709
|
|
|
6316
6710
|
//#endregion
|
|
6317
|
-
//#region ../../node_modules/.pnpm/@effected+lockfiles@0.1.
|
|
6711
|
+
//#region ../../node_modules/.pnpm/@effected+lockfiles@0.1.9_@effected+jsonc@0.5.0_effect@4.0.0-beta.99__@effected+npm@0.3_d470055e7ca4b6a23d413cae592e2835/node_modules/@effected/lockfiles/internal/npm.js
|
|
6318
6712
|
const DepRecord$1 = Schema.optionalKey(Schema.Record(Schema.String, Schema.String));
|
|
6319
6713
|
const NpmPackageEntry = Schema.Struct({
|
|
6320
6714
|
name: Schema.optionalKey(Schema.String),
|
|
@@ -6413,7 +6807,7 @@ const toFields$2 = (raw) => Effect.gen(function* () {
|
|
|
6413
6807
|
});
|
|
6414
6808
|
|
|
6415
6809
|
//#endregion
|
|
6416
|
-
//#region ../../node_modules/.pnpm/@effected+yaml@0.
|
|
6810
|
+
//#region ../../node_modules/.pnpm/@effected+yaml@0.5.0_effect@4.0.0-beta.99/node_modules/@effected/yaml/YamlNode.js
|
|
6417
6811
|
/**
|
|
6418
6812
|
* YAML scalar presentation styles.
|
|
6419
6813
|
*
|
|
@@ -6433,6 +6827,16 @@ const ScalarStyle = Schema.Literals([
|
|
|
6433
6827
|
*/
|
|
6434
6828
|
const CollectionStyle = Schema.Literals(["block", "flow"]);
|
|
6435
6829
|
/**
|
|
6830
|
+
* Quote characters available to the stringifier's plain-scalar fallback: the
|
|
6831
|
+
* style a `plain`-styled scalar is rendered in when it turns out to require
|
|
6832
|
+
* quoting. Referenced by the `quoteStyle` field of `YamlStringifyOptions`;
|
|
6833
|
+
* unlike `ScalarStyle` it is a stringify-option vocabulary, never a property
|
|
6834
|
+
* of a composed node.
|
|
6835
|
+
*
|
|
6836
|
+
* @public
|
|
6837
|
+
*/
|
|
6838
|
+
const QuoteStyle = Schema.Literals(["single", "double"]);
|
|
6839
|
+
/**
|
|
6436
6840
|
* Block-scalar chomping indicators (`-` strip, default clip, `+` keep).
|
|
6437
6841
|
* Referenced by the {@link YamlScalar} `chomp` field schema.
|
|
6438
6842
|
*
|
|
@@ -6806,7 +7210,7 @@ function nodeToValue(node, anchors, budget, counting = false) {
|
|
|
6806
7210
|
}
|
|
6807
7211
|
|
|
6808
7212
|
//#endregion
|
|
6809
|
-
//#region ../../node_modules/.pnpm/@effected+yaml@0.
|
|
7213
|
+
//#region ../../node_modules/.pnpm/@effected+yaml@0.5.0_effect@4.0.0-beta.99/node_modules/@effected/yaml/internal/diagnostics.js
|
|
6810
7214
|
/** Error codes emitted by the lexer stage. */
|
|
6811
7215
|
const YAML_LEX_ERROR_CODES = [
|
|
6812
7216
|
"UnexpectedCharacter",
|
|
@@ -6885,7 +7289,7 @@ function isFatalCode(code) {
|
|
|
6885
7289
|
}
|
|
6886
7290
|
|
|
6887
7291
|
//#endregion
|
|
6888
|
-
//#region ../../node_modules/.pnpm/@effected+yaml@0.
|
|
7292
|
+
//#region ../../node_modules/.pnpm/@effected+yaml@0.5.0_effect@4.0.0-beta.99/node_modules/@effected/yaml/YamlDiagnostic.js
|
|
6889
7293
|
/**
|
|
6890
7294
|
* Error codes emitted by the lexer stage.
|
|
6891
7295
|
*
|
|
@@ -7007,7 +7411,7 @@ function lineChar(text, offset) {
|
|
|
7007
7411
|
}
|
|
7008
7412
|
|
|
7009
7413
|
//#endregion
|
|
7010
|
-
//#region ../../node_modules/.pnpm/@effected+yaml@0.
|
|
7414
|
+
//#region ../../node_modules/.pnpm/@effected+yaml@0.5.0_effect@4.0.0-beta.99/node_modules/@effected/yaml/internal/composer/anchors.js
|
|
7011
7415
|
/**
|
|
7012
7416
|
* Check if a pending anchor is being applied to an alias node (invalid in YAML 1.2 §3.2.2).
|
|
7013
7417
|
* Aliases represent references to existing anchored nodes and cannot have their own anchors.
|
|
@@ -7101,7 +7505,7 @@ function collectAnchors(node, anchors) {
|
|
|
7101
7505
|
}
|
|
7102
7506
|
|
|
7103
7507
|
//#endregion
|
|
7104
|
-
//#region ../../node_modules/.pnpm/@effected+yaml@0.
|
|
7508
|
+
//#region ../../node_modules/.pnpm/@effected+yaml@0.5.0_effect@4.0.0-beta.99/node_modules/@effected/yaml/internal/lexer.js
|
|
7105
7509
|
/**
|
|
7106
7510
|
* Create a new YAML scanner for the given source text.
|
|
7107
7511
|
*
|
|
@@ -8059,7 +8463,7 @@ function lexAll(text) {
|
|
|
8059
8463
|
}
|
|
8060
8464
|
|
|
8061
8465
|
//#endregion
|
|
8062
|
-
//#region ../../node_modules/.pnpm/@effected+yaml@0.
|
|
8466
|
+
//#region ../../node_modules/.pnpm/@effected+yaml@0.5.0_effect@4.0.0-beta.99/node_modules/@effected/yaml/internal/cst-parser.js
|
|
8063
8467
|
/**
|
|
8064
8468
|
* Hardening: cap CST nesting so hostile inputs cannot overflow the stack
|
|
8065
8469
|
* while the tree is being BUILT. Set slightly above the composer's
|
|
@@ -8772,7 +9176,7 @@ function parseCSTAll(text) {
|
|
|
8772
9176
|
}
|
|
8773
9177
|
|
|
8774
9178
|
//#endregion
|
|
8775
|
-
//#region ../../node_modules/.pnpm/@effected+yaml@0.
|
|
9179
|
+
//#region ../../node_modules/.pnpm/@effected+yaml@0.5.0_effect@4.0.0-beta.99/node_modules/@effected/yaml/internal/composer/state.js
|
|
8776
9180
|
let lineStartsText;
|
|
8777
9181
|
let lineStartsCache = [];
|
|
8778
9182
|
function getLineStarts(text) {
|
|
@@ -8879,7 +9283,7 @@ function exitNesting(state) {
|
|
|
8879
9283
|
}
|
|
8880
9284
|
|
|
8881
9285
|
//#endregion
|
|
8882
|
-
//#region ../../node_modules/.pnpm/@effected+yaml@0.
|
|
9286
|
+
//#region ../../node_modules/.pnpm/@effected+yaml@0.5.0_effect@4.0.0-beta.99/node_modules/@effected/yaml/internal/composer/tags.js
|
|
8883
9287
|
/**
|
|
8884
9288
|
* Resolve a tag shorthand using the document's %TAG directives.
|
|
8885
9289
|
* For example, with `%TAG !! tag:example.com,2000:app/`, the tag `!!int`
|
|
@@ -8966,7 +9370,7 @@ function validateTagHandlesInDocument(docCst, state) {
|
|
|
8966
9370
|
}
|
|
8967
9371
|
|
|
8968
9372
|
//#endregion
|
|
8969
|
-
//#region ../../node_modules/.pnpm/@effected+yaml@0.
|
|
9373
|
+
//#region ../../node_modules/.pnpm/@effected+yaml@0.5.0_effect@4.0.0-beta.99/node_modules/@effected/yaml/internal/composer/scalars.js
|
|
8970
9374
|
const NULL_RE$1 = /^(?:null|Null|NULL|~)$/;
|
|
8971
9375
|
const TRUE_RE$1 = /^(?:true|True|TRUE)$/;
|
|
8972
9376
|
const FALSE_RE$1 = /^(?:false|False|FALSE)$/;
|
|
@@ -9845,7 +10249,7 @@ function shouldPreserveRaw(rawValue, value) {
|
|
|
9845
10249
|
}
|
|
9846
10250
|
|
|
9847
10251
|
//#endregion
|
|
9848
|
-
//#region ../../node_modules/.pnpm/@effected+yaml@0.
|
|
10252
|
+
//#region ../../node_modules/.pnpm/@effected+yaml@0.5.0_effect@4.0.0-beta.99/node_modules/@effected/yaml/internal/composer/block.js
|
|
9849
10253
|
/**
|
|
9850
10254
|
* Compose a block map from its CST children, with an optional external first key.
|
|
9851
10255
|
*
|
|
@@ -10994,7 +11398,7 @@ function composeFlatBlockMap(children, startIdx, parentCst, state, externalFirst
|
|
|
10994
11398
|
}
|
|
10995
11399
|
|
|
10996
11400
|
//#endregion
|
|
10997
|
-
//#region ../../node_modules/.pnpm/@effected+yaml@0.
|
|
11401
|
+
//#region ../../node_modules/.pnpm/@effected+yaml@0.5.0_effect@4.0.0-beta.99/node_modules/@effected/yaml/internal/composer/flow.js
|
|
10998
11402
|
/**
|
|
10999
11403
|
* Validate that flow collection entries are separated by commas.
|
|
11000
11404
|
*
|
|
@@ -11387,7 +11791,7 @@ function composeFlowSeqInner(cst, state, meta, parentBlockColumn) {
|
|
|
11387
11791
|
}
|
|
11388
11792
|
|
|
11389
11793
|
//#endregion
|
|
11390
|
-
//#region ../../node_modules/.pnpm/@effected+yaml@0.
|
|
11794
|
+
//#region ../../node_modules/.pnpm/@effected+yaml@0.5.0_effect@4.0.0-beta.99/node_modules/@effected/yaml/internal/composer/document.js
|
|
11391
11795
|
/** The flow-composer dispatch wired into every state this module creates. */
|
|
11392
11796
|
const FLOW = {
|
|
11393
11797
|
composeFlowMap,
|
|
@@ -12054,7 +12458,7 @@ function composeAllDocuments(text, options) {
|
|
|
12054
12458
|
}
|
|
12055
12459
|
|
|
12056
12460
|
//#endregion
|
|
12057
|
-
//#region ../../node_modules/.pnpm/@effected+yaml@0.
|
|
12461
|
+
//#region ../../node_modules/.pnpm/@effected+yaml@0.5.0_effect@4.0.0-beta.99/node_modules/@effected/yaml/internal/fold.js
|
|
12058
12462
|
/**
|
|
12059
12463
|
* Column-based line folding for a single logical scalar line (YAML 1.2 flow
|
|
12060
12464
|
* folding, §7.3 / §8.2.1). Breaks the content at "safe" single-space
|
|
@@ -12291,7 +12695,7 @@ function renderBlockFolded(s, indent) {
|
|
|
12291
12695
|
}
|
|
12292
12696
|
|
|
12293
12697
|
//#endregion
|
|
12294
|
-
//#region ../../node_modules/.pnpm/@effected+yaml@0.
|
|
12698
|
+
//#region ../../node_modules/.pnpm/@effected+yaml@0.5.0_effect@4.0.0-beta.99/node_modules/@effected/yaml/internal/stringifier.js
|
|
12295
12699
|
/**
|
|
12296
12700
|
* Thrown by the stringifier on its failure paths (circular references). The
|
|
12297
12701
|
* facade catches this and materializes the public stringify error.
|
|
@@ -12397,7 +12801,10 @@ function requiresQuoting(s, ignoreType = false) {
|
|
|
12397
12801
|
if (s.includes(" #") || s.includes(" #")) return true;
|
|
12398
12802
|
const last = s[s.length - 1];
|
|
12399
12803
|
if (last === " " || last === " ") return true;
|
|
12400
|
-
for (let i = 0; i < s.length; i++)
|
|
12804
|
+
for (let i = 0; i < s.length; i++) {
|
|
12805
|
+
const code = s.charCodeAt(i);
|
|
12806
|
+
if (code === 9 || code === 13 || isControlChar(code)) return true;
|
|
12807
|
+
}
|
|
12401
12808
|
return false;
|
|
12402
12809
|
}
|
|
12403
12810
|
/**
|
|
@@ -12454,11 +12861,13 @@ function renderSingleQuoted(s) {
|
|
|
12454
12861
|
*
|
|
12455
12862
|
* Multi-line strings are routed to block styles regardless of the requested
|
|
12456
12863
|
* style (except double-quoted). For single-line strings, plain style delegates
|
|
12457
|
-
* to {@link requiresQuoting} and falls back to
|
|
12458
|
-
*
|
|
12459
|
-
*
|
|
12864
|
+
* to {@link requiresQuoting} and falls back to `quoteStyle` (single-quoted by
|
|
12865
|
+
* default, double-quoted when the caller asked for it) — or to double-quoted
|
|
12866
|
+
* regardless when the value needs YAML escapes single quotes cannot express.
|
|
12867
|
+
* Block literal and block folded styles are always accepted for single-line
|
|
12868
|
+
* strings even though the output is unusual.
|
|
12460
12869
|
*/
|
|
12461
|
-
function renderString(s, style, indent, ignoreType = false, canonical = false, explicitChomp, parentPosition) {
|
|
12870
|
+
function renderString(s, style, indent, ignoreType = false, canonical = false, explicitChomp, parentPosition, quoteStyle = "single") {
|
|
12462
12871
|
if (s.includes("\n")) {
|
|
12463
12872
|
let hasControl = false;
|
|
12464
12873
|
for (let i = 0; i < s.length; i++) {
|
|
@@ -12492,7 +12901,7 @@ function renderString(s, style, indent, ignoreType = false, canonical = false, e
|
|
|
12492
12901
|
if (requiresQuoting(s, ignoreType)) {
|
|
12493
12902
|
if (s.includes(" ") || s.includes("\r")) return renderDoubleQuoted(s, canonical);
|
|
12494
12903
|
for (let i = 0; i < s.length; i++) if (isControlChar(s.charCodeAt(i))) return renderDoubleQuoted(s, canonical);
|
|
12495
|
-
return renderSingleQuoted(s);
|
|
12904
|
+
return quoteStyle === "double" ? renderDoubleQuoted(s, canonical) : renderSingleQuoted(s);
|
|
12496
12905
|
}
|
|
12497
12906
|
return s;
|
|
12498
12907
|
case "single-quoted": return renderSingleQuoted(s);
|
|
@@ -12532,6 +12941,7 @@ function createContext(options) {
|
|
|
12532
12941
|
defaultCollectionStyle: options?.defaultCollectionStyle ?? "block",
|
|
12533
12942
|
sortKeys: options?.sortKeys ?? false,
|
|
12534
12943
|
indentSequences: options?.indentSequences ?? false,
|
|
12944
|
+
quoteStyle: options?.quoteStyle ?? "single",
|
|
12535
12945
|
forceDefaultStyles: options?.forceDefaultStyles ?? false,
|
|
12536
12946
|
seen: /* @__PURE__ */ new Set()
|
|
12537
12947
|
};
|
|
@@ -12551,7 +12961,7 @@ function stringifyLines(value, ctx, depth, allowFold = true) {
|
|
|
12551
12961
|
if (typeof value === "bigint") return [value.toString()];
|
|
12552
12962
|
if (typeof value === "string") {
|
|
12553
12963
|
const indentStr = " ".repeat(ctx.indent);
|
|
12554
|
-
const rendered = renderString(value, ctx.defaultScalarStyle, indentStr, false, ctx.forceDefaultStyles);
|
|
12964
|
+
const rendered = renderString(value, ctx.defaultScalarStyle, indentStr, false, ctx.forceDefaultStyles, void 0, void 0, ctx.quoteStyle);
|
|
12555
12965
|
return (allowFold && ctx.lineWidth > 0 ? foldRenderedScalar(rendered, indentStr, ctx.lineWidth) : rendered).split("\n");
|
|
12556
12966
|
}
|
|
12557
12967
|
if (Array.isArray(value)) {
|
|
@@ -12616,10 +13026,11 @@ function stringifyObjectLines(obj, ctx, depth) {
|
|
|
12616
13026
|
const keys = Object.keys(obj);
|
|
12617
13027
|
if (keys.length === 0) return ["{}"];
|
|
12618
13028
|
if (ctx.sortKeys) keys.sort();
|
|
13029
|
+
const renderPlainKey = (k) => renderString(k, "plain", "", false, false, void 0, void 0, ctx.quoteStyle);
|
|
12619
13030
|
if (ctx.defaultCollectionStyle === "flow") return [`{${keys.map((k) => {
|
|
12620
|
-
return `${
|
|
13031
|
+
return `${renderPlainKey(k)}: ${stringifyLines(obj[k], ctx, depth + 1, false).join(" ")}`;
|
|
12621
13032
|
}).join(", ")}}`];
|
|
12622
|
-
const renderKey = (k) => k.includes("\n") ? renderDoubleQuoted(k, ctx.forceDefaultStyles) :
|
|
13033
|
+
const renderKey = (k) => k.includes("\n") ? renderDoubleQuoted(k, ctx.forceDefaultStyles) : renderPlainKey(k);
|
|
12623
13034
|
const pad = " ".repeat(ctx.indent);
|
|
12624
13035
|
const lines = [];
|
|
12625
13036
|
for (const k of keys) {
|
|
@@ -12656,7 +13067,7 @@ function stringifyValue(value, options) {
|
|
|
12656
13067
|
}
|
|
12657
13068
|
|
|
12658
13069
|
//#endregion
|
|
12659
|
-
//#region ../../node_modules/.pnpm/@effected+yaml@0.
|
|
13070
|
+
//#region ../../node_modules/.pnpm/@effected+yaml@0.5.0_effect@4.0.0-beta.99/node_modules/@effected/yaml/Yaml.js
|
|
12660
13071
|
/**
|
|
12661
13072
|
* Options controlling parse behavior. All fields are omissible; absent fields
|
|
12662
13073
|
* resolve to `strict` `true`, `maxAliasCount` `100` (the alias-based
|
|
@@ -12686,8 +13097,8 @@ var YamlParseOptions = class extends Schema.Class("YamlParseOptions")({
|
|
|
12686
13097
|
* Options controlling stringify behavior. All fields are omissible; absent
|
|
12687
13098
|
* fields resolve to `indent` `2`, `lineWidth` `0`, `defaultScalarStyle`
|
|
12688
13099
|
* `"plain"`, `defaultCollectionStyle` `"block"`, `sortKeys` `false`,
|
|
12689
|
-
* `indentSequences` `false`, `
|
|
12690
|
-
* `false`.
|
|
13100
|
+
* `indentSequences` `false`, `quoteStyle` `"single"`, `finalNewline` `true`
|
|
13101
|
+
* and `forceDefaultStyles` `false`.
|
|
12691
13102
|
*
|
|
12692
13103
|
* `lineWidth` controls column-based scalar folding. The default `0` (and any
|
|
12693
13104
|
* value `<= 0`) never wraps, emitting byte-identical output to the historic
|
|
@@ -12704,6 +13115,18 @@ var YamlParseOptions = class extends Schema.Class("YamlParseOptions")({
|
|
|
12704
13115
|
* matching the `yaml` npm package's default output. Top-level sequences stay
|
|
12705
13116
|
* at column zero in both modes.
|
|
12706
13117
|
*
|
|
13118
|
+
* `quoteStyle` selects the quote character used when a `plain`-styled scalar
|
|
13119
|
+
* (the `defaultScalarStyle` default) turns out to require quoting: `"single"`
|
|
13120
|
+
* (the default) emits `'@parcel/watcher'` — the kit's byte-compatible legacy
|
|
13121
|
+
* form — while `"double"` emits `"@parcel/watcher"`, matching the `yaml` npm
|
|
13122
|
+
* package's `singleQuote: false` output. It is a fallback selector only:
|
|
13123
|
+
* scalars that need no quoting stay plain, and an explicit
|
|
13124
|
+
* `defaultScalarStyle` of `"single-quoted"` or `"double-quoted"` still wins.
|
|
13125
|
+
* On that plain fallback path, values carrying a tab, a carriage return or
|
|
13126
|
+
* any other C0 control character are always emitted double-quoted whichever
|
|
13127
|
+
* `quoteStyle` is set, since only double quotes can escape them into a form
|
|
13128
|
+
* that round-trips exactly.
|
|
13129
|
+
*
|
|
12707
13130
|
* Construct with the validated `YamlStringifyOptions.make({ ... })` static —
|
|
12708
13131
|
* the kit convention (never `new`). Call sites that take a
|
|
12709
13132
|
* `YamlStringifyOptions` also accept a structurally-matching plain literal.
|
|
@@ -12729,7 +13152,7 @@ var YamlStringifyOptions = class extends Schema.Class("YamlStringifyOptions")({
|
|
|
12729
13152
|
* (`>`) scalars at approximately that column, never block-literal (`|`).
|
|
12730
13153
|
*
|
|
12731
13154
|
* Takes effect only through {@link Yaml.stringify} and
|
|
12732
|
-
* {@link Yaml.
|
|
13155
|
+
* {@link Yaml.stringifyResult} — the two entry points that accept these
|
|
12733
13156
|
* options on the value path. The schema factories ({@link Yaml.fromString},
|
|
12734
13157
|
* {@link Yaml.schema}, {@link Yaml.YamlFromString}) encode with default
|
|
12735
13158
|
* stringify options (`lineWidth` `0`), so their output never folds. The
|
|
@@ -12742,6 +13165,17 @@ var YamlStringifyOptions = class extends Schema.Class("YamlStringifyOptions")({
|
|
|
12742
13165
|
defaultCollectionStyle: Schema.optionalKey(CollectionStyle),
|
|
12743
13166
|
sortKeys: Schema.optionalKey(Schema.Boolean),
|
|
12744
13167
|
indentSequences: Schema.optionalKey(Schema.Boolean),
|
|
13168
|
+
/**
|
|
13169
|
+
* Quote style used when a `plain`-styled scalar requires quoting. Default
|
|
13170
|
+
* `"single"` — the released byte-compatible behavior. `"double"` renders
|
|
13171
|
+
* the same scalars double-quoted instead, matching the `yaml` npm
|
|
13172
|
+
* package's `singleQuote: false` output.
|
|
13173
|
+
*
|
|
13174
|
+
* Affects only the plain fallback: scalars that need no quoting stay
|
|
13175
|
+
* plain, and an explicit `defaultScalarStyle` of `"single-quoted"` or
|
|
13176
|
+
* `"double-quoted"` is unaffected.
|
|
13177
|
+
*/
|
|
13178
|
+
quoteStyle: Schema.optionalKey(QuoteStyle),
|
|
12745
13179
|
finalNewline: Schema.optionalKey(Schema.Boolean),
|
|
12746
13180
|
forceDefaultStyles: Schema.optionalKey(Schema.Boolean)
|
|
12747
13181
|
}) {};
|
|
@@ -12791,6 +13225,7 @@ const toStringifyInput = (options) => options === void 0 ? {} : {
|
|
|
12791
13225
|
defaultCollectionStyle: options.defaultCollectionStyle,
|
|
12792
13226
|
sortKeys: options.sortKeys,
|
|
12793
13227
|
indentSequences: options.indentSequences,
|
|
13228
|
+
quoteStyle: options.quoteStyle,
|
|
12794
13229
|
finalNewline: options.finalNewline,
|
|
12795
13230
|
forceDefaultStyles: options.forceDefaultStyles
|
|
12796
13231
|
};
|
|
@@ -12848,7 +13283,7 @@ const stringifyDefectToError = (defect, value) => {
|
|
|
12848
13283
|
* mode (fatal diagnostics, duplicate keys, a "billion laughs" blow-up) yields
|
|
12849
13284
|
* a `Failure` carrying a typed {@link YamlParseError} — never a throw.
|
|
12850
13285
|
*/
|
|
12851
|
-
const
|
|
13286
|
+
const parseResultImpl = (text, options) => {
|
|
12852
13287
|
const doc = composeFirstDocument(text, toParseInput(options));
|
|
12853
13288
|
const failures = failureRecords(doc, options?.uniqueKeys ?? true);
|
|
12854
13289
|
if (failures.length > 0) return Result.fail(new YamlParseError({
|
|
@@ -12869,7 +13304,7 @@ const parseSyncImpl = (text, options) => {
|
|
|
12869
13304
|
* recursion budget yields a `Failure` carrying a typed {@link YamlStringifyError},
|
|
12870
13305
|
* never a thrown defect.
|
|
12871
13306
|
*/
|
|
12872
|
-
const
|
|
13307
|
+
const stringifyResultImpl = (value, options) => {
|
|
12873
13308
|
try {
|
|
12874
13309
|
return Result.succeed(stringifyValue(value, toStringifyInput(options)));
|
|
12875
13310
|
} catch (defect) {
|
|
@@ -12946,17 +13381,11 @@ var Yaml = class Yaml {
|
|
|
12946
13381
|
* resolved size grows exponentially relative to `maxAliasCount`) also
|
|
12947
13382
|
* fails through {@link YamlParseError} with an `AliasCountExceeded`
|
|
12948
13383
|
* diagnostic, never as an unhandled defect.
|
|
13384
|
+
*
|
|
13385
|
+
* Defined in terms of {@link Yaml.parseResult} — synchronous callers can
|
|
13386
|
+
* use that variant directly.
|
|
12949
13387
|
*/
|
|
12950
|
-
static parse = Effect.fn("Yaml.parse")(
|
|
12951
|
-
const doc = composeFirstDocument(text, toParseInput(options));
|
|
12952
|
-
const failures = failureRecords(doc, options?.uniqueKeys ?? true);
|
|
12953
|
-
if (failures.length > 0) return yield* new YamlParseError({
|
|
12954
|
-
diagnostics: toDiagnostics(text, failures),
|
|
12955
|
-
input: text
|
|
12956
|
-
});
|
|
12957
|
-
const anchors = /* @__PURE__ */ new Map();
|
|
12958
|
-
return yield* extractDocumentValue(doc.contents, anchors, options?.maxAliasCount ?? 100, text);
|
|
12959
|
-
});
|
|
13388
|
+
static parse = Effect.fn("Yaml.parse")((text, options) => Effect.fromResult(Yaml.parseResult(text, options)));
|
|
12960
13389
|
/**
|
|
12961
13390
|
* Parse a multi-document YAML stream into an array of plain JavaScript
|
|
12962
13391
|
* values (one per document, in order). Any fatal diagnostic in any
|
|
@@ -12989,6 +13418,15 @@ var Yaml = class Yaml {
|
|
|
12989
13418
|
* or on a value nested deeper than the stringifier's recursion budget
|
|
12990
13419
|
* (`NestingDepthExceeded`) — both surface through the typed error channel
|
|
12991
13420
|
* rather than as an unhandled stack-overflow defect.
|
|
13421
|
+
*
|
|
13422
|
+
* @remarks
|
|
13423
|
+
* A `"<<"` object key is emitted **quoted** (`'<<': …`). This is the
|
|
13424
|
+
* opposite of the document path ({@link YamlFormat.format} and
|
|
13425
|
+
* `YamlDocument#stringify`), which leaves a parsed plain `<<` key unquoted
|
|
13426
|
+
* so it keeps its merge-key meaning, and the asymmetry is deliberate: a
|
|
13427
|
+
* `"<<"` key on a plain JavaScript object is an ordinary string key that
|
|
13428
|
+
* never carried merge semantics, so emitting it plain would silently turn
|
|
13429
|
+
* ordinary data into a merge directive.
|
|
12992
13430
|
*/
|
|
12993
13431
|
static stringify = Effect.fn("Yaml.stringify")(function* (value, options) {
|
|
12994
13432
|
return yield* stringifyOrFail(value, options);
|
|
@@ -12996,8 +13434,14 @@ var Yaml = class Yaml {
|
|
|
12996
13434
|
/**
|
|
12997
13435
|
* Synchronous single-document parse, returning a `Result` instead of
|
|
12998
13436
|
* an `Effect`. A pure escape hatch for config-time callers that cannot
|
|
12999
|
-
* `await` an Effect (a `vitest.config.ts` is the motivating case)
|
|
13000
|
-
*
|
|
13437
|
+
* `await` an Effect (a `vitest.config.ts` is the motivating case).
|
|
13438
|
+
*
|
|
13439
|
+
* @remarks
|
|
13440
|
+
* This is the package's single parse path. {@link Yaml.parse} is defined in
|
|
13441
|
+
* terms of it (`Effect.fromResult` behind the named span), so the two
|
|
13442
|
+
* variants cannot diverge. Reach for the `Effect` variant inside Effect
|
|
13443
|
+
* code — it carries the `Yaml.parse` tracing span — and for this one at
|
|
13444
|
+
* synchronous boundaries.
|
|
13001
13445
|
*
|
|
13002
13446
|
* Preserves the package contract — malformed and adversarial input fails
|
|
13003
13447
|
* typed, never as a defect. Fatal diagnostics, duplicate keys and a
|
|
@@ -13009,7 +13453,7 @@ var Yaml = class Yaml {
|
|
|
13009
13453
|
* import { Yaml } from "@effected/yaml";
|
|
13010
13454
|
* import { Result } from "effect";
|
|
13011
13455
|
*
|
|
13012
|
-
* const result = Yaml.
|
|
13456
|
+
* const result = Yaml.parseResult("name: Alice\nage: 30");
|
|
13013
13457
|
* if (Result.isSuccess(result)) {
|
|
13014
13458
|
* result.success; // { name: "Alice", age: 30 }
|
|
13015
13459
|
* } else {
|
|
@@ -13019,8 +13463,8 @@ var Yaml = class Yaml {
|
|
|
13019
13463
|
*
|
|
13020
13464
|
* @public
|
|
13021
13465
|
*/
|
|
13022
|
-
static
|
|
13023
|
-
return
|
|
13466
|
+
static parseResult(text, options) {
|
|
13467
|
+
return parseResultImpl(text, options);
|
|
13024
13468
|
}
|
|
13025
13469
|
/**
|
|
13026
13470
|
* Synchronous stringify, returning a `Result` instead of an `Effect`.
|
|
@@ -13037,7 +13481,7 @@ var Yaml = class Yaml {
|
|
|
13037
13481
|
* import { Yaml } from "@effected/yaml";
|
|
13038
13482
|
* import { Result } from "effect";
|
|
13039
13483
|
*
|
|
13040
|
-
* const result = Yaml.
|
|
13484
|
+
* const result = Yaml.stringifyResult({ name: "Alice" });
|
|
13041
13485
|
* if (Result.isFailure(result)) {
|
|
13042
13486
|
* result.failure; // YamlStringifyError
|
|
13043
13487
|
* } else {
|
|
@@ -13047,8 +13491,8 @@ var Yaml = class Yaml {
|
|
|
13047
13491
|
*
|
|
13048
13492
|
* @public
|
|
13049
13493
|
*/
|
|
13050
|
-
static
|
|
13051
|
-
return
|
|
13494
|
+
static stringifyResult(value, options) {
|
|
13495
|
+
return stringifyResultImpl(value, options);
|
|
13052
13496
|
}
|
|
13053
13497
|
/**
|
|
13054
13498
|
* Strip comments from YAML text. Without `replaceCh`, comment characters
|
|
@@ -13275,7 +13719,7 @@ function deepEqualValues(a, b) {
|
|
|
13275
13719
|
}
|
|
13276
13720
|
|
|
13277
13721
|
//#endregion
|
|
13278
|
-
//#region ../../node_modules/.pnpm/@effected+lockfiles@0.1.
|
|
13722
|
+
//#region ../../node_modules/.pnpm/@effected+lockfiles@0.1.9_@effected+jsonc@0.5.0_effect@4.0.0-beta.99__@effected+npm@0.3_d470055e7ca4b6a23d413cae592e2835/node_modules/@effected/lockfiles/internal/documents.js
|
|
13279
13723
|
/**
|
|
13280
13724
|
* An empty YAML document composes to `null` (`Yaml.parseAll("")` is `[null]`,
|
|
13281
13725
|
* and the trailing document of an env-only `pnpm-lock.yaml` is `null` too).
|
|
@@ -13346,7 +13790,7 @@ const selectSoleDocument = (content) => Effect.gen(function* () {
|
|
|
13346
13790
|
});
|
|
13347
13791
|
|
|
13348
13792
|
//#endregion
|
|
13349
|
-
//#region ../../node_modules/.pnpm/@effected+lockfiles@0.1.
|
|
13793
|
+
//#region ../../node_modules/.pnpm/@effected+lockfiles@0.1.9_@effected+jsonc@0.5.0_effect@4.0.0-beta.99__@effected+npm@0.3_d470055e7ca4b6a23d413cae592e2835/node_modules/@effected/lockfiles/internal/pnpm.js
|
|
13350
13794
|
const PnpmImporterDeps = Schema.optionalKey(Schema.Record(Schema.String, Schema.Struct({
|
|
13351
13795
|
specifier: Schema.String,
|
|
13352
13796
|
version: Schema.String
|
|
@@ -13473,7 +13917,7 @@ const toFields$1 = (raw) => Effect.gen(function* () {
|
|
|
13473
13917
|
});
|
|
13474
13918
|
|
|
13475
13919
|
//#endregion
|
|
13476
|
-
//#region ../../node_modules/.pnpm/@effected+lockfiles@0.1.
|
|
13920
|
+
//#region ../../node_modules/.pnpm/@effected+lockfiles@0.1.9_@effected+jsonc@0.5.0_effect@4.0.0-beta.99__@effected+npm@0.3_d470055e7ca4b6a23d413cae592e2835/node_modules/@effected/lockfiles/internal/yarn.js
|
|
13477
13921
|
const YarnLockfileRaw = Schema.Record(Schema.String, Schema.Unknown);
|
|
13478
13922
|
const DepRecord = Schema.optionalKey(Schema.Record(Schema.String, Schema.String));
|
|
13479
13923
|
const YarnEntry = Schema.Struct({
|
|
@@ -13597,7 +14041,7 @@ const cleanYarnDeps = (deps) => {
|
|
|
13597
14041
|
};
|
|
13598
14042
|
|
|
13599
14043
|
//#endregion
|
|
13600
|
-
//#region ../../node_modules/.pnpm/@effected+lockfiles@0.1.
|
|
14044
|
+
//#region ../../node_modules/.pnpm/@effected+lockfiles@0.1.9_@effected+jsonc@0.5.0_effect@4.0.0-beta.99__@effected+npm@0.3_d470055e7ca4b6a23d413cae592e2835/node_modules/@effected/lockfiles/Lockfile.js
|
|
13601
14045
|
const EMPTY_IMPORTERS = [];
|
|
13602
14046
|
/**
|
|
13603
14047
|
* Failure of `Lockfile.parse`: the given content is not a valid lockfile of
|
|
@@ -13842,7 +14286,7 @@ var Lockfile = class Lockfile extends Schema.Class("Lockfile")({
|
|
|
13842
14286
|
};
|
|
13843
14287
|
|
|
13844
14288
|
//#endregion
|
|
13845
|
-
//#region ../../node_modules/.pnpm/@effected+lockfiles@0.1.
|
|
14289
|
+
//#region ../../node_modules/.pnpm/@effected+lockfiles@0.1.9_@effected+jsonc@0.5.0_effect@4.0.0-beta.99__@effected+npm@0.3_d470055e7ca4b6a23d413cae592e2835/node_modules/@effected/lockfiles/LockfileIntegrity.js
|
|
13846
14290
|
/**
|
|
13847
14291
|
* The minimal manifest shape {@link LockfileIntegrity.compare} checks a
|
|
13848
14292
|
* lockfile against: a package name plus the four optional dependency maps.
|
|
@@ -13959,7 +14403,7 @@ var LockfileIntegrity = class LockfileIntegrity extends Schema.Class("LockfileIn
|
|
|
13959
14403
|
};
|
|
13960
14404
|
|
|
13961
14405
|
//#endregion
|
|
13962
|
-
//#region ../../node_modules/.pnpm/@effected+package-json@0.
|
|
14406
|
+
//#region ../../node_modules/.pnpm/@effected+package-json@0.4.2_effect@4.0.0-beta.99/node_modules/@effected/package-json/Dependency.js
|
|
13963
14407
|
/**
|
|
13964
14408
|
* A resolved dependency entry pairing a package name with its version
|
|
13965
14409
|
* specifier and the `kind` of map it came from (`@effected/npm`'s
|
|
@@ -14024,7 +14468,7 @@ var Dependency = class extends Schema.Class("Dependency")({
|
|
|
14024
14468
|
};
|
|
14025
14469
|
|
|
14026
14470
|
//#endregion
|
|
14027
|
-
//#region ../../node_modules/.pnpm/@effected+package-json@0.
|
|
14471
|
+
//#region ../../node_modules/.pnpm/@effected+package-json@0.4.2_effect@4.0.0-beta.99/node_modules/@effected/package-json/DevEngines.js
|
|
14028
14472
|
/**
|
|
14029
14473
|
* A single `devEngines` constraint with a name and optional `version` / `onFail`.
|
|
14030
14474
|
*
|
|
@@ -15065,7 +15509,7 @@ var require_spdx_expression_parse = /* @__PURE__ */ __commonJSMin(((exports, mod
|
|
|
15065
15509
|
}));
|
|
15066
15510
|
|
|
15067
15511
|
//#endregion
|
|
15068
|
-
//#region ../../node_modules/.pnpm/@effected+package-json@0.
|
|
15512
|
+
//#region ../../node_modules/.pnpm/@effected+package-json@0.4.2_effect@4.0.0-beta.99/node_modules/@effected/package-json/License.js
|
|
15069
15513
|
var import_spdx_expression_parse = /* @__PURE__ */ __toESM(require_spdx_expression_parse(), 1);
|
|
15070
15514
|
/**
|
|
15071
15515
|
* Indicates that a string is not a valid SPDX license identifier or expression.
|
|
@@ -15107,7 +15551,7 @@ const isValidSpdx = (value) => {
|
|
|
15107
15551
|
const SpdxLicense = Schema.String.pipe(Schema.check(Schema.makeFilter((value) => isValidSpdx(value) ? void 0 : "Expected a valid SPDX license expression")), Schema.brand("SpdxLicense"));
|
|
15108
15552
|
|
|
15109
15553
|
//#endregion
|
|
15110
|
-
//#region ../../node_modules/.pnpm/@effected+package-json@0.
|
|
15554
|
+
//#region ../../node_modules/.pnpm/@effected+package-json@0.4.2_effect@4.0.0-beta.99/node_modules/@effected/package-json/PackageManager.js
|
|
15111
15555
|
const PACKAGE_MANAGER_RE = /^([a-z]+)@(\d+\.\d+\.\d+(?:-[a-zA-Z0-9._-]+)?)(?:\+(.+))?$/;
|
|
15112
15556
|
/**
|
|
15113
15557
|
* The `packageManager` field only ever carries corepack's `<algo>.<hex>`
|
|
@@ -15166,7 +15610,7 @@ var PackageManager = class PackageManager extends Schema.Class("PackageManager")
|
|
|
15166
15610
|
};
|
|
15167
15611
|
|
|
15168
15612
|
//#endregion
|
|
15169
|
-
//#region ../../node_modules/.pnpm/@effected+package-json@0.
|
|
15613
|
+
//#region ../../node_modules/.pnpm/@effected+package-json@0.4.2_effect@4.0.0-beta.99/node_modules/@effected/package-json/PackageName.js
|
|
15170
15614
|
/**
|
|
15171
15615
|
* Indicates that a string could not be used as a valid npm package name.
|
|
15172
15616
|
*
|
|
@@ -15225,7 +15669,7 @@ const PackageName = Object.assign(Schema.Union([ScopedPackageName, UnscopedPacka
|
|
|
15225
15669
|
});
|
|
15226
15670
|
|
|
15227
15671
|
//#endregion
|
|
15228
|
-
//#region ../../node_modules/.pnpm/@effected+package-json@0.
|
|
15672
|
+
//#region ../../node_modules/.pnpm/@effected+package-json@0.4.2_effect@4.0.0-beta.99/node_modules/@effected/package-json/Person.js
|
|
15229
15673
|
const parsePersonString = (input) => {
|
|
15230
15674
|
const emailMatch = input.match(/<([^>]+)>/);
|
|
15231
15675
|
const urlMatch = input.match(/\(([^)]+)\)/);
|
|
@@ -15239,8 +15683,56 @@ const parsePersonString = (input) => {
|
|
|
15239
15683
|
...urlMatch !== null ? { url: urlMatch[1] } : {}
|
|
15240
15684
|
});
|
|
15241
15685
|
};
|
|
15686
|
+
const serializePerson = (person) => {
|
|
15687
|
+
let result = person.name;
|
|
15688
|
+
if (person.email !== void 0) result += ` <${person.email}>`;
|
|
15689
|
+
if (person.url !== void 0) result += ` (${person.url})`;
|
|
15690
|
+
return result;
|
|
15691
|
+
};
|
|
15692
|
+
const wireForms = /* @__PURE__ */ new WeakMap();
|
|
15693
|
+
const rememberWire = (person, wire) => {
|
|
15694
|
+
wireForms.set(person, wire);
|
|
15695
|
+
return person;
|
|
15696
|
+
};
|
|
15697
|
+
const KNOWN_KEYS = /* @__PURE__ */ new Set([
|
|
15698
|
+
"name",
|
|
15699
|
+
"email",
|
|
15700
|
+
"url"
|
|
15701
|
+
]);
|
|
15702
|
+
const sameRest = (a, b) => JSON.stringify(a ?? {}) === JSON.stringify(b ?? {});
|
|
15703
|
+
const isFaithful = (wire, person) => {
|
|
15704
|
+
if (typeof wire === "string") {
|
|
15705
|
+
const parsed = parsePersonString(wire);
|
|
15706
|
+
return parsed.name === person.name && parsed.email === person.email && parsed.url === person.url;
|
|
15707
|
+
}
|
|
15708
|
+
const rest = restOf(wire);
|
|
15709
|
+
return wire.name === person.name && wire.email === person.email && wire.url === person.url && sameRest(rest, person.rest);
|
|
15710
|
+
};
|
|
15711
|
+
const PersonFields = Schema.Struct({
|
|
15712
|
+
name: Schema.String,
|
|
15713
|
+
email: Schema.optionalKey(Schema.String),
|
|
15714
|
+
url: Schema.optionalKey(Schema.String)
|
|
15715
|
+
});
|
|
15716
|
+
const decodePersonFields = Schema.decodeUnknownEffect(PersonFields);
|
|
15717
|
+
const restOf = (raw) => {
|
|
15718
|
+
const rest = {};
|
|
15719
|
+
for (const [key, value] of Object.entries(raw)) if (!KNOWN_KEYS.has(key)) rest[key] = value;
|
|
15720
|
+
return rest;
|
|
15721
|
+
};
|
|
15722
|
+
const encodePersonObject = (person) => {
|
|
15723
|
+
const wire = wireForms.get(person);
|
|
15724
|
+
if (wire !== void 0 && typeof wire !== "string" && isFaithful(wire, person)) return wire;
|
|
15725
|
+
const known = { name: person.name };
|
|
15726
|
+
if (person.email !== void 0) known.email = person.email;
|
|
15727
|
+
if (person.url !== void 0) known.url = person.url;
|
|
15728
|
+
return {
|
|
15729
|
+
...person.rest ?? {},
|
|
15730
|
+
...known
|
|
15731
|
+
};
|
|
15732
|
+
};
|
|
15242
15733
|
/**
|
|
15243
|
-
* A structured person object with `name
|
|
15734
|
+
* A structured person object with `name`, optional `email` / `url`, and a
|
|
15735
|
+
* `rest` catch-all preserving any additional keys across a read/write cycle.
|
|
15244
15736
|
*
|
|
15245
15737
|
* @public
|
|
15246
15738
|
*/
|
|
@@ -15250,30 +15742,78 @@ var Person = class Person extends Schema.Class("Person")({
|
|
|
15250
15742
|
/** The optional email address. */
|
|
15251
15743
|
email: Schema.optionalKey(Schema.String),
|
|
15252
15744
|
/** The optional homepage URL. */
|
|
15253
|
-
url: Schema.optionalKey(Schema.String)
|
|
15745
|
+
url: Schema.optionalKey(Schema.String),
|
|
15746
|
+
/** Any additional keys, preserved verbatim and flattened back on encode. */
|
|
15747
|
+
rest: Schema.optionalKey(Schema.Record(Schema.String, Schema.Unknown))
|
|
15254
15748
|
}) {
|
|
15749
|
+
/**
|
|
15750
|
+
* The object wire codec: an open JSON object ↔ a {@link Person}, partitioning
|
|
15751
|
+
* unknown keys into `rest` and flattening them back on encode so the on-disk
|
|
15752
|
+
* shape never carries a literal `rest` key.
|
|
15753
|
+
*/
|
|
15754
|
+
static schema = Schema.Record(Schema.String, Schema.Unknown).pipe(Schema.decodeTo(Schema.instanceOf(Person), SchemaTransformation.transformOrFail({
|
|
15755
|
+
decode: (raw) => decodePersonFields(raw).pipe(Effect.mapError((error) => error.issue), Effect.map((fields) => {
|
|
15756
|
+
const rest = restOf(raw);
|
|
15757
|
+
return rememberWire(Person.make({
|
|
15758
|
+
...fields,
|
|
15759
|
+
...Object.keys(rest).length > 0 ? { rest } : {}
|
|
15760
|
+
}), raw);
|
|
15761
|
+
})),
|
|
15762
|
+
encode: (person) => Effect.succeed(encodePersonObject(person))
|
|
15763
|
+
})));
|
|
15255
15764
|
/**
|
|
15256
15765
|
* Schema transformation between the `"Name <email> (url)"` shorthand string
|
|
15257
|
-
* and a {@link Person}.
|
|
15766
|
+
* and a {@link Person}. Decoding remembers the input text so that encoding
|
|
15767
|
+
* reproduces it verbatim; see {@link Person.wireStringOf}.
|
|
15258
15768
|
*/
|
|
15259
15769
|
static FromString = Schema.String.pipe(Schema.decodeTo(Schema.instanceOf(Person), SchemaTransformation.transform({
|
|
15260
|
-
decode: (input) => parsePersonString(input),
|
|
15770
|
+
decode: (input) => rememberWire(parsePersonString(input), input),
|
|
15261
15771
|
encode: (person) => {
|
|
15262
|
-
|
|
15263
|
-
|
|
15264
|
-
if (person.url !== void 0) result += ` (${person.url})`;
|
|
15265
|
-
return result;
|
|
15772
|
+
const wire = wireForms.get(person);
|
|
15773
|
+
return typeof wire === "string" && isFaithful(wire, person) ? wire : serializePerson(person);
|
|
15266
15774
|
}
|
|
15267
15775
|
})));
|
|
15268
15776
|
/**
|
|
15269
15777
|
* The `author` / `contributors` value: either the shorthand string or the
|
|
15270
15778
|
* structured object, always decoded to a {@link Person}.
|
|
15779
|
+
*
|
|
15780
|
+
* The wire form is preserved across a round trip — a person read from the
|
|
15781
|
+
* shorthand string encodes back to that string, byte for byte, and one read
|
|
15782
|
+
* from an object encodes back to an object with its unknown keys intact.
|
|
15783
|
+
* Formatting a manifest therefore never rewrites one legal encoding into the
|
|
15784
|
+
* other.
|
|
15785
|
+
*
|
|
15786
|
+
* Provenance belongs to the instance, so a person that is *rebuilt* (rather
|
|
15787
|
+
* than carried through unchanged) has none and encodes in the canonical
|
|
15788
|
+
* object form. Editing an unrelated field of the surrounding `Package`
|
|
15789
|
+
* carries the same person instance through and preserves its encoding.
|
|
15790
|
+
*/
|
|
15791
|
+
static FromValue = Schema.Union([Person.schema, Schema.String]).pipe(Schema.decodeTo(Schema.instanceOf(Person), SchemaTransformation.transform({
|
|
15792
|
+
decode: (input) => typeof input === "string" ? rememberWire(parsePersonString(input), input) : input,
|
|
15793
|
+
encode: (person) => {
|
|
15794
|
+
const wire = wireForms.get(person);
|
|
15795
|
+
return typeof wire === "string" && isFaithful(wire, person) ? wire : person;
|
|
15796
|
+
}
|
|
15797
|
+
})));
|
|
15798
|
+
/**
|
|
15799
|
+
* The shorthand text this person was decoded from, when it was decoded from
|
|
15800
|
+
* the string form and still matches its fields; `None` for a person built
|
|
15801
|
+
* from an object or by hand.
|
|
15802
|
+
*
|
|
15803
|
+
* Exposed so callers can tell which encoding a manifest used without
|
|
15804
|
+
* re-reading the file.
|
|
15805
|
+
*
|
|
15806
|
+
* @param person - the person to inspect
|
|
15807
|
+
* @returns the original shorthand text, or `None`
|
|
15271
15808
|
*/
|
|
15272
|
-
static
|
|
15809
|
+
static wireStringOf(person) {
|
|
15810
|
+
const wire = wireForms.get(person);
|
|
15811
|
+
return typeof wire === "string" && isFaithful(wire, person) ? Option.some(wire) : Option.none();
|
|
15812
|
+
}
|
|
15273
15813
|
};
|
|
15274
15814
|
|
|
15275
15815
|
//#endregion
|
|
15276
|
-
//#region ../../node_modules/.pnpm/@effected+package-json@0.
|
|
15816
|
+
//#region ../../node_modules/.pnpm/@effected+package-json@0.4.2_effect@4.0.0-beta.99/node_modules/@effected/package-json/internal/format.js
|
|
15277
15817
|
const KEY_INDEX = new Map([
|
|
15278
15818
|
"$schema",
|
|
15279
15819
|
"name",
|
|
@@ -15497,7 +16037,7 @@ const renderJson = (raw, options) => {
|
|
|
15497
16037
|
};
|
|
15498
16038
|
|
|
15499
16039
|
//#endregion
|
|
15500
|
-
//#region ../../node_modules/.pnpm/@effected+package-json@0.
|
|
16040
|
+
//#region ../../node_modules/.pnpm/@effected+package-json@0.4.2_effect@4.0.0-beta.99/node_modules/@effected/package-json/Package.js
|
|
15501
16041
|
const toHashMap = SchemaTransformation.transform({
|
|
15502
16042
|
decode: (record) => HashMap.fromIterable(Object.entries(record)),
|
|
15503
16043
|
encode: (map) => Object.fromEntries(HashMap.toEntries(map))
|
|
@@ -15816,7 +16356,7 @@ var Package = class Package extends Schema.Class("Package")({
|
|
|
15816
16356
|
};
|
|
15817
16357
|
|
|
15818
16358
|
//#endregion
|
|
15819
|
-
//#region ../../node_modules/.pnpm/@effected+workspaces@0.
|
|
16359
|
+
//#region ../../node_modules/.pnpm/@effected+workspaces@0.6.0_@effected+jsonc@0.5.0_effect@4.0.0-beta.99__effect@4.0.0-beta.99/node_modules/@effected/workspaces/WorkspacePackage.js
|
|
15820
16360
|
const EMPTY$1 = Object.freeze(Object.create(null));
|
|
15821
16361
|
const EMPTY_MANIFEST = Object.freeze(Object.create(null));
|
|
15822
16362
|
/**
|
|
@@ -15891,10 +16431,12 @@ var WorkspaceManifestError = class extends Schema.TaggedErrorClass()("WorkspaceM
|
|
|
15891
16431
|
* path: "/repo/packages/utils",
|
|
15892
16432
|
* packageJsonPath: "/repo/packages/utils/package.json",
|
|
15893
16433
|
* relativePath: "packages/utils",
|
|
16434
|
+
* workspaceRoot: "/repo",
|
|
15894
16435
|
* });
|
|
15895
16436
|
*
|
|
15896
16437
|
* pkg.isRootWorkspace; // false
|
|
15897
16438
|
* pkg.unscopedName; // "utils"
|
|
16439
|
+
* pkg.workspaceRoot; // "/repo"
|
|
15898
16440
|
* ```
|
|
15899
16441
|
*
|
|
15900
16442
|
* @public
|
|
@@ -15910,6 +16452,21 @@ var WorkspacePackage = class WorkspacePackage extends Schema.Class("WorkspacePac
|
|
|
15910
16452
|
packageJsonPath: Schema.NonEmptyString,
|
|
15911
16453
|
/** POSIX path relative to the workspace root; `"."` for the root package. */
|
|
15912
16454
|
relativePath: Schema.String,
|
|
16455
|
+
/**
|
|
16456
|
+
* Absolute path to the workspace root this package was discovered under.
|
|
16457
|
+
*
|
|
16458
|
+
* @remarks
|
|
16459
|
+
* Carried, not derived. Whoever built this value already knew the root —
|
|
16460
|
+
* `WorkspaceDiscovery` resolved it before enumerating, and the sync entry
|
|
16461
|
+
* point is handed it — so dropping it forced every consumer into per-package
|
|
16462
|
+
* root arithmetic (counting `relativePath` segments and re-ascending that
|
|
16463
|
+
* many `..`). That reconstruction is exact only while `path` and
|
|
16464
|
+
* `relativePath` agree, and it re-derives something the kit never had to
|
|
16465
|
+
* lose.
|
|
16466
|
+
*
|
|
16467
|
+
* For the root package this equals `path`, and `relativePath` is `"."`.
|
|
16468
|
+
*/
|
|
16469
|
+
workspaceRoot: Schema.NonEmptyString,
|
|
15913
16470
|
/** Whether the package is marked private. */
|
|
15914
16471
|
private: Schema.Boolean.pipe(Schema.withDecodingDefaultKey(Effect.succeed(false)), Schema.withConstructorDefault(Effect.succeed(false))),
|
|
15915
16472
|
/** Production dependencies. */
|
|
@@ -16079,7 +16636,7 @@ var WorkspacePackage = class WorkspacePackage extends Schema.Class("WorkspacePac
|
|
|
16079
16636
|
};
|
|
16080
16637
|
|
|
16081
16638
|
//#endregion
|
|
16082
|
-
//#region ../../node_modules/.pnpm/@effected+walker@0.
|
|
16639
|
+
//#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
|
|
16083
16640
|
/**
|
|
16084
16641
|
* Typed failure raised by {@link descend}: a directory mid-walk was unreadable
|
|
16085
16642
|
* (under `onUnreadable: "fail"`), or the walk descended past `maxDepth`. Depth
|
|
@@ -16215,7 +16772,98 @@ const descend = Effect.fn("Walker.descend")(function* (pattern, options) {
|
|
|
16215
16772
|
});
|
|
16216
16773
|
|
|
16217
16774
|
//#endregion
|
|
16218
|
-
//#region ../../node_modules/.pnpm/@effected+walker@0.
|
|
16775
|
+
//#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
|
|
16776
|
+
/**
|
|
16777
|
+
* Typed failure raised by {@link compileAndExpand}: the single error the
|
|
16778
|
+
* compile+expand recipe fails with, so a caller catches one tag rather than
|
|
16779
|
+
* folding two error channels by hand.
|
|
16780
|
+
*
|
|
16781
|
+
* @remarks
|
|
16782
|
+
* One tag, two genuinely different causes — "your pattern is malformed" and
|
|
16783
|
+
* "that directory is unreadable" are different problems with different fixes,
|
|
16784
|
+
* so `cause` keeps the underlying typed error intact
|
|
16785
|
+
* rather than flattening it into a string. Discriminate on `cause._tag`
|
|
16786
|
+
* (`"GlobPatternError"` vs `"DescendError"`), or read
|
|
16787
|
+
* {@link GlobExpansionError.stage} when only the phase matters; either way the
|
|
16788
|
+
* original payload — a guard's `limit`/`actual`, a descent's `path` — is still
|
|
16789
|
+
* there. `cause` is also the native `Error` cause, so error chaining and
|
|
16790
|
+
* stack-printing work without extra wiring.
|
|
16791
|
+
*
|
|
16792
|
+
* @public
|
|
16793
|
+
*/
|
|
16794
|
+
var GlobExpansionError = class extends Schema.TaggedErrorClass()("GlobExpansionError", {
|
|
16795
|
+
/** The glob pattern's source text, as handed to {@link compileAndExpand}. */
|
|
16796
|
+
pattern: Schema.String,
|
|
16797
|
+
/** The underlying typed failure, intact: a compile guard trip or a descent failure. */
|
|
16798
|
+
cause: Schema.Union([GlobPatternError, DescendError])
|
|
16799
|
+
}) {
|
|
16800
|
+
/**
|
|
16801
|
+
* Which phase failed — `"compile"` when the pattern itself was rejected,
|
|
16802
|
+
* `"descend"` when the filesystem walk failed. A convenience over
|
|
16803
|
+
* `cause._tag` for callers that only need the phase.
|
|
16804
|
+
*/
|
|
16805
|
+
get stage() {
|
|
16806
|
+
return this.cause._tag === "GlobPatternError" ? "compile" : "descend";
|
|
16807
|
+
}
|
|
16808
|
+
get message() {
|
|
16809
|
+
const shown = this.pattern.length > 64 ? `${this.pattern.slice(0, 64)}…` : this.pattern;
|
|
16810
|
+
return `glob expansion of ${JSON.stringify(shown)} failed during ${this.stage}: ${this.cause.message}`;
|
|
16811
|
+
}
|
|
16812
|
+
};
|
|
16813
|
+
/**
|
|
16814
|
+
* Compile a glob pattern and expand it against the filesystem in one call:
|
|
16815
|
+
* matching FILE paths relative to `options.cwd`, POSIX separators, sorted.
|
|
16816
|
+
*
|
|
16817
|
+
* @remarks
|
|
16818
|
+
* The recipe form of {@link descend}. Everything `descend` documents about
|
|
16819
|
+
* traversal holds unchanged — the literal fast-path, the negated-pattern walk
|
|
16820
|
+
* from `cwd`, files-only matching, symlink and prune handling, `maxDepth`,
|
|
16821
|
+
* `onUnreadable` — because this delegates to it. What this adds is the seam:
|
|
16822
|
+
* the pattern arrives as a string, and both failure modes arrive as one
|
|
16823
|
+
* {@link GlobExpansionError} with the underlying error preserved in `cause`.
|
|
16824
|
+
*
|
|
16825
|
+
* A missing base directory, a pattern that climbs above `cwd`, and a pattern
|
|
16826
|
+
* that simply matches nothing are all an EMPTY result, not a failure — zero
|
|
16827
|
+
* matches is a normal glob answer. Only a rejected pattern or a failed walk
|
|
16828
|
+
* produces an error.
|
|
16829
|
+
*
|
|
16830
|
+
* `FileSystem` and `Path` stay in the `R` channel and are **deliberately not
|
|
16831
|
+
* provided here**, even though hand-providing them is the friction this
|
|
16832
|
+
* recipe otherwise removes. `FileSystem` cannot be provided — a library that
|
|
16833
|
+
* picks its own filesystem cannot be tested against a fixture tree. Given
|
|
16834
|
+
* that, providing `Path` internally would not save the caller a layer (they
|
|
16835
|
+
* still supply `FileSystem`), and it would actively break win32: the walk
|
|
16836
|
+
* would join paths POSIX-style against a caller's win32 filesystem. The
|
|
16837
|
+
* consumer's platform layer stays the single place that choice is made.
|
|
16838
|
+
* Provide both once at the application boundary, not per call site.
|
|
16839
|
+
*
|
|
16840
|
+
* @example
|
|
16841
|
+
* ```ts
|
|
16842
|
+
* import { compileAndExpand } from "@effected/walker"
|
|
16843
|
+
* import { GlobPatternOptions } from "@effected/glob"
|
|
16844
|
+
*
|
|
16845
|
+
* const files = yield* compileAndExpand("packages/*/src/**/*.ts", {
|
|
16846
|
+
* cwd: "/repo",
|
|
16847
|
+
* glob: GlobPatternOptions.make({ dot: true })
|
|
16848
|
+
* })
|
|
16849
|
+
* ```
|
|
16850
|
+
*
|
|
16851
|
+
* @public
|
|
16852
|
+
*/
|
|
16853
|
+
const compileAndExpand = Effect.fn("Walker.compileAndExpand")(function* (pattern, options) {
|
|
16854
|
+
const compiled = GlobPattern.compileResult(pattern, options.glob);
|
|
16855
|
+
if (Result.isFailure(compiled)) return yield* new GlobExpansionError({
|
|
16856
|
+
pattern,
|
|
16857
|
+
cause: compiled.failure
|
|
16858
|
+
});
|
|
16859
|
+
return yield* descend(compiled.success, options).pipe(Effect.mapError((cause) => new GlobExpansionError({
|
|
16860
|
+
pattern,
|
|
16861
|
+
cause
|
|
16862
|
+
})));
|
|
16863
|
+
});
|
|
16864
|
+
|
|
16865
|
+
//#endregion
|
|
16866
|
+
//#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
|
|
16219
16867
|
/**
|
|
16220
16868
|
* Ascend from `start` toward the filesystem root, yielding each directory,
|
|
16221
16869
|
* nearest first.
|
|
@@ -16229,17 +16877,28 @@ const descend = Effect.fn("Walker.descend")(function* (pattern, options) {
|
|
|
16229
16877
|
* Bounded twice over: `dirname` is a fixpoint at the root, and `maxDepth` guards
|
|
16230
16878
|
* a pathological `Path` implementation that never reaches one.
|
|
16231
16879
|
*
|
|
16880
|
+
* `stopAt` is compared in normalized form — see {@link AscendOptions.stopAt}.
|
|
16881
|
+
* Raw string equality made the ceiling fail OPEN: an unnormalized ceiling
|
|
16882
|
+
* matched nothing and the ascent ran silently to the filesystem root, which is
|
|
16883
|
+
* the unbounded walk the option exists to prevent, with no error to notice it
|
|
16884
|
+
* by. A relative ceiling **dies** for the same reason — resolving one against
|
|
16885
|
+
* `process.cwd()` would reintroduce the silent-wrong-walk failure through a
|
|
16886
|
+
* different door. See {@link AscendOptions.stopAt} for why that is a defect
|
|
16887
|
+
* rather than a typed error; the error channel stays `never`.
|
|
16888
|
+
*
|
|
16232
16889
|
* @public
|
|
16233
16890
|
*/
|
|
16234
16891
|
const ascend = (start, options) => Effect.gen(function* () {
|
|
16235
16892
|
const path = yield* Path.Path;
|
|
16236
16893
|
const maxDepth = options?.maxDepth ?? 256;
|
|
16237
16894
|
if (!Number.isInteger(maxDepth) || maxDepth < 1) return yield* Effect.die(/* @__PURE__ */ new Error(`Walker.ascend: maxDepth must be a positive integer, received ${maxDepth}`));
|
|
16895
|
+
if (options?.stopAt !== void 0 && !path.isAbsolute(options.stopAt)) return yield* Effect.die(/* @__PURE__ */ new Error(`Walker.ascend: stopAt must be an absolute path, received ${JSON.stringify(options.stopAt)} (ascending from ${JSON.stringify(start)})`));
|
|
16896
|
+
const ceiling = options?.stopAt === void 0 ? void 0 : path.resolve(options.stopAt);
|
|
16238
16897
|
const dirs = [];
|
|
16239
16898
|
let current = start;
|
|
16240
16899
|
for (let depth = 0; depth < maxDepth; depth++) {
|
|
16241
16900
|
dirs.push(current);
|
|
16242
|
-
if (
|
|
16901
|
+
if (ceiling !== void 0 && (current === ceiling || path.resolve(current) === ceiling)) break;
|
|
16243
16902
|
const parent = path.dirname(current);
|
|
16244
16903
|
if (parent === current) break;
|
|
16245
16904
|
current = parent;
|
|
@@ -16306,7 +16965,7 @@ const Walker$1 = {
|
|
|
16306
16965
|
};
|
|
16307
16966
|
|
|
16308
16967
|
//#endregion
|
|
16309
|
-
//#region ../../node_modules/.pnpm/@effected+workspaces@0.
|
|
16968
|
+
//#region ../../node_modules/.pnpm/@effected+workspaces@0.6.0_@effected+jsonc@0.5.0_effect@4.0.0-beta.99__effect@4.0.0-beta.99/node_modules/@effected/workspaces/WorkspaceRoot.js
|
|
16310
16969
|
/**
|
|
16311
16970
|
* The marker filenames {@link WorkspaceRoot} probes for, in priority order.
|
|
16312
16971
|
*
|
|
@@ -16326,11 +16985,22 @@ var WorkspaceRootNotFoundError = class extends Schema.TaggedErrorClass()("Worksp
|
|
|
16326
16985
|
/** The directory the ascent started from. */
|
|
16327
16986
|
searchPath: Schema.String,
|
|
16328
16987
|
/** The marker filenames probed at each ancestor. */
|
|
16329
|
-
markers: Schema.Array(Schema.String)
|
|
16988
|
+
markers: Schema.Array(Schema.String),
|
|
16989
|
+
/**
|
|
16990
|
+
* The resolved ceiling the ascent was bounded by, when one was supplied.
|
|
16991
|
+
*
|
|
16992
|
+
* @remarks
|
|
16993
|
+
* Absent means the ascent ran to the filesystem root. Its presence is what
|
|
16994
|
+
* lets a caller tell "there is no workspace root anywhere above me" from
|
|
16995
|
+
* "there is none below the ceiling I set" — two failures that otherwise
|
|
16996
|
+
* render identically.
|
|
16997
|
+
*/
|
|
16998
|
+
stopAt: Schema.optionalKey(Schema.String)
|
|
16330
16999
|
}) {
|
|
16331
|
-
/** Renders the search path
|
|
17000
|
+
/** Renders the search path, probed markers and any ceiling into a one-line message. */
|
|
16332
17001
|
get message() {
|
|
16333
|
-
|
|
17002
|
+
const bound = this.stopAt === void 0 ? "" : ` up to ${this.stopAt}`;
|
|
17003
|
+
return `No workspace root above ${this.searchPath}${bound} (looked for ${this.markers.join(", ")})`;
|
|
16334
17004
|
}
|
|
16335
17005
|
};
|
|
16336
17006
|
/**
|
|
@@ -16353,6 +17023,12 @@ const isWorkspaceRoot = (dir) => Effect.gen(function* () {
|
|
|
16353
17023
|
}).pipe(Effect.orElseSucceed(() => ({})));
|
|
16354
17024
|
return parsed.workspaces !== void 0 && parsed.workspaces !== null;
|
|
16355
17025
|
});
|
|
17026
|
+
/** Whether `descendant` is `ancestor` itself or lies beneath it, on POSIX or win32 separators. */
|
|
17027
|
+
const isAtOrBelow = (descendant, ancestor) => {
|
|
17028
|
+
if (descendant === ancestor) return true;
|
|
17029
|
+
const prefix = ancestor.endsWith("/") || ancestor.endsWith("\\") ? ancestor : `${ancestor}/`;
|
|
17030
|
+
return descendant.startsWith(prefix) || descendant.startsWith(prefix.replace(/\/$/, "\\"));
|
|
17031
|
+
};
|
|
16356
17032
|
/**
|
|
16357
17033
|
* Locates the workspace root by ascending from a starting directory.
|
|
16358
17034
|
*
|
|
@@ -16367,6 +17043,20 @@ const isWorkspaceRoot = (dir) => Effect.gen(function* () {
|
|
|
16367
17043
|
* });
|
|
16368
17044
|
* ```
|
|
16369
17045
|
*
|
|
17046
|
+
* @example
|
|
17047
|
+
* Bounded: an unmarked fixture directory fails typed instead of escaping into
|
|
17048
|
+
* the enclosing repository.
|
|
17049
|
+
*
|
|
17050
|
+
* ```ts
|
|
17051
|
+
* import { WorkspaceRoot } from "@effected/workspaces";
|
|
17052
|
+
* import { Effect } from "effect";
|
|
17053
|
+
*
|
|
17054
|
+
* const program = Effect.gen(function* () {
|
|
17055
|
+
* const roots = yield* WorkspaceRoot;
|
|
17056
|
+
* return yield* roots.find("/tmp/fixture/packages/a", { stopAt: "/tmp/fixture" });
|
|
17057
|
+
* });
|
|
17058
|
+
* ```
|
|
17059
|
+
*
|
|
16370
17060
|
* @public
|
|
16371
17061
|
*/
|
|
16372
17062
|
var WorkspaceRoot = class WorkspaceRoot extends Context.Service()("@effected/workspaces/WorkspaceRoot") {
|
|
@@ -16374,25 +17064,96 @@ var WorkspaceRoot = class WorkspaceRoot extends Context.Service()("@effected/wor
|
|
|
16374
17064
|
static make = Effect.gen(function* () {
|
|
16375
17065
|
const fs = yield* FileSystem.FileSystem;
|
|
16376
17066
|
const path = yield* Path.Path;
|
|
16377
|
-
const find = Effect.fn("WorkspaceRoot.find")(function* (cwd) {
|
|
17067
|
+
const find = Effect.fn("WorkspaceRoot.find")(function* (cwd, options) {
|
|
16378
17068
|
const start = path.resolve(cwd);
|
|
16379
|
-
const
|
|
17069
|
+
const ceiling = options?.stopAt === void 0 ? void 0 : path.resolve(options.stopAt);
|
|
17070
|
+
const chain = yield* Walker$1.ascend(start, {
|
|
17071
|
+
...ceiling === void 0 ? {} : { stopAt: ceiling },
|
|
17072
|
+
...options?.maxDepth === void 0 ? {} : { maxDepth: options.maxDepth }
|
|
17073
|
+
});
|
|
16380
17074
|
const found = yield* Walker$1.findRoot(chain, isWorkspaceRoot);
|
|
16381
17075
|
if (Option.isNone(found)) return yield* Effect.fail(new WorkspaceRootNotFoundError({
|
|
16382
17076
|
searchPath: start,
|
|
16383
|
-
markers: WORKSPACE_MARKERS
|
|
17077
|
+
markers: WORKSPACE_MARKERS,
|
|
17078
|
+
...ceiling === void 0 ? {} : { stopAt: ceiling }
|
|
16384
17079
|
}));
|
|
16385
17080
|
yield* Effect.logDebug("Workspace root found").pipe(Effect.annotateLogs("workspace.root", found.value));
|
|
16386
17081
|
return found.value;
|
|
16387
17082
|
});
|
|
16388
|
-
return { find: (cwd) => find(cwd).pipe(Effect.provideService(FileSystem.FileSystem, fs), Effect.provideService(Path.Path, path)) };
|
|
17083
|
+
return { find: (cwd, options) => find(cwd, options).pipe(Effect.provideService(FileSystem.FileSystem, fs), Effect.provideService(Path.Path, path)) };
|
|
16389
17084
|
});
|
|
16390
17085
|
/** The live layer. */
|
|
16391
17086
|
static layer = Layer.effect(WorkspaceRoot, WorkspaceRoot.make);
|
|
17087
|
+
/**
|
|
17088
|
+
* A test double resolving every `find` to `root`, with no filesystem.
|
|
17089
|
+
*
|
|
17090
|
+
* @remarks
|
|
17091
|
+
* The nine-copies-of-a-four-line-mock case — a `Layer.succeed` over a `find`
|
|
17092
|
+
* that ignores its arguments and succeeds with a fixed root is what consumers
|
|
17093
|
+
* were writing by hand. The difference is that this double **honours
|
|
17094
|
+
* `stopAt`**: a hand-rolled `find` that ignores the ceiling makes a bounded
|
|
17095
|
+
* call pass under test and fail against the live service, which is the
|
|
17096
|
+
* failure mode the option exists to catch. A `root` above the ceiling fails
|
|
17097
|
+
* here exactly as it would live, with the same
|
|
17098
|
+
* {@link WorkspaceRootNotFoundError}.
|
|
17099
|
+
*
|
|
17100
|
+
* The ceiling is `path.resolve`d through the injected `Path` service before
|
|
17101
|
+
* the comparison, exactly as the live `make` path does — so a `stopAt`
|
|
17102
|
+
* carrying `..` segments bounds the double identically to the live service,
|
|
17103
|
+
* not by raw string. This is why `makeTest` yields an `Effect` requiring
|
|
17104
|
+
* `Path`: it captures the service once at construction, the same shape as
|
|
17105
|
+
* `make`. Consumers reach for {@link WorkspaceRoot.layerTest}, which provides
|
|
17106
|
+
* `Path.layer` internally, so the requirement never surfaces at their call
|
|
17107
|
+
* site.
|
|
17108
|
+
*
|
|
17109
|
+
* `maxDepth` is deliberately NOT modelled: the double does not walk, so it has
|
|
17110
|
+
* no depth to cap, and pretending otherwise would encode a fiction. A suite
|
|
17111
|
+
* exercising the depth guard wants the live service over a fixture tree.
|
|
17112
|
+
*
|
|
17113
|
+
* @param root - The root every unbounded `find` resolves to.
|
|
17114
|
+
*/
|
|
17115
|
+
static makeTest = (root) => Effect.gen(function* () {
|
|
17116
|
+
const path = yield* Path.Path;
|
|
17117
|
+
return { find: (cwd, options) => options?.stopAt !== void 0 && !isAtOrBelow(root, path.resolve(options.stopAt)) ? Effect.fail(new WorkspaceRootNotFoundError({
|
|
17118
|
+
searchPath: cwd,
|
|
17119
|
+
markers: WORKSPACE_MARKERS,
|
|
17120
|
+
stopAt: options.stopAt
|
|
17121
|
+
})) : Effect.succeed(root) };
|
|
17122
|
+
});
|
|
17123
|
+
/**
|
|
17124
|
+
* The test layer: {@link WorkspaceRoot.makeTest} with `Path.layer` provided.
|
|
17125
|
+
*
|
|
17126
|
+
* @remarks
|
|
17127
|
+
* `makeTest` requires `Path` to normalize the `stopAt` ceiling; this layer
|
|
17128
|
+
* supplies core's `Path.layer` internally, so the requirement never reaches a
|
|
17129
|
+
* consumer — the published type stays `Layer.Layer<WorkspaceRoot>`.
|
|
17130
|
+
*
|
|
17131
|
+
* A parameterized layer factory mints a **fresh reference per call**, and
|
|
17132
|
+
* layers memoize by reference — bind the result to a `const` and reuse it
|
|
17133
|
+
* rather than calling `layerTest(...)` at each composition site.
|
|
17134
|
+
*
|
|
17135
|
+
* Pair it with `WorkspaceDiscovery.layerTest` to stand up the whole discovery
|
|
17136
|
+
* path without a filesystem; between them there is nothing left for a
|
|
17137
|
+
* module-level mock of `@effected/workspaces` to do, and a provided layer
|
|
17138
|
+
* keeps the service graph — and its typed errors — intact.
|
|
17139
|
+
*
|
|
17140
|
+
* @example
|
|
17141
|
+
* ```ts
|
|
17142
|
+
* import { WorkspaceDiscovery, WorkspaceRoot } from "@effected/workspaces";
|
|
17143
|
+
* import { Effect } from "effect";
|
|
17144
|
+
*
|
|
17145
|
+
* const TestRoot = WorkspaceRoot.layerTest("/repo");
|
|
17146
|
+
* const TestDiscovery = WorkspaceDiscovery.layerTest({
|
|
17147
|
+
* listPackages: () => Effect.succeed([]),
|
|
17148
|
+
* });
|
|
17149
|
+
* // program.pipe(Effect.provide(TestRoot), Effect.provide(TestDiscovery))
|
|
17150
|
+
* ```
|
|
17151
|
+
*/
|
|
17152
|
+
static layerTest = (root) => Layer.effect(WorkspaceRoot, WorkspaceRoot.makeTest(root)).pipe(Layer.provide(Path.layer));
|
|
16392
17153
|
};
|
|
16393
17154
|
|
|
16394
17155
|
//#endregion
|
|
16395
|
-
//#region ../../node_modules/.pnpm/@effected+workspaces@0.
|
|
17156
|
+
//#region ../../node_modules/.pnpm/@effected+workspaces@0.6.0_@effected+jsonc@0.5.0_effect@4.0.0-beta.99__effect@4.0.0-beta.99/node_modules/@effected/workspaces/internal/limits.js
|
|
16396
17157
|
/**
|
|
16397
17158
|
* Hard ceiling on directories the enumerator will visit for one pattern set.
|
|
16398
17159
|
* Guards the pathological case a depth cap alone does not: a wide, shallow
|
|
@@ -16411,7 +17172,7 @@ const MAX_ENUMERATION_ENTRIES = 1e5;
|
|
|
16411
17172
|
const PRUNED_DIRECTORIES = /* @__PURE__ */ new Set([".git", "node_modules"]);
|
|
16412
17173
|
|
|
16413
17174
|
//#endregion
|
|
16414
|
-
//#region ../../node_modules/.pnpm/@effected+workspaces@0.
|
|
17175
|
+
//#region ../../node_modules/.pnpm/@effected+workspaces@0.6.0_@effected+jsonc@0.5.0_effect@4.0.0-beta.99__effect@4.0.0-beta.99/node_modules/@effected/workspaces/internal/traverse.js
|
|
16415
17176
|
/** Directory names never descended into. */
|
|
16416
17177
|
const isPruned = (entry) => PRUNED_DIRECTORIES.has(entry);
|
|
16417
17178
|
/** Join root-relative POSIX segments; `""` is the root itself. */
|
|
@@ -16502,7 +17263,7 @@ var Traversal = class {
|
|
|
16502
17263
|
};
|
|
16503
17264
|
|
|
16504
17265
|
//#endregion
|
|
16505
|
-
//#region ../../node_modules/.pnpm/@effected+workspaces@0.
|
|
17266
|
+
//#region ../../node_modules/.pnpm/@effected+workspaces@0.6.0_@effected+jsonc@0.5.0_effect@4.0.0-beta.99__effect@4.0.0-beta.99/node_modules/@effected/workspaces/internal/enumerate.js
|
|
16506
17267
|
/** Strip a trailing slash from `GlobPattern.enumerationPrefix` to get a relative directory. */
|
|
16507
17268
|
const baseOf = (pattern) => pattern.enumerationPrefix.replace(/\/$/, "");
|
|
16508
17269
|
/**
|
|
@@ -16573,7 +17334,7 @@ const enumerate = (root, globs, options) => Effect.gen(function* () {
|
|
|
16573
17334
|
});
|
|
16574
17335
|
|
|
16575
17336
|
//#endregion
|
|
16576
|
-
//#region ../../node_modules/.pnpm/@effected+workspaces@0.
|
|
17337
|
+
//#region ../../node_modules/.pnpm/@effected+workspaces@0.6.0_@effected+jsonc@0.5.0_effect@4.0.0-beta.99__effect@4.0.0-beta.99/node_modules/@effected/workspaces/internal/patterns.js
|
|
16577
17338
|
const stringsOf = (value) => Array.isArray(value) ? value.filter((entry) => typeof entry === "string") : void 0;
|
|
16578
17339
|
/** The `packages:` list of a `pnpm-workspace.yaml` document. Total on a parsed document. */
|
|
16579
17340
|
const pnpmPatternsOf = (document) => {
|
|
@@ -16631,7 +17392,7 @@ const readPatterns = (root) => Effect.gen(function* () {
|
|
|
16631
17392
|
});
|
|
16632
17393
|
|
|
16633
17394
|
//#endregion
|
|
16634
|
-
//#region ../../node_modules/.pnpm/@effected+workspaces@0.
|
|
17395
|
+
//#region ../../node_modules/.pnpm/@effected+workspaces@0.6.0_@effected+jsonc@0.5.0_effect@4.0.0-beta.99__effect@4.0.0-beta.99/node_modules/@effected/workspaces/WorkspaceDiscovery.js
|
|
16635
17396
|
/**
|
|
16636
17397
|
* Raised when a workspace member's `package.json` cannot be read, parsed, or
|
|
16637
17398
|
* used — it is missing, malformed, or lacks a `name` or `version`.
|
|
@@ -16809,6 +17570,7 @@ var WorkspaceDiscovery = class WorkspaceDiscovery extends Context.Service()("@ef
|
|
|
16809
17570
|
path: directory,
|
|
16810
17571
|
packageJsonPath,
|
|
16811
17572
|
relativePath,
|
|
17573
|
+
workspaceRoot: root,
|
|
16812
17574
|
manifestRecord: raw,
|
|
16813
17575
|
...typeof raw.private === "boolean" ? { private: raw.private } : {},
|
|
16814
17576
|
...isStringRecord$2(raw.dependencies) ? { dependencies: raw.dependencies } : {},
|
|
@@ -16966,6 +17728,7 @@ var WorkspaceDiscovery = class WorkspaceDiscovery extends Context.Service()("@ef
|
|
|
16966
17728
|
* path: "/repo/packages/utils",
|
|
16967
17729
|
* packageJsonPath: "/repo/packages/utils/package.json",
|
|
16968
17730
|
* relativePath: "packages/utils",
|
|
17731
|
+
* workspaceRoot: "/repo",
|
|
16969
17732
|
* }),
|
|
16970
17733
|
* ]),
|
|
16971
17734
|
* });
|
|
@@ -17064,7 +17827,7 @@ var WorkspaceDiscovery = class WorkspaceDiscovery extends Context.Service()("@ef
|
|
|
17064
17827
|
const isStringRecord$2 = (value) => value !== null && typeof value === "object" && !Array.isArray(value) && Object.values(value).every((entry) => typeof entry === "string");
|
|
17065
17828
|
|
|
17066
17829
|
//#endregion
|
|
17067
|
-
//#region ../../node_modules/.pnpm/@effected+workspaces@0.
|
|
17830
|
+
//#region ../../node_modules/.pnpm/@effected+workspaces@0.6.0_@effected+jsonc@0.5.0_effect@4.0.0-beta.99__effect@4.0.0-beta.99/node_modules/@effected/workspaces/DependencyGraph.js
|
|
17068
17831
|
/**
|
|
17069
17832
|
* Raised when the workspace dependency graph cannot be topologically ordered
|
|
17070
17833
|
* because it contains a cycle.
|
|
@@ -18666,7 +19429,7 @@ var Git = class extends Context.Service()("@effected/git/Git") {
|
|
|
18666
19429
|
};
|
|
18667
19430
|
|
|
18668
19431
|
//#endregion
|
|
18669
|
-
//#region ../../node_modules/.pnpm/@effected+workspaces@0.
|
|
19432
|
+
//#region ../../node_modules/.pnpm/@effected+workspaces@0.6.0_@effected+jsonc@0.5.0_effect@4.0.0-beta.99__effect@4.0.0-beta.99/node_modules/@effected/workspaces/ChangeDetector.js
|
|
18670
19433
|
/**
|
|
18671
19434
|
* Which git refs to compare, and whether to fold in the working tree.
|
|
18672
19435
|
*
|
|
@@ -18948,7 +19711,7 @@ function resolveFromCatalog(catalogs, wantedDependency) {
|
|
|
18948
19711
|
}
|
|
18949
19712
|
|
|
18950
19713
|
//#endregion
|
|
18951
|
-
//#region ../../node_modules/.pnpm/@effected+workspaces@0.
|
|
19714
|
+
//#region ../../node_modules/.pnpm/@effected+workspaces@0.6.0_@effected+jsonc@0.5.0_effect@4.0.0-beta.99__effect@4.0.0-beta.99/node_modules/@effected/workspaces/internal/catalogs.js
|
|
18952
19715
|
/** Project a pnpm-workspace manifest's `catalog` / `catalogs` fields into a `Catalogs` map. */
|
|
18953
19716
|
const inlineCatalogs = (manifest) => {
|
|
18954
19717
|
if (manifest.catalog === void 0 && manifest.catalogs === void 0) return {};
|
|
@@ -19013,7 +19776,7 @@ const rangeOf = (catalogs, dependency, specifier) => {
|
|
|
19013
19776
|
};
|
|
19014
19777
|
|
|
19015
19778
|
//#endregion
|
|
19016
|
-
//#region ../../node_modules/.pnpm/@effected+workspaces@0.
|
|
19779
|
+
//#region ../../node_modules/.pnpm/@effected+workspaces@0.6.0_@effected+jsonc@0.5.0_effect@4.0.0-beta.99__effect@4.0.0-beta.99/node_modules/@effected/workspaces/ConfigDependencyHooks.js
|
|
19017
19780
|
/** Whether `value` is a non-null, non-array object. */
|
|
19018
19781
|
const isObject$2 = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
19019
19782
|
/**
|
|
@@ -19048,17 +19811,45 @@ const seedToConfig = (seed) => {
|
|
|
19048
19811
|
else catalogs[name] = { ...entries };
|
|
19049
19812
|
return {
|
|
19050
19813
|
catalog,
|
|
19051
|
-
catalogs
|
|
19814
|
+
catalogs,
|
|
19815
|
+
minimumReleaseAge: void 0,
|
|
19816
|
+
minimumReleaseAgeExclude: void 0
|
|
19052
19817
|
};
|
|
19053
19818
|
};
|
|
19054
|
-
/**
|
|
19819
|
+
/** A finite number if `value` is one, else the prior threaded value — a garbage age is dropped, not fatal. */
|
|
19820
|
+
const finiteNumberOr = (value, fallback) => typeof value === "number" && Number.isFinite(value) ? value : fallback;
|
|
19821
|
+
/** A string array if `value` is one, else the prior threaded value — a malformed exclude is dropped, not fatal. */
|
|
19822
|
+
const stringArrayOr = (value, fallback) => Array.isArray(value) && value.every((entry) => typeof entry === "string") ? value : fallback;
|
|
19823
|
+
/**
|
|
19824
|
+
* Read the catalog slice and the release-age keys back out of whatever a hook
|
|
19825
|
+
* returned, threading the prior config as the fallback.
|
|
19826
|
+
*
|
|
19827
|
+
* @remarks
|
|
19828
|
+
* Tolerant by design, matching this seam's discipline: a hook's returned *data*
|
|
19829
|
+
* is normalized, never a typed failure (only a load/replay *mechanism* failure
|
|
19830
|
+
* raises `CatalogAssemblyError`). A hook that omits a key, or returns a
|
|
19831
|
+
* malformed value for it, leaves the prior threaded value in place; a hook that
|
|
19832
|
+
* sets a well-formed key rewrites it — so across hooks the **last well-formed
|
|
19833
|
+
* write wins**, exactly as pnpm's single mutable config object behaves.
|
|
19834
|
+
*/
|
|
19055
19835
|
const configOf = (value, fallback) => {
|
|
19056
19836
|
if (!isObject$2(value)) return fallback;
|
|
19057
19837
|
return {
|
|
19058
19838
|
catalog: isObject$2(value.catalog) ? value.catalog : fallback.catalog,
|
|
19059
|
-
catalogs: isObject$2(value.catalogs) ? value.catalogs : fallback.catalogs
|
|
19839
|
+
catalogs: isObject$2(value.catalogs) ? value.catalogs : fallback.catalogs,
|
|
19840
|
+
minimumReleaseAge: finiteNumberOr(value.minimumReleaseAge, fallback.minimumReleaseAge),
|
|
19841
|
+
minimumReleaseAgeExclude: stringArrayOr(value.minimumReleaseAgeExclude, fallback.minimumReleaseAgeExclude)
|
|
19060
19842
|
};
|
|
19061
19843
|
};
|
|
19844
|
+
/**
|
|
19845
|
+
* Project the threaded config's release-age keys into a partial gate
|
|
19846
|
+
* contribution, omitting a key the hooks never set (never an explicit
|
|
19847
|
+
* `undefined` — the fields are `optionalKey`).
|
|
19848
|
+
*/
|
|
19849
|
+
const releaseAgeOf = (config) => ({
|
|
19850
|
+
...config.minimumReleaseAge !== void 0 ? { ageMinutes: config.minimumReleaseAge } : {},
|
|
19851
|
+
...config.minimumReleaseAgeExclude !== void 0 ? { exclude: config.minimumReleaseAgeExclude } : {}
|
|
19852
|
+
});
|
|
19062
19853
|
/** Fold the hook config back into the normalized `catalog name → dependency → range` record. */
|
|
19063
19854
|
const configToEntries = (config) => {
|
|
19064
19855
|
const raw = { ...config.catalogs };
|
|
@@ -19098,7 +19889,10 @@ var ConfigDependencyHooks = class ConfigDependencyHooks extends Context.Service(
|
|
|
19098
19889
|
* config dependency. The default {@link WorkspaceCatalogs} layer wires this, so
|
|
19099
19890
|
* the default catalog path provably executes no config-dependency code.
|
|
19100
19891
|
*/
|
|
19101
|
-
static layerNoop = Layer.succeed(ConfigDependencyHooks, { inject: (_root, _configDependencies, seed) => Effect.succeed(
|
|
19892
|
+
static layerNoop = Layer.succeed(ConfigDependencyHooks, { inject: (_root, _configDependencies, seed) => Effect.succeed({
|
|
19893
|
+
catalogs: seed,
|
|
19894
|
+
releaseAge: {}
|
|
19895
|
+
}) });
|
|
19102
19896
|
/**
|
|
19103
19897
|
* The live layer: dynamically imports each config dependency's `pnpmfile.cjs`
|
|
19104
19898
|
* (in process, no subprocess) and replays its `updateConfig` hook over the
|
|
@@ -19107,13 +19901,20 @@ var ConfigDependencyHooks = class ConfigDependencyHooks extends Context.Service(
|
|
|
19107
19901
|
* `hooks`-source `CatalogAssemblyError`, never a silent skip.
|
|
19108
19902
|
*
|
|
19109
19903
|
* @remarks
|
|
19110
|
-
*
|
|
19111
|
-
*
|
|
19112
|
-
*
|
|
19904
|
+
* Runtime-coupled by design, not node-exclusive. The `import()` below loads
|
|
19905
|
+
* **and executes** a config dependency's pnpmfile in-process — code execution,
|
|
19906
|
+
* not IO, so no `FileSystem` / `Path` service abstracts it. The `node:path` and
|
|
19907
|
+
* `node:url` imports (`join`, `pathToFileURL`) exist only to build the URL that
|
|
19908
|
+
* `import()` consumes; node and bun both implement those builtins and dynamic
|
|
19909
|
+
* import, so this layer runs on either runtime. Only ever wired by
|
|
19910
|
+
* `WorkspaceCatalogs.layerWithConfigDependencies`.
|
|
19113
19911
|
*/
|
|
19114
19912
|
static layerLive = Layer.succeed(ConfigDependencyHooks, { inject: (root, configDependencies, seed) => Effect.gen(function* () {
|
|
19115
19913
|
const names = Object.keys(configDependencies);
|
|
19116
|
-
if (names.length === 0) return
|
|
19914
|
+
if (names.length === 0) return {
|
|
19915
|
+
catalogs: seed,
|
|
19916
|
+
releaseAge: {}
|
|
19917
|
+
};
|
|
19117
19918
|
let config = seedToConfig(seed);
|
|
19118
19919
|
for (const name of names) {
|
|
19119
19920
|
if (hasTraversalSegment(name)) return yield* Effect.fail(new CatalogAssemblyError({
|
|
@@ -19154,12 +19955,15 @@ var ConfigDependencyHooks = class ConfigDependencyHooks extends Context.Service(
|
|
|
19154
19955
|
})
|
|
19155
19956
|
});
|
|
19156
19957
|
}
|
|
19157
|
-
return
|
|
19958
|
+
return {
|
|
19959
|
+
catalogs: configToEntries(config),
|
|
19960
|
+
releaseAge: releaseAgeOf(config)
|
|
19961
|
+
};
|
|
19158
19962
|
}) });
|
|
19159
19963
|
};
|
|
19160
19964
|
|
|
19161
19965
|
//#endregion
|
|
19162
|
-
//#region ../../node_modules/.pnpm/@effected+workspaces@0.
|
|
19966
|
+
//#region ../../node_modules/.pnpm/@effected+workspaces@0.6.0_@effected+jsonc@0.5.0_effect@4.0.0-beta.99__effect@4.0.0-beta.99/node_modules/@effected/workspaces/PackageManagerName.js
|
|
19163
19967
|
/**
|
|
19164
19968
|
* The four package managers this package understands.
|
|
19165
19969
|
*
|
|
@@ -19402,7 +20206,7 @@ var PackageManagerDetector = class PackageManagerDetector extends Context.Servic
|
|
|
19402
20206
|
};
|
|
19403
20207
|
|
|
19404
20208
|
//#endregion
|
|
19405
|
-
//#region ../../node_modules/.pnpm/@effected+workspaces@0.
|
|
20209
|
+
//#region ../../node_modules/.pnpm/@effected+workspaces@0.6.0_@effected+jsonc@0.5.0_effect@4.0.0-beta.99__effect@4.0.0-beta.99/node_modules/@effected/workspaces/LockfileReader.js
|
|
19406
20210
|
/**
|
|
19407
20211
|
* Raised when the workspace's lockfile cannot be read off disk.
|
|
19408
20212
|
*
|
|
@@ -19513,7 +20317,7 @@ var LockfileReader = class LockfileReader extends Context.Service()("@effected/w
|
|
|
19513
20317
|
};
|
|
19514
20318
|
|
|
19515
20319
|
//#endregion
|
|
19516
|
-
//#region ../../node_modules/.pnpm/@effected+workspaces@0.
|
|
20320
|
+
//#region ../../node_modules/.pnpm/@effected+workspaces@0.6.0_@effected+jsonc@0.5.0_effect@4.0.0-beta.99__effect@4.0.0-beta.99/node_modules/@effected/workspaces/Publishability.js
|
|
19517
20321
|
/** The public npm registry, used when `publishConfig.registry` says nothing. */
|
|
19518
20322
|
const DEFAULT_REGISTRY = "https://registry.npmjs.org/";
|
|
19519
20323
|
/**
|
|
@@ -19614,7 +20418,7 @@ var PublishabilityDetector = class PublishabilityDetector extends Context.Servic
|
|
|
19614
20418
|
};
|
|
19615
20419
|
|
|
19616
20420
|
//#endregion
|
|
19617
|
-
//#region ../../node_modules/.pnpm/@effected+workspaces@0.
|
|
20421
|
+
//#region ../../node_modules/.pnpm/@effected+workspaces@0.6.0_@effected+jsonc@0.5.0_effect@4.0.0-beta.99__effect@4.0.0-beta.99/node_modules/@effected/workspaces/WorkspaceCatalogs.js
|
|
19618
20422
|
/**
|
|
19619
20423
|
* An immutable, fully-normalized catalog collection — the one catalog
|
|
19620
20424
|
* resolution semantic in the package.
|
|
@@ -19787,6 +20591,37 @@ const configDependenciesOf = (document) => {
|
|
|
19787
20591
|
for (const [name, spec] of Object.entries(document.configDependencies)) if (typeof spec === "string") out[name] = spec;
|
|
19788
20592
|
return out;
|
|
19789
20593
|
};
|
|
20594
|
+
/**
|
|
20595
|
+
* The inline release-age gate contribution of a parsed `pnpm-workspace.yaml`
|
|
20596
|
+
* document — pnpm's top-level `minimumReleaseAge` (minutes) and
|
|
20597
|
+
* `minimumReleaseAgeExclude` (name patterns) keys, mapped onto
|
|
20598
|
+
* `@effected/npm`'s `PartialReleaseAgeGate` field names
|
|
20599
|
+
* (`ageMinutes` / `exclude`).
|
|
20600
|
+
*
|
|
20601
|
+
* @remarks
|
|
20602
|
+
* **Hard-fail by design**, the same posture as the live catalog-block reader:
|
|
20603
|
+
* a present-but-malformed value (a non-numeric `minimumReleaseAge`, a
|
|
20604
|
+
* `minimumReleaseAgeExclude` that is not a string array) fails typed as a
|
|
20605
|
+
* `CatalogAssemblyError` rather than being silently dropped, because a
|
|
20606
|
+
* silently-ignored gate is the "install refuses a too-young version the
|
|
20607
|
+
* resolver already picked" bug this vocabulary exists to prevent. An absent or
|
|
20608
|
+
* explicitly `null` key contributes nothing; the permissive
|
|
20609
|
+
* `PartialReleaseAgeGate` accepts any finite `ageMinutes` (negatives and
|
|
20610
|
+
* fractions included) — `ReleaseAgeGate.combine` is the single clamping
|
|
20611
|
+
* authority, exactly as on the hook path.
|
|
20612
|
+
*/
|
|
20613
|
+
const inlineReleaseAge = (document) => {
|
|
20614
|
+
if (!isObject$1(document)) return Effect.succeed({});
|
|
20615
|
+
const raw = {};
|
|
20616
|
+
if (document.minimumReleaseAge !== void 0 && document.minimumReleaseAge !== null) raw.ageMinutes = document.minimumReleaseAge;
|
|
20617
|
+
if (document.minimumReleaseAgeExclude !== void 0 && document.minimumReleaseAgeExclude !== null) raw.exclude = document.minimumReleaseAgeExclude;
|
|
20618
|
+
if (Object.keys(raw).length === 0) return Effect.succeed({});
|
|
20619
|
+
return Schema.decodeUnknownEffect(PartialReleaseAgeGate)(raw).pipe(Effect.catchTag("SchemaError", (cause) => new CatalogAssemblyError({
|
|
20620
|
+
source: "manifest",
|
|
20621
|
+
path: "pnpm-workspace.yaml",
|
|
20622
|
+
cause
|
|
20623
|
+
})));
|
|
20624
|
+
};
|
|
19790
20625
|
/** A hard-fail catalog-assembly failure naming the malformed part of a `workspaces` field. */
|
|
19791
20626
|
const malformed = (source, path, detail) => new CatalogAssemblyError({
|
|
19792
20627
|
source,
|
|
@@ -19907,6 +20742,8 @@ var WorkspaceCatalogs = class WorkspaceCatalogs extends Context.Service()("@effe
|
|
|
19907
20742
|
const hasPnpmWorkspace = yield* probeExists(workspaceYaml);
|
|
19908
20743
|
let inline;
|
|
19909
20744
|
let injected;
|
|
20745
|
+
let inlineGate = {};
|
|
20746
|
+
let hookGate = {};
|
|
19910
20747
|
if (hasPnpmWorkspace) {
|
|
19911
20748
|
const text = yield* fs.readFileString(workspaceYaml).pipe(Effect.mapError((cause) => new CatalogAssemblyError({
|
|
19912
20749
|
source: "manifest",
|
|
@@ -19920,11 +20757,16 @@ var WorkspaceCatalogs = class WorkspaceCatalogs extends Context.Service()("@effe
|
|
|
19920
20757
|
})));
|
|
19921
20758
|
yield* validatePnpmWorkspaceCatalogs(document);
|
|
19922
20759
|
inline = CatalogSet.fromCatalogs(inlineCatalogs(catalogBlocksOf(document)));
|
|
19923
|
-
|
|
19924
|
-
|
|
20760
|
+
inlineGate = yield* inlineReleaseAge(document);
|
|
20761
|
+
const injection = yield* hooks.inject(root, configDependenciesOf(document), inline.entries);
|
|
20762
|
+
injected = CatalogSet.fromCatalogs(injection.catalogs);
|
|
20763
|
+
hookGate = injection.releaseAge;
|
|
19925
20764
|
} else {
|
|
19926
20765
|
const manifestPath = path.join(root, "package.json");
|
|
19927
|
-
if (!(yield* probeExists(manifestPath))) return
|
|
20766
|
+
if (!(yield* probeExists(manifestPath))) return {
|
|
20767
|
+
catalogs: fromLockfile,
|
|
20768
|
+
releaseAgeGate: ReleaseAgeGate.combine()
|
|
20769
|
+
};
|
|
19928
20770
|
const text = yield* fs.readFileString(manifestPath).pipe(Effect.mapError((cause) => new CatalogAssemblyError({
|
|
19929
20771
|
source: "manifest",
|
|
19930
20772
|
path: manifestPath,
|
|
@@ -19934,20 +20776,28 @@ var WorkspaceCatalogs = class WorkspaceCatalogs extends Context.Service()("@effe
|
|
|
19934
20776
|
injected = CatalogSet.empty();
|
|
19935
20777
|
}
|
|
19936
20778
|
const assembled = CatalogSet.merge(fromLockfile, inline, injected);
|
|
20779
|
+
const releaseAgeGate = ReleaseAgeGate.combine(inlineGate, hookGate);
|
|
19937
20780
|
yield* Effect.logDebug("Catalogs assembled").pipe(Effect.annotateLogs({
|
|
19938
20781
|
"workspace.root": root,
|
|
19939
|
-
"workspace.catalogs": Object.keys(assembled.entries).join(",")
|
|
20782
|
+
"workspace.catalogs": Object.keys(assembled.entries).join(","),
|
|
20783
|
+
"workspace.releaseAgeMinutes": releaseAgeGate.ageMinutes
|
|
19940
20784
|
}));
|
|
19941
|
-
return
|
|
20785
|
+
return {
|
|
20786
|
+
catalogs: assembled,
|
|
20787
|
+
releaseAgeGate
|
|
20788
|
+
};
|
|
19942
20789
|
});
|
|
19943
20790
|
const [resolveOnce, invalidate] = yield* Effect.cachedInvalidateWithTTL(assemble, Duration.infinity);
|
|
19944
20791
|
const memo = Effect.onExit(resolveOnce, (exit) => Exit.isSuccess(exit) ? Effect.void : invalidate);
|
|
19945
20792
|
return {
|
|
19946
20793
|
set: Effect.fn("WorkspaceCatalogs.set")(function* () {
|
|
19947
|
-
return yield* memo;
|
|
20794
|
+
return (yield* memo).catalogs;
|
|
19948
20795
|
}),
|
|
19949
20796
|
resolveSpecifier: Effect.fn("WorkspaceCatalogs.resolveSpecifier")(function* (dependency, specifier) {
|
|
19950
|
-
return (yield* memo).resolveSpecifier(dependency, specifier);
|
|
20797
|
+
return (yield* memo).catalogs.resolveSpecifier(dependency, specifier);
|
|
20798
|
+
}),
|
|
20799
|
+
releaseAgeGate: Effect.fn("WorkspaceCatalogs.releaseAgeGate")(function* () {
|
|
20800
|
+
return (yield* memo).releaseAgeGate;
|
|
19951
20801
|
})
|
|
19952
20802
|
};
|
|
19953
20803
|
});
|
|
@@ -19999,7 +20849,7 @@ var WorkspaceCatalogs = class WorkspaceCatalogs extends Context.Service()("@effe
|
|
|
19999
20849
|
};
|
|
20000
20850
|
|
|
20001
20851
|
//#endregion
|
|
20002
|
-
//#region ../../node_modules/.pnpm/@effected+workspaces@0.
|
|
20852
|
+
//#region ../../node_modules/.pnpm/@effected+workspaces@0.6.0_@effected+jsonc@0.5.0_effect@4.0.0-beta.99__effect@4.0.0-beta.99/node_modules/@effected/workspaces/WorkspaceStateSnapshot.js
|
|
20003
20853
|
const EMPTY = Object.freeze(Object.create(null));
|
|
20004
20854
|
const DependencyMap = Schema.Record(Schema.String, Schema.String).pipe(Schema.withDecodingDefaultKey(Effect.succeed(EMPTY)), Schema.withConstructorDefault(Effect.succeed(EMPTY)));
|
|
20005
20855
|
/**
|
|
@@ -20165,7 +21015,7 @@ var WorkspaceStateSnapshot = class extends Schema.Class("WorkspaceStateSnapshot"
|
|
|
20165
21015
|
};
|
|
20166
21016
|
|
|
20167
21017
|
//#endregion
|
|
20168
|
-
//#region ../../node_modules/.pnpm/@effected+workspaces@0.
|
|
21018
|
+
//#region ../../node_modules/.pnpm/@effected+workspaces@0.6.0_@effected+jsonc@0.5.0_effect@4.0.0-beta.99__effect@4.0.0-beta.99/node_modules/@effected/workspaces/WorkspaceSnapshots.js
|
|
20169
21019
|
/** Whether `value` is a non-null, non-array object. */
|
|
20170
21020
|
const isObject = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
20171
21021
|
/** Whether every value in a record is a string — a usable dependency map. */
|
|
@@ -20358,7 +21208,7 @@ var WorkspaceSnapshots = class WorkspaceSnapshots extends Context.Service()("@ef
|
|
|
20358
21208
|
};
|
|
20359
21209
|
|
|
20360
21210
|
//#endregion
|
|
20361
|
-
//#region ../../node_modules/.pnpm/@effected+workspaces@0.
|
|
21211
|
+
//#region ../../node_modules/.pnpm/@effected+workspaces@0.6.0_@effected+jsonc@0.5.0_effect@4.0.0-beta.99__effect@4.0.0-beta.99/node_modules/@effected/workspaces/Workspaces.js
|
|
20362
21212
|
/**
|
|
20363
21213
|
* Every service that needs only a filesystem: root, package-manager detection,
|
|
20364
21214
|
* discovery, lockfile reading, catalogs and publishability.
|
|
@@ -20736,34 +21586,15 @@ const SilkPublishabilityDetectorLive = Layer.effect(PublishabilityDetector, Effe
|
|
|
20736
21586
|
}) };
|
|
20737
21587
|
}));
|
|
20738
21588
|
/**
|
|
20739
|
-
* The workspace root a package was discovered against, derived from its own
|
|
20740
|
-
* coordinates: `relativePath` is the package directory relative to the
|
|
20741
|
-
* discovery root (POSIX, `"."` for the root package), so ascending one level
|
|
20742
|
-
* per path segment from `pkg.path` lands exactly on that root.
|
|
20743
|
-
*
|
|
20744
|
-
* @remarks
|
|
20745
|
-
* Derivation is deliberate — probing the filesystem for workspace markers
|
|
20746
|
-
* (`WorkspaceRoot.find`) can walk PAST the intended root when that root
|
|
20747
|
-
* carries no marker (a fixture tree, a bare directory) and land on an
|
|
20748
|
-
* enclosing workspace, silently swapping in that outer root's
|
|
20749
|
-
* `.changeset/config.json` and dropping the ignore/mode gating (the #209
|
|
20750
|
-
* regression class). The discovery root needs no probing: whoever built the
|
|
20751
|
-
* `WorkspacePackage` already knew it.
|
|
20752
|
-
*/
|
|
20753
|
-
const packageRoot = (pkg) => {
|
|
20754
|
-
const segments = pkg.relativePath.split("/").filter((segment) => segment !== "" && segment !== ".");
|
|
20755
|
-
return segments.length === 0 ? pkg.path : join(pkg.path, ...segments.map(() => ".."));
|
|
20756
|
-
};
|
|
20757
|
-
/**
|
|
20758
21589
|
* Ignore-aware override of `PublishabilityDetector`. `detect` short-circuits to `[]`
|
|
20759
21590
|
* for changeset-ignored packages, then dispatches on `ChangesetConfig.mode`:
|
|
20760
21591
|
* `none` → `[]`; `silk` → `SilkPublishability.detect`; `vanilla` → the library default.
|
|
20761
21592
|
*
|
|
20762
21593
|
* @remarks Requires `FileSystem` and {@link ChangesetConfig} at build.
|
|
20763
21594
|
* The kit's `detect` contract no longer receives the workspace root, so the changeset
|
|
20764
|
-
* lookups
|
|
20765
|
-
*
|
|
20766
|
-
*
|
|
21595
|
+
* lookups read it from `pkg.workspaceRoot` — the discovery root the package was found
|
|
21596
|
+
* against, never a filesystem marker walk, which could escape an unmarked root and read
|
|
21597
|
+
* the wrong `.changeset/config.json`.
|
|
20767
21598
|
*
|
|
20768
21599
|
* @since 0.4.0
|
|
20769
21600
|
* @public
|
|
@@ -20773,7 +21604,7 @@ const PublishabilityDetectorAdaptiveLive = Layer.effect(PublishabilityDetector,
|
|
|
20773
21604
|
const config = yield* ChangesetConfig;
|
|
20774
21605
|
const vanilla = yield* Effect.provide(PublishabilityDetector, PublishabilityDetector.layer);
|
|
20775
21606
|
return { detect: (pkg) => Effect.gen(function* () {
|
|
20776
|
-
const root =
|
|
21607
|
+
const root = pkg.workspaceRoot;
|
|
20777
21608
|
if (yield* config.isIgnored(pkg.name, root)) return [];
|
|
20778
21609
|
const mode = yield* config.mode(root);
|
|
20779
21610
|
if (mode === "none") return [];
|
|
@@ -45570,25 +46401,15 @@ function normalizeLegacyOptions(options, configPath) {
|
|
|
45570
46401
|
};
|
|
45571
46402
|
}
|
|
45572
46403
|
/** Match dotfiles, mirroring the former tinyglobby `dot: true` behavior. */
|
|
45573
|
-
const GLOB_OPTIONS = GlobPatternOptions.make({ dot: true });
|
|
46404
|
+
const GLOB_OPTIONS$1 = GlobPatternOptions.make({ dot: true });
|
|
45574
46405
|
/**
|
|
45575
|
-
* Compile `glob` via `@effected/glob`, folding a compile-guard trip
|
|
45576
|
-
* (over-length pattern, brace-expansion budget, nesting depth) into a
|
|
45577
|
-
* {@link ConfigurationError} naming the offending glob on the typed channel.
|
|
45578
|
-
*/
|
|
45579
|
-
function compileGlob(glob) {
|
|
45580
|
-
return GlobPattern.compile(glob, GLOB_OPTIONS).pipe(Effect.mapError((error) => new ConfigurationError({
|
|
45581
|
-
field: "glob",
|
|
45582
|
-
reason: `Invalid glob pattern ${JSON.stringify(glob)}: ${error.message}`
|
|
45583
|
-
})));
|
|
45584
|
-
}
|
|
45585
46406
|
/**
|
|
45586
46407
|
* Pure attribution helper: does `glob` (under this service's `dot: true`
|
|
45587
46408
|
* semantics) match the repo-relative POSIX path `rel`? An uncompilable
|
|
45588
46409
|
* pattern matches nothing.
|
|
45589
46410
|
*/
|
|
45590
46411
|
function globMatchesRel(glob, rel) {
|
|
45591
|
-
const result =
|
|
46412
|
+
const result = GlobPattern.compileResult(glob, GLOB_OPTIONS$1);
|
|
45592
46413
|
return Result.isSuccess(result) && result.success.matches(rel);
|
|
45593
46414
|
}
|
|
45594
46415
|
/**
|
|
@@ -45604,13 +46425,14 @@ function globMatchesRel(glob, rel) {
|
|
|
45604
46425
|
* module already speaks POSIX-relative match paths).
|
|
45605
46426
|
*/
|
|
45606
46427
|
function materializeGlob(glob, cwd) {
|
|
45607
|
-
return
|
|
46428
|
+
return compileAndExpand(glob, {
|
|
45608
46429
|
cwd,
|
|
45609
|
-
onUnreadable: "skip"
|
|
46430
|
+
onUnreadable: "skip",
|
|
46431
|
+
glob: GLOB_OPTIONS$1
|
|
45610
46432
|
}).pipe(Effect.mapError((error) => new ConfigurationError({
|
|
45611
46433
|
field: "glob",
|
|
45612
|
-
reason: `Failed to materialize glob ${JSON.stringify(glob)}: ${error.message}`
|
|
45613
|
-
})), Effect.provide(Path.layer))
|
|
46434
|
+
reason: error.stage === "compile" ? `Invalid glob pattern ${JSON.stringify(glob)}: ${error.cause.message}` : `Failed to materialize glob ${JSON.stringify(glob)}: ${error.cause.message}`
|
|
46435
|
+
})), Effect.provide(Path.layer));
|
|
45614
46436
|
}
|
|
45615
46437
|
/**
|
|
45616
46438
|
* Determine whether `child` is the same directory as `parent` or sits inside
|
|
@@ -47321,19 +48143,29 @@ var VersionFiles = class VersionFiles {
|
|
|
47321
48143
|
}
|
|
47322
48144
|
};
|
|
47323
48145
|
/**
|
|
48146
|
+
* Match dotfiles, matching `ConfigInspector`'s glob dialect.
|
|
48147
|
+
*
|
|
48148
|
+
* @remarks
|
|
48149
|
+
* This module previously compiled with minimatch DEFAULTS while
|
|
48150
|
+
* `ConfigInspector` compiled with `dot: true`, so a wildcard segment matching
|
|
48151
|
+
* a dotted directory was attributed to a package but never materialized (or
|
|
48152
|
+
* the reverse). The two paths must agree: attribution and materialization
|
|
48153
|
+
* answer the same question about the same glob.
|
|
48154
|
+
*/
|
|
48155
|
+
const GLOB_OPTIONS = GlobPatternOptions.make({ dot: true });
|
|
48156
|
+
/**
|
|
47324
48157
|
* Expand a glob pattern against the filesystem, returning matching FILE paths
|
|
47325
48158
|
* relative to `cwd` (POSIX separators), sorted by relative path.
|
|
47326
48159
|
*
|
|
47327
48160
|
* @remarks
|
|
47328
|
-
* The walk is `@effected/walker`'s `
|
|
48161
|
+
* The walk is `@effected/walker`'s `compileAndExpand` (literal fast path,
|
|
47329
48162
|
* `enumerationPrefix` bounding, `node_modules`/`.git` pruning), with
|
|
47330
48163
|
* `onUnreadable: "skip"` preserving this module's silent-skip policy for
|
|
47331
|
-
* unreadable directories. Matching semantics are
|
|
47332
|
-
*
|
|
47333
|
-
*
|
|
47334
|
-
*
|
|
47335
|
-
*
|
|
47336
|
-
* paths and node-bound absolute paths throughout.
|
|
48164
|
+
* unreadable directories. Matching semantics are {@link GLOB_OPTIONS} —
|
|
48165
|
+
* wildcards DO match dotfiles, aligning this module with `ConfigInspector`. An
|
|
48166
|
+
* uncompilable pattern expands to no matches. The `Path` requirement is
|
|
48167
|
+
* satisfied internally with the core POSIX `Path.layer` — this module already
|
|
48168
|
+
* speaks POSIX relative match paths and node-bound absolute paths throughout.
|
|
47337
48169
|
*
|
|
47338
48170
|
* @param source - The glob pattern, repo-relative
|
|
47339
48171
|
* @param cwd - Absolute directory the pattern is resolved against
|
|
@@ -47342,13 +48174,11 @@ var VersionFiles = class VersionFiles {
|
|
|
47342
48174
|
* @internal
|
|
47343
48175
|
*/
|
|
47344
48176
|
function expandGlob(source, cwd) {
|
|
47345
|
-
return
|
|
47346
|
-
|
|
47347
|
-
|
|
47348
|
-
|
|
47349
|
-
|
|
47350
|
-
})
|
|
47351
|
-
})), Effect.provide(Path.layer));
|
|
48177
|
+
return compileAndExpand(source, {
|
|
48178
|
+
cwd,
|
|
48179
|
+
onUnreadable: "skip",
|
|
48180
|
+
glob: GLOB_OPTIONS
|
|
48181
|
+
}).pipe(Effect.catch((error) => error.stage === "compile" ? Effect.succeed([]) : Effect.fail(error)), Effect.provide(Path.layer));
|
|
47352
48182
|
}
|
|
47353
48183
|
/**
|
|
47354
48184
|
* Read the `version` field from a `package.json` in the given directory.
|