@savvy-web/silk 3.0.4 → 3.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/changesets-changelog.cjs +1073 -257
- package/changesets-changelog.d.cts +596 -37
- package/changesets-changelog.d.ts +596 -37
- package/changesets-changelog.js +1091 -261
- package/changesets-markdownlint.cjs +1073 -257
- package/changesets-markdownlint.d.cts +596 -37
- package/changesets-markdownlint.d.ts +596 -37
- package/changesets-markdownlint.js +1091 -261
- package/package.json +6 -6
- package/tsconfig/node/dist/tsconfig.tsbuildinfo +1 -1
package/changesets-changelog.cjs
CHANGED
|
@@ -419,7 +419,7 @@ const trimTrailingSlashes = (s) => {
|
|
|
419
419
|
return s.slice(0, end);
|
|
420
420
|
};
|
|
421
421
|
//#endregion
|
|
422
|
-
//#region ../../node_modules/.pnpm/@effected+glob@0.
|
|
422
|
+
//#region ../../node_modules/.pnpm/@effected+glob@0.2.0_effect@4.0.0-beta.99/node_modules/@effected/glob/internal/limits.js
|
|
423
423
|
/** Hard cap on pattern length. Upstream minimatch's MAX_PATTERN_LENGTH (64KB). */
|
|
424
424
|
const MAX_PATTERN_LENGTH = 1024 * 64;
|
|
425
425
|
/** Default brace-expansion output budget. Upstream brace-expansion's EXPANSION_MAX. */
|
|
@@ -453,7 +453,7 @@ const assertCap = (name, value) => {
|
|
|
453
453
|
return value;
|
|
454
454
|
};
|
|
455
455
|
//#endregion
|
|
456
|
-
//#region ../../node_modules/.pnpm/@effected+glob@0.
|
|
456
|
+
//#region ../../node_modules/.pnpm/@effected+glob@0.2.0_effect@4.0.0-beta.99/node_modules/@effected/glob/internal/unescape.js
|
|
457
457
|
/**
|
|
458
458
|
* Un-escape a string that has been escaped with `escape`.
|
|
459
459
|
*
|
|
@@ -476,11 +476,11 @@ const unescapePattern = (s, { windowsPathsNoEscape = false, magicalBraces = true
|
|
|
476
476
|
return windowsPathsNoEscape ? s.replace(/\[([^/\\{}])\]/g, "$1") : s.replace(/((?!\\).|^)\[([^/\\{}])\]/g, "$1$2").replace(/\\([^/{}])/g, "$1");
|
|
477
477
|
};
|
|
478
478
|
//#endregion
|
|
479
|
-
//#region ../../node_modules/.pnpm/@effected+glob@0.
|
|
479
|
+
//#region ../../node_modules/.pnpm/@effected+glob@0.2.0_effect@4.0.0-beta.99/node_modules/@effected/glob/internal/types.js
|
|
480
480
|
/** The globstar marker in a compiled pattern set. */
|
|
481
481
|
const GLOBSTAR = Symbol("globstar **");
|
|
482
482
|
//#endregion
|
|
483
|
-
//#region ../../node_modules/.pnpm/@effected+glob@0.
|
|
483
|
+
//#region ../../node_modules/.pnpm/@effected+glob@0.2.0_effect@4.0.0-beta.99/node_modules/@effected/glob/internal/escape.js
|
|
484
484
|
/**
|
|
485
485
|
* Escape all magic characters in a glob pattern.
|
|
486
486
|
*
|
|
@@ -498,13 +498,13 @@ const escapePattern = (s, { windowsPathsNoEscape = false, magicalBraces = false
|
|
|
498
498
|
return windowsPathsNoEscape ? s.replace(/[?*()[\]]/g, "[$&]") : s.replace(/[?*()[\]\\]/g, "\\$&");
|
|
499
499
|
};
|
|
500
500
|
//#endregion
|
|
501
|
-
//#region ../../node_modules/.pnpm/@effected+glob@0.
|
|
501
|
+
//#region ../../node_modules/.pnpm/@effected+glob@0.2.0_effect@4.0.0-beta.99/node_modules/@effected/glob/internal/assertValidPattern.js
|
|
502
502
|
const assertValidPattern = (pattern) => {
|
|
503
503
|
if (typeof pattern !== "string") throw new TypeError("invalid pattern");
|
|
504
504
|
if (pattern.length > 65536) throw new GuardExceeded("PatternTooLong", MAX_PATTERN_LENGTH, pattern.length);
|
|
505
505
|
};
|
|
506
506
|
//#endregion
|
|
507
|
-
//#region ../../node_modules/.pnpm/@effected+glob@0.
|
|
507
|
+
//#region ../../node_modules/.pnpm/@effected+glob@0.2.0_effect@4.0.0-beta.99/node_modules/@effected/glob/internal/braceExpressions.js
|
|
508
508
|
const posixClasses = {
|
|
509
509
|
"[:alnum:]": ["\\p{L}\\p{Nl}\\p{Nd}", true],
|
|
510
510
|
"[:alpha:]": ["\\p{L}\\p{Nl}", true],
|
|
@@ -627,7 +627,7 @@ const parseClass = (glob, position) => {
|
|
|
627
627
|
];
|
|
628
628
|
};
|
|
629
629
|
//#endregion
|
|
630
|
-
//#region ../../node_modules/.pnpm/@effected+glob@0.
|
|
630
|
+
//#region ../../node_modules/.pnpm/@effected+glob@0.2.0_effect@4.0.0-beta.99/node_modules/@effected/glob/internal/ast.js
|
|
631
631
|
const types = /* @__PURE__ */ new Set([
|
|
632
632
|
"!",
|
|
633
633
|
"?",
|
|
@@ -1144,7 +1144,7 @@ var AST = class AST {
|
|
|
1144
1144
|
}
|
|
1145
1145
|
};
|
|
1146
1146
|
//#endregion
|
|
1147
|
-
//#region ../../node_modules/.pnpm/@effected+glob@0.
|
|
1147
|
+
//#region ../../node_modules/.pnpm/@effected+glob@0.2.0_effect@4.0.0-beta.99/node_modules/@effected/glob/internal/balancedMatch.js
|
|
1148
1148
|
const maybeMatch = (reg, str) => {
|
|
1149
1149
|
const m = str.match(reg);
|
|
1150
1150
|
return m ? m[0] : null;
|
|
@@ -1202,7 +1202,7 @@ const range = (a, b, str) => {
|
|
|
1202
1202
|
return result;
|
|
1203
1203
|
};
|
|
1204
1204
|
//#endregion
|
|
1205
|
-
//#region ../../node_modules/.pnpm/@effected+glob@0.
|
|
1205
|
+
//#region ../../node_modules/.pnpm/@effected+glob@0.2.0_effect@4.0.0-beta.99/node_modules/@effected/glob/internal/braceExpansion.js
|
|
1206
1206
|
const escSlash = `\0SLASH${Math.random()}\0`;
|
|
1207
1207
|
const escOpen = `\0OPEN${Math.random()}\0`;
|
|
1208
1208
|
const escClose = `\0CLOSE${Math.random()}\0`;
|
|
@@ -1349,7 +1349,7 @@ function expand_(str, max, isTopInput, depth) {
|
|
|
1349
1349
|
}
|
|
1350
1350
|
}
|
|
1351
1351
|
//#endregion
|
|
1352
|
-
//#region ../../node_modules/.pnpm/@effected+glob@0.
|
|
1352
|
+
//#region ../../node_modules/.pnpm/@effected+glob@0.2.0_effect@4.0.0-beta.99/node_modules/@effected/glob/internal/minimatch.js
|
|
1353
1353
|
const starDotExtRE = /^\*+([^+@!?*[(]*)$/;
|
|
1354
1354
|
const starDotExtTest = (ext) => (f) => !f.startsWith(".") && f.endsWith(ext);
|
|
1355
1355
|
const starDotExtTestDot = (ext) => (f) => f.endsWith(ext);
|
|
@@ -1920,7 +1920,7 @@ var Minimatch = class {
|
|
|
1920
1920
|
}
|
|
1921
1921
|
};
|
|
1922
1922
|
//#endregion
|
|
1923
|
-
//#region ../../node_modules/.pnpm/@effected+glob@0.
|
|
1923
|
+
//#region ../../node_modules/.pnpm/@effected+glob@0.2.0_effect@4.0.0-beta.99/node_modules/@effected/glob/GlobPattern.js
|
|
1924
1924
|
/**
|
|
1925
1925
|
* Typed failure raised when a glob pattern trips a compile-time guard:
|
|
1926
1926
|
* over-length, brace-expansion budget exhaustion, or nesting past the depth
|
|
@@ -2049,17 +2049,30 @@ var GlobPattern = class GlobPattern extends effect.Schema.Class("GlobPattern")(e
|
|
|
2049
2049
|
return this.#engine;
|
|
2050
2050
|
}
|
|
2051
2051
|
/**
|
|
2052
|
-
* Compile a pattern under the given options — the package's
|
|
2053
|
-
* boundary
|
|
2054
|
-
*
|
|
2055
|
-
*
|
|
2052
|
+
* Compile a pattern under the given options, synchronously — the package's
|
|
2053
|
+
* fallible boundary in its primitive form. Compilation is pure
|
|
2054
|
+
* string→predicate work with no IO, no services and no async step, so the
|
|
2055
|
+
* sync form is the real primitive and {@link GlobPattern.compile} is
|
|
2056
|
+
* derived from it.
|
|
2057
|
+
*
|
|
2058
|
+
* Total: never throws for pattern input. Guard trips (over-length,
|
|
2059
|
+
* expansion budget, nesting depth) come back as a `Result` failure holding
|
|
2060
|
+
* {@link GlobPatternError}; invalid *options* never reach here (they throw
|
|
2061
|
+
* at `GlobPatternOptions.make`, a wiring defect).
|
|
2056
2062
|
*
|
|
2057
2063
|
* The pattern must also compile under DEFAULT options, whatever the
|
|
2058
2064
|
* effective options are — permissive options (say `nobrace` over a brace
|
|
2059
2065
|
* bomb) do not admit a defaults-rejected pattern; the same typed error
|
|
2060
2066
|
* surfaces instead.
|
|
2067
|
+
*
|
|
2068
|
+
* @remarks
|
|
2069
|
+
* For synchronous call sites that cannot host an Effect — a lint-staged
|
|
2070
|
+
* handler, a config predicate — this removes the
|
|
2071
|
+
* `Effect.runSync(Effect.result(...))` escape hatch: pair it with
|
|
2072
|
+
* `Result.isSuccess` and read `.success` directly. Effect call sites should
|
|
2073
|
+
* prefer {@link GlobPattern.compile}, which carries the tracing span.
|
|
2061
2074
|
*/
|
|
2062
|
-
static
|
|
2075
|
+
static compileResult(source, options) {
|
|
2063
2076
|
const engineOptions = toEngineOptions(options);
|
|
2064
2077
|
try {
|
|
2065
2078
|
new Minimatch(source, {});
|
|
@@ -2067,16 +2080,30 @@ var GlobPattern = class GlobPattern extends effect.Schema.Class("GlobPattern")(e
|
|
|
2067
2080
|
const pattern = new GlobPattern({ source });
|
|
2068
2081
|
pattern.#engine = engine;
|
|
2069
2082
|
pattern.#engineOptions = engineOptions;
|
|
2070
|
-
return pattern;
|
|
2083
|
+
return effect.Result.succeed(pattern);
|
|
2071
2084
|
} catch (e) {
|
|
2072
|
-
if (isGuardExceeded(e)) return
|
|
2085
|
+
if (isGuardExceeded(e)) return effect.Result.fail(new GlobPatternError({
|
|
2073
2086
|
pattern: source,
|
|
2074
2087
|
reason: e.reason,
|
|
2075
2088
|
limit: e.limit,
|
|
2076
2089
|
actual: e.actual
|
|
2077
|
-
});
|
|
2090
|
+
}));
|
|
2078
2091
|
throw e;
|
|
2079
2092
|
}
|
|
2093
|
+
}
|
|
2094
|
+
/**
|
|
2095
|
+
* Compile a pattern under the given options — the package's fallible
|
|
2096
|
+
* boundary, and the form Effect call sites should reach for. Guard trips
|
|
2097
|
+
* (over-length, expansion budget, nesting depth) fail typed with
|
|
2098
|
+
* {@link GlobPatternError}; invalid options never reach here (they throw at
|
|
2099
|
+
* `GlobPatternOptions.make`, a wiring defect).
|
|
2100
|
+
*
|
|
2101
|
+
* Defined in terms of {@link GlobPattern.compileResult} — synchronous
|
|
2102
|
+
* callers can use that variant directly. Same semantics, same errors; this
|
|
2103
|
+
* form adds only the `GlobPattern.compile` tracing span.
|
|
2104
|
+
*/
|
|
2105
|
+
static compile = effect.Effect.fn("GlobPattern.compile")(function* (source, options) {
|
|
2106
|
+
return yield* effect.Effect.fromResult(GlobPattern.compileResult(source, options));
|
|
2080
2107
|
});
|
|
2081
2108
|
/**
|
|
2082
2109
|
* Whether `candidate` matches this pattern. Total: never throws, never
|
|
@@ -2172,7 +2199,7 @@ var GlobPattern = class GlobPattern extends effect.Schema.Class("GlobPattern")(e
|
|
|
2172
2199
|
})));
|
|
2173
2200
|
};
|
|
2174
2201
|
//#endregion
|
|
2175
|
-
//#region ../../node_modules/.pnpm/@effected+glob@0.
|
|
2202
|
+
//#region ../../node_modules/.pnpm/@effected+glob@0.2.0_effect@4.0.0-beta.99/node_modules/@effected/glob/GlobSet.js
|
|
2176
2203
|
const exclusionTarget = (pattern) => pattern.startsWith("!") ? pattern.slice(1) : void 0;
|
|
2177
2204
|
const allCompileUnderDefaults = (patterns) => {
|
|
2178
2205
|
for (const pattern of patterns) {
|
|
@@ -2247,27 +2274,53 @@ var GlobSet = class GlobSet extends effect.Schema.Class("GlobSet")(effect.Schema
|
|
|
2247
2274
|
return this.#literalSet;
|
|
2248
2275
|
}
|
|
2249
2276
|
/**
|
|
2250
|
-
* Compile a pattern set —
|
|
2251
|
-
*
|
|
2252
|
-
*
|
|
2253
|
-
*
|
|
2277
|
+
* Compile a pattern set, synchronously — the primitive form, mirroring
|
|
2278
|
+
* {@link GlobPattern.compileResult}. Set compilation is pure
|
|
2279
|
+
* string→predicate work with no IO and no async step, so the sync form is
|
|
2280
|
+
* the real primitive and {@link GlobSet.compile} is derived from it.
|
|
2281
|
+
*
|
|
2282
|
+
* Total: never throws for pattern input. Fails on the FIRST uncompilable
|
|
2283
|
+
* member, coming back as a `Result` failure whose {@link GlobPatternError}
|
|
2284
|
+
* names the offending source pattern in `pattern` (bang included for
|
|
2285
|
+
* exclusions).
|
|
2286
|
+
*
|
|
2287
|
+
* @remarks
|
|
2288
|
+
* For synchronous call sites that cannot host an Effect — a lint-staged
|
|
2289
|
+
* handler, a config predicate — this removes the
|
|
2290
|
+
* `Effect.runSync(Effect.result(...))` escape hatch: pair it with
|
|
2291
|
+
* `Result.isSuccess` and read `.success` directly. Effect call sites should
|
|
2292
|
+
* prefer {@link GlobSet.compile}, which carries the tracing span.
|
|
2254
2293
|
*/
|
|
2255
|
-
static
|
|
2294
|
+
static compileResult(patterns) {
|
|
2256
2295
|
for (const pattern of patterns) {
|
|
2257
2296
|
const target = exclusionTarget(pattern) ?? pattern;
|
|
2258
2297
|
try {
|
|
2259
2298
|
new Minimatch(target, {});
|
|
2260
2299
|
} catch (e) {
|
|
2261
|
-
if (isGuardExceeded(e)) return
|
|
2300
|
+
if (isGuardExceeded(e)) return effect.Result.fail(new GlobPatternError({
|
|
2262
2301
|
pattern,
|
|
2263
2302
|
reason: e.reason,
|
|
2264
2303
|
limit: e.limit,
|
|
2265
2304
|
actual: e.actual
|
|
2266
|
-
});
|
|
2305
|
+
}));
|
|
2267
2306
|
throw e;
|
|
2268
2307
|
}
|
|
2269
2308
|
}
|
|
2270
|
-
return new GlobSet({ patterns });
|
|
2309
|
+
return effect.Result.succeed(new GlobSet({ patterns }));
|
|
2310
|
+
}
|
|
2311
|
+
/**
|
|
2312
|
+
* Compile a pattern set — with {@link GlobPattern.compile}, the package's
|
|
2313
|
+
* only other fallible boundary, and the form Effect call sites should reach
|
|
2314
|
+
* for. Fails typed on the FIRST uncompilable member, with the error's
|
|
2315
|
+
* `pattern` field naming the offending source pattern (bang included for
|
|
2316
|
+
* exclusions).
|
|
2317
|
+
*
|
|
2318
|
+
* Defined in terms of {@link GlobSet.compileResult} — synchronous callers
|
|
2319
|
+
* can use that variant directly. Same semantics, same errors; this form
|
|
2320
|
+
* adds only the `GlobSet.compile` tracing span.
|
|
2321
|
+
*/
|
|
2322
|
+
static compile = effect.Effect.fn("GlobSet.compile")(function* (patterns) {
|
|
2323
|
+
return yield* effect.Effect.fromResult(GlobSet.compileResult(patterns));
|
|
2271
2324
|
});
|
|
2272
2325
|
/**
|
|
2273
2326
|
* Whether `candidate` matches the set: some include accepts it (literal
|
|
@@ -2300,7 +2353,7 @@ var GlobSet = class GlobSet extends effect.Schema.Class("GlobSet")(effect.Schema
|
|
|
2300
2353
|
}
|
|
2301
2354
|
};
|
|
2302
2355
|
//#endregion
|
|
2303
|
-
//#region ../../node_modules/.pnpm/@effected+lockfiles@0.1.
|
|
2356
|
+
//#region ../../node_modules/.pnpm/@effected+lockfiles@0.1.9_@effected+jsonc@0.5.0_effect@4.0.0-beta.99__@effected+npm@0.3_d470055e7ca4b6a23d413cae592e2835/node_modules/@effected/lockfiles/BunExtension.js
|
|
2304
2357
|
/**
|
|
2305
2358
|
* Extension data specific to bun lockfiles, attached to `Lockfile.extension`
|
|
2306
2359
|
* when the format is `"bun"`.
|
|
@@ -2321,7 +2374,7 @@ var BunExtension = class extends effect.Schema.Class("BunExtension")({
|
|
|
2321
2374
|
trustedDependencies: effect.Schema.optionalKey(effect.Schema.Array(effect.Schema.String))
|
|
2322
2375
|
}) {};
|
|
2323
2376
|
//#endregion
|
|
2324
|
-
//#region ../../node_modules/.pnpm/@effected+npm@0.
|
|
2377
|
+
//#region ../../node_modules/.pnpm/@effected+npm@0.3.0_@effected+semver@0.2.0_effect@4.0.0-beta.99__effect@4.0.0-beta.99/node_modules/@effected/npm/CatalogResolver.js
|
|
2325
2378
|
/**
|
|
2326
2379
|
* Contract for resolving pnpm `catalog:` dependency specifiers to concrete
|
|
2327
2380
|
* version ranges.
|
|
@@ -2367,7 +2420,7 @@ var CatalogResolver = class CatalogResolver extends effect.Context.Service()("@e
|
|
|
2367
2420
|
static noop = effect.Layer.succeed(CatalogResolver, { rangeOf: () => effect.Effect.succeed(effect.Option.none()) });
|
|
2368
2421
|
};
|
|
2369
2422
|
//#endregion
|
|
2370
|
-
//#region ../../node_modules/.pnpm/@effected+npm@0.
|
|
2423
|
+
//#region ../../node_modules/.pnpm/@effected+npm@0.3.0_@effected+semver@0.2.0_effect@4.0.0-beta.99__effect@4.0.0-beta.99/node_modules/@effected/npm/WorkspaceResolver.js
|
|
2371
2424
|
/**
|
|
2372
2425
|
* Raised when a `catalog:` or `workspace:` specifier cannot be resolved
|
|
2373
2426
|
* because the resolution mechanism itself failed — not for an ordinary
|
|
@@ -2428,7 +2481,7 @@ var WorkspaceResolver = class WorkspaceResolver extends effect.Context.Service()
|
|
|
2428
2481
|
static noop = effect.Layer.succeed(WorkspaceResolver, { versionOf: () => effect.Effect.succeed(effect.Option.none()) });
|
|
2429
2482
|
};
|
|
2430
2483
|
//#endregion
|
|
2431
|
-
//#region ../../node_modules/.pnpm/@effected+npm@0.
|
|
2484
|
+
//#region ../../node_modules/.pnpm/@effected+npm@0.3.0_@effected+semver@0.2.0_effect@4.0.0-beta.99__effect@4.0.0-beta.99/node_modules/@effected/npm/CatalogAssemblyError.js
|
|
2432
2485
|
/**
|
|
2433
2486
|
* Raised when a workspace's catalogs cannot be assembled — a `pnpm-workspace.yaml`
|
|
2434
2487
|
* that is unreadable or not valid YAML, a root `package.json` `workspaces` field
|
|
@@ -2472,7 +2525,7 @@ var CatalogAssemblyError = class extends effect.Schema.TaggedErrorClass()("Catal
|
|
|
2472
2525
|
}
|
|
2473
2526
|
};
|
|
2474
2527
|
//#endregion
|
|
2475
|
-
//#region ../../node_modules/.pnpm/@effected+npm@0.
|
|
2528
|
+
//#region ../../node_modules/.pnpm/@effected+npm@0.3.0_@effected+semver@0.2.0_effect@4.0.0-beta.99__effect@4.0.0-beta.99/node_modules/@effected/npm/DependencySection.js
|
|
2476
2529
|
/**
|
|
2477
2530
|
* The short dependency kind: which dependency map an entry came from, named the
|
|
2478
2531
|
* way consumers branch on it.
|
|
@@ -2504,7 +2557,7 @@ Object.fromEntries(Object.entries({
|
|
|
2504
2557
|
optional: "optionalDependencies"
|
|
2505
2558
|
}).map(([kind, field]) => [field, kind]));
|
|
2506
2559
|
//#endregion
|
|
2507
|
-
//#region ../../node_modules/.pnpm/@effected+semver@0.
|
|
2560
|
+
//#region ../../node_modules/.pnpm/@effected+semver@0.2.0_effect@4.0.0-beta.99/node_modules/@effected/semver/internal/desugar.js
|
|
2508
2561
|
const sv = (major, minor, patch, prerelease = [], build = []) => ({
|
|
2509
2562
|
major,
|
|
2510
2563
|
minor,
|
|
@@ -2593,7 +2646,7 @@ const desugarHyphen = (lower, upper) => {
|
|
|
2593
2646
|
return [comp(">=", lowerVersion)];
|
|
2594
2647
|
};
|
|
2595
2648
|
//#endregion
|
|
2596
|
-
//#region ../../node_modules/.pnpm/@effected+semver@0.
|
|
2649
|
+
//#region ../../node_modules/.pnpm/@effected+semver@0.2.0_effect@4.0.0-beta.99/node_modules/@effected/semver/internal/grammar.js
|
|
2597
2650
|
/** Private control-flow exception; never escapes the entry points. */
|
|
2598
2651
|
var ParseFailure = class {
|
|
2599
2652
|
position;
|
|
@@ -2988,7 +3041,7 @@ const formatComparator = (c) => {
|
|
|
2988
3041
|
/** Print comparator sets as `a b || c d`. */
|
|
2989
3042
|
const formatRange = (sets) => sets.map((set) => set.map(formatComparator).join(" ")).join(" || ");
|
|
2990
3043
|
//#endregion
|
|
2991
|
-
//#region ../../node_modules/.pnpm/@effected+semver@0.
|
|
3044
|
+
//#region ../../node_modules/.pnpm/@effected+semver@0.2.0_effect@4.0.0-beta.99/node_modules/@effected/semver/internal/order.js
|
|
2992
3045
|
/**
|
|
2993
3046
|
* Compare two prerelease identifiers per SemVer 2.0.0 §11: numeric
|
|
2994
3047
|
* identifiers always have lower precedence than alphanumeric ones; numerics
|
|
@@ -3041,7 +3094,7 @@ const compareBuild = (a, b) => {
|
|
|
3041
3094
|
return 0;
|
|
3042
3095
|
};
|
|
3043
3096
|
//#endregion
|
|
3044
|
-
//#region ../../node_modules/.pnpm/@effected+semver@0.
|
|
3097
|
+
//#region ../../node_modules/.pnpm/@effected+semver@0.2.0_effect@4.0.0-beta.99/node_modules/@effected/semver/SemVer.js
|
|
3045
3098
|
/**
|
|
3046
3099
|
* Indicates that a string could not be parsed as a valid SemVer 2.0.0 version.
|
|
3047
3100
|
*
|
|
@@ -3122,23 +3175,57 @@ var SemVer = class SemVer extends effect.Schema.Class("SemVer")({
|
|
|
3122
3175
|
encode: (parts) => effect.Effect.succeed(formatVersion(parts))
|
|
3123
3176
|
})));
|
|
3124
3177
|
/**
|
|
3125
|
-
* Parse a strict SemVer 2.0.0 version string
|
|
3178
|
+
* Parse a strict SemVer 2.0.0 version string, synchronously, returning a
|
|
3179
|
+
* `Result` instead of an `Effect`.
|
|
3126
3180
|
*
|
|
3127
3181
|
* Rejects `v`/`V` prefixes, `=` prefixes, leading zeros on numeric
|
|
3128
3182
|
* identifiers and partially consumed input.
|
|
3129
3183
|
*
|
|
3184
|
+
* @remarks
|
|
3185
|
+
* {@link SemVer.parse} is defined in terms of this function; the two never
|
|
3186
|
+
* diverge. Reach for the `Effect` variant inside Effect code — it carries
|
|
3187
|
+
* the `SemVer.parse` tracing span — and for this one at synchronous
|
|
3188
|
+
* boundaries.
|
|
3189
|
+
*
|
|
3190
|
+
* @example
|
|
3191
|
+
* ```ts
|
|
3192
|
+
* import { SemVer } from "@effected/semver";
|
|
3193
|
+
* import { Result } from "effect";
|
|
3194
|
+
*
|
|
3195
|
+
* const ok = SemVer.parseResult("1.2.3");
|
|
3196
|
+
* if (Result.isSuccess(ok)) {
|
|
3197
|
+
* console.log(ok.success.major); // => 1
|
|
3198
|
+
* }
|
|
3199
|
+
*
|
|
3200
|
+
* const bad = SemVer.parseResult("v1.2.3");
|
|
3201
|
+
* if (Result.isFailure(bad)) {
|
|
3202
|
+
* console.log(bad.failure._tag); // => "InvalidVersionError"
|
|
3203
|
+
* }
|
|
3204
|
+
* ```
|
|
3205
|
+
*
|
|
3130
3206
|
* @param input - the version string to parse
|
|
3131
|
-
* @returns the parsed {@link SemVer}
|
|
3132
|
-
* when `input` is not a valid version
|
|
3207
|
+
* @returns a `Result` succeeding with the parsed {@link SemVer}, or failing
|
|
3208
|
+
* with {@link InvalidVersionError} when `input` is not a valid version
|
|
3209
|
+
* string.
|
|
3133
3210
|
*/
|
|
3134
|
-
static
|
|
3211
|
+
static parseResult(input) {
|
|
3135
3212
|
const result = parseVersion(input);
|
|
3136
|
-
if (!result.ok) return
|
|
3213
|
+
if (!result.ok) return effect.Result.fail(new InvalidVersionError({
|
|
3137
3214
|
input: result.input,
|
|
3138
3215
|
position: result.position
|
|
3139
|
-
});
|
|
3140
|
-
return SemVer.make(result.value);
|
|
3141
|
-
}
|
|
3216
|
+
}));
|
|
3217
|
+
return effect.Result.succeed(SemVer.make(result.value));
|
|
3218
|
+
}
|
|
3219
|
+
/**
|
|
3220
|
+
* Parse a strict SemVer 2.0.0 version string. Defined in terms of
|
|
3221
|
+
* {@link SemVer.parseResult} — synchronous callers can use that variant
|
|
3222
|
+
* directly.
|
|
3223
|
+
*
|
|
3224
|
+
* @param input - the version string to parse
|
|
3225
|
+
* @returns the parsed {@link SemVer}. Fails with {@link InvalidVersionError}
|
|
3226
|
+
* when `input` is not a valid version string.
|
|
3227
|
+
*/
|
|
3228
|
+
static parse = effect.Effect.fn("SemVer.parse")((input) => effect.Effect.fromResult(SemVer.parseResult(input)));
|
|
3142
3229
|
/**
|
|
3143
3230
|
* Positional convenience constructor: `SemVer.of(1, 2, 3)`.
|
|
3144
3231
|
*
|
|
@@ -3442,7 +3529,7 @@ var SemVerBump = class {
|
|
|
3442
3529
|
}
|
|
3443
3530
|
};
|
|
3444
3531
|
//#endregion
|
|
3445
|
-
//#region ../../node_modules/.pnpm/@effected+semver@0.
|
|
3532
|
+
//#region ../../node_modules/.pnpm/@effected+semver@0.2.0_effect@4.0.0-beta.99/node_modules/@effected/semver/Comparator.js
|
|
3446
3533
|
/**
|
|
3447
3534
|
* Indicates that a string could not be parsed as a single comparator.
|
|
3448
3535
|
*
|
|
@@ -3509,18 +3596,52 @@ var Comparator = class Comparator extends effect.Schema.Class("Comparator")({
|
|
|
3509
3596
|
},
|
|
3510
3597
|
encode: (parts) => effect.Effect.succeed(formatComparator(parts))
|
|
3511
3598
|
})));
|
|
3512
|
-
/**
|
|
3513
|
-
|
|
3599
|
+
/**
|
|
3600
|
+
* Parse a comparator string (e.g. `">=1.2.3"`), synchronously, returning a
|
|
3601
|
+
* `Result` instead of an `Effect`.
|
|
3602
|
+
*
|
|
3603
|
+
* @remarks
|
|
3604
|
+
* {@link Comparator.parse} is defined in terms of this function; the two
|
|
3605
|
+
* never diverge. Reach for the `Effect` variant inside Effect code — it
|
|
3606
|
+
* carries the `Comparator.parse` tracing span — and for this one at
|
|
3607
|
+
* synchronous boundaries.
|
|
3608
|
+
*
|
|
3609
|
+
* @example
|
|
3610
|
+
* ```ts
|
|
3611
|
+
* import { Comparator } from "@effected/semver";
|
|
3612
|
+
* import { Result } from "effect";
|
|
3613
|
+
*
|
|
3614
|
+
* const ok = Comparator.parseResult(">=1.2.3");
|
|
3615
|
+
* if (Result.isSuccess(ok)) {
|
|
3616
|
+
* console.log(ok.success.operator); // => ">="
|
|
3617
|
+
* }
|
|
3618
|
+
* ```
|
|
3619
|
+
*
|
|
3620
|
+
* @param input - the comparator string to parse
|
|
3621
|
+
* @returns a `Result` succeeding with the parsed {@link Comparator}, or
|
|
3622
|
+
* failing with {@link InvalidComparatorError}.
|
|
3623
|
+
*/
|
|
3624
|
+
static parseResult(input) {
|
|
3514
3625
|
const result = parseComparator(input);
|
|
3515
|
-
if (!result.ok) return
|
|
3626
|
+
if (!result.ok) return effect.Result.fail(new InvalidComparatorError({
|
|
3516
3627
|
input: result.input,
|
|
3517
3628
|
position: result.position
|
|
3518
|
-
});
|
|
3519
|
-
return Comparator.make({
|
|
3629
|
+
}));
|
|
3630
|
+
return effect.Result.succeed(Comparator.make({
|
|
3520
3631
|
operator: result.value.operator,
|
|
3521
3632
|
version: SemVer.make(result.value.version)
|
|
3522
|
-
});
|
|
3523
|
-
}
|
|
3633
|
+
}));
|
|
3634
|
+
}
|
|
3635
|
+
/**
|
|
3636
|
+
* Parse a comparator string (e.g. `">=1.2.3"`). Defined in terms of
|
|
3637
|
+
* {@link Comparator.parseResult} — synchronous callers can use that variant
|
|
3638
|
+
* directly.
|
|
3639
|
+
*
|
|
3640
|
+
* @param input - the comparator string to parse
|
|
3641
|
+
* @returns the parsed {@link Comparator}. Fails with
|
|
3642
|
+
* {@link InvalidComparatorError}.
|
|
3643
|
+
*/
|
|
3644
|
+
static parse = effect.Effect.fn("Comparator.parse")((input) => effect.Effect.fromResult(Comparator.parseResult(input)));
|
|
3524
3645
|
/** Test whether a version satisfies this comparator. */
|
|
3525
3646
|
test(version) {
|
|
3526
3647
|
const cmp = version.compare(this.version);
|
|
@@ -3542,7 +3663,7 @@ var Comparator = class Comparator extends effect.Schema.Class("Comparator")({
|
|
|
3542
3663
|
}
|
|
3543
3664
|
};
|
|
3544
3665
|
//#endregion
|
|
3545
|
-
//#region ../../node_modules/.pnpm/@effected+semver@0.
|
|
3666
|
+
//#region ../../node_modules/.pnpm/@effected+semver@0.2.0_effect@4.0.0-beta.99/node_modules/@effected/semver/internal/normalize.js
|
|
3546
3667
|
const operatorWeight = (op) => {
|
|
3547
3668
|
switch (op) {
|
|
3548
3669
|
case ">=": return 0;
|
|
@@ -3573,7 +3694,7 @@ const normalizeComparatorSet = (set) => sortComparators(removeDuplicates(set));
|
|
|
3573
3694
|
/** Normalize every comparator set in a range: sort and deduplicate each independently. */
|
|
3574
3695
|
const normalizeSets = (sets) => sets.map(normalizeComparatorSet);
|
|
3575
3696
|
//#endregion
|
|
3576
|
-
//#region ../../node_modules/.pnpm/@effected+semver@0.
|
|
3697
|
+
//#region ../../node_modules/.pnpm/@effected+semver@0.2.0_effect@4.0.0-beta.99/node_modules/@effected/semver/Range.js
|
|
3577
3698
|
/**
|
|
3578
3699
|
* Indicates that a string could not be parsed as a range expression.
|
|
3579
3700
|
*
|
|
@@ -3633,18 +3754,51 @@ sets: effect.Schema.Array(effect.Schema.Array(Comparator)) }) {
|
|
|
3633
3754
|
},
|
|
3634
3755
|
encode: (parts) => effect.Effect.succeed(formatRange(parts.sets))
|
|
3635
3756
|
})));
|
|
3636
|
-
/**
|
|
3637
|
-
|
|
3757
|
+
/**
|
|
3758
|
+
* Parse a range expression and normalize its comparator sets,
|
|
3759
|
+
* synchronously, returning a `Result` instead of an `Effect`.
|
|
3760
|
+
*
|
|
3761
|
+
* @remarks
|
|
3762
|
+
* {@link Range.parse} is defined in terms of this function; the two never
|
|
3763
|
+
* diverge. Reach for the `Effect` variant inside Effect code — it carries
|
|
3764
|
+
* the `Range.parse` tracing span — and for this one at synchronous
|
|
3765
|
+
* boundaries.
|
|
3766
|
+
*
|
|
3767
|
+
* @example
|
|
3768
|
+
* ```ts
|
|
3769
|
+
* import { Range } from "@effected/semver";
|
|
3770
|
+
* import { Result } from "effect";
|
|
3771
|
+
*
|
|
3772
|
+
* const ok = Range.parseResult("^1.0.0");
|
|
3773
|
+
* if (Result.isSuccess(ok)) {
|
|
3774
|
+
* console.log(ok.success.toString()); // => ">=1.0.0 <2.0.0-0"
|
|
3775
|
+
* }
|
|
3776
|
+
* ```
|
|
3777
|
+
*
|
|
3778
|
+
* @param input - the range expression to parse
|
|
3779
|
+
* @returns a `Result` succeeding with the parsed {@link Range}, or failing
|
|
3780
|
+
* with {@link InvalidRangeError}.
|
|
3781
|
+
*/
|
|
3782
|
+
static parseResult(input) {
|
|
3638
3783
|
const result = parseRange$1(input);
|
|
3639
|
-
if (!result.ok) return
|
|
3784
|
+
if (!result.ok) return effect.Result.fail(new InvalidRangeError({
|
|
3640
3785
|
input: result.input,
|
|
3641
3786
|
position: result.position
|
|
3642
|
-
});
|
|
3643
|
-
return Range.make({ sets: normalizeSets(result.value).map((set) => set.map((c) => Comparator.make({
|
|
3787
|
+
}));
|
|
3788
|
+
return effect.Result.succeed(Range.make({ sets: normalizeSets(result.value).map((set) => set.map((c) => Comparator.make({
|
|
3644
3789
|
operator: c.operator,
|
|
3645
3790
|
version: SemVer.make(c.version)
|
|
3646
|
-
}))) });
|
|
3647
|
-
}
|
|
3791
|
+
}))) }));
|
|
3792
|
+
}
|
|
3793
|
+
/**
|
|
3794
|
+
* Parse a range expression and normalize its comparator sets. Defined in
|
|
3795
|
+
* terms of {@link Range.parseResult} — synchronous callers can use that
|
|
3796
|
+
* variant directly.
|
|
3797
|
+
*
|
|
3798
|
+
* @param input - the range expression to parse
|
|
3799
|
+
* @returns the parsed {@link Range}. Fails with {@link InvalidRangeError}.
|
|
3800
|
+
*/
|
|
3801
|
+
static parse = effect.Effect.fn("Range.parse")((input) => effect.Effect.fromResult(Range.parseResult(input)));
|
|
3648
3802
|
/**
|
|
3649
3803
|
* Test whether a version satisfies a range; see {@link Range.test} for the
|
|
3650
3804
|
* prerelease matching rule. Dual API.
|
|
@@ -3671,19 +3825,49 @@ sets: effect.Schema.Array(effect.Schema.Array(Comparator)) }) {
|
|
|
3671
3825
|
static union = effect.Function.dual(2, (self, that) => Range.make({ sets: [...self.sets, ...that.sets] }));
|
|
3672
3826
|
/**
|
|
3673
3827
|
* Intersect two ranges via a cross-product of their comparator sets,
|
|
3674
|
-
* keeping only satisfiable combinations
|
|
3828
|
+
* keeping only satisfiable combinations, synchronously, returning a
|
|
3829
|
+
* `Result` instead of an `Effect`. Fails with
|
|
3675
3830
|
* {@link UnsatisfiableConstraintError} when no satisfiable set remains —
|
|
3676
3831
|
* an honest typed failure instead of an unsatisfiable range. Dual API.
|
|
3832
|
+
*
|
|
3833
|
+
* @remarks
|
|
3834
|
+
* {@link Range.intersect} is defined in terms of this function; the two
|
|
3835
|
+
* never diverge. Reach for the `Effect` variant inside Effect code — it
|
|
3836
|
+
* carries the `Range.intersect` tracing span — and for this one at
|
|
3837
|
+
* synchronous boundaries.
|
|
3838
|
+
*
|
|
3839
|
+
* @example
|
|
3840
|
+
* ```ts
|
|
3841
|
+
* import { Range } from "@effected/semver";
|
|
3842
|
+
* import { Result } from "effect";
|
|
3843
|
+
*
|
|
3844
|
+
* const a = Result.getOrThrow(Range.parseResult("^1.0.0"));
|
|
3845
|
+
* const b = Result.getOrThrow(Range.parseResult(">=1.5.0"));
|
|
3846
|
+
* const merged = Range.intersectResult(a, b);
|
|
3847
|
+
* if (Result.isSuccess(merged)) {
|
|
3848
|
+
* console.log(merged.success.toString()); // => ">=1.0.0 <2.0.0-0 >=1.5.0"
|
|
3849
|
+
* }
|
|
3850
|
+
* ```
|
|
3677
3851
|
*/
|
|
3678
|
-
static
|
|
3852
|
+
static intersectResult = effect.Function.dual(2, (self, that) => {
|
|
3679
3853
|
const candidates = [];
|
|
3680
3854
|
for (const setA of self.sets) for (const setB of that.sets) {
|
|
3681
3855
|
const merged = [...setA, ...setB];
|
|
3682
3856
|
if (isSetSatisfiable(merged)) candidates.push(merged);
|
|
3683
3857
|
}
|
|
3684
|
-
if (candidates.length === 0) return
|
|
3685
|
-
return Range.make({ sets: candidates });
|
|
3686
|
-
})
|
|
3858
|
+
if (candidates.length === 0) return effect.Result.fail(new UnsatisfiableConstraintError({ constraints: [self, that] }));
|
|
3859
|
+
return effect.Result.succeed(Range.make({ sets: candidates }));
|
|
3860
|
+
});
|
|
3861
|
+
/**
|
|
3862
|
+
* Intersect two ranges via a cross-product of their comparator sets,
|
|
3863
|
+
* keeping only satisfiable combinations. Fails with
|
|
3864
|
+
* {@link UnsatisfiableConstraintError} when no satisfiable set remains —
|
|
3865
|
+
* an honest typed failure instead of an unsatisfiable range. Dual API.
|
|
3866
|
+
*
|
|
3867
|
+
* Defined in terms of {@link Range.intersectResult} — synchronous callers
|
|
3868
|
+
* can use that variant directly.
|
|
3869
|
+
*/
|
|
3870
|
+
static intersect = effect.Function.dual(2, effect.Effect.fn("Range.intersect")((self, that) => effect.Effect.fromResult(Range.intersectResult(self, that))));
|
|
3687
3871
|
/**
|
|
3688
3872
|
* Check whether every version matched by `sub` is also matched by `sup`.
|
|
3689
3873
|
* Dual API.
|
|
@@ -3842,7 +4026,7 @@ const isComparatorSetSubset = (sub, sup) => {
|
|
|
3842
4026
|
return true;
|
|
3843
4027
|
};
|
|
3844
4028
|
//#endregion
|
|
3845
|
-
//#region ../../node_modules/.pnpm/@effected+npm@0.
|
|
4029
|
+
//#region ../../node_modules/.pnpm/@effected+npm@0.3.0_@effected+semver@0.2.0_effect@4.0.0-beta.99__effect@4.0.0-beta.99/node_modules/@effected/npm/DependencySpecifier.js
|
|
3846
4030
|
/**
|
|
3847
4031
|
* Indicates that a string could not be parsed as a valid dependency specifier.
|
|
3848
4032
|
*
|
|
@@ -4049,7 +4233,7 @@ const DependencySpecifier = Object.assign(brandedSpecifier, {
|
|
|
4049
4233
|
FromString: fromString
|
|
4050
4234
|
});
|
|
4051
4235
|
//#endregion
|
|
4052
|
-
//#region ../../node_modules/.pnpm/@effected+npm@0.
|
|
4236
|
+
//#region ../../node_modules/.pnpm/@effected+npm@0.3.0_@effected+semver@0.2.0_effect@4.0.0-beta.99__effect@4.0.0-beta.99/node_modules/@effected/npm/IntegrityHash.js
|
|
4053
4237
|
const SRI_RE = /^(sha1|sha256|sha384|sha512)-[A-Za-z0-9+/]+={0,2}$/;
|
|
4054
4238
|
const COREPACK_RE = /^(sha1|sha256|sha384|sha512)\.[0-9a-f]+$/;
|
|
4055
4239
|
const YARN_RE = /^[0-9]+(c[0-9]+)?\/[0-9a-f]+$/;
|
|
@@ -4102,7 +4286,175 @@ const IntegrityHash = Object.assign(brandedIntegrity, {
|
|
|
4102
4286
|
decode: decode$2
|
|
4103
4287
|
});
|
|
4104
4288
|
//#endregion
|
|
4105
|
-
//#region ../../node_modules/.pnpm/@effected+
|
|
4289
|
+
//#region ../../node_modules/.pnpm/@effected+npm@0.3.0_@effected+semver@0.2.0_effect@4.0.0-beta.99__effect@4.0.0-beta.99/node_modules/@effected/npm/ReleaseAgeGate.js
|
|
4290
|
+
const MS_PER_MINUTE = 6e4;
|
|
4291
|
+
/**
|
|
4292
|
+
* A source's partial contribution to a {@link ReleaseAgeGate}: the effective
|
|
4293
|
+
* gate is assembled from more than one place (inline `pnpm-workspace.yaml`
|
|
4294
|
+
* keys, replayed `updateConfig` hooks, `pnpm config get` output), and each
|
|
4295
|
+
* source may set the age, the exclude list, both, or neither. Absent fields
|
|
4296
|
+
* contribute nothing to the combination.
|
|
4297
|
+
*
|
|
4298
|
+
* Deliberately permissive: unlike {@link ReleaseAgeGate} it does not constrain
|
|
4299
|
+
* `ageMinutes` to be non-negative, because the raw values arrive from arbitrary
|
|
4300
|
+
* config sources and {@link ReleaseAgeGate.combine} is the single authority
|
|
4301
|
+
* that clamps them.
|
|
4302
|
+
*
|
|
4303
|
+
* @public
|
|
4304
|
+
*/
|
|
4305
|
+
const PartialReleaseAgeGate = effect.Schema.Struct({
|
|
4306
|
+
/** Minutes a release must age; absent means this source sets no age. */
|
|
4307
|
+
ageMinutes: effect.Schema.optionalKey(effect.Schema.Number),
|
|
4308
|
+
/** Exempt package-name patterns; absent means this source adds no exemptions. */
|
|
4309
|
+
exclude: effect.Schema.optionalKey(effect.Schema.Array(effect.Schema.String))
|
|
4310
|
+
});
|
|
4311
|
+
const AgeMinutes = effect.Schema.Number.check(effect.Schema.isGreaterThanOrEqualTo(0), effect.Schema.isFinite());
|
|
4312
|
+
const matchesPattern = (name, pattern) => {
|
|
4313
|
+
if (pattern === name) return true;
|
|
4314
|
+
if (!pattern.includes("*")) return false;
|
|
4315
|
+
let nameIndex = 0;
|
|
4316
|
+
let patternIndex = 0;
|
|
4317
|
+
let starIndex = -1;
|
|
4318
|
+
let retryNameIndex = 0;
|
|
4319
|
+
while (nameIndex < name.length) if (pattern[patternIndex] === "*") {
|
|
4320
|
+
starIndex = patternIndex;
|
|
4321
|
+
patternIndex += 1;
|
|
4322
|
+
retryNameIndex = nameIndex;
|
|
4323
|
+
} else if (pattern[patternIndex] === name[nameIndex]) {
|
|
4324
|
+
patternIndex += 1;
|
|
4325
|
+
nameIndex += 1;
|
|
4326
|
+
} else if (starIndex !== -1) {
|
|
4327
|
+
patternIndex = starIndex + 1;
|
|
4328
|
+
retryNameIndex += 1;
|
|
4329
|
+
nameIndex = retryNameIndex;
|
|
4330
|
+
} else return false;
|
|
4331
|
+
while (pattern[patternIndex] === "*") patternIndex += 1;
|
|
4332
|
+
return patternIndex === pattern.length;
|
|
4333
|
+
};
|
|
4334
|
+
const matchesExclude = (name, patterns) => patterns.some((pattern) => matchesPattern(name, pattern));
|
|
4335
|
+
/**
|
|
4336
|
+
* pnpm's publish-time release-age gate: the number of minutes a published
|
|
4337
|
+
* version must age before it is eligible, and the set of package-name patterns
|
|
4338
|
+
* exempt from the gate. Mirrors pnpm's `minimumReleaseAge` /
|
|
4339
|
+
* `minimumReleaseAgeExclude` config so a resolver can drop too-young candidate
|
|
4340
|
+
* versions before picking, avoiding `ERR_PNPM_NO_MATURE_MATCHING_VERSION`.
|
|
4341
|
+
*
|
|
4342
|
+
* `ageMinutes` is constrained non-negative and finite; a `ReleaseAgeGate` with
|
|
4343
|
+
* `ageMinutes <= 0` is an inert gate that filters nothing. Assemble a gate from
|
|
4344
|
+
* multiple config sources with {@link ReleaseAgeGate.combine}, and apply it to
|
|
4345
|
+
* a package's candidate versions with {@link ReleaseAgeGate.filterVersions}.
|
|
4346
|
+
*
|
|
4347
|
+
* @example
|
|
4348
|
+
* ```ts
|
|
4349
|
+
* import { ReleaseAgeGate } from "@effected/npm";
|
|
4350
|
+
*
|
|
4351
|
+
* const gate = ReleaseAgeGate.combine(
|
|
4352
|
+
* { ageMinutes: 1440 },
|
|
4353
|
+
* { exclude: ["@my-scope/*"] },
|
|
4354
|
+
* );
|
|
4355
|
+
* // gate.ageMinutes === 1440, gate.exclude === ["@my-scope/*"]
|
|
4356
|
+
*
|
|
4357
|
+
* const eligible = gate.filterVersions(
|
|
4358
|
+
* ["1.0.0", "1.0.1"],
|
|
4359
|
+
* { "1.0.0": "2020-01-01T00:00:00Z", "1.0.1": "2026-07-21T00:00:00Z" },
|
|
4360
|
+
* "prettier",
|
|
4361
|
+
* Date.now(),
|
|
4362
|
+
* );
|
|
4363
|
+
* ```
|
|
4364
|
+
*
|
|
4365
|
+
* @public
|
|
4366
|
+
*/
|
|
4367
|
+
var ReleaseAgeGate = class ReleaseAgeGate extends effect.Schema.Class("ReleaseAgeGate")({
|
|
4368
|
+
/** Minutes a published version must age before it is eligible (non-negative, finite). */
|
|
4369
|
+
ageMinutes: AgeMinutes,
|
|
4370
|
+
/** Package-name patterns exempt from the gate (exact names or `*`-globs). */
|
|
4371
|
+
exclude: effect.Schema.Array(effect.Schema.String)
|
|
4372
|
+
}) {
|
|
4373
|
+
/**
|
|
4374
|
+
* Combine partial contributions from multiple sources into one effective
|
|
4375
|
+
* gate: **strictest age wins** (the maximum of the contributed ages,
|
|
4376
|
+
* clamped to be non-negative) and the exclude sets **union** (deduplicated,
|
|
4377
|
+
* insertion order preserved). A contribution's absent field adds nothing; a
|
|
4378
|
+
* negative or non-finite contributed age is ignored by the clamp. With no
|
|
4379
|
+
* contributions (or only empty ones) the result is the inert zero gate
|
|
4380
|
+
* (`ageMinutes: 0`, `exclude: []`).
|
|
4381
|
+
*
|
|
4382
|
+
* `combine` is total — it never throws on a fractional, negative, or
|
|
4383
|
+
* non-finite contribution — which is why {@link (PartialReleaseAgeGate:variable)}
|
|
4384
|
+
* does not constrain its `ageMinutes` and this method owns the clamp.
|
|
4385
|
+
*
|
|
4386
|
+
* @param contributions - the partial gates to merge, one per source.
|
|
4387
|
+
*/
|
|
4388
|
+
static combine(...contributions) {
|
|
4389
|
+
const ages = contributions.map((contribution) => contribution.ageMinutes).filter((age) => typeof age === "number" && Number.isFinite(age));
|
|
4390
|
+
const ageMinutes = ages.length > 0 ? Math.max(0, ...ages) : 0;
|
|
4391
|
+
const exclude = [...new Set(contributions.flatMap((contribution) => contribution.exclude ?? []))];
|
|
4392
|
+
return ReleaseAgeGate.make({
|
|
4393
|
+
ageMinutes,
|
|
4394
|
+
exclude
|
|
4395
|
+
});
|
|
4396
|
+
}
|
|
4397
|
+
/**
|
|
4398
|
+
* Whether a package name matches any of `patterns`, using pnpm's
|
|
4399
|
+
* `@pnpm/matcher` semantics: an exact-name match, or a `*`-glob where `*`
|
|
4400
|
+
* matches any run of characters **including `/`** — so a bare `*` matches a
|
|
4401
|
+
* scoped name like `@scope/pkg`, and `@scope/*` matches every package in a
|
|
4402
|
+
* scope.
|
|
4403
|
+
*
|
|
4404
|
+
* @remarks
|
|
4405
|
+
* This is deliberately **NOT** `@effected/glob`'s minimatch dialect, in
|
|
4406
|
+
* which `*` refuses to cross `/` (there `*` matches `pkg` but not
|
|
4407
|
+
* `@scope/pkg`, and you would need `**`). pnpm treats the package name as a
|
|
4408
|
+
* flat string, so this matcher does too. Do not "fix" this to route through
|
|
4409
|
+
* `@effected/glob`: it would silently change which packages a gate exempts
|
|
4410
|
+
* and diverge from pnpm's own behavior.
|
|
4411
|
+
*
|
|
4412
|
+
* @param name - the package name to test.
|
|
4413
|
+
* @param patterns - the exclude patterns (exact names or `*`-globs).
|
|
4414
|
+
*/
|
|
4415
|
+
static matchesExclude(name, patterns) {
|
|
4416
|
+
return matchesExclude(name, patterns);
|
|
4417
|
+
}
|
|
4418
|
+
/**
|
|
4419
|
+
* Whether this gate exempts the given package name from the release-age
|
|
4420
|
+
* check — `ReleaseAgeGate.matchesExclude(name, this.exclude)`.
|
|
4421
|
+
*
|
|
4422
|
+
* @param name - the package name to test.
|
|
4423
|
+
*/
|
|
4424
|
+
isExcluded(name) {
|
|
4425
|
+
return matchesExclude(name, this.exclude);
|
|
4426
|
+
}
|
|
4427
|
+
/**
|
|
4428
|
+
* Filter a package's candidate versions to those old enough to pass the
|
|
4429
|
+
* gate, given each version's publish timestamp and a caller-supplied `now`.
|
|
4430
|
+
*
|
|
4431
|
+
* A version is kept when it has a parseable publish timestamp at or before
|
|
4432
|
+
* the cutoff (`now - ageMinutes * 60000`). A version with a **missing or
|
|
4433
|
+
* unparseable** timestamp in `times` is **dropped** — matching pnpm's strict
|
|
4434
|
+
* posture: a version whose age cannot be established is treated as too young.
|
|
4435
|
+
* The clock is the caller's; this method reads no wall clock.
|
|
4436
|
+
*
|
|
4437
|
+
* Returns all versions unchanged (a no-op) when the gate is inert
|
|
4438
|
+
* (`ageMinutes <= 0`) or the package name is excluded.
|
|
4439
|
+
*
|
|
4440
|
+
* @param versions - the candidate version strings.
|
|
4441
|
+
* @param times - a map from version string to its ISO-8601 publish date.
|
|
4442
|
+
* @param name - the package name (checked against the gate's `exclude` list).
|
|
4443
|
+
* @param now - the current time in epoch milliseconds (the caller's clock).
|
|
4444
|
+
*/
|
|
4445
|
+
filterVersions(versions, times, name, now) {
|
|
4446
|
+
if (this.ageMinutes <= 0 || this.isExcluded(name)) return versions;
|
|
4447
|
+
const cutoff = now - this.ageMinutes * MS_PER_MINUTE;
|
|
4448
|
+
return versions.filter((version) => {
|
|
4449
|
+
const time = times[version];
|
|
4450
|
+
if (time === void 0) return false;
|
|
4451
|
+
const published = Date.parse(time);
|
|
4452
|
+
return Number.isFinite(published) && published <= cutoff;
|
|
4453
|
+
});
|
|
4454
|
+
}
|
|
4455
|
+
};
|
|
4456
|
+
//#endregion
|
|
4457
|
+
//#region ../../node_modules/.pnpm/@effected+lockfiles@0.1.9_@effected+jsonc@0.5.0_effect@4.0.0-beta.99__@effected+npm@0.3_d470055e7ca4b6a23d413cae592e2835/node_modules/@effected/lockfiles/ImporterDependency.js
|
|
4106
4458
|
/**
|
|
4107
4459
|
* One declared dependency of one workspace importer, as the lockfile records it.
|
|
4108
4460
|
*
|
|
@@ -4130,7 +4482,7 @@ var ImporterDependency = class extends effect.Schema.Class("ImporterDependency")
|
|
|
4130
4482
|
depType: DependencyField
|
|
4131
4483
|
}) {};
|
|
4132
4484
|
//#endregion
|
|
4133
|
-
//#region ../../node_modules/.pnpm/@effected+lockfiles@0.1.
|
|
4485
|
+
//#region ../../node_modules/.pnpm/@effected+lockfiles@0.1.9_@effected+jsonc@0.5.0_effect@4.0.0-beta.99__@effected+npm@0.3_d470055e7ca4b6a23d413cae592e2835/node_modules/@effected/lockfiles/LockfileImporter.js
|
|
4134
4486
|
/**
|
|
4135
4487
|
* One workspace importer's declared dependencies, as the lockfile records them.
|
|
4136
4488
|
*
|
|
@@ -4154,7 +4506,7 @@ var LockfileImporter = class extends effect.Schema.Class("LockfileImporter")({
|
|
|
4154
4506
|
dependencies: effect.Schema.Array(ImporterDependency)
|
|
4155
4507
|
}) {};
|
|
4156
4508
|
//#endregion
|
|
4157
|
-
//#region ../../node_modules/.pnpm/@effected+lockfiles@0.1.
|
|
4509
|
+
//#region ../../node_modules/.pnpm/@effected+lockfiles@0.1.9_@effected+jsonc@0.5.0_effect@4.0.0-beta.99__@effected+npm@0.3_d470055e7ca4b6a23d413cae592e2835/node_modules/@effected/lockfiles/ResolvedPackage.js
|
|
4158
4510
|
const EMPTY_DEPENDENCIES = {};
|
|
4159
4511
|
/**
|
|
4160
4512
|
* A package resolved from a lockfile.
|
|
@@ -4189,7 +4541,7 @@ var ResolvedPackage = class extends effect.Schema.Class("ResolvedPackage")({
|
|
|
4189
4541
|
dependencies: effect.Schema.Record(effect.Schema.String, effect.Schema.String).pipe(effect.Schema.withDecodingDefaultKey(effect.Effect.succeed(EMPTY_DEPENDENCIES)), effect.Schema.withConstructorDefault(effect.Effect.succeed(EMPTY_DEPENDENCIES)))
|
|
4190
4542
|
}) {};
|
|
4191
4543
|
//#endregion
|
|
4192
|
-
//#region ../../node_modules/.pnpm/@effected+lockfiles@0.1.
|
|
4544
|
+
//#region ../../node_modules/.pnpm/@effected+lockfiles@0.1.9_@effected+jsonc@0.5.0_effect@4.0.0-beta.99__@effected+npm@0.3_d470055e7ca4b6a23d413cae592e2835/node_modules/@effected/lockfiles/WorkspaceDependency.js
|
|
4193
4545
|
/**
|
|
4194
4546
|
* A directed dependency edge between two workspace packages as recorded in
|
|
4195
4547
|
* the lockfile.
|
|
@@ -4211,7 +4563,7 @@ var WorkspaceDependency = class extends effect.Schema.Class("WorkspaceDependency
|
|
|
4211
4563
|
constraint: effect.Schema.String
|
|
4212
4564
|
}) {};
|
|
4213
4565
|
//#endregion
|
|
4214
|
-
//#region ../../node_modules/.pnpm/@effected+lockfiles@0.1.
|
|
4566
|
+
//#region ../../node_modules/.pnpm/@effected+lockfiles@0.1.9_@effected+jsonc@0.5.0_effect@4.0.0-beta.99__@effected+npm@0.3_d470055e7ca4b6a23d413cae592e2835/node_modules/@effected/lockfiles/PnpmExtension.js
|
|
4215
4567
|
/**
|
|
4216
4568
|
* Extension data specific to pnpm lockfiles, attached to `Lockfile.extension`
|
|
4217
4569
|
* when the format is `"pnpm"`.
|
|
@@ -4236,7 +4588,7 @@ var PnpmExtension = class extends effect.Schema.Class("PnpmExtension")({
|
|
|
4236
4588
|
}))
|
|
4237
4589
|
}) {};
|
|
4238
4590
|
//#endregion
|
|
4239
|
-
//#region ../../node_modules/.pnpm/@effected+lockfiles@0.1.
|
|
4591
|
+
//#region ../../node_modules/.pnpm/@effected+lockfiles@0.1.9_@effected+jsonc@0.5.0_effect@4.0.0-beta.99__@effected+npm@0.3_d470055e7ca4b6a23d413cae592e2835/node_modules/@effected/lockfiles/LockfileFormat.js
|
|
4240
4592
|
/**
|
|
4241
4593
|
* The lockfile formats this package parses: bun's `bun.lock` (JSONC), npm's
|
|
4242
4594
|
* `package-lock.json` (v2/v3 JSON), pnpm's `pnpm-lock.yaml` and yarn Berry's
|
|
@@ -4270,7 +4622,7 @@ const FILENAMES = {
|
|
|
4270
4622
|
*/
|
|
4271
4623
|
const filenameFor = (format) => FILENAMES[format];
|
|
4272
4624
|
//#endregion
|
|
4273
|
-
//#region ../../node_modules/.pnpm/@effected+lockfiles@0.1.
|
|
4625
|
+
//#region ../../node_modules/.pnpm/@effected+lockfiles@0.1.9_@effected+jsonc@0.5.0_effect@4.0.0-beta.99__@effected+npm@0.3_d470055e7ca4b6a23d413cae592e2835/node_modules/@effected/lockfiles/internal/shared.js
|
|
4274
4626
|
/**
|
|
4275
4627
|
* The four dependency sections of a manifest, in a stable order — the shared
|
|
4276
4628
|
* dependency-sections table (v3's `DEP_SECTIONS`). Each entry is both the
|
|
@@ -4396,7 +4748,7 @@ const extractWorkspaceDeps = (workspaces, workspaceNames) => {
|
|
|
4396
4748
|
return deps;
|
|
4397
4749
|
};
|
|
4398
4750
|
//#endregion
|
|
4399
|
-
//#region ../../node_modules/.pnpm/@effected+jsonc@0.
|
|
4751
|
+
//#region ../../node_modules/.pnpm/@effected+jsonc@0.5.0_effect@4.0.0-beta.99/node_modules/@effected/jsonc/JsoncNode.js
|
|
4400
4752
|
/**
|
|
4401
4753
|
* Discriminator values for JSONC AST node types: the JSON value types
|
|
4402
4754
|
* (`string`/`number`/`boolean`/`null`), the structural types
|
|
@@ -4571,7 +4923,7 @@ function evaluateNode(node, depth) {
|
|
|
4571
4923
|
}
|
|
4572
4924
|
}
|
|
4573
4925
|
//#endregion
|
|
4574
|
-
//#region ../../node_modules/.pnpm/@effected+jsonc@0.
|
|
4926
|
+
//#region ../../node_modules/.pnpm/@effected+jsonc@0.5.0_effect@4.0.0-beta.99/node_modules/@effected/jsonc/internal/scanner.js
|
|
4575
4927
|
const isWhitespace = (ch) => ch === 32 || ch === 9 || ch === 11 || ch === 12 || ch === 160 || ch === 65279;
|
|
4576
4928
|
const isLineBreak$1 = (ch) => ch === 10 || ch === 13 || ch === 8232 || ch === 8233;
|
|
4577
4929
|
const isDigit$1 = (ch) => ch >= 48 && ch <= 57;
|
|
@@ -4867,7 +5219,7 @@ const createScanner$2 = (text, ignoreTrivia = false) => {
|
|
|
4867
5219
|
};
|
|
4868
5220
|
};
|
|
4869
5221
|
//#endregion
|
|
4870
|
-
//#region ../../node_modules/.pnpm/@effected+jsonc@0.
|
|
5222
|
+
//#region ../../node_modules/.pnpm/@effected+jsonc@0.5.0_effect@4.0.0-beta.99/node_modules/@effected/jsonc/internal/skip.js
|
|
4871
5223
|
/**
|
|
4872
5224
|
* Iteratively consume the value beginning at the cursor's current token and
|
|
4873
5225
|
* return its tight end offset (excludes trailing whitespace/comments).
|
|
@@ -4897,7 +5249,7 @@ const skipBalancedValue = (cursor) => {
|
|
|
4897
5249
|
return end;
|
|
4898
5250
|
};
|
|
4899
5251
|
//#endregion
|
|
4900
|
-
//#region ../../node_modules/.pnpm/@effected+jsonc@0.
|
|
5252
|
+
//#region ../../node_modules/.pnpm/@effected+jsonc@0.5.0_effect@4.0.0-beta.99/node_modules/@effected/jsonc/internal/parser.js
|
|
4901
5253
|
/**
|
|
4902
5254
|
* The public parse-error code vocabulary. The facade builds its `@public`
|
|
4903
5255
|
* `JsoncParseErrorCode` schema from this array; the parser produces these codes
|
|
@@ -5310,7 +5662,7 @@ const parseTree$2 = (text, flags) => {
|
|
|
5310
5662
|
};
|
|
5311
5663
|
};
|
|
5312
5664
|
//#endregion
|
|
5313
|
-
//#region ../../node_modules/.pnpm/@effected+jsonc@0.
|
|
5665
|
+
//#region ../../node_modules/.pnpm/@effected+jsonc@0.5.0_effect@4.0.0-beta.99/node_modules/@effected/jsonc/Jsonc.js
|
|
5314
5666
|
/**
|
|
5315
5667
|
* The single public parse-error code vocabulary, appearing as the `code` field
|
|
5316
5668
|
* of {@link JsoncParseErrorDetail}.
|
|
@@ -5535,9 +5887,57 @@ var Jsonc = class Jsonc {
|
|
|
5535
5887
|
*/
|
|
5536
5888
|
static parse = effect.Effect.fn("Jsonc.parse")((text, options) => effect.Effect.fromResult(Jsonc.parseResult(text, options)));
|
|
5537
5889
|
/**
|
|
5890
|
+
* Parse JSONC into an immutable {@link JsoncNode} AST, synchronously,
|
|
5891
|
+
* returning a `Result` instead of an `Effect`. `Option.none()` for empty
|
|
5892
|
+
* input (with `allowEmptyContent`); the aggregate {@link JsoncParseError}
|
|
5893
|
+
* for malformed input. Pure — parsing is fundamentally synchronous, so
|
|
5894
|
+
* non-Effect consumers (a plain config loader, a build script) can call
|
|
5895
|
+
* this directly instead of wrapping
|
|
5896
|
+
* `Effect.runSync(Effect.result(Jsonc.parseTree(text)))`.
|
|
5897
|
+
*
|
|
5898
|
+
* @remarks
|
|
5899
|
+
* {@link Jsonc.parseTree} is defined in terms of this function; the two
|
|
5900
|
+
* never diverge. Reach for the `Effect` variant inside Effect code — it
|
|
5901
|
+
* carries the `Jsonc.parseTree` tracing span — and for this one at
|
|
5902
|
+
* synchronous boundaries.
|
|
5903
|
+
*
|
|
5904
|
+
* @example
|
|
5905
|
+
* ```ts
|
|
5906
|
+
* import { Jsonc } from "@effected/jsonc";
|
|
5907
|
+
* import { Option, Result } from "effect";
|
|
5908
|
+
*
|
|
5909
|
+
* const ok = Jsonc.parseTreeResult('{ "port": 3000 // dev\n }');
|
|
5910
|
+
* if (Result.isSuccess(ok) && Option.isSome(ok.success)) {
|
|
5911
|
+
* console.log(ok.success.value.type); // => "object"
|
|
5912
|
+
* }
|
|
5913
|
+
*
|
|
5914
|
+
* const bad = Jsonc.parseTreeResult("{ bad }");
|
|
5915
|
+
* if (Result.isFailure(bad)) {
|
|
5916
|
+
* console.log(bad.failure._tag); // => "JsoncParseError"
|
|
5917
|
+
* }
|
|
5918
|
+
* ```
|
|
5919
|
+
*
|
|
5920
|
+
* @param text - The JSONC source to parse.
|
|
5921
|
+
* @param options - Optional {@link JsoncParseOptions}; defaults apply for
|
|
5922
|
+
* omitted fields.
|
|
5923
|
+
* @returns A `Result` succeeding with `Option.some(root)` (or
|
|
5924
|
+
* `Option.none()` for empty input), or failing with the aggregate
|
|
5925
|
+
* {@link JsoncParseError}.
|
|
5926
|
+
*/
|
|
5927
|
+
static parseTreeResult(text, options) {
|
|
5928
|
+
const { root, errors } = parseTree$2(text, toFlags(options));
|
|
5929
|
+
if (errors.length > 0) return effect.Result.fail(new JsoncParseError({
|
|
5930
|
+
errors: toDetails(text, errors),
|
|
5931
|
+
input: text
|
|
5932
|
+
}));
|
|
5933
|
+
return effect.Result.succeed(root !== void 0 ? effect.Option.some(root) : effect.Option.none());
|
|
5934
|
+
}
|
|
5935
|
+
/**
|
|
5538
5936
|
* Parse JSONC into an immutable {@link JsoncNode} AST. `Option.none()` for
|
|
5539
5937
|
* empty input (with `allowEmptyContent`); the aggregate
|
|
5540
|
-
* {@link JsoncParseError} for malformed input.
|
|
5938
|
+
* {@link JsoncParseError} for malformed input. Defined in terms of
|
|
5939
|
+
* {@link Jsonc.parseTreeResult} — synchronous callers can use that variant
|
|
5940
|
+
* directly.
|
|
5541
5941
|
*
|
|
5542
5942
|
* @param text - The JSONC source to parse.
|
|
5543
5943
|
* @param options - Optional {@link JsoncParseOptions}; defaults apply for
|
|
@@ -5546,14 +5946,7 @@ var Jsonc = class Jsonc {
|
|
|
5546
5946
|
* `Option.none()` for empty input), or fails with the aggregate
|
|
5547
5947
|
* {@link JsoncParseError}.
|
|
5548
5948
|
*/
|
|
5549
|
-
static parseTree = effect.Effect.fn("Jsonc.parseTree")(
|
|
5550
|
-
const { root, errors } = parseTree$2(text, toFlags(options));
|
|
5551
|
-
if (errors.length > 0) return yield* new JsoncParseError({
|
|
5552
|
-
errors: toDetails(text, errors),
|
|
5553
|
-
input: text
|
|
5554
|
-
});
|
|
5555
|
-
return root !== void 0 ? effect.Option.some(root) : effect.Option.none();
|
|
5556
|
-
});
|
|
5949
|
+
static parseTree = effect.Effect.fn("Jsonc.parseTree")((text, options) => effect.Effect.fromResult(Jsonc.parseTreeResult(text, options)));
|
|
5557
5950
|
/**
|
|
5558
5951
|
* Stringify a plain JavaScript value as JSON text, synchronously, returning
|
|
5559
5952
|
* a `Result` instead of an `Effect`. With no options the output is
|
|
@@ -5873,7 +6266,7 @@ var JsoncEdit = class extends effect.Schema.Class("JsoncEdit")({
|
|
|
5873
6266
|
}
|
|
5874
6267
|
};
|
|
5875
6268
|
//#endregion
|
|
5876
|
-
//#region ../../node_modules/.pnpm/@effected+jsonc@0.
|
|
6269
|
+
//#region ../../node_modules/.pnpm/@effected+jsonc@0.5.0_effect@4.0.0-beta.99/node_modules/@effected/jsonc/internal/navigate.js
|
|
5877
6270
|
/**
|
|
5878
6271
|
* Resolve `path` against `text`, returning where the target is (or where it
|
|
5879
6272
|
* would be inserted). `path` must be non-empty — the whole-document case is
|
|
@@ -6000,7 +6393,7 @@ function navigate(text, path) {
|
|
|
6000
6393
|
return { _tag: "NoOp" };
|
|
6001
6394
|
}
|
|
6002
6395
|
//#endregion
|
|
6003
|
-
//#region ../../node_modules/.pnpm/@effected+jsonc@0.
|
|
6396
|
+
//#region ../../node_modules/.pnpm/@effected+jsonc@0.5.0_effect@4.0.0-beta.99/node_modules/@effected/jsonc/JsoncModifier.js
|
|
6004
6397
|
/**
|
|
6005
6398
|
* Raised when `JsoncModifier.modify` cannot navigate the requested path: the
|
|
6006
6399
|
* value at `depth` is not the container kind (`expected`) the next path segment
|
|
@@ -6128,7 +6521,7 @@ var JsoncModifier = class {
|
|
|
6128
6521
|
});
|
|
6129
6522
|
};
|
|
6130
6523
|
//#endregion
|
|
6131
|
-
//#region ../../node_modules/.pnpm/@effected+lockfiles@0.1.
|
|
6524
|
+
//#region ../../node_modules/.pnpm/@effected+lockfiles@0.1.9_@effected+jsonc@0.5.0_effect@4.0.0-beta.99__@effected+npm@0.3_d470055e7ca4b6a23d413cae592e2835/node_modules/@effected/lockfiles/internal/bun.js
|
|
6132
6525
|
const DepRecord$2 = effect.Schema.optionalKey(effect.Schema.Record(effect.Schema.String, effect.Schema.String));
|
|
6133
6526
|
const BunWorkspaceEntry = effect.Schema.Struct({
|
|
6134
6527
|
name: effect.Schema.optionalKey(effect.Schema.String),
|
|
@@ -6221,7 +6614,7 @@ const toFields$3 = (raw) => effect.Effect.gen(function* () {
|
|
|
6221
6614
|
};
|
|
6222
6615
|
});
|
|
6223
6616
|
//#endregion
|
|
6224
|
-
//#region ../../node_modules/.pnpm/@effected+lockfiles@0.1.
|
|
6617
|
+
//#region ../../node_modules/.pnpm/@effected+lockfiles@0.1.9_@effected+jsonc@0.5.0_effect@4.0.0-beta.99__@effected+npm@0.3_d470055e7ca4b6a23d413cae592e2835/node_modules/@effected/lockfiles/internal/npm.js
|
|
6225
6618
|
const DepRecord$1 = effect.Schema.optionalKey(effect.Schema.Record(effect.Schema.String, effect.Schema.String));
|
|
6226
6619
|
const NpmPackageEntry = effect.Schema.Struct({
|
|
6227
6620
|
name: effect.Schema.optionalKey(effect.Schema.String),
|
|
@@ -6319,7 +6712,7 @@ const toFields$2 = (raw) => effect.Effect.gen(function* () {
|
|
|
6319
6712
|
};
|
|
6320
6713
|
});
|
|
6321
6714
|
//#endregion
|
|
6322
|
-
//#region ../../node_modules/.pnpm/@effected+yaml@0.
|
|
6715
|
+
//#region ../../node_modules/.pnpm/@effected+yaml@0.5.0_effect@4.0.0-beta.99/node_modules/@effected/yaml/YamlNode.js
|
|
6323
6716
|
/**
|
|
6324
6717
|
* YAML scalar presentation styles.
|
|
6325
6718
|
*
|
|
@@ -6339,6 +6732,16 @@ const ScalarStyle = effect.Schema.Literals([
|
|
|
6339
6732
|
*/
|
|
6340
6733
|
const CollectionStyle = effect.Schema.Literals(["block", "flow"]);
|
|
6341
6734
|
/**
|
|
6735
|
+
* Quote characters available to the stringifier's plain-scalar fallback: the
|
|
6736
|
+
* style a `plain`-styled scalar is rendered in when it turns out to require
|
|
6737
|
+
* quoting. Referenced by the `quoteStyle` field of `YamlStringifyOptions`;
|
|
6738
|
+
* unlike `ScalarStyle` it is a stringify-option vocabulary, never a property
|
|
6739
|
+
* of a composed node.
|
|
6740
|
+
*
|
|
6741
|
+
* @public
|
|
6742
|
+
*/
|
|
6743
|
+
const QuoteStyle = effect.Schema.Literals(["single", "double"]);
|
|
6744
|
+
/**
|
|
6342
6745
|
* Block-scalar chomping indicators (`-` strip, default clip, `+` keep).
|
|
6343
6746
|
* Referenced by the {@link YamlScalar} `chomp` field schema.
|
|
6344
6747
|
*
|
|
@@ -6711,7 +7114,7 @@ function nodeToValue(node, anchors, budget, counting = false) {
|
|
|
6711
7114
|
return null;
|
|
6712
7115
|
}
|
|
6713
7116
|
//#endregion
|
|
6714
|
-
//#region ../../node_modules/.pnpm/@effected+yaml@0.
|
|
7117
|
+
//#region ../../node_modules/.pnpm/@effected+yaml@0.5.0_effect@4.0.0-beta.99/node_modules/@effected/yaml/internal/diagnostics.js
|
|
6715
7118
|
/** Error codes emitted by the lexer stage. */
|
|
6716
7119
|
const YAML_LEX_ERROR_CODES = [
|
|
6717
7120
|
"UnexpectedCharacter",
|
|
@@ -6789,7 +7192,7 @@ function isFatalCode(code) {
|
|
|
6789
7192
|
return FATAL_CODES.has(code);
|
|
6790
7193
|
}
|
|
6791
7194
|
//#endregion
|
|
6792
|
-
//#region ../../node_modules/.pnpm/@effected+yaml@0.
|
|
7195
|
+
//#region ../../node_modules/.pnpm/@effected+yaml@0.5.0_effect@4.0.0-beta.99/node_modules/@effected/yaml/YamlDiagnostic.js
|
|
6793
7196
|
/**
|
|
6794
7197
|
* Error codes emitted by the lexer stage.
|
|
6795
7198
|
*
|
|
@@ -6910,7 +7313,7 @@ function lineChar(text, offset) {
|
|
|
6910
7313
|
};
|
|
6911
7314
|
}
|
|
6912
7315
|
//#endregion
|
|
6913
|
-
//#region ../../node_modules/.pnpm/@effected+yaml@0.
|
|
7316
|
+
//#region ../../node_modules/.pnpm/@effected+yaml@0.5.0_effect@4.0.0-beta.99/node_modules/@effected/yaml/internal/composer/anchors.js
|
|
6914
7317
|
/**
|
|
6915
7318
|
* Check if a pending anchor is being applied to an alias node (invalid in YAML 1.2 §3.2.2).
|
|
6916
7319
|
* Aliases represent references to existing anchored nodes and cannot have their own anchors.
|
|
@@ -7003,7 +7406,7 @@ function collectAnchors(node, anchors) {
|
|
|
7003
7406
|
}
|
|
7004
7407
|
}
|
|
7005
7408
|
//#endregion
|
|
7006
|
-
//#region ../../node_modules/.pnpm/@effected+yaml@0.
|
|
7409
|
+
//#region ../../node_modules/.pnpm/@effected+yaml@0.5.0_effect@4.0.0-beta.99/node_modules/@effected/yaml/internal/lexer.js
|
|
7007
7410
|
/**
|
|
7008
7411
|
* Create a new YAML scanner for the given source text.
|
|
7009
7412
|
*
|
|
@@ -7960,7 +8363,7 @@ function lexAll(text) {
|
|
|
7960
8363
|
return tokens;
|
|
7961
8364
|
}
|
|
7962
8365
|
//#endregion
|
|
7963
|
-
//#region ../../node_modules/.pnpm/@effected+yaml@0.
|
|
8366
|
+
//#region ../../node_modules/.pnpm/@effected+yaml@0.5.0_effect@4.0.0-beta.99/node_modules/@effected/yaml/internal/cst-parser.js
|
|
7964
8367
|
/**
|
|
7965
8368
|
* Hardening: cap CST nesting so hostile inputs cannot overflow the stack
|
|
7966
8369
|
* while the tree is being BUILT. Set slightly above the composer's
|
|
@@ -8672,7 +9075,7 @@ function parseCSTAll(text) {
|
|
|
8672
9075
|
return parseDocuments(lexAll(text), text);
|
|
8673
9076
|
}
|
|
8674
9077
|
//#endregion
|
|
8675
|
-
//#region ../../node_modules/.pnpm/@effected+yaml@0.
|
|
9078
|
+
//#region ../../node_modules/.pnpm/@effected+yaml@0.5.0_effect@4.0.0-beta.99/node_modules/@effected/yaml/internal/composer/state.js
|
|
8676
9079
|
let lineStartsText;
|
|
8677
9080
|
let lineStartsCache = [];
|
|
8678
9081
|
function getLineStarts(text) {
|
|
@@ -8778,7 +9181,7 @@ function exitNesting(state) {
|
|
|
8778
9181
|
state.depth--;
|
|
8779
9182
|
}
|
|
8780
9183
|
//#endregion
|
|
8781
|
-
//#region ../../node_modules/.pnpm/@effected+yaml@0.
|
|
9184
|
+
//#region ../../node_modules/.pnpm/@effected+yaml@0.5.0_effect@4.0.0-beta.99/node_modules/@effected/yaml/internal/composer/tags.js
|
|
8782
9185
|
/**
|
|
8783
9186
|
* Resolve a tag shorthand using the document's %TAG directives.
|
|
8784
9187
|
* For example, with `%TAG !! tag:example.com,2000:app/`, the tag `!!int`
|
|
@@ -8864,7 +9267,7 @@ function validateTagHandlesInDocument(docCst, state) {
|
|
|
8864
9267
|
}
|
|
8865
9268
|
}
|
|
8866
9269
|
//#endregion
|
|
8867
|
-
//#region ../../node_modules/.pnpm/@effected+yaml@0.
|
|
9270
|
+
//#region ../../node_modules/.pnpm/@effected+yaml@0.5.0_effect@4.0.0-beta.99/node_modules/@effected/yaml/internal/composer/scalars.js
|
|
8868
9271
|
const NULL_RE$1 = /^(?:null|Null|NULL|~)$/;
|
|
8869
9272
|
const TRUE_RE$1 = /^(?:true|True|TRUE)$/;
|
|
8870
9273
|
const FALSE_RE$1 = /^(?:false|False|FALSE)$/;
|
|
@@ -9742,7 +10145,7 @@ function shouldPreserveRaw(rawValue, value) {
|
|
|
9742
10145
|
return false;
|
|
9743
10146
|
}
|
|
9744
10147
|
//#endregion
|
|
9745
|
-
//#region ../../node_modules/.pnpm/@effected+yaml@0.
|
|
10148
|
+
//#region ../../node_modules/.pnpm/@effected+yaml@0.5.0_effect@4.0.0-beta.99/node_modules/@effected/yaml/internal/composer/block.js
|
|
9746
10149
|
/**
|
|
9747
10150
|
* Compose a block map from its CST children, with an optional external first key.
|
|
9748
10151
|
*
|
|
@@ -10890,7 +11293,7 @@ function composeFlatBlockMap(children, startIdx, parentCst, state, externalFirst
|
|
|
10890
11293
|
return map;
|
|
10891
11294
|
}
|
|
10892
11295
|
//#endregion
|
|
10893
|
-
//#region ../../node_modules/.pnpm/@effected+yaml@0.
|
|
11296
|
+
//#region ../../node_modules/.pnpm/@effected+yaml@0.5.0_effect@4.0.0-beta.99/node_modules/@effected/yaml/internal/composer/flow.js
|
|
10894
11297
|
/**
|
|
10895
11298
|
* Validate that flow collection entries are separated by commas.
|
|
10896
11299
|
*
|
|
@@ -11282,7 +11685,7 @@ function composeFlowSeqInner(cst, state, meta, parentBlockColumn) {
|
|
|
11282
11685
|
return seq;
|
|
11283
11686
|
}
|
|
11284
11687
|
//#endregion
|
|
11285
|
-
//#region ../../node_modules/.pnpm/@effected+yaml@0.
|
|
11688
|
+
//#region ../../node_modules/.pnpm/@effected+yaml@0.5.0_effect@4.0.0-beta.99/node_modules/@effected/yaml/internal/composer/document.js
|
|
11286
11689
|
/** The flow-composer dispatch wired into every state this module creates. */
|
|
11287
11690
|
const FLOW = {
|
|
11288
11691
|
composeFlowMap,
|
|
@@ -11948,7 +12351,7 @@ function composeAllDocuments(text, options) {
|
|
|
11948
12351
|
};
|
|
11949
12352
|
}
|
|
11950
12353
|
//#endregion
|
|
11951
|
-
//#region ../../node_modules/.pnpm/@effected+yaml@0.
|
|
12354
|
+
//#region ../../node_modules/.pnpm/@effected+yaml@0.5.0_effect@4.0.0-beta.99/node_modules/@effected/yaml/internal/fold.js
|
|
11952
12355
|
/**
|
|
11953
12356
|
* Column-based line folding for a single logical scalar line (YAML 1.2 flow
|
|
11954
12357
|
* folding, §7.3 / §8.2.1). Breaks the content at "safe" single-space
|
|
@@ -12184,7 +12587,7 @@ function renderBlockFolded(s, indent) {
|
|
|
12184
12587
|
return `>${indentIndicator}${chomp}\n${outputLines.join("\n")}`;
|
|
12185
12588
|
}
|
|
12186
12589
|
//#endregion
|
|
12187
|
-
//#region ../../node_modules/.pnpm/@effected+yaml@0.
|
|
12590
|
+
//#region ../../node_modules/.pnpm/@effected+yaml@0.5.0_effect@4.0.0-beta.99/node_modules/@effected/yaml/internal/stringifier.js
|
|
12188
12591
|
/**
|
|
12189
12592
|
* Thrown by the stringifier on its failure paths (circular references). The
|
|
12190
12593
|
* facade catches this and materializes the public stringify error.
|
|
@@ -12290,7 +12693,10 @@ function requiresQuoting(s, ignoreType = false) {
|
|
|
12290
12693
|
if (s.includes(" #") || s.includes(" #")) return true;
|
|
12291
12694
|
const last = s[s.length - 1];
|
|
12292
12695
|
if (last === " " || last === " ") return true;
|
|
12293
|
-
for (let i = 0; i < s.length; i++)
|
|
12696
|
+
for (let i = 0; i < s.length; i++) {
|
|
12697
|
+
const code = s.charCodeAt(i);
|
|
12698
|
+
if (code === 9 || code === 13 || isControlChar(code)) return true;
|
|
12699
|
+
}
|
|
12294
12700
|
return false;
|
|
12295
12701
|
}
|
|
12296
12702
|
/**
|
|
@@ -12347,11 +12753,13 @@ function renderSingleQuoted(s) {
|
|
|
12347
12753
|
*
|
|
12348
12754
|
* Multi-line strings are routed to block styles regardless of the requested
|
|
12349
12755
|
* style (except double-quoted). For single-line strings, plain style delegates
|
|
12350
|
-
* to {@link requiresQuoting} and falls back to
|
|
12351
|
-
*
|
|
12352
|
-
*
|
|
12756
|
+
* to {@link requiresQuoting} and falls back to `quoteStyle` (single-quoted by
|
|
12757
|
+
* default, double-quoted when the caller asked for it) — or to double-quoted
|
|
12758
|
+
* regardless when the value needs YAML escapes single quotes cannot express.
|
|
12759
|
+
* Block literal and block folded styles are always accepted for single-line
|
|
12760
|
+
* strings even though the output is unusual.
|
|
12353
12761
|
*/
|
|
12354
|
-
function renderString(s, style, indent, ignoreType = false, canonical = false, explicitChomp, parentPosition) {
|
|
12762
|
+
function renderString(s, style, indent, ignoreType = false, canonical = false, explicitChomp, parentPosition, quoteStyle = "single") {
|
|
12355
12763
|
if (s.includes("\n")) {
|
|
12356
12764
|
let hasControl = false;
|
|
12357
12765
|
for (let i = 0; i < s.length; i++) {
|
|
@@ -12385,7 +12793,7 @@ function renderString(s, style, indent, ignoreType = false, canonical = false, e
|
|
|
12385
12793
|
if (requiresQuoting(s, ignoreType)) {
|
|
12386
12794
|
if (s.includes(" ") || s.includes("\r")) return renderDoubleQuoted(s, canonical);
|
|
12387
12795
|
for (let i = 0; i < s.length; i++) if (isControlChar(s.charCodeAt(i))) return renderDoubleQuoted(s, canonical);
|
|
12388
|
-
return renderSingleQuoted(s);
|
|
12796
|
+
return quoteStyle === "double" ? renderDoubleQuoted(s, canonical) : renderSingleQuoted(s);
|
|
12389
12797
|
}
|
|
12390
12798
|
return s;
|
|
12391
12799
|
case "single-quoted": return renderSingleQuoted(s);
|
|
@@ -12425,6 +12833,7 @@ function createContext(options) {
|
|
|
12425
12833
|
defaultCollectionStyle: options?.defaultCollectionStyle ?? "block",
|
|
12426
12834
|
sortKeys: options?.sortKeys ?? false,
|
|
12427
12835
|
indentSequences: options?.indentSequences ?? false,
|
|
12836
|
+
quoteStyle: options?.quoteStyle ?? "single",
|
|
12428
12837
|
forceDefaultStyles: options?.forceDefaultStyles ?? false,
|
|
12429
12838
|
seen: /* @__PURE__ */ new Set()
|
|
12430
12839
|
};
|
|
@@ -12444,7 +12853,7 @@ function stringifyLines(value, ctx, depth, allowFold = true) {
|
|
|
12444
12853
|
if (typeof value === "bigint") return [value.toString()];
|
|
12445
12854
|
if (typeof value === "string") {
|
|
12446
12855
|
const indentStr = " ".repeat(ctx.indent);
|
|
12447
|
-
const rendered = renderString(value, ctx.defaultScalarStyle, indentStr, false, ctx.forceDefaultStyles);
|
|
12856
|
+
const rendered = renderString(value, ctx.defaultScalarStyle, indentStr, false, ctx.forceDefaultStyles, void 0, void 0, ctx.quoteStyle);
|
|
12448
12857
|
return (allowFold && ctx.lineWidth > 0 ? foldRenderedScalar(rendered, indentStr, ctx.lineWidth) : rendered).split("\n");
|
|
12449
12858
|
}
|
|
12450
12859
|
if (Array.isArray(value)) {
|
|
@@ -12509,10 +12918,11 @@ function stringifyObjectLines(obj, ctx, depth) {
|
|
|
12509
12918
|
const keys = Object.keys(obj);
|
|
12510
12919
|
if (keys.length === 0) return ["{}"];
|
|
12511
12920
|
if (ctx.sortKeys) keys.sort();
|
|
12921
|
+
const renderPlainKey = (k) => renderString(k, "plain", "", false, false, void 0, void 0, ctx.quoteStyle);
|
|
12512
12922
|
if (ctx.defaultCollectionStyle === "flow") return [`{${keys.map((k) => {
|
|
12513
|
-
return `${
|
|
12923
|
+
return `${renderPlainKey(k)}: ${stringifyLines(obj[k], ctx, depth + 1, false).join(" ")}`;
|
|
12514
12924
|
}).join(", ")}}`];
|
|
12515
|
-
const renderKey = (k) => k.includes("\n") ? renderDoubleQuoted(k, ctx.forceDefaultStyles) :
|
|
12925
|
+
const renderKey = (k) => k.includes("\n") ? renderDoubleQuoted(k, ctx.forceDefaultStyles) : renderPlainKey(k);
|
|
12516
12926
|
const pad = " ".repeat(ctx.indent);
|
|
12517
12927
|
const lines = [];
|
|
12518
12928
|
for (const k of keys) {
|
|
@@ -12560,7 +12970,7 @@ effect.Schema.Class("YamlStringifyOptions")({
|
|
|
12560
12970
|
* (`>`) scalars at approximately that column, never block-literal (`|`).
|
|
12561
12971
|
*
|
|
12562
12972
|
* Takes effect only through {@link Yaml.stringify} and
|
|
12563
|
-
* {@link Yaml.
|
|
12973
|
+
* {@link Yaml.stringifyResult} — the two entry points that accept these
|
|
12564
12974
|
* options on the value path. The schema factories ({@link Yaml.fromString},
|
|
12565
12975
|
* {@link Yaml.schema}, {@link Yaml.YamlFromString}) encode with default
|
|
12566
12976
|
* stringify options (`lineWidth` `0`), so their output never folds. The
|
|
@@ -12573,6 +12983,17 @@ effect.Schema.Class("YamlStringifyOptions")({
|
|
|
12573
12983
|
defaultCollectionStyle: effect.Schema.optionalKey(CollectionStyle),
|
|
12574
12984
|
sortKeys: effect.Schema.optionalKey(effect.Schema.Boolean),
|
|
12575
12985
|
indentSequences: effect.Schema.optionalKey(effect.Schema.Boolean),
|
|
12986
|
+
/**
|
|
12987
|
+
* Quote style used when a `plain`-styled scalar requires quoting. Default
|
|
12988
|
+
* `"single"` — the released byte-compatible behavior. `"double"` renders
|
|
12989
|
+
* the same scalars double-quoted instead, matching the `yaml` npm
|
|
12990
|
+
* package's `singleQuote: false` output.
|
|
12991
|
+
*
|
|
12992
|
+
* Affects only the plain fallback: scalars that need no quoting stay
|
|
12993
|
+
* plain, and an explicit `defaultScalarStyle` of `"single-quoted"` or
|
|
12994
|
+
* `"double-quoted"` is unaffected.
|
|
12995
|
+
*/
|
|
12996
|
+
quoteStyle: effect.Schema.optionalKey(QuoteStyle),
|
|
12576
12997
|
finalNewline: effect.Schema.optionalKey(effect.Schema.Boolean),
|
|
12577
12998
|
forceDefaultStyles: effect.Schema.optionalKey(effect.Schema.Boolean)
|
|
12578
12999
|
});
|
|
@@ -12622,6 +13043,7 @@ const toStringifyInput = (options) => options === void 0 ? {} : {
|
|
|
12622
13043
|
defaultCollectionStyle: options.defaultCollectionStyle,
|
|
12623
13044
|
sortKeys: options.sortKeys,
|
|
12624
13045
|
indentSequences: options.indentSequences,
|
|
13046
|
+
quoteStyle: options.quoteStyle,
|
|
12625
13047
|
finalNewline: options.finalNewline,
|
|
12626
13048
|
forceDefaultStyles: options.forceDefaultStyles
|
|
12627
13049
|
};
|
|
@@ -12679,7 +13101,7 @@ const stringifyDefectToError = (defect, value) => {
|
|
|
12679
13101
|
* mode (fatal diagnostics, duplicate keys, a "billion laughs" blow-up) yields
|
|
12680
13102
|
* a `Failure` carrying a typed {@link YamlParseError} — never a throw.
|
|
12681
13103
|
*/
|
|
12682
|
-
const
|
|
13104
|
+
const parseResultImpl = (text, options) => {
|
|
12683
13105
|
const doc = composeFirstDocument(text, toParseInput(options));
|
|
12684
13106
|
const failures = failureRecords(doc, options?.uniqueKeys ?? true);
|
|
12685
13107
|
if (failures.length > 0) return effect.Result.fail(new YamlParseError({
|
|
@@ -12700,7 +13122,7 @@ const parseSyncImpl = (text, options) => {
|
|
|
12700
13122
|
* recursion budget yields a `Failure` carrying a typed {@link YamlStringifyError},
|
|
12701
13123
|
* never a thrown defect.
|
|
12702
13124
|
*/
|
|
12703
|
-
const
|
|
13125
|
+
const stringifyResultImpl = (value, options) => {
|
|
12704
13126
|
try {
|
|
12705
13127
|
return effect.Result.succeed(stringifyValue(value, toStringifyInput(options)));
|
|
12706
13128
|
} catch (defect) {
|
|
@@ -12777,17 +13199,11 @@ var Yaml = class Yaml {
|
|
|
12777
13199
|
* resolved size grows exponentially relative to `maxAliasCount`) also
|
|
12778
13200
|
* fails through {@link YamlParseError} with an `AliasCountExceeded`
|
|
12779
13201
|
* diagnostic, never as an unhandled defect.
|
|
13202
|
+
*
|
|
13203
|
+
* Defined in terms of {@link Yaml.parseResult} — synchronous callers can
|
|
13204
|
+
* use that variant directly.
|
|
12780
13205
|
*/
|
|
12781
|
-
static parse = effect.Effect.fn("Yaml.parse")(
|
|
12782
|
-
const doc = composeFirstDocument(text, toParseInput(options));
|
|
12783
|
-
const failures = failureRecords(doc, options?.uniqueKeys ?? true);
|
|
12784
|
-
if (failures.length > 0) return yield* new YamlParseError({
|
|
12785
|
-
diagnostics: toDiagnostics(text, failures),
|
|
12786
|
-
input: text
|
|
12787
|
-
});
|
|
12788
|
-
const anchors = /* @__PURE__ */ new Map();
|
|
12789
|
-
return yield* extractDocumentValue(doc.contents, anchors, options?.maxAliasCount ?? 100, text);
|
|
12790
|
-
});
|
|
13206
|
+
static parse = effect.Effect.fn("Yaml.parse")((text, options) => effect.Effect.fromResult(Yaml.parseResult(text, options)));
|
|
12791
13207
|
/**
|
|
12792
13208
|
* Parse a multi-document YAML stream into an array of plain JavaScript
|
|
12793
13209
|
* values (one per document, in order). Any fatal diagnostic in any
|
|
@@ -12820,6 +13236,15 @@ var Yaml = class Yaml {
|
|
|
12820
13236
|
* or on a value nested deeper than the stringifier's recursion budget
|
|
12821
13237
|
* (`NestingDepthExceeded`) — both surface through the typed error channel
|
|
12822
13238
|
* rather than as an unhandled stack-overflow defect.
|
|
13239
|
+
*
|
|
13240
|
+
* @remarks
|
|
13241
|
+
* A `"<<"` object key is emitted **quoted** (`'<<': …`). This is the
|
|
13242
|
+
* opposite of the document path ({@link YamlFormat.format} and
|
|
13243
|
+
* `YamlDocument#stringify`), which leaves a parsed plain `<<` key unquoted
|
|
13244
|
+
* so it keeps its merge-key meaning, and the asymmetry is deliberate: a
|
|
13245
|
+
* `"<<"` key on a plain JavaScript object is an ordinary string key that
|
|
13246
|
+
* never carried merge semantics, so emitting it plain would silently turn
|
|
13247
|
+
* ordinary data into a merge directive.
|
|
12823
13248
|
*/
|
|
12824
13249
|
static stringify = effect.Effect.fn("Yaml.stringify")(function* (value, options) {
|
|
12825
13250
|
return yield* stringifyOrFail(value, options);
|
|
@@ -12827,8 +13252,14 @@ var Yaml = class Yaml {
|
|
|
12827
13252
|
/**
|
|
12828
13253
|
* Synchronous single-document parse, returning a `Result` instead of
|
|
12829
13254
|
* an `Effect`. A pure escape hatch for config-time callers that cannot
|
|
12830
|
-
* `await` an Effect (a `vitest.config.ts` is the motivating case)
|
|
12831
|
-
*
|
|
13255
|
+
* `await` an Effect (a `vitest.config.ts` is the motivating case).
|
|
13256
|
+
*
|
|
13257
|
+
* @remarks
|
|
13258
|
+
* This is the package's single parse path. {@link Yaml.parse} is defined in
|
|
13259
|
+
* terms of it (`Effect.fromResult` behind the named span), so the two
|
|
13260
|
+
* variants cannot diverge. Reach for the `Effect` variant inside Effect
|
|
13261
|
+
* code — it carries the `Yaml.parse` tracing span — and for this one at
|
|
13262
|
+
* synchronous boundaries.
|
|
12832
13263
|
*
|
|
12833
13264
|
* Preserves the package contract — malformed and adversarial input fails
|
|
12834
13265
|
* typed, never as a defect. Fatal diagnostics, duplicate keys and a
|
|
@@ -12840,7 +13271,7 @@ var Yaml = class Yaml {
|
|
|
12840
13271
|
* import { Yaml } from "@effected/yaml";
|
|
12841
13272
|
* import { Result } from "effect";
|
|
12842
13273
|
*
|
|
12843
|
-
* const result = Yaml.
|
|
13274
|
+
* const result = Yaml.parseResult("name: Alice\nage: 30");
|
|
12844
13275
|
* if (Result.isSuccess(result)) {
|
|
12845
13276
|
* result.success; // { name: "Alice", age: 30 }
|
|
12846
13277
|
* } else {
|
|
@@ -12850,8 +13281,8 @@ var Yaml = class Yaml {
|
|
|
12850
13281
|
*
|
|
12851
13282
|
* @public
|
|
12852
13283
|
*/
|
|
12853
|
-
static
|
|
12854
|
-
return
|
|
13284
|
+
static parseResult(text, options) {
|
|
13285
|
+
return parseResultImpl(text, options);
|
|
12855
13286
|
}
|
|
12856
13287
|
/**
|
|
12857
13288
|
* Synchronous stringify, returning a `Result` instead of an `Effect`.
|
|
@@ -12868,7 +13299,7 @@ var Yaml = class Yaml {
|
|
|
12868
13299
|
* import { Yaml } from "@effected/yaml";
|
|
12869
13300
|
* import { Result } from "effect";
|
|
12870
13301
|
*
|
|
12871
|
-
* const result = Yaml.
|
|
13302
|
+
* const result = Yaml.stringifyResult({ name: "Alice" });
|
|
12872
13303
|
* if (Result.isFailure(result)) {
|
|
12873
13304
|
* result.failure; // YamlStringifyError
|
|
12874
13305
|
* } else {
|
|
@@ -12878,8 +13309,8 @@ var Yaml = class Yaml {
|
|
|
12878
13309
|
*
|
|
12879
13310
|
* @public
|
|
12880
13311
|
*/
|
|
12881
|
-
static
|
|
12882
|
-
return
|
|
13312
|
+
static stringifyResult(value, options) {
|
|
13313
|
+
return stringifyResultImpl(value, options);
|
|
12883
13314
|
}
|
|
12884
13315
|
/**
|
|
12885
13316
|
* Strip comments from YAML text. Without `replaceCh`, comment characters
|
|
@@ -13105,7 +13536,7 @@ function deepEqualValues(a, b) {
|
|
|
13105
13536
|
return false;
|
|
13106
13537
|
}
|
|
13107
13538
|
//#endregion
|
|
13108
|
-
//#region ../../node_modules/.pnpm/@effected+lockfiles@0.1.
|
|
13539
|
+
//#region ../../node_modules/.pnpm/@effected+lockfiles@0.1.9_@effected+jsonc@0.5.0_effect@4.0.0-beta.99__@effected+npm@0.3_d470055e7ca4b6a23d413cae592e2835/node_modules/@effected/lockfiles/internal/documents.js
|
|
13109
13540
|
/**
|
|
13110
13541
|
* An empty YAML document composes to `null` (`Yaml.parseAll("")` is `[null]`,
|
|
13111
13542
|
* and the trailing document of an env-only `pnpm-lock.yaml` is `null` too).
|
|
@@ -13175,7 +13606,7 @@ const selectSoleDocument = (content) => effect.Effect.gen(function* () {
|
|
|
13175
13606
|
};
|
|
13176
13607
|
});
|
|
13177
13608
|
//#endregion
|
|
13178
|
-
//#region ../../node_modules/.pnpm/@effected+lockfiles@0.1.
|
|
13609
|
+
//#region ../../node_modules/.pnpm/@effected+lockfiles@0.1.9_@effected+jsonc@0.5.0_effect@4.0.0-beta.99__@effected+npm@0.3_d470055e7ca4b6a23d413cae592e2835/node_modules/@effected/lockfiles/internal/pnpm.js
|
|
13179
13610
|
const PnpmImporterDeps = effect.Schema.optionalKey(effect.Schema.Record(effect.Schema.String, effect.Schema.Struct({
|
|
13180
13611
|
specifier: effect.Schema.String,
|
|
13181
13612
|
version: effect.Schema.String
|
|
@@ -13301,7 +13732,7 @@ const toFields$1 = (raw) => effect.Effect.gen(function* () {
|
|
|
13301
13732
|
};
|
|
13302
13733
|
});
|
|
13303
13734
|
//#endregion
|
|
13304
|
-
//#region ../../node_modules/.pnpm/@effected+lockfiles@0.1.
|
|
13735
|
+
//#region ../../node_modules/.pnpm/@effected+lockfiles@0.1.9_@effected+jsonc@0.5.0_effect@4.0.0-beta.99__@effected+npm@0.3_d470055e7ca4b6a23d413cae592e2835/node_modules/@effected/lockfiles/internal/yarn.js
|
|
13305
13736
|
const YarnLockfileRaw = effect.Schema.Record(effect.Schema.String, effect.Schema.Unknown);
|
|
13306
13737
|
const DepRecord = effect.Schema.optionalKey(effect.Schema.Record(effect.Schema.String, effect.Schema.String));
|
|
13307
13738
|
const YarnEntry = effect.Schema.Struct({
|
|
@@ -13424,7 +13855,7 @@ const cleanYarnDeps = (deps) => {
|
|
|
13424
13855
|
return Object.fromEntries(Object.entries(deps).map(([name, value]) => [name, value.startsWith("npm:") ? value.slice(4) : value]));
|
|
13425
13856
|
};
|
|
13426
13857
|
//#endregion
|
|
13427
|
-
//#region ../../node_modules/.pnpm/@effected+lockfiles@0.1.
|
|
13858
|
+
//#region ../../node_modules/.pnpm/@effected+lockfiles@0.1.9_@effected+jsonc@0.5.0_effect@4.0.0-beta.99__@effected+npm@0.3_d470055e7ca4b6a23d413cae592e2835/node_modules/@effected/lockfiles/Lockfile.js
|
|
13428
13859
|
const EMPTY_IMPORTERS = [];
|
|
13429
13860
|
/**
|
|
13430
13861
|
* Failure of `Lockfile.parse`: the given content is not a valid lockfile of
|
|
@@ -13668,7 +14099,7 @@ var Lockfile = class Lockfile extends effect.Schema.Class("Lockfile")({
|
|
|
13668
14099
|
}
|
|
13669
14100
|
};
|
|
13670
14101
|
//#endregion
|
|
13671
|
-
//#region ../../node_modules/.pnpm/@effected+lockfiles@0.1.
|
|
14102
|
+
//#region ../../node_modules/.pnpm/@effected+lockfiles@0.1.9_@effected+jsonc@0.5.0_effect@4.0.0-beta.99__@effected+npm@0.3_d470055e7ca4b6a23d413cae592e2835/node_modules/@effected/lockfiles/LockfileIntegrity.js
|
|
13672
14103
|
/**
|
|
13673
14104
|
* The minimal manifest shape {@link LockfileIntegrity.compare} checks a
|
|
13674
14105
|
* lockfile against: a package name plus the four optional dependency maps.
|
|
@@ -13784,7 +14215,7 @@ var LockfileIntegrity = class LockfileIntegrity extends effect.Schema.Class("Loc
|
|
|
13784
14215
|
}
|
|
13785
14216
|
};
|
|
13786
14217
|
//#endregion
|
|
13787
|
-
//#region ../../node_modules/.pnpm/@effected+package-json@0.
|
|
14218
|
+
//#region ../../node_modules/.pnpm/@effected+package-json@0.4.2_effect@4.0.0-beta.99/node_modules/@effected/package-json/Dependency.js
|
|
13788
14219
|
/**
|
|
13789
14220
|
* A resolved dependency entry pairing a package name with its version
|
|
13790
14221
|
* specifier and the `kind` of map it came from (`@effected/npm`'s
|
|
@@ -13848,7 +14279,7 @@ var Dependency = class extends effect.Schema.Class("Dependency")({
|
|
|
13848
14279
|
}
|
|
13849
14280
|
};
|
|
13850
14281
|
//#endregion
|
|
13851
|
-
//#region ../../node_modules/.pnpm/@effected+package-json@0.
|
|
14282
|
+
//#region ../../node_modules/.pnpm/@effected+package-json@0.4.2_effect@4.0.0-beta.99/node_modules/@effected/package-json/DevEngines.js
|
|
13852
14283
|
/**
|
|
13853
14284
|
* A single `devEngines` constraint with a name and optional `version` / `onFail`.
|
|
13854
14285
|
*
|
|
@@ -14873,7 +15304,7 @@ var require_parse$2 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
14873
15304
|
};
|
|
14874
15305
|
}));
|
|
14875
15306
|
//#endregion
|
|
14876
|
-
//#region ../../node_modules/.pnpm/@effected+package-json@0.
|
|
15307
|
+
//#region ../../node_modules/.pnpm/@effected+package-json@0.4.2_effect@4.0.0-beta.99/node_modules/@effected/package-json/License.js
|
|
14877
15308
|
var import_spdx_expression_parse = /* @__PURE__ */ __toESM((/* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
14878
15309
|
var scan = require_scan$1();
|
|
14879
15310
|
var parse = require_parse$2();
|
|
@@ -14920,7 +15351,7 @@ const isValidSpdx = (value) => {
|
|
|
14920
15351
|
*/
|
|
14921
15352
|
const SpdxLicense = effect.Schema.String.pipe(effect.Schema.check(effect.Schema.makeFilter((value) => isValidSpdx(value) ? void 0 : "Expected a valid SPDX license expression")), effect.Schema.brand("SpdxLicense"));
|
|
14922
15353
|
//#endregion
|
|
14923
|
-
//#region ../../node_modules/.pnpm/@effected+package-json@0.
|
|
15354
|
+
//#region ../../node_modules/.pnpm/@effected+package-json@0.4.2_effect@4.0.0-beta.99/node_modules/@effected/package-json/PackageManager.js
|
|
14924
15355
|
const PACKAGE_MANAGER_RE = /^([a-z]+)@(\d+\.\d+\.\d+(?:-[a-zA-Z0-9._-]+)?)(?:\+(.+))?$/;
|
|
14925
15356
|
/**
|
|
14926
15357
|
* The `packageManager` field only ever carries corepack's `<algo>.<hex>`
|
|
@@ -14978,7 +15409,7 @@ var PackageManager = class PackageManager extends effect.Schema.Class("PackageMa
|
|
|
14978
15409
|
}
|
|
14979
15410
|
};
|
|
14980
15411
|
//#endregion
|
|
14981
|
-
//#region ../../node_modules/.pnpm/@effected+package-json@0.
|
|
15412
|
+
//#region ../../node_modules/.pnpm/@effected+package-json@0.4.2_effect@4.0.0-beta.99/node_modules/@effected/package-json/PackageName.js
|
|
14982
15413
|
/**
|
|
14983
15414
|
* Indicates that a string could not be used as a valid npm package name.
|
|
14984
15415
|
*
|
|
@@ -15036,7 +15467,7 @@ const PackageName = Object.assign(effect.Schema.Union([ScopedPackageName, Unscop
|
|
|
15036
15467
|
isScoped
|
|
15037
15468
|
});
|
|
15038
15469
|
//#endregion
|
|
15039
|
-
//#region ../../node_modules/.pnpm/@effected+package-json@0.
|
|
15470
|
+
//#region ../../node_modules/.pnpm/@effected+package-json@0.4.2_effect@4.0.0-beta.99/node_modules/@effected/package-json/Person.js
|
|
15040
15471
|
const parsePersonString = (input) => {
|
|
15041
15472
|
const emailMatch = input.match(/<([^>]+)>/);
|
|
15042
15473
|
const urlMatch = input.match(/\(([^)]+)\)/);
|
|
@@ -15050,8 +15481,56 @@ const parsePersonString = (input) => {
|
|
|
15050
15481
|
...urlMatch !== null ? { url: urlMatch[1] } : {}
|
|
15051
15482
|
});
|
|
15052
15483
|
};
|
|
15484
|
+
const serializePerson = (person) => {
|
|
15485
|
+
let result = person.name;
|
|
15486
|
+
if (person.email !== void 0) result += ` <${person.email}>`;
|
|
15487
|
+
if (person.url !== void 0) result += ` (${person.url})`;
|
|
15488
|
+
return result;
|
|
15489
|
+
};
|
|
15490
|
+
const wireForms = /* @__PURE__ */ new WeakMap();
|
|
15491
|
+
const rememberWire = (person, wire) => {
|
|
15492
|
+
wireForms.set(person, wire);
|
|
15493
|
+
return person;
|
|
15494
|
+
};
|
|
15495
|
+
const KNOWN_KEYS = /* @__PURE__ */ new Set([
|
|
15496
|
+
"name",
|
|
15497
|
+
"email",
|
|
15498
|
+
"url"
|
|
15499
|
+
]);
|
|
15500
|
+
const sameRest = (a, b) => JSON.stringify(a ?? {}) === JSON.stringify(b ?? {});
|
|
15501
|
+
const isFaithful = (wire, person) => {
|
|
15502
|
+
if (typeof wire === "string") {
|
|
15503
|
+
const parsed = parsePersonString(wire);
|
|
15504
|
+
return parsed.name === person.name && parsed.email === person.email && parsed.url === person.url;
|
|
15505
|
+
}
|
|
15506
|
+
const rest = restOf(wire);
|
|
15507
|
+
return wire.name === person.name && wire.email === person.email && wire.url === person.url && sameRest(rest, person.rest);
|
|
15508
|
+
};
|
|
15509
|
+
const PersonFields = effect.Schema.Struct({
|
|
15510
|
+
name: effect.Schema.String,
|
|
15511
|
+
email: effect.Schema.optionalKey(effect.Schema.String),
|
|
15512
|
+
url: effect.Schema.optionalKey(effect.Schema.String)
|
|
15513
|
+
});
|
|
15514
|
+
const decodePersonFields = effect.Schema.decodeUnknownEffect(PersonFields);
|
|
15515
|
+
const restOf = (raw) => {
|
|
15516
|
+
const rest = {};
|
|
15517
|
+
for (const [key, value] of Object.entries(raw)) if (!KNOWN_KEYS.has(key)) rest[key] = value;
|
|
15518
|
+
return rest;
|
|
15519
|
+
};
|
|
15520
|
+
const encodePersonObject = (person) => {
|
|
15521
|
+
const wire = wireForms.get(person);
|
|
15522
|
+
if (wire !== void 0 && typeof wire !== "string" && isFaithful(wire, person)) return wire;
|
|
15523
|
+
const known = { name: person.name };
|
|
15524
|
+
if (person.email !== void 0) known.email = person.email;
|
|
15525
|
+
if (person.url !== void 0) known.url = person.url;
|
|
15526
|
+
return {
|
|
15527
|
+
...person.rest ?? {},
|
|
15528
|
+
...known
|
|
15529
|
+
};
|
|
15530
|
+
};
|
|
15053
15531
|
/**
|
|
15054
|
-
* A structured person object with `name
|
|
15532
|
+
* A structured person object with `name`, optional `email` / `url`, and a
|
|
15533
|
+
* `rest` catch-all preserving any additional keys across a read/write cycle.
|
|
15055
15534
|
*
|
|
15056
15535
|
* @public
|
|
15057
15536
|
*/
|
|
@@ -15061,29 +15540,77 @@ var Person = class Person extends effect.Schema.Class("Person")({
|
|
|
15061
15540
|
/** The optional email address. */
|
|
15062
15541
|
email: effect.Schema.optionalKey(effect.Schema.String),
|
|
15063
15542
|
/** The optional homepage URL. */
|
|
15064
|
-
url: effect.Schema.optionalKey(effect.Schema.String)
|
|
15543
|
+
url: effect.Schema.optionalKey(effect.Schema.String),
|
|
15544
|
+
/** Any additional keys, preserved verbatim and flattened back on encode. */
|
|
15545
|
+
rest: effect.Schema.optionalKey(effect.Schema.Record(effect.Schema.String, effect.Schema.Unknown))
|
|
15065
15546
|
}) {
|
|
15547
|
+
/**
|
|
15548
|
+
* The object wire codec: an open JSON object ↔ a {@link Person}, partitioning
|
|
15549
|
+
* unknown keys into `rest` and flattening them back on encode so the on-disk
|
|
15550
|
+
* shape never carries a literal `rest` key.
|
|
15551
|
+
*/
|
|
15552
|
+
static schema = effect.Schema.Record(effect.Schema.String, effect.Schema.Unknown).pipe(effect.Schema.decodeTo(effect.Schema.instanceOf(Person), effect.SchemaTransformation.transformOrFail({
|
|
15553
|
+
decode: (raw) => decodePersonFields(raw).pipe(effect.Effect.mapError((error) => error.issue), effect.Effect.map((fields) => {
|
|
15554
|
+
const rest = restOf(raw);
|
|
15555
|
+
return rememberWire(Person.make({
|
|
15556
|
+
...fields,
|
|
15557
|
+
...Object.keys(rest).length > 0 ? { rest } : {}
|
|
15558
|
+
}), raw);
|
|
15559
|
+
})),
|
|
15560
|
+
encode: (person) => effect.Effect.succeed(encodePersonObject(person))
|
|
15561
|
+
})));
|
|
15066
15562
|
/**
|
|
15067
15563
|
* Schema transformation between the `"Name <email> (url)"` shorthand string
|
|
15068
|
-
* and a {@link Person}.
|
|
15564
|
+
* and a {@link Person}. Decoding remembers the input text so that encoding
|
|
15565
|
+
* reproduces it verbatim; see {@link Person.wireStringOf}.
|
|
15069
15566
|
*/
|
|
15070
15567
|
static FromString = effect.Schema.String.pipe(effect.Schema.decodeTo(effect.Schema.instanceOf(Person), effect.SchemaTransformation.transform({
|
|
15071
|
-
decode: (input) => parsePersonString(input),
|
|
15568
|
+
decode: (input) => rememberWire(parsePersonString(input), input),
|
|
15072
15569
|
encode: (person) => {
|
|
15073
|
-
|
|
15074
|
-
|
|
15075
|
-
if (person.url !== void 0) result += ` (${person.url})`;
|
|
15076
|
-
return result;
|
|
15570
|
+
const wire = wireForms.get(person);
|
|
15571
|
+
return typeof wire === "string" && isFaithful(wire, person) ? wire : serializePerson(person);
|
|
15077
15572
|
}
|
|
15078
15573
|
})));
|
|
15079
15574
|
/**
|
|
15080
15575
|
* The `author` / `contributors` value: either the shorthand string or the
|
|
15081
15576
|
* structured object, always decoded to a {@link Person}.
|
|
15577
|
+
*
|
|
15578
|
+
* The wire form is preserved across a round trip — a person read from the
|
|
15579
|
+
* shorthand string encodes back to that string, byte for byte, and one read
|
|
15580
|
+
* from an object encodes back to an object with its unknown keys intact.
|
|
15581
|
+
* Formatting a manifest therefore never rewrites one legal encoding into the
|
|
15582
|
+
* other.
|
|
15583
|
+
*
|
|
15584
|
+
* Provenance belongs to the instance, so a person that is *rebuilt* (rather
|
|
15585
|
+
* than carried through unchanged) has none and encodes in the canonical
|
|
15586
|
+
* object form. Editing an unrelated field of the surrounding `Package`
|
|
15587
|
+
* carries the same person instance through and preserves its encoding.
|
|
15082
15588
|
*/
|
|
15083
|
-
static FromValue = effect.Schema.Union([Person,
|
|
15589
|
+
static FromValue = effect.Schema.Union([Person.schema, effect.Schema.String]).pipe(effect.Schema.decodeTo(effect.Schema.instanceOf(Person), effect.SchemaTransformation.transform({
|
|
15590
|
+
decode: (input) => typeof input === "string" ? rememberWire(parsePersonString(input), input) : input,
|
|
15591
|
+
encode: (person) => {
|
|
15592
|
+
const wire = wireForms.get(person);
|
|
15593
|
+
return typeof wire === "string" && isFaithful(wire, person) ? wire : person;
|
|
15594
|
+
}
|
|
15595
|
+
})));
|
|
15596
|
+
/**
|
|
15597
|
+
* The shorthand text this person was decoded from, when it was decoded from
|
|
15598
|
+
* the string form and still matches its fields; `None` for a person built
|
|
15599
|
+
* from an object or by hand.
|
|
15600
|
+
*
|
|
15601
|
+
* Exposed so callers can tell which encoding a manifest used without
|
|
15602
|
+
* re-reading the file.
|
|
15603
|
+
*
|
|
15604
|
+
* @param person - the person to inspect
|
|
15605
|
+
* @returns the original shorthand text, or `None`
|
|
15606
|
+
*/
|
|
15607
|
+
static wireStringOf(person) {
|
|
15608
|
+
const wire = wireForms.get(person);
|
|
15609
|
+
return typeof wire === "string" && isFaithful(wire, person) ? effect.Option.some(wire) : effect.Option.none();
|
|
15610
|
+
}
|
|
15084
15611
|
};
|
|
15085
15612
|
//#endregion
|
|
15086
|
-
//#region ../../node_modules/.pnpm/@effected+package-json@0.
|
|
15613
|
+
//#region ../../node_modules/.pnpm/@effected+package-json@0.4.2_effect@4.0.0-beta.99/node_modules/@effected/package-json/internal/format.js
|
|
15087
15614
|
const KEY_INDEX = new Map([
|
|
15088
15615
|
"$schema",
|
|
15089
15616
|
"name",
|
|
@@ -15306,7 +15833,7 @@ const renderJson = (raw, options) => {
|
|
|
15306
15833
|
return options.newline ? `${json}\n` : json;
|
|
15307
15834
|
};
|
|
15308
15835
|
//#endregion
|
|
15309
|
-
//#region ../../node_modules/.pnpm/@effected+package-json@0.
|
|
15836
|
+
//#region ../../node_modules/.pnpm/@effected+package-json@0.4.2_effect@4.0.0-beta.99/node_modules/@effected/package-json/Package.js
|
|
15310
15837
|
const toHashMap = effect.SchemaTransformation.transform({
|
|
15311
15838
|
decode: (record) => effect.HashMap.fromIterable(Object.entries(record)),
|
|
15312
15839
|
encode: (map) => Object.fromEntries(effect.HashMap.toEntries(map))
|
|
@@ -15624,7 +16151,7 @@ var Package = class Package extends effect.Schema.Class("Package")({
|
|
|
15624
16151
|
}
|
|
15625
16152
|
};
|
|
15626
16153
|
//#endregion
|
|
15627
|
-
//#region ../../node_modules/.pnpm/@effected+workspaces@0.
|
|
16154
|
+
//#region ../../node_modules/.pnpm/@effected+workspaces@0.6.0_@effected+jsonc@0.5.0_effect@4.0.0-beta.99__effect@4.0.0-beta.99/node_modules/@effected/workspaces/WorkspacePackage.js
|
|
15628
16155
|
const EMPTY$1 = Object.freeze(Object.create(null));
|
|
15629
16156
|
const EMPTY_MANIFEST = Object.freeze(Object.create(null));
|
|
15630
16157
|
/**
|
|
@@ -15699,10 +16226,12 @@ var WorkspaceManifestError = class extends effect.Schema.TaggedErrorClass()("Wor
|
|
|
15699
16226
|
* path: "/repo/packages/utils",
|
|
15700
16227
|
* packageJsonPath: "/repo/packages/utils/package.json",
|
|
15701
16228
|
* relativePath: "packages/utils",
|
|
16229
|
+
* workspaceRoot: "/repo",
|
|
15702
16230
|
* });
|
|
15703
16231
|
*
|
|
15704
16232
|
* pkg.isRootWorkspace; // false
|
|
15705
16233
|
* pkg.unscopedName; // "utils"
|
|
16234
|
+
* pkg.workspaceRoot; // "/repo"
|
|
15706
16235
|
* ```
|
|
15707
16236
|
*
|
|
15708
16237
|
* @public
|
|
@@ -15718,6 +16247,21 @@ var WorkspacePackage = class WorkspacePackage extends effect.Schema.Class("Works
|
|
|
15718
16247
|
packageJsonPath: effect.Schema.NonEmptyString,
|
|
15719
16248
|
/** POSIX path relative to the workspace root; `"."` for the root package. */
|
|
15720
16249
|
relativePath: effect.Schema.String,
|
|
16250
|
+
/**
|
|
16251
|
+
* Absolute path to the workspace root this package was discovered under.
|
|
16252
|
+
*
|
|
16253
|
+
* @remarks
|
|
16254
|
+
* Carried, not derived. Whoever built this value already knew the root —
|
|
16255
|
+
* `WorkspaceDiscovery` resolved it before enumerating, and the sync entry
|
|
16256
|
+
* point is handed it — so dropping it forced every consumer into per-package
|
|
16257
|
+
* root arithmetic (counting `relativePath` segments and re-ascending that
|
|
16258
|
+
* many `..`). That reconstruction is exact only while `path` and
|
|
16259
|
+
* `relativePath` agree, and it re-derives something the kit never had to
|
|
16260
|
+
* lose.
|
|
16261
|
+
*
|
|
16262
|
+
* For the root package this equals `path`, and `relativePath` is `"."`.
|
|
16263
|
+
*/
|
|
16264
|
+
workspaceRoot: effect.Schema.NonEmptyString,
|
|
15721
16265
|
/** Whether the package is marked private. */
|
|
15722
16266
|
private: effect.Schema.Boolean.pipe(effect.Schema.withDecodingDefaultKey(effect.Effect.succeed(false)), effect.Schema.withConstructorDefault(effect.Effect.succeed(false))),
|
|
15723
16267
|
/** Production dependencies. */
|
|
@@ -15886,7 +16430,7 @@ var WorkspacePackage = class WorkspacePackage extends effect.Schema.Class("Works
|
|
|
15886
16430
|
}
|
|
15887
16431
|
};
|
|
15888
16432
|
//#endregion
|
|
15889
|
-
//#region ../../node_modules/.pnpm/@effected+walker@0.
|
|
16433
|
+
//#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
|
|
15890
16434
|
/**
|
|
15891
16435
|
* Typed failure raised by {@link descend}: a directory mid-walk was unreadable
|
|
15892
16436
|
* (under `onUnreadable: "fail"`), or the walk descended past `maxDepth`. Depth
|
|
@@ -16021,7 +16565,97 @@ const descend = effect.Effect.fn("Walker.descend")(function* (pattern, options)
|
|
|
16021
16565
|
return results;
|
|
16022
16566
|
});
|
|
16023
16567
|
//#endregion
|
|
16024
|
-
//#region ../../node_modules/.pnpm/@effected+walker@0.
|
|
16568
|
+
//#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
|
|
16569
|
+
/**
|
|
16570
|
+
* Typed failure raised by {@link compileAndExpand}: the single error the
|
|
16571
|
+
* compile+expand recipe fails with, so a caller catches one tag rather than
|
|
16572
|
+
* folding two error channels by hand.
|
|
16573
|
+
*
|
|
16574
|
+
* @remarks
|
|
16575
|
+
* One tag, two genuinely different causes — "your pattern is malformed" and
|
|
16576
|
+
* "that directory is unreadable" are different problems with different fixes,
|
|
16577
|
+
* so `cause` keeps the underlying typed error intact
|
|
16578
|
+
* rather than flattening it into a string. Discriminate on `cause._tag`
|
|
16579
|
+
* (`"GlobPatternError"` vs `"DescendError"`), or read
|
|
16580
|
+
* {@link GlobExpansionError.stage} when only the phase matters; either way the
|
|
16581
|
+
* original payload — a guard's `limit`/`actual`, a descent's `path` — is still
|
|
16582
|
+
* there. `cause` is also the native `Error` cause, so error chaining and
|
|
16583
|
+
* stack-printing work without extra wiring.
|
|
16584
|
+
*
|
|
16585
|
+
* @public
|
|
16586
|
+
*/
|
|
16587
|
+
var GlobExpansionError = class extends effect.Schema.TaggedErrorClass()("GlobExpansionError", {
|
|
16588
|
+
/** The glob pattern's source text, as handed to {@link compileAndExpand}. */
|
|
16589
|
+
pattern: effect.Schema.String,
|
|
16590
|
+
/** The underlying typed failure, intact: a compile guard trip or a descent failure. */
|
|
16591
|
+
cause: effect.Schema.Union([GlobPatternError, DescendError])
|
|
16592
|
+
}) {
|
|
16593
|
+
/**
|
|
16594
|
+
* Which phase failed — `"compile"` when the pattern itself was rejected,
|
|
16595
|
+
* `"descend"` when the filesystem walk failed. A convenience over
|
|
16596
|
+
* `cause._tag` for callers that only need the phase.
|
|
16597
|
+
*/
|
|
16598
|
+
get stage() {
|
|
16599
|
+
return this.cause._tag === "GlobPatternError" ? "compile" : "descend";
|
|
16600
|
+
}
|
|
16601
|
+
get message() {
|
|
16602
|
+
const shown = this.pattern.length > 64 ? `${this.pattern.slice(0, 64)}…` : this.pattern;
|
|
16603
|
+
return `glob expansion of ${JSON.stringify(shown)} failed during ${this.stage}: ${this.cause.message}`;
|
|
16604
|
+
}
|
|
16605
|
+
};
|
|
16606
|
+
/**
|
|
16607
|
+
* Compile a glob pattern and expand it against the filesystem in one call:
|
|
16608
|
+
* matching FILE paths relative to `options.cwd`, POSIX separators, sorted.
|
|
16609
|
+
*
|
|
16610
|
+
* @remarks
|
|
16611
|
+
* The recipe form of {@link descend}. Everything `descend` documents about
|
|
16612
|
+
* traversal holds unchanged — the literal fast-path, the negated-pattern walk
|
|
16613
|
+
* from `cwd`, files-only matching, symlink and prune handling, `maxDepth`,
|
|
16614
|
+
* `onUnreadable` — because this delegates to it. What this adds is the seam:
|
|
16615
|
+
* the pattern arrives as a string, and both failure modes arrive as one
|
|
16616
|
+
* {@link GlobExpansionError} with the underlying error preserved in `cause`.
|
|
16617
|
+
*
|
|
16618
|
+
* A missing base directory, a pattern that climbs above `cwd`, and a pattern
|
|
16619
|
+
* that simply matches nothing are all an EMPTY result, not a failure — zero
|
|
16620
|
+
* matches is a normal glob answer. Only a rejected pattern or a failed walk
|
|
16621
|
+
* produces an error.
|
|
16622
|
+
*
|
|
16623
|
+
* `FileSystem` and `Path` stay in the `R` channel and are **deliberately not
|
|
16624
|
+
* provided here**, even though hand-providing them is the friction this
|
|
16625
|
+
* recipe otherwise removes. `FileSystem` cannot be provided — a library that
|
|
16626
|
+
* picks its own filesystem cannot be tested against a fixture tree. Given
|
|
16627
|
+
* that, providing `Path` internally would not save the caller a layer (they
|
|
16628
|
+
* still supply `FileSystem`), and it would actively break win32: the walk
|
|
16629
|
+
* would join paths POSIX-style against a caller's win32 filesystem. The
|
|
16630
|
+
* consumer's platform layer stays the single place that choice is made.
|
|
16631
|
+
* Provide both once at the application boundary, not per call site.
|
|
16632
|
+
*
|
|
16633
|
+
* @example
|
|
16634
|
+
* ```ts
|
|
16635
|
+
* import { compileAndExpand } from "@effected/walker"
|
|
16636
|
+
* import { GlobPatternOptions } from "@effected/glob"
|
|
16637
|
+
*
|
|
16638
|
+
* const files = yield* compileAndExpand("packages/*/src/**/*.ts", {
|
|
16639
|
+
* cwd: "/repo",
|
|
16640
|
+
* glob: GlobPatternOptions.make({ dot: true })
|
|
16641
|
+
* })
|
|
16642
|
+
* ```
|
|
16643
|
+
*
|
|
16644
|
+
* @public
|
|
16645
|
+
*/
|
|
16646
|
+
const compileAndExpand = effect.Effect.fn("Walker.compileAndExpand")(function* (pattern, options) {
|
|
16647
|
+
const compiled = GlobPattern.compileResult(pattern, options.glob);
|
|
16648
|
+
if (effect.Result.isFailure(compiled)) return yield* new GlobExpansionError({
|
|
16649
|
+
pattern,
|
|
16650
|
+
cause: compiled.failure
|
|
16651
|
+
});
|
|
16652
|
+
return yield* descend(compiled.success, options).pipe(effect.Effect.mapError((cause) => new GlobExpansionError({
|
|
16653
|
+
pattern,
|
|
16654
|
+
cause
|
|
16655
|
+
})));
|
|
16656
|
+
});
|
|
16657
|
+
//#endregion
|
|
16658
|
+
//#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
|
|
16025
16659
|
/**
|
|
16026
16660
|
* Ascend from `start` toward the filesystem root, yielding each directory,
|
|
16027
16661
|
* nearest first.
|
|
@@ -16035,17 +16669,28 @@ const descend = effect.Effect.fn("Walker.descend")(function* (pattern, options)
|
|
|
16035
16669
|
* Bounded twice over: `dirname` is a fixpoint at the root, and `maxDepth` guards
|
|
16036
16670
|
* a pathological `Path` implementation that never reaches one.
|
|
16037
16671
|
*
|
|
16672
|
+
* `stopAt` is compared in normalized form — see {@link AscendOptions.stopAt}.
|
|
16673
|
+
* Raw string equality made the ceiling fail OPEN: an unnormalized ceiling
|
|
16674
|
+
* matched nothing and the ascent ran silently to the filesystem root, which is
|
|
16675
|
+
* the unbounded walk the option exists to prevent, with no error to notice it
|
|
16676
|
+
* by. A relative ceiling **dies** for the same reason — resolving one against
|
|
16677
|
+
* `process.cwd()` would reintroduce the silent-wrong-walk failure through a
|
|
16678
|
+
* different door. See {@link AscendOptions.stopAt} for why that is a defect
|
|
16679
|
+
* rather than a typed error; the error channel stays `never`.
|
|
16680
|
+
*
|
|
16038
16681
|
* @public
|
|
16039
16682
|
*/
|
|
16040
16683
|
const ascend = (start, options) => effect.Effect.gen(function* () {
|
|
16041
16684
|
const path = yield* effect.Path.Path;
|
|
16042
16685
|
const maxDepth = options?.maxDepth ?? 256;
|
|
16043
16686
|
if (!Number.isInteger(maxDepth) || maxDepth < 1) return yield* effect.Effect.die(/* @__PURE__ */ new Error(`Walker.ascend: maxDepth must be a positive integer, received ${maxDepth}`));
|
|
16687
|
+
if (options?.stopAt !== void 0 && !path.isAbsolute(options.stopAt)) return yield* effect.Effect.die(/* @__PURE__ */ new Error(`Walker.ascend: stopAt must be an absolute path, received ${JSON.stringify(options.stopAt)} (ascending from ${JSON.stringify(start)})`));
|
|
16688
|
+
const ceiling = options?.stopAt === void 0 ? void 0 : path.resolve(options.stopAt);
|
|
16044
16689
|
const dirs = [];
|
|
16045
16690
|
let current = start;
|
|
16046
16691
|
for (let depth = 0; depth < maxDepth; depth++) {
|
|
16047
16692
|
dirs.push(current);
|
|
16048
|
-
if (
|
|
16693
|
+
if (ceiling !== void 0 && (current === ceiling || path.resolve(current) === ceiling)) break;
|
|
16049
16694
|
const parent = path.dirname(current);
|
|
16050
16695
|
if (parent === current) break;
|
|
16051
16696
|
current = parent;
|
|
@@ -16111,7 +16756,7 @@ const Walker$1 = {
|
|
|
16111
16756
|
findRoot: findRoot$1
|
|
16112
16757
|
};
|
|
16113
16758
|
//#endregion
|
|
16114
|
-
//#region ../../node_modules/.pnpm/@effected+workspaces@0.
|
|
16759
|
+
//#region ../../node_modules/.pnpm/@effected+workspaces@0.6.0_@effected+jsonc@0.5.0_effect@4.0.0-beta.99__effect@4.0.0-beta.99/node_modules/@effected/workspaces/WorkspaceRoot.js
|
|
16115
16760
|
/**
|
|
16116
16761
|
* The marker filenames {@link WorkspaceRoot} probes for, in priority order.
|
|
16117
16762
|
*
|
|
@@ -16131,11 +16776,22 @@ var WorkspaceRootNotFoundError = class extends effect.Schema.TaggedErrorClass()(
|
|
|
16131
16776
|
/** The directory the ascent started from. */
|
|
16132
16777
|
searchPath: effect.Schema.String,
|
|
16133
16778
|
/** The marker filenames probed at each ancestor. */
|
|
16134
|
-
markers: effect.Schema.Array(effect.Schema.String)
|
|
16779
|
+
markers: effect.Schema.Array(effect.Schema.String),
|
|
16780
|
+
/**
|
|
16781
|
+
* The resolved ceiling the ascent was bounded by, when one was supplied.
|
|
16782
|
+
*
|
|
16783
|
+
* @remarks
|
|
16784
|
+
* Absent means the ascent ran to the filesystem root. Its presence is what
|
|
16785
|
+
* lets a caller tell "there is no workspace root anywhere above me" from
|
|
16786
|
+
* "there is none below the ceiling I set" — two failures that otherwise
|
|
16787
|
+
* render identically.
|
|
16788
|
+
*/
|
|
16789
|
+
stopAt: effect.Schema.optionalKey(effect.Schema.String)
|
|
16135
16790
|
}) {
|
|
16136
|
-
/** Renders the search path
|
|
16791
|
+
/** Renders the search path, probed markers and any ceiling into a one-line message. */
|
|
16137
16792
|
get message() {
|
|
16138
|
-
|
|
16793
|
+
const bound = this.stopAt === void 0 ? "" : ` up to ${this.stopAt}`;
|
|
16794
|
+
return `No workspace root above ${this.searchPath}${bound} (looked for ${this.markers.join(", ")})`;
|
|
16139
16795
|
}
|
|
16140
16796
|
};
|
|
16141
16797
|
/**
|
|
@@ -16158,6 +16814,12 @@ const isWorkspaceRoot = (dir) => effect.Effect.gen(function* () {
|
|
|
16158
16814
|
}).pipe(effect.Effect.orElseSucceed(() => ({})));
|
|
16159
16815
|
return parsed.workspaces !== void 0 && parsed.workspaces !== null;
|
|
16160
16816
|
});
|
|
16817
|
+
/** Whether `descendant` is `ancestor` itself or lies beneath it, on POSIX or win32 separators. */
|
|
16818
|
+
const isAtOrBelow = (descendant, ancestor) => {
|
|
16819
|
+
if (descendant === ancestor) return true;
|
|
16820
|
+
const prefix = ancestor.endsWith("/") || ancestor.endsWith("\\") ? ancestor : `${ancestor}/`;
|
|
16821
|
+
return descendant.startsWith(prefix) || descendant.startsWith(prefix.replace(/\/$/, "\\"));
|
|
16822
|
+
};
|
|
16161
16823
|
/**
|
|
16162
16824
|
* Locates the workspace root by ascending from a starting directory.
|
|
16163
16825
|
*
|
|
@@ -16172,6 +16834,20 @@ const isWorkspaceRoot = (dir) => effect.Effect.gen(function* () {
|
|
|
16172
16834
|
* });
|
|
16173
16835
|
* ```
|
|
16174
16836
|
*
|
|
16837
|
+
* @example
|
|
16838
|
+
* Bounded: an unmarked fixture directory fails typed instead of escaping into
|
|
16839
|
+
* the enclosing repository.
|
|
16840
|
+
*
|
|
16841
|
+
* ```ts
|
|
16842
|
+
* import { WorkspaceRoot } from "@effected/workspaces";
|
|
16843
|
+
* import { Effect } from "effect";
|
|
16844
|
+
*
|
|
16845
|
+
* const program = Effect.gen(function* () {
|
|
16846
|
+
* const roots = yield* WorkspaceRoot;
|
|
16847
|
+
* return yield* roots.find("/tmp/fixture/packages/a", { stopAt: "/tmp/fixture" });
|
|
16848
|
+
* });
|
|
16849
|
+
* ```
|
|
16850
|
+
*
|
|
16175
16851
|
* @public
|
|
16176
16852
|
*/
|
|
16177
16853
|
var WorkspaceRoot = class WorkspaceRoot extends effect.Context.Service()("@effected/workspaces/WorkspaceRoot") {
|
|
@@ -16179,24 +16855,95 @@ var WorkspaceRoot = class WorkspaceRoot extends effect.Context.Service()("@effec
|
|
|
16179
16855
|
static make = effect.Effect.gen(function* () {
|
|
16180
16856
|
const fs = yield* effect.FileSystem.FileSystem;
|
|
16181
16857
|
const path = yield* effect.Path.Path;
|
|
16182
|
-
const find = effect.Effect.fn("WorkspaceRoot.find")(function* (cwd) {
|
|
16858
|
+
const find = effect.Effect.fn("WorkspaceRoot.find")(function* (cwd, options) {
|
|
16183
16859
|
const start = path.resolve(cwd);
|
|
16184
|
-
const
|
|
16860
|
+
const ceiling = options?.stopAt === void 0 ? void 0 : path.resolve(options.stopAt);
|
|
16861
|
+
const chain = yield* Walker$1.ascend(start, {
|
|
16862
|
+
...ceiling === void 0 ? {} : { stopAt: ceiling },
|
|
16863
|
+
...options?.maxDepth === void 0 ? {} : { maxDepth: options.maxDepth }
|
|
16864
|
+
});
|
|
16185
16865
|
const found = yield* Walker$1.findRoot(chain, isWorkspaceRoot);
|
|
16186
16866
|
if (effect.Option.isNone(found)) return yield* effect.Effect.fail(new WorkspaceRootNotFoundError({
|
|
16187
16867
|
searchPath: start,
|
|
16188
|
-
markers: WORKSPACE_MARKERS
|
|
16868
|
+
markers: WORKSPACE_MARKERS,
|
|
16869
|
+
...ceiling === void 0 ? {} : { stopAt: ceiling }
|
|
16189
16870
|
}));
|
|
16190
16871
|
yield* effect.Effect.logDebug("Workspace root found").pipe(effect.Effect.annotateLogs("workspace.root", found.value));
|
|
16191
16872
|
return found.value;
|
|
16192
16873
|
});
|
|
16193
|
-
return { find: (cwd) => find(cwd).pipe(effect.Effect.provideService(effect.FileSystem.FileSystem, fs), effect.Effect.provideService(effect.Path.Path, path)) };
|
|
16874
|
+
return { find: (cwd, options) => find(cwd, options).pipe(effect.Effect.provideService(effect.FileSystem.FileSystem, fs), effect.Effect.provideService(effect.Path.Path, path)) };
|
|
16194
16875
|
});
|
|
16195
16876
|
/** The live layer. */
|
|
16196
16877
|
static layer = effect.Layer.effect(WorkspaceRoot, WorkspaceRoot.make);
|
|
16878
|
+
/**
|
|
16879
|
+
* A test double resolving every `find` to `root`, with no filesystem.
|
|
16880
|
+
*
|
|
16881
|
+
* @remarks
|
|
16882
|
+
* The nine-copies-of-a-four-line-mock case — a `Layer.succeed` over a `find`
|
|
16883
|
+
* that ignores its arguments and succeeds with a fixed root is what consumers
|
|
16884
|
+
* were writing by hand. The difference is that this double **honours
|
|
16885
|
+
* `stopAt`**: a hand-rolled `find` that ignores the ceiling makes a bounded
|
|
16886
|
+
* call pass under test and fail against the live service, which is the
|
|
16887
|
+
* failure mode the option exists to catch. A `root` above the ceiling fails
|
|
16888
|
+
* here exactly as it would live, with the same
|
|
16889
|
+
* {@link WorkspaceRootNotFoundError}.
|
|
16890
|
+
*
|
|
16891
|
+
* The ceiling is `path.resolve`d through the injected `Path` service before
|
|
16892
|
+
* the comparison, exactly as the live `make` path does — so a `stopAt`
|
|
16893
|
+
* carrying `..` segments bounds the double identically to the live service,
|
|
16894
|
+
* not by raw string. This is why `makeTest` yields an `Effect` requiring
|
|
16895
|
+
* `Path`: it captures the service once at construction, the same shape as
|
|
16896
|
+
* `make`. Consumers reach for {@link WorkspaceRoot.layerTest}, which provides
|
|
16897
|
+
* `Path.layer` internally, so the requirement never surfaces at their call
|
|
16898
|
+
* site.
|
|
16899
|
+
*
|
|
16900
|
+
* `maxDepth` is deliberately NOT modelled: the double does not walk, so it has
|
|
16901
|
+
* no depth to cap, and pretending otherwise would encode a fiction. A suite
|
|
16902
|
+
* exercising the depth guard wants the live service over a fixture tree.
|
|
16903
|
+
*
|
|
16904
|
+
* @param root - The root every unbounded `find` resolves to.
|
|
16905
|
+
*/
|
|
16906
|
+
static makeTest = (root) => effect.Effect.gen(function* () {
|
|
16907
|
+
const path = yield* effect.Path.Path;
|
|
16908
|
+
return { find: (cwd, options) => options?.stopAt !== void 0 && !isAtOrBelow(root, path.resolve(options.stopAt)) ? effect.Effect.fail(new WorkspaceRootNotFoundError({
|
|
16909
|
+
searchPath: cwd,
|
|
16910
|
+
markers: WORKSPACE_MARKERS,
|
|
16911
|
+
stopAt: options.stopAt
|
|
16912
|
+
})) : effect.Effect.succeed(root) };
|
|
16913
|
+
});
|
|
16914
|
+
/**
|
|
16915
|
+
* The test layer: {@link WorkspaceRoot.makeTest} with `Path.layer` provided.
|
|
16916
|
+
*
|
|
16917
|
+
* @remarks
|
|
16918
|
+
* `makeTest` requires `Path` to normalize the `stopAt` ceiling; this layer
|
|
16919
|
+
* supplies core's `Path.layer` internally, so the requirement never reaches a
|
|
16920
|
+
* consumer — the published type stays `Layer.Layer<WorkspaceRoot>`.
|
|
16921
|
+
*
|
|
16922
|
+
* A parameterized layer factory mints a **fresh reference per call**, and
|
|
16923
|
+
* layers memoize by reference — bind the result to a `const` and reuse it
|
|
16924
|
+
* rather than calling `layerTest(...)` at each composition site.
|
|
16925
|
+
*
|
|
16926
|
+
* Pair it with `WorkspaceDiscovery.layerTest` to stand up the whole discovery
|
|
16927
|
+
* path without a filesystem; between them there is nothing left for a
|
|
16928
|
+
* module-level mock of `@effected/workspaces` to do, and a provided layer
|
|
16929
|
+
* keeps the service graph — and its typed errors — intact.
|
|
16930
|
+
*
|
|
16931
|
+
* @example
|
|
16932
|
+
* ```ts
|
|
16933
|
+
* import { WorkspaceDiscovery, WorkspaceRoot } from "@effected/workspaces";
|
|
16934
|
+
* import { Effect } from "effect";
|
|
16935
|
+
*
|
|
16936
|
+
* const TestRoot = WorkspaceRoot.layerTest("/repo");
|
|
16937
|
+
* const TestDiscovery = WorkspaceDiscovery.layerTest({
|
|
16938
|
+
* listPackages: () => Effect.succeed([]),
|
|
16939
|
+
* });
|
|
16940
|
+
* // program.pipe(Effect.provide(TestRoot), Effect.provide(TestDiscovery))
|
|
16941
|
+
* ```
|
|
16942
|
+
*/
|
|
16943
|
+
static layerTest = (root) => effect.Layer.effect(WorkspaceRoot, WorkspaceRoot.makeTest(root)).pipe(effect.Layer.provide(effect.Path.layer));
|
|
16197
16944
|
};
|
|
16198
16945
|
//#endregion
|
|
16199
|
-
//#region ../../node_modules/.pnpm/@effected+workspaces@0.
|
|
16946
|
+
//#region ../../node_modules/.pnpm/@effected+workspaces@0.6.0_@effected+jsonc@0.5.0_effect@4.0.0-beta.99__effect@4.0.0-beta.99/node_modules/@effected/workspaces/internal/limits.js
|
|
16200
16947
|
/**
|
|
16201
16948
|
* Hard ceiling on directories the enumerator will visit for one pattern set.
|
|
16202
16949
|
* Guards the pathological case a depth cap alone does not: a wide, shallow
|
|
@@ -16214,7 +16961,7 @@ const MAX_ENUMERATION_ENTRIES = 1e5;
|
|
|
16214
16961
|
*/
|
|
16215
16962
|
const PRUNED_DIRECTORIES = /* @__PURE__ */ new Set([".git", "node_modules"]);
|
|
16216
16963
|
//#endregion
|
|
16217
|
-
//#region ../../node_modules/.pnpm/@effected+workspaces@0.
|
|
16964
|
+
//#region ../../node_modules/.pnpm/@effected+workspaces@0.6.0_@effected+jsonc@0.5.0_effect@4.0.0-beta.99__effect@4.0.0-beta.99/node_modules/@effected/workspaces/internal/traverse.js
|
|
16218
16965
|
/** Directory names never descended into. */
|
|
16219
16966
|
const isPruned = (entry) => PRUNED_DIRECTORIES.has(entry);
|
|
16220
16967
|
/** Join root-relative POSIX segments; `""` is the root itself. */
|
|
@@ -16304,7 +17051,7 @@ var Traversal = class {
|
|
|
16304
17051
|
}
|
|
16305
17052
|
};
|
|
16306
17053
|
//#endregion
|
|
16307
|
-
//#region ../../node_modules/.pnpm/@effected+workspaces@0.
|
|
17054
|
+
//#region ../../node_modules/.pnpm/@effected+workspaces@0.6.0_@effected+jsonc@0.5.0_effect@4.0.0-beta.99__effect@4.0.0-beta.99/node_modules/@effected/workspaces/internal/enumerate.js
|
|
16308
17055
|
/** Strip a trailing slash from `GlobPattern.enumerationPrefix` to get a relative directory. */
|
|
16309
17056
|
const baseOf = (pattern) => pattern.enumerationPrefix.replace(/\/$/, "");
|
|
16310
17057
|
/**
|
|
@@ -16374,7 +17121,7 @@ const enumerate = (root, globs, options) => effect.Effect.gen(function* () {
|
|
|
16374
17121
|
return results;
|
|
16375
17122
|
});
|
|
16376
17123
|
//#endregion
|
|
16377
|
-
//#region ../../node_modules/.pnpm/@effected+workspaces@0.
|
|
17124
|
+
//#region ../../node_modules/.pnpm/@effected+workspaces@0.6.0_@effected+jsonc@0.5.0_effect@4.0.0-beta.99__effect@4.0.0-beta.99/node_modules/@effected/workspaces/internal/patterns.js
|
|
16378
17125
|
const stringsOf = (value) => Array.isArray(value) ? value.filter((entry) => typeof entry === "string") : void 0;
|
|
16379
17126
|
/** The `packages:` list of a `pnpm-workspace.yaml` document. Total on a parsed document. */
|
|
16380
17127
|
const pnpmPatternsOf = (document) => {
|
|
@@ -16431,7 +17178,7 @@ const readPatterns = (root) => effect.Effect.gen(function* () {
|
|
|
16431
17178
|
return manifestPatternsOf(manifest);
|
|
16432
17179
|
});
|
|
16433
17180
|
//#endregion
|
|
16434
|
-
//#region ../../node_modules/.pnpm/@effected+workspaces@0.
|
|
17181
|
+
//#region ../../node_modules/.pnpm/@effected+workspaces@0.6.0_@effected+jsonc@0.5.0_effect@4.0.0-beta.99__effect@4.0.0-beta.99/node_modules/@effected/workspaces/WorkspaceDiscovery.js
|
|
16435
17182
|
/**
|
|
16436
17183
|
* Raised when a workspace member's `package.json` cannot be read, parsed, or
|
|
16437
17184
|
* used — it is missing, malformed, or lacks a `name` or `version`.
|
|
@@ -16609,6 +17356,7 @@ var WorkspaceDiscovery = class WorkspaceDiscovery extends effect.Context.Service
|
|
|
16609
17356
|
path: directory,
|
|
16610
17357
|
packageJsonPath,
|
|
16611
17358
|
relativePath,
|
|
17359
|
+
workspaceRoot: root,
|
|
16612
17360
|
manifestRecord: raw,
|
|
16613
17361
|
...typeof raw.private === "boolean" ? { private: raw.private } : {},
|
|
16614
17362
|
...isStringRecord$2(raw.dependencies) ? { dependencies: raw.dependencies } : {},
|
|
@@ -16766,6 +17514,7 @@ var WorkspaceDiscovery = class WorkspaceDiscovery extends effect.Context.Service
|
|
|
16766
17514
|
* path: "/repo/packages/utils",
|
|
16767
17515
|
* packageJsonPath: "/repo/packages/utils/package.json",
|
|
16768
17516
|
* relativePath: "packages/utils",
|
|
17517
|
+
* workspaceRoot: "/repo",
|
|
16769
17518
|
* }),
|
|
16770
17519
|
* ]),
|
|
16771
17520
|
* });
|
|
@@ -16863,7 +17612,7 @@ var WorkspaceDiscovery = class WorkspaceDiscovery extends effect.Context.Service
|
|
|
16863
17612
|
};
|
|
16864
17613
|
const isStringRecord$2 = (value) => value !== null && typeof value === "object" && !Array.isArray(value) && Object.values(value).every((entry) => typeof entry === "string");
|
|
16865
17614
|
//#endregion
|
|
16866
|
-
//#region ../../node_modules/.pnpm/@effected+workspaces@0.
|
|
17615
|
+
//#region ../../node_modules/.pnpm/@effected+workspaces@0.6.0_@effected+jsonc@0.5.0_effect@4.0.0-beta.99__effect@4.0.0-beta.99/node_modules/@effected/workspaces/DependencyGraph.js
|
|
16867
17616
|
/**
|
|
16868
17617
|
* Raised when the workspace dependency graph cannot be topologically ordered
|
|
16869
17618
|
* because it contains a cycle.
|
|
@@ -18461,7 +19210,7 @@ var Git = class extends effect.Context.Service()("@effected/git/Git") {
|
|
|
18461
19210
|
}));
|
|
18462
19211
|
};
|
|
18463
19212
|
//#endregion
|
|
18464
|
-
//#region ../../node_modules/.pnpm/@effected+workspaces@0.
|
|
19213
|
+
//#region ../../node_modules/.pnpm/@effected+workspaces@0.6.0_@effected+jsonc@0.5.0_effect@4.0.0-beta.99__effect@4.0.0-beta.99/node_modules/@effected/workspaces/ChangeDetector.js
|
|
18465
19214
|
/**
|
|
18466
19215
|
* Which git refs to compare, and whether to fold in the working tree.
|
|
18467
19216
|
*
|
|
@@ -18713,7 +19462,7 @@ function resolveFromCatalog(catalogs, wantedDependency) {
|
|
|
18713
19462
|
};
|
|
18714
19463
|
}
|
|
18715
19464
|
//#endregion
|
|
18716
|
-
//#region ../../node_modules/.pnpm/@effected+workspaces@0.
|
|
19465
|
+
//#region ../../node_modules/.pnpm/@effected+workspaces@0.6.0_@effected+jsonc@0.5.0_effect@4.0.0-beta.99__effect@4.0.0-beta.99/node_modules/@effected/workspaces/internal/catalogs.js
|
|
18717
19466
|
/** Project a pnpm-workspace manifest's `catalog` / `catalogs` fields into a `Catalogs` map. */
|
|
18718
19467
|
const inlineCatalogs = (manifest) => {
|
|
18719
19468
|
if (manifest.catalog === void 0 && manifest.catalogs === void 0) return {};
|
|
@@ -18777,7 +19526,7 @@ const rangeOf = (catalogs, dependency, specifier) => {
|
|
|
18777
19526
|
});
|
|
18778
19527
|
};
|
|
18779
19528
|
//#endregion
|
|
18780
|
-
//#region ../../node_modules/.pnpm/@effected+workspaces@0.
|
|
19529
|
+
//#region ../../node_modules/.pnpm/@effected+workspaces@0.6.0_@effected+jsonc@0.5.0_effect@4.0.0-beta.99__effect@4.0.0-beta.99/node_modules/@effected/workspaces/ConfigDependencyHooks.js
|
|
18781
19530
|
/** Whether `value` is a non-null, non-array object. */
|
|
18782
19531
|
const isObject$2 = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
18783
19532
|
/**
|
|
@@ -18812,17 +19561,45 @@ const seedToConfig = (seed) => {
|
|
|
18812
19561
|
else catalogs[name] = { ...entries };
|
|
18813
19562
|
return {
|
|
18814
19563
|
catalog,
|
|
18815
|
-
catalogs
|
|
19564
|
+
catalogs,
|
|
19565
|
+
minimumReleaseAge: void 0,
|
|
19566
|
+
minimumReleaseAgeExclude: void 0
|
|
18816
19567
|
};
|
|
18817
19568
|
};
|
|
18818
|
-
/**
|
|
19569
|
+
/** A finite number if `value` is one, else the prior threaded value — a garbage age is dropped, not fatal. */
|
|
19570
|
+
const finiteNumberOr = (value, fallback) => typeof value === "number" && Number.isFinite(value) ? value : fallback;
|
|
19571
|
+
/** A string array if `value` is one, else the prior threaded value — a malformed exclude is dropped, not fatal. */
|
|
19572
|
+
const stringArrayOr = (value, fallback) => Array.isArray(value) && value.every((entry) => typeof entry === "string") ? value : fallback;
|
|
19573
|
+
/**
|
|
19574
|
+
* Read the catalog slice and the release-age keys back out of whatever a hook
|
|
19575
|
+
* returned, threading the prior config as the fallback.
|
|
19576
|
+
*
|
|
19577
|
+
* @remarks
|
|
19578
|
+
* Tolerant by design, matching this seam's discipline: a hook's returned *data*
|
|
19579
|
+
* is normalized, never a typed failure (only a load/replay *mechanism* failure
|
|
19580
|
+
* raises `CatalogAssemblyError`). A hook that omits a key, or returns a
|
|
19581
|
+
* malformed value for it, leaves the prior threaded value in place; a hook that
|
|
19582
|
+
* sets a well-formed key rewrites it — so across hooks the **last well-formed
|
|
19583
|
+
* write wins**, exactly as pnpm's single mutable config object behaves.
|
|
19584
|
+
*/
|
|
18819
19585
|
const configOf = (value, fallback) => {
|
|
18820
19586
|
if (!isObject$2(value)) return fallback;
|
|
18821
19587
|
return {
|
|
18822
19588
|
catalog: isObject$2(value.catalog) ? value.catalog : fallback.catalog,
|
|
18823
|
-
catalogs: isObject$2(value.catalogs) ? value.catalogs : fallback.catalogs
|
|
19589
|
+
catalogs: isObject$2(value.catalogs) ? value.catalogs : fallback.catalogs,
|
|
19590
|
+
minimumReleaseAge: finiteNumberOr(value.minimumReleaseAge, fallback.minimumReleaseAge),
|
|
19591
|
+
minimumReleaseAgeExclude: stringArrayOr(value.minimumReleaseAgeExclude, fallback.minimumReleaseAgeExclude)
|
|
18824
19592
|
};
|
|
18825
19593
|
};
|
|
19594
|
+
/**
|
|
19595
|
+
* Project the threaded config's release-age keys into a partial gate
|
|
19596
|
+
* contribution, omitting a key the hooks never set (never an explicit
|
|
19597
|
+
* `undefined` — the fields are `optionalKey`).
|
|
19598
|
+
*/
|
|
19599
|
+
const releaseAgeOf = (config) => ({
|
|
19600
|
+
...config.minimumReleaseAge !== void 0 ? { ageMinutes: config.minimumReleaseAge } : {},
|
|
19601
|
+
...config.minimumReleaseAgeExclude !== void 0 ? { exclude: config.minimumReleaseAgeExclude } : {}
|
|
19602
|
+
});
|
|
18826
19603
|
/** Fold the hook config back into the normalized `catalog name → dependency → range` record. */
|
|
18827
19604
|
const configToEntries = (config) => {
|
|
18828
19605
|
const raw = { ...config.catalogs };
|
|
@@ -18862,7 +19639,10 @@ var ConfigDependencyHooks = class ConfigDependencyHooks extends effect.Context.S
|
|
|
18862
19639
|
* config dependency. The default {@link WorkspaceCatalogs} layer wires this, so
|
|
18863
19640
|
* the default catalog path provably executes no config-dependency code.
|
|
18864
19641
|
*/
|
|
18865
|
-
static layerNoop = effect.Layer.succeed(ConfigDependencyHooks, { inject: (_root, _configDependencies, seed) => effect.Effect.succeed(
|
|
19642
|
+
static layerNoop = effect.Layer.succeed(ConfigDependencyHooks, { inject: (_root, _configDependencies, seed) => effect.Effect.succeed({
|
|
19643
|
+
catalogs: seed,
|
|
19644
|
+
releaseAge: {}
|
|
19645
|
+
}) });
|
|
18866
19646
|
/**
|
|
18867
19647
|
* The live layer: dynamically imports each config dependency's `pnpmfile.cjs`
|
|
18868
19648
|
* (in process, no subprocess) and replays its `updateConfig` hook over the
|
|
@@ -18871,13 +19651,20 @@ var ConfigDependencyHooks = class ConfigDependencyHooks extends effect.Context.S
|
|
|
18871
19651
|
* `hooks`-source `CatalogAssemblyError`, never a silent skip.
|
|
18872
19652
|
*
|
|
18873
19653
|
* @remarks
|
|
18874
|
-
*
|
|
18875
|
-
*
|
|
18876
|
-
*
|
|
19654
|
+
* Runtime-coupled by design, not node-exclusive. The `import()` below loads
|
|
19655
|
+
* **and executes** a config dependency's pnpmfile in-process — code execution,
|
|
19656
|
+
* not IO, so no `FileSystem` / `Path` service abstracts it. The `node:path` and
|
|
19657
|
+
* `node:url` imports (`join`, `pathToFileURL`) exist only to build the URL that
|
|
19658
|
+
* `import()` consumes; node and bun both implement those builtins and dynamic
|
|
19659
|
+
* import, so this layer runs on either runtime. Only ever wired by
|
|
19660
|
+
* `WorkspaceCatalogs.layerWithConfigDependencies`.
|
|
18877
19661
|
*/
|
|
18878
19662
|
static layerLive = effect.Layer.succeed(ConfigDependencyHooks, { inject: (root, configDependencies, seed) => effect.Effect.gen(function* () {
|
|
18879
19663
|
const names = Object.keys(configDependencies);
|
|
18880
|
-
if (names.length === 0) return
|
|
19664
|
+
if (names.length === 0) return {
|
|
19665
|
+
catalogs: seed,
|
|
19666
|
+
releaseAge: {}
|
|
19667
|
+
};
|
|
18881
19668
|
let config = seedToConfig(seed);
|
|
18882
19669
|
for (const name of names) {
|
|
18883
19670
|
if (hasTraversalSegment(name)) return yield* effect.Effect.fail(new CatalogAssemblyError({
|
|
@@ -18918,11 +19705,14 @@ var ConfigDependencyHooks = class ConfigDependencyHooks extends effect.Context.S
|
|
|
18918
19705
|
})
|
|
18919
19706
|
});
|
|
18920
19707
|
}
|
|
18921
|
-
return
|
|
19708
|
+
return {
|
|
19709
|
+
catalogs: configToEntries(config),
|
|
19710
|
+
releaseAge: releaseAgeOf(config)
|
|
19711
|
+
};
|
|
18922
19712
|
}) });
|
|
18923
19713
|
};
|
|
18924
19714
|
//#endregion
|
|
18925
|
-
//#region ../../node_modules/.pnpm/@effected+workspaces@0.
|
|
19715
|
+
//#region ../../node_modules/.pnpm/@effected+workspaces@0.6.0_@effected+jsonc@0.5.0_effect@4.0.0-beta.99__effect@4.0.0-beta.99/node_modules/@effected/workspaces/PackageManagerName.js
|
|
18926
19716
|
/**
|
|
18927
19717
|
* The four package managers this package understands.
|
|
18928
19718
|
*
|
|
@@ -19164,7 +19954,7 @@ var PackageManagerDetector = class PackageManagerDetector extends effect.Context
|
|
|
19164
19954
|
static layer = effect.Layer.effect(PackageManagerDetector, PackageManagerDetector.make);
|
|
19165
19955
|
};
|
|
19166
19956
|
//#endregion
|
|
19167
|
-
//#region ../../node_modules/.pnpm/@effected+workspaces@0.
|
|
19957
|
+
//#region ../../node_modules/.pnpm/@effected+workspaces@0.6.0_@effected+jsonc@0.5.0_effect@4.0.0-beta.99__effect@4.0.0-beta.99/node_modules/@effected/workspaces/LockfileReader.js
|
|
19168
19958
|
/**
|
|
19169
19959
|
* Raised when the workspace's lockfile cannot be read off disk.
|
|
19170
19960
|
*
|
|
@@ -19274,7 +20064,7 @@ var LockfileReader = class LockfileReader extends effect.Context.Service()("@eff
|
|
|
19274
20064
|
static layer = (options) => effect.Layer.effect(LockfileReader, LockfileReader.make(options));
|
|
19275
20065
|
};
|
|
19276
20066
|
//#endregion
|
|
19277
|
-
//#region ../../node_modules/.pnpm/@effected+workspaces@0.
|
|
20067
|
+
//#region ../../node_modules/.pnpm/@effected+workspaces@0.6.0_@effected+jsonc@0.5.0_effect@4.0.0-beta.99__effect@4.0.0-beta.99/node_modules/@effected/workspaces/Publishability.js
|
|
19278
20068
|
/** The public npm registry, used when `publishConfig.registry` says nothing. */
|
|
19279
20069
|
const DEFAULT_REGISTRY = "https://registry.npmjs.org/";
|
|
19280
20070
|
/**
|
|
@@ -19374,7 +20164,7 @@ var PublishabilityDetector = class PublishabilityDetector extends effect.Context
|
|
|
19374
20164
|
}) });
|
|
19375
20165
|
};
|
|
19376
20166
|
//#endregion
|
|
19377
|
-
//#region ../../node_modules/.pnpm/@effected+workspaces@0.
|
|
20167
|
+
//#region ../../node_modules/.pnpm/@effected+workspaces@0.6.0_@effected+jsonc@0.5.0_effect@4.0.0-beta.99__effect@4.0.0-beta.99/node_modules/@effected/workspaces/WorkspaceCatalogs.js
|
|
19378
20168
|
/**
|
|
19379
20169
|
* An immutable, fully-normalized catalog collection — the one catalog
|
|
19380
20170
|
* resolution semantic in the package.
|
|
@@ -19547,6 +20337,37 @@ const configDependenciesOf = (document) => {
|
|
|
19547
20337
|
for (const [name, spec] of Object.entries(document.configDependencies)) if (typeof spec === "string") out[name] = spec;
|
|
19548
20338
|
return out;
|
|
19549
20339
|
};
|
|
20340
|
+
/**
|
|
20341
|
+
* The inline release-age gate contribution of a parsed `pnpm-workspace.yaml`
|
|
20342
|
+
* document — pnpm's top-level `minimumReleaseAge` (minutes) and
|
|
20343
|
+
* `minimumReleaseAgeExclude` (name patterns) keys, mapped onto
|
|
20344
|
+
* `@effected/npm`'s `PartialReleaseAgeGate` field names
|
|
20345
|
+
* (`ageMinutes` / `exclude`).
|
|
20346
|
+
*
|
|
20347
|
+
* @remarks
|
|
20348
|
+
* **Hard-fail by design**, the same posture as the live catalog-block reader:
|
|
20349
|
+
* a present-but-malformed value (a non-numeric `minimumReleaseAge`, a
|
|
20350
|
+
* `minimumReleaseAgeExclude` that is not a string array) fails typed as a
|
|
20351
|
+
* `CatalogAssemblyError` rather than being silently dropped, because a
|
|
20352
|
+
* silently-ignored gate is the "install refuses a too-young version the
|
|
20353
|
+
* resolver already picked" bug this vocabulary exists to prevent. An absent or
|
|
20354
|
+
* explicitly `null` key contributes nothing; the permissive
|
|
20355
|
+
* `PartialReleaseAgeGate` accepts any finite `ageMinutes` (negatives and
|
|
20356
|
+
* fractions included) — `ReleaseAgeGate.combine` is the single clamping
|
|
20357
|
+
* authority, exactly as on the hook path.
|
|
20358
|
+
*/
|
|
20359
|
+
const inlineReleaseAge = (document) => {
|
|
20360
|
+
if (!isObject$1(document)) return effect.Effect.succeed({});
|
|
20361
|
+
const raw = {};
|
|
20362
|
+
if (document.minimumReleaseAge !== void 0 && document.minimumReleaseAge !== null) raw.ageMinutes = document.minimumReleaseAge;
|
|
20363
|
+
if (document.minimumReleaseAgeExclude !== void 0 && document.minimumReleaseAgeExclude !== null) raw.exclude = document.minimumReleaseAgeExclude;
|
|
20364
|
+
if (Object.keys(raw).length === 0) return effect.Effect.succeed({});
|
|
20365
|
+
return effect.Schema.decodeUnknownEffect(PartialReleaseAgeGate)(raw).pipe(effect.Effect.catchTag("SchemaError", (cause) => new CatalogAssemblyError({
|
|
20366
|
+
source: "manifest",
|
|
20367
|
+
path: "pnpm-workspace.yaml",
|
|
20368
|
+
cause
|
|
20369
|
+
})));
|
|
20370
|
+
};
|
|
19550
20371
|
/** A hard-fail catalog-assembly failure naming the malformed part of a `workspaces` field. */
|
|
19551
20372
|
const malformed = (source, path, detail) => new CatalogAssemblyError({
|
|
19552
20373
|
source,
|
|
@@ -19667,6 +20488,8 @@ var WorkspaceCatalogs = class WorkspaceCatalogs extends effect.Context.Service()
|
|
|
19667
20488
|
const hasPnpmWorkspace = yield* probeExists(workspaceYaml);
|
|
19668
20489
|
let inline;
|
|
19669
20490
|
let injected;
|
|
20491
|
+
let inlineGate = {};
|
|
20492
|
+
let hookGate = {};
|
|
19670
20493
|
if (hasPnpmWorkspace) {
|
|
19671
20494
|
const text = yield* fs.readFileString(workspaceYaml).pipe(effect.Effect.mapError((cause) => new CatalogAssemblyError({
|
|
19672
20495
|
source: "manifest",
|
|
@@ -19680,11 +20503,16 @@ var WorkspaceCatalogs = class WorkspaceCatalogs extends effect.Context.Service()
|
|
|
19680
20503
|
})));
|
|
19681
20504
|
yield* validatePnpmWorkspaceCatalogs(document);
|
|
19682
20505
|
inline = CatalogSet.fromCatalogs(inlineCatalogs(catalogBlocksOf(document)));
|
|
19683
|
-
|
|
19684
|
-
|
|
20506
|
+
inlineGate = yield* inlineReleaseAge(document);
|
|
20507
|
+
const injection = yield* hooks.inject(root, configDependenciesOf(document), inline.entries);
|
|
20508
|
+
injected = CatalogSet.fromCatalogs(injection.catalogs);
|
|
20509
|
+
hookGate = injection.releaseAge;
|
|
19685
20510
|
} else {
|
|
19686
20511
|
const manifestPath = path.join(root, "package.json");
|
|
19687
|
-
if (!(yield* probeExists(manifestPath))) return
|
|
20512
|
+
if (!(yield* probeExists(manifestPath))) return {
|
|
20513
|
+
catalogs: fromLockfile,
|
|
20514
|
+
releaseAgeGate: ReleaseAgeGate.combine()
|
|
20515
|
+
};
|
|
19688
20516
|
const text = yield* fs.readFileString(manifestPath).pipe(effect.Effect.mapError((cause) => new CatalogAssemblyError({
|
|
19689
20517
|
source: "manifest",
|
|
19690
20518
|
path: manifestPath,
|
|
@@ -19694,20 +20522,28 @@ var WorkspaceCatalogs = class WorkspaceCatalogs extends effect.Context.Service()
|
|
|
19694
20522
|
injected = CatalogSet.empty();
|
|
19695
20523
|
}
|
|
19696
20524
|
const assembled = CatalogSet.merge(fromLockfile, inline, injected);
|
|
20525
|
+
const releaseAgeGate = ReleaseAgeGate.combine(inlineGate, hookGate);
|
|
19697
20526
|
yield* effect.Effect.logDebug("Catalogs assembled").pipe(effect.Effect.annotateLogs({
|
|
19698
20527
|
"workspace.root": root,
|
|
19699
|
-
"workspace.catalogs": Object.keys(assembled.entries).join(",")
|
|
20528
|
+
"workspace.catalogs": Object.keys(assembled.entries).join(","),
|
|
20529
|
+
"workspace.releaseAgeMinutes": releaseAgeGate.ageMinutes
|
|
19700
20530
|
}));
|
|
19701
|
-
return
|
|
20531
|
+
return {
|
|
20532
|
+
catalogs: assembled,
|
|
20533
|
+
releaseAgeGate
|
|
20534
|
+
};
|
|
19702
20535
|
});
|
|
19703
20536
|
const [resolveOnce, invalidate] = yield* effect.Effect.cachedInvalidateWithTTL(assemble, effect.Duration.infinity);
|
|
19704
20537
|
const memo = effect.Effect.onExit(resolveOnce, (exit) => effect.Exit.isSuccess(exit) ? effect.Effect.void : invalidate);
|
|
19705
20538
|
return {
|
|
19706
20539
|
set: effect.Effect.fn("WorkspaceCatalogs.set")(function* () {
|
|
19707
|
-
return yield* memo;
|
|
20540
|
+
return (yield* memo).catalogs;
|
|
19708
20541
|
}),
|
|
19709
20542
|
resolveSpecifier: effect.Effect.fn("WorkspaceCatalogs.resolveSpecifier")(function* (dependency, specifier) {
|
|
19710
|
-
return (yield* memo).resolveSpecifier(dependency, specifier);
|
|
20543
|
+
return (yield* memo).catalogs.resolveSpecifier(dependency, specifier);
|
|
20544
|
+
}),
|
|
20545
|
+
releaseAgeGate: effect.Effect.fn("WorkspaceCatalogs.releaseAgeGate")(function* () {
|
|
20546
|
+
return (yield* memo).releaseAgeGate;
|
|
19711
20547
|
})
|
|
19712
20548
|
};
|
|
19713
20549
|
});
|
|
@@ -19758,7 +20594,7 @@ var WorkspaceCatalogs = class WorkspaceCatalogs extends effect.Context.Service()
|
|
|
19758
20594
|
}));
|
|
19759
20595
|
};
|
|
19760
20596
|
//#endregion
|
|
19761
|
-
//#region ../../node_modules/.pnpm/@effected+workspaces@0.
|
|
20597
|
+
//#region ../../node_modules/.pnpm/@effected+workspaces@0.6.0_@effected+jsonc@0.5.0_effect@4.0.0-beta.99__effect@4.0.0-beta.99/node_modules/@effected/workspaces/WorkspaceStateSnapshot.js
|
|
19762
20598
|
const EMPTY = Object.freeze(Object.create(null));
|
|
19763
20599
|
const DependencyMap = effect.Schema.Record(effect.Schema.String, effect.Schema.String).pipe(effect.Schema.withDecodingDefaultKey(effect.Effect.succeed(EMPTY)), effect.Schema.withConstructorDefault(effect.Effect.succeed(EMPTY)));
|
|
19764
20600
|
/**
|
|
@@ -19923,7 +20759,7 @@ var WorkspaceStateSnapshot = class extends effect.Schema.Class("WorkspaceStateSn
|
|
|
19923
20759
|
}
|
|
19924
20760
|
};
|
|
19925
20761
|
//#endregion
|
|
19926
|
-
//#region ../../node_modules/.pnpm/@effected+workspaces@0.
|
|
20762
|
+
//#region ../../node_modules/.pnpm/@effected+workspaces@0.6.0_@effected+jsonc@0.5.0_effect@4.0.0-beta.99__effect@4.0.0-beta.99/node_modules/@effected/workspaces/WorkspaceSnapshots.js
|
|
19927
20763
|
/** Whether `value` is a non-null, non-array object. */
|
|
19928
20764
|
const isObject = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
19929
20765
|
/** Whether every value in a record is a string — a usable dependency map. */
|
|
@@ -20115,7 +20951,7 @@ var WorkspaceSnapshots = class WorkspaceSnapshots extends effect.Context.Service
|
|
|
20115
20951
|
static layer = (options) => effect.Layer.effect(WorkspaceSnapshots, WorkspaceSnapshots.make(options));
|
|
20116
20952
|
};
|
|
20117
20953
|
//#endregion
|
|
20118
|
-
//#region ../../node_modules/.pnpm/@effected+workspaces@0.
|
|
20954
|
+
//#region ../../node_modules/.pnpm/@effected+workspaces@0.6.0_@effected+jsonc@0.5.0_effect@4.0.0-beta.99__effect@4.0.0-beta.99/node_modules/@effected/workspaces/Workspaces.js
|
|
20119
20955
|
/**
|
|
20120
20956
|
* Every service that needs only a filesystem: root, package-manager detection,
|
|
20121
20957
|
* discovery, lockfile reading, catalogs and publishability.
|
|
@@ -20483,34 +21319,15 @@ effect.Layer.effect(PublishabilityDetector, effect.Effect.gen(function* () {
|
|
|
20483
21319
|
}) };
|
|
20484
21320
|
}));
|
|
20485
21321
|
/**
|
|
20486
|
-
* The workspace root a package was discovered against, derived from its own
|
|
20487
|
-
* coordinates: `relativePath` is the package directory relative to the
|
|
20488
|
-
* discovery root (POSIX, `"."` for the root package), so ascending one level
|
|
20489
|
-
* per path segment from `pkg.path` lands exactly on that root.
|
|
20490
|
-
*
|
|
20491
|
-
* @remarks
|
|
20492
|
-
* Derivation is deliberate — probing the filesystem for workspace markers
|
|
20493
|
-
* (`WorkspaceRoot.find`) can walk PAST the intended root when that root
|
|
20494
|
-
* carries no marker (a fixture tree, a bare directory) and land on an
|
|
20495
|
-
* enclosing workspace, silently swapping in that outer root's
|
|
20496
|
-
* `.changeset/config.json` and dropping the ignore/mode gating (the #209
|
|
20497
|
-
* regression class). The discovery root needs no probing: whoever built the
|
|
20498
|
-
* `WorkspacePackage` already knew it.
|
|
20499
|
-
*/
|
|
20500
|
-
const packageRoot = (pkg) => {
|
|
20501
|
-
const segments = pkg.relativePath.split("/").filter((segment) => segment !== "" && segment !== ".");
|
|
20502
|
-
return segments.length === 0 ? pkg.path : (0, node_path.join)(pkg.path, ...segments.map(() => ".."));
|
|
20503
|
-
};
|
|
20504
|
-
/**
|
|
20505
21322
|
* Ignore-aware override of `PublishabilityDetector`. `detect` short-circuits to `[]`
|
|
20506
21323
|
* for changeset-ignored packages, then dispatches on `ChangesetConfig.mode`:
|
|
20507
21324
|
* `none` → `[]`; `silk` → `SilkPublishability.detect`; `vanilla` → the library default.
|
|
20508
21325
|
*
|
|
20509
21326
|
* @remarks Requires `FileSystem` and {@link ChangesetConfig} at build.
|
|
20510
21327
|
* The kit's `detect` contract no longer receives the workspace root, so the changeset
|
|
20511
|
-
* lookups
|
|
20512
|
-
*
|
|
20513
|
-
*
|
|
21328
|
+
* lookups read it from `pkg.workspaceRoot` — the discovery root the package was found
|
|
21329
|
+
* against, never a filesystem marker walk, which could escape an unmarked root and read
|
|
21330
|
+
* the wrong `.changeset/config.json`.
|
|
20514
21331
|
*
|
|
20515
21332
|
* @since 0.4.0
|
|
20516
21333
|
* @public
|
|
@@ -20520,7 +21337,7 @@ const PublishabilityDetectorAdaptiveLive = effect.Layer.effect(PublishabilityDet
|
|
|
20520
21337
|
const config = yield* ChangesetConfig;
|
|
20521
21338
|
const vanilla = yield* effect.Effect.provide(PublishabilityDetector, PublishabilityDetector.layer);
|
|
20522
21339
|
return { detect: (pkg) => effect.Effect.gen(function* () {
|
|
20523
|
-
const root =
|
|
21340
|
+
const root = pkg.workspaceRoot;
|
|
20524
21341
|
if (yield* config.isIgnored(pkg.name, root)) return [];
|
|
20525
21342
|
const mode = yield* config.mode(root);
|
|
20526
21343
|
if (mode === "none") return [];
|
|
@@ -45093,25 +45910,15 @@ function normalizeLegacyOptions(options, configPath) {
|
|
|
45093
45910
|
};
|
|
45094
45911
|
}
|
|
45095
45912
|
/** Match dotfiles, mirroring the former tinyglobby `dot: true` behavior. */
|
|
45096
|
-
const GLOB_OPTIONS = GlobPatternOptions.make({ dot: true });
|
|
45913
|
+
const GLOB_OPTIONS$1 = GlobPatternOptions.make({ dot: true });
|
|
45097
45914
|
/**
|
|
45098
|
-
* Compile `glob` via `@effected/glob`, folding a compile-guard trip
|
|
45099
|
-
* (over-length pattern, brace-expansion budget, nesting depth) into a
|
|
45100
|
-
* {@link ConfigurationError} naming the offending glob on the typed channel.
|
|
45101
|
-
*/
|
|
45102
|
-
function compileGlob(glob) {
|
|
45103
|
-
return GlobPattern.compile(glob, GLOB_OPTIONS).pipe(effect.Effect.mapError((error) => new ConfigurationError({
|
|
45104
|
-
field: "glob",
|
|
45105
|
-
reason: `Invalid glob pattern ${JSON.stringify(glob)}: ${error.message}`
|
|
45106
|
-
})));
|
|
45107
|
-
}
|
|
45108
45915
|
/**
|
|
45109
45916
|
* Pure attribution helper: does `glob` (under this service's `dot: true`
|
|
45110
45917
|
* semantics) match the repo-relative POSIX path `rel`? An uncompilable
|
|
45111
45918
|
* pattern matches nothing.
|
|
45112
45919
|
*/
|
|
45113
45920
|
function globMatchesRel(glob, rel) {
|
|
45114
|
-
const result =
|
|
45921
|
+
const result = GlobPattern.compileResult(glob, GLOB_OPTIONS$1);
|
|
45115
45922
|
return effect.Result.isSuccess(result) && result.success.matches(rel);
|
|
45116
45923
|
}
|
|
45117
45924
|
/**
|
|
@@ -45127,13 +45934,14 @@ function globMatchesRel(glob, rel) {
|
|
|
45127
45934
|
* module already speaks POSIX-relative match paths).
|
|
45128
45935
|
*/
|
|
45129
45936
|
function materializeGlob(glob, cwd) {
|
|
45130
|
-
return
|
|
45937
|
+
return compileAndExpand(glob, {
|
|
45131
45938
|
cwd,
|
|
45132
|
-
onUnreadable: "skip"
|
|
45939
|
+
onUnreadable: "skip",
|
|
45940
|
+
glob: GLOB_OPTIONS$1
|
|
45133
45941
|
}).pipe(effect.Effect.mapError((error) => new ConfigurationError({
|
|
45134
45942
|
field: "glob",
|
|
45135
|
-
reason: `Failed to materialize glob ${JSON.stringify(glob)}: ${error.message}`
|
|
45136
|
-
})), effect.Effect.provide(effect.Path.layer))
|
|
45943
|
+
reason: error.stage === "compile" ? `Invalid glob pattern ${JSON.stringify(glob)}: ${error.cause.message}` : `Failed to materialize glob ${JSON.stringify(glob)}: ${error.cause.message}`
|
|
45944
|
+
})), effect.Effect.provide(effect.Path.layer));
|
|
45137
45945
|
}
|
|
45138
45946
|
/**
|
|
45139
45947
|
* Determine whether `child` is the same directory as `parent` or sits inside
|
|
@@ -46835,19 +47643,29 @@ var VersionFiles = class VersionFiles {
|
|
|
46835
47643
|
}
|
|
46836
47644
|
};
|
|
46837
47645
|
/**
|
|
47646
|
+
* Match dotfiles, matching `ConfigInspector`'s glob dialect.
|
|
47647
|
+
*
|
|
47648
|
+
* @remarks
|
|
47649
|
+
* This module previously compiled with minimatch DEFAULTS while
|
|
47650
|
+
* `ConfigInspector` compiled with `dot: true`, so a wildcard segment matching
|
|
47651
|
+
* a dotted directory was attributed to a package but never materialized (or
|
|
47652
|
+
* the reverse). The two paths must agree: attribution and materialization
|
|
47653
|
+
* answer the same question about the same glob.
|
|
47654
|
+
*/
|
|
47655
|
+
const GLOB_OPTIONS = GlobPatternOptions.make({ dot: true });
|
|
47656
|
+
/**
|
|
46838
47657
|
* Expand a glob pattern against the filesystem, returning matching FILE paths
|
|
46839
47658
|
* relative to `cwd` (POSIX separators), sorted by relative path.
|
|
46840
47659
|
*
|
|
46841
47660
|
* @remarks
|
|
46842
|
-
* The walk is `@effected/walker`'s `
|
|
47661
|
+
* The walk is `@effected/walker`'s `compileAndExpand` (literal fast path,
|
|
46843
47662
|
* `enumerationPrefix` bounding, `node_modules`/`.git` pruning), with
|
|
46844
47663
|
* `onUnreadable: "skip"` preserving this module's silent-skip policy for
|
|
46845
|
-
* unreadable directories. Matching semantics are
|
|
46846
|
-
*
|
|
46847
|
-
*
|
|
46848
|
-
*
|
|
46849
|
-
*
|
|
46850
|
-
* paths and node-bound absolute paths throughout.
|
|
47664
|
+
* unreadable directories. Matching semantics are {@link GLOB_OPTIONS} —
|
|
47665
|
+
* wildcards DO match dotfiles, aligning this module with `ConfigInspector`. An
|
|
47666
|
+
* uncompilable pattern expands to no matches. The `Path` requirement is
|
|
47667
|
+
* satisfied internally with the core POSIX `Path.layer` — this module already
|
|
47668
|
+
* speaks POSIX relative match paths and node-bound absolute paths throughout.
|
|
46851
47669
|
*
|
|
46852
47670
|
* @param source - The glob pattern, repo-relative
|
|
46853
47671
|
* @param cwd - Absolute directory the pattern is resolved against
|
|
@@ -46856,13 +47674,11 @@ var VersionFiles = class VersionFiles {
|
|
|
46856
47674
|
* @internal
|
|
46857
47675
|
*/
|
|
46858
47676
|
function expandGlob(source, cwd) {
|
|
46859
|
-
return
|
|
46860
|
-
|
|
46861
|
-
|
|
46862
|
-
|
|
46863
|
-
|
|
46864
|
-
})
|
|
46865
|
-
})), effect.Effect.provide(effect.Path.layer));
|
|
47677
|
+
return compileAndExpand(source, {
|
|
47678
|
+
cwd,
|
|
47679
|
+
onUnreadable: "skip",
|
|
47680
|
+
glob: GLOB_OPTIONS
|
|
47681
|
+
}).pipe(effect.Effect.catch((error) => error.stage === "compile" ? effect.Effect.succeed([]) : effect.Effect.fail(error)), effect.Effect.provide(effect.Path.layer));
|
|
46866
47682
|
}
|
|
46867
47683
|
/**
|
|
46868
47684
|
* Read the `version` field from a `package.json` in the given directory.
|