@savvy-web/silk 3.0.4 → 3.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/changesets-changelog.cjs +809 -244
- package/changesets-changelog.d.cts +414 -32
- package/changesets-changelog.d.ts +414 -32
- package/changesets-changelog.js +826 -248
- package/changesets-markdownlint.cjs +809 -244
- package/changesets-markdownlint.d.cts +414 -32
- package/changesets-markdownlint.d.ts +414 -32
- package/changesets-markdownlint.js +826 -248
- package/package.json +4 -4
- package/tsconfig/node/dist/tsconfig.tsbuildinfo +1 -1
package/changesets-changelog.js
CHANGED
|
@@ -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.8_@effected+jsonc@0.5.0_effect@4.0.0-beta.99__@effected+npm@0.2_d9e647ebf030778b1166690cbf4c6aa9/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.2.
|
|
2406
|
+
//#region ../../node_modules/.pnpm/@effected+npm@0.2.3_@effected+semver@0.2.0_effect@4.0.0-beta.99__effect@4.0.0-beta.99/node_modules/@effected/npm/CatalogResolver.js
|
|
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.2.
|
|
2453
|
+
//#region ../../node_modules/.pnpm/@effected+npm@0.2.3_@effected+semver@0.2.0_effect@4.0.0-beta.99__effect@4.0.0-beta.99/node_modules/@effected/npm/WorkspaceResolver.js
|
|
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.2.
|
|
2515
|
+
//#region ../../node_modules/.pnpm/@effected+npm@0.2.3_@effected+semver@0.2.0_effect@4.0.0-beta.99__effect@4.0.0-beta.99/node_modules/@effected/npm/CatalogAssemblyError.js
|
|
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.2.
|
|
2560
|
+
//#region ../../node_modules/.pnpm/@effected+npm@0.2.3_@effected+semver@0.2.0_effect@4.0.0-beta.99__effect@4.0.0-beta.99/node_modules/@effected/npm/DependencySection.js
|
|
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.2.
|
|
4070
|
+
//#region ../../node_modules/.pnpm/@effected+npm@0.2.3_@effected+semver@0.2.0_effect@4.0.0-beta.99__effect@4.0.0-beta.99/node_modules/@effected/npm/DependencySpecifier.js
|
|
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.2.
|
|
4278
|
+
//#region ../../node_modules/.pnpm/@effected+npm@0.2.3_@effected+semver@0.2.0_effect@4.0.0-beta.99__effect@4.0.0-beta.99/node_modules/@effected/npm/IntegrityHash.js
|
|
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,7 @@ const IntegrityHash = Object.assign(brandedIntegrity, {
|
|
|
4145
4329
|
});
|
|
4146
4330
|
|
|
4147
4331
|
//#endregion
|
|
4148
|
-
//#region ../../node_modules/.pnpm/@effected+lockfiles@0.1.
|
|
4332
|
+
//#region ../../node_modules/.pnpm/@effected+lockfiles@0.1.8_@effected+jsonc@0.5.0_effect@4.0.0-beta.99__@effected+npm@0.2_d9e647ebf030778b1166690cbf4c6aa9/node_modules/@effected/lockfiles/ImporterDependency.js
|
|
4149
4333
|
/**
|
|
4150
4334
|
* One declared dependency of one workspace importer, as the lockfile records it.
|
|
4151
4335
|
*
|
|
@@ -4174,7 +4358,7 @@ var ImporterDependency = class extends Schema.Class("ImporterDependency")({
|
|
|
4174
4358
|
}) {};
|
|
4175
4359
|
|
|
4176
4360
|
//#endregion
|
|
4177
|
-
//#region ../../node_modules/.pnpm/@effected+lockfiles@0.1.
|
|
4361
|
+
//#region ../../node_modules/.pnpm/@effected+lockfiles@0.1.8_@effected+jsonc@0.5.0_effect@4.0.0-beta.99__@effected+npm@0.2_d9e647ebf030778b1166690cbf4c6aa9/node_modules/@effected/lockfiles/LockfileImporter.js
|
|
4178
4362
|
/**
|
|
4179
4363
|
* One workspace importer's declared dependencies, as the lockfile records them.
|
|
4180
4364
|
*
|
|
@@ -4199,7 +4383,7 @@ var LockfileImporter = class extends Schema.Class("LockfileImporter")({
|
|
|
4199
4383
|
}) {};
|
|
4200
4384
|
|
|
4201
4385
|
//#endregion
|
|
4202
|
-
//#region ../../node_modules/.pnpm/@effected+lockfiles@0.1.
|
|
4386
|
+
//#region ../../node_modules/.pnpm/@effected+lockfiles@0.1.8_@effected+jsonc@0.5.0_effect@4.0.0-beta.99__@effected+npm@0.2_d9e647ebf030778b1166690cbf4c6aa9/node_modules/@effected/lockfiles/ResolvedPackage.js
|
|
4203
4387
|
const EMPTY_DEPENDENCIES = {};
|
|
4204
4388
|
/**
|
|
4205
4389
|
* A package resolved from a lockfile.
|
|
@@ -4235,7 +4419,7 @@ var ResolvedPackage = class extends Schema.Class("ResolvedPackage")({
|
|
|
4235
4419
|
}) {};
|
|
4236
4420
|
|
|
4237
4421
|
//#endregion
|
|
4238
|
-
//#region ../../node_modules/.pnpm/@effected+lockfiles@0.1.
|
|
4422
|
+
//#region ../../node_modules/.pnpm/@effected+lockfiles@0.1.8_@effected+jsonc@0.5.0_effect@4.0.0-beta.99__@effected+npm@0.2_d9e647ebf030778b1166690cbf4c6aa9/node_modules/@effected/lockfiles/WorkspaceDependency.js
|
|
4239
4423
|
/**
|
|
4240
4424
|
* A directed dependency edge between two workspace packages as recorded in
|
|
4241
4425
|
* the lockfile.
|
|
@@ -4258,7 +4442,7 @@ var WorkspaceDependency = class extends Schema.Class("WorkspaceDependency")({
|
|
|
4258
4442
|
}) {};
|
|
4259
4443
|
|
|
4260
4444
|
//#endregion
|
|
4261
|
-
//#region ../../node_modules/.pnpm/@effected+lockfiles@0.1.
|
|
4445
|
+
//#region ../../node_modules/.pnpm/@effected+lockfiles@0.1.8_@effected+jsonc@0.5.0_effect@4.0.0-beta.99__@effected+npm@0.2_d9e647ebf030778b1166690cbf4c6aa9/node_modules/@effected/lockfiles/PnpmExtension.js
|
|
4262
4446
|
/**
|
|
4263
4447
|
* Extension data specific to pnpm lockfiles, attached to `Lockfile.extension`
|
|
4264
4448
|
* when the format is `"pnpm"`.
|
|
@@ -4284,7 +4468,7 @@ var PnpmExtension = class extends Schema.Class("PnpmExtension")({
|
|
|
4284
4468
|
}) {};
|
|
4285
4469
|
|
|
4286
4470
|
//#endregion
|
|
4287
|
-
//#region ../../node_modules/.pnpm/@effected+lockfiles@0.1.
|
|
4471
|
+
//#region ../../node_modules/.pnpm/@effected+lockfiles@0.1.8_@effected+jsonc@0.5.0_effect@4.0.0-beta.99__@effected+npm@0.2_d9e647ebf030778b1166690cbf4c6aa9/node_modules/@effected/lockfiles/LockfileFormat.js
|
|
4288
4472
|
/**
|
|
4289
4473
|
* The lockfile formats this package parses: bun's `bun.lock` (JSONC), npm's
|
|
4290
4474
|
* `package-lock.json` (v2/v3 JSON), pnpm's `pnpm-lock.yaml` and yarn Berry's
|
|
@@ -4319,7 +4503,7 @@ const FILENAMES = {
|
|
|
4319
4503
|
const filenameFor = (format) => FILENAMES[format];
|
|
4320
4504
|
|
|
4321
4505
|
//#endregion
|
|
4322
|
-
//#region ../../node_modules/.pnpm/@effected+lockfiles@0.1.
|
|
4506
|
+
//#region ../../node_modules/.pnpm/@effected+lockfiles@0.1.8_@effected+jsonc@0.5.0_effect@4.0.0-beta.99__@effected+npm@0.2_d9e647ebf030778b1166690cbf4c6aa9/node_modules/@effected/lockfiles/internal/shared.js
|
|
4323
4507
|
/**
|
|
4324
4508
|
* The four dependency sections of a manifest, in a stable order — the shared
|
|
4325
4509
|
* dependency-sections table (v3's `DEP_SECTIONS`). Each entry is both the
|
|
@@ -4446,7 +4630,7 @@ const extractWorkspaceDeps = (workspaces, workspaceNames) => {
|
|
|
4446
4630
|
};
|
|
4447
4631
|
|
|
4448
4632
|
//#endregion
|
|
4449
|
-
//#region ../../node_modules/.pnpm/@effected+jsonc@0.
|
|
4633
|
+
//#region ../../node_modules/.pnpm/@effected+jsonc@0.5.0_effect@4.0.0-beta.99/node_modules/@effected/jsonc/JsoncNode.js
|
|
4450
4634
|
/**
|
|
4451
4635
|
* Discriminator values for JSONC AST node types: the JSON value types
|
|
4452
4636
|
* (`string`/`number`/`boolean`/`null`), the structural types
|
|
@@ -4622,7 +4806,7 @@ function evaluateNode(node, depth) {
|
|
|
4622
4806
|
}
|
|
4623
4807
|
|
|
4624
4808
|
//#endregion
|
|
4625
|
-
//#region ../../node_modules/.pnpm/@effected+jsonc@0.
|
|
4809
|
+
//#region ../../node_modules/.pnpm/@effected+jsonc@0.5.0_effect@4.0.0-beta.99/node_modules/@effected/jsonc/internal/scanner.js
|
|
4626
4810
|
const isWhitespace = (ch) => ch === 32 || ch === 9 || ch === 11 || ch === 12 || ch === 160 || ch === 65279;
|
|
4627
4811
|
const isLineBreak$1 = (ch) => ch === 10 || ch === 13 || ch === 8232 || ch === 8233;
|
|
4628
4812
|
const isDigit$1 = (ch) => ch >= 48 && ch <= 57;
|
|
@@ -4919,7 +5103,7 @@ const createScanner$2 = (text, ignoreTrivia = false) => {
|
|
|
4919
5103
|
};
|
|
4920
5104
|
|
|
4921
5105
|
//#endregion
|
|
4922
|
-
//#region ../../node_modules/.pnpm/@effected+jsonc@0.
|
|
5106
|
+
//#region ../../node_modules/.pnpm/@effected+jsonc@0.5.0_effect@4.0.0-beta.99/node_modules/@effected/jsonc/internal/skip.js
|
|
4923
5107
|
/**
|
|
4924
5108
|
* Iteratively consume the value beginning at the cursor's current token and
|
|
4925
5109
|
* return its tight end offset (excludes trailing whitespace/comments).
|
|
@@ -4950,7 +5134,7 @@ const skipBalancedValue = (cursor) => {
|
|
|
4950
5134
|
};
|
|
4951
5135
|
|
|
4952
5136
|
//#endregion
|
|
4953
|
-
//#region ../../node_modules/.pnpm/@effected+jsonc@0.
|
|
5137
|
+
//#region ../../node_modules/.pnpm/@effected+jsonc@0.5.0_effect@4.0.0-beta.99/node_modules/@effected/jsonc/internal/parser.js
|
|
4954
5138
|
/**
|
|
4955
5139
|
* The public parse-error code vocabulary. The facade builds its `@public`
|
|
4956
5140
|
* `JsoncParseErrorCode` schema from this array; the parser produces these codes
|
|
@@ -5364,7 +5548,7 @@ const parseTree$2 = (text, flags) => {
|
|
|
5364
5548
|
};
|
|
5365
5549
|
|
|
5366
5550
|
//#endregion
|
|
5367
|
-
//#region ../../node_modules/.pnpm/@effected+jsonc@0.
|
|
5551
|
+
//#region ../../node_modules/.pnpm/@effected+jsonc@0.5.0_effect@4.0.0-beta.99/node_modules/@effected/jsonc/Jsonc.js
|
|
5368
5552
|
/**
|
|
5369
5553
|
* The single public parse-error code vocabulary, appearing as the `code` field
|
|
5370
5554
|
* of {@link JsoncParseErrorDetail}.
|
|
@@ -5614,9 +5798,57 @@ var Jsonc = class Jsonc {
|
|
|
5614
5798
|
*/
|
|
5615
5799
|
static parse = Effect.fn("Jsonc.parse")((text, options) => Effect.fromResult(Jsonc.parseResult(text, options)));
|
|
5616
5800
|
/**
|
|
5801
|
+
* Parse JSONC into an immutable {@link JsoncNode} AST, synchronously,
|
|
5802
|
+
* returning a `Result` instead of an `Effect`. `Option.none()` for empty
|
|
5803
|
+
* input (with `allowEmptyContent`); the aggregate {@link JsoncParseError}
|
|
5804
|
+
* for malformed input. Pure — parsing is fundamentally synchronous, so
|
|
5805
|
+
* non-Effect consumers (a plain config loader, a build script) can call
|
|
5806
|
+
* this directly instead of wrapping
|
|
5807
|
+
* `Effect.runSync(Effect.result(Jsonc.parseTree(text)))`.
|
|
5808
|
+
*
|
|
5809
|
+
* @remarks
|
|
5810
|
+
* {@link Jsonc.parseTree} is defined in terms of this function; the two
|
|
5811
|
+
* never diverge. Reach for the `Effect` variant inside Effect code — it
|
|
5812
|
+
* carries the `Jsonc.parseTree` tracing span — and for this one at
|
|
5813
|
+
* synchronous boundaries.
|
|
5814
|
+
*
|
|
5815
|
+
* @example
|
|
5816
|
+
* ```ts
|
|
5817
|
+
* import { Jsonc } from "@effected/jsonc";
|
|
5818
|
+
* import { Option, Result } from "effect";
|
|
5819
|
+
*
|
|
5820
|
+
* const ok = Jsonc.parseTreeResult('{ "port": 3000 // dev\n }');
|
|
5821
|
+
* if (Result.isSuccess(ok) && Option.isSome(ok.success)) {
|
|
5822
|
+
* console.log(ok.success.value.type); // => "object"
|
|
5823
|
+
* }
|
|
5824
|
+
*
|
|
5825
|
+
* const bad = Jsonc.parseTreeResult("{ bad }");
|
|
5826
|
+
* if (Result.isFailure(bad)) {
|
|
5827
|
+
* console.log(bad.failure._tag); // => "JsoncParseError"
|
|
5828
|
+
* }
|
|
5829
|
+
* ```
|
|
5830
|
+
*
|
|
5831
|
+
* @param text - The JSONC source to parse.
|
|
5832
|
+
* @param options - Optional {@link JsoncParseOptions}; defaults apply for
|
|
5833
|
+
* omitted fields.
|
|
5834
|
+
* @returns A `Result` succeeding with `Option.some(root)` (or
|
|
5835
|
+
* `Option.none()` for empty input), or failing with the aggregate
|
|
5836
|
+
* {@link JsoncParseError}.
|
|
5837
|
+
*/
|
|
5838
|
+
static parseTreeResult(text, options) {
|
|
5839
|
+
const { root, errors } = parseTree$2(text, toFlags(options));
|
|
5840
|
+
if (errors.length > 0) return Result.fail(new JsoncParseError({
|
|
5841
|
+
errors: toDetails(text, errors),
|
|
5842
|
+
input: text
|
|
5843
|
+
}));
|
|
5844
|
+
return Result.succeed(root !== void 0 ? Option.some(root) : Option.none());
|
|
5845
|
+
}
|
|
5846
|
+
/**
|
|
5617
5847
|
* Parse JSONC into an immutable {@link JsoncNode} AST. `Option.none()` for
|
|
5618
5848
|
* empty input (with `allowEmptyContent`); the aggregate
|
|
5619
|
-
* {@link JsoncParseError} for malformed input.
|
|
5849
|
+
* {@link JsoncParseError} for malformed input. Defined in terms of
|
|
5850
|
+
* {@link Jsonc.parseTreeResult} — synchronous callers can use that variant
|
|
5851
|
+
* directly.
|
|
5620
5852
|
*
|
|
5621
5853
|
* @param text - The JSONC source to parse.
|
|
5622
5854
|
* @param options - Optional {@link JsoncParseOptions}; defaults apply for
|
|
@@ -5625,14 +5857,7 @@ var Jsonc = class Jsonc {
|
|
|
5625
5857
|
* `Option.none()` for empty input), or fails with the aggregate
|
|
5626
5858
|
* {@link JsoncParseError}.
|
|
5627
5859
|
*/
|
|
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
|
-
});
|
|
5860
|
+
static parseTree = Effect.fn("Jsonc.parseTree")((text, options) => Effect.fromResult(Jsonc.parseTreeResult(text, options)));
|
|
5636
5861
|
/**
|
|
5637
5862
|
* Stringify a plain JavaScript value as JSON text, synchronously, returning
|
|
5638
5863
|
* a `Result` instead of an `Effect`. With no options the output is
|
|
@@ -5892,7 +6117,7 @@ var Jsonc = class Jsonc {
|
|
|
5892
6117
|
};
|
|
5893
6118
|
|
|
5894
6119
|
//#endregion
|
|
5895
|
-
//#region ../../node_modules/.pnpm/@effected+jsonc@0.
|
|
6120
|
+
//#region ../../node_modules/.pnpm/@effected+jsonc@0.5.0_effect@4.0.0-beta.99/node_modules/@effected/jsonc/JsoncEdit.js
|
|
5896
6121
|
/**
|
|
5897
6122
|
* A range within a JSONC document, expressed as a zero-based character
|
|
5898
6123
|
* `offset` and a `length` in UTF-16 code units. Pass to `JsoncFormatter.format`
|
|
@@ -5963,7 +6188,7 @@ var JsoncEdit = class extends Schema.Class("JsoncEdit")({
|
|
|
5963
6188
|
};
|
|
5964
6189
|
|
|
5965
6190
|
//#endregion
|
|
5966
|
-
//#region ../../node_modules/.pnpm/@effected+jsonc@0.
|
|
6191
|
+
//#region ../../node_modules/.pnpm/@effected+jsonc@0.5.0_effect@4.0.0-beta.99/node_modules/@effected/jsonc/internal/navigate.js
|
|
5967
6192
|
/**
|
|
5968
6193
|
* Resolve `path` against `text`, returning where the target is (or where it
|
|
5969
6194
|
* would be inserted). `path` must be non-empty — the whole-document case is
|
|
@@ -6091,7 +6316,7 @@ function navigate(text, path) {
|
|
|
6091
6316
|
}
|
|
6092
6317
|
|
|
6093
6318
|
//#endregion
|
|
6094
|
-
//#region ../../node_modules/.pnpm/@effected+jsonc@0.
|
|
6319
|
+
//#region ../../node_modules/.pnpm/@effected+jsonc@0.5.0_effect@4.0.0-beta.99/node_modules/@effected/jsonc/JsoncModifier.js
|
|
6095
6320
|
/**
|
|
6096
6321
|
* Raised when `JsoncModifier.modify` cannot navigate the requested path: the
|
|
6097
6322
|
* value at `depth` is not the container kind (`expected`) the next path segment
|
|
@@ -6220,7 +6445,7 @@ var JsoncModifier = class {
|
|
|
6220
6445
|
};
|
|
6221
6446
|
|
|
6222
6447
|
//#endregion
|
|
6223
|
-
//#region ../../node_modules/.pnpm/@effected+lockfiles@0.1.
|
|
6448
|
+
//#region ../../node_modules/.pnpm/@effected+lockfiles@0.1.8_@effected+jsonc@0.5.0_effect@4.0.0-beta.99__@effected+npm@0.2_d9e647ebf030778b1166690cbf4c6aa9/node_modules/@effected/lockfiles/internal/bun.js
|
|
6224
6449
|
const DepRecord$2 = Schema.optionalKey(Schema.Record(Schema.String, Schema.String));
|
|
6225
6450
|
const BunWorkspaceEntry = Schema.Struct({
|
|
6226
6451
|
name: Schema.optionalKey(Schema.String),
|
|
@@ -6314,7 +6539,7 @@ const toFields$3 = (raw) => Effect.gen(function* () {
|
|
|
6314
6539
|
});
|
|
6315
6540
|
|
|
6316
6541
|
//#endregion
|
|
6317
|
-
//#region ../../node_modules/.pnpm/@effected+lockfiles@0.1.
|
|
6542
|
+
//#region ../../node_modules/.pnpm/@effected+lockfiles@0.1.8_@effected+jsonc@0.5.0_effect@4.0.0-beta.99__@effected+npm@0.2_d9e647ebf030778b1166690cbf4c6aa9/node_modules/@effected/lockfiles/internal/npm.js
|
|
6318
6543
|
const DepRecord$1 = Schema.optionalKey(Schema.Record(Schema.String, Schema.String));
|
|
6319
6544
|
const NpmPackageEntry = Schema.Struct({
|
|
6320
6545
|
name: Schema.optionalKey(Schema.String),
|
|
@@ -6413,7 +6638,7 @@ const toFields$2 = (raw) => Effect.gen(function* () {
|
|
|
6413
6638
|
});
|
|
6414
6639
|
|
|
6415
6640
|
//#endregion
|
|
6416
|
-
//#region ../../node_modules/.pnpm/@effected+yaml@0.
|
|
6641
|
+
//#region ../../node_modules/.pnpm/@effected+yaml@0.5.0_effect@4.0.0-beta.99/node_modules/@effected/yaml/YamlNode.js
|
|
6417
6642
|
/**
|
|
6418
6643
|
* YAML scalar presentation styles.
|
|
6419
6644
|
*
|
|
@@ -6433,6 +6658,16 @@ const ScalarStyle = Schema.Literals([
|
|
|
6433
6658
|
*/
|
|
6434
6659
|
const CollectionStyle = Schema.Literals(["block", "flow"]);
|
|
6435
6660
|
/**
|
|
6661
|
+
* Quote characters available to the stringifier's plain-scalar fallback: the
|
|
6662
|
+
* style a `plain`-styled scalar is rendered in when it turns out to require
|
|
6663
|
+
* quoting. Referenced by the `quoteStyle` field of `YamlStringifyOptions`;
|
|
6664
|
+
* unlike `ScalarStyle` it is a stringify-option vocabulary, never a property
|
|
6665
|
+
* of a composed node.
|
|
6666
|
+
*
|
|
6667
|
+
* @public
|
|
6668
|
+
*/
|
|
6669
|
+
const QuoteStyle = Schema.Literals(["single", "double"]);
|
|
6670
|
+
/**
|
|
6436
6671
|
* Block-scalar chomping indicators (`-` strip, default clip, `+` keep).
|
|
6437
6672
|
* Referenced by the {@link YamlScalar} `chomp` field schema.
|
|
6438
6673
|
*
|
|
@@ -6806,7 +7041,7 @@ function nodeToValue(node, anchors, budget, counting = false) {
|
|
|
6806
7041
|
}
|
|
6807
7042
|
|
|
6808
7043
|
//#endregion
|
|
6809
|
-
//#region ../../node_modules/.pnpm/@effected+yaml@0.
|
|
7044
|
+
//#region ../../node_modules/.pnpm/@effected+yaml@0.5.0_effect@4.0.0-beta.99/node_modules/@effected/yaml/internal/diagnostics.js
|
|
6810
7045
|
/** Error codes emitted by the lexer stage. */
|
|
6811
7046
|
const YAML_LEX_ERROR_CODES = [
|
|
6812
7047
|
"UnexpectedCharacter",
|
|
@@ -6885,7 +7120,7 @@ function isFatalCode(code) {
|
|
|
6885
7120
|
}
|
|
6886
7121
|
|
|
6887
7122
|
//#endregion
|
|
6888
|
-
//#region ../../node_modules/.pnpm/@effected+yaml@0.
|
|
7123
|
+
//#region ../../node_modules/.pnpm/@effected+yaml@0.5.0_effect@4.0.0-beta.99/node_modules/@effected/yaml/YamlDiagnostic.js
|
|
6889
7124
|
/**
|
|
6890
7125
|
* Error codes emitted by the lexer stage.
|
|
6891
7126
|
*
|
|
@@ -7007,7 +7242,7 @@ function lineChar(text, offset) {
|
|
|
7007
7242
|
}
|
|
7008
7243
|
|
|
7009
7244
|
//#endregion
|
|
7010
|
-
//#region ../../node_modules/.pnpm/@effected+yaml@0.
|
|
7245
|
+
//#region ../../node_modules/.pnpm/@effected+yaml@0.5.0_effect@4.0.0-beta.99/node_modules/@effected/yaml/internal/composer/anchors.js
|
|
7011
7246
|
/**
|
|
7012
7247
|
* Check if a pending anchor is being applied to an alias node (invalid in YAML 1.2 §3.2.2).
|
|
7013
7248
|
* Aliases represent references to existing anchored nodes and cannot have their own anchors.
|
|
@@ -7101,7 +7336,7 @@ function collectAnchors(node, anchors) {
|
|
|
7101
7336
|
}
|
|
7102
7337
|
|
|
7103
7338
|
//#endregion
|
|
7104
|
-
//#region ../../node_modules/.pnpm/@effected+yaml@0.
|
|
7339
|
+
//#region ../../node_modules/.pnpm/@effected+yaml@0.5.0_effect@4.0.0-beta.99/node_modules/@effected/yaml/internal/lexer.js
|
|
7105
7340
|
/**
|
|
7106
7341
|
* Create a new YAML scanner for the given source text.
|
|
7107
7342
|
*
|
|
@@ -8059,7 +8294,7 @@ function lexAll(text) {
|
|
|
8059
8294
|
}
|
|
8060
8295
|
|
|
8061
8296
|
//#endregion
|
|
8062
|
-
//#region ../../node_modules/.pnpm/@effected+yaml@0.
|
|
8297
|
+
//#region ../../node_modules/.pnpm/@effected+yaml@0.5.0_effect@4.0.0-beta.99/node_modules/@effected/yaml/internal/cst-parser.js
|
|
8063
8298
|
/**
|
|
8064
8299
|
* Hardening: cap CST nesting so hostile inputs cannot overflow the stack
|
|
8065
8300
|
* while the tree is being BUILT. Set slightly above the composer's
|
|
@@ -8772,7 +9007,7 @@ function parseCSTAll(text) {
|
|
|
8772
9007
|
}
|
|
8773
9008
|
|
|
8774
9009
|
//#endregion
|
|
8775
|
-
//#region ../../node_modules/.pnpm/@effected+yaml@0.
|
|
9010
|
+
//#region ../../node_modules/.pnpm/@effected+yaml@0.5.0_effect@4.0.0-beta.99/node_modules/@effected/yaml/internal/composer/state.js
|
|
8776
9011
|
let lineStartsText;
|
|
8777
9012
|
let lineStartsCache = [];
|
|
8778
9013
|
function getLineStarts(text) {
|
|
@@ -8879,7 +9114,7 @@ function exitNesting(state) {
|
|
|
8879
9114
|
}
|
|
8880
9115
|
|
|
8881
9116
|
//#endregion
|
|
8882
|
-
//#region ../../node_modules/.pnpm/@effected+yaml@0.
|
|
9117
|
+
//#region ../../node_modules/.pnpm/@effected+yaml@0.5.0_effect@4.0.0-beta.99/node_modules/@effected/yaml/internal/composer/tags.js
|
|
8883
9118
|
/**
|
|
8884
9119
|
* Resolve a tag shorthand using the document's %TAG directives.
|
|
8885
9120
|
* For example, with `%TAG !! tag:example.com,2000:app/`, the tag `!!int`
|
|
@@ -8966,7 +9201,7 @@ function validateTagHandlesInDocument(docCst, state) {
|
|
|
8966
9201
|
}
|
|
8967
9202
|
|
|
8968
9203
|
//#endregion
|
|
8969
|
-
//#region ../../node_modules/.pnpm/@effected+yaml@0.
|
|
9204
|
+
//#region ../../node_modules/.pnpm/@effected+yaml@0.5.0_effect@4.0.0-beta.99/node_modules/@effected/yaml/internal/composer/scalars.js
|
|
8970
9205
|
const NULL_RE$1 = /^(?:null|Null|NULL|~)$/;
|
|
8971
9206
|
const TRUE_RE$1 = /^(?:true|True|TRUE)$/;
|
|
8972
9207
|
const FALSE_RE$1 = /^(?:false|False|FALSE)$/;
|
|
@@ -9845,7 +10080,7 @@ function shouldPreserveRaw(rawValue, value) {
|
|
|
9845
10080
|
}
|
|
9846
10081
|
|
|
9847
10082
|
//#endregion
|
|
9848
|
-
//#region ../../node_modules/.pnpm/@effected+yaml@0.
|
|
10083
|
+
//#region ../../node_modules/.pnpm/@effected+yaml@0.5.0_effect@4.0.0-beta.99/node_modules/@effected/yaml/internal/composer/block.js
|
|
9849
10084
|
/**
|
|
9850
10085
|
* Compose a block map from its CST children, with an optional external first key.
|
|
9851
10086
|
*
|
|
@@ -10994,7 +11229,7 @@ function composeFlatBlockMap(children, startIdx, parentCst, state, externalFirst
|
|
|
10994
11229
|
}
|
|
10995
11230
|
|
|
10996
11231
|
//#endregion
|
|
10997
|
-
//#region ../../node_modules/.pnpm/@effected+yaml@0.
|
|
11232
|
+
//#region ../../node_modules/.pnpm/@effected+yaml@0.5.0_effect@4.0.0-beta.99/node_modules/@effected/yaml/internal/composer/flow.js
|
|
10998
11233
|
/**
|
|
10999
11234
|
* Validate that flow collection entries are separated by commas.
|
|
11000
11235
|
*
|
|
@@ -11387,7 +11622,7 @@ function composeFlowSeqInner(cst, state, meta, parentBlockColumn) {
|
|
|
11387
11622
|
}
|
|
11388
11623
|
|
|
11389
11624
|
//#endregion
|
|
11390
|
-
//#region ../../node_modules/.pnpm/@effected+yaml@0.
|
|
11625
|
+
//#region ../../node_modules/.pnpm/@effected+yaml@0.5.0_effect@4.0.0-beta.99/node_modules/@effected/yaml/internal/composer/document.js
|
|
11391
11626
|
/** The flow-composer dispatch wired into every state this module creates. */
|
|
11392
11627
|
const FLOW = {
|
|
11393
11628
|
composeFlowMap,
|
|
@@ -12054,7 +12289,7 @@ function composeAllDocuments(text, options) {
|
|
|
12054
12289
|
}
|
|
12055
12290
|
|
|
12056
12291
|
//#endregion
|
|
12057
|
-
//#region ../../node_modules/.pnpm/@effected+yaml@0.
|
|
12292
|
+
//#region ../../node_modules/.pnpm/@effected+yaml@0.5.0_effect@4.0.0-beta.99/node_modules/@effected/yaml/internal/fold.js
|
|
12058
12293
|
/**
|
|
12059
12294
|
* Column-based line folding for a single logical scalar line (YAML 1.2 flow
|
|
12060
12295
|
* folding, §7.3 / §8.2.1). Breaks the content at "safe" single-space
|
|
@@ -12291,7 +12526,7 @@ function renderBlockFolded(s, indent) {
|
|
|
12291
12526
|
}
|
|
12292
12527
|
|
|
12293
12528
|
//#endregion
|
|
12294
|
-
//#region ../../node_modules/.pnpm/@effected+yaml@0.
|
|
12529
|
+
//#region ../../node_modules/.pnpm/@effected+yaml@0.5.0_effect@4.0.0-beta.99/node_modules/@effected/yaml/internal/stringifier.js
|
|
12295
12530
|
/**
|
|
12296
12531
|
* Thrown by the stringifier on its failure paths (circular references). The
|
|
12297
12532
|
* facade catches this and materializes the public stringify error.
|
|
@@ -12397,7 +12632,10 @@ function requiresQuoting(s, ignoreType = false) {
|
|
|
12397
12632
|
if (s.includes(" #") || s.includes(" #")) return true;
|
|
12398
12633
|
const last = s[s.length - 1];
|
|
12399
12634
|
if (last === " " || last === " ") return true;
|
|
12400
|
-
for (let i = 0; i < s.length; i++)
|
|
12635
|
+
for (let i = 0; i < s.length; i++) {
|
|
12636
|
+
const code = s.charCodeAt(i);
|
|
12637
|
+
if (code === 9 || code === 13 || isControlChar(code)) return true;
|
|
12638
|
+
}
|
|
12401
12639
|
return false;
|
|
12402
12640
|
}
|
|
12403
12641
|
/**
|
|
@@ -12454,11 +12692,13 @@ function renderSingleQuoted(s) {
|
|
|
12454
12692
|
*
|
|
12455
12693
|
* Multi-line strings are routed to block styles regardless of the requested
|
|
12456
12694
|
* style (except double-quoted). For single-line strings, plain style delegates
|
|
12457
|
-
* to {@link requiresQuoting} and falls back to
|
|
12458
|
-
*
|
|
12459
|
-
*
|
|
12695
|
+
* to {@link requiresQuoting} and falls back to `quoteStyle` (single-quoted by
|
|
12696
|
+
* default, double-quoted when the caller asked for it) — or to double-quoted
|
|
12697
|
+
* regardless when the value needs YAML escapes single quotes cannot express.
|
|
12698
|
+
* Block literal and block folded styles are always accepted for single-line
|
|
12699
|
+
* strings even though the output is unusual.
|
|
12460
12700
|
*/
|
|
12461
|
-
function renderString(s, style, indent, ignoreType = false, canonical = false, explicitChomp, parentPosition) {
|
|
12701
|
+
function renderString(s, style, indent, ignoreType = false, canonical = false, explicitChomp, parentPosition, quoteStyle = "single") {
|
|
12462
12702
|
if (s.includes("\n")) {
|
|
12463
12703
|
let hasControl = false;
|
|
12464
12704
|
for (let i = 0; i < s.length; i++) {
|
|
@@ -12492,7 +12732,7 @@ function renderString(s, style, indent, ignoreType = false, canonical = false, e
|
|
|
12492
12732
|
if (requiresQuoting(s, ignoreType)) {
|
|
12493
12733
|
if (s.includes(" ") || s.includes("\r")) return renderDoubleQuoted(s, canonical);
|
|
12494
12734
|
for (let i = 0; i < s.length; i++) if (isControlChar(s.charCodeAt(i))) return renderDoubleQuoted(s, canonical);
|
|
12495
|
-
return renderSingleQuoted(s);
|
|
12735
|
+
return quoteStyle === "double" ? renderDoubleQuoted(s, canonical) : renderSingleQuoted(s);
|
|
12496
12736
|
}
|
|
12497
12737
|
return s;
|
|
12498
12738
|
case "single-quoted": return renderSingleQuoted(s);
|
|
@@ -12532,6 +12772,7 @@ function createContext(options) {
|
|
|
12532
12772
|
defaultCollectionStyle: options?.defaultCollectionStyle ?? "block",
|
|
12533
12773
|
sortKeys: options?.sortKeys ?? false,
|
|
12534
12774
|
indentSequences: options?.indentSequences ?? false,
|
|
12775
|
+
quoteStyle: options?.quoteStyle ?? "single",
|
|
12535
12776
|
forceDefaultStyles: options?.forceDefaultStyles ?? false,
|
|
12536
12777
|
seen: /* @__PURE__ */ new Set()
|
|
12537
12778
|
};
|
|
@@ -12551,7 +12792,7 @@ function stringifyLines(value, ctx, depth, allowFold = true) {
|
|
|
12551
12792
|
if (typeof value === "bigint") return [value.toString()];
|
|
12552
12793
|
if (typeof value === "string") {
|
|
12553
12794
|
const indentStr = " ".repeat(ctx.indent);
|
|
12554
|
-
const rendered = renderString(value, ctx.defaultScalarStyle, indentStr, false, ctx.forceDefaultStyles);
|
|
12795
|
+
const rendered = renderString(value, ctx.defaultScalarStyle, indentStr, false, ctx.forceDefaultStyles, void 0, void 0, ctx.quoteStyle);
|
|
12555
12796
|
return (allowFold && ctx.lineWidth > 0 ? foldRenderedScalar(rendered, indentStr, ctx.lineWidth) : rendered).split("\n");
|
|
12556
12797
|
}
|
|
12557
12798
|
if (Array.isArray(value)) {
|
|
@@ -12616,10 +12857,11 @@ function stringifyObjectLines(obj, ctx, depth) {
|
|
|
12616
12857
|
const keys = Object.keys(obj);
|
|
12617
12858
|
if (keys.length === 0) return ["{}"];
|
|
12618
12859
|
if (ctx.sortKeys) keys.sort();
|
|
12860
|
+
const renderPlainKey = (k) => renderString(k, "plain", "", false, false, void 0, void 0, ctx.quoteStyle);
|
|
12619
12861
|
if (ctx.defaultCollectionStyle === "flow") return [`{${keys.map((k) => {
|
|
12620
|
-
return `${
|
|
12862
|
+
return `${renderPlainKey(k)}: ${stringifyLines(obj[k], ctx, depth + 1, false).join(" ")}`;
|
|
12621
12863
|
}).join(", ")}}`];
|
|
12622
|
-
const renderKey = (k) => k.includes("\n") ? renderDoubleQuoted(k, ctx.forceDefaultStyles) :
|
|
12864
|
+
const renderKey = (k) => k.includes("\n") ? renderDoubleQuoted(k, ctx.forceDefaultStyles) : renderPlainKey(k);
|
|
12623
12865
|
const pad = " ".repeat(ctx.indent);
|
|
12624
12866
|
const lines = [];
|
|
12625
12867
|
for (const k of keys) {
|
|
@@ -12656,7 +12898,7 @@ function stringifyValue(value, options) {
|
|
|
12656
12898
|
}
|
|
12657
12899
|
|
|
12658
12900
|
//#endregion
|
|
12659
|
-
//#region ../../node_modules/.pnpm/@effected+yaml@0.
|
|
12901
|
+
//#region ../../node_modules/.pnpm/@effected+yaml@0.5.0_effect@4.0.0-beta.99/node_modules/@effected/yaml/Yaml.js
|
|
12660
12902
|
/**
|
|
12661
12903
|
* Options controlling parse behavior. All fields are omissible; absent fields
|
|
12662
12904
|
* resolve to `strict` `true`, `maxAliasCount` `100` (the alias-based
|
|
@@ -12686,8 +12928,8 @@ var YamlParseOptions = class extends Schema.Class("YamlParseOptions")({
|
|
|
12686
12928
|
* Options controlling stringify behavior. All fields are omissible; absent
|
|
12687
12929
|
* fields resolve to `indent` `2`, `lineWidth` `0`, `defaultScalarStyle`
|
|
12688
12930
|
* `"plain"`, `defaultCollectionStyle` `"block"`, `sortKeys` `false`,
|
|
12689
|
-
* `indentSequences` `false`, `
|
|
12690
|
-
* `false`.
|
|
12931
|
+
* `indentSequences` `false`, `quoteStyle` `"single"`, `finalNewline` `true`
|
|
12932
|
+
* and `forceDefaultStyles` `false`.
|
|
12691
12933
|
*
|
|
12692
12934
|
* `lineWidth` controls column-based scalar folding. The default `0` (and any
|
|
12693
12935
|
* value `<= 0`) never wraps, emitting byte-identical output to the historic
|
|
@@ -12704,6 +12946,18 @@ var YamlParseOptions = class extends Schema.Class("YamlParseOptions")({
|
|
|
12704
12946
|
* matching the `yaml` npm package's default output. Top-level sequences stay
|
|
12705
12947
|
* at column zero in both modes.
|
|
12706
12948
|
*
|
|
12949
|
+
* `quoteStyle` selects the quote character used when a `plain`-styled scalar
|
|
12950
|
+
* (the `defaultScalarStyle` default) turns out to require quoting: `"single"`
|
|
12951
|
+
* (the default) emits `'@parcel/watcher'` — the kit's byte-compatible legacy
|
|
12952
|
+
* form — while `"double"` emits `"@parcel/watcher"`, matching the `yaml` npm
|
|
12953
|
+
* package's `singleQuote: false` output. It is a fallback selector only:
|
|
12954
|
+
* scalars that need no quoting stay plain, and an explicit
|
|
12955
|
+
* `defaultScalarStyle` of `"single-quoted"` or `"double-quoted"` still wins.
|
|
12956
|
+
* On that plain fallback path, values carrying a tab, a carriage return or
|
|
12957
|
+
* any other C0 control character are always emitted double-quoted whichever
|
|
12958
|
+
* `quoteStyle` is set, since only double quotes can escape them into a form
|
|
12959
|
+
* that round-trips exactly.
|
|
12960
|
+
*
|
|
12707
12961
|
* Construct with the validated `YamlStringifyOptions.make({ ... })` static —
|
|
12708
12962
|
* the kit convention (never `new`). Call sites that take a
|
|
12709
12963
|
* `YamlStringifyOptions` also accept a structurally-matching plain literal.
|
|
@@ -12729,7 +12983,7 @@ var YamlStringifyOptions = class extends Schema.Class("YamlStringifyOptions")({
|
|
|
12729
12983
|
* (`>`) scalars at approximately that column, never block-literal (`|`).
|
|
12730
12984
|
*
|
|
12731
12985
|
* Takes effect only through {@link Yaml.stringify} and
|
|
12732
|
-
* {@link Yaml.
|
|
12986
|
+
* {@link Yaml.stringifyResult} — the two entry points that accept these
|
|
12733
12987
|
* options on the value path. The schema factories ({@link Yaml.fromString},
|
|
12734
12988
|
* {@link Yaml.schema}, {@link Yaml.YamlFromString}) encode with default
|
|
12735
12989
|
* stringify options (`lineWidth` `0`), so their output never folds. The
|
|
@@ -12742,6 +12996,17 @@ var YamlStringifyOptions = class extends Schema.Class("YamlStringifyOptions")({
|
|
|
12742
12996
|
defaultCollectionStyle: Schema.optionalKey(CollectionStyle),
|
|
12743
12997
|
sortKeys: Schema.optionalKey(Schema.Boolean),
|
|
12744
12998
|
indentSequences: Schema.optionalKey(Schema.Boolean),
|
|
12999
|
+
/**
|
|
13000
|
+
* Quote style used when a `plain`-styled scalar requires quoting. Default
|
|
13001
|
+
* `"single"` — the released byte-compatible behavior. `"double"` renders
|
|
13002
|
+
* the same scalars double-quoted instead, matching the `yaml` npm
|
|
13003
|
+
* package's `singleQuote: false` output.
|
|
13004
|
+
*
|
|
13005
|
+
* Affects only the plain fallback: scalars that need no quoting stay
|
|
13006
|
+
* plain, and an explicit `defaultScalarStyle` of `"single-quoted"` or
|
|
13007
|
+
* `"double-quoted"` is unaffected.
|
|
13008
|
+
*/
|
|
13009
|
+
quoteStyle: Schema.optionalKey(QuoteStyle),
|
|
12745
13010
|
finalNewline: Schema.optionalKey(Schema.Boolean),
|
|
12746
13011
|
forceDefaultStyles: Schema.optionalKey(Schema.Boolean)
|
|
12747
13012
|
}) {};
|
|
@@ -12791,6 +13056,7 @@ const toStringifyInput = (options) => options === void 0 ? {} : {
|
|
|
12791
13056
|
defaultCollectionStyle: options.defaultCollectionStyle,
|
|
12792
13057
|
sortKeys: options.sortKeys,
|
|
12793
13058
|
indentSequences: options.indentSequences,
|
|
13059
|
+
quoteStyle: options.quoteStyle,
|
|
12794
13060
|
finalNewline: options.finalNewline,
|
|
12795
13061
|
forceDefaultStyles: options.forceDefaultStyles
|
|
12796
13062
|
};
|
|
@@ -12848,7 +13114,7 @@ const stringifyDefectToError = (defect, value) => {
|
|
|
12848
13114
|
* mode (fatal diagnostics, duplicate keys, a "billion laughs" blow-up) yields
|
|
12849
13115
|
* a `Failure` carrying a typed {@link YamlParseError} — never a throw.
|
|
12850
13116
|
*/
|
|
12851
|
-
const
|
|
13117
|
+
const parseResultImpl = (text, options) => {
|
|
12852
13118
|
const doc = composeFirstDocument(text, toParseInput(options));
|
|
12853
13119
|
const failures = failureRecords(doc, options?.uniqueKeys ?? true);
|
|
12854
13120
|
if (failures.length > 0) return Result.fail(new YamlParseError({
|
|
@@ -12869,7 +13135,7 @@ const parseSyncImpl = (text, options) => {
|
|
|
12869
13135
|
* recursion budget yields a `Failure` carrying a typed {@link YamlStringifyError},
|
|
12870
13136
|
* never a thrown defect.
|
|
12871
13137
|
*/
|
|
12872
|
-
const
|
|
13138
|
+
const stringifyResultImpl = (value, options) => {
|
|
12873
13139
|
try {
|
|
12874
13140
|
return Result.succeed(stringifyValue(value, toStringifyInput(options)));
|
|
12875
13141
|
} catch (defect) {
|
|
@@ -12946,17 +13212,11 @@ var Yaml = class Yaml {
|
|
|
12946
13212
|
* resolved size grows exponentially relative to `maxAliasCount`) also
|
|
12947
13213
|
* fails through {@link YamlParseError} with an `AliasCountExceeded`
|
|
12948
13214
|
* diagnostic, never as an unhandled defect.
|
|
13215
|
+
*
|
|
13216
|
+
* Defined in terms of {@link Yaml.parseResult} — synchronous callers can
|
|
13217
|
+
* use that variant directly.
|
|
12949
13218
|
*/
|
|
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
|
-
});
|
|
13219
|
+
static parse = Effect.fn("Yaml.parse")((text, options) => Effect.fromResult(Yaml.parseResult(text, options)));
|
|
12960
13220
|
/**
|
|
12961
13221
|
* Parse a multi-document YAML stream into an array of plain JavaScript
|
|
12962
13222
|
* values (one per document, in order). Any fatal diagnostic in any
|
|
@@ -12989,6 +13249,15 @@ var Yaml = class Yaml {
|
|
|
12989
13249
|
* or on a value nested deeper than the stringifier's recursion budget
|
|
12990
13250
|
* (`NestingDepthExceeded`) — both surface through the typed error channel
|
|
12991
13251
|
* rather than as an unhandled stack-overflow defect.
|
|
13252
|
+
*
|
|
13253
|
+
* @remarks
|
|
13254
|
+
* A `"<<"` object key is emitted **quoted** (`'<<': …`). This is the
|
|
13255
|
+
* opposite of the document path ({@link YamlFormat.format} and
|
|
13256
|
+
* `YamlDocument#stringify`), which leaves a parsed plain `<<` key unquoted
|
|
13257
|
+
* so it keeps its merge-key meaning, and the asymmetry is deliberate: a
|
|
13258
|
+
* `"<<"` key on a plain JavaScript object is an ordinary string key that
|
|
13259
|
+
* never carried merge semantics, so emitting it plain would silently turn
|
|
13260
|
+
* ordinary data into a merge directive.
|
|
12992
13261
|
*/
|
|
12993
13262
|
static stringify = Effect.fn("Yaml.stringify")(function* (value, options) {
|
|
12994
13263
|
return yield* stringifyOrFail(value, options);
|
|
@@ -12996,8 +13265,14 @@ var Yaml = class Yaml {
|
|
|
12996
13265
|
/**
|
|
12997
13266
|
* Synchronous single-document parse, returning a `Result` instead of
|
|
12998
13267
|
* 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
|
-
*
|
|
13268
|
+
* `await` an Effect (a `vitest.config.ts` is the motivating case).
|
|
13269
|
+
*
|
|
13270
|
+
* @remarks
|
|
13271
|
+
* This is the package's single parse path. {@link Yaml.parse} is defined in
|
|
13272
|
+
* terms of it (`Effect.fromResult` behind the named span), so the two
|
|
13273
|
+
* variants cannot diverge. Reach for the `Effect` variant inside Effect
|
|
13274
|
+
* code — it carries the `Yaml.parse` tracing span — and for this one at
|
|
13275
|
+
* synchronous boundaries.
|
|
13001
13276
|
*
|
|
13002
13277
|
* Preserves the package contract — malformed and adversarial input fails
|
|
13003
13278
|
* typed, never as a defect. Fatal diagnostics, duplicate keys and a
|
|
@@ -13009,7 +13284,7 @@ var Yaml = class Yaml {
|
|
|
13009
13284
|
* import { Yaml } from "@effected/yaml";
|
|
13010
13285
|
* import { Result } from "effect";
|
|
13011
13286
|
*
|
|
13012
|
-
* const result = Yaml.
|
|
13287
|
+
* const result = Yaml.parseResult("name: Alice\nage: 30");
|
|
13013
13288
|
* if (Result.isSuccess(result)) {
|
|
13014
13289
|
* result.success; // { name: "Alice", age: 30 }
|
|
13015
13290
|
* } else {
|
|
@@ -13019,8 +13294,8 @@ var Yaml = class Yaml {
|
|
|
13019
13294
|
*
|
|
13020
13295
|
* @public
|
|
13021
13296
|
*/
|
|
13022
|
-
static
|
|
13023
|
-
return
|
|
13297
|
+
static parseResult(text, options) {
|
|
13298
|
+
return parseResultImpl(text, options);
|
|
13024
13299
|
}
|
|
13025
13300
|
/**
|
|
13026
13301
|
* Synchronous stringify, returning a `Result` instead of an `Effect`.
|
|
@@ -13037,7 +13312,7 @@ var Yaml = class Yaml {
|
|
|
13037
13312
|
* import { Yaml } from "@effected/yaml";
|
|
13038
13313
|
* import { Result } from "effect";
|
|
13039
13314
|
*
|
|
13040
|
-
* const result = Yaml.
|
|
13315
|
+
* const result = Yaml.stringifyResult({ name: "Alice" });
|
|
13041
13316
|
* if (Result.isFailure(result)) {
|
|
13042
13317
|
* result.failure; // YamlStringifyError
|
|
13043
13318
|
* } else {
|
|
@@ -13047,8 +13322,8 @@ var Yaml = class Yaml {
|
|
|
13047
13322
|
*
|
|
13048
13323
|
* @public
|
|
13049
13324
|
*/
|
|
13050
|
-
static
|
|
13051
|
-
return
|
|
13325
|
+
static stringifyResult(value, options) {
|
|
13326
|
+
return stringifyResultImpl(value, options);
|
|
13052
13327
|
}
|
|
13053
13328
|
/**
|
|
13054
13329
|
* Strip comments from YAML text. Without `replaceCh`, comment characters
|
|
@@ -13275,7 +13550,7 @@ function deepEqualValues(a, b) {
|
|
|
13275
13550
|
}
|
|
13276
13551
|
|
|
13277
13552
|
//#endregion
|
|
13278
|
-
//#region ../../node_modules/.pnpm/@effected+lockfiles@0.1.
|
|
13553
|
+
//#region ../../node_modules/.pnpm/@effected+lockfiles@0.1.8_@effected+jsonc@0.5.0_effect@4.0.0-beta.99__@effected+npm@0.2_d9e647ebf030778b1166690cbf4c6aa9/node_modules/@effected/lockfiles/internal/documents.js
|
|
13279
13554
|
/**
|
|
13280
13555
|
* An empty YAML document composes to `null` (`Yaml.parseAll("")` is `[null]`,
|
|
13281
13556
|
* and the trailing document of an env-only `pnpm-lock.yaml` is `null` too).
|
|
@@ -13346,7 +13621,7 @@ const selectSoleDocument = (content) => Effect.gen(function* () {
|
|
|
13346
13621
|
});
|
|
13347
13622
|
|
|
13348
13623
|
//#endregion
|
|
13349
|
-
//#region ../../node_modules/.pnpm/@effected+lockfiles@0.1.
|
|
13624
|
+
//#region ../../node_modules/.pnpm/@effected+lockfiles@0.1.8_@effected+jsonc@0.5.0_effect@4.0.0-beta.99__@effected+npm@0.2_d9e647ebf030778b1166690cbf4c6aa9/node_modules/@effected/lockfiles/internal/pnpm.js
|
|
13350
13625
|
const PnpmImporterDeps = Schema.optionalKey(Schema.Record(Schema.String, Schema.Struct({
|
|
13351
13626
|
specifier: Schema.String,
|
|
13352
13627
|
version: Schema.String
|
|
@@ -13473,7 +13748,7 @@ const toFields$1 = (raw) => Effect.gen(function* () {
|
|
|
13473
13748
|
});
|
|
13474
13749
|
|
|
13475
13750
|
//#endregion
|
|
13476
|
-
//#region ../../node_modules/.pnpm/@effected+lockfiles@0.1.
|
|
13751
|
+
//#region ../../node_modules/.pnpm/@effected+lockfiles@0.1.8_@effected+jsonc@0.5.0_effect@4.0.0-beta.99__@effected+npm@0.2_d9e647ebf030778b1166690cbf4c6aa9/node_modules/@effected/lockfiles/internal/yarn.js
|
|
13477
13752
|
const YarnLockfileRaw = Schema.Record(Schema.String, Schema.Unknown);
|
|
13478
13753
|
const DepRecord = Schema.optionalKey(Schema.Record(Schema.String, Schema.String));
|
|
13479
13754
|
const YarnEntry = Schema.Struct({
|
|
@@ -13597,7 +13872,7 @@ const cleanYarnDeps = (deps) => {
|
|
|
13597
13872
|
};
|
|
13598
13873
|
|
|
13599
13874
|
//#endregion
|
|
13600
|
-
//#region ../../node_modules/.pnpm/@effected+lockfiles@0.1.
|
|
13875
|
+
//#region ../../node_modules/.pnpm/@effected+lockfiles@0.1.8_@effected+jsonc@0.5.0_effect@4.0.0-beta.99__@effected+npm@0.2_d9e647ebf030778b1166690cbf4c6aa9/node_modules/@effected/lockfiles/Lockfile.js
|
|
13601
13876
|
const EMPTY_IMPORTERS = [];
|
|
13602
13877
|
/**
|
|
13603
13878
|
* Failure of `Lockfile.parse`: the given content is not a valid lockfile of
|
|
@@ -13842,7 +14117,7 @@ var Lockfile = class Lockfile extends Schema.Class("Lockfile")({
|
|
|
13842
14117
|
};
|
|
13843
14118
|
|
|
13844
14119
|
//#endregion
|
|
13845
|
-
//#region ../../node_modules/.pnpm/@effected+lockfiles@0.1.
|
|
14120
|
+
//#region ../../node_modules/.pnpm/@effected+lockfiles@0.1.8_@effected+jsonc@0.5.0_effect@4.0.0-beta.99__@effected+npm@0.2_d9e647ebf030778b1166690cbf4c6aa9/node_modules/@effected/lockfiles/LockfileIntegrity.js
|
|
13846
14121
|
/**
|
|
13847
14122
|
* The minimal manifest shape {@link LockfileIntegrity.compare} checks a
|
|
13848
14123
|
* lockfile against: a package name plus the four optional dependency maps.
|
|
@@ -13959,7 +14234,7 @@ var LockfileIntegrity = class LockfileIntegrity extends Schema.Class("LockfileIn
|
|
|
13959
14234
|
};
|
|
13960
14235
|
|
|
13961
14236
|
//#endregion
|
|
13962
|
-
//#region ../../node_modules/.pnpm/@effected+package-json@0.
|
|
14237
|
+
//#region ../../node_modules/.pnpm/@effected+package-json@0.4.1_effect@4.0.0-beta.99/node_modules/@effected/package-json/Dependency.js
|
|
13963
14238
|
/**
|
|
13964
14239
|
* A resolved dependency entry pairing a package name with its version
|
|
13965
14240
|
* specifier and the `kind` of map it came from (`@effected/npm`'s
|
|
@@ -14024,7 +14299,7 @@ var Dependency = class extends Schema.Class("Dependency")({
|
|
|
14024
14299
|
};
|
|
14025
14300
|
|
|
14026
14301
|
//#endregion
|
|
14027
|
-
//#region ../../node_modules/.pnpm/@effected+package-json@0.
|
|
14302
|
+
//#region ../../node_modules/.pnpm/@effected+package-json@0.4.1_effect@4.0.0-beta.99/node_modules/@effected/package-json/DevEngines.js
|
|
14028
14303
|
/**
|
|
14029
14304
|
* A single `devEngines` constraint with a name and optional `version` / `onFail`.
|
|
14030
14305
|
*
|
|
@@ -15065,7 +15340,7 @@ var require_spdx_expression_parse = /* @__PURE__ */ __commonJSMin(((exports, mod
|
|
|
15065
15340
|
}));
|
|
15066
15341
|
|
|
15067
15342
|
//#endregion
|
|
15068
|
-
//#region ../../node_modules/.pnpm/@effected+package-json@0.
|
|
15343
|
+
//#region ../../node_modules/.pnpm/@effected+package-json@0.4.1_effect@4.0.0-beta.99/node_modules/@effected/package-json/License.js
|
|
15069
15344
|
var import_spdx_expression_parse = /* @__PURE__ */ __toESM(require_spdx_expression_parse(), 1);
|
|
15070
15345
|
/**
|
|
15071
15346
|
* Indicates that a string is not a valid SPDX license identifier or expression.
|
|
@@ -15107,7 +15382,7 @@ const isValidSpdx = (value) => {
|
|
|
15107
15382
|
const SpdxLicense = Schema.String.pipe(Schema.check(Schema.makeFilter((value) => isValidSpdx(value) ? void 0 : "Expected a valid SPDX license expression")), Schema.brand("SpdxLicense"));
|
|
15108
15383
|
|
|
15109
15384
|
//#endregion
|
|
15110
|
-
//#region ../../node_modules/.pnpm/@effected+package-json@0.
|
|
15385
|
+
//#region ../../node_modules/.pnpm/@effected+package-json@0.4.1_effect@4.0.0-beta.99/node_modules/@effected/package-json/PackageManager.js
|
|
15111
15386
|
const PACKAGE_MANAGER_RE = /^([a-z]+)@(\d+\.\d+\.\d+(?:-[a-zA-Z0-9._-]+)?)(?:\+(.+))?$/;
|
|
15112
15387
|
/**
|
|
15113
15388
|
* The `packageManager` field only ever carries corepack's `<algo>.<hex>`
|
|
@@ -15166,7 +15441,7 @@ var PackageManager = class PackageManager extends Schema.Class("PackageManager")
|
|
|
15166
15441
|
};
|
|
15167
15442
|
|
|
15168
15443
|
//#endregion
|
|
15169
|
-
//#region ../../node_modules/.pnpm/@effected+package-json@0.
|
|
15444
|
+
//#region ../../node_modules/.pnpm/@effected+package-json@0.4.1_effect@4.0.0-beta.99/node_modules/@effected/package-json/PackageName.js
|
|
15170
15445
|
/**
|
|
15171
15446
|
* Indicates that a string could not be used as a valid npm package name.
|
|
15172
15447
|
*
|
|
@@ -15225,7 +15500,7 @@ const PackageName = Object.assign(Schema.Union([ScopedPackageName, UnscopedPacka
|
|
|
15225
15500
|
});
|
|
15226
15501
|
|
|
15227
15502
|
//#endregion
|
|
15228
|
-
//#region ../../node_modules/.pnpm/@effected+package-json@0.
|
|
15503
|
+
//#region ../../node_modules/.pnpm/@effected+package-json@0.4.1_effect@4.0.0-beta.99/node_modules/@effected/package-json/Person.js
|
|
15229
15504
|
const parsePersonString = (input) => {
|
|
15230
15505
|
const emailMatch = input.match(/<([^>]+)>/);
|
|
15231
15506
|
const urlMatch = input.match(/\(([^)]+)\)/);
|
|
@@ -15239,8 +15514,56 @@ const parsePersonString = (input) => {
|
|
|
15239
15514
|
...urlMatch !== null ? { url: urlMatch[1] } : {}
|
|
15240
15515
|
});
|
|
15241
15516
|
};
|
|
15517
|
+
const serializePerson = (person) => {
|
|
15518
|
+
let result = person.name;
|
|
15519
|
+
if (person.email !== void 0) result += ` <${person.email}>`;
|
|
15520
|
+
if (person.url !== void 0) result += ` (${person.url})`;
|
|
15521
|
+
return result;
|
|
15522
|
+
};
|
|
15523
|
+
const wireForms = /* @__PURE__ */ new WeakMap();
|
|
15524
|
+
const rememberWire = (person, wire) => {
|
|
15525
|
+
wireForms.set(person, wire);
|
|
15526
|
+
return person;
|
|
15527
|
+
};
|
|
15528
|
+
const KNOWN_KEYS = /* @__PURE__ */ new Set([
|
|
15529
|
+
"name",
|
|
15530
|
+
"email",
|
|
15531
|
+
"url"
|
|
15532
|
+
]);
|
|
15533
|
+
const sameRest = (a, b) => JSON.stringify(a ?? {}) === JSON.stringify(b ?? {});
|
|
15534
|
+
const isFaithful = (wire, person) => {
|
|
15535
|
+
if (typeof wire === "string") {
|
|
15536
|
+
const parsed = parsePersonString(wire);
|
|
15537
|
+
return parsed.name === person.name && parsed.email === person.email && parsed.url === person.url;
|
|
15538
|
+
}
|
|
15539
|
+
const rest = restOf(wire);
|
|
15540
|
+
return wire.name === person.name && wire.email === person.email && wire.url === person.url && sameRest(rest, person.rest);
|
|
15541
|
+
};
|
|
15542
|
+
const PersonFields = Schema.Struct({
|
|
15543
|
+
name: Schema.String,
|
|
15544
|
+
email: Schema.optionalKey(Schema.String),
|
|
15545
|
+
url: Schema.optionalKey(Schema.String)
|
|
15546
|
+
});
|
|
15547
|
+
const decodePersonFields = Schema.decodeUnknownEffect(PersonFields);
|
|
15548
|
+
const restOf = (raw) => {
|
|
15549
|
+
const rest = {};
|
|
15550
|
+
for (const [key, value] of Object.entries(raw)) if (!KNOWN_KEYS.has(key)) rest[key] = value;
|
|
15551
|
+
return rest;
|
|
15552
|
+
};
|
|
15553
|
+
const encodePersonObject = (person) => {
|
|
15554
|
+
const wire = wireForms.get(person);
|
|
15555
|
+
if (wire !== void 0 && typeof wire !== "string" && isFaithful(wire, person)) return wire;
|
|
15556
|
+
const known = { name: person.name };
|
|
15557
|
+
if (person.email !== void 0) known.email = person.email;
|
|
15558
|
+
if (person.url !== void 0) known.url = person.url;
|
|
15559
|
+
return {
|
|
15560
|
+
...person.rest ?? {},
|
|
15561
|
+
...known
|
|
15562
|
+
};
|
|
15563
|
+
};
|
|
15242
15564
|
/**
|
|
15243
|
-
* A structured person object with `name
|
|
15565
|
+
* A structured person object with `name`, optional `email` / `url`, and a
|
|
15566
|
+
* `rest` catch-all preserving any additional keys across a read/write cycle.
|
|
15244
15567
|
*
|
|
15245
15568
|
* @public
|
|
15246
15569
|
*/
|
|
@@ -15250,30 +15573,78 @@ var Person = class Person extends Schema.Class("Person")({
|
|
|
15250
15573
|
/** The optional email address. */
|
|
15251
15574
|
email: Schema.optionalKey(Schema.String),
|
|
15252
15575
|
/** The optional homepage URL. */
|
|
15253
|
-
url: Schema.optionalKey(Schema.String)
|
|
15576
|
+
url: Schema.optionalKey(Schema.String),
|
|
15577
|
+
/** Any additional keys, preserved verbatim and flattened back on encode. */
|
|
15578
|
+
rest: Schema.optionalKey(Schema.Record(Schema.String, Schema.Unknown))
|
|
15254
15579
|
}) {
|
|
15580
|
+
/**
|
|
15581
|
+
* The object wire codec: an open JSON object ↔ a {@link Person}, partitioning
|
|
15582
|
+
* unknown keys into `rest` and flattening them back on encode so the on-disk
|
|
15583
|
+
* shape never carries a literal `rest` key.
|
|
15584
|
+
*/
|
|
15585
|
+
static schema = Schema.Record(Schema.String, Schema.Unknown).pipe(Schema.decodeTo(Schema.instanceOf(Person), SchemaTransformation.transformOrFail({
|
|
15586
|
+
decode: (raw) => decodePersonFields(raw).pipe(Effect.mapError((error) => error.issue), Effect.map((fields) => {
|
|
15587
|
+
const rest = restOf(raw);
|
|
15588
|
+
return rememberWire(Person.make({
|
|
15589
|
+
...fields,
|
|
15590
|
+
...Object.keys(rest).length > 0 ? { rest } : {}
|
|
15591
|
+
}), raw);
|
|
15592
|
+
})),
|
|
15593
|
+
encode: (person) => Effect.succeed(encodePersonObject(person))
|
|
15594
|
+
})));
|
|
15255
15595
|
/**
|
|
15256
15596
|
* Schema transformation between the `"Name <email> (url)"` shorthand string
|
|
15257
|
-
* and a {@link Person}.
|
|
15597
|
+
* and a {@link Person}. Decoding remembers the input text so that encoding
|
|
15598
|
+
* reproduces it verbatim; see {@link Person.wireStringOf}.
|
|
15258
15599
|
*/
|
|
15259
15600
|
static FromString = Schema.String.pipe(Schema.decodeTo(Schema.instanceOf(Person), SchemaTransformation.transform({
|
|
15260
|
-
decode: (input) => parsePersonString(input),
|
|
15601
|
+
decode: (input) => rememberWire(parsePersonString(input), input),
|
|
15261
15602
|
encode: (person) => {
|
|
15262
|
-
|
|
15263
|
-
|
|
15264
|
-
if (person.url !== void 0) result += ` (${person.url})`;
|
|
15265
|
-
return result;
|
|
15603
|
+
const wire = wireForms.get(person);
|
|
15604
|
+
return typeof wire === "string" && isFaithful(wire, person) ? wire : serializePerson(person);
|
|
15266
15605
|
}
|
|
15267
15606
|
})));
|
|
15268
15607
|
/**
|
|
15269
15608
|
* The `author` / `contributors` value: either the shorthand string or the
|
|
15270
15609
|
* structured object, always decoded to a {@link Person}.
|
|
15610
|
+
*
|
|
15611
|
+
* The wire form is preserved across a round trip — a person read from the
|
|
15612
|
+
* shorthand string encodes back to that string, byte for byte, and one read
|
|
15613
|
+
* from an object encodes back to an object with its unknown keys intact.
|
|
15614
|
+
* Formatting a manifest therefore never rewrites one legal encoding into the
|
|
15615
|
+
* other.
|
|
15616
|
+
*
|
|
15617
|
+
* Provenance belongs to the instance, so a person that is *rebuilt* (rather
|
|
15618
|
+
* than carried through unchanged) has none and encodes in the canonical
|
|
15619
|
+
* object form. Editing an unrelated field of the surrounding `Package`
|
|
15620
|
+
* carries the same person instance through and preserves its encoding.
|
|
15271
15621
|
*/
|
|
15272
|
-
static FromValue = Schema.Union([Person,
|
|
15622
|
+
static FromValue = Schema.Union([Person.schema, Schema.String]).pipe(Schema.decodeTo(Schema.instanceOf(Person), SchemaTransformation.transform({
|
|
15623
|
+
decode: (input) => typeof input === "string" ? rememberWire(parsePersonString(input), input) : input,
|
|
15624
|
+
encode: (person) => {
|
|
15625
|
+
const wire = wireForms.get(person);
|
|
15626
|
+
return typeof wire === "string" && isFaithful(wire, person) ? wire : person;
|
|
15627
|
+
}
|
|
15628
|
+
})));
|
|
15629
|
+
/**
|
|
15630
|
+
* The shorthand text this person was decoded from, when it was decoded from
|
|
15631
|
+
* the string form and still matches its fields; `None` for a person built
|
|
15632
|
+
* from an object or by hand.
|
|
15633
|
+
*
|
|
15634
|
+
* Exposed so callers can tell which encoding a manifest used without
|
|
15635
|
+
* re-reading the file.
|
|
15636
|
+
*
|
|
15637
|
+
* @param person - the person to inspect
|
|
15638
|
+
* @returns the original shorthand text, or `None`
|
|
15639
|
+
*/
|
|
15640
|
+
static wireStringOf(person) {
|
|
15641
|
+
const wire = wireForms.get(person);
|
|
15642
|
+
return typeof wire === "string" && isFaithful(wire, person) ? Option.some(wire) : Option.none();
|
|
15643
|
+
}
|
|
15273
15644
|
};
|
|
15274
15645
|
|
|
15275
15646
|
//#endregion
|
|
15276
|
-
//#region ../../node_modules/.pnpm/@effected+package-json@0.
|
|
15647
|
+
//#region ../../node_modules/.pnpm/@effected+package-json@0.4.1_effect@4.0.0-beta.99/node_modules/@effected/package-json/internal/format.js
|
|
15277
15648
|
const KEY_INDEX = new Map([
|
|
15278
15649
|
"$schema",
|
|
15279
15650
|
"name",
|
|
@@ -15497,7 +15868,7 @@ const renderJson = (raw, options) => {
|
|
|
15497
15868
|
};
|
|
15498
15869
|
|
|
15499
15870
|
//#endregion
|
|
15500
|
-
//#region ../../node_modules/.pnpm/@effected+package-json@0.
|
|
15871
|
+
//#region ../../node_modules/.pnpm/@effected+package-json@0.4.1_effect@4.0.0-beta.99/node_modules/@effected/package-json/Package.js
|
|
15501
15872
|
const toHashMap = SchemaTransformation.transform({
|
|
15502
15873
|
decode: (record) => HashMap.fromIterable(Object.entries(record)),
|
|
15503
15874
|
encode: (map) => Object.fromEntries(HashMap.toEntries(map))
|
|
@@ -15816,7 +16187,7 @@ var Package = class Package extends Schema.Class("Package")({
|
|
|
15816
16187
|
};
|
|
15817
16188
|
|
|
15818
16189
|
//#endregion
|
|
15819
|
-
//#region ../../node_modules/.pnpm/@effected+workspaces@0.
|
|
16190
|
+
//#region ../../node_modules/.pnpm/@effected+workspaces@0.5.2_@effected+jsonc@0.5.0_effect@4.0.0-beta.99__effect@4.0.0-beta.99/node_modules/@effected/workspaces/WorkspacePackage.js
|
|
15820
16191
|
const EMPTY$1 = Object.freeze(Object.create(null));
|
|
15821
16192
|
const EMPTY_MANIFEST = Object.freeze(Object.create(null));
|
|
15822
16193
|
/**
|
|
@@ -15891,10 +16262,12 @@ var WorkspaceManifestError = class extends Schema.TaggedErrorClass()("WorkspaceM
|
|
|
15891
16262
|
* path: "/repo/packages/utils",
|
|
15892
16263
|
* packageJsonPath: "/repo/packages/utils/package.json",
|
|
15893
16264
|
* relativePath: "packages/utils",
|
|
16265
|
+
* workspaceRoot: "/repo",
|
|
15894
16266
|
* });
|
|
15895
16267
|
*
|
|
15896
16268
|
* pkg.isRootWorkspace; // false
|
|
15897
16269
|
* pkg.unscopedName; // "utils"
|
|
16270
|
+
* pkg.workspaceRoot; // "/repo"
|
|
15898
16271
|
* ```
|
|
15899
16272
|
*
|
|
15900
16273
|
* @public
|
|
@@ -15910,6 +16283,21 @@ var WorkspacePackage = class WorkspacePackage extends Schema.Class("WorkspacePac
|
|
|
15910
16283
|
packageJsonPath: Schema.NonEmptyString,
|
|
15911
16284
|
/** POSIX path relative to the workspace root; `"."` for the root package. */
|
|
15912
16285
|
relativePath: Schema.String,
|
|
16286
|
+
/**
|
|
16287
|
+
* Absolute path to the workspace root this package was discovered under.
|
|
16288
|
+
*
|
|
16289
|
+
* @remarks
|
|
16290
|
+
* Carried, not derived. Whoever built this value already knew the root —
|
|
16291
|
+
* `WorkspaceDiscovery` resolved it before enumerating, and the sync entry
|
|
16292
|
+
* point is handed it — so dropping it forced every consumer into per-package
|
|
16293
|
+
* root arithmetic (counting `relativePath` segments and re-ascending that
|
|
16294
|
+
* many `..`). That reconstruction is exact only while `path` and
|
|
16295
|
+
* `relativePath` agree, and it re-derives something the kit never had to
|
|
16296
|
+
* lose.
|
|
16297
|
+
*
|
|
16298
|
+
* For the root package this equals `path`, and `relativePath` is `"."`.
|
|
16299
|
+
*/
|
|
16300
|
+
workspaceRoot: Schema.NonEmptyString,
|
|
15913
16301
|
/** Whether the package is marked private. */
|
|
15914
16302
|
private: Schema.Boolean.pipe(Schema.withDecodingDefaultKey(Effect.succeed(false)), Schema.withConstructorDefault(Effect.succeed(false))),
|
|
15915
16303
|
/** Production dependencies. */
|
|
@@ -16079,7 +16467,7 @@ var WorkspacePackage = class WorkspacePackage extends Schema.Class("WorkspacePac
|
|
|
16079
16467
|
};
|
|
16080
16468
|
|
|
16081
16469
|
//#endregion
|
|
16082
|
-
//#region ../../node_modules/.pnpm/@effected+walker@0.
|
|
16470
|
+
//#region ../../node_modules/.pnpm/@effected+walker@0.3.1_@effected+glob@0.2.0_effect@4.0.0-beta.99__effect@4.0.0-beta.99/node_modules/@effected/walker/Descend.js
|
|
16083
16471
|
/**
|
|
16084
16472
|
* Typed failure raised by {@link descend}: a directory mid-walk was unreadable
|
|
16085
16473
|
* (under `onUnreadable: "fail"`), or the walk descended past `maxDepth`. Depth
|
|
@@ -16215,7 +16603,98 @@ const descend = Effect.fn("Walker.descend")(function* (pattern, options) {
|
|
|
16215
16603
|
});
|
|
16216
16604
|
|
|
16217
16605
|
//#endregion
|
|
16218
|
-
//#region ../../node_modules/.pnpm/@effected+walker@0.
|
|
16606
|
+
//#region ../../node_modules/.pnpm/@effected+walker@0.3.1_@effected+glob@0.2.0_effect@4.0.0-beta.99__effect@4.0.0-beta.99/node_modules/@effected/walker/Expand.js
|
|
16607
|
+
/**
|
|
16608
|
+
* Typed failure raised by {@link compileAndExpand}: the single error the
|
|
16609
|
+
* compile+expand recipe fails with, so a caller catches one tag rather than
|
|
16610
|
+
* folding two error channels by hand.
|
|
16611
|
+
*
|
|
16612
|
+
* @remarks
|
|
16613
|
+
* One tag, two genuinely different causes — "your pattern is malformed" and
|
|
16614
|
+
* "that directory is unreadable" are different problems with different fixes,
|
|
16615
|
+
* so `cause` keeps the underlying typed error intact
|
|
16616
|
+
* rather than flattening it into a string. Discriminate on `cause._tag`
|
|
16617
|
+
* (`"GlobPatternError"` vs `"DescendError"`), or read
|
|
16618
|
+
* {@link GlobExpansionError.stage} when only the phase matters; either way the
|
|
16619
|
+
* original payload — a guard's `limit`/`actual`, a descent's `path` — is still
|
|
16620
|
+
* there. `cause` is also the native `Error` cause, so error chaining and
|
|
16621
|
+
* stack-printing work without extra wiring.
|
|
16622
|
+
*
|
|
16623
|
+
* @public
|
|
16624
|
+
*/
|
|
16625
|
+
var GlobExpansionError = class extends Schema.TaggedErrorClass()("GlobExpansionError", {
|
|
16626
|
+
/** The glob pattern's source text, as handed to {@link compileAndExpand}. */
|
|
16627
|
+
pattern: Schema.String,
|
|
16628
|
+
/** The underlying typed failure, intact: a compile guard trip or a descent failure. */
|
|
16629
|
+
cause: Schema.Union([GlobPatternError, DescendError])
|
|
16630
|
+
}) {
|
|
16631
|
+
/**
|
|
16632
|
+
* Which phase failed — `"compile"` when the pattern itself was rejected,
|
|
16633
|
+
* `"descend"` when the filesystem walk failed. A convenience over
|
|
16634
|
+
* `cause._tag` for callers that only need the phase.
|
|
16635
|
+
*/
|
|
16636
|
+
get stage() {
|
|
16637
|
+
return this.cause._tag === "GlobPatternError" ? "compile" : "descend";
|
|
16638
|
+
}
|
|
16639
|
+
get message() {
|
|
16640
|
+
const shown = this.pattern.length > 64 ? `${this.pattern.slice(0, 64)}…` : this.pattern;
|
|
16641
|
+
return `glob expansion of ${JSON.stringify(shown)} failed during ${this.stage}: ${this.cause.message}`;
|
|
16642
|
+
}
|
|
16643
|
+
};
|
|
16644
|
+
/**
|
|
16645
|
+
* Compile a glob pattern and expand it against the filesystem in one call:
|
|
16646
|
+
* matching FILE paths relative to `options.cwd`, POSIX separators, sorted.
|
|
16647
|
+
*
|
|
16648
|
+
* @remarks
|
|
16649
|
+
* The recipe form of {@link descend}. Everything `descend` documents about
|
|
16650
|
+
* traversal holds unchanged — the literal fast-path, the negated-pattern walk
|
|
16651
|
+
* from `cwd`, files-only matching, symlink and prune handling, `maxDepth`,
|
|
16652
|
+
* `onUnreadable` — because this delegates to it. What this adds is the seam:
|
|
16653
|
+
* the pattern arrives as a string, and both failure modes arrive as one
|
|
16654
|
+
* {@link GlobExpansionError} with the underlying error preserved in `cause`.
|
|
16655
|
+
*
|
|
16656
|
+
* A missing base directory, a pattern that climbs above `cwd`, and a pattern
|
|
16657
|
+
* that simply matches nothing are all an EMPTY result, not a failure — zero
|
|
16658
|
+
* matches is a normal glob answer. Only a rejected pattern or a failed walk
|
|
16659
|
+
* produces an error.
|
|
16660
|
+
*
|
|
16661
|
+
* `FileSystem` and `Path` stay in the `R` channel and are **deliberately not
|
|
16662
|
+
* provided here**, even though hand-providing them is the friction this
|
|
16663
|
+
* recipe otherwise removes. `FileSystem` cannot be provided — a library that
|
|
16664
|
+
* picks its own filesystem cannot be tested against a fixture tree. Given
|
|
16665
|
+
* that, providing `Path` internally would not save the caller a layer (they
|
|
16666
|
+
* still supply `FileSystem`), and it would actively break win32: the walk
|
|
16667
|
+
* would join paths POSIX-style against a caller's win32 filesystem. The
|
|
16668
|
+
* consumer's platform layer stays the single place that choice is made.
|
|
16669
|
+
* Provide both once at the application boundary, not per call site.
|
|
16670
|
+
*
|
|
16671
|
+
* @example
|
|
16672
|
+
* ```ts
|
|
16673
|
+
* import { compileAndExpand } from "@effected/walker"
|
|
16674
|
+
* import { GlobPatternOptions } from "@effected/glob"
|
|
16675
|
+
*
|
|
16676
|
+
* const files = yield* compileAndExpand("packages/*/src/**/*.ts", {
|
|
16677
|
+
* cwd: "/repo",
|
|
16678
|
+
* glob: GlobPatternOptions.make({ dot: true })
|
|
16679
|
+
* })
|
|
16680
|
+
* ```
|
|
16681
|
+
*
|
|
16682
|
+
* @public
|
|
16683
|
+
*/
|
|
16684
|
+
const compileAndExpand = Effect.fn("Walker.compileAndExpand")(function* (pattern, options) {
|
|
16685
|
+
const compiled = GlobPattern.compileResult(pattern, options.glob);
|
|
16686
|
+
if (Result.isFailure(compiled)) return yield* new GlobExpansionError({
|
|
16687
|
+
pattern,
|
|
16688
|
+
cause: compiled.failure
|
|
16689
|
+
});
|
|
16690
|
+
return yield* descend(compiled.success, options).pipe(Effect.mapError((cause) => new GlobExpansionError({
|
|
16691
|
+
pattern,
|
|
16692
|
+
cause
|
|
16693
|
+
})));
|
|
16694
|
+
});
|
|
16695
|
+
|
|
16696
|
+
//#endregion
|
|
16697
|
+
//#region ../../node_modules/.pnpm/@effected+walker@0.3.1_@effected+glob@0.2.0_effect@4.0.0-beta.99__effect@4.0.0-beta.99/node_modules/@effected/walker/Walker.js
|
|
16219
16698
|
/**
|
|
16220
16699
|
* Ascend from `start` toward the filesystem root, yielding each directory,
|
|
16221
16700
|
* nearest first.
|
|
@@ -16229,17 +16708,28 @@ const descend = Effect.fn("Walker.descend")(function* (pattern, options) {
|
|
|
16229
16708
|
* Bounded twice over: `dirname` is a fixpoint at the root, and `maxDepth` guards
|
|
16230
16709
|
* a pathological `Path` implementation that never reaches one.
|
|
16231
16710
|
*
|
|
16711
|
+
* `stopAt` is compared in normalized form — see {@link AscendOptions.stopAt}.
|
|
16712
|
+
* Raw string equality made the ceiling fail OPEN: an unnormalized ceiling
|
|
16713
|
+
* matched nothing and the ascent ran silently to the filesystem root, which is
|
|
16714
|
+
* the unbounded walk the option exists to prevent, with no error to notice it
|
|
16715
|
+
* by. A relative ceiling **dies** for the same reason — resolving one against
|
|
16716
|
+
* `process.cwd()` would reintroduce the silent-wrong-walk failure through a
|
|
16717
|
+
* different door. See {@link AscendOptions.stopAt} for why that is a defect
|
|
16718
|
+
* rather than a typed error; the error channel stays `never`.
|
|
16719
|
+
*
|
|
16232
16720
|
* @public
|
|
16233
16721
|
*/
|
|
16234
16722
|
const ascend = (start, options) => Effect.gen(function* () {
|
|
16235
16723
|
const path = yield* Path.Path;
|
|
16236
16724
|
const maxDepth = options?.maxDepth ?? 256;
|
|
16237
16725
|
if (!Number.isInteger(maxDepth) || maxDepth < 1) return yield* Effect.die(/* @__PURE__ */ new Error(`Walker.ascend: maxDepth must be a positive integer, received ${maxDepth}`));
|
|
16726
|
+
if (options?.stopAt !== void 0 && !path.isAbsolute(options.stopAt)) return yield* Effect.die(/* @__PURE__ */ new Error(`Walker.ascend: stopAt must be an absolute path, received ${JSON.stringify(options.stopAt)} (ascending from ${JSON.stringify(start)})`));
|
|
16727
|
+
const ceiling = options?.stopAt === void 0 ? void 0 : path.resolve(options.stopAt);
|
|
16238
16728
|
const dirs = [];
|
|
16239
16729
|
let current = start;
|
|
16240
16730
|
for (let depth = 0; depth < maxDepth; depth++) {
|
|
16241
16731
|
dirs.push(current);
|
|
16242
|
-
if (
|
|
16732
|
+
if (ceiling !== void 0 && (current === ceiling || path.resolve(current) === ceiling)) break;
|
|
16243
16733
|
const parent = path.dirname(current);
|
|
16244
16734
|
if (parent === current) break;
|
|
16245
16735
|
current = parent;
|
|
@@ -16306,7 +16796,7 @@ const Walker$1 = {
|
|
|
16306
16796
|
};
|
|
16307
16797
|
|
|
16308
16798
|
//#endregion
|
|
16309
|
-
//#region ../../node_modules/.pnpm/@effected+workspaces@0.
|
|
16799
|
+
//#region ../../node_modules/.pnpm/@effected+workspaces@0.5.2_@effected+jsonc@0.5.0_effect@4.0.0-beta.99__effect@4.0.0-beta.99/node_modules/@effected/workspaces/WorkspaceRoot.js
|
|
16310
16800
|
/**
|
|
16311
16801
|
* The marker filenames {@link WorkspaceRoot} probes for, in priority order.
|
|
16312
16802
|
*
|
|
@@ -16326,11 +16816,22 @@ var WorkspaceRootNotFoundError = class extends Schema.TaggedErrorClass()("Worksp
|
|
|
16326
16816
|
/** The directory the ascent started from. */
|
|
16327
16817
|
searchPath: Schema.String,
|
|
16328
16818
|
/** The marker filenames probed at each ancestor. */
|
|
16329
|
-
markers: Schema.Array(Schema.String)
|
|
16819
|
+
markers: Schema.Array(Schema.String),
|
|
16820
|
+
/**
|
|
16821
|
+
* The resolved ceiling the ascent was bounded by, when one was supplied.
|
|
16822
|
+
*
|
|
16823
|
+
* @remarks
|
|
16824
|
+
* Absent means the ascent ran to the filesystem root. Its presence is what
|
|
16825
|
+
* lets a caller tell "there is no workspace root anywhere above me" from
|
|
16826
|
+
* "there is none below the ceiling I set" — two failures that otherwise
|
|
16827
|
+
* render identically.
|
|
16828
|
+
*/
|
|
16829
|
+
stopAt: Schema.optionalKey(Schema.String)
|
|
16330
16830
|
}) {
|
|
16331
|
-
/** Renders the search path
|
|
16831
|
+
/** Renders the search path, probed markers and any ceiling into a one-line message. */
|
|
16332
16832
|
get message() {
|
|
16333
|
-
|
|
16833
|
+
const bound = this.stopAt === void 0 ? "" : ` up to ${this.stopAt}`;
|
|
16834
|
+
return `No workspace root above ${this.searchPath}${bound} (looked for ${this.markers.join(", ")})`;
|
|
16334
16835
|
}
|
|
16335
16836
|
};
|
|
16336
16837
|
/**
|
|
@@ -16353,6 +16854,12 @@ const isWorkspaceRoot = (dir) => Effect.gen(function* () {
|
|
|
16353
16854
|
}).pipe(Effect.orElseSucceed(() => ({})));
|
|
16354
16855
|
return parsed.workspaces !== void 0 && parsed.workspaces !== null;
|
|
16355
16856
|
});
|
|
16857
|
+
/** Whether `descendant` is `ancestor` itself or lies beneath it, on POSIX or win32 separators. */
|
|
16858
|
+
const isAtOrBelow = (descendant, ancestor) => {
|
|
16859
|
+
if (descendant === ancestor) return true;
|
|
16860
|
+
const prefix = ancestor.endsWith("/") || ancestor.endsWith("\\") ? ancestor : `${ancestor}/`;
|
|
16861
|
+
return descendant.startsWith(prefix) || descendant.startsWith(prefix.replace(/\/$/, "\\"));
|
|
16862
|
+
};
|
|
16356
16863
|
/**
|
|
16357
16864
|
* Locates the workspace root by ascending from a starting directory.
|
|
16358
16865
|
*
|
|
@@ -16367,6 +16874,20 @@ const isWorkspaceRoot = (dir) => Effect.gen(function* () {
|
|
|
16367
16874
|
* });
|
|
16368
16875
|
* ```
|
|
16369
16876
|
*
|
|
16877
|
+
* @example
|
|
16878
|
+
* Bounded: an unmarked fixture directory fails typed instead of escaping into
|
|
16879
|
+
* the enclosing repository.
|
|
16880
|
+
*
|
|
16881
|
+
* ```ts
|
|
16882
|
+
* import { WorkspaceRoot } from "@effected/workspaces";
|
|
16883
|
+
* import { Effect } from "effect";
|
|
16884
|
+
*
|
|
16885
|
+
* const program = Effect.gen(function* () {
|
|
16886
|
+
* const roots = yield* WorkspaceRoot;
|
|
16887
|
+
* return yield* roots.find("/tmp/fixture/packages/a", { stopAt: "/tmp/fixture" });
|
|
16888
|
+
* });
|
|
16889
|
+
* ```
|
|
16890
|
+
*
|
|
16370
16891
|
* @public
|
|
16371
16892
|
*/
|
|
16372
16893
|
var WorkspaceRoot = class WorkspaceRoot extends Context.Service()("@effected/workspaces/WorkspaceRoot") {
|
|
@@ -16374,25 +16895,96 @@ var WorkspaceRoot = class WorkspaceRoot extends Context.Service()("@effected/wor
|
|
|
16374
16895
|
static make = Effect.gen(function* () {
|
|
16375
16896
|
const fs = yield* FileSystem.FileSystem;
|
|
16376
16897
|
const path = yield* Path.Path;
|
|
16377
|
-
const find = Effect.fn("WorkspaceRoot.find")(function* (cwd) {
|
|
16898
|
+
const find = Effect.fn("WorkspaceRoot.find")(function* (cwd, options) {
|
|
16378
16899
|
const start = path.resolve(cwd);
|
|
16379
|
-
const
|
|
16900
|
+
const ceiling = options?.stopAt === void 0 ? void 0 : path.resolve(options.stopAt);
|
|
16901
|
+
const chain = yield* Walker$1.ascend(start, {
|
|
16902
|
+
...ceiling === void 0 ? {} : { stopAt: ceiling },
|
|
16903
|
+
...options?.maxDepth === void 0 ? {} : { maxDepth: options.maxDepth }
|
|
16904
|
+
});
|
|
16380
16905
|
const found = yield* Walker$1.findRoot(chain, isWorkspaceRoot);
|
|
16381
16906
|
if (Option.isNone(found)) return yield* Effect.fail(new WorkspaceRootNotFoundError({
|
|
16382
16907
|
searchPath: start,
|
|
16383
|
-
markers: WORKSPACE_MARKERS
|
|
16908
|
+
markers: WORKSPACE_MARKERS,
|
|
16909
|
+
...ceiling === void 0 ? {} : { stopAt: ceiling }
|
|
16384
16910
|
}));
|
|
16385
16911
|
yield* Effect.logDebug("Workspace root found").pipe(Effect.annotateLogs("workspace.root", found.value));
|
|
16386
16912
|
return found.value;
|
|
16387
16913
|
});
|
|
16388
|
-
return { find: (cwd) => find(cwd).pipe(Effect.provideService(FileSystem.FileSystem, fs), Effect.provideService(Path.Path, path)) };
|
|
16914
|
+
return { find: (cwd, options) => find(cwd, options).pipe(Effect.provideService(FileSystem.FileSystem, fs), Effect.provideService(Path.Path, path)) };
|
|
16389
16915
|
});
|
|
16390
16916
|
/** The live layer. */
|
|
16391
16917
|
static layer = Layer.effect(WorkspaceRoot, WorkspaceRoot.make);
|
|
16918
|
+
/**
|
|
16919
|
+
* A test double resolving every `find` to `root`, with no filesystem.
|
|
16920
|
+
*
|
|
16921
|
+
* @remarks
|
|
16922
|
+
* The nine-copies-of-a-four-line-mock case — a `Layer.succeed` over a `find`
|
|
16923
|
+
* that ignores its arguments and succeeds with a fixed root is what consumers
|
|
16924
|
+
* were writing by hand. The difference is that this double **honours
|
|
16925
|
+
* `stopAt`**: a hand-rolled `find` that ignores the ceiling makes a bounded
|
|
16926
|
+
* call pass under test and fail against the live service, which is the
|
|
16927
|
+
* failure mode the option exists to catch. A `root` above the ceiling fails
|
|
16928
|
+
* here exactly as it would live, with the same
|
|
16929
|
+
* {@link WorkspaceRootNotFoundError}.
|
|
16930
|
+
*
|
|
16931
|
+
* The ceiling is `path.resolve`d through the injected `Path` service before
|
|
16932
|
+
* the comparison, exactly as the live `make` path does — so a `stopAt`
|
|
16933
|
+
* carrying `..` segments bounds the double identically to the live service,
|
|
16934
|
+
* not by raw string. This is why `makeTest` yields an `Effect` requiring
|
|
16935
|
+
* `Path`: it captures the service once at construction, the same shape as
|
|
16936
|
+
* `make`. Consumers reach for {@link WorkspaceRoot.layerTest}, which provides
|
|
16937
|
+
* `Path.layer` internally, so the requirement never surfaces at their call
|
|
16938
|
+
* site.
|
|
16939
|
+
*
|
|
16940
|
+
* `maxDepth` is deliberately NOT modelled: the double does not walk, so it has
|
|
16941
|
+
* no depth to cap, and pretending otherwise would encode a fiction. A suite
|
|
16942
|
+
* exercising the depth guard wants the live service over a fixture tree.
|
|
16943
|
+
*
|
|
16944
|
+
* @param root - The root every unbounded `find` resolves to.
|
|
16945
|
+
*/
|
|
16946
|
+
static makeTest = (root) => Effect.gen(function* () {
|
|
16947
|
+
const path = yield* Path.Path;
|
|
16948
|
+
return { find: (cwd, options) => options?.stopAt !== void 0 && !isAtOrBelow(root, path.resolve(options.stopAt)) ? Effect.fail(new WorkspaceRootNotFoundError({
|
|
16949
|
+
searchPath: cwd,
|
|
16950
|
+
markers: WORKSPACE_MARKERS,
|
|
16951
|
+
stopAt: options.stopAt
|
|
16952
|
+
})) : Effect.succeed(root) };
|
|
16953
|
+
});
|
|
16954
|
+
/**
|
|
16955
|
+
* The test layer: {@link WorkspaceRoot.makeTest} with `Path.layer` provided.
|
|
16956
|
+
*
|
|
16957
|
+
* @remarks
|
|
16958
|
+
* `makeTest` requires `Path` to normalize the `stopAt` ceiling; this layer
|
|
16959
|
+
* supplies core's `Path.layer` internally, so the requirement never reaches a
|
|
16960
|
+
* consumer — the published type stays `Layer.Layer<WorkspaceRoot>`.
|
|
16961
|
+
*
|
|
16962
|
+
* A parameterized layer factory mints a **fresh reference per call**, and
|
|
16963
|
+
* layers memoize by reference — bind the result to a `const` and reuse it
|
|
16964
|
+
* rather than calling `layerTest(...)` at each composition site.
|
|
16965
|
+
*
|
|
16966
|
+
* Pair it with `WorkspaceDiscovery.layerTest` to stand up the whole discovery
|
|
16967
|
+
* path without a filesystem; between them there is nothing left for a
|
|
16968
|
+
* module-level mock of `@effected/workspaces` to do, and a provided layer
|
|
16969
|
+
* keeps the service graph — and its typed errors — intact.
|
|
16970
|
+
*
|
|
16971
|
+
* @example
|
|
16972
|
+
* ```ts
|
|
16973
|
+
* import { WorkspaceDiscovery, WorkspaceRoot } from "@effected/workspaces";
|
|
16974
|
+
* import { Effect } from "effect";
|
|
16975
|
+
*
|
|
16976
|
+
* const TestRoot = WorkspaceRoot.layerTest("/repo");
|
|
16977
|
+
* const TestDiscovery = WorkspaceDiscovery.layerTest({
|
|
16978
|
+
* listPackages: () => Effect.succeed([]),
|
|
16979
|
+
* });
|
|
16980
|
+
* // program.pipe(Effect.provide(TestRoot), Effect.provide(TestDiscovery))
|
|
16981
|
+
* ```
|
|
16982
|
+
*/
|
|
16983
|
+
static layerTest = (root) => Layer.effect(WorkspaceRoot, WorkspaceRoot.makeTest(root)).pipe(Layer.provide(Path.layer));
|
|
16392
16984
|
};
|
|
16393
16985
|
|
|
16394
16986
|
//#endregion
|
|
16395
|
-
//#region ../../node_modules/.pnpm/@effected+workspaces@0.
|
|
16987
|
+
//#region ../../node_modules/.pnpm/@effected+workspaces@0.5.2_@effected+jsonc@0.5.0_effect@4.0.0-beta.99__effect@4.0.0-beta.99/node_modules/@effected/workspaces/internal/limits.js
|
|
16396
16988
|
/**
|
|
16397
16989
|
* Hard ceiling on directories the enumerator will visit for one pattern set.
|
|
16398
16990
|
* Guards the pathological case a depth cap alone does not: a wide, shallow
|
|
@@ -16411,7 +17003,7 @@ const MAX_ENUMERATION_ENTRIES = 1e5;
|
|
|
16411
17003
|
const PRUNED_DIRECTORIES = /* @__PURE__ */ new Set([".git", "node_modules"]);
|
|
16412
17004
|
|
|
16413
17005
|
//#endregion
|
|
16414
|
-
//#region ../../node_modules/.pnpm/@effected+workspaces@0.
|
|
17006
|
+
//#region ../../node_modules/.pnpm/@effected+workspaces@0.5.2_@effected+jsonc@0.5.0_effect@4.0.0-beta.99__effect@4.0.0-beta.99/node_modules/@effected/workspaces/internal/traverse.js
|
|
16415
17007
|
/** Directory names never descended into. */
|
|
16416
17008
|
const isPruned = (entry) => PRUNED_DIRECTORIES.has(entry);
|
|
16417
17009
|
/** Join root-relative POSIX segments; `""` is the root itself. */
|
|
@@ -16502,7 +17094,7 @@ var Traversal = class {
|
|
|
16502
17094
|
};
|
|
16503
17095
|
|
|
16504
17096
|
//#endregion
|
|
16505
|
-
//#region ../../node_modules/.pnpm/@effected+workspaces@0.
|
|
17097
|
+
//#region ../../node_modules/.pnpm/@effected+workspaces@0.5.2_@effected+jsonc@0.5.0_effect@4.0.0-beta.99__effect@4.0.0-beta.99/node_modules/@effected/workspaces/internal/enumerate.js
|
|
16506
17098
|
/** Strip a trailing slash from `GlobPattern.enumerationPrefix` to get a relative directory. */
|
|
16507
17099
|
const baseOf = (pattern) => pattern.enumerationPrefix.replace(/\/$/, "");
|
|
16508
17100
|
/**
|
|
@@ -16573,7 +17165,7 @@ const enumerate = (root, globs, options) => Effect.gen(function* () {
|
|
|
16573
17165
|
});
|
|
16574
17166
|
|
|
16575
17167
|
//#endregion
|
|
16576
|
-
//#region ../../node_modules/.pnpm/@effected+workspaces@0.
|
|
17168
|
+
//#region ../../node_modules/.pnpm/@effected+workspaces@0.5.2_@effected+jsonc@0.5.0_effect@4.0.0-beta.99__effect@4.0.0-beta.99/node_modules/@effected/workspaces/internal/patterns.js
|
|
16577
17169
|
const stringsOf = (value) => Array.isArray(value) ? value.filter((entry) => typeof entry === "string") : void 0;
|
|
16578
17170
|
/** The `packages:` list of a `pnpm-workspace.yaml` document. Total on a parsed document. */
|
|
16579
17171
|
const pnpmPatternsOf = (document) => {
|
|
@@ -16631,7 +17223,7 @@ const readPatterns = (root) => Effect.gen(function* () {
|
|
|
16631
17223
|
});
|
|
16632
17224
|
|
|
16633
17225
|
//#endregion
|
|
16634
|
-
//#region ../../node_modules/.pnpm/@effected+workspaces@0.
|
|
17226
|
+
//#region ../../node_modules/.pnpm/@effected+workspaces@0.5.2_@effected+jsonc@0.5.0_effect@4.0.0-beta.99__effect@4.0.0-beta.99/node_modules/@effected/workspaces/WorkspaceDiscovery.js
|
|
16635
17227
|
/**
|
|
16636
17228
|
* Raised when a workspace member's `package.json` cannot be read, parsed, or
|
|
16637
17229
|
* used — it is missing, malformed, or lacks a `name` or `version`.
|
|
@@ -16809,6 +17401,7 @@ var WorkspaceDiscovery = class WorkspaceDiscovery extends Context.Service()("@ef
|
|
|
16809
17401
|
path: directory,
|
|
16810
17402
|
packageJsonPath,
|
|
16811
17403
|
relativePath,
|
|
17404
|
+
workspaceRoot: root,
|
|
16812
17405
|
manifestRecord: raw,
|
|
16813
17406
|
...typeof raw.private === "boolean" ? { private: raw.private } : {},
|
|
16814
17407
|
...isStringRecord$2(raw.dependencies) ? { dependencies: raw.dependencies } : {},
|
|
@@ -16966,6 +17559,7 @@ var WorkspaceDiscovery = class WorkspaceDiscovery extends Context.Service()("@ef
|
|
|
16966
17559
|
* path: "/repo/packages/utils",
|
|
16967
17560
|
* packageJsonPath: "/repo/packages/utils/package.json",
|
|
16968
17561
|
* relativePath: "packages/utils",
|
|
17562
|
+
* workspaceRoot: "/repo",
|
|
16969
17563
|
* }),
|
|
16970
17564
|
* ]),
|
|
16971
17565
|
* });
|
|
@@ -17064,7 +17658,7 @@ var WorkspaceDiscovery = class WorkspaceDiscovery extends Context.Service()("@ef
|
|
|
17064
17658
|
const isStringRecord$2 = (value) => value !== null && typeof value === "object" && !Array.isArray(value) && Object.values(value).every((entry) => typeof entry === "string");
|
|
17065
17659
|
|
|
17066
17660
|
//#endregion
|
|
17067
|
-
//#region ../../node_modules/.pnpm/@effected+workspaces@0.
|
|
17661
|
+
//#region ../../node_modules/.pnpm/@effected+workspaces@0.5.2_@effected+jsonc@0.5.0_effect@4.0.0-beta.99__effect@4.0.0-beta.99/node_modules/@effected/workspaces/DependencyGraph.js
|
|
17068
17662
|
/**
|
|
17069
17663
|
* Raised when the workspace dependency graph cannot be topologically ordered
|
|
17070
17664
|
* because it contains a cycle.
|
|
@@ -18666,7 +19260,7 @@ var Git = class extends Context.Service()("@effected/git/Git") {
|
|
|
18666
19260
|
};
|
|
18667
19261
|
|
|
18668
19262
|
//#endregion
|
|
18669
|
-
//#region ../../node_modules/.pnpm/@effected+workspaces@0.
|
|
19263
|
+
//#region ../../node_modules/.pnpm/@effected+workspaces@0.5.2_@effected+jsonc@0.5.0_effect@4.0.0-beta.99__effect@4.0.0-beta.99/node_modules/@effected/workspaces/ChangeDetector.js
|
|
18670
19264
|
/**
|
|
18671
19265
|
* Which git refs to compare, and whether to fold in the working tree.
|
|
18672
19266
|
*
|
|
@@ -18948,7 +19542,7 @@ function resolveFromCatalog(catalogs, wantedDependency) {
|
|
|
18948
19542
|
}
|
|
18949
19543
|
|
|
18950
19544
|
//#endregion
|
|
18951
|
-
//#region ../../node_modules/.pnpm/@effected+workspaces@0.
|
|
19545
|
+
//#region ../../node_modules/.pnpm/@effected+workspaces@0.5.2_@effected+jsonc@0.5.0_effect@4.0.0-beta.99__effect@4.0.0-beta.99/node_modules/@effected/workspaces/internal/catalogs.js
|
|
18952
19546
|
/** Project a pnpm-workspace manifest's `catalog` / `catalogs` fields into a `Catalogs` map. */
|
|
18953
19547
|
const inlineCatalogs = (manifest) => {
|
|
18954
19548
|
if (manifest.catalog === void 0 && manifest.catalogs === void 0) return {};
|
|
@@ -19013,7 +19607,7 @@ const rangeOf = (catalogs, dependency, specifier) => {
|
|
|
19013
19607
|
};
|
|
19014
19608
|
|
|
19015
19609
|
//#endregion
|
|
19016
|
-
//#region ../../node_modules/.pnpm/@effected+workspaces@0.
|
|
19610
|
+
//#region ../../node_modules/.pnpm/@effected+workspaces@0.5.2_@effected+jsonc@0.5.0_effect@4.0.0-beta.99__effect@4.0.0-beta.99/node_modules/@effected/workspaces/ConfigDependencyHooks.js
|
|
19017
19611
|
/** Whether `value` is a non-null, non-array object. */
|
|
19018
19612
|
const isObject$2 = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
19019
19613
|
/**
|
|
@@ -19107,9 +19701,13 @@ var ConfigDependencyHooks = class ConfigDependencyHooks extends Context.Service(
|
|
|
19107
19701
|
* `hooks`-source `CatalogAssemblyError`, never a silent skip.
|
|
19108
19702
|
*
|
|
19109
19703
|
* @remarks
|
|
19110
|
-
*
|
|
19111
|
-
*
|
|
19112
|
-
*
|
|
19704
|
+
* Runtime-coupled by design, not node-exclusive. The `import()` below loads
|
|
19705
|
+
* **and executes** a config dependency's pnpmfile in-process — code execution,
|
|
19706
|
+
* not IO, so no `FileSystem` / `Path` service abstracts it. The `node:path` and
|
|
19707
|
+
* `node:url` imports (`join`, `pathToFileURL`) exist only to build the URL that
|
|
19708
|
+
* `import()` consumes; node and bun both implement those builtins and dynamic
|
|
19709
|
+
* import, so this layer runs on either runtime. Only ever wired by
|
|
19710
|
+
* `WorkspaceCatalogs.layerWithConfigDependencies`.
|
|
19113
19711
|
*/
|
|
19114
19712
|
static layerLive = Layer.succeed(ConfigDependencyHooks, { inject: (root, configDependencies, seed) => Effect.gen(function* () {
|
|
19115
19713
|
const names = Object.keys(configDependencies);
|
|
@@ -19159,7 +19757,7 @@ var ConfigDependencyHooks = class ConfigDependencyHooks extends Context.Service(
|
|
|
19159
19757
|
};
|
|
19160
19758
|
|
|
19161
19759
|
//#endregion
|
|
19162
|
-
//#region ../../node_modules/.pnpm/@effected+workspaces@0.
|
|
19760
|
+
//#region ../../node_modules/.pnpm/@effected+workspaces@0.5.2_@effected+jsonc@0.5.0_effect@4.0.0-beta.99__effect@4.0.0-beta.99/node_modules/@effected/workspaces/PackageManagerName.js
|
|
19163
19761
|
/**
|
|
19164
19762
|
* The four package managers this package understands.
|
|
19165
19763
|
*
|
|
@@ -19402,7 +20000,7 @@ var PackageManagerDetector = class PackageManagerDetector extends Context.Servic
|
|
|
19402
20000
|
};
|
|
19403
20001
|
|
|
19404
20002
|
//#endregion
|
|
19405
|
-
//#region ../../node_modules/.pnpm/@effected+workspaces@0.
|
|
20003
|
+
//#region ../../node_modules/.pnpm/@effected+workspaces@0.5.2_@effected+jsonc@0.5.0_effect@4.0.0-beta.99__effect@4.0.0-beta.99/node_modules/@effected/workspaces/LockfileReader.js
|
|
19406
20004
|
/**
|
|
19407
20005
|
* Raised when the workspace's lockfile cannot be read off disk.
|
|
19408
20006
|
*
|
|
@@ -19513,7 +20111,7 @@ var LockfileReader = class LockfileReader extends Context.Service()("@effected/w
|
|
|
19513
20111
|
};
|
|
19514
20112
|
|
|
19515
20113
|
//#endregion
|
|
19516
|
-
//#region ../../node_modules/.pnpm/@effected+workspaces@0.
|
|
20114
|
+
//#region ../../node_modules/.pnpm/@effected+workspaces@0.5.2_@effected+jsonc@0.5.0_effect@4.0.0-beta.99__effect@4.0.0-beta.99/node_modules/@effected/workspaces/Publishability.js
|
|
19517
20115
|
/** The public npm registry, used when `publishConfig.registry` says nothing. */
|
|
19518
20116
|
const DEFAULT_REGISTRY = "https://registry.npmjs.org/";
|
|
19519
20117
|
/**
|
|
@@ -19614,7 +20212,7 @@ var PublishabilityDetector = class PublishabilityDetector extends Context.Servic
|
|
|
19614
20212
|
};
|
|
19615
20213
|
|
|
19616
20214
|
//#endregion
|
|
19617
|
-
//#region ../../node_modules/.pnpm/@effected+workspaces@0.
|
|
20215
|
+
//#region ../../node_modules/.pnpm/@effected+workspaces@0.5.2_@effected+jsonc@0.5.0_effect@4.0.0-beta.99__effect@4.0.0-beta.99/node_modules/@effected/workspaces/WorkspaceCatalogs.js
|
|
19618
20216
|
/**
|
|
19619
20217
|
* An immutable, fully-normalized catalog collection — the one catalog
|
|
19620
20218
|
* resolution semantic in the package.
|
|
@@ -19999,7 +20597,7 @@ var WorkspaceCatalogs = class WorkspaceCatalogs extends Context.Service()("@effe
|
|
|
19999
20597
|
};
|
|
20000
20598
|
|
|
20001
20599
|
//#endregion
|
|
20002
|
-
//#region ../../node_modules/.pnpm/@effected+workspaces@0.
|
|
20600
|
+
//#region ../../node_modules/.pnpm/@effected+workspaces@0.5.2_@effected+jsonc@0.5.0_effect@4.0.0-beta.99__effect@4.0.0-beta.99/node_modules/@effected/workspaces/WorkspaceStateSnapshot.js
|
|
20003
20601
|
const EMPTY = Object.freeze(Object.create(null));
|
|
20004
20602
|
const DependencyMap = Schema.Record(Schema.String, Schema.String).pipe(Schema.withDecodingDefaultKey(Effect.succeed(EMPTY)), Schema.withConstructorDefault(Effect.succeed(EMPTY)));
|
|
20005
20603
|
/**
|
|
@@ -20165,7 +20763,7 @@ var WorkspaceStateSnapshot = class extends Schema.Class("WorkspaceStateSnapshot"
|
|
|
20165
20763
|
};
|
|
20166
20764
|
|
|
20167
20765
|
//#endregion
|
|
20168
|
-
//#region ../../node_modules/.pnpm/@effected+workspaces@0.
|
|
20766
|
+
//#region ../../node_modules/.pnpm/@effected+workspaces@0.5.2_@effected+jsonc@0.5.0_effect@4.0.0-beta.99__effect@4.0.0-beta.99/node_modules/@effected/workspaces/WorkspaceSnapshots.js
|
|
20169
20767
|
/** Whether `value` is a non-null, non-array object. */
|
|
20170
20768
|
const isObject = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
20171
20769
|
/** Whether every value in a record is a string — a usable dependency map. */
|
|
@@ -20358,7 +20956,7 @@ var WorkspaceSnapshots = class WorkspaceSnapshots extends Context.Service()("@ef
|
|
|
20358
20956
|
};
|
|
20359
20957
|
|
|
20360
20958
|
//#endregion
|
|
20361
|
-
//#region ../../node_modules/.pnpm/@effected+workspaces@0.
|
|
20959
|
+
//#region ../../node_modules/.pnpm/@effected+workspaces@0.5.2_@effected+jsonc@0.5.0_effect@4.0.0-beta.99__effect@4.0.0-beta.99/node_modules/@effected/workspaces/Workspaces.js
|
|
20362
20960
|
/**
|
|
20363
20961
|
* Every service that needs only a filesystem: root, package-manager detection,
|
|
20364
20962
|
* discovery, lockfile reading, catalogs and publishability.
|
|
@@ -20736,34 +21334,15 @@ const SilkPublishabilityDetectorLive = Layer.effect(PublishabilityDetector, Effe
|
|
|
20736
21334
|
}) };
|
|
20737
21335
|
}));
|
|
20738
21336
|
/**
|
|
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
21337
|
* Ignore-aware override of `PublishabilityDetector`. `detect` short-circuits to `[]`
|
|
20759
21338
|
* for changeset-ignored packages, then dispatches on `ChangesetConfig.mode`:
|
|
20760
21339
|
* `none` → `[]`; `silk` → `SilkPublishability.detect`; `vanilla` → the library default.
|
|
20761
21340
|
*
|
|
20762
21341
|
* @remarks Requires `FileSystem` and {@link ChangesetConfig} at build.
|
|
20763
21342
|
* The kit's `detect` contract no longer receives the workspace root, so the changeset
|
|
20764
|
-
* lookups
|
|
20765
|
-
*
|
|
20766
|
-
*
|
|
21343
|
+
* lookups read it from `pkg.workspaceRoot` — the discovery root the package was found
|
|
21344
|
+
* against, never a filesystem marker walk, which could escape an unmarked root and read
|
|
21345
|
+
* the wrong `.changeset/config.json`.
|
|
20767
21346
|
*
|
|
20768
21347
|
* @since 0.4.0
|
|
20769
21348
|
* @public
|
|
@@ -20773,7 +21352,7 @@ const PublishabilityDetectorAdaptiveLive = Layer.effect(PublishabilityDetector,
|
|
|
20773
21352
|
const config = yield* ChangesetConfig;
|
|
20774
21353
|
const vanilla = yield* Effect.provide(PublishabilityDetector, PublishabilityDetector.layer);
|
|
20775
21354
|
return { detect: (pkg) => Effect.gen(function* () {
|
|
20776
|
-
const root =
|
|
21355
|
+
const root = pkg.workspaceRoot;
|
|
20777
21356
|
if (yield* config.isIgnored(pkg.name, root)) return [];
|
|
20778
21357
|
const mode = yield* config.mode(root);
|
|
20779
21358
|
if (mode === "none") return [];
|
|
@@ -45570,25 +46149,15 @@ function normalizeLegacyOptions(options, configPath) {
|
|
|
45570
46149
|
};
|
|
45571
46150
|
}
|
|
45572
46151
|
/** Match dotfiles, mirroring the former tinyglobby `dot: true` behavior. */
|
|
45573
|
-
const GLOB_OPTIONS = GlobPatternOptions.make({ dot: true });
|
|
46152
|
+
const GLOB_OPTIONS$1 = GlobPatternOptions.make({ dot: true });
|
|
45574
46153
|
/**
|
|
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
46154
|
/**
|
|
45586
46155
|
* Pure attribution helper: does `glob` (under this service's `dot: true`
|
|
45587
46156
|
* semantics) match the repo-relative POSIX path `rel`? An uncompilable
|
|
45588
46157
|
* pattern matches nothing.
|
|
45589
46158
|
*/
|
|
45590
46159
|
function globMatchesRel(glob, rel) {
|
|
45591
|
-
const result =
|
|
46160
|
+
const result = GlobPattern.compileResult(glob, GLOB_OPTIONS$1);
|
|
45592
46161
|
return Result.isSuccess(result) && result.success.matches(rel);
|
|
45593
46162
|
}
|
|
45594
46163
|
/**
|
|
@@ -45604,13 +46173,14 @@ function globMatchesRel(glob, rel) {
|
|
|
45604
46173
|
* module already speaks POSIX-relative match paths).
|
|
45605
46174
|
*/
|
|
45606
46175
|
function materializeGlob(glob, cwd) {
|
|
45607
|
-
return
|
|
46176
|
+
return compileAndExpand(glob, {
|
|
45608
46177
|
cwd,
|
|
45609
|
-
onUnreadable: "skip"
|
|
46178
|
+
onUnreadable: "skip",
|
|
46179
|
+
glob: GLOB_OPTIONS$1
|
|
45610
46180
|
}).pipe(Effect.mapError((error) => new ConfigurationError({
|
|
45611
46181
|
field: "glob",
|
|
45612
|
-
reason: `Failed to materialize glob ${JSON.stringify(glob)}: ${error.message}`
|
|
45613
|
-
})), Effect.provide(Path.layer))
|
|
46182
|
+
reason: error.stage === "compile" ? `Invalid glob pattern ${JSON.stringify(glob)}: ${error.cause.message}` : `Failed to materialize glob ${JSON.stringify(glob)}: ${error.cause.message}`
|
|
46183
|
+
})), Effect.provide(Path.layer));
|
|
45614
46184
|
}
|
|
45615
46185
|
/**
|
|
45616
46186
|
* Determine whether `child` is the same directory as `parent` or sits inside
|
|
@@ -47321,19 +47891,29 @@ var VersionFiles = class VersionFiles {
|
|
|
47321
47891
|
}
|
|
47322
47892
|
};
|
|
47323
47893
|
/**
|
|
47894
|
+
* Match dotfiles, matching `ConfigInspector`'s glob dialect.
|
|
47895
|
+
*
|
|
47896
|
+
* @remarks
|
|
47897
|
+
* This module previously compiled with minimatch DEFAULTS while
|
|
47898
|
+
* `ConfigInspector` compiled with `dot: true`, so a wildcard segment matching
|
|
47899
|
+
* a dotted directory was attributed to a package but never materialized (or
|
|
47900
|
+
* the reverse). The two paths must agree: attribution and materialization
|
|
47901
|
+
* answer the same question about the same glob.
|
|
47902
|
+
*/
|
|
47903
|
+
const GLOB_OPTIONS = GlobPatternOptions.make({ dot: true });
|
|
47904
|
+
/**
|
|
47324
47905
|
* Expand a glob pattern against the filesystem, returning matching FILE paths
|
|
47325
47906
|
* relative to `cwd` (POSIX separators), sorted by relative path.
|
|
47326
47907
|
*
|
|
47327
47908
|
* @remarks
|
|
47328
|
-
* The walk is `@effected/walker`'s `
|
|
47909
|
+
* The walk is `@effected/walker`'s `compileAndExpand` (literal fast path,
|
|
47329
47910
|
* `enumerationPrefix` bounding, `node_modules`/`.git` pruning), with
|
|
47330
47911
|
* `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.
|
|
47912
|
+
* unreadable directories. Matching semantics are {@link GLOB_OPTIONS} —
|
|
47913
|
+
* wildcards DO match dotfiles, aligning this module with `ConfigInspector`. An
|
|
47914
|
+
* uncompilable pattern expands to no matches. The `Path` requirement is
|
|
47915
|
+
* satisfied internally with the core POSIX `Path.layer` — this module already
|
|
47916
|
+
* speaks POSIX relative match paths and node-bound absolute paths throughout.
|
|
47337
47917
|
*
|
|
47338
47918
|
* @param source - The glob pattern, repo-relative
|
|
47339
47919
|
* @param cwd - Absolute directory the pattern is resolved against
|
|
@@ -47342,13 +47922,11 @@ var VersionFiles = class VersionFiles {
|
|
|
47342
47922
|
* @internal
|
|
47343
47923
|
*/
|
|
47344
47924
|
function expandGlob(source, cwd) {
|
|
47345
|
-
return
|
|
47346
|
-
|
|
47347
|
-
|
|
47348
|
-
|
|
47349
|
-
|
|
47350
|
-
})
|
|
47351
|
-
})), Effect.provide(Path.layer));
|
|
47925
|
+
return compileAndExpand(source, {
|
|
47926
|
+
cwd,
|
|
47927
|
+
onUnreadable: "skip",
|
|
47928
|
+
glob: GLOB_OPTIONS
|
|
47929
|
+
}).pipe(Effect.catch((error) => error.stage === "compile" ? Effect.succeed([]) : Effect.fail(error)), Effect.provide(Path.layer));
|
|
47352
47930
|
}
|
|
47353
47931
|
/**
|
|
47354
47932
|
* Read the `version` field from a `package.json` in the given directory.
|