@savvy-web/silk 3.4.0 → 3.4.2
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 +1669 -297
- package/changesets-changelog.d.cts +297 -39
- package/changesets-changelog.d.ts +297 -39
- package/changesets-changelog.js +1732 -244
- package/changesets-markdownlint.cjs +1669 -297
- package/changesets-markdownlint.d.cts +297 -39
- package/changesets-markdownlint.d.ts +297 -39
- package/changesets-markdownlint.js +1732 -244
- package/package.json +4 -4
- package/tsconfig/node/dist/tsconfig.tsbuildinfo +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { builtinModules, createRequire } from "node:module";
|
|
2
|
-
import { Context, Data, Duration, Effect, Equal, Exit, FileSystem, Function, Hash, HashMap, Layer, Option, Order, Path, Pipeable, PlatformError, Predicate, Result, Schema, SchemaIssue, SchemaTransformation, Stream } from "effect";
|
|
2
|
+
import { Context, Data, Duration, Effect, Equal, Exit, FileSystem, Function, Hash, HashMap, Layer, Option, Order, Path, Pipeable, PlatformError, Predicate, Redacted, Ref, Result, Schema, SchemaIssue, SchemaTransformation, Stdio, Stream } from "effect";
|
|
3
3
|
import * as path$1 from "node:path";
|
|
4
4
|
import { basename, delimiter, dirname, isAbsolute, join, normalize, relative, resolve } from "node:path";
|
|
5
5
|
import { ChildProcess, ChildProcessSpawner } from "effect/unstable/process";
|
|
@@ -2352,7 +2352,7 @@ var GlobSet = class GlobSet extends Schema.Class("GlobSet")(Schema.Struct({ patt
|
|
|
2352
2352
|
};
|
|
2353
2353
|
|
|
2354
2354
|
//#endregion
|
|
2355
|
-
//#region ../../node_modules/.pnpm/@effected+lockfiles@0.3.
|
|
2355
|
+
//#region ../../node_modules/.pnpm/@effected+lockfiles@0.3.2_@effected+jsonc@0.5.2_effect@4.0.0-beta.101__@effected+npm@0._3c1784fba62fde9a5bac4cf15387fd04/node_modules/@effected/lockfiles/BunExtension.js
|
|
2356
2356
|
/**
|
|
2357
2357
|
* Extension data specific to bun lockfiles, attached to `Lockfile.extension`
|
|
2358
2358
|
* when the format is `"bun"`.
|
|
@@ -2374,7 +2374,7 @@ var BunExtension = class extends Schema.Class("BunExtension")({
|
|
|
2374
2374
|
}) {};
|
|
2375
2375
|
|
|
2376
2376
|
//#endregion
|
|
2377
|
-
//#region ../../node_modules/.pnpm/@effected+npm@0.8.
|
|
2377
|
+
//#region ../../node_modules/.pnpm/@effected+npm@0.8.3_@effected+semver@0.3.2_effect@4.0.0-beta.101__effect@4.0.0-beta.101/node_modules/@effected/npm/CatalogResolver.js
|
|
2378
2378
|
/**
|
|
2379
2379
|
* Contract for resolving pnpm `catalog:` dependency specifiers to concrete
|
|
2380
2380
|
* version ranges.
|
|
@@ -2410,7 +2410,7 @@ var BunExtension = class extends Schema.Class("BunExtension")({
|
|
|
2410
2410
|
*
|
|
2411
2411
|
* @public
|
|
2412
2412
|
*/
|
|
2413
|
-
var CatalogResolver = class CatalogResolver extends Context.Service()("@effected/npm/CatalogResolver") {
|
|
2413
|
+
var CatalogResolver$1 = class CatalogResolver extends Context.Service()("@effected/npm/CatalogResolver") {
|
|
2414
2414
|
/**
|
|
2415
2415
|
* No-op default: `rangeOf` always succeeds with `Option.none()`, never
|
|
2416
2416
|
* consulting an actual catalog. A pure `Layer.succeed`, bound to a const
|
|
@@ -2421,7 +2421,7 @@ var CatalogResolver = class CatalogResolver extends Context.Service()("@effected
|
|
|
2421
2421
|
};
|
|
2422
2422
|
|
|
2423
2423
|
//#endregion
|
|
2424
|
-
//#region ../../node_modules/.pnpm/@effected+npm@0.8.
|
|
2424
|
+
//#region ../../node_modules/.pnpm/@effected+npm@0.8.3_@effected+semver@0.3.2_effect@4.0.0-beta.101__effect@4.0.0-beta.101/node_modules/@effected/npm/WorkspaceResolver.js
|
|
2425
2425
|
/**
|
|
2426
2426
|
* Raised when a `catalog:` or `workspace:` specifier cannot be resolved
|
|
2427
2427
|
* because the resolution mechanism itself failed — not for an ordinary
|
|
@@ -2435,7 +2435,7 @@ var CatalogResolver = class CatalogResolver extends Context.Service()("@effected
|
|
|
2435
2435
|
*
|
|
2436
2436
|
* @public
|
|
2437
2437
|
*/
|
|
2438
|
-
var DependencyResolutionError = class extends Schema.TaggedErrorClass()("DependencyResolutionError", {
|
|
2438
|
+
var DependencyResolutionError$1 = class extends Schema.TaggedErrorClass()("DependencyResolutionError", {
|
|
2439
2439
|
specifier: Schema.String,
|
|
2440
2440
|
cause: Schema.Defect()
|
|
2441
2441
|
}) {
|
|
@@ -2473,7 +2473,7 @@ var DependencyResolutionError = class extends Schema.TaggedErrorClass()("Depende
|
|
|
2473
2473
|
*
|
|
2474
2474
|
* @public
|
|
2475
2475
|
*/
|
|
2476
|
-
var WorkspaceResolver = class WorkspaceResolver extends Context.Service()("@effected/npm/WorkspaceResolver") {
|
|
2476
|
+
var WorkspaceResolver$1 = class WorkspaceResolver extends Context.Service()("@effected/npm/WorkspaceResolver") {
|
|
2477
2477
|
/**
|
|
2478
2478
|
* No-op default: `versionOf` always succeeds with `Option.none()`, never
|
|
2479
2479
|
* consulting an actual workspace. A pure `Layer.succeed`, bound to a
|
|
@@ -2483,7 +2483,7 @@ var WorkspaceResolver = class WorkspaceResolver extends Context.Service()("@effe
|
|
|
2483
2483
|
};
|
|
2484
2484
|
|
|
2485
2485
|
//#endregion
|
|
2486
|
-
//#region ../../node_modules/.pnpm/@effected+npm@0.8.
|
|
2486
|
+
//#region ../../node_modules/.pnpm/@effected+npm@0.8.3_@effected+semver@0.3.2_effect@4.0.0-beta.101__effect@4.0.0-beta.101/node_modules/@effected/npm/CatalogAssemblyError.js
|
|
2487
2487
|
/**
|
|
2488
2488
|
* Raised when a workspace's catalogs cannot be assembled — a `pnpm-workspace.yaml`
|
|
2489
2489
|
* that is unreadable or not valid YAML, a root `package.json` `workspaces` field
|
|
@@ -2528,14 +2528,14 @@ var CatalogAssemblyError = class extends Schema.TaggedErrorClass()("CatalogAssem
|
|
|
2528
2528
|
};
|
|
2529
2529
|
|
|
2530
2530
|
//#endregion
|
|
2531
|
-
//#region ../../node_modules/.pnpm/@effected+npm@0.8.
|
|
2531
|
+
//#region ../../node_modules/.pnpm/@effected+npm@0.8.3_@effected+semver@0.3.2_effect@4.0.0-beta.101__effect@4.0.0-beta.101/node_modules/@effected/npm/DependencySection.js
|
|
2532
2532
|
/**
|
|
2533
2533
|
* The short dependency kind: which dependency map an entry came from, named the
|
|
2534
2534
|
* way consumers branch on it.
|
|
2535
2535
|
*
|
|
2536
2536
|
* @public
|
|
2537
2537
|
*/
|
|
2538
|
-
const DependencyKind = Schema.Literals([
|
|
2538
|
+
const DependencyKind$1 = Schema.Literals([
|
|
2539
2539
|
"prod",
|
|
2540
2540
|
"dev",
|
|
2541
2541
|
"peer",
|
|
@@ -2547,22 +2547,22 @@ const DependencyKind = Schema.Literals([
|
|
|
2547
2547
|
*
|
|
2548
2548
|
* @public
|
|
2549
2549
|
*/
|
|
2550
|
-
const DependencyField = Schema.Literals([
|
|
2550
|
+
const DependencyField$1 = Schema.Literals([
|
|
2551
2551
|
"dependencies",
|
|
2552
2552
|
"devDependencies",
|
|
2553
2553
|
"peerDependencies",
|
|
2554
2554
|
"optionalDependencies"
|
|
2555
2555
|
]);
|
|
2556
|
-
const KIND_TO_FIELD = {
|
|
2556
|
+
const KIND_TO_FIELD$1 = {
|
|
2557
2557
|
prod: "dependencies",
|
|
2558
2558
|
dev: "devDependencies",
|
|
2559
2559
|
peer: "peerDependencies",
|
|
2560
2560
|
optional: "optionalDependencies"
|
|
2561
2561
|
};
|
|
2562
|
-
const FIELD_TO_KIND = Object.fromEntries(Object.entries(KIND_TO_FIELD).map(([kind, field]) => [field, kind]));
|
|
2562
|
+
const FIELD_TO_KIND$1 = Object.fromEntries(Object.entries(KIND_TO_FIELD$1).map(([kind, field]) => [field, kind]));
|
|
2563
2563
|
|
|
2564
2564
|
//#endregion
|
|
2565
|
-
//#region ../../node_modules/.pnpm/@effected+semver@0.3.
|
|
2565
|
+
//#region ../../node_modules/.pnpm/@effected+semver@0.3.2_effect@4.0.0-beta.101/node_modules/@effected/semver/internal/desugar.js
|
|
2566
2566
|
const sv = (major, minor, patch, prerelease = [], build = []) => ({
|
|
2567
2567
|
major,
|
|
2568
2568
|
minor,
|
|
@@ -2652,7 +2652,7 @@ const desugarHyphen = (lower, upper) => {
|
|
|
2652
2652
|
};
|
|
2653
2653
|
|
|
2654
2654
|
//#endregion
|
|
2655
|
-
//#region ../../node_modules/.pnpm/@effected+semver@0.3.
|
|
2655
|
+
//#region ../../node_modules/.pnpm/@effected+semver@0.3.2_effect@4.0.0-beta.101/node_modules/@effected/semver/internal/grammar.js
|
|
2656
2656
|
/** Private control-flow exception; never escapes the entry points. */
|
|
2657
2657
|
var ParseFailure = class {
|
|
2658
2658
|
position;
|
|
@@ -2937,7 +2937,7 @@ const parseRangeComparators = (s) => {
|
|
|
2937
2937
|
* Parse a range expression into comparator sets (OR of ANDs). The empty
|
|
2938
2938
|
* string parses as the match-all range.
|
|
2939
2939
|
*/
|
|
2940
|
-
const parseRange$
|
|
2940
|
+
const parseRange$2 = (raw) => {
|
|
2941
2941
|
const trimmed = raw.trim();
|
|
2942
2942
|
if (trimmed.length === 0) return {
|
|
2943
2943
|
ok: true,
|
|
@@ -3053,7 +3053,7 @@ const formatComparator = (c) => {
|
|
|
3053
3053
|
const formatRange = (sets) => sets.map((set) => set.map(formatComparator).join(" ")).join(" || ");
|
|
3054
3054
|
|
|
3055
3055
|
//#endregion
|
|
3056
|
-
//#region ../../node_modules/.pnpm/@effected+semver@0.3.
|
|
3056
|
+
//#region ../../node_modules/.pnpm/@effected+semver@0.3.2_effect@4.0.0-beta.101/node_modules/@effected/semver/internal/order.js
|
|
3057
3057
|
/**
|
|
3058
3058
|
* Compare two prerelease identifiers per SemVer 2.0.0 §11: numeric
|
|
3059
3059
|
* identifiers always have lower precedence than alphanumeric ones; numerics
|
|
@@ -3107,7 +3107,7 @@ const compareBuild = (a, b) => {
|
|
|
3107
3107
|
};
|
|
3108
3108
|
|
|
3109
3109
|
//#endregion
|
|
3110
|
-
//#region ../../node_modules/.pnpm/@effected+semver@0.3.
|
|
3110
|
+
//#region ../../node_modules/.pnpm/@effected+semver@0.3.2_effect@4.0.0-beta.101/node_modules/@effected/semver/SemVer.js
|
|
3111
3111
|
/**
|
|
3112
3112
|
* Indicates that a string could not be parsed as a valid SemVer 2.0.0 version.
|
|
3113
3113
|
*
|
|
@@ -3619,7 +3619,7 @@ var SemVerBump = class {
|
|
|
3619
3619
|
};
|
|
3620
3620
|
|
|
3621
3621
|
//#endregion
|
|
3622
|
-
//#region ../../node_modules/.pnpm/@effected+semver@0.3.
|
|
3622
|
+
//#region ../../node_modules/.pnpm/@effected+semver@0.3.2_effect@4.0.0-beta.101/node_modules/@effected/semver/Comparator.js
|
|
3623
3623
|
/**
|
|
3624
3624
|
* Indicates that a string could not be parsed as a single comparator.
|
|
3625
3625
|
*
|
|
@@ -3754,7 +3754,7 @@ var Comparator = class Comparator extends Schema.Class("Comparator")({
|
|
|
3754
3754
|
};
|
|
3755
3755
|
|
|
3756
3756
|
//#endregion
|
|
3757
|
-
//#region ../../node_modules/.pnpm/@effected+semver@0.3.
|
|
3757
|
+
//#region ../../node_modules/.pnpm/@effected+semver@0.3.2_effect@4.0.0-beta.101/node_modules/@effected/semver/internal/normalize.js
|
|
3758
3758
|
const operatorWeight = (op) => {
|
|
3759
3759
|
switch (op) {
|
|
3760
3760
|
case ">=": return 0;
|
|
@@ -3786,7 +3786,7 @@ const normalizeComparatorSet = (set) => sortComparators(removeDuplicates(set));
|
|
|
3786
3786
|
const normalizeSets = (sets) => sets.map(normalizeComparatorSet);
|
|
3787
3787
|
|
|
3788
3788
|
//#endregion
|
|
3789
|
-
//#region ../../node_modules/.pnpm/@effected+semver@0.3.
|
|
3789
|
+
//#region ../../node_modules/.pnpm/@effected+semver@0.3.2_effect@4.0.0-beta.101/node_modules/@effected/semver/Range.js
|
|
3790
3790
|
/**
|
|
3791
3791
|
* Indicates that a string could not be parsed as a range expression.
|
|
3792
3792
|
*
|
|
@@ -3841,7 +3841,7 @@ sets: Schema.Array(Schema.Array(Comparator)) }) {
|
|
|
3841
3841
|
*/
|
|
3842
3842
|
static FromString = Schema.String.pipe(Schema.decodeTo(Range, SchemaTransformation.transformOrFail({
|
|
3843
3843
|
decode: (input) => {
|
|
3844
|
-
const result = parseRange$
|
|
3844
|
+
const result = parseRange$2(input);
|
|
3845
3845
|
return result.ok ? Effect.succeed({ sets: normalizeSets(result.value) }) : Effect.fail(new SchemaIssue.InvalidValue(Option.some(input), { message: `Invalid range expression: "${result.input}" at position ${result.position}` }));
|
|
3846
3846
|
},
|
|
3847
3847
|
encode: (parts) => Effect.succeed(formatRange(parts.sets))
|
|
@@ -3872,7 +3872,7 @@ sets: Schema.Array(Schema.Array(Comparator)) }) {
|
|
|
3872
3872
|
* with {@link InvalidRangeError}.
|
|
3873
3873
|
*/
|
|
3874
3874
|
static parseResult(input) {
|
|
3875
|
-
const result = parseRange$
|
|
3875
|
+
const result = parseRange$2(input);
|
|
3876
3876
|
if (!result.ok) return Result.fail(new InvalidRangeError({
|
|
3877
3877
|
input: result.input,
|
|
3878
3878
|
position: result.position
|
|
@@ -3894,17 +3894,54 @@ sets: Schema.Array(Schema.Array(Comparator)) }) {
|
|
|
3894
3894
|
/**
|
|
3895
3895
|
* Test whether a version satisfies a range; see {@link Range.test} for the
|
|
3896
3896
|
* prerelease matching rule. Dual API.
|
|
3897
|
+
*
|
|
3898
|
+
* @remarks
|
|
3899
|
+
* **Data-first order is `(version, range)`** — the version being tested
|
|
3900
|
+
* comes first, the range it is tested against second. The data-last form
|
|
3901
|
+
* takes the range: `Range.satisfies(range)` applied to a version.
|
|
3902
|
+
*
|
|
3903
|
+
* Worth stating because the two parameters are distinct classes and the
|
|
3904
|
+
* order is not recoverable from the call site. TypeScript rejects a flipped
|
|
3905
|
+
* call outright, so this only bites callers without type checking — which
|
|
3906
|
+
* includes the untyped `node --input-type=module` probes this repo's own
|
|
3907
|
+
* evidence ladder calls for. There, `Range.satisfies(range, version)`
|
|
3908
|
+
* dispatches data-first, binds the `Range` to `version`, and dies with
|
|
3909
|
+
* `TypeError: range.test is not a function` — a message naming the
|
|
3910
|
+
* parameter that received the *version*, so it reads as a defect inside
|
|
3911
|
+
* this package rather than a caller error.
|
|
3912
|
+
*
|
|
3913
|
+
* The same order and the same hazard apply to `Range.filter`,
|
|
3914
|
+
* {@link Range.maxSatisfying} and {@link Range.minSatisfying}: subject
|
|
3915
|
+
* first, range second.
|
|
3897
3916
|
*/
|
|
3898
3917
|
static satisfies = Function.dual(2, (version, range) => range.test(version));
|
|
3899
|
-
/**
|
|
3918
|
+
/**
|
|
3919
|
+
* Filter versions that satisfy a range, preserving order. Dual API.
|
|
3920
|
+
*
|
|
3921
|
+
* @remarks
|
|
3922
|
+
* Data-first order is `(versions, range)` — see {@link Range.satisfies}
|
|
3923
|
+
* for why the order is spelled out.
|
|
3924
|
+
*/
|
|
3900
3925
|
static filter = Function.dual(2, (versions, range) => range.filter(versions));
|
|
3901
|
-
/**
|
|
3926
|
+
/**
|
|
3927
|
+
* Highest satisfying version, or `Option.none()`. Dual API.
|
|
3928
|
+
*
|
|
3929
|
+
* @remarks
|
|
3930
|
+
* Data-first order is `(versions, range)` — see {@link Range.satisfies}
|
|
3931
|
+
* for why the order is spelled out.
|
|
3932
|
+
*/
|
|
3902
3933
|
static maxSatisfying = Function.dual(2, (versions, range) => {
|
|
3903
3934
|
let best;
|
|
3904
3935
|
for (const v of versions) if (range.test(v) && (best === void 0 || v.gt(best))) best = v;
|
|
3905
3936
|
return best === void 0 ? Option.none() : Option.some(best);
|
|
3906
3937
|
});
|
|
3907
|
-
/**
|
|
3938
|
+
/**
|
|
3939
|
+
* Lowest satisfying version, or `Option.none()`. Dual API.
|
|
3940
|
+
*
|
|
3941
|
+
* @remarks
|
|
3942
|
+
* Data-first order is `(versions, range)` — see {@link Range.satisfies}
|
|
3943
|
+
* for why the order is spelled out.
|
|
3944
|
+
*/
|
|
3908
3945
|
static minSatisfying = Function.dual(2, (versions, range) => {
|
|
3909
3946
|
let best;
|
|
3910
3947
|
for (const v of versions) if (range.test(v) && (best === void 0 || v.lt(best))) best = v;
|
|
@@ -4115,7 +4152,7 @@ const isComparatorSetSubset = (sub, sup) => {
|
|
|
4115
4152
|
};
|
|
4116
4153
|
|
|
4117
4154
|
//#endregion
|
|
4118
|
-
//#region ../../node_modules/.pnpm/@effected+npm@0.8.
|
|
4155
|
+
//#region ../../node_modules/.pnpm/@effected+npm@0.8.3_@effected+semver@0.3.2_effect@4.0.0-beta.101__effect@4.0.0-beta.101/node_modules/@effected/npm/DependencySpecifier.js
|
|
4119
4156
|
/**
|
|
4120
4157
|
* Indicates that a string could not be parsed as a valid dependency specifier.
|
|
4121
4158
|
*
|
|
@@ -4124,50 +4161,50 @@ const isComparatorSetSubset = (sub, sup) => {
|
|
|
4124
4161
|
*
|
|
4125
4162
|
* @public
|
|
4126
4163
|
*/
|
|
4127
|
-
var InvalidDependencySpecifierError = class extends Schema.TaggedErrorClass()("InvalidDependencySpecifierError", {
|
|
4164
|
+
var InvalidDependencySpecifierError$1 = class extends Schema.TaggedErrorClass()("InvalidDependencySpecifierError", {
|
|
4128
4165
|
/** The raw input string that failed validation. */
|
|
4129
4166
|
input: Schema.String }) {
|
|
4130
4167
|
get message() {
|
|
4131
4168
|
return `Invalid dependency specifier "${this.input}": not a recognized specifier`;
|
|
4132
4169
|
}
|
|
4133
4170
|
};
|
|
4134
|
-
const CATALOG_PREFIX = "catalog:";
|
|
4135
|
-
const WORKSPACE_PREFIX = "workspace:";
|
|
4136
|
-
const isBarePath = (value) => value.startsWith("./") || value.startsWith("../") || value.startsWith("~/") || value.startsWith("/");
|
|
4137
|
-
const isGitHubShorthand = (value) => !value.startsWith(".") && !value.startsWith("~") && !value.startsWith("/") && /^[a-zA-Z0-9_.-]+\/[a-zA-Z0-9_.-]+(#.*)?$/.test(value);
|
|
4138
|
-
const isGit = (value) => value.startsWith("git+") || value.startsWith("git://") || value.startsWith("github:") || value.startsWith("gist:") || value.startsWith("bitbucket:") || value.startsWith("gitlab:") || isGitHubShorthand(value);
|
|
4139
|
-
const isLocal = (value) => value.startsWith("file:") || value.startsWith("link:") || value.startsWith("portal:") || isBarePath(value);
|
|
4140
|
-
const isLink = (value) => value.startsWith("link:");
|
|
4141
|
-
const isPortal = (value) => value.startsWith("portal:");
|
|
4142
|
-
const isCatalog = (value) => value.startsWith(CATALOG_PREFIX);
|
|
4143
|
-
const isWorkspace = (value) => value.startsWith(WORKSPACE_PREFIX);
|
|
4144
|
-
const isUrl$
|
|
4145
|
-
const parseRange = (value) => {
|
|
4171
|
+
const CATALOG_PREFIX$1 = "catalog:";
|
|
4172
|
+
const WORKSPACE_PREFIX$1 = "workspace:";
|
|
4173
|
+
const isBarePath$1 = (value) => value.startsWith("./") || value.startsWith("../") || value.startsWith("~/") || value.startsWith("/");
|
|
4174
|
+
const isGitHubShorthand$1 = (value) => !value.startsWith(".") && !value.startsWith("~") && !value.startsWith("/") && /^[a-zA-Z0-9_.-]+\/[a-zA-Z0-9_.-]+(#.*)?$/.test(value);
|
|
4175
|
+
const isGit$1 = (value) => value.startsWith("git+") || value.startsWith("git://") || value.startsWith("github:") || value.startsWith("gist:") || value.startsWith("bitbucket:") || value.startsWith("gitlab:") || isGitHubShorthand$1(value);
|
|
4176
|
+
const isLocal$1 = (value) => value.startsWith("file:") || value.startsWith("link:") || value.startsWith("portal:") || isBarePath$1(value);
|
|
4177
|
+
const isLink$1 = (value) => value.startsWith("link:");
|
|
4178
|
+
const isPortal$1 = (value) => value.startsWith("portal:");
|
|
4179
|
+
const isCatalog$1 = (value) => value.startsWith(CATALOG_PREFIX$1);
|
|
4180
|
+
const isWorkspace$1 = (value) => value.startsWith(WORKSPACE_PREFIX$1);
|
|
4181
|
+
const isUrl$2 = (value) => value.startsWith("http://") || value.startsWith("https://");
|
|
4182
|
+
const parseRange$1 = (value) => {
|
|
4146
4183
|
const exit = Schema.decodeUnknownExit(Range$1.FromString)(value);
|
|
4147
4184
|
return Exit.isSuccess(exit) ? Option.some(exit.value) : Option.none();
|
|
4148
4185
|
};
|
|
4149
|
-
const isRange = (value) => Option.isSome(parseRange(value));
|
|
4150
|
-
const protocolOf = (value) => {
|
|
4151
|
-
if (value.startsWith(CATALOG_PREFIX)) return "catalog";
|
|
4152
|
-
if (value.startsWith(WORKSPACE_PREFIX)) return "workspace";
|
|
4186
|
+
const isRange$1 = (value) => Option.isSome(parseRange$1(value));
|
|
4187
|
+
const protocolOf$1 = (value) => {
|
|
4188
|
+
if (value.startsWith(CATALOG_PREFIX$1)) return "catalog";
|
|
4189
|
+
if (value.startsWith(WORKSPACE_PREFIX$1)) return "workspace";
|
|
4153
4190
|
if (value.startsWith("link:")) return "link";
|
|
4154
4191
|
if (value.startsWith("portal:")) return "portal";
|
|
4155
|
-
if (value.startsWith("file:") || isBarePath(value)) return "file";
|
|
4192
|
+
if (value.startsWith("file:") || isBarePath$1(value)) return "file";
|
|
4156
4193
|
if (value.startsWith("npm:")) return "npm";
|
|
4157
|
-
if (isGit(value)) return "git";
|
|
4158
|
-
if (isUrl$
|
|
4159
|
-
if (isRange(value)) return "range";
|
|
4194
|
+
if (isGit$1(value)) return "git";
|
|
4195
|
+
if (isUrl$2(value)) return "url";
|
|
4196
|
+
if (isRange$1(value)) return "range";
|
|
4160
4197
|
if (/^[a-zA-Z][a-zA-Z0-9._-]*$/.test(value)) return "tag";
|
|
4161
4198
|
return "unknown";
|
|
4162
4199
|
};
|
|
4163
|
-
const isTag = (value) => protocolOf(value) === "tag";
|
|
4164
|
-
const catalogNameOf$
|
|
4165
|
-
if (!isCatalog(specifier)) return Option.none();
|
|
4200
|
+
const isTag$1 = (value) => protocolOf$1(value) === "tag";
|
|
4201
|
+
const catalogNameOf$2 = (specifier) => {
|
|
4202
|
+
if (!isCatalog$1(specifier)) return Option.none();
|
|
4166
4203
|
const rest = specifier.slice(8).trim();
|
|
4167
4204
|
return rest.length === 0 ? Option.none() : Option.some(rest);
|
|
4168
4205
|
};
|
|
4169
|
-
const projectRangeModifier = (range, version) => range === "*" || range === "" ? version : range === "~" ? `~${version}` : range === "^" ? `^${version}` : range;
|
|
4170
|
-
const splitWorkspaceRest = (rest) => {
|
|
4206
|
+
const projectRangeModifier$1 = (range, version) => range === "*" || range === "" ? version : range === "~" ? `~${version}` : range === "^" ? `^${version}` : range;
|
|
4207
|
+
const splitWorkspaceRest$1 = (rest) => {
|
|
4171
4208
|
const at = rest.lastIndexOf("@");
|
|
4172
4209
|
return at > 0 ? {
|
|
4173
4210
|
target: rest.slice(0, at),
|
|
@@ -4177,15 +4214,15 @@ const splitWorkspaceRest = (rest) => {
|
|
|
4177
4214
|
range: rest
|
|
4178
4215
|
};
|
|
4179
4216
|
};
|
|
4180
|
-
const projectWorkspaceRange = (rest, version) => {
|
|
4181
|
-
const { target, range } = splitWorkspaceRest(rest);
|
|
4182
|
-
const projected = projectRangeModifier(range, version);
|
|
4217
|
+
const projectWorkspaceRange$1 = (rest, version) => {
|
|
4218
|
+
const { target, range } = splitWorkspaceRest$1(rest);
|
|
4219
|
+
const projected = projectRangeModifier$1(range, version);
|
|
4183
4220
|
return target === void 0 ? projected : `npm:${target}@${projected}`;
|
|
4184
4221
|
};
|
|
4185
|
-
const resolveWorkspace = (specifier, version) => isWorkspace(specifier) ? projectWorkspaceRange(specifier.slice(10), version) : specifier;
|
|
4186
|
-
const workspaceTargetOf = (specifier) => {
|
|
4187
|
-
if (!isWorkspace(specifier)) return Option.none();
|
|
4188
|
-
const { target } = splitWorkspaceRest(specifier.slice(10));
|
|
4222
|
+
const resolveWorkspace$1 = (specifier, version) => isWorkspace$1(specifier) ? projectWorkspaceRange$1(specifier.slice(10), version) : specifier;
|
|
4223
|
+
const workspaceTargetOf$1 = (specifier) => {
|
|
4224
|
+
if (!isWorkspace$1(specifier)) return Option.none();
|
|
4225
|
+
const { target } = splitWorkspaceRest$1(specifier.slice(10));
|
|
4189
4226
|
return target === void 0 ? Option.none() : Option.some(target);
|
|
4190
4227
|
};
|
|
4191
4228
|
/**
|
|
@@ -4195,14 +4232,14 @@ const workspaceTargetOf = (specifier) => {
|
|
|
4195
4232
|
*
|
|
4196
4233
|
* @public
|
|
4197
4234
|
*/
|
|
4198
|
-
const isValidDependencySpecifier = (value) => value.length > 0 && protocolOf(value) !== "unknown";
|
|
4235
|
+
const isValidDependencySpecifier$1 = (value) => value.length > 0 && protocolOf$1(value) !== "unknown";
|
|
4199
4236
|
/**
|
|
4200
4237
|
* A `catalog:` reference. `name` carries the catalog name, or `Option.none()`
|
|
4201
4238
|
* for the default catalog (`catalog:`).
|
|
4202
4239
|
*
|
|
4203
4240
|
* @public
|
|
4204
4241
|
*/
|
|
4205
|
-
var CatalogSpecifier = class extends Schema.TaggedClass()("catalog", {
|
|
4242
|
+
var CatalogSpecifier$1 = class extends Schema.TaggedClass()("catalog", {
|
|
4206
4243
|
/** The original specifier string. */
|
|
4207
4244
|
raw: Schema.String,
|
|
4208
4245
|
/** The catalog name, or `Option.none()` for the default catalog. */
|
|
@@ -4214,7 +4251,7 @@ var CatalogSpecifier = class extends Schema.TaggedClass()("catalog", {
|
|
|
4214
4251
|
*
|
|
4215
4252
|
* @public
|
|
4216
4253
|
*/
|
|
4217
|
-
var WorkspaceSpecifier = class extends Schema.TaggedClass()("workspace", {
|
|
4254
|
+
var WorkspaceSpecifier$1 = class extends Schema.TaggedClass()("workspace", {
|
|
4218
4255
|
/** The original specifier string. */
|
|
4219
4256
|
raw: Schema.String,
|
|
4220
4257
|
/** The part after `workspace:` (e.g. `*`, `^1.2.3`, or an alias form). */
|
|
@@ -4238,7 +4275,7 @@ var WorkspaceSpecifier = class extends Schema.TaggedClass()("workspace", {
|
|
|
4238
4275
|
* specifier points at (the alias target's version for the alias form).
|
|
4239
4276
|
*/
|
|
4240
4277
|
resolve(version) {
|
|
4241
|
-
return projectWorkspaceRange(this.range, version);
|
|
4278
|
+
return projectWorkspaceRange$1(this.range, version);
|
|
4242
4279
|
}
|
|
4243
4280
|
};
|
|
4244
4281
|
/**
|
|
@@ -4246,7 +4283,7 @@ var WorkspaceSpecifier = class extends Schema.TaggedClass()("workspace", {
|
|
|
4246
4283
|
*
|
|
4247
4284
|
* @public
|
|
4248
4285
|
*/
|
|
4249
|
-
var RangeSpecifier = class extends Schema.TaggedClass()("range", {
|
|
4286
|
+
var RangeSpecifier$1 = class extends Schema.TaggedClass()("range", {
|
|
4250
4287
|
/** The original specifier string. */
|
|
4251
4288
|
raw: Schema.String }) {};
|
|
4252
4289
|
/**
|
|
@@ -4254,7 +4291,7 @@ raw: Schema.String }) {};
|
|
|
4254
4291
|
*
|
|
4255
4292
|
* @public
|
|
4256
4293
|
*/
|
|
4257
|
-
var DistTagSpecifier = class extends Schema.TaggedClass()("dist-tag", {
|
|
4294
|
+
var DistTagSpecifier$1 = class extends Schema.TaggedClass()("dist-tag", {
|
|
4258
4295
|
/** The original specifier string (also the tag name). */
|
|
4259
4296
|
raw: Schema.String }) {};
|
|
4260
4297
|
/**
|
|
@@ -4263,35 +4300,35 @@ raw: Schema.String }) {};
|
|
|
4263
4300
|
*
|
|
4264
4301
|
* @public
|
|
4265
4302
|
*/
|
|
4266
|
-
var RawSpecifier = class extends Schema.TaggedClass()("raw", {
|
|
4303
|
+
var RawSpecifier$1 = class extends Schema.TaggedClass()("raw", {
|
|
4267
4304
|
/** The original specifier string. */
|
|
4268
4305
|
raw: Schema.String }) {};
|
|
4269
|
-
const Classified = Schema.Union([
|
|
4270
|
-
CatalogSpecifier,
|
|
4271
|
-
WorkspaceSpecifier,
|
|
4272
|
-
RangeSpecifier,
|
|
4273
|
-
DistTagSpecifier,
|
|
4274
|
-
RawSpecifier
|
|
4306
|
+
const Classified$1 = Schema.Union([
|
|
4307
|
+
CatalogSpecifier$1,
|
|
4308
|
+
WorkspaceSpecifier$1,
|
|
4309
|
+
RangeSpecifier$1,
|
|
4310
|
+
DistTagSpecifier$1,
|
|
4311
|
+
RawSpecifier$1
|
|
4275
4312
|
]);
|
|
4276
|
-
const classify$
|
|
4277
|
-
if (isCatalog(value)) return CatalogSpecifier.make({
|
|
4313
|
+
const classify$2 = (value) => {
|
|
4314
|
+
if (isCatalog$1(value)) return CatalogSpecifier$1.make({
|
|
4278
4315
|
raw: value,
|
|
4279
|
-
name: catalogNameOf$
|
|
4316
|
+
name: catalogNameOf$2(value)
|
|
4280
4317
|
});
|
|
4281
|
-
if (isWorkspace(value)) return WorkspaceSpecifier.make({
|
|
4318
|
+
if (isWorkspace$1(value)) return WorkspaceSpecifier$1.make({
|
|
4282
4319
|
raw: value,
|
|
4283
4320
|
range: value.slice(10)
|
|
4284
4321
|
});
|
|
4285
|
-
if (isRange(value)) return RangeSpecifier.make({ raw: value });
|
|
4286
|
-
if (isTag(value)) return DistTagSpecifier.make({ raw: value });
|
|
4287
|
-
return RawSpecifier.make({ raw: value });
|
|
4322
|
+
if (isRange$1(value)) return RangeSpecifier$1.make({ raw: value });
|
|
4323
|
+
if (isTag$1(value)) return DistTagSpecifier$1.make({ raw: value });
|
|
4324
|
+
return RawSpecifier$1.make({ raw: value });
|
|
4288
4325
|
};
|
|
4289
|
-
const fromString = Schema.String.pipe(Schema.decodeTo(Classified, SchemaTransformation.transformOrFail({
|
|
4290
|
-
decode: (input) => isValidDependencySpecifier(input) ? Effect.succeed(classify$
|
|
4326
|
+
const fromString$1 = Schema.String.pipe(Schema.decodeTo(Classified$1, SchemaTransformation.transformOrFail({
|
|
4327
|
+
decode: (input) => isValidDependencySpecifier$1(input) ? Effect.succeed(classify$2(input)) : Effect.fail(new SchemaIssue.InvalidValue(Option.some(input), { message: `Invalid dependency specifier: "${input}"` })),
|
|
4291
4328
|
encode: (classified) => Effect.succeed(classified.raw)
|
|
4292
4329
|
})));
|
|
4293
|
-
const brandedSpecifier = Schema.String.pipe(Schema.check(Schema.makeFilter((value) => isValidDependencySpecifier(value) ? void 0 : "Expected a valid dependency specifier")), Schema.brand("DependencySpecifier"));
|
|
4294
|
-
const decode$
|
|
4330
|
+
const brandedSpecifier$1 = Schema.String.pipe(Schema.check(Schema.makeFilter((value) => isValidDependencySpecifier$1(value) ? void 0 : "Expected a valid dependency specifier")), Schema.brand("DependencySpecifier"));
|
|
4331
|
+
const decode$5 = (input) => Schema.decodeUnknownEffect(brandedSpecifier$1)(input).pipe(Effect.mapError(() => new InvalidDependencySpecifierError$1({ input })));
|
|
4295
4332
|
/**
|
|
4296
4333
|
* A valid dependency version specifier, carrying the protocol taxonomy statics
|
|
4297
4334
|
* (`DependencySpecifier.protocolOf` and friends) that classify any specifier
|
|
@@ -4302,44 +4339,44 @@ const decode$3 = (input) => Schema.decodeUnknownEffect(brandedSpecifier)(input).
|
|
|
4302
4339
|
*
|
|
4303
4340
|
* @public
|
|
4304
4341
|
*/
|
|
4305
|
-
const DependencySpecifier = Object.assign(brandedSpecifier, {
|
|
4306
|
-
protocolOf,
|
|
4307
|
-
parseRange,
|
|
4308
|
-
isRange,
|
|
4309
|
-
isTag,
|
|
4310
|
-
isGit,
|
|
4311
|
-
isUrl: isUrl$
|
|
4312
|
-
isLocal,
|
|
4313
|
-
isLink,
|
|
4314
|
-
isPortal,
|
|
4315
|
-
isCatalog,
|
|
4316
|
-
isWorkspace,
|
|
4317
|
-
catalogNameOf: catalogNameOf$
|
|
4318
|
-
resolveWorkspace,
|
|
4319
|
-
workspaceTargetOf,
|
|
4320
|
-
isValid: isValidDependencySpecifier,
|
|
4321
|
-
decode: decode$
|
|
4322
|
-
FromString: fromString
|
|
4342
|
+
const DependencySpecifier$1 = Object.assign(brandedSpecifier$1, {
|
|
4343
|
+
protocolOf: protocolOf$1,
|
|
4344
|
+
parseRange: parseRange$1,
|
|
4345
|
+
isRange: isRange$1,
|
|
4346
|
+
isTag: isTag$1,
|
|
4347
|
+
isGit: isGit$1,
|
|
4348
|
+
isUrl: isUrl$2,
|
|
4349
|
+
isLocal: isLocal$1,
|
|
4350
|
+
isLink: isLink$1,
|
|
4351
|
+
isPortal: isPortal$1,
|
|
4352
|
+
isCatalog: isCatalog$1,
|
|
4353
|
+
isWorkspace: isWorkspace$1,
|
|
4354
|
+
catalogNameOf: catalogNameOf$2,
|
|
4355
|
+
resolveWorkspace: resolveWorkspace$1,
|
|
4356
|
+
workspaceTargetOf: workspaceTargetOf$1,
|
|
4357
|
+
isValid: isValidDependencySpecifier$1,
|
|
4358
|
+
decode: decode$5,
|
|
4359
|
+
FromString: fromString$1
|
|
4323
4360
|
});
|
|
4324
4361
|
|
|
4325
4362
|
//#endregion
|
|
4326
|
-
//#region ../../node_modules/.pnpm/@effected+npm@0.8.
|
|
4327
|
-
const SRI_RE = /^(sha1|sha256|sha384|sha512)-[A-Za-z0-9+/]+={0,2}$/;
|
|
4328
|
-
const COREPACK_RE = /^(sha1|sha224|sha256|sha384|sha512)\.[0-9a-f]+$/;
|
|
4329
|
-
const YARN_RE = /^[0-9]+(c[0-9]+)?\/[0-9a-f]+$/;
|
|
4330
|
-
const isSri = (value) => SRI_RE.test(value);
|
|
4331
|
-
const isCorepack = (value) => COREPACK_RE.test(value);
|
|
4332
|
-
const isYarnChecksum = (value) => YARN_RE.test(value);
|
|
4363
|
+
//#region ../../node_modules/.pnpm/@effected+npm@0.8.3_@effected+semver@0.3.2_effect@4.0.0-beta.101__effect@4.0.0-beta.101/node_modules/@effected/npm/IntegrityHash.js
|
|
4364
|
+
const SRI_RE$1 = /^(sha1|sha256|sha384|sha512)-[A-Za-z0-9+/]+={0,2}$/;
|
|
4365
|
+
const COREPACK_RE$1 = /^(sha1|sha224|sha256|sha384|sha512)\.[0-9a-f]+$/;
|
|
4366
|
+
const YARN_RE$1 = /^[0-9]+(c[0-9]+)?\/[0-9a-f]+$/;
|
|
4367
|
+
const isSri$1 = (value) => SRI_RE$1.test(value);
|
|
4368
|
+
const isCorepack$1 = (value) => COREPACK_RE$1.test(value);
|
|
4369
|
+
const isYarnChecksum$1 = (value) => YARN_RE$1.test(value);
|
|
4333
4370
|
/**
|
|
4334
4371
|
* Whether a string is a valid integrity hash in the SRI (`<algo>-<base64>`),
|
|
4335
4372
|
* corepack (`<algo>.<hex>`) or yarn (`<cachekey>/<hex>`) form.
|
|
4336
4373
|
*
|
|
4337
4374
|
* @public
|
|
4338
4375
|
*/
|
|
4339
|
-
const isValidIntegrityHash = (value) => isSri(value) || isCorepack(value) || isYarnChecksum(value);
|
|
4340
|
-
const algorithmOf = (value) => {
|
|
4341
|
-
if (isSri(value)) return Option.some(value.slice(0, value.indexOf("-")));
|
|
4342
|
-
if (isCorepack(value)) return Option.some(value.slice(0, value.indexOf(".")));
|
|
4376
|
+
const isValidIntegrityHash$1 = (value) => isSri$1(value) || isCorepack$1(value) || isYarnChecksum$1(value);
|
|
4377
|
+
const algorithmOf$1 = (value) => {
|
|
4378
|
+
if (isSri$1(value)) return Option.some(value.slice(0, value.indexOf("-")));
|
|
4379
|
+
if (isCorepack$1(value)) return Option.some(value.slice(0, value.indexOf(".")));
|
|
4343
4380
|
return Option.none();
|
|
4344
4381
|
};
|
|
4345
4382
|
/**
|
|
@@ -4350,15 +4387,15 @@ const algorithmOf = (value) => {
|
|
|
4350
4387
|
*
|
|
4351
4388
|
* @public
|
|
4352
4389
|
*/
|
|
4353
|
-
var InvalidIntegrityHashError = class extends Schema.TaggedErrorClass()("InvalidIntegrityHashError", {
|
|
4390
|
+
var InvalidIntegrityHashError$1 = class extends Schema.TaggedErrorClass()("InvalidIntegrityHashError", {
|
|
4354
4391
|
/** The raw input string that failed validation. */
|
|
4355
4392
|
input: Schema.String }) {
|
|
4356
4393
|
get message() {
|
|
4357
4394
|
return `Invalid integrity hash "${this.input}": expected an SRI (<algo>-<base64>), corepack (<algo>.<hex>) or yarn (<cachekey>/<hex>) form`;
|
|
4358
4395
|
}
|
|
4359
4396
|
};
|
|
4360
|
-
const brandedIntegrity = Schema.String.pipe(Schema.check(Schema.makeFilter((value) => isValidIntegrityHash(value) ? void 0 : "Expected an SRI, corepack or yarn integrity hash")), Schema.brand("IntegrityHash"));
|
|
4361
|
-
const decode$
|
|
4397
|
+
const brandedIntegrity$1 = Schema.String.pipe(Schema.check(Schema.makeFilter((value) => isValidIntegrityHash$1(value) ? void 0 : "Expected an SRI, corepack or yarn integrity hash")), Schema.brand("IntegrityHash"));
|
|
4398
|
+
const decode$4 = (input) => Schema.decodeUnknownEffect(brandedIntegrity$1)(input).pipe(Effect.mapError(() => new InvalidIntegrityHashError$1({ input })));
|
|
4362
4399
|
/**
|
|
4363
4400
|
* A subresource-integrity hash, covering the SRI (`sha512-<base64>`), corepack
|
|
4364
4401
|
* (`sha512.<hex>`) and yarn (`10c0/<hex>`) textual forms, carrying taxonomy
|
|
@@ -4367,13 +4404,13 @@ const decode$2 = (input) => Schema.decodeUnknownEffect(brandedIntegrity)(input).
|
|
|
4367
4404
|
*
|
|
4368
4405
|
* @public
|
|
4369
4406
|
*/
|
|
4370
|
-
const IntegrityHash = Object.assign(brandedIntegrity, {
|
|
4371
|
-
isSri,
|
|
4372
|
-
isCorepack,
|
|
4373
|
-
isYarnChecksum,
|
|
4374
|
-
isValid: isValidIntegrityHash,
|
|
4375
|
-
algorithmOf,
|
|
4376
|
-
decode: decode$
|
|
4407
|
+
const IntegrityHash$1 = Object.assign(brandedIntegrity$1, {
|
|
4408
|
+
isSri: isSri$1,
|
|
4409
|
+
isCorepack: isCorepack$1,
|
|
4410
|
+
isYarnChecksum: isYarnChecksum$1,
|
|
4411
|
+
isValid: isValidIntegrityHash$1,
|
|
4412
|
+
algorithmOf: algorithmOf$1,
|
|
4413
|
+
decode: decode$4
|
|
4377
4414
|
});
|
|
4378
4415
|
/**
|
|
4379
4416
|
* {@link (IntegrityHash:variable)} narrowed to the corepack `<algo>.<hex>` form
|
|
@@ -4426,10 +4463,10 @@ const IntegrityHash = Object.assign(brandedIntegrity, {
|
|
|
4426
4463
|
*
|
|
4427
4464
|
* @public
|
|
4428
4465
|
*/
|
|
4429
|
-
const CorepackIntegrityHash = brandedIntegrity.pipe(Schema.check(Schema.makeFilter((value) => isCorepack(value) ? void 0 : "Expected a corepack (<algo>.<hex>) integrity hash")));
|
|
4466
|
+
const CorepackIntegrityHash$1 = brandedIntegrity$1.pipe(Schema.check(Schema.makeFilter((value) => isCorepack$1(value) ? void 0 : "Expected a corepack (<algo>.<hex>) integrity hash")));
|
|
4430
4467
|
|
|
4431
4468
|
//#endregion
|
|
4432
|
-
//#region ../../node_modules/.pnpm/@effected+commands@0.
|
|
4469
|
+
//#region ../../node_modules/.pnpm/@effected+commands@0.3.1_effect@4.0.0-beta.101/node_modules/@effected/commands/LocalExec.js
|
|
4433
4470
|
/**
|
|
4434
4471
|
* The package managers whose project-local exec argv this package knows.
|
|
4435
4472
|
*
|
|
@@ -4638,7 +4675,681 @@ var LocalExec = class LocalExec extends Context.Service()("@effected/commands/Lo
|
|
|
4638
4675
|
};
|
|
4639
4676
|
|
|
4640
4677
|
//#endregion
|
|
4641
|
-
//#region ../../node_modules/.pnpm/@effected+
|
|
4678
|
+
//#region ../../node_modules/.pnpm/@effected+commands@0.3.1_effect@4.0.0-beta.101/node_modules/@effected/commands/Redaction.js
|
|
4679
|
+
/**
|
|
4680
|
+
* Argument tokens whose *following* positional (or `=`-joined value) is a
|
|
4681
|
+
* secret. Lowercase; matching is case-insensitive.
|
|
4682
|
+
*
|
|
4683
|
+
* @remarks
|
|
4684
|
+
* This is the heuristic backstop, not the primary mechanism — it can only know
|
|
4685
|
+
* about flags someone thought to list. The primary mechanism is
|
|
4686
|
+
* {@link Redaction.applyArgs}, which redacts by **value**: the caller says what
|
|
4687
|
+
* its secrets are and every occurrence goes, whatever flag carried it.
|
|
4688
|
+
*
|
|
4689
|
+
* @public
|
|
4690
|
+
*/
|
|
4691
|
+
const SECRET_FLAGS = /* @__PURE__ */ new Set([
|
|
4692
|
+
"--access-token",
|
|
4693
|
+
"--api-key",
|
|
4694
|
+
"--auth",
|
|
4695
|
+
"--auth-token",
|
|
4696
|
+
"--otp",
|
|
4697
|
+
"--password",
|
|
4698
|
+
"--registry-token",
|
|
4699
|
+
"--token"
|
|
4700
|
+
]);
|
|
4701
|
+
/**
|
|
4702
|
+
* npm config keys whose value is a credential (`//registry/:_authToken`,
|
|
4703
|
+
* `//registry/:_password`).
|
|
4704
|
+
*/
|
|
4705
|
+
const AUTH_KEY = /:(?:_authtoken|_password)$/i;
|
|
4706
|
+
/**
|
|
4707
|
+
* The distinct, non-empty secret values, longest first.
|
|
4708
|
+
*
|
|
4709
|
+
* @remarks
|
|
4710
|
+
* Longest-first is load-bearing: redacting `"ab"` before `"abcd"` rewrites
|
|
4711
|
+
* `"abcd"` to `"***cd"`, leaking `"cd"` — a fragment of the longer secret.
|
|
4712
|
+
* Empty values are dropped because `"abc".split("").join("***")` would insert
|
|
4713
|
+
* the placeholder between every character.
|
|
4714
|
+
*/
|
|
4715
|
+
const prepare = (secrets) => [...new Set(secrets.map(Redacted.value))].filter((value) => value.length > 0).sort((a, b) => b.length - a.length);
|
|
4716
|
+
/** Replaces each prepared value with {@link REDACTED}, literally (never as a pattern). */
|
|
4717
|
+
const replaceAll = (text, values) => {
|
|
4718
|
+
let out = text;
|
|
4719
|
+
for (const value of values) out = out.split(value).join("***");
|
|
4720
|
+
return out;
|
|
4721
|
+
};
|
|
4722
|
+
const apply = (text, secrets) => secrets.length === 0 ? text : replaceAll(text, prepare(secrets));
|
|
4723
|
+
const applyArgs = (args, secrets) => {
|
|
4724
|
+
if (secrets.length === 0) return args;
|
|
4725
|
+
const values = prepare(secrets);
|
|
4726
|
+
return args.map((arg) => replaceAll(arg, values));
|
|
4727
|
+
};
|
|
4728
|
+
/** Whether `name` introduces a credential value. */
|
|
4729
|
+
const isSecretName = (name, extra) => {
|
|
4730
|
+
const lower = name.toLowerCase();
|
|
4731
|
+
return SECRET_FLAGS.has(lower) || extra.has(lower) || AUTH_KEY.test(name);
|
|
4732
|
+
};
|
|
4733
|
+
const scrubArgs = (args, options) => {
|
|
4734
|
+
const extra = new Set((options?.flags ?? []).map((flag) => flag.toLowerCase()));
|
|
4735
|
+
const out = [];
|
|
4736
|
+
for (let index = 0; index < args.length; index++) {
|
|
4737
|
+
const arg = args[index] ?? "";
|
|
4738
|
+
const equals = arg.indexOf("=");
|
|
4739
|
+
if (equals > 0 && isSecretName(arg.slice(0, equals), extra)) {
|
|
4740
|
+
out.push(`${arg.slice(0, equals)}=***`);
|
|
4741
|
+
continue;
|
|
4742
|
+
}
|
|
4743
|
+
out.push(arg);
|
|
4744
|
+
if (isSecretName(arg, extra) && index + 1 < args.length) {
|
|
4745
|
+
out.push("***");
|
|
4746
|
+
index++;
|
|
4747
|
+
}
|
|
4748
|
+
}
|
|
4749
|
+
return out;
|
|
4750
|
+
};
|
|
4751
|
+
/**
|
|
4752
|
+
* Secret scrubbing for command arguments and captured output.
|
|
4753
|
+
*
|
|
4754
|
+
* @remarks
|
|
4755
|
+
* Two mechanisms, deliberately layered. {@link Redaction.apply} and
|
|
4756
|
+
* {@link Redaction.applyArgs} redact **by value** — the caller declares its
|
|
4757
|
+
* secrets as `Redacted` and every occurrence is removed wherever it appears.
|
|
4758
|
+
* {@link Redaction.scrubArgs} is a **flag heuristic** that runs in addition, for
|
|
4759
|
+
* the secrets a caller forgot to declare.
|
|
4760
|
+
*
|
|
4761
|
+
* @public
|
|
4762
|
+
*/
|
|
4763
|
+
var Redaction = class {
|
|
4764
|
+
constructor() {}
|
|
4765
|
+
/**
|
|
4766
|
+
* Replaces every occurrence of every secret's value in `text` with
|
|
4767
|
+
* {@link REDACTED}.
|
|
4768
|
+
*
|
|
4769
|
+
* @remarks
|
|
4770
|
+
* Exact, literal matching — no pattern compilation, no encoding-aware search. A
|
|
4771
|
+
* secret that reaches the text base64-encoded, URL-encoded, or split across a
|
|
4772
|
+
* line break is **not** found; declare the encoded form as a secret too if that
|
|
4773
|
+
* is a real risk.
|
|
4774
|
+
*
|
|
4775
|
+
* A secret composed only of the placeholder's own characters (`*`, `**`, `***`)
|
|
4776
|
+
* cannot be fully removed, because the replacement reintroduces it. That is a
|
|
4777
|
+
* documented limitation, not a defect.
|
|
4778
|
+
*/
|
|
4779
|
+
static apply = apply;
|
|
4780
|
+
/**
|
|
4781
|
+
* {@link Redaction.apply} over each entry of an argv array. An entry is
|
|
4782
|
+
* redacted whether it *is* a secret or merely *contains* one
|
|
4783
|
+
* (`--url=https://u:s3cr3t@host`).
|
|
4784
|
+
*/
|
|
4785
|
+
static applyArgs = applyArgs;
|
|
4786
|
+
/**
|
|
4787
|
+
* Heuristic backstop: redact any argv value that is introduced by a known
|
|
4788
|
+
* secret-bearing flag or npm auth key, in either the separated
|
|
4789
|
+
* (`--token abc`) or inline (`--token=abc`) form.
|
|
4790
|
+
*
|
|
4791
|
+
* @remarks
|
|
4792
|
+
* This catches secrets the caller forgot to declare; it cannot catch a flag
|
|
4793
|
+
* nobody listed. Prefer {@link Redaction.applyArgs} with the actual
|
|
4794
|
+
* `Redacted` values — this runs *in addition*, never instead.
|
|
4795
|
+
*/
|
|
4796
|
+
static scrubArgs = scrubArgs;
|
|
4797
|
+
/** Flags treated as secret-bearing by {@link Redaction.scrubArgs}. See {@link SECRET_FLAGS}. */
|
|
4798
|
+
static SECRET_FLAGS = SECRET_FLAGS;
|
|
4799
|
+
};
|
|
4800
|
+
|
|
4801
|
+
//#endregion
|
|
4802
|
+
//#region ../../node_modules/.pnpm/@effected+commands@0.3.1_effect@4.0.0-beta.101/node_modules/@effected/commands/internal/capture.js
|
|
4803
|
+
/**
|
|
4804
|
+
* Raised when a captured stream exceeds its byte budget.
|
|
4805
|
+
*
|
|
4806
|
+
* @remarks
|
|
4807
|
+
* Internal and never exported from the package: `Run` maps it to the public
|
|
4808
|
+
* `CommandOutputError`. `Data.TaggedError` is appropriate precisely because it
|
|
4809
|
+
* never escapes — it is an in-process signal, not a contract.
|
|
4810
|
+
*/
|
|
4811
|
+
var OutputTooLarge = class extends Data.TaggedError("OutputTooLarge") {};
|
|
4812
|
+
/**
|
|
4813
|
+
* Collects a byte stream into a string, failing once more than `limit` bytes
|
|
4814
|
+
* have arrived.
|
|
4815
|
+
*
|
|
4816
|
+
* @remarks
|
|
4817
|
+
* The budget is enforced **during** accumulation, not after: checking the
|
|
4818
|
+
* length of an already-collected string would mean the memory was already
|
|
4819
|
+
* spent, which is the exact failure the budget exists to prevent. Counting is
|
|
4820
|
+
* on raw bytes, before decoding, because bytes are what the process actually
|
|
4821
|
+
* produced.
|
|
4822
|
+
*/
|
|
4823
|
+
const collectBounded = (stream, limit) => Effect.gen(function* () {
|
|
4824
|
+
const seen = yield* Ref.make(0);
|
|
4825
|
+
const bounded = Stream.mapEffect(stream, (chunk) => Effect.flatMap(Ref.updateAndGet(seen, (total) => total + chunk.length), (total) => total > limit ? Effect.fail(new OutputTooLarge({ limit })) : Effect.succeed(chunk)));
|
|
4826
|
+
return yield* Stream.mkString(Stream.decodeText(bounded));
|
|
4827
|
+
});
|
|
4828
|
+
|
|
4829
|
+
//#endregion
|
|
4830
|
+
//#region ../../node_modules/.pnpm/@effected+commands@0.3.1_effect@4.0.0-beta.101/node_modules/@effected/commands/Run.js
|
|
4831
|
+
/**
|
|
4832
|
+
* Default ceiling on captured bytes per stream (16 MiB).
|
|
4833
|
+
*
|
|
4834
|
+
* @remarks
|
|
4835
|
+
* Collecting a child's output without a bound is a memory-exhaustion vector.
|
|
4836
|
+
* Output genuinely larger than this belongs on {@link Run.stream}, which never
|
|
4837
|
+
* accumulates.
|
|
4838
|
+
*
|
|
4839
|
+
* @public
|
|
4840
|
+
*/
|
|
4841
|
+
const DEFAULT_MAX_OUTPUT_BYTES = 16777216;
|
|
4842
|
+
/** Characters shown from the tail of captured output in an error message. */
|
|
4843
|
+
const MAX_MESSAGE_CHARS = 2e3;
|
|
4844
|
+
/**
|
|
4845
|
+
* What one completed run produced.
|
|
4846
|
+
*
|
|
4847
|
+
* @public
|
|
4848
|
+
*/
|
|
4849
|
+
var CommandOutput = class extends Schema.Class("CommandOutput")({
|
|
4850
|
+
/** Captured standard output, redacted. */
|
|
4851
|
+
stdout: Schema.String,
|
|
4852
|
+
/** Captured standard error, redacted. */
|
|
4853
|
+
stderr: Schema.String,
|
|
4854
|
+
/** The process exit code. A non-zero value is NOT an error at this level. */
|
|
4855
|
+
exitCode: Schema.Number
|
|
4856
|
+
}) {
|
|
4857
|
+
/** Whether the process exited zero. */
|
|
4858
|
+
get succeeded() {
|
|
4859
|
+
return this.exitCode === 0;
|
|
4860
|
+
}
|
|
4861
|
+
};
|
|
4862
|
+
/** The executable and argv an error should report for `command`. */
|
|
4863
|
+
const describeCommand = (command) => {
|
|
4864
|
+
if (ChildProcess.isStandardCommand(command)) return {
|
|
4865
|
+
command: command.command,
|
|
4866
|
+
args: command.args
|
|
4867
|
+
};
|
|
4868
|
+
const left = describeCommand(command.left);
|
|
4869
|
+
const right = describeCommand(command.right);
|
|
4870
|
+
return {
|
|
4871
|
+
command: `${left.command} | ${right.command}`,
|
|
4872
|
+
args: []
|
|
4873
|
+
};
|
|
4874
|
+
};
|
|
4875
|
+
/** argv as an error should store it: declared secrets removed, then the flag heuristic. */
|
|
4876
|
+
const safeArgs = (args, secrets) => Redaction.scrubArgs(Redaction.applyArgs(args, secrets ?? []));
|
|
4877
|
+
/** Captured text as an error should store it. */
|
|
4878
|
+
const safeText = (text, secrets) => Redaction.apply(text, secrets ?? []);
|
|
4879
|
+
/** Tail-bounded rendering: tools write warnings first and the real error last. */
|
|
4880
|
+
const tail = (text) => {
|
|
4881
|
+
const trimmed = text.trim();
|
|
4882
|
+
if (trimmed.length <= MAX_MESSAGE_CHARS) return trimmed;
|
|
4883
|
+
return `...[${trimmed.length - MAX_MESSAGE_CHARS} chars truncated from head]...\n${trimmed.slice(-2e3)}`;
|
|
4884
|
+
};
|
|
4885
|
+
/**
|
|
4886
|
+
* A command that could not be run, or that ran and failed.
|
|
4887
|
+
*
|
|
4888
|
+
* @remarks
|
|
4889
|
+
* `kind` is the routing surface, never the message: `"nonZero"` (the process
|
|
4890
|
+
* ran and exited non-zero), `"spawn"` (it never started — the executable is
|
|
4891
|
+
* missing, or the platform refused), `"timeout"` (a caller-supplied ceiling
|
|
4892
|
+
* elapsed). Composed retry and fallback logic branches on `kind`; nothing in
|
|
4893
|
+
* this package asks a caller to match on prose.
|
|
4894
|
+
*
|
|
4895
|
+
* `args` is **always** stored redacted.
|
|
4896
|
+
*
|
|
4897
|
+
* @public
|
|
4898
|
+
*/
|
|
4899
|
+
var CommandFailedError = class CommandFailedError extends Schema.TaggedErrorClass()("CommandFailedError", {
|
|
4900
|
+
/** Why it failed. */
|
|
4901
|
+
kind: Schema.Literals([
|
|
4902
|
+
"nonZero",
|
|
4903
|
+
"spawn",
|
|
4904
|
+
"timeout"
|
|
4905
|
+
]),
|
|
4906
|
+
/** The executable (or `"a | b"` for a pipeline). */
|
|
4907
|
+
command: Schema.String,
|
|
4908
|
+
/** argv, redacted. */
|
|
4909
|
+
args: Schema.Array(Schema.String),
|
|
4910
|
+
/** The exit code, when the process ran. */
|
|
4911
|
+
exitCode: Schema.optionalKey(Schema.Number),
|
|
4912
|
+
/** Captured standard error, redacted, when the process ran. */
|
|
4913
|
+
stderr: Schema.optionalKey(Schema.String),
|
|
4914
|
+
/** Captured standard output, redacted, when the process ran. */
|
|
4915
|
+
stdout: Schema.optionalKey(Schema.String),
|
|
4916
|
+
/** The absorbed platform failure, for `"spawn"`. */
|
|
4917
|
+
cause: Schema.optionalKey(Schema.Defect())
|
|
4918
|
+
}) {
|
|
4919
|
+
/** The process ran and exited non-zero. */
|
|
4920
|
+
static nonZero = (command, output, secrets) => {
|
|
4921
|
+
const described = describeCommand(command);
|
|
4922
|
+
return new CommandFailedError({
|
|
4923
|
+
kind: "nonZero",
|
|
4924
|
+
command: described.command,
|
|
4925
|
+
args: safeArgs(described.args, secrets),
|
|
4926
|
+
exitCode: output.exitCode,
|
|
4927
|
+
stderr: output.stderr,
|
|
4928
|
+
stdout: output.stdout
|
|
4929
|
+
});
|
|
4930
|
+
};
|
|
4931
|
+
/** The process never started. */
|
|
4932
|
+
static spawn = (command, cause, secrets) => {
|
|
4933
|
+
const described = describeCommand(command);
|
|
4934
|
+
return new CommandFailedError({
|
|
4935
|
+
kind: "spawn",
|
|
4936
|
+
command: described.command,
|
|
4937
|
+
args: safeArgs(described.args, secrets),
|
|
4938
|
+
cause
|
|
4939
|
+
});
|
|
4940
|
+
};
|
|
4941
|
+
/** A caller-supplied ceiling elapsed; the child was killed with its scope. */
|
|
4942
|
+
static timedOut = (command, secrets) => {
|
|
4943
|
+
const described = describeCommand(command);
|
|
4944
|
+
return new CommandFailedError({
|
|
4945
|
+
kind: "timeout",
|
|
4946
|
+
command: described.command,
|
|
4947
|
+
args: safeArgs(described.args, secrets)
|
|
4948
|
+
});
|
|
4949
|
+
};
|
|
4950
|
+
/**
|
|
4951
|
+
* Whether this is a spawn failure caused by the executable not existing —
|
|
4952
|
+
* the structural "tool is not installed" signal.
|
|
4953
|
+
*/
|
|
4954
|
+
get notFound() {
|
|
4955
|
+
return this.kind === "spawn" && this.cause instanceof PlatformError.PlatformError && this.cause.reason._tag === "NotFound";
|
|
4956
|
+
}
|
|
4957
|
+
/** Names the command and surfaces the tail of whichever stream carries the cause. */
|
|
4958
|
+
get message() {
|
|
4959
|
+
const parts = [`Command "${this.args.length > 0 ? `${this.command} ${this.args.join(" ")}` : this.command}" failed`];
|
|
4960
|
+
if (this.kind === "timeout") parts.push("(timed out)");
|
|
4961
|
+
if (this.exitCode !== void 0) parts.push(`(exit ${this.exitCode})`);
|
|
4962
|
+
const stream = this.stderr?.trim() ? this.stderr : this.stdout?.trim() ? this.stdout : void 0;
|
|
4963
|
+
if (stream !== void 0) parts.push(`:\n${tail(stream)}`);
|
|
4964
|
+
return parts.join(" ");
|
|
4965
|
+
}
|
|
4966
|
+
};
|
|
4967
|
+
/**
|
|
4968
|
+
* A command ran, but its output could not be used.
|
|
4969
|
+
*
|
|
4970
|
+
* @remarks
|
|
4971
|
+
* Separate from {@link CommandFailedError} because the process itself
|
|
4972
|
+
* succeeded: `"notJson"` (stdout is not JSON), `"schema"` (it is JSON but does
|
|
4973
|
+
* not decode), `"tooLarge"` (capture exceeded its byte budget). Keeping the two
|
|
4974
|
+
* distinguishable is the point — a schema drift and a crashed tool call for
|
|
4975
|
+
* different responses.
|
|
4976
|
+
*
|
|
4977
|
+
* The context fields (`exitCode`, `stderr`, `stdout`) are populated by
|
|
4978
|
+
* {@link Run.jsonLine}, whose payload framing parses regardless of exit code —
|
|
4979
|
+
* when no payload arrives, the exit code and captured streams are the only
|
|
4980
|
+
* evidence of what actually went wrong. Both streams are **always** stored
|
|
4981
|
+
* redacted.
|
|
4982
|
+
*
|
|
4983
|
+
* @public
|
|
4984
|
+
*/
|
|
4985
|
+
var CommandOutputError = class extends Schema.TaggedErrorClass()("CommandOutputError", {
|
|
4986
|
+
/** Which way the output was unusable. */
|
|
4987
|
+
kind: Schema.Literals([
|
|
4988
|
+
"notJson",
|
|
4989
|
+
"schema",
|
|
4990
|
+
"tooLarge"
|
|
4991
|
+
]),
|
|
4992
|
+
/** The executable that produced it. */
|
|
4993
|
+
command: Schema.String,
|
|
4994
|
+
/** The underlying parse or decode failure. */
|
|
4995
|
+
cause: Schema.optionalKey(Schema.Defect()),
|
|
4996
|
+
/** The exit code, when the combinator parses independently of it. */
|
|
4997
|
+
exitCode: Schema.optionalKey(Schema.Number),
|
|
4998
|
+
/** Captured standard error, redacted, when the process ran. */
|
|
4999
|
+
stderr: Schema.optionalKey(Schema.String),
|
|
5000
|
+
/** Captured standard output, redacted, when the process ran. */
|
|
5001
|
+
stdout: Schema.optionalKey(Schema.String)
|
|
5002
|
+
}) {
|
|
5003
|
+
get message() {
|
|
5004
|
+
const parts = [];
|
|
5005
|
+
if (this.kind === "notJson") parts.push(`Command "${this.command}" did not produce JSON`);
|
|
5006
|
+
else if (this.kind === "schema") parts.push(`Command "${this.command}" produced JSON that did not match the expected schema`);
|
|
5007
|
+
else parts.push(`Command "${this.command}" produced more output than the configured limit`);
|
|
5008
|
+
if (this.exitCode !== void 0) parts.push(`(exit ${this.exitCode})`);
|
|
5009
|
+
if (this.stderr !== void 0 && this.stderr.trim().length > 0) parts.push(`:\n${tail(this.stderr)}`);
|
|
5010
|
+
return parts.join(" ");
|
|
5011
|
+
}
|
|
5012
|
+
};
|
|
5013
|
+
/** Spawns, collects both streams concurrently, and awaits exit. */
|
|
5014
|
+
const collectRaw = (command, options, tee) => Effect.scoped(Effect.gen(function* () {
|
|
5015
|
+
const handle = yield* (yield* ChildProcessSpawner.ChildProcessSpawner).spawn(command);
|
|
5016
|
+
const limit = options?.maxOutputBytes ?? 16777216;
|
|
5017
|
+
const out = tee === void 0 ? handle.stdout : Stream.tapSink(handle.stdout, tee.stdout());
|
|
5018
|
+
const err = tee === void 0 ? handle.stderr : Stream.tapSink(handle.stderr, tee.stderr());
|
|
5019
|
+
const [stdout, stderr, exitCode] = yield* Effect.all([
|
|
5020
|
+
collectBounded(out, limit),
|
|
5021
|
+
collectBounded(err, limit),
|
|
5022
|
+
handle.exitCode
|
|
5023
|
+
], { concurrency: "unbounded" });
|
|
5024
|
+
const secrets = options?.redact;
|
|
5025
|
+
return CommandOutput.make({
|
|
5026
|
+
stdout: safeText(stdout, secrets),
|
|
5027
|
+
stderr: safeText(stderr, secrets),
|
|
5028
|
+
exitCode: Number(exitCode)
|
|
5029
|
+
});
|
|
5030
|
+
}));
|
|
5031
|
+
/** Maps the raw failure modes onto this package's taxonomy, and applies any ceiling. */
|
|
5032
|
+
const collectClassified = (command, options, tee) => {
|
|
5033
|
+
const described = describeCommand(command);
|
|
5034
|
+
const classified = collectRaw(command, options, tee).pipe(Effect.catch((error) => Effect.fail(error instanceof OutputTooLarge ? new CommandOutputError({
|
|
5035
|
+
kind: "tooLarge",
|
|
5036
|
+
command: described.command,
|
|
5037
|
+
cause: error
|
|
5038
|
+
}) : CommandFailedError.spawn(command, error, options?.redact))));
|
|
5039
|
+
return options?.timeout === void 0 ? classified : Effect.timeoutOrElse(classified, {
|
|
5040
|
+
duration: options.timeout,
|
|
5041
|
+
orElse: () => Effect.fail(CommandFailedError.timedOut(command, options.redact))
|
|
5042
|
+
});
|
|
5043
|
+
};
|
|
5044
|
+
/** Fails a run whose process exited non-zero. */
|
|
5045
|
+
const requireZero = (command, output, options) => output.succeeded ? Effect.succeed(output) : Effect.fail(CommandFailedError.nonZero(command, output, options?.redact));
|
|
5046
|
+
/** Span attributes: what ran and how many arguments — never the arguments. */
|
|
5047
|
+
const annotate = (command) => {
|
|
5048
|
+
const described = describeCommand(command);
|
|
5049
|
+
return Effect.annotateCurrentSpan({
|
|
5050
|
+
command: described.command,
|
|
5051
|
+
argc: described.args.length
|
|
5052
|
+
});
|
|
5053
|
+
};
|
|
5054
|
+
const collect = Effect.fn("Run.collect")(function* (command, options) {
|
|
5055
|
+
yield* annotate(command);
|
|
5056
|
+
return yield* collectClassified(command, options, void 0);
|
|
5057
|
+
});
|
|
5058
|
+
const collectTee = Effect.fn("Run.collectTee")(function* (command, options) {
|
|
5059
|
+
yield* annotate(command);
|
|
5060
|
+
const stdio = yield* Stdio.Stdio;
|
|
5061
|
+
return yield* collectClassified(command, options, stdio);
|
|
5062
|
+
});
|
|
5063
|
+
const text$4 = Effect.fn("Run.text")(function* (command, options) {
|
|
5064
|
+
yield* annotate(command);
|
|
5065
|
+
const output = yield* collectClassified(command, options, void 0);
|
|
5066
|
+
return (yield* requireZero(command, output, options)).stdout.trim();
|
|
5067
|
+
});
|
|
5068
|
+
const lines = Effect.fn("Run.lines")(function* (command, options) {
|
|
5069
|
+
yield* annotate(command);
|
|
5070
|
+
const output = yield* collectClassified(command, options, void 0);
|
|
5071
|
+
return (yield* requireZero(command, output, options)).stdout.split(/\r?\n/).map((line) => line.trim()).filter((line) => line.length > 0);
|
|
5072
|
+
});
|
|
5073
|
+
const json = Effect.fn("Run.json")(function* (command, schema, options) {
|
|
5074
|
+
yield* annotate(command);
|
|
5075
|
+
const described = describeCommand(command);
|
|
5076
|
+
const output = yield* collectClassified(command, options, void 0);
|
|
5077
|
+
const checked = yield* requireZero(command, output, options);
|
|
5078
|
+
const parsed = yield* Effect.try({
|
|
5079
|
+
try: () => JSON.parse(checked.stdout),
|
|
5080
|
+
catch: (cause) => new CommandOutputError({
|
|
5081
|
+
kind: "notJson",
|
|
5082
|
+
command: described.command,
|
|
5083
|
+
cause
|
|
5084
|
+
})
|
|
5085
|
+
});
|
|
5086
|
+
return yield* Schema.decodeUnknownEffect(schema)(parsed).pipe(Effect.catch((cause) => Effect.fail(new CommandOutputError({
|
|
5087
|
+
kind: "schema",
|
|
5088
|
+
command: described.command,
|
|
5089
|
+
cause
|
|
5090
|
+
}))));
|
|
5091
|
+
});
|
|
5092
|
+
const jsonLine = Effect.fn("Run.jsonLine")(function* (command, schema, options) {
|
|
5093
|
+
yield* annotate(command);
|
|
5094
|
+
const described = describeCommand(command);
|
|
5095
|
+
const output = yield* collectClassified(command, options, void 0);
|
|
5096
|
+
const context = {
|
|
5097
|
+
exitCode: output.exitCode,
|
|
5098
|
+
stderr: output.stderr,
|
|
5099
|
+
stdout: output.stdout
|
|
5100
|
+
};
|
|
5101
|
+
const candidates = output.stdout.split(/\r?\n/).filter((candidate) => candidate.trim().length > 0);
|
|
5102
|
+
if (candidates.length === 0) return yield* Effect.fail(new CommandOutputError({
|
|
5103
|
+
kind: "notJson",
|
|
5104
|
+
command: described.command,
|
|
5105
|
+
cause: /* @__PURE__ */ new Error("stdout carried no non-empty line"),
|
|
5106
|
+
...context
|
|
5107
|
+
}));
|
|
5108
|
+
let notJsonCause;
|
|
5109
|
+
let schemaCause;
|
|
5110
|
+
for (let index = candidates.length - 1; index >= 0; index--) {
|
|
5111
|
+
const candidate = candidates[index];
|
|
5112
|
+
if (candidate === void 0) continue;
|
|
5113
|
+
let parsed;
|
|
5114
|
+
try {
|
|
5115
|
+
parsed = JSON.parse(candidate);
|
|
5116
|
+
} catch (cause) {
|
|
5117
|
+
notJsonCause ??= cause;
|
|
5118
|
+
continue;
|
|
5119
|
+
}
|
|
5120
|
+
const decoded = yield* Effect.result(Schema.decodeUnknownEffect(schema)(parsed));
|
|
5121
|
+
if (Result.isSuccess(decoded)) return decoded.success;
|
|
5122
|
+
schemaCause ??= decoded.failure;
|
|
5123
|
+
}
|
|
5124
|
+
return yield* Effect.fail(schemaCause !== void 0 ? new CommandOutputError({
|
|
5125
|
+
kind: "schema",
|
|
5126
|
+
command: described.command,
|
|
5127
|
+
cause: schemaCause,
|
|
5128
|
+
...context
|
|
5129
|
+
}) : new CommandOutputError({
|
|
5130
|
+
kind: "notJson",
|
|
5131
|
+
command: described.command,
|
|
5132
|
+
cause: notJsonCause,
|
|
5133
|
+
...context
|
|
5134
|
+
}));
|
|
5135
|
+
});
|
|
5136
|
+
const exitCode = Effect.fn("Run.exitCode")(function* (command, options) {
|
|
5137
|
+
yield* annotate(command);
|
|
5138
|
+
return (yield* collectClassified(command, options, void 0)).exitCode;
|
|
5139
|
+
});
|
|
5140
|
+
const succeeds = Effect.fn("Run.succeeds")(function* (command, options) {
|
|
5141
|
+
yield* annotate(command);
|
|
5142
|
+
return yield* collectClassified(command, options, void 0).pipe(Effect.map((output) => output.succeeded), Effect.catch(() => Effect.succeed(false)));
|
|
5143
|
+
});
|
|
5144
|
+
const detach = Effect.fn("Run.detach")(function* (command) {
|
|
5145
|
+
yield* annotate(command);
|
|
5146
|
+
return yield* Effect.scoped(Effect.gen(function* () {
|
|
5147
|
+
const handle = yield* (yield* ChildProcessSpawner.ChildProcessSpawner).spawn(command);
|
|
5148
|
+
yield* handle.unref;
|
|
5149
|
+
return handle.pid;
|
|
5150
|
+
})).pipe(Effect.catch((error) => Effect.fail(CommandFailedError.spawn(command, error))));
|
|
5151
|
+
});
|
|
5152
|
+
const stream = (command, options) => Stream.unwrap(Effect.map(ChildProcessSpawner.ChildProcessSpawner, (spawner) => spawner.streamLines(command, { includeStderr: options?.includeStderr ?? false }))).pipe(Stream.mapError((error) => CommandFailedError.spawn(command, error)));
|
|
5153
|
+
const extendEnv = Function.dual(2, (self, env) => {
|
|
5154
|
+
if (ChildProcess.isStandardCommand(self)) {
|
|
5155
|
+
const merged = self.options.env === void 0 ? env : {
|
|
5156
|
+
...self.options.env,
|
|
5157
|
+
...env
|
|
5158
|
+
};
|
|
5159
|
+
return ChildProcess.make(self.command, self.args, {
|
|
5160
|
+
...self.options,
|
|
5161
|
+
env: merged,
|
|
5162
|
+
extendEnv: true
|
|
5163
|
+
});
|
|
5164
|
+
}
|
|
5165
|
+
return ChildProcess.pipeTo(extendEnv(self.left, env), extendEnv(self.right, env), self.options);
|
|
5166
|
+
});
|
|
5167
|
+
/**
|
|
5168
|
+
* Structured running of core `ChildProcess.Command` values.
|
|
5169
|
+
*
|
|
5170
|
+
* @remarks
|
|
5171
|
+
* These are free functions over core's contract, **not** a service: core's
|
|
5172
|
+
* `ChildProcessSpawner` already is the subprocess service, and wrapping it in a
|
|
5173
|
+
* second one is the re-declaration this package exists not to repeat. Tests
|
|
5174
|
+
* stub the spawner (`ChildProcessSpawner.make(mockSpawn)`), not these.
|
|
5175
|
+
*
|
|
5176
|
+
* A non-zero exit is a *result* for {@link Run.collect}, {@link Run.exitCode},
|
|
5177
|
+
* {@link Run.succeeds} and {@link Run.jsonLine}, and a typed *failure* for
|
|
5178
|
+
* {@link Run.text}, {@link Run.lines} and {@link Run.json} — the split is
|
|
5179
|
+
* deliberate, matching core (where a non-zero exit is a success) at the
|
|
5180
|
+
* reporting level while giving the interpreting helpers the ergonomics callers
|
|
5181
|
+
* actually want.
|
|
5182
|
+
*
|
|
5183
|
+
* The interpreting helpers also **trim**: {@link Run.text} strips leading and
|
|
5184
|
+
* trailing whitespace from the whole result — not just a trailing newline —
|
|
5185
|
+
* and {@link Run.lines} trims each line. Fixed-column output whose first
|
|
5186
|
+
* column can be whitespace (`git status --porcelain`) silently loses that
|
|
5187
|
+
* column through either, producing plausible wrong values rather than an
|
|
5188
|
+
* error. Parse that kind of output from the untrimmed `stdout` of
|
|
5189
|
+
* {@link Run.collect}'s {@link CommandOutput} instead.
|
|
5190
|
+
*
|
|
5191
|
+
* @public
|
|
5192
|
+
*/
|
|
5193
|
+
var Run = class {
|
|
5194
|
+
constructor() {}
|
|
5195
|
+
/**
|
|
5196
|
+
* Spawns `command`, collects stdout and stderr concurrently, and resolves
|
|
5197
|
+
* with the {@link CommandOutput} once the process exits.
|
|
5198
|
+
*
|
|
5199
|
+
* @remarks
|
|
5200
|
+
* A non-zero exit is a *result* here, not a failure — see {@link Run}'s
|
|
5201
|
+
* remarks for the split against {@link Run.text}, {@link Run.lines} and
|
|
5202
|
+
* {@link Run.json}.
|
|
5203
|
+
*/
|
|
5204
|
+
static collect = collect;
|
|
5205
|
+
/**
|
|
5206
|
+
* Like {@link Run.collect}, but also tees each stream to the `Stdio` in `R`
|
|
5207
|
+
* as it arrives, for a caller that wants live output alongside the captured
|
|
5208
|
+
* {@link CommandOutput}.
|
|
5209
|
+
*/
|
|
5210
|
+
static collectTee = collectTee;
|
|
5211
|
+
/**
|
|
5212
|
+
* Runs `command` and resolves with trimmed stdout on a zero exit.
|
|
5213
|
+
*
|
|
5214
|
+
* @remarks
|
|
5215
|
+
* A non-zero exit is a typed failure here — {@link CommandFailedError} —
|
|
5216
|
+
* unlike {@link Run.collect}, {@link Run.exitCode} and {@link Run.succeeds},
|
|
5217
|
+
* which treat it as a result.
|
|
5218
|
+
*
|
|
5219
|
+
* The trim strips **leading and trailing whitespace**, not just the trailing
|
|
5220
|
+
* newline. For parse-sensitive output where leading whitespace is data
|
|
5221
|
+
* (`git status --porcelain`, whose first entry's status column it would
|
|
5222
|
+
* silently eat), use {@link Run.collect} and read its {@link CommandOutput}'s
|
|
5223
|
+
* untrimmed `stdout` instead.
|
|
5224
|
+
*/
|
|
5225
|
+
static text = text$4;
|
|
5226
|
+
/**
|
|
5227
|
+
* Runs `command` and resolves with stdout split into trimmed, non-empty
|
|
5228
|
+
* lines on a zero exit.
|
|
5229
|
+
*
|
|
5230
|
+
* @remarks
|
|
5231
|
+
* A non-zero exit is a typed failure here — {@link CommandFailedError} —
|
|
5232
|
+
* matching {@link Run.text} and {@link Run.json}.
|
|
5233
|
+
*/
|
|
5234
|
+
static lines = lines;
|
|
5235
|
+
/**
|
|
5236
|
+
* Runs `command`, parses stdout as JSON and decodes it against `schema` on
|
|
5237
|
+
* a zero exit.
|
|
5238
|
+
*
|
|
5239
|
+
* @remarks
|
|
5240
|
+
* Fails with {@link CommandOutputError} when stdout is not JSON or does not
|
|
5241
|
+
* decode; a non-zero exit fails with {@link CommandFailedError}, matching
|
|
5242
|
+
* {@link Run.text} and {@link Run.lines}.
|
|
5243
|
+
*
|
|
5244
|
+
* This parses the **whole** of stdout and requires a zero exit. For a
|
|
5245
|
+
* protocol payload located by scanning stdout lines from the end — tolerant
|
|
5246
|
+
* of noise around it and of a non-zero exit — use {@link Run.jsonLine}
|
|
5247
|
+
* instead.
|
|
5248
|
+
*/
|
|
5249
|
+
static json = json;
|
|
5250
|
+
/**
|
|
5251
|
+
* Runs `command` and, **scanning stdout lines from the end**, resolves with
|
|
5252
|
+
* the first line that both parses as JSON and decodes against `schema` —
|
|
5253
|
+
* the framing variant of {@link Run.json}, for a child that reports through
|
|
5254
|
+
* a single JSON protocol payload near the end of its output.
|
|
5255
|
+
*
|
|
5256
|
+
* @remarks
|
|
5257
|
+
* The framing tolerates noise on **both sides** of the payload: noise before
|
|
5258
|
+
* it (a subprocess-loaded hook's own `console.log`, a tool's warnings) and
|
|
5259
|
+
* noise after it (a hook logging from `process.on("exit", ...)` fires after
|
|
5260
|
+
* the payload has flushed — the trigger for widening the old "last non-empty
|
|
5261
|
+
* line must decode" contract, spencerbeggs/effected#292). Lines are split on
|
|
5262
|
+
* `\r?\n`, whitespace-only lines are dropped, and the scan runs from the last
|
|
5263
|
+
* line backwards until one decodes. The tolerance is positional, not
|
|
5264
|
+
* volumetric: the whole of stdout is still captured under
|
|
5265
|
+
* {@link RunOptions.maxOutputBytes} (default
|
|
5266
|
+
* {@link DEFAULT_MAX_OUTPUT_BYTES}, 16 MiB), so a child whose noise exceeds
|
|
5267
|
+
* the ceiling fails typed as `"tooLarge"` before any line is examined —
|
|
5268
|
+
* raise the ceiling for a child known to be loud in volume.
|
|
5269
|
+
*
|
|
5270
|
+
* The scan's consequence: when **multiple** lines decode under `schema`, the
|
|
5271
|
+
* **last** one wins. A child must therefore never emit two schema-valid
|
|
5272
|
+
* lines, and a consumer schema should be shaped so an accidental log line
|
|
5273
|
+
* cannot satisfy it — a discriminated envelope with a required literal field
|
|
5274
|
+
* (`ok: true | false`, the shape `@effected/workspaces`' `ReplayPayload`
|
|
5275
|
+
* uses) rather than a permissive record a stray `console.log(someObject)`
|
|
5276
|
+
* might match.
|
|
5277
|
+
*
|
|
5278
|
+
* Unlike {@link Run.json}, this parses **regardless of the exit code** — a
|
|
5279
|
+
* deliberate posture, not an oversight. A protocol payload discriminates
|
|
5280
|
+
* success in-band (its own `ok` field, its own error shape), so the payload
|
|
5281
|
+
* outranks the exit code: a child that crashes *after* flushing its payload
|
|
5282
|
+
* still reported, and a caller that wants exit-code semantics has
|
|
5283
|
+
* {@link Run.json}. When no line decodes anywhere, the typed
|
|
5284
|
+
* {@link CommandOutputError} carries the exit code and both captured streams
|
|
5285
|
+
* (redacted) as context, so the failure is diagnosable without re-running.
|
|
5286
|
+
* Its `kind` preserves the near-miss diagnostic: `"schema"` when at least
|
|
5287
|
+
* one line parsed as JSON but none decoded — with the **last parseable
|
|
5288
|
+
* line's** decode failure as `cause`, that line being the most probable
|
|
5289
|
+
* intended payload — and `"notJson"` only when no non-empty line was JSON at
|
|
5290
|
+
* all (carrying the last non-empty line's parse error). A spawn failure or
|
|
5291
|
+
* an opted-in timeout still fails with {@link CommandFailedError}.
|
|
5292
|
+
*/
|
|
5293
|
+
static jsonLine = jsonLine;
|
|
5294
|
+
/**
|
|
5295
|
+
* Runs `command` and resolves with its exit code alone.
|
|
5296
|
+
*
|
|
5297
|
+
* @remarks
|
|
5298
|
+
* A non-zero exit is a *result* here, not a failure — see {@link Run}'s
|
|
5299
|
+
* remarks for the split against {@link Run.text}, {@link Run.lines} and
|
|
5300
|
+
* {@link Run.json}.
|
|
5301
|
+
*/
|
|
5302
|
+
static exitCode = exitCode;
|
|
5303
|
+
/**
|
|
5304
|
+
* Runs `command` and resolves with whether it exited zero, collapsing a
|
|
5305
|
+
* spawn or other classified failure to `false` rather than propagating it.
|
|
5306
|
+
*/
|
|
5307
|
+
static succeeds = succeeds;
|
|
5308
|
+
/** Decoded stdout lines as they arrive, for output too large or too long-lived to collect. */
|
|
5309
|
+
static stream = stream;
|
|
5310
|
+
/**
|
|
5311
|
+
* Spawns `command` and resolves with its pid without waiting for exit.
|
|
5312
|
+
*
|
|
5313
|
+
* @remarks
|
|
5314
|
+
* Unrefs the child **before** this scope closes, so it survives the
|
|
5315
|
+
* caller's scope closing — the Node backend's release skips the kill for an
|
|
5316
|
+
* unref'd child, and reversing that order kills it with the scope instead.
|
|
5317
|
+
* Fails with {@link CommandFailedError} if the process never starts.
|
|
5318
|
+
*/
|
|
5319
|
+
static detach = detach;
|
|
5320
|
+
/**
|
|
5321
|
+
* Adds environment variables to a command WITHOUT losing the parent
|
|
5322
|
+
* environment: merges `env` over any existing command environment (new values
|
|
5323
|
+
* win, matching core's `ChildProcess.setEnv`) and sets `extendEnv: true`.
|
|
5324
|
+
*
|
|
5325
|
+
* @remarks
|
|
5326
|
+
* This combinator exists because of a core trap: `ChildProcess.setEnv` merges
|
|
5327
|
+
* into `options.env` but never sets `extendEnv`, and the Node spawner resolves
|
|
5328
|
+
* the child environment as `extendEnv ? { ...process.env, ...env } : env` — so
|
|
5329
|
+
* a command built with bare `setEnv({ SOME_VAR: x })` spawns a child whose
|
|
5330
|
+
* ENTIRE environment is that one variable: no `PATH`, no `HOME`. The failure is
|
|
5331
|
+
* silent at the type level and surfaces as "spawned tool cannot find its own
|
|
5332
|
+
* binary" at runtime.
|
|
5333
|
+
*
|
|
5334
|
+
* Deliberately forces `extendEnv: true` even where construction set it `false`
|
|
5335
|
+
* — inheriting the parent environment is this combinator's entire purpose. A
|
|
5336
|
+
* caller who wants a hermetic environment uses core's `setEnv` or construction
|
|
5337
|
+
* options (`ChildProcess.make(cmd, args, { env, extendEnv: false })`) directly.
|
|
5338
|
+
*
|
|
5339
|
+
* For a pipeline, applies to every command in the pipeline (mirroring core's
|
|
5340
|
+
* `setEnv`), preserving the pipe's own options. Composes core's public
|
|
5341
|
+
* vocabulary (`ChildProcess.make`, `ChildProcess.pipeTo`) — it re-declares
|
|
5342
|
+
* nothing.
|
|
5343
|
+
*/
|
|
5344
|
+
static extendEnv = extendEnv;
|
|
5345
|
+
/** Default ceiling on captured bytes per stream. See {@link DEFAULT_MAX_OUTPUT_BYTES}. */
|
|
5346
|
+
static DEFAULT_MAX_OUTPUT_BYTES = DEFAULT_MAX_OUTPUT_BYTES;
|
|
5347
|
+
/** The placeholder written in place of a redacted secret. See {@link REDACTED}. */
|
|
5348
|
+
static REDACTED = "***";
|
|
5349
|
+
};
|
|
5350
|
+
|
|
5351
|
+
//#endregion
|
|
5352
|
+
//#region ../../node_modules/.pnpm/@effected+npm@0.8.3_@effected+semver@0.3.2_effect@4.0.0-beta.101__effect@4.0.0-beta.101/node_modules/@effected/npm/ReleaseAgeGate.js
|
|
4642
5353
|
const MS_PER_MINUTE = 6e4;
|
|
4643
5354
|
/**
|
|
4644
5355
|
* A source's partial contribution to a {@link ReleaseAgeGate}: the effective
|
|
@@ -4809,7 +5520,7 @@ var ReleaseAgeGate = class ReleaseAgeGate extends Schema.Class("ReleaseAgeGate")
|
|
|
4809
5520
|
};
|
|
4810
5521
|
|
|
4811
5522
|
//#endregion
|
|
4812
|
-
//#region ../../node_modules/.pnpm/@effected+lockfiles@0.3.
|
|
5523
|
+
//#region ../../node_modules/.pnpm/@effected+lockfiles@0.3.2_@effected+jsonc@0.5.2_effect@4.0.0-beta.101__@effected+npm@0._3c1784fba62fde9a5bac4cf15387fd04/node_modules/@effected/lockfiles/ImporterDependency.js
|
|
4813
5524
|
/**
|
|
4814
5525
|
* One declared dependency of one workspace importer, as the lockfile records it.
|
|
4815
5526
|
*
|
|
@@ -4841,14 +5552,14 @@ var ReleaseAgeGate = class ReleaseAgeGate extends Schema.Class("ReleaseAgeGate")
|
|
|
4841
5552
|
*/
|
|
4842
5553
|
var ImporterDependency = class extends Schema.Class("ImporterDependency")({
|
|
4843
5554
|
name: Schema.NonEmptyString,
|
|
4844
|
-
specifier: DependencySpecifier.FromString,
|
|
5555
|
+
specifier: DependencySpecifier$1.FromString,
|
|
4845
5556
|
version: Schema.optionalKey(Schema.String),
|
|
4846
5557
|
peerSuffix: Schema.optionalKey(Schema.String),
|
|
4847
|
-
depType: DependencyField
|
|
5558
|
+
depType: DependencyField$1
|
|
4848
5559
|
}) {};
|
|
4849
5560
|
|
|
4850
5561
|
//#endregion
|
|
4851
|
-
//#region ../../node_modules/.pnpm/@effected+lockfiles@0.3.
|
|
5562
|
+
//#region ../../node_modules/.pnpm/@effected+lockfiles@0.3.2_@effected+jsonc@0.5.2_effect@4.0.0-beta.101__@effected+npm@0._3c1784fba62fde9a5bac4cf15387fd04/node_modules/@effected/lockfiles/LockfileImporter.js
|
|
4852
5563
|
/**
|
|
4853
5564
|
* One workspace importer's declared dependencies, as the lockfile records them.
|
|
4854
5565
|
*
|
|
@@ -4873,7 +5584,7 @@ var LockfileImporter = class extends Schema.Class("LockfileImporter")({
|
|
|
4873
5584
|
}) {};
|
|
4874
5585
|
|
|
4875
5586
|
//#endregion
|
|
4876
|
-
//#region ../../node_modules/.pnpm/@effected+lockfiles@0.3.
|
|
5587
|
+
//#region ../../node_modules/.pnpm/@effected+lockfiles@0.3.2_@effected+jsonc@0.5.2_effect@4.0.0-beta.101__@effected+npm@0._3c1784fba62fde9a5bac4cf15387fd04/node_modules/@effected/lockfiles/ResolvedPackage.js
|
|
4877
5588
|
const EMPTY_DEPENDENCIES = {};
|
|
4878
5589
|
/**
|
|
4879
5590
|
* A package resolved from a lockfile.
|
|
@@ -4902,14 +5613,14 @@ const EMPTY_DEPENDENCIES = {};
|
|
|
4902
5613
|
var ResolvedPackage = class extends Schema.Class("ResolvedPackage")({
|
|
4903
5614
|
name: Schema.NonEmptyString,
|
|
4904
5615
|
version: Schema.String,
|
|
4905
|
-
integrity: Schema.optionalKey(IntegrityHash),
|
|
5616
|
+
integrity: Schema.optionalKey(IntegrityHash$1),
|
|
4906
5617
|
isWorkspace: Schema.Boolean,
|
|
4907
5618
|
relativePath: Schema.optionalKey(Schema.String),
|
|
4908
5619
|
dependencies: Schema.Record(Schema.String, Schema.String).pipe(Schema.withDecodingDefaultKey(Effect.succeed(EMPTY_DEPENDENCIES)), Schema.withConstructorDefault(Effect.succeed(EMPTY_DEPENDENCIES)))
|
|
4909
5620
|
}) {};
|
|
4910
5621
|
|
|
4911
5622
|
//#endregion
|
|
4912
|
-
//#region ../../node_modules/.pnpm/@effected+lockfiles@0.3.
|
|
5623
|
+
//#region ../../node_modules/.pnpm/@effected+lockfiles@0.3.2_@effected+jsonc@0.5.2_effect@4.0.0-beta.101__@effected+npm@0._3c1784fba62fde9a5bac4cf15387fd04/node_modules/@effected/lockfiles/WorkspaceDependency.js
|
|
4913
5624
|
/**
|
|
4914
5625
|
* A directed dependency edge between two workspace packages as recorded in
|
|
4915
5626
|
* the lockfile.
|
|
@@ -4927,12 +5638,12 @@ var ResolvedPackage = class extends Schema.Class("ResolvedPackage")({
|
|
|
4927
5638
|
var WorkspaceDependency = class extends Schema.Class("WorkspaceDependency")({
|
|
4928
5639
|
from: Schema.NonEmptyString,
|
|
4929
5640
|
to: Schema.NonEmptyString,
|
|
4930
|
-
depType: DependencyField,
|
|
5641
|
+
depType: DependencyField$1,
|
|
4931
5642
|
constraint: Schema.String
|
|
4932
5643
|
}) {};
|
|
4933
5644
|
|
|
4934
5645
|
//#endregion
|
|
4935
|
-
//#region ../../node_modules/.pnpm/@effected+lockfiles@0.3.
|
|
5646
|
+
//#region ../../node_modules/.pnpm/@effected+lockfiles@0.3.2_@effected+jsonc@0.5.2_effect@4.0.0-beta.101__@effected+npm@0._3c1784fba62fde9a5bac4cf15387fd04/node_modules/@effected/lockfiles/PnpmExtension.js
|
|
4936
5647
|
/**
|
|
4937
5648
|
* Extension data specific to pnpm lockfiles, attached to `Lockfile.extension`
|
|
4938
5649
|
* when the format is `"pnpm"`.
|
|
@@ -4958,7 +5669,7 @@ var PnpmExtension = class extends Schema.Class("PnpmExtension")({
|
|
|
4958
5669
|
}) {};
|
|
4959
5670
|
|
|
4960
5671
|
//#endregion
|
|
4961
|
-
//#region ../../node_modules/.pnpm/@effected+lockfiles@0.3.
|
|
5672
|
+
//#region ../../node_modules/.pnpm/@effected+lockfiles@0.3.2_@effected+jsonc@0.5.2_effect@4.0.0-beta.101__@effected+npm@0._3c1784fba62fde9a5bac4cf15387fd04/node_modules/@effected/lockfiles/LockfileFormat.js
|
|
4962
5673
|
/**
|
|
4963
5674
|
* The lockfile formats this package parses: bun's `bun.lock` (JSONC), npm's
|
|
4964
5675
|
* `package-lock.json` (v2/v3 JSON), pnpm's `pnpm-lock.yaml` and yarn Berry's
|
|
@@ -4997,7 +5708,7 @@ const FILENAMES = {
|
|
|
4997
5708
|
const filenameFor = (format) => FILENAMES[format][0];
|
|
4998
5709
|
|
|
4999
5710
|
//#endregion
|
|
5000
|
-
//#region ../../node_modules/.pnpm/@effected+lockfiles@0.3.
|
|
5711
|
+
//#region ../../node_modules/.pnpm/@effected+lockfiles@0.3.2_@effected+jsonc@0.5.2_effect@4.0.0-beta.101__@effected+npm@0._3c1784fba62fde9a5bac4cf15387fd04/node_modules/@effected/lockfiles/internal/shared.js
|
|
5001
5712
|
/**
|
|
5002
5713
|
* The four dependency sections of a manifest, in a stable order — the shared
|
|
5003
5714
|
* dependency-sections table (v3's `DEP_SECTIONS`). Each entry is both the
|
|
@@ -5032,9 +5743,9 @@ const DEP_TYPES = [
|
|
|
5032
5743
|
*/
|
|
5033
5744
|
const toIntegrityHash = (raw) => {
|
|
5034
5745
|
if (raw === void 0) return Effect.succeed(void 0);
|
|
5035
|
-
return Schema.decodeUnknownEffect(IntegrityHash)(raw).pipe(Effect.mapError(validationFailure));
|
|
5746
|
+
return Schema.decodeUnknownEffect(IntegrityHash$1)(raw).pipe(Effect.mapError(validationFailure));
|
|
5036
5747
|
};
|
|
5037
|
-
const decodeSpecifier = Schema.decodeUnknownExit(DependencySpecifier.FromString);
|
|
5748
|
+
const decodeSpecifier = Schema.decodeUnknownExit(DependencySpecifier$1.FromString);
|
|
5038
5749
|
/**
|
|
5039
5750
|
* Split pnpm's peer-disambiguation suffix off a recorded string: everything
|
|
5040
5751
|
* from the first `(` on is suffix, since package names and versions never
|
|
@@ -6969,7 +7680,7 @@ var JsoncModifier = class {
|
|
|
6969
7680
|
};
|
|
6970
7681
|
|
|
6971
7682
|
//#endregion
|
|
6972
|
-
//#region ../../node_modules/.pnpm/@effected+lockfiles@0.3.
|
|
7683
|
+
//#region ../../node_modules/.pnpm/@effected+lockfiles@0.3.2_@effected+jsonc@0.5.2_effect@4.0.0-beta.101__@effected+npm@0._3c1784fba62fde9a5bac4cf15387fd04/node_modules/@effected/lockfiles/internal/bun.js
|
|
6973
7684
|
const DepRecord$2 = Schema.optionalKey(Schema.Record(Schema.String, Schema.String));
|
|
6974
7685
|
const BunWorkspaceEntry = Schema.Struct({
|
|
6975
7686
|
name: Schema.optionalKey(Schema.String),
|
|
@@ -7063,7 +7774,7 @@ const toFields$3 = (raw) => Effect.gen(function* () {
|
|
|
7063
7774
|
});
|
|
7064
7775
|
|
|
7065
7776
|
//#endregion
|
|
7066
|
-
//#region ../../node_modules/.pnpm/@effected+lockfiles@0.3.
|
|
7777
|
+
//#region ../../node_modules/.pnpm/@effected+lockfiles@0.3.2_@effected+jsonc@0.5.2_effect@4.0.0-beta.101__@effected+npm@0._3c1784fba62fde9a5bac4cf15387fd04/node_modules/@effected/lockfiles/internal/npm.js
|
|
7067
7778
|
const DepRecord$1 = Schema.optionalKey(Schema.Record(Schema.String, Schema.String));
|
|
7068
7779
|
const NpmPackageEntry = Schema.Struct({
|
|
7069
7780
|
name: Schema.optionalKey(Schema.String),
|
|
@@ -14091,7 +14802,7 @@ function deepEqualValues(a, b) {
|
|
|
14091
14802
|
}
|
|
14092
14803
|
|
|
14093
14804
|
//#endregion
|
|
14094
|
-
//#region ../../node_modules/.pnpm/@effected+lockfiles@0.3.
|
|
14805
|
+
//#region ../../node_modules/.pnpm/@effected+lockfiles@0.3.2_@effected+jsonc@0.5.2_effect@4.0.0-beta.101__@effected+npm@0._3c1784fba62fde9a5bac4cf15387fd04/node_modules/@effected/lockfiles/internal/documents.js
|
|
14095
14806
|
/**
|
|
14096
14807
|
* An empty YAML document composes to `null` (`Yaml.parseAll("")` is `[null]`,
|
|
14097
14808
|
* and the trailing document of an env-only `pnpm-lock.yaml` is `null` too).
|
|
@@ -14162,7 +14873,7 @@ const selectSoleDocument = (content) => Effect.gen(function* () {
|
|
|
14162
14873
|
});
|
|
14163
14874
|
|
|
14164
14875
|
//#endregion
|
|
14165
|
-
//#region ../../node_modules/.pnpm/@effected+lockfiles@0.3.
|
|
14876
|
+
//#region ../../node_modules/.pnpm/@effected+lockfiles@0.3.2_@effected+jsonc@0.5.2_effect@4.0.0-beta.101__@effected+npm@0._3c1784fba62fde9a5bac4cf15387fd04/node_modules/@effected/lockfiles/internal/pnpm.js
|
|
14166
14877
|
const PnpmImporterDeps = Schema.optionalKey(Schema.Record(Schema.String, Schema.Struct({
|
|
14167
14878
|
specifier: Schema.String,
|
|
14168
14879
|
version: Schema.String
|
|
@@ -14288,7 +14999,7 @@ const toFields$1 = (raw) => Effect.gen(function* () {
|
|
|
14288
14999
|
});
|
|
14289
15000
|
|
|
14290
15001
|
//#endregion
|
|
14291
|
-
//#region ../../node_modules/.pnpm/@effected+lockfiles@0.3.
|
|
15002
|
+
//#region ../../node_modules/.pnpm/@effected+lockfiles@0.3.2_@effected+jsonc@0.5.2_effect@4.0.0-beta.101__@effected+npm@0._3c1784fba62fde9a5bac4cf15387fd04/node_modules/@effected/lockfiles/internal/yarn.js
|
|
14292
15003
|
const YarnLockfileRaw = Schema.Record(Schema.String, Schema.Unknown);
|
|
14293
15004
|
const DepRecord = Schema.optionalKey(Schema.Record(Schema.String, Schema.String));
|
|
14294
15005
|
const YarnEntry = Schema.Struct({
|
|
@@ -14412,7 +15123,7 @@ const cleanYarnDeps = (deps) => {
|
|
|
14412
15123
|
};
|
|
14413
15124
|
|
|
14414
15125
|
//#endregion
|
|
14415
|
-
//#region ../../node_modules/.pnpm/@effected+lockfiles@0.3.
|
|
15126
|
+
//#region ../../node_modules/.pnpm/@effected+lockfiles@0.3.2_@effected+jsonc@0.5.2_effect@4.0.0-beta.101__@effected+npm@0._3c1784fba62fde9a5bac4cf15387fd04/node_modules/@effected/lockfiles/Lockfile.js
|
|
14416
15127
|
const EMPTY_IMPORTERS = [];
|
|
14417
15128
|
/**
|
|
14418
15129
|
* Failure of `Lockfile.parse`: the given content is not a valid lockfile of
|
|
@@ -14657,7 +15368,7 @@ var Lockfile = class Lockfile extends Schema.Class("Lockfile")({
|
|
|
14657
15368
|
};
|
|
14658
15369
|
|
|
14659
15370
|
//#endregion
|
|
14660
|
-
//#region ../../node_modules/.pnpm/@effected+lockfiles@0.3.
|
|
15371
|
+
//#region ../../node_modules/.pnpm/@effected+lockfiles@0.3.2_@effected+jsonc@0.5.2_effect@4.0.0-beta.101__@effected+npm@0._3c1784fba62fde9a5bac4cf15387fd04/node_modules/@effected/lockfiles/LockfileIntegrity.js
|
|
14661
15372
|
/**
|
|
14662
15373
|
* The minimal manifest shape {@link LockfileIntegrity.compare} checks a
|
|
14663
15374
|
* lockfile against: a package name plus the four optional dependency maps.
|
|
@@ -14705,7 +15416,7 @@ var LockfileIntegrity = class LockfileIntegrity extends Schema.Class("LockfileIn
|
|
|
14705
15416
|
dependency: Schema.String,
|
|
14706
15417
|
constraint: Schema.String,
|
|
14707
15418
|
resolved: Schema.String,
|
|
14708
|
-
depType: DependencyField
|
|
15419
|
+
depType: DependencyField$1
|
|
14709
15420
|
}))
|
|
14710
15421
|
}) {
|
|
14711
15422
|
/**
|
|
@@ -14774,7 +15485,464 @@ var LockfileIntegrity = class LockfileIntegrity extends Schema.Class("LockfileIn
|
|
|
14774
15485
|
};
|
|
14775
15486
|
|
|
14776
15487
|
//#endregion
|
|
14777
|
-
//#region ../../node_modules/.pnpm/@effected+
|
|
15488
|
+
//#region ../../node_modules/.pnpm/@effected+npm@0.8.2_@effected+semver@0.3.2_effect@4.0.0-beta.101__effect@4.0.0-beta.101/node_modules/@effected/npm/CatalogResolver.js
|
|
15489
|
+
/**
|
|
15490
|
+
* Contract for resolving pnpm `catalog:` dependency specifiers to concrete
|
|
15491
|
+
* version ranges.
|
|
15492
|
+
*
|
|
15493
|
+
* `rangeOf` takes a package name and an optional catalog name
|
|
15494
|
+
* (`Option.none()` selects the default catalog) and returns the configured
|
|
15495
|
+
* range as `Option.some`, or `Option.none()` when the specifier is absent
|
|
15496
|
+
* from the catalog. By convention the error channel is reserved for a
|
|
15497
|
+
* failure in the resolution mechanism itself — an unmatched package or
|
|
15498
|
+
* catalog name is an `Option.none()` success, never an error. A failure to
|
|
15499
|
+
* *assemble* the catalogs (an unreadable or malformed catalog source)
|
|
15500
|
+
* surfaces typed as a {@link CatalogAssemblyError}; any other mechanism
|
|
15501
|
+
* failure is a {@link DependencyResolutionError}.
|
|
15502
|
+
*
|
|
15503
|
+
* This is a contract-only service: {@link CatalogResolver.noop} is the sole
|
|
15504
|
+
* implementation this package ships, and it resolves nothing. Real consumers
|
|
15505
|
+
* (e.g. `@effected/workspaces`) provide a working implementation at the
|
|
15506
|
+
* application boundary.
|
|
15507
|
+
*
|
|
15508
|
+
* @example
|
|
15509
|
+
* ```ts
|
|
15510
|
+
* import { Effect, Option } from "effect";
|
|
15511
|
+
* import { CatalogResolver } from "@effected/npm";
|
|
15512
|
+
*
|
|
15513
|
+
* const program = Effect.gen(function* () {
|
|
15514
|
+
* const resolver = yield* CatalogResolver;
|
|
15515
|
+
* return yield* resolver.rangeOf("effect", Option.none());
|
|
15516
|
+
* });
|
|
15517
|
+
*
|
|
15518
|
+
* Effect.runPromise(Effect.provide(program, CatalogResolver.noop));
|
|
15519
|
+
* // => Option.none()
|
|
15520
|
+
* ```
|
|
15521
|
+
*
|
|
15522
|
+
* @public
|
|
15523
|
+
*/
|
|
15524
|
+
var CatalogResolver = class CatalogResolver extends Context.Service()("@effected/npm/CatalogResolver") {
|
|
15525
|
+
/**
|
|
15526
|
+
* No-op default: `rangeOf` always succeeds with `Option.none()`, never
|
|
15527
|
+
* consulting an actual catalog. A pure `Layer.succeed`, bound to a const
|
|
15528
|
+
* so it memoizes by reference — the layer is built once, not once per
|
|
15529
|
+
* reference to `CatalogResolver.noop`.
|
|
15530
|
+
*/
|
|
15531
|
+
static noop = Layer.succeed(CatalogResolver, { rangeOf: () => Effect.succeed(Option.none()) });
|
|
15532
|
+
};
|
|
15533
|
+
|
|
15534
|
+
//#endregion
|
|
15535
|
+
//#region ../../node_modules/.pnpm/@effected+npm@0.8.2_@effected+semver@0.3.2_effect@4.0.0-beta.101__effect@4.0.0-beta.101/node_modules/@effected/npm/WorkspaceResolver.js
|
|
15536
|
+
/**
|
|
15537
|
+
* Raised when a `catalog:` or `workspace:` specifier cannot be resolved
|
|
15538
|
+
* because the resolution mechanism itself failed — not for an ordinary
|
|
15539
|
+
* unmatched specifier, which resolves to `Option.none()` instead. Both
|
|
15540
|
+
* {@link CatalogResolver} and {@link WorkspaceResolver} fail with it.
|
|
15541
|
+
*
|
|
15542
|
+
* `cause` preserves the originating failure on a structured `Schema.Defect`
|
|
15543
|
+
* field rather than folding it into a string, so callers can branch on the
|
|
15544
|
+
* original value (an `Error`, a parsed diagnostic, anything); `specifier`
|
|
15545
|
+
* records the specifier string that failed to resolve.
|
|
15546
|
+
*
|
|
15547
|
+
* @public
|
|
15548
|
+
*/
|
|
15549
|
+
var DependencyResolutionError = class extends Schema.TaggedErrorClass()("DependencyResolutionError", {
|
|
15550
|
+
specifier: Schema.String,
|
|
15551
|
+
cause: Schema.Defect()
|
|
15552
|
+
}) {
|
|
15553
|
+
/** Renders `specifier` into a one-line failure message. */
|
|
15554
|
+
get message() {
|
|
15555
|
+
return `Failed to resolve dependency specifier "${this.specifier}"`;
|
|
15556
|
+
}
|
|
15557
|
+
};
|
|
15558
|
+
/**
|
|
15559
|
+
* Contract for resolving pnpm `workspace:` dependency specifiers to concrete
|
|
15560
|
+
* versions.
|
|
15561
|
+
*
|
|
15562
|
+
* `versionOf` takes a workspace package name and returns its concrete
|
|
15563
|
+
* version (the range modifier stripped) as `Option.some`, or
|
|
15564
|
+
* `Option.none()` when the name is not a known workspace member.
|
|
15565
|
+
*
|
|
15566
|
+
* This is a contract-only service: {@link WorkspaceResolver.noop} is the
|
|
15567
|
+
* sole implementation this package ships, and it resolves nothing. Real
|
|
15568
|
+
* consumers (e.g. `@effected/workspaces`) provide a working implementation
|
|
15569
|
+
* at the application boundary.
|
|
15570
|
+
*
|
|
15571
|
+
* @example
|
|
15572
|
+
* ```ts
|
|
15573
|
+
* import { Effect } from "effect";
|
|
15574
|
+
* import { WorkspaceResolver } from "@effected/npm";
|
|
15575
|
+
*
|
|
15576
|
+
* const program = Effect.gen(function* () {
|
|
15577
|
+
* const resolver = yield* WorkspaceResolver;
|
|
15578
|
+
* return yield* resolver.versionOf("@effected/semver");
|
|
15579
|
+
* });
|
|
15580
|
+
*
|
|
15581
|
+
* Effect.runPromise(Effect.provide(program, WorkspaceResolver.noop));
|
|
15582
|
+
* // => Option.none()
|
|
15583
|
+
* ```
|
|
15584
|
+
*
|
|
15585
|
+
* @public
|
|
15586
|
+
*/
|
|
15587
|
+
var WorkspaceResolver = class WorkspaceResolver extends Context.Service()("@effected/npm/WorkspaceResolver") {
|
|
15588
|
+
/**
|
|
15589
|
+
* No-op default: `versionOf` always succeeds with `Option.none()`, never
|
|
15590
|
+
* consulting an actual workspace. A pure `Layer.succeed`, bound to a
|
|
15591
|
+
* const so it memoizes by reference.
|
|
15592
|
+
*/
|
|
15593
|
+
static noop = Layer.succeed(WorkspaceResolver, { versionOf: () => Effect.succeed(Option.none()) });
|
|
15594
|
+
};
|
|
15595
|
+
|
|
15596
|
+
//#endregion
|
|
15597
|
+
//#region ../../node_modules/.pnpm/@effected+npm@0.8.2_@effected+semver@0.3.2_effect@4.0.0-beta.101__effect@4.0.0-beta.101/node_modules/@effected/npm/DependencySection.js
|
|
15598
|
+
/**
|
|
15599
|
+
* The short dependency kind: which dependency map an entry came from, named the
|
|
15600
|
+
* way consumers branch on it.
|
|
15601
|
+
*
|
|
15602
|
+
* @public
|
|
15603
|
+
*/
|
|
15604
|
+
const DependencyKind = Schema.Literals([
|
|
15605
|
+
"prod",
|
|
15606
|
+
"dev",
|
|
15607
|
+
"peer",
|
|
15608
|
+
"optional"
|
|
15609
|
+
]);
|
|
15610
|
+
/**
|
|
15611
|
+
* The manifest field name a dependency is declared under, matching the
|
|
15612
|
+
* `package.json` / `package-lock.json` key exactly.
|
|
15613
|
+
*
|
|
15614
|
+
* @public
|
|
15615
|
+
*/
|
|
15616
|
+
const DependencyField = Schema.Literals([
|
|
15617
|
+
"dependencies",
|
|
15618
|
+
"devDependencies",
|
|
15619
|
+
"peerDependencies",
|
|
15620
|
+
"optionalDependencies"
|
|
15621
|
+
]);
|
|
15622
|
+
const KIND_TO_FIELD = {
|
|
15623
|
+
prod: "dependencies",
|
|
15624
|
+
dev: "devDependencies",
|
|
15625
|
+
peer: "peerDependencies",
|
|
15626
|
+
optional: "optionalDependencies"
|
|
15627
|
+
};
|
|
15628
|
+
const FIELD_TO_KIND = Object.fromEntries(Object.entries(KIND_TO_FIELD).map(([kind, field]) => [field, kind]));
|
|
15629
|
+
|
|
15630
|
+
//#endregion
|
|
15631
|
+
//#region ../../node_modules/.pnpm/@effected+npm@0.8.2_@effected+semver@0.3.2_effect@4.0.0-beta.101__effect@4.0.0-beta.101/node_modules/@effected/npm/DependencySpecifier.js
|
|
15632
|
+
/**
|
|
15633
|
+
* Indicates that a string could not be parsed as a valid dependency specifier.
|
|
15634
|
+
*
|
|
15635
|
+
* Raised by {@link DependencySpecifier.decode}. The offending string is
|
|
15636
|
+
* preserved on `input`.
|
|
15637
|
+
*
|
|
15638
|
+
* @public
|
|
15639
|
+
*/
|
|
15640
|
+
var InvalidDependencySpecifierError = class extends Schema.TaggedErrorClass()("InvalidDependencySpecifierError", {
|
|
15641
|
+
/** The raw input string that failed validation. */
|
|
15642
|
+
input: Schema.String }) {
|
|
15643
|
+
get message() {
|
|
15644
|
+
return `Invalid dependency specifier "${this.input}": not a recognized specifier`;
|
|
15645
|
+
}
|
|
15646
|
+
};
|
|
15647
|
+
const CATALOG_PREFIX = "catalog:";
|
|
15648
|
+
const WORKSPACE_PREFIX = "workspace:";
|
|
15649
|
+
const isBarePath = (value) => value.startsWith("./") || value.startsWith("../") || value.startsWith("~/") || value.startsWith("/");
|
|
15650
|
+
const isGitHubShorthand = (value) => !value.startsWith(".") && !value.startsWith("~") && !value.startsWith("/") && /^[a-zA-Z0-9_.-]+\/[a-zA-Z0-9_.-]+(#.*)?$/.test(value);
|
|
15651
|
+
const isGit = (value) => value.startsWith("git+") || value.startsWith("git://") || value.startsWith("github:") || value.startsWith("gist:") || value.startsWith("bitbucket:") || value.startsWith("gitlab:") || isGitHubShorthand(value);
|
|
15652
|
+
const isLocal = (value) => value.startsWith("file:") || value.startsWith("link:") || value.startsWith("portal:") || isBarePath(value);
|
|
15653
|
+
const isLink = (value) => value.startsWith("link:");
|
|
15654
|
+
const isPortal = (value) => value.startsWith("portal:");
|
|
15655
|
+
const isCatalog = (value) => value.startsWith(CATALOG_PREFIX);
|
|
15656
|
+
const isWorkspace = (value) => value.startsWith(WORKSPACE_PREFIX);
|
|
15657
|
+
const isUrl$1 = (value) => value.startsWith("http://") || value.startsWith("https://");
|
|
15658
|
+
const parseRange = (value) => {
|
|
15659
|
+
const exit = Schema.decodeUnknownExit(Range$1.FromString)(value);
|
|
15660
|
+
return Exit.isSuccess(exit) ? Option.some(exit.value) : Option.none();
|
|
15661
|
+
};
|
|
15662
|
+
const isRange = (value) => Option.isSome(parseRange(value));
|
|
15663
|
+
const protocolOf = (value) => {
|
|
15664
|
+
if (value.startsWith(CATALOG_PREFIX)) return "catalog";
|
|
15665
|
+
if (value.startsWith(WORKSPACE_PREFIX)) return "workspace";
|
|
15666
|
+
if (value.startsWith("link:")) return "link";
|
|
15667
|
+
if (value.startsWith("portal:")) return "portal";
|
|
15668
|
+
if (value.startsWith("file:") || isBarePath(value)) return "file";
|
|
15669
|
+
if (value.startsWith("npm:")) return "npm";
|
|
15670
|
+
if (isGit(value)) return "git";
|
|
15671
|
+
if (isUrl$1(value)) return "url";
|
|
15672
|
+
if (isRange(value)) return "range";
|
|
15673
|
+
if (/^[a-zA-Z][a-zA-Z0-9._-]*$/.test(value)) return "tag";
|
|
15674
|
+
return "unknown";
|
|
15675
|
+
};
|
|
15676
|
+
const isTag = (value) => protocolOf(value) === "tag";
|
|
15677
|
+
const catalogNameOf$1 = (specifier) => {
|
|
15678
|
+
if (!isCatalog(specifier)) return Option.none();
|
|
15679
|
+
const rest = specifier.slice(8).trim();
|
|
15680
|
+
return rest.length === 0 ? Option.none() : Option.some(rest);
|
|
15681
|
+
};
|
|
15682
|
+
const projectRangeModifier = (range, version) => range === "*" || range === "" ? version : range === "~" ? `~${version}` : range === "^" ? `^${version}` : range;
|
|
15683
|
+
const splitWorkspaceRest = (rest) => {
|
|
15684
|
+
const at = rest.lastIndexOf("@");
|
|
15685
|
+
return at > 0 ? {
|
|
15686
|
+
target: rest.slice(0, at),
|
|
15687
|
+
range: rest.slice(at + 1)
|
|
15688
|
+
} : {
|
|
15689
|
+
target: void 0,
|
|
15690
|
+
range: rest
|
|
15691
|
+
};
|
|
15692
|
+
};
|
|
15693
|
+
const projectWorkspaceRange = (rest, version) => {
|
|
15694
|
+
const { target, range } = splitWorkspaceRest(rest);
|
|
15695
|
+
const projected = projectRangeModifier(range, version);
|
|
15696
|
+
return target === void 0 ? projected : `npm:${target}@${projected}`;
|
|
15697
|
+
};
|
|
15698
|
+
const resolveWorkspace = (specifier, version) => isWorkspace(specifier) ? projectWorkspaceRange(specifier.slice(10), version) : specifier;
|
|
15699
|
+
const workspaceTargetOf = (specifier) => {
|
|
15700
|
+
if (!isWorkspace(specifier)) return Option.none();
|
|
15701
|
+
const { target } = splitWorkspaceRest(specifier.slice(10));
|
|
15702
|
+
return target === void 0 ? Option.none() : Option.some(target);
|
|
15703
|
+
};
|
|
15704
|
+
/**
|
|
15705
|
+
* Whether a string is a recognized dependency specifier: a semver range, exact
|
|
15706
|
+
* version, dist-tag, URL, git ref, GitHub shorthand, file path, or an
|
|
15707
|
+
* `npm:` / `catalog:` / `workspace:` protocol.
|
|
15708
|
+
*
|
|
15709
|
+
* @public
|
|
15710
|
+
*/
|
|
15711
|
+
const isValidDependencySpecifier = (value) => value.length > 0 && protocolOf(value) !== "unknown";
|
|
15712
|
+
/**
|
|
15713
|
+
* A `catalog:` reference. `name` carries the catalog name, or `Option.none()`
|
|
15714
|
+
* for the default catalog (`catalog:`).
|
|
15715
|
+
*
|
|
15716
|
+
* @public
|
|
15717
|
+
*/
|
|
15718
|
+
var CatalogSpecifier = class extends Schema.TaggedClass()("catalog", {
|
|
15719
|
+
/** The original specifier string. */
|
|
15720
|
+
raw: Schema.String,
|
|
15721
|
+
/** The catalog name, or `Option.none()` for the default catalog. */
|
|
15722
|
+
name: Schema.Option(Schema.String)
|
|
15723
|
+
}) {};
|
|
15724
|
+
/**
|
|
15725
|
+
* A `workspace:` reference. `range` carries the part after `workspace:` — a
|
|
15726
|
+
* range modifier (`*`, `^`, `~`), a concrete range, or an alias form.
|
|
15727
|
+
*
|
|
15728
|
+
* @public
|
|
15729
|
+
*/
|
|
15730
|
+
var WorkspaceSpecifier = class extends Schema.TaggedClass()("workspace", {
|
|
15731
|
+
/** The original specifier string. */
|
|
15732
|
+
raw: Schema.String,
|
|
15733
|
+
/** The part after `workspace:` (e.g. `*`, `^1.2.3`, or an alias form). */
|
|
15734
|
+
range: Schema.String
|
|
15735
|
+
}) {
|
|
15736
|
+
/**
|
|
15737
|
+
* The pnpm publish-time projection of this specifier against a concrete
|
|
15738
|
+
* workspace version: `*` (or an empty range) becomes `version`, `~` becomes
|
|
15739
|
+
* `~version`, `^` becomes `^version`, and a pinned range passes through
|
|
15740
|
+
* unchanged. The alias form (`workspace:<name>@<range>`) becomes pnpm's
|
|
15741
|
+
* publish-time aliased dependency `npm:<name>@<projected>`, with the range
|
|
15742
|
+
* modifier projected the same way — `version` must then be the TARGET
|
|
15743
|
+
* package's version (see `DependencySpecifier.workspaceTargetOf`).
|
|
15744
|
+
*
|
|
15745
|
+
* @remarks
|
|
15746
|
+
* The same projection as `DependencySpecifier.resolveWorkspace`, applied to
|
|
15747
|
+
* this instance's already-extracted `range`; the two share one internal
|
|
15748
|
+
* implementation.
|
|
15749
|
+
*
|
|
15750
|
+
* @param version - The concrete version of the workspace package the
|
|
15751
|
+
* specifier points at (the alias target's version for the alias form).
|
|
15752
|
+
*/
|
|
15753
|
+
resolve(version) {
|
|
15754
|
+
return projectWorkspaceRange(this.range, version);
|
|
15755
|
+
}
|
|
15756
|
+
};
|
|
15757
|
+
/**
|
|
15758
|
+
* A plain semver range or exact version (e.g. `^1.2.3`, `1.x`, `>=1 <2`).
|
|
15759
|
+
*
|
|
15760
|
+
* @public
|
|
15761
|
+
*/
|
|
15762
|
+
var RangeSpecifier = class extends Schema.TaggedClass()("range", {
|
|
15763
|
+
/** The original specifier string. */
|
|
15764
|
+
raw: Schema.String }) {};
|
|
15765
|
+
/**
|
|
15766
|
+
* A bare dist-tag (e.g. `latest`, `next`).
|
|
15767
|
+
*
|
|
15768
|
+
* @public
|
|
15769
|
+
*/
|
|
15770
|
+
var DistTagSpecifier = class extends Schema.TaggedClass()("dist-tag", {
|
|
15771
|
+
/** The original specifier string (also the tag name). */
|
|
15772
|
+
raw: Schema.String }) {};
|
|
15773
|
+
/**
|
|
15774
|
+
* The honest fallback for `file:` / `link:` / `portal:` / git / URL / `npm:`
|
|
15775
|
+
* forms this concept does not further interpret.
|
|
15776
|
+
*
|
|
15777
|
+
* @public
|
|
15778
|
+
*/
|
|
15779
|
+
var RawSpecifier = class extends Schema.TaggedClass()("raw", {
|
|
15780
|
+
/** The original specifier string. */
|
|
15781
|
+
raw: Schema.String }) {};
|
|
15782
|
+
const Classified = Schema.Union([
|
|
15783
|
+
CatalogSpecifier,
|
|
15784
|
+
WorkspaceSpecifier,
|
|
15785
|
+
RangeSpecifier,
|
|
15786
|
+
DistTagSpecifier,
|
|
15787
|
+
RawSpecifier
|
|
15788
|
+
]);
|
|
15789
|
+
const classify$1 = (value) => {
|
|
15790
|
+
if (isCatalog(value)) return CatalogSpecifier.make({
|
|
15791
|
+
raw: value,
|
|
15792
|
+
name: catalogNameOf$1(value)
|
|
15793
|
+
});
|
|
15794
|
+
if (isWorkspace(value)) return WorkspaceSpecifier.make({
|
|
15795
|
+
raw: value,
|
|
15796
|
+
range: value.slice(10)
|
|
15797
|
+
});
|
|
15798
|
+
if (isRange(value)) return RangeSpecifier.make({ raw: value });
|
|
15799
|
+
if (isTag(value)) return DistTagSpecifier.make({ raw: value });
|
|
15800
|
+
return RawSpecifier.make({ raw: value });
|
|
15801
|
+
};
|
|
15802
|
+
const fromString = Schema.String.pipe(Schema.decodeTo(Classified, SchemaTransformation.transformOrFail({
|
|
15803
|
+
decode: (input) => isValidDependencySpecifier(input) ? Effect.succeed(classify$1(input)) : Effect.fail(new SchemaIssue.InvalidValue(Option.some(input), { message: `Invalid dependency specifier: "${input}"` })),
|
|
15804
|
+
encode: (classified) => Effect.succeed(classified.raw)
|
|
15805
|
+
})));
|
|
15806
|
+
const brandedSpecifier = Schema.String.pipe(Schema.check(Schema.makeFilter((value) => isValidDependencySpecifier(value) ? void 0 : "Expected a valid dependency specifier")), Schema.brand("DependencySpecifier"));
|
|
15807
|
+
const decode$3 = (input) => Schema.decodeUnknownEffect(brandedSpecifier)(input).pipe(Effect.mapError(() => new InvalidDependencySpecifierError({ input })));
|
|
15808
|
+
/**
|
|
15809
|
+
* A valid dependency version specifier, carrying the protocol taxonomy statics
|
|
15810
|
+
* (`DependencySpecifier.protocolOf` and friends) that classify any specifier
|
|
15811
|
+
* string, plus the {@link (DependencySpecifier:variable).FromString} codec that
|
|
15812
|
+
* decodes a string into a {@link ClassifiedSpecifier} tagged union. Use it as a
|
|
15813
|
+
* schema for a specifier field and reach for the statics to inspect a raw
|
|
15814
|
+
* string.
|
|
15815
|
+
*
|
|
15816
|
+
* @public
|
|
15817
|
+
*/
|
|
15818
|
+
const DependencySpecifier = Object.assign(brandedSpecifier, {
|
|
15819
|
+
protocolOf,
|
|
15820
|
+
parseRange,
|
|
15821
|
+
isRange,
|
|
15822
|
+
isTag,
|
|
15823
|
+
isGit,
|
|
15824
|
+
isUrl: isUrl$1,
|
|
15825
|
+
isLocal,
|
|
15826
|
+
isLink,
|
|
15827
|
+
isPortal,
|
|
15828
|
+
isCatalog,
|
|
15829
|
+
isWorkspace,
|
|
15830
|
+
catalogNameOf: catalogNameOf$1,
|
|
15831
|
+
resolveWorkspace,
|
|
15832
|
+
workspaceTargetOf,
|
|
15833
|
+
isValid: isValidDependencySpecifier,
|
|
15834
|
+
decode: decode$3,
|
|
15835
|
+
FromString: fromString
|
|
15836
|
+
});
|
|
15837
|
+
|
|
15838
|
+
//#endregion
|
|
15839
|
+
//#region ../../node_modules/.pnpm/@effected+npm@0.8.2_@effected+semver@0.3.2_effect@4.0.0-beta.101__effect@4.0.0-beta.101/node_modules/@effected/npm/IntegrityHash.js
|
|
15840
|
+
const SRI_RE = /^(sha1|sha256|sha384|sha512)-[A-Za-z0-9+/]+={0,2}$/;
|
|
15841
|
+
const COREPACK_RE = /^(sha1|sha224|sha256|sha384|sha512)\.[0-9a-f]+$/;
|
|
15842
|
+
const YARN_RE = /^[0-9]+(c[0-9]+)?\/[0-9a-f]+$/;
|
|
15843
|
+
const isSri = (value) => SRI_RE.test(value);
|
|
15844
|
+
const isCorepack = (value) => COREPACK_RE.test(value);
|
|
15845
|
+
const isYarnChecksum = (value) => YARN_RE.test(value);
|
|
15846
|
+
/**
|
|
15847
|
+
* Whether a string is a valid integrity hash in the SRI (`<algo>-<base64>`),
|
|
15848
|
+
* corepack (`<algo>.<hex>`) or yarn (`<cachekey>/<hex>`) form.
|
|
15849
|
+
*
|
|
15850
|
+
* @public
|
|
15851
|
+
*/
|
|
15852
|
+
const isValidIntegrityHash = (value) => isSri(value) || isCorepack(value) || isYarnChecksum(value);
|
|
15853
|
+
const algorithmOf = (value) => {
|
|
15854
|
+
if (isSri(value)) return Option.some(value.slice(0, value.indexOf("-")));
|
|
15855
|
+
if (isCorepack(value)) return Option.some(value.slice(0, value.indexOf(".")));
|
|
15856
|
+
return Option.none();
|
|
15857
|
+
};
|
|
15858
|
+
/**
|
|
15859
|
+
* Indicates that a string could not be parsed as a valid integrity hash.
|
|
15860
|
+
*
|
|
15861
|
+
* Raised by {@link IntegrityHash.decode}. The offending string is preserved on
|
|
15862
|
+
* `input`.
|
|
15863
|
+
*
|
|
15864
|
+
* @public
|
|
15865
|
+
*/
|
|
15866
|
+
var InvalidIntegrityHashError = class extends Schema.TaggedErrorClass()("InvalidIntegrityHashError", {
|
|
15867
|
+
/** The raw input string that failed validation. */
|
|
15868
|
+
input: Schema.String }) {
|
|
15869
|
+
get message() {
|
|
15870
|
+
return `Invalid integrity hash "${this.input}": expected an SRI (<algo>-<base64>), corepack (<algo>.<hex>) or yarn (<cachekey>/<hex>) form`;
|
|
15871
|
+
}
|
|
15872
|
+
};
|
|
15873
|
+
const brandedIntegrity = Schema.String.pipe(Schema.check(Schema.makeFilter((value) => isValidIntegrityHash(value) ? void 0 : "Expected an SRI, corepack or yarn integrity hash")), Schema.brand("IntegrityHash"));
|
|
15874
|
+
const decode$2 = (input) => Schema.decodeUnknownEffect(brandedIntegrity)(input).pipe(Effect.mapError(() => new InvalidIntegrityHashError({ input })));
|
|
15875
|
+
/**
|
|
15876
|
+
* A subresource-integrity hash, covering the SRI (`sha512-<base64>`), corepack
|
|
15877
|
+
* (`sha512.<hex>`) and yarn (`10c0/<hex>`) textual forms, carrying taxonomy
|
|
15878
|
+
* statics (`IntegrityHash.algorithmOf` and friends). Use it as a schema for an
|
|
15879
|
+
* integrity field and reach for the statics to inspect a raw string.
|
|
15880
|
+
*
|
|
15881
|
+
* @public
|
|
15882
|
+
*/
|
|
15883
|
+
const IntegrityHash = Object.assign(brandedIntegrity, {
|
|
15884
|
+
isSri,
|
|
15885
|
+
isCorepack,
|
|
15886
|
+
isYarnChecksum,
|
|
15887
|
+
isValid: isValidIntegrityHash,
|
|
15888
|
+
algorithmOf,
|
|
15889
|
+
decode: decode$2
|
|
15890
|
+
});
|
|
15891
|
+
/**
|
|
15892
|
+
* {@link (IntegrityHash:variable)} narrowed to the corepack `<algo>.<hex>` form
|
|
15893
|
+
* — `sha512.deadbeef`, and corepack's own sha224 default pins
|
|
15894
|
+
* (`sha224.877304e3…`). An SRI (`sha512-<base64>`) or yarn (`10c0/<hex>`)
|
|
15895
|
+
* hash, both valid `IntegrityHash` values, fails this schema.
|
|
15896
|
+
*
|
|
15897
|
+
* @remarks
|
|
15898
|
+
* The corepack pin tail (`<name>@<version>+<integrity>`) is the one place the
|
|
15899
|
+
* kit meets this form, and two schemas name it: `PackageManagerPin.integrity`
|
|
15900
|
+
* here and `@effected/package-json`'s `PackageManager.integrity`. Both consume
|
|
15901
|
+
* **this** schema — the restriction existed privately in each module until they
|
|
15902
|
+
* were consolidated, and a private copy is exactly how the two drift (the
|
|
15903
|
+
* widening that admitted sha224 had to be made twice).
|
|
15904
|
+
*
|
|
15905
|
+
* It decodes to the same {@link IntegrityHashBrand} the unrestricted schema
|
|
15906
|
+
* does, so a corepack-validated value assigns anywhere an `IntegrityHash` is
|
|
15907
|
+
* expected; there is no second brand. Reach for
|
|
15908
|
+
* `IntegrityHash.isCorepack(value)` to ask the same question about a raw
|
|
15909
|
+
* string without decoding.
|
|
15910
|
+
*
|
|
15911
|
+
* That single brand is also why sharing this schema is not type-enforced, and
|
|
15912
|
+
* the consequence is sharper than it looks: a `Schema.check` is **erased from
|
|
15913
|
+
* the built type**, so this schema and the unrestricted one are the same
|
|
15914
|
+
* declared type. A consumer that quietly reverts to a private copy compiles
|
|
15915
|
+
* clean, and — if the copy is faithful — passes every rejection test too.
|
|
15916
|
+
* Neither `tsc` nor behaviour can see the re-fork.
|
|
15917
|
+
*
|
|
15918
|
+
* What does see it is **object identity**, so each consumer's suite asserts
|
|
15919
|
+
* that its field schema IS this export:
|
|
15920
|
+
* `PackageManagerPin.fields.integrity.schema === CorepackIntegrityHash` (an
|
|
15921
|
+
* `optionalKey` field keeps the inner schema on `.schema`), and
|
|
15922
|
+
* `PackageManager.fields.integrity.value === CorepackIntegrityHash` on the
|
|
15923
|
+
* `@effected/package-json` side (a `Schema.Option` keeps it on `.value`). Both
|
|
15924
|
+
* assertions carry a control against the unrestricted brand, so they discriminate
|
|
15925
|
+
* rather than passing on any schema at all. That identity assertion is the only
|
|
15926
|
+
* thing standing between the two surfaces and a silent re-fork; do not replace
|
|
15927
|
+
* it with a behavioural test, which cannot fail.
|
|
15928
|
+
*
|
|
15929
|
+
* @example
|
|
15930
|
+
* ```ts
|
|
15931
|
+
* import { CorepackIntegrityHash } from "@effected/npm";
|
|
15932
|
+
* import { Schema } from "effect";
|
|
15933
|
+
*
|
|
15934
|
+
* const decode = Schema.decodeUnknownExit(CorepackIntegrityHash);
|
|
15935
|
+
*
|
|
15936
|
+
* decode("sha512.deadbeef"); // success
|
|
15937
|
+
* decode("sha512-3q2+7w=="); // failure — SRI form
|
|
15938
|
+
* ```
|
|
15939
|
+
*
|
|
15940
|
+
* @public
|
|
15941
|
+
*/
|
|
15942
|
+
const CorepackIntegrityHash = brandedIntegrity.pipe(Schema.check(Schema.makeFilter((value) => isCorepack(value) ? void 0 : "Expected a corepack (<algo>.<hex>) integrity hash")));
|
|
15943
|
+
|
|
15944
|
+
//#endregion
|
|
15945
|
+
//#region ../../node_modules/.pnpm/@effected+package-json@0.7.3_effect@4.0.0-beta.101/node_modules/@effected/package-json/Dependency.js
|
|
14778
15946
|
/**
|
|
14779
15947
|
* A resolved dependency entry pairing a package name with its version
|
|
14780
15948
|
* specifier and the `kind` of map it came from (`@effected/npm`'s
|
|
@@ -14839,7 +16007,7 @@ var Dependency = class extends Schema.Class("Dependency")({
|
|
|
14839
16007
|
};
|
|
14840
16008
|
|
|
14841
16009
|
//#endregion
|
|
14842
|
-
//#region ../../node_modules/.pnpm/@effected+package-json@0.7.
|
|
16010
|
+
//#region ../../node_modules/.pnpm/@effected+package-json@0.7.3_effect@4.0.0-beta.101/node_modules/@effected/package-json/DevEngines.js
|
|
14843
16011
|
/**
|
|
14844
16012
|
* A single `devEngines` constraint with a name and optional `version` / `onFail`.
|
|
14845
16013
|
*
|
|
@@ -16437,7 +17605,7 @@ const SpdxExpression = {
|
|
|
16437
17605
|
};
|
|
16438
17606
|
|
|
16439
17607
|
//#endregion
|
|
16440
|
-
//#region ../../node_modules/.pnpm/@effected+package-json@0.7.
|
|
17608
|
+
//#region ../../node_modules/.pnpm/@effected+package-json@0.7.3_effect@4.0.0-beta.101/node_modules/@effected/package-json/License.js
|
|
16441
17609
|
/**
|
|
16442
17610
|
* Indicates that a string is not a valid SPDX license identifier or expression.
|
|
16443
17611
|
*
|
|
@@ -16473,7 +17641,7 @@ const isValidSpdx = (value) => {
|
|
|
16473
17641
|
const SpdxLicense = Schema.String.pipe(Schema.check(Schema.makeFilter((value) => isValidSpdx(value) ? void 0 : "Expected a valid SPDX license expression")), Schema.brand("SpdxLicense"));
|
|
16474
17642
|
|
|
16475
17643
|
//#endregion
|
|
16476
|
-
//#region ../../node_modules/.pnpm/@effected+package-json@0.7.
|
|
17644
|
+
//#region ../../node_modules/.pnpm/@effected+package-json@0.7.3_effect@4.0.0-beta.101/node_modules/@effected/package-json/PackageManager.js
|
|
16477
17645
|
const PACKAGE_MANAGER_NAME_RE = /^[a-z]+$/;
|
|
16478
17646
|
const invalid$1 = (input, message) => Effect.fail(new SchemaIssue.InvalidValue(Option.some(input), { message }));
|
|
16479
17647
|
/**
|
|
@@ -16585,7 +17753,7 @@ var PackageManager = class PackageManager extends Schema.Class("PackageManager")
|
|
|
16585
17753
|
};
|
|
16586
17754
|
|
|
16587
17755
|
//#endregion
|
|
16588
|
-
//#region ../../node_modules/.pnpm/@effected+package-json@0.7.
|
|
17756
|
+
//#region ../../node_modules/.pnpm/@effected+package-json@0.7.3_effect@4.0.0-beta.101/node_modules/@effected/package-json/PackageName.js
|
|
16589
17757
|
/**
|
|
16590
17758
|
* Indicates that a string could not be used as a valid npm package name.
|
|
16591
17759
|
*
|
|
@@ -16644,7 +17812,7 @@ const PackageName = Object.assign(Schema.Union([ScopedPackageName, UnscopedPacka
|
|
|
16644
17812
|
});
|
|
16645
17813
|
|
|
16646
17814
|
//#endregion
|
|
16647
|
-
//#region ../../node_modules/.pnpm/@effected+package-json@0.7.
|
|
17815
|
+
//#region ../../node_modules/.pnpm/@effected+package-json@0.7.3_effect@4.0.0-beta.101/node_modules/@effected/package-json/Person.js
|
|
16648
17816
|
const parsePersonString = (input) => {
|
|
16649
17817
|
const emailMatch = input.match(/<([^>]+)>/);
|
|
16650
17818
|
const urlMatch = input.match(/\(([^)]+)\)/);
|
|
@@ -16791,7 +17959,7 @@ var Person = class Person extends Schema.Class("Person")({
|
|
|
16791
17959
|
};
|
|
16792
17960
|
|
|
16793
17961
|
//#endregion
|
|
16794
|
-
//#region ../../node_modules/.pnpm/@effected+package-json@0.7.
|
|
17962
|
+
//#region ../../node_modules/.pnpm/@effected+package-json@0.7.3_effect@4.0.0-beta.101/node_modules/@effected/package-json/Repository.js
|
|
16795
17963
|
/** The shorthand hosts npm resolves without a scheme. */
|
|
16796
17964
|
const SHORTHAND_HOSTS = /* @__PURE__ */ new Map([
|
|
16797
17965
|
["github", "https://github.com"],
|
|
@@ -16967,7 +18135,7 @@ var Bugs = class Bugs extends Schema.Class("Bugs")({
|
|
|
16967
18135
|
};
|
|
16968
18136
|
|
|
16969
18137
|
//#endregion
|
|
16970
|
-
//#region ../../node_modules/.pnpm/@effected+package-json@0.7.
|
|
18138
|
+
//#region ../../node_modules/.pnpm/@effected+package-json@0.7.3_effect@4.0.0-beta.101/node_modules/@effected/package-json/internal/format.js
|
|
16971
18139
|
const KEY_INDEX = new Map([
|
|
16972
18140
|
"$schema",
|
|
16973
18141
|
"name",
|
|
@@ -17191,7 +18359,7 @@ const renderJson = (raw, options) => {
|
|
|
17191
18359
|
};
|
|
17192
18360
|
|
|
17193
18361
|
//#endregion
|
|
17194
|
-
//#region ../../node_modules/.pnpm/@effected+package-json@0.7.
|
|
18362
|
+
//#region ../../node_modules/.pnpm/@effected+package-json@0.7.3_effect@4.0.0-beta.101/node_modules/@effected/package-json/Package.js
|
|
17195
18363
|
const toHashMap = SchemaTransformation.transform({
|
|
17196
18364
|
decode: (record) => HashMap.fromIterable(Object.entries(record)),
|
|
17197
18365
|
encode: (map) => Object.fromEntries(HashMap.toEntries(map))
|
|
@@ -17518,7 +18686,7 @@ var Package = class Package extends Schema.Class("Package")({
|
|
|
17518
18686
|
};
|
|
17519
18687
|
|
|
17520
18688
|
//#endregion
|
|
17521
|
-
//#region ../../node_modules/.pnpm/@effected+workspaces@0.
|
|
18689
|
+
//#region ../../node_modules/.pnpm/@effected+workspaces@0.10.0_@effected+jsonc@0.5.2_effect@4.0.0-beta.101__effect@4.0.0-beta.101/node_modules/@effected/workspaces/WorkspacePackage.js
|
|
17522
18690
|
const EMPTY$1 = Object.freeze(Object.create(null));
|
|
17523
18691
|
const EMPTY_MANIFEST = Object.freeze(Object.create(null));
|
|
17524
18692
|
/**
|
|
@@ -18120,7 +19288,7 @@ var Walker$1 = class {
|
|
|
18120
19288
|
};
|
|
18121
19289
|
|
|
18122
19290
|
//#endregion
|
|
18123
|
-
//#region ../../node_modules/.pnpm/@effected+workspaces@0.
|
|
19291
|
+
//#region ../../node_modules/.pnpm/@effected+workspaces@0.10.0_@effected+jsonc@0.5.2_effect@4.0.0-beta.101__effect@4.0.0-beta.101/node_modules/@effected/workspaces/WorkspaceRoot.js
|
|
18124
19292
|
/**
|
|
18125
19293
|
* The marker filenames {@link WorkspaceRoot} probes for, in priority order.
|
|
18126
19294
|
*
|
|
@@ -18308,7 +19476,7 @@ var WorkspaceRoot = class WorkspaceRoot extends Context.Service()("@effected/wor
|
|
|
18308
19476
|
};
|
|
18309
19477
|
|
|
18310
19478
|
//#endregion
|
|
18311
|
-
//#region ../../node_modules/.pnpm/@effected+workspaces@0.
|
|
19479
|
+
//#region ../../node_modules/.pnpm/@effected+workspaces@0.10.0_@effected+jsonc@0.5.2_effect@4.0.0-beta.101__effect@4.0.0-beta.101/node_modules/@effected/workspaces/internal/limits.js
|
|
18312
19480
|
/**
|
|
18313
19481
|
* Hard ceiling on directories the enumerator will visit for one pattern set.
|
|
18314
19482
|
* Guards the pathological case a depth cap alone does not: a wide, shallow
|
|
@@ -18327,7 +19495,7 @@ const MAX_ENUMERATION_ENTRIES = 1e5;
|
|
|
18327
19495
|
const PRUNED_DIRECTORIES = /* @__PURE__ */ new Set([".git", "node_modules"]);
|
|
18328
19496
|
|
|
18329
19497
|
//#endregion
|
|
18330
|
-
//#region ../../node_modules/.pnpm/@effected+workspaces@0.
|
|
19498
|
+
//#region ../../node_modules/.pnpm/@effected+workspaces@0.10.0_@effected+jsonc@0.5.2_effect@4.0.0-beta.101__effect@4.0.0-beta.101/node_modules/@effected/workspaces/internal/traverse.js
|
|
18331
19499
|
/** Directory names never descended into. */
|
|
18332
19500
|
const isPruned = (entry) => PRUNED_DIRECTORIES.has(entry);
|
|
18333
19501
|
/** Join root-relative POSIX segments; `""` is the root itself. */
|
|
@@ -18418,7 +19586,7 @@ var Traversal = class {
|
|
|
18418
19586
|
};
|
|
18419
19587
|
|
|
18420
19588
|
//#endregion
|
|
18421
|
-
//#region ../../node_modules/.pnpm/@effected+workspaces@0.
|
|
19589
|
+
//#region ../../node_modules/.pnpm/@effected+workspaces@0.10.0_@effected+jsonc@0.5.2_effect@4.0.0-beta.101__effect@4.0.0-beta.101/node_modules/@effected/workspaces/internal/enumerate.js
|
|
18422
19590
|
/** Strip a trailing slash from `GlobPattern.enumerationPrefix` to get a relative directory. */
|
|
18423
19591
|
const baseOf = (pattern) => pattern.enumerationPrefix.replace(/\/$/, "");
|
|
18424
19592
|
/**
|
|
@@ -18489,7 +19657,7 @@ const enumerate = (root, globs, options) => Effect.gen(function* () {
|
|
|
18489
19657
|
});
|
|
18490
19658
|
|
|
18491
19659
|
//#endregion
|
|
18492
|
-
//#region ../../node_modules/.pnpm/@effected+workspaces@0.
|
|
19660
|
+
//#region ../../node_modules/.pnpm/@effected+workspaces@0.10.0_@effected+jsonc@0.5.2_effect@4.0.0-beta.101__effect@4.0.0-beta.101/node_modules/@effected/workspaces/internal/patterns.js
|
|
18493
19661
|
const stringsOf = (value) => Array.isArray(value) ? value.filter((entry) => typeof entry === "string") : void 0;
|
|
18494
19662
|
/** The `packages:` list of a `pnpm-workspace.yaml` document. Total on a parsed document. */
|
|
18495
19663
|
const pnpmPatternsOf = (document) => {
|
|
@@ -18547,7 +19715,7 @@ const readPatterns = (root) => Effect.gen(function* () {
|
|
|
18547
19715
|
});
|
|
18548
19716
|
|
|
18549
19717
|
//#endregion
|
|
18550
|
-
//#region ../../node_modules/.pnpm/@effected+workspaces@0.
|
|
19718
|
+
//#region ../../node_modules/.pnpm/@effected+workspaces@0.10.0_@effected+jsonc@0.5.2_effect@4.0.0-beta.101__effect@4.0.0-beta.101/node_modules/@effected/workspaces/WorkspaceDiscovery.js
|
|
18551
19719
|
/**
|
|
18552
19720
|
* Raised when a workspace member's `package.json` cannot be read, parsed, or
|
|
18553
19721
|
* used — it is missing, malformed, or lacks a `name` or `version`.
|
|
@@ -18800,6 +19968,15 @@ var WorkspaceDiscovery = class WorkspaceDiscovery extends Context.Service()("@ef
|
|
|
18800
19968
|
for (const entry of index) if (filePath.startsWith(entry.prefix)) return Option.some(entry.package);
|
|
18801
19969
|
return Option.none();
|
|
18802
19970
|
};
|
|
19971
|
+
const packageIndexes = /* @__PURE__ */ new WeakMap();
|
|
19972
|
+
const packagesByName = (all) => {
|
|
19973
|
+
const cached = packageIndexes.get(all);
|
|
19974
|
+
if (cached !== void 0) return cached;
|
|
19975
|
+
const index = /* @__PURE__ */ new Map();
|
|
19976
|
+
for (const pkg of all) if (!index.has(pkg.name)) index.set(pkg.name, pkg);
|
|
19977
|
+
packageIndexes.set(all, index);
|
|
19978
|
+
return index;
|
|
19979
|
+
};
|
|
18803
19980
|
return {
|
|
18804
19981
|
info: Effect.fn("WorkspaceDiscovery.info")(function* () {
|
|
18805
19982
|
return (yield* memo).info;
|
|
@@ -18813,7 +19990,7 @@ var WorkspaceDiscovery = class WorkspaceDiscovery extends Context.Service()("@ef
|
|
|
18813
19990
|
}),
|
|
18814
19991
|
getPackage: Effect.fn("WorkspaceDiscovery.getPackage")(function* (name) {
|
|
18815
19992
|
const all = yield* packages;
|
|
18816
|
-
const found = all.
|
|
19993
|
+
const found = packagesByName(all).get(name);
|
|
18817
19994
|
if (found !== void 0) return found;
|
|
18818
19995
|
return yield* Effect.fail(new PackageNotFoundError({
|
|
18819
19996
|
name,
|
|
@@ -18975,9 +20152,18 @@ var WorkspaceDiscovery = class WorkspaceDiscovery extends Context.Service()("@ef
|
|
|
18975
20152
|
* // `Package.resolve` now resolves `workspace:*` for real.
|
|
18976
20153
|
* ```
|
|
18977
20154
|
*/
|
|
18978
|
-
static workspaceResolver = Layer.effect(WorkspaceResolver, Effect.gen(function* () {
|
|
20155
|
+
static workspaceResolver = Layer.effect(WorkspaceResolver$1, Effect.gen(function* () {
|
|
18979
20156
|
const discovery = yield* WorkspaceDiscovery;
|
|
18980
|
-
|
|
20157
|
+
const versionIndexes = /* @__PURE__ */ new WeakMap();
|
|
20158
|
+
const versionsByName = (all) => {
|
|
20159
|
+
const cached = versionIndexes.get(all);
|
|
20160
|
+
if (cached !== void 0) return cached;
|
|
20161
|
+
const index = /* @__PURE__ */ new Map();
|
|
20162
|
+
for (const pkg of all) if (!index.has(pkg.name)) index.set(pkg.name, pkg.version);
|
|
20163
|
+
versionIndexes.set(all, index);
|
|
20164
|
+
return index;
|
|
20165
|
+
};
|
|
20166
|
+
return { versionOf: (packageName) => discovery.listPackages().pipe(Effect.map((all) => Option.fromUndefinedOr(versionsByName(all).get(packageName))), Effect.mapError((cause) => new DependencyResolutionError$1({
|
|
18981
20167
|
specifier: `workspace:${packageName}`,
|
|
18982
20168
|
cause
|
|
18983
20169
|
}))) };
|
|
@@ -18986,7 +20172,7 @@ var WorkspaceDiscovery = class WorkspaceDiscovery extends Context.Service()("@ef
|
|
|
18986
20172
|
const isStringRecord$2 = (value) => value !== null && typeof value === "object" && !Array.isArray(value) && Object.values(value).every((entry) => typeof entry === "string");
|
|
18987
20173
|
|
|
18988
20174
|
//#endregion
|
|
18989
|
-
//#region ../../node_modules/.pnpm/@effected+workspaces@0.
|
|
20175
|
+
//#region ../../node_modules/.pnpm/@effected+workspaces@0.10.0_@effected+jsonc@0.5.2_effect@4.0.0-beta.101__effect@4.0.0-beta.101/node_modules/@effected/workspaces/DependencyGraph.js
|
|
18990
20176
|
/**
|
|
18991
20177
|
* Raised when the workspace dependency graph cannot be topologically ordered
|
|
18992
20178
|
* because it contains a cycle.
|
|
@@ -20632,7 +21818,7 @@ var Git = class Git extends Context.Service()("@effected/git/Git") {
|
|
|
20632
21818
|
};
|
|
20633
21819
|
|
|
20634
21820
|
//#endregion
|
|
20635
|
-
//#region ../../node_modules/.pnpm/@effected+workspaces@0.
|
|
21821
|
+
//#region ../../node_modules/.pnpm/@effected+workspaces@0.10.0_@effected+jsonc@0.5.2_effect@4.0.0-beta.101__effect@4.0.0-beta.101/node_modules/@effected/workspaces/ChangeDetector.js
|
|
20636
21822
|
/**
|
|
20637
21823
|
* Which git refs to compare, and whether to fold in the working tree.
|
|
20638
21824
|
*
|
|
@@ -20780,13 +21966,31 @@ var ChangeDetector = class ChangeDetector extends Context.Service()("@effected/w
|
|
|
20780
21966
|
};
|
|
20781
21967
|
|
|
20782
21968
|
//#endregion
|
|
20783
|
-
//#region ../../node_modules/.pnpm/@pnpm+constants@
|
|
21969
|
+
//#region ../../node_modules/.pnpm/@pnpm+constants@1101.0.0/node_modules/@pnpm/constants/lib/index.js
|
|
20784
21970
|
const LOCKFILE_MAJOR_VERSION = "9";
|
|
20785
21971
|
const LOCKFILE_VERSION = `${"9"}.0`;
|
|
20786
21972
|
const ENGINE_NAME = `${process.platform};${process.arch};node${process.version.split(".")[0].substring(1)}`;
|
|
21973
|
+
/**
|
|
21974
|
+
* Named-registry aliases that work without any configuration. User entries in
|
|
21975
|
+
* the `namedRegistries` setting are merged on top and may override these
|
|
21976
|
+
* (e.g. GHES users can point `gh` at their own enterprise host).
|
|
21977
|
+
*
|
|
21978
|
+
* `npmjs` is here so a dependency can be pinned to the public registry even
|
|
21979
|
+
* when `registry` points somewhere else, such as an internal proxy. The `npm`
|
|
21980
|
+
* prefix cannot serve that purpose: it is reserved for the alias protocol
|
|
21981
|
+
* (`npm:<name>@<range>`), which resolves through the default registry.
|
|
21982
|
+
*
|
|
21983
|
+
* Because these URLs are also the prefixes a recorded tarball URL is matched
|
|
21984
|
+
* against, an org that proxies npmjs should point `npmjs` at their proxy so
|
|
21985
|
+
* verification keeps going there rather than to the public host.
|
|
21986
|
+
*/
|
|
21987
|
+
const BUILTIN_NAMED_REGISTRIES = Object.freeze({
|
|
21988
|
+
gh: "https://npm.pkg.github.com/",
|
|
21989
|
+
npmjs: "https://registry.npmjs.org/"
|
|
21990
|
+
});
|
|
20787
21991
|
|
|
20788
21992
|
//#endregion
|
|
20789
|
-
//#region ../../node_modules/.pnpm/@pnpm+error@1100.1.
|
|
21993
|
+
//#region ../../node_modules/.pnpm/@pnpm+error@1100.1.1/node_modules/@pnpm/error/lib/index.js
|
|
20790
21994
|
var PnpmError = class extends Error {
|
|
20791
21995
|
code;
|
|
20792
21996
|
hint;
|
|
@@ -20802,7 +22006,7 @@ var PnpmError = class extends Error {
|
|
|
20802
22006
|
};
|
|
20803
22007
|
|
|
20804
22008
|
//#endregion
|
|
20805
|
-
//#region ../../node_modules/.pnpm/@pnpm+catalogs.config@1100.0.
|
|
22009
|
+
//#region ../../node_modules/.pnpm/@pnpm+catalogs.config@1100.0.4/node_modules/@pnpm/catalogs.config/lib/getCatalogsFromWorkspaceManifest.js
|
|
20806
22010
|
function getCatalogsFromWorkspaceManifest(workspaceManifest) {
|
|
20807
22011
|
if (workspaceManifest == null) return {};
|
|
20808
22012
|
checkDefaultCatalogIsDefinedOnce(workspaceManifest);
|
|
@@ -20816,7 +22020,7 @@ function checkDefaultCatalogIsDefinedOnce(manifest) {
|
|
|
20816
22020
|
}
|
|
20817
22021
|
|
|
20818
22022
|
//#endregion
|
|
20819
|
-
//#region ../../node_modules/.pnpm/@pnpm+catalogs.config@1100.0.
|
|
22023
|
+
//#region ../../node_modules/.pnpm/@pnpm+catalogs.config@1100.0.4/node_modules/@pnpm/catalogs.config/lib/mergeCatalogs.js
|
|
20820
22024
|
/**
|
|
20821
22025
|
* Deep-merges catalog definitions, later arguments taking precedence over
|
|
20822
22026
|
* earlier ones at the individual entry level. Use it to fold the catalog
|
|
@@ -20914,7 +22118,7 @@ function resolveFromCatalog(catalogs, wantedDependency) {
|
|
|
20914
22118
|
}
|
|
20915
22119
|
|
|
20916
22120
|
//#endregion
|
|
20917
|
-
//#region ../../node_modules/.pnpm/@effected+workspaces@0.
|
|
22121
|
+
//#region ../../node_modules/.pnpm/@effected+workspaces@0.10.0_@effected+jsonc@0.5.2_effect@4.0.0-beta.101__effect@4.0.0-beta.101/node_modules/@effected/workspaces/internal/catalogs.js
|
|
20918
22122
|
/** Project a pnpm-workspace manifest's `catalog` / `catalogs` fields into a `Catalogs` map. */
|
|
20919
22123
|
const inlineCatalogs = (manifest) => {
|
|
20920
22124
|
if (manifest.catalog === void 0 && manifest.catalogs === void 0) return {};
|
|
@@ -20980,7 +22184,7 @@ const rangeOf = (catalogs, dependency, specifier) => {
|
|
|
20980
22184
|
};
|
|
20981
22185
|
|
|
20982
22186
|
//#endregion
|
|
20983
|
-
//#region ../../node_modules/.pnpm/@effected+workspaces@0.
|
|
22187
|
+
//#region ../../node_modules/.pnpm/@effected+workspaces@0.10.0_@effected+jsonc@0.5.2_effect@4.0.0-beta.101__effect@4.0.0-beta.101/node_modules/@effected/workspaces/ConfigDependencyHooks.js
|
|
20984
22188
|
/** Whether `value` is a non-null, non-array object. */
|
|
20985
22189
|
const isObject$2 = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
20986
22190
|
/**
|
|
@@ -21073,6 +22277,137 @@ const updateConfigOf = (mod) => {
|
|
|
21073
22277
|
}
|
|
21074
22278
|
};
|
|
21075
22279
|
/**
|
|
22280
|
+
* The subprocess replay program {@link ConfigDependencyHooks.layerSubprocess}
|
|
22281
|
+
* hands to `node --input-type=module -e`.
|
|
22282
|
+
*
|
|
22283
|
+
* @remarks
|
|
22284
|
+
* A **static** string constant, deliberately: a bundler compiles a *computed*
|
|
22285
|
+
* dynamic `import()` into a context module that cannot resolve a runtime path
|
|
22286
|
+
* (`Cannot find module 'file:///…'`), so the computed import has to run in a
|
|
22287
|
+
* child process whose program text carries **no interpolated runtime value** —
|
|
22288
|
+
* the workspace root, the seed and the dependency names all arrive via argv
|
|
22289
|
+
* (`process.argv.slice(1)` under `-e`), never spliced into the script.
|
|
22290
|
+
*
|
|
22291
|
+
* The script mirrors this module's in-process semantics exactly so the two
|
|
22292
|
+
* layers are drop-in interchangeable: `pnpmfile.mjs` before `pnpmfile.cjs`
|
|
22293
|
+
* (pnpm 11's loader order), the `ERR_MODULE_NOT_FOUND`-for-the-candidate-itself
|
|
22294
|
+
* skip discrimination (`err.url` equality), the same hook-locator shapes, the
|
|
22295
|
+
* same tolerant threading of returned data (`configOf` / `finiteNumberOr` /
|
|
22296
|
+
* `stringArrayOr` clones below), and the same synchronous hook call. Only the
|
|
22297
|
+
* *mechanism* failures are reported: the script prints one final line of JSON —
|
|
22298
|
+
* `{ ok: true, config }` on success, `{ ok: false, name, message, stack? }`
|
|
22299
|
+
* naming the offending dependency on a load/replay failure — and exits through
|
|
22300
|
+
* the write callback so the payload is flushed even if a hook left the event
|
|
22301
|
+
* loop occupied. The final-line framing tolerates a hook's own `console.log`
|
|
22302
|
+
* noise on stdout.
|
|
22303
|
+
*/
|
|
22304
|
+
const REPLAY_SCRIPT = `
|
|
22305
|
+
const [root, seedJson, ...names] = process.argv.slice(1);
|
|
22306
|
+
const { pathToFileURL } = await import("node:url");
|
|
22307
|
+
const { join } = await import("node:path");
|
|
22308
|
+
const isObject = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
22309
|
+
const finiteNumberOr = (value, fallback) => (typeof value === "number" && Number.isFinite(value) ? value : fallback);
|
|
22310
|
+
const stringArrayOr = (value, fallback) =>
|
|
22311
|
+
Array.isArray(value) && value.every((entry) => typeof entry === "string") ? value : fallback;
|
|
22312
|
+
const configOf = (value, fallback) =>
|
|
22313
|
+
isObject(value)
|
|
22314
|
+
? {
|
|
22315
|
+
catalog: isObject(value.catalog) ? value.catalog : fallback.catalog,
|
|
22316
|
+
catalogs: isObject(value.catalogs) ? value.catalogs : fallback.catalogs,
|
|
22317
|
+
minimumReleaseAge: finiteNumberOr(value.minimumReleaseAge, fallback.minimumReleaseAge),
|
|
22318
|
+
minimumReleaseAgeExclude: stringArrayOr(value.minimumReleaseAgeExclude, fallback.minimumReleaseAgeExclude),
|
|
22319
|
+
}
|
|
22320
|
+
: fallback;
|
|
22321
|
+
const failure = (name, cause) => ({
|
|
22322
|
+
ok: false,
|
|
22323
|
+
name,
|
|
22324
|
+
message: cause instanceof Error ? cause.message : String(cause),
|
|
22325
|
+
...(cause instanceof Error && typeof cause.stack === "string" ? { stack: cause.stack } : {}),
|
|
22326
|
+
});
|
|
22327
|
+
const replay = async () => {
|
|
22328
|
+
let catalog = {};
|
|
22329
|
+
const catalogs = {};
|
|
22330
|
+
for (const [name, entries] of Object.entries(JSON.parse(seedJson))) {
|
|
22331
|
+
if (name === "default") catalog = { ...entries };
|
|
22332
|
+
else catalogs[name] = { ...entries };
|
|
22333
|
+
}
|
|
22334
|
+
let config = { catalog, catalogs, minimumReleaseAge: undefined, minimumReleaseAgeExclude: undefined };
|
|
22335
|
+
for (const name of names) {
|
|
22336
|
+
let loaded;
|
|
22337
|
+
let found = false;
|
|
22338
|
+
for (const filename of ["pnpmfile.mjs", "pnpmfile.cjs"]) {
|
|
22339
|
+
const candidate = pathToFileURL(join(root, "node_modules", ".pnpm-config", name, filename)).href;
|
|
22340
|
+
try {
|
|
22341
|
+
loaded = await import(candidate);
|
|
22342
|
+
found = true;
|
|
22343
|
+
break;
|
|
22344
|
+
} catch (cause) {
|
|
22345
|
+
const url =
|
|
22346
|
+
isObject(cause) && cause.code === "ERR_MODULE_NOT_FOUND" && typeof cause.url === "string"
|
|
22347
|
+
? cause.url
|
|
22348
|
+
: undefined;
|
|
22349
|
+
if (url === candidate) continue;
|
|
22350
|
+
return failure(name, cause);
|
|
22351
|
+
}
|
|
22352
|
+
}
|
|
22353
|
+
if (!found) continue;
|
|
22354
|
+
let hook;
|
|
22355
|
+
for (const candidate of [loaded, isObject(loaded) ? loaded.default : undefined]) {
|
|
22356
|
+
if (!isObject(candidate)) continue;
|
|
22357
|
+
if (isObject(candidate.hooks) && typeof candidate.hooks.updateConfig === "function") {
|
|
22358
|
+
hook = candidate.hooks.updateConfig;
|
|
22359
|
+
break;
|
|
22360
|
+
}
|
|
22361
|
+
if (typeof candidate.updateConfig === "function") {
|
|
22362
|
+
hook = candidate.updateConfig;
|
|
22363
|
+
break;
|
|
22364
|
+
}
|
|
22365
|
+
}
|
|
22366
|
+
if (hook === undefined) continue;
|
|
22367
|
+
try {
|
|
22368
|
+
config = configOf(hook(config), config);
|
|
22369
|
+
} catch (cause) {
|
|
22370
|
+
return failure(name, cause);
|
|
22371
|
+
}
|
|
22372
|
+
}
|
|
22373
|
+
return { ok: true, config };
|
|
22374
|
+
};
|
|
22375
|
+
const payload = await replay();
|
|
22376
|
+
process.stdout.write("\\n" + JSON.stringify(payload) + "\\n", () => process.exit(0));
|
|
22377
|
+
`;
|
|
22378
|
+
/**
|
|
22379
|
+
* The ceiling on one subprocess replay. A config dependency's `updateConfig`
|
|
22380
|
+
* reads and rewrites a config object — no install work, no network — so thirty
|
|
22381
|
+
* seconds is generous. Without a ceiling a pnpmfile that loops or awaits a
|
|
22382
|
+
* promise that never settles hangs `inject`, and through it the one memoized
|
|
22383
|
+
* {@link WorkspaceCatalogs} assemble pass every catalog read blocks on. Expiry
|
|
22384
|
+
* kills the child (`Run` scopes it) and surfaces as a `CommandFailedError`
|
|
22385
|
+
* through the same typed transport-failure path as any other mechanism failure.
|
|
22386
|
+
*/
|
|
22387
|
+
const REPLAY_TIMEOUT = Duration.seconds(30);
|
|
22388
|
+
/**
|
|
22389
|
+
* The subprocess protocol payload — the child's final stdout line, framed and
|
|
22390
|
+
* parsed by `Run.jsonLine`. The envelope is strict (a payload without a usable
|
|
22391
|
+
* `ok` discriminant is a mechanism failure, typed); the `config` slice inside a
|
|
22392
|
+
* success stays `Unknown` because a hook's returned *data* is tolerantly
|
|
22393
|
+
* threaded (`configOf`), never fatal.
|
|
22394
|
+
*/
|
|
22395
|
+
const ReplayPayload = Schema.Union([Schema.Struct({
|
|
22396
|
+
ok: Schema.Literal(true),
|
|
22397
|
+
config: Schema.Unknown
|
|
22398
|
+
}), Schema.Struct({
|
|
22399
|
+
ok: Schema.Literal(false),
|
|
22400
|
+
name: Schema.optionalKey(Schema.String),
|
|
22401
|
+
message: Schema.optionalKey(Schema.String),
|
|
22402
|
+
stack: Schema.optionalKey(Schema.String)
|
|
22403
|
+
})]);
|
|
22404
|
+
/** Rebuild the subprocess's serialized failure as an `Error`, preserving the child-side stack when it carried one. */
|
|
22405
|
+
const replayFailureCause = (payload) => {
|
|
22406
|
+
const error = new Error(payload.message ?? "config dependency hook replay failed");
|
|
22407
|
+
if (payload.stack !== void 0) error.stack = payload.stack;
|
|
22408
|
+
return error;
|
|
22409
|
+
};
|
|
22410
|
+
/**
|
|
21076
22411
|
* Replays a workspace's `configDependencies` `updateConfig` hooks over the inline
|
|
21077
22412
|
* catalogs — the opt-in seam that lets hook-injected catalogs participate in
|
|
21078
22413
|
* assembly.
|
|
@@ -21165,10 +22500,99 @@ var ConfigDependencyHooks = class ConfigDependencyHooks extends Context.Service(
|
|
|
21165
22500
|
releaseAge: releaseAgeOf(config)
|
|
21166
22501
|
};
|
|
21167
22502
|
}) });
|
|
22503
|
+
/**
|
|
22504
|
+
* The subprocess layer: replays each config dependency's pnpmfile in a `node`
|
|
22505
|
+
* child process instead of an in-process dynamic `import()`, with identical
|
|
22506
|
+
* typed semantics to {@link ConfigDependencyHooks.layerLive} — the two are
|
|
22507
|
+
* drop-in interchangeable.
|
|
22508
|
+
*
|
|
22509
|
+
* @remarks
|
|
22510
|
+
* `layerLive` computes the `import()` path at runtime, and a bundler (rspack,
|
|
22511
|
+
* for one) compiles a *computed* dynamic import into a context module that
|
|
22512
|
+
* throws `Cannot find module 'file:///…'` at runtime — so in any bundled
|
|
22513
|
+
* consumer, a GitHub Action above all, the in-process replay is unreachable.
|
|
22514
|
+
* This layer keeps every computed load out of the bundle graph: the replay
|
|
22515
|
+
* program is a **static** string constant passed via argv
|
|
22516
|
+
* (`node --input-type=module -e <script> <root> <seed> <...names>`), and the
|
|
22517
|
+
* child process performs the computed imports where no bundler rewrote them.
|
|
22518
|
+
* A subprocess also keeps config-dependency code out of the consumer's own
|
|
22519
|
+
* process.
|
|
22520
|
+
*
|
|
22521
|
+
* The contract's semantics are unchanged, not the downstream fail-open shape:
|
|
22522
|
+
* an empty `configDependencies` returns the seed without spawning anything; a
|
|
22523
|
+
* `..` path segment in a dependency name fails typed **before** any spawn; a
|
|
22524
|
+
* missing pnpmfile (neither `.mjs` nor `.cjs`) is the one legitimate skip,
|
|
22525
|
+
* discriminated inside the child by `err.url` equality exactly as
|
|
22526
|
+
* `layerLive` discriminates in process; any other load failure — a syntax
|
|
22527
|
+
* error, a throwing top level, an `ERR_MODULE_NOT_FOUND` for a module the
|
|
22528
|
+
* pnpmfile itself imports — and a hook that throws when called are serialized
|
|
22529
|
+
* back per-name and surface typed as a `hooks`-source `CatalogAssemblyError`
|
|
22530
|
+
* naming that dependency. A hook's returned *data* stays tolerantly threaded
|
|
22531
|
+
* (last well-formed write wins), never fatal. Spawn and transport failures —
|
|
22532
|
+
* `node` absent, a non-zero exit without a result payload, unparseable
|
|
22533
|
+
* output — fail typed too, never a defect and never a silent skip.
|
|
22534
|
+
*
|
|
22535
|
+
* Two bounds this layer imposes that `layerLive` cannot: the replay is
|
|
22536
|
+
* given thirty seconds (a pnpmfile that loops or awaits forever fails typed
|
|
22537
|
+
* instead of hanging the memoized assemble pass — a subprocess is killable,
|
|
22538
|
+
* while `layerLive`'s in-process synchronous hook call is not interruptible
|
|
22539
|
+
* by any means, so the asymmetry is inherent, not a parity violation), and
|
|
22540
|
+
* the child's stdout is captured under `Run.jsonLine`'s 16 MiB default
|
|
22541
|
+
* ceiling (a hook that logs more than that fails typed as `tooLarge`, where
|
|
22542
|
+
* `layerLive` — which captures nothing — would succeed).
|
|
22543
|
+
*
|
|
22544
|
+
* Catalog folding and normalization stay in the **parent** (the same
|
|
22545
|
+
* `@pnpm/catalogs`-derived path `layerLive` uses); the child returns only the
|
|
22546
|
+
* raw threaded config slice, since the script cannot import kit code.
|
|
22547
|
+
*
|
|
22548
|
+
* Requires core's `ChildProcessSpawner`, resolved when the layer is built —
|
|
22549
|
+
* the consumer provides it once at the edge (`@effect/platform-node`'s
|
|
22550
|
+
* `NodeServices.layer`), the same discharge `@effected/git` uses. Wired by
|
|
22551
|
+
* `WorkspaceCatalogs.layerWithConfigDependenciesSubprocess` /
|
|
22552
|
+
* `Workspaces.layerWithConfigDependenciesSubprocess`.
|
|
22553
|
+
*/
|
|
22554
|
+
static layerSubprocess = Layer.effect(ConfigDependencyHooks, Effect.gen(function* () {
|
|
22555
|
+
const spawner = yield* ChildProcessSpawner.ChildProcessSpawner;
|
|
22556
|
+
return { inject: (root, configDependencies, seed) => Effect.gen(function* () {
|
|
22557
|
+
const names = Object.keys(configDependencies);
|
|
22558
|
+
if (names.length === 0) return {
|
|
22559
|
+
catalogs: seed,
|
|
22560
|
+
releaseAge: {}
|
|
22561
|
+
};
|
|
22562
|
+
for (const name of names) if (hasTraversalSegment(name)) return yield* Effect.fail(new CatalogAssemblyError({
|
|
22563
|
+
source: "hooks",
|
|
22564
|
+
path: name,
|
|
22565
|
+
cause: /* @__PURE__ */ new Error(`config dependency name has a '..' path segment: ${name}`)
|
|
22566
|
+
}));
|
|
22567
|
+
const command = ChildProcess.make("node", [
|
|
22568
|
+
"--input-type=module",
|
|
22569
|
+
"-e",
|
|
22570
|
+
REPLAY_SCRIPT,
|
|
22571
|
+
root,
|
|
22572
|
+
JSON.stringify(seed),
|
|
22573
|
+
...names
|
|
22574
|
+
]);
|
|
22575
|
+
const payload = yield* Run.jsonLine(command, ReplayPayload, { timeout: REPLAY_TIMEOUT }).pipe(Effect.provideService(ChildProcessSpawner.ChildProcessSpawner, spawner), Effect.catch((cause) => Effect.fail(new CatalogAssemblyError({
|
|
22576
|
+
source: "hooks",
|
|
22577
|
+
path: root,
|
|
22578
|
+
cause
|
|
22579
|
+
}))));
|
|
22580
|
+
if (payload.ok === false) return yield* Effect.fail(new CatalogAssemblyError({
|
|
22581
|
+
source: "hooks",
|
|
22582
|
+
path: payload.name ?? root,
|
|
22583
|
+
cause: replayFailureCause(payload)
|
|
22584
|
+
}));
|
|
22585
|
+
const config = configOf(payload.config, seedToConfig(seed));
|
|
22586
|
+
return {
|
|
22587
|
+
catalogs: configToEntries(config),
|
|
22588
|
+
releaseAge: releaseAgeOf(config)
|
|
22589
|
+
};
|
|
22590
|
+
}) };
|
|
22591
|
+
}));
|
|
21168
22592
|
};
|
|
21169
22593
|
|
|
21170
22594
|
//#endregion
|
|
21171
|
-
//#region ../../node_modules/.pnpm/@effected+workspaces@0.
|
|
22595
|
+
//#region ../../node_modules/.pnpm/@effected+workspaces@0.10.0_@effected+jsonc@0.5.2_effect@4.0.0-beta.101__effect@4.0.0-beta.101/node_modules/@effected/workspaces/PackageManagerName.js
|
|
21172
22596
|
/**
|
|
21173
22597
|
* The four package managers this package understands.
|
|
21174
22598
|
*
|
|
@@ -21497,7 +22921,7 @@ var PackageManagerDetector = class PackageManagerDetector extends Context.Servic
|
|
|
21497
22921
|
};
|
|
21498
22922
|
|
|
21499
22923
|
//#endregion
|
|
21500
|
-
//#region ../../node_modules/.pnpm/@effected+workspaces@0.
|
|
22924
|
+
//#region ../../node_modules/.pnpm/@effected+workspaces@0.10.0_@effected+jsonc@0.5.2_effect@4.0.0-beta.101__effect@4.0.0-beta.101/node_modules/@effected/workspaces/LockfileReader.js
|
|
21501
22925
|
/**
|
|
21502
22926
|
* Raised when the workspace's lockfile cannot be read off disk.
|
|
21503
22927
|
*
|
|
@@ -21678,7 +23102,7 @@ var LockfileReader = class LockfileReader extends Context.Service()("@effected/w
|
|
|
21678
23102
|
};
|
|
21679
23103
|
|
|
21680
23104
|
//#endregion
|
|
21681
|
-
//#region ../../node_modules/.pnpm/@effected+workspaces@0.
|
|
23105
|
+
//#region ../../node_modules/.pnpm/@effected+workspaces@0.10.0_@effected+jsonc@0.5.2_effect@4.0.0-beta.101__effect@4.0.0-beta.101/node_modules/@effected/workspaces/Publishability.js
|
|
21682
23106
|
/** The public npm registry, used when `publishConfig.registry` says nothing. */
|
|
21683
23107
|
const DEFAULT_REGISTRY = "https://registry.npmjs.org/";
|
|
21684
23108
|
/**
|
|
@@ -21838,7 +23262,7 @@ var PublishabilityDetector = class extends Context.Service()("@effected/workspac
|
|
|
21838
23262
|
};
|
|
21839
23263
|
|
|
21840
23264
|
//#endregion
|
|
21841
|
-
//#region ../../node_modules/.pnpm/@effected+workspaces@0.
|
|
23265
|
+
//#region ../../node_modules/.pnpm/@effected+workspaces@0.10.0_@effected+jsonc@0.5.2_effect@4.0.0-beta.101__effect@4.0.0-beta.101/node_modules/@effected/workspaces/internal/importerVersions.js
|
|
21842
23266
|
/**
|
|
21843
23267
|
* Strip pnpm's peer-disambiguation suffix from a recorded importer version.
|
|
21844
23268
|
*
|
|
@@ -21925,7 +23349,7 @@ const unanimousVersionOf = (index, dependency) => {
|
|
|
21925
23349
|
};
|
|
21926
23350
|
|
|
21927
23351
|
//#endregion
|
|
21928
|
-
//#region ../../node_modules/.pnpm/@effected+workspaces@0.
|
|
23352
|
+
//#region ../../node_modules/.pnpm/@effected+workspaces@0.10.0_@effected+jsonc@0.5.2_effect@4.0.0-beta.101__effect@4.0.0-beta.101/node_modules/@effected/workspaces/WorkspaceCatalogs.js
|
|
21929
23353
|
/**
|
|
21930
23354
|
* An immutable, fully-normalized catalog collection — the one catalog
|
|
21931
23355
|
* resolution semantic in the package.
|
|
@@ -22346,6 +23770,24 @@ var WorkspaceCatalogs = class WorkspaceCatalogs extends Context.Service()("@effe
|
|
|
22346
23770
|
*/
|
|
22347
23771
|
static layerWithConfigDependencies = (options) => Layer.effect(WorkspaceCatalogs, WorkspaceCatalogs.make(options)).pipe(Layer.provide(ConfigDependencyHooks.layerLive));
|
|
22348
23772
|
/**
|
|
23773
|
+
* The opt-in layer that replays config-dependency `pnpmfile` hooks in a
|
|
23774
|
+
* `node` **child process**: it wires
|
|
23775
|
+
* {@link ConfigDependencyHooks.layerSubprocess} in place of the in-process
|
|
23776
|
+
* `layerLive`.
|
|
23777
|
+
*
|
|
23778
|
+
* @remarks
|
|
23779
|
+
* Same typed semantics as {@link WorkspaceCatalogs.layerWithConfigDependencies}
|
|
23780
|
+
* — the two hook layers are drop-in interchangeable — but the replay's
|
|
23781
|
+
* computed dynamic `import()` runs in the subprocess, so it survives bundling
|
|
23782
|
+
* (a bundler compiles a computed in-process `import()` into a context module
|
|
23783
|
+
* that cannot resolve at runtime — every bundled GitHub Action hits this).
|
|
23784
|
+
* The cost is one extra requirement: core's `ChildProcessSpawner`, provided
|
|
23785
|
+
* once at the edge (`@effect/platform-node`'s `NodeServices.layer`) — the
|
|
23786
|
+
* same sanctioned R-widening as `Workspaces.layerWithGit`. Parameterized, so
|
|
23787
|
+
* bind it to a `const` and reuse it.
|
|
23788
|
+
*/
|
|
23789
|
+
static layerWithConfigDependenciesSubprocess = (options) => Layer.effect(WorkspaceCatalogs, WorkspaceCatalogs.make(options)).pipe(Layer.provide(ConfigDependencyHooks.layerSubprocess));
|
|
23790
|
+
/**
|
|
22349
23791
|
* A test double satisfying the full {@link WorkspaceCatalogsShape} with no
|
|
22350
23792
|
* filesystem, lockfile read, or hook replay.
|
|
22351
23793
|
*
|
|
@@ -22422,9 +23864,9 @@ var WorkspaceCatalogs = class WorkspaceCatalogs extends Context.Service()("@effe
|
|
|
22422
23864
|
* consumers to `_tag`-sniff `unknown`); only the remaining mechanism failure,
|
|
22423
23865
|
* an unfindable workspace root, is wrapped as `DependencyResolutionError`.
|
|
22424
23866
|
*/
|
|
22425
|
-
static catalogResolver = Layer.effect(CatalogResolver, Effect.gen(function* () {
|
|
23867
|
+
static catalogResolver = Layer.effect(CatalogResolver$1, Effect.gen(function* () {
|
|
22426
23868
|
const catalogs = yield* WorkspaceCatalogs;
|
|
22427
|
-
return { rangeOf: (packageName, catalog) => catalogs.set().pipe(Effect.map((set) => set.rangeOf(packageName, catalog)), Effect.catchTag("WorkspaceRootNotFoundError", (cause) => Effect.fail(new DependencyResolutionError({
|
|
23869
|
+
return { rangeOf: (packageName, catalog) => catalogs.set().pipe(Effect.map((set) => set.rangeOf(packageName, catalog)), Effect.catchTag("WorkspaceRootNotFoundError", (cause) => Effect.fail(new DependencyResolutionError$1({
|
|
22428
23870
|
specifier: Option.match(catalog, {
|
|
22429
23871
|
onNone: () => "catalog:",
|
|
22430
23872
|
onSome: (name) => `catalog:${name}`
|
|
@@ -22435,7 +23877,7 @@ var WorkspaceCatalogs = class WorkspaceCatalogs extends Context.Service()("@effe
|
|
|
22435
23877
|
};
|
|
22436
23878
|
|
|
22437
23879
|
//#endregion
|
|
22438
|
-
//#region ../../node_modules/.pnpm/@effected+workspaces@0.
|
|
23880
|
+
//#region ../../node_modules/.pnpm/@effected+workspaces@0.10.0_@effected+jsonc@0.5.2_effect@4.0.0-beta.101__effect@4.0.0-beta.101/node_modules/@effected/workspaces/WorkspaceStateSnapshot.js
|
|
22439
23881
|
const EMPTY = Object.freeze(Object.create(null));
|
|
22440
23882
|
const DependencyMap = Schema.Record(Schema.String, Schema.String).pipe(Schema.withDecodingDefaultKey(Effect.succeed(EMPTY)), Schema.withConstructorDefault(Effect.succeed(EMPTY)));
|
|
22441
23883
|
/**
|
|
@@ -22614,7 +24056,7 @@ var WorkspaceStateSnapshot = class extends Schema.Class("WorkspaceStateSnapshot"
|
|
|
22614
24056
|
* resolving to `Option.none()` so the caller falls back to the raw string.
|
|
22615
24057
|
*/
|
|
22616
24058
|
#resolveWith(dependency, specifier, onUnresolvedCatalog) {
|
|
22617
|
-
const exit = Schema.decodeUnknownExit(DependencySpecifier.FromString)(specifier);
|
|
24059
|
+
const exit = Schema.decodeUnknownExit(DependencySpecifier$1.FromString)(specifier);
|
|
22618
24060
|
if (!Exit.isSuccess(exit)) return Option.none();
|
|
22619
24061
|
const classified = exit.value;
|
|
22620
24062
|
switch (classified._tag) {
|
|
@@ -22639,7 +24081,7 @@ var WorkspaceStateSnapshot = class extends Schema.Class("WorkspaceStateSnapshot"
|
|
|
22639
24081
|
* `rangeOf` never fails.
|
|
22640
24082
|
*/
|
|
22641
24083
|
get catalogResolver() {
|
|
22642
|
-
if (this.#catalogResolver === void 0) this.#catalogResolver = Layer.succeed(CatalogResolver, { rangeOf: (packageName, catalog) => Effect.succeed(this.catalogs.rangeOf(packageName, catalog)) });
|
|
24084
|
+
if (this.#catalogResolver === void 0) this.#catalogResolver = Layer.succeed(CatalogResolver$1, { rangeOf: (packageName, catalog) => Effect.succeed(this.catalogs.rangeOf(packageName, catalog)) });
|
|
22643
24085
|
return this.#catalogResolver;
|
|
22644
24086
|
}
|
|
22645
24087
|
/**
|
|
@@ -22648,7 +24090,7 @@ var WorkspaceStateSnapshot = class extends Schema.Class("WorkspaceStateSnapshot"
|
|
|
22648
24090
|
* `workspace:` specifiers as of this ref. Built once per instance and cached.
|
|
22649
24091
|
*/
|
|
22650
24092
|
get workspaceResolver() {
|
|
22651
|
-
if (this.#workspaceResolver === void 0) this.#workspaceResolver = Layer.succeed(WorkspaceResolver, { versionOf: (packageName) => Effect.succeed(Option.fromUndefinedOr(this.#versions().get(packageName))) });
|
|
24093
|
+
if (this.#workspaceResolver === void 0) this.#workspaceResolver = Layer.succeed(WorkspaceResolver$1, { versionOf: (packageName) => Effect.succeed(Option.fromUndefinedOr(this.#versions().get(packageName))) });
|
|
22652
24094
|
return this.#workspaceResolver;
|
|
22653
24095
|
}
|
|
22654
24096
|
/** Both snapshot-scoped resolver layers merged. Built once per instance and cached. */
|
|
@@ -22659,7 +24101,7 @@ var WorkspaceStateSnapshot = class extends Schema.Class("WorkspaceStateSnapshot"
|
|
|
22659
24101
|
};
|
|
22660
24102
|
|
|
22661
24103
|
//#endregion
|
|
22662
|
-
//#region ../../node_modules/.pnpm/@effected+workspaces@0.
|
|
24104
|
+
//#region ../../node_modules/.pnpm/@effected+workspaces@0.10.0_@effected+jsonc@0.5.2_effect@4.0.0-beta.101__effect@4.0.0-beta.101/node_modules/@effected/workspaces/WorkspaceSnapshots.js
|
|
22663
24105
|
/** Whether `value` is a non-null, non-array object. */
|
|
22664
24106
|
const isObject = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
22665
24107
|
/** Whether every value in a record is a string — a usable dependency map. */
|
|
@@ -22937,7 +24379,7 @@ var WorkspaceSnapshots = class WorkspaceSnapshots extends Context.Service()("@ef
|
|
|
22937
24379
|
};
|
|
22938
24380
|
|
|
22939
24381
|
//#endregion
|
|
22940
|
-
//#region ../../node_modules/.pnpm/@effected+workspaces@0.
|
|
24382
|
+
//#region ../../node_modules/.pnpm/@effected+workspaces@0.10.0_@effected+jsonc@0.5.2_effect@4.0.0-beta.101__effect@4.0.0-beta.101/node_modules/@effected/workspaces/Workspaces.js
|
|
22941
24383
|
const compose = (options, catalogsFactory) => {
|
|
22942
24384
|
const roots = WorkspaceRoot.layer;
|
|
22943
24385
|
const detector = PackageManagerDetector.layer;
|
|
@@ -22954,6 +24396,7 @@ const layerWithGit = (options) => {
|
|
|
22954
24396
|
};
|
|
22955
24397
|
const resolvers = Layer.mergeAll(WorkspaceCatalogs.catalogResolver, WorkspaceDiscovery.workspaceResolver);
|
|
22956
24398
|
const layerWithConfigDependencies = (options) => compose(options, WorkspaceCatalogs.layerWithConfigDependencies);
|
|
24399
|
+
const layerWithConfigDependenciesSubprocess = (options) => compose(options, WorkspaceCatalogs.layerWithConfigDependenciesSubprocess);
|
|
22957
24400
|
const resolverLayer = (options) => resolvers.pipe(Layer.provide(layerWithConfigDependencies(options)));
|
|
22958
24401
|
const resolveManifest = Effect.fn("Workspaces.resolveManifest")(function* (manifest, options) {
|
|
22959
24402
|
return yield* manifest.resolve().pipe(Effect.provide(resolverLayer(options)));
|
|
@@ -23035,6 +24478,32 @@ var Workspaces = class {
|
|
|
23035
24478
|
*/
|
|
23036
24479
|
static layerWithConfigDependencies = layerWithConfigDependencies;
|
|
23037
24480
|
/**
|
|
24481
|
+
* The git-free composite with config-dependency hook replay in a `node`
|
|
24482
|
+
* **child process** —
|
|
24483
|
+
* {@link WorkspaceCatalogs.layerWithConfigDependenciesSubprocess} in place of
|
|
24484
|
+
* the in-process replay.
|
|
24485
|
+
*
|
|
24486
|
+
* @remarks
|
|
24487
|
+
* Same typed semantics as {@link Workspaces.layerWithConfigDependencies}; the
|
|
24488
|
+
* difference is mechanism, and it matters in exactly one environment class: a
|
|
24489
|
+
* **bundled** consumer. The in-process replay's computed dynamic `import()`
|
|
24490
|
+
* is compiled by bundlers (rspack among them) into a context module that
|
|
24491
|
+
* throws `Cannot find module 'file:///…'` at runtime, which makes
|
|
24492
|
+
* `WorkspaceCatalogs.releaseAgeGate()` unreachable from any bundled GitHub
|
|
24493
|
+
* Action. Here the computed import runs inside a `node` child process whose
|
|
24494
|
+
* program text is a static string handed over argv, so nothing computed
|
|
24495
|
+
* enters the bundle graph.
|
|
24496
|
+
*
|
|
24497
|
+
* The extra requirement is core's `ChildProcessSpawner`, provided once at
|
|
24498
|
+
* the edge (`@effect/platform-node`'s `NodeServices.layer`) — the same
|
|
24499
|
+
* sanctioned R-widening as {@link Workspaces.layerWithGit}, and the reason
|
|
24500
|
+
* this is a separate composite rather than a flag: a consumer that keeps the
|
|
24501
|
+
* in-process replay should not have to be able to spawn a subprocess.
|
|
24502
|
+
*
|
|
24503
|
+
* **Bind the result to a `const`.**
|
|
24504
|
+
*/
|
|
24505
|
+
static layerWithConfigDependenciesSubprocess = layerWithConfigDependenciesSubprocess;
|
|
24506
|
+
/**
|
|
23038
24507
|
* The git-free composite plus {@link ChangeDetector} and
|
|
23039
24508
|
* {@link WorkspaceSnapshots}, over `@effected/git`'s `Git` service.
|
|
23040
24509
|
*
|
|
@@ -61219,7 +62688,7 @@ function validatePackages(packages) {
|
|
|
61219
62688
|
}
|
|
61220
62689
|
|
|
61221
62690
|
//#endregion
|
|
61222
|
-
//#region ../../node_modules/.pnpm/@changesets+get-dependents-graph@3.0.0-next.
|
|
62691
|
+
//#region ../../node_modules/.pnpm/@changesets+get-dependents-graph@3.0.0-next.9/node_modules/@changesets/get-dependents-graph/dist/index.mjs
|
|
61223
62692
|
var src_default = new Proxy({}, { get(target, color) {
|
|
61224
62693
|
target[color] ??= (text) => styleText(color, text);
|
|
61225
62694
|
return target[color];
|
|
@@ -61340,7 +62809,7 @@ function getDependentsGraph(packages, opts) {
|
|
|
61340
62809
|
}
|
|
61341
62810
|
|
|
61342
62811
|
//#endregion
|
|
61343
|
-
//#region ../../node_modules/.pnpm/@changesets+should-skip-package@1.0.0-next.
|
|
62812
|
+
//#region ../../node_modules/.pnpm/@changesets+should-skip-package@1.0.0-next.9/node_modules/@changesets/should-skip-package/dist/index.mjs
|
|
61344
62813
|
function shouldSkipPackage({ packageJson }, { ignore, allowPrivatePackages }) {
|
|
61345
62814
|
if (ignore.includes(packageJson.name)) return true;
|
|
61346
62815
|
if (packageJson.private && !allowPrivatePackages) return true;
|
|
@@ -61348,7 +62817,7 @@ function shouldSkipPackage({ packageJson }, { ignore, allowPrivatePackages }) {
|
|
|
61348
62817
|
}
|
|
61349
62818
|
|
|
61350
62819
|
//#endregion
|
|
61351
|
-
//#region ../../node_modules/.pnpm/@changesets+config@4.0.0-next.
|
|
62820
|
+
//#region ../../node_modules/.pnpm/@changesets+config@4.0.0-next.9/node_modules/@changesets/config/dist/index.mjs
|
|
61352
62821
|
const DEFAULT_CONFIG = {
|
|
61353
62822
|
lang: void 0,
|
|
61354
62823
|
message: void 0,
|
|
@@ -62090,9 +63559,9 @@ const WrittenConfigSchema = /* @__PURE__ */ object({
|
|
|
62090
63559
|
linked: rootKey(PackageGroupSchema, "Packages that should be linked together so when they are being released, they will be released at the same version.", []),
|
|
62091
63560
|
updateInternalDependencies: rootKey(/* @__PURE__ */ union([/* @__PURE__ */ literal("minor"), /* @__PURE__ */ literal("patch")]), "The minimum bump type to trigger automatic update of internal dependencies that are part of the same release.", "patch"),
|
|
62092
63561
|
privatePackages: rootKey(/* @__PURE__ */ union([/* @__PURE__ */ object({
|
|
62093
|
-
version: /* @__PURE__ */ optional(/* @__PURE__ */ boolean(),
|
|
63562
|
+
version: /* @__PURE__ */ optional(/* @__PURE__ */ boolean(), false),
|
|
62094
63563
|
tag: /* @__PURE__ */ optional(/* @__PURE__ */ boolean(), false)
|
|
62095
|
-
}), /* @__PURE__ */
|
|
63564
|
+
}), /* @__PURE__ */ boolean()]), "Opt in to tracking non-npm / private packages", {}),
|
|
62096
63565
|
bumpVersionsWithWorkspaceProtocolOnly: rootKey(/* @__PURE__ */ boolean(), "Determines whether Changesets should only bump dependency ranges that use workspace protocol of packages that are part of the workspace.", false),
|
|
62097
63566
|
snapshot: rootKey(/* @__PURE__ */ object({
|
|
62098
63567
|
useCalculatedVersion: /* @__PURE__ */ optional(/* @__PURE__ */ pipe(/* @__PURE__ */ boolean(), /* @__PURE__ */ description("Makes generated snapshot versions use the calculated version (based on the changeset files) as a base version, instead of 0.0.0")), false),
|
|
@@ -62116,11 +63585,11 @@ function normalizeWrittenConfig({ packageNames, writtenConfig }) {
|
|
|
62116
63585
|
else if (writtenConfig.commit === true) config.commit = ["@changesets/cli/commit", { skipCI: "version" }];
|
|
62117
63586
|
if (writtenConfig.ignore != null) config.ignore = globMatch(packageNames, writtenConfig.ignore);
|
|
62118
63587
|
if (typeof writtenConfig.privatePackages !== "object") config.privatePackages = {
|
|
62119
|
-
version: writtenConfig.privatePackages ??
|
|
62120
|
-
tag: false
|
|
63588
|
+
version: writtenConfig.privatePackages ?? false,
|
|
63589
|
+
tag: writtenConfig.privatePackages ?? false
|
|
62121
63590
|
};
|
|
62122
63591
|
else config.privatePackages = {
|
|
62123
|
-
version: writtenConfig.privatePackages.version ??
|
|
63592
|
+
version: writtenConfig.privatePackages.version ?? false,
|
|
62124
63593
|
tag: writtenConfig.privatePackages.tag ?? false
|
|
62125
63594
|
};
|
|
62126
63595
|
return config;
|
|
@@ -62260,7 +63729,7 @@ async function readConfig(cwd, packages) {
|
|
|
62260
63729
|
packages ??= await getPackages(cwd);
|
|
62261
63730
|
return validateConfig(JSON.parse(await fs$1.readFile(path$1.join(packages.rootDir, ".changeset", "config.json"), "utf8")), packages);
|
|
62262
63731
|
}
|
|
62263
|
-
var version = "4.0.0-next.
|
|
63732
|
+
var version = "4.0.0-next.9";
|
|
62264
63733
|
const defaultWrittenConfig = {
|
|
62265
63734
|
["$schema"]: `https://unpkg.com/@changesets/config@${version}/schema.json`,
|
|
62266
63735
|
baseBranch: "main",
|
|
@@ -63552,7 +65021,7 @@ var InternalError = class extends Error {
|
|
|
63552
65021
|
};
|
|
63553
65022
|
|
|
63554
65023
|
//#endregion
|
|
63555
|
-
//#region ../../node_modules/.pnpm/@changesets+git@4.0.0-next.
|
|
65024
|
+
//#region ../../node_modules/.pnpm/@changesets+git@4.0.0-next.9/node_modules/@changesets/git/dist/index.mjs
|
|
63556
65025
|
async function getDivergedCommit(cwd, ref) {
|
|
63557
65026
|
const cmd = await exec("git", [
|
|
63558
65027
|
"merge-base",
|
|
@@ -63576,6 +65045,7 @@ async function getCommitsThatAddFiles(gitPaths, { cwd, short = false }) {
|
|
|
63576
65045
|
const [commitSha, parentSha] = (await exec("git", [
|
|
63577
65046
|
"log",
|
|
63578
65047
|
"--diff-filter=A",
|
|
65048
|
+
"--follow",
|
|
63579
65049
|
"--max-count=1",
|
|
63580
65050
|
short ? "--pretty=format:%h:%p" : "--pretty=format:%H:%p",
|
|
63581
65051
|
gitPath
|
|
@@ -63629,8 +65099,9 @@ async function getChangedChangesetFilesSinceRef({ cwd, ref }) {
|
|
|
63629
65099
|
"--no-relative",
|
|
63630
65100
|
await getDivergedCommit(cwd, ref)
|
|
63631
65101
|
], { nodeOptions: { cwd } });
|
|
63632
|
-
const
|
|
63633
|
-
|
|
65102
|
+
const rootChangesetsRegex = /\.changeset\/[^/]+\.md$/;
|
|
65103
|
+
const preChangesetsRegex = /\.changeset\/pre\/[^/]+\.md$/;
|
|
65104
|
+
return cmd.stdout.toString().trim().split("\n").filter((file) => rootChangesetsRegex.test(file) || preChangesetsRegex.test(file));
|
|
63634
65105
|
} catch (err) {
|
|
63635
65106
|
if (err instanceof GitError) return [];
|
|
63636
65107
|
throw err;
|
|
@@ -65722,7 +67193,7 @@ function applyEdits(text, edits) {
|
|
|
65722
67193
|
}
|
|
65723
67194
|
|
|
65724
67195
|
//#endregion
|
|
65725
|
-
//#region ../../node_modules/.pnpm/@changesets+apply-release-plan@8.0.0-next.
|
|
67196
|
+
//#region ../../node_modules/.pnpm/@changesets+apply-release-plan@8.0.0-next.10/node_modules/@changesets/apply-release-plan/dist/index.mjs
|
|
65726
67197
|
/**
|
|
65727
67198
|
* A simple JSON editing utility that preserves formatting. They specified operation keys
|
|
65728
67199
|
* must exist in the JSON for this implementation.
|
|
@@ -65942,12 +67413,11 @@ async function applyReleasePlan(releasePlan, packages, config = defaultConfig, s
|
|
|
65942
67413
|
...pkg
|
|
65943
67414
|
};
|
|
65944
67415
|
}), changesets, config, cwd, contextDir);
|
|
65945
|
-
if (releasePlan.preState
|
|
65946
|
-
|
|
67416
|
+
if (releasePlan.preState?.mode === "exit" && snapshot == null) {
|
|
67417
|
+
await fs$1.rm(path$1.join(cwd, ".changeset", "pre.json"), {
|
|
65947
67418
|
recursive: true,
|
|
65948
67419
|
force: true
|
|
65949
67420
|
});
|
|
65950
|
-
else await fs$1.writeFile(path$1.join(cwd, ".changeset", "pre.json"), JSON.stringify(releasePlan.preState, null, 2) + "\n");
|
|
65951
67421
|
touchedFiles.push(path$1.join(cwd, ".changeset", "pre.json"));
|
|
65952
67422
|
}
|
|
65953
67423
|
const versionsToUpdate = releases.map((release) => ({
|
|
@@ -65984,24 +67454,27 @@ async function applyReleasePlan(releasePlan, packages, config = defaultConfig, s
|
|
|
65984
67454
|
if (pkgJsonPath) touchedFiles.push(pkgJsonPath);
|
|
65985
67455
|
}
|
|
65986
67456
|
if (filesToFormat.length > 0) await (await getFormatter(config.format, cwd))(filesToFormat);
|
|
65987
|
-
|
|
65988
|
-
|
|
65989
|
-
|
|
65990
|
-
|
|
65991
|
-
|
|
65992
|
-
|
|
65993
|
-
|
|
65994
|
-
|
|
65995
|
-
|
|
65996
|
-
|
|
65997
|
-
|
|
65998
|
-
|
|
65999
|
-
|
|
66000
|
-
|
|
66001
|
-
|
|
67457
|
+
const isPreChangesets = releasePlan.preState?.mode === "pre";
|
|
67458
|
+
if (isPreChangesets && changesets.length > 0) await fs$1.mkdir(path$1.resolve(cwd, ".changeset", "pre"), { recursive: true });
|
|
67459
|
+
await Promise.all(changesets.map(async (changeset) => {
|
|
67460
|
+
const changesetPath = path$1.resolve(cwd, ".changeset", `${changeset.id}.md`);
|
|
67461
|
+
if (await fs$1.access(changesetPath).then(() => true, () => false)) {
|
|
67462
|
+
if (!changeset.releases.some((release) => shouldSkipPackage(packagesByName.get(release.name), {
|
|
67463
|
+
ignore: config.ignore,
|
|
67464
|
+
allowPrivatePackages: config.privatePackages.version
|
|
67465
|
+
}))) if (isPreChangesets) {
|
|
67466
|
+
const newChangesetPath = path$1.resolve(cwd, ".changeset", "pre", `${changeset.id}.md`);
|
|
67467
|
+
await fs$1.rename(changesetPath, newChangesetPath);
|
|
67468
|
+
touchedFiles.push(changesetPath, newChangesetPath);
|
|
67469
|
+
} else {
|
|
67470
|
+
await fs$1.rm(changesetPath, {
|
|
67471
|
+
recursive: true,
|
|
67472
|
+
force: true
|
|
67473
|
+
});
|
|
67474
|
+
touchedFiles.push(changesetPath);
|
|
66002
67475
|
}
|
|
66003
|
-
}
|
|
66004
|
-
}
|
|
67476
|
+
}
|
|
67477
|
+
}));
|
|
66005
67478
|
return touchedFiles;
|
|
66006
67479
|
}
|
|
66007
67480
|
async function getNewChangelogEntry(releasesWithPackage, changesets, config, cwd, contextDir) {
|
|
@@ -66074,7 +67547,7 @@ async function updateChangelog(changelogPath, changelog, name) {
|
|
|
66074
67547
|
}
|
|
66075
67548
|
|
|
66076
67549
|
//#endregion
|
|
66077
|
-
//#region ../../node_modules/.pnpm/@changesets+assemble-release-plan@7.0.0-next.
|
|
67550
|
+
//#region ../../node_modules/.pnpm/@changesets+assemble-release-plan@7.0.0-next.10/node_modules/@changesets/assemble-release-plan/dist/index.mjs
|
|
66078
67551
|
function getHighestReleaseType(releases) {
|
|
66079
67552
|
if (releases.length === 0) throw new Error(`Large internal Changesets error when calculating highest release type in the set of releases. Please contact the maintainers`);
|
|
66080
67553
|
let highestReleaseType = "none";
|
|
@@ -66324,7 +67797,7 @@ function getNewVersion(release, preInfo) {
|
|
|
66324
67797
|
function assembleReleasePlan(changesets, packages, config, preState, snapshot) {
|
|
66325
67798
|
const packagesByName = new Map(packages.packages.map((x) => [x.packageJson.name, x]));
|
|
66326
67799
|
const relevantChangesets = getRelevantChangesets(changesets, packagesByName, config, preState);
|
|
66327
|
-
const preInfo = getPreInfo(
|
|
67800
|
+
const preInfo = getPreInfo(packagesByName, config, preState);
|
|
66328
67801
|
const releases = flattenReleases(relevantChangesets, packagesByName, config);
|
|
66329
67802
|
const dependencyGraph = getDependentsGraph(packages, { bumpVersionsWithWorkspaceProtocolOnly: config.bumpVersionsWithWorkspaceProtocolOnly });
|
|
66330
67803
|
let releasesValidated = false;
|
|
@@ -66378,10 +67851,7 @@ function getRelevantChangesets(changesets, packagesByName, config, preState) {
|
|
|
66378
67851
|
else notSkippedPackages.push(release.name);
|
|
66379
67852
|
if (skippedPackages.length > 0 && notSkippedPackages.length > 0) throw new Error(`Found mixed changeset ${changeset.id}\nFound ignored packages: ${skippedPackages.join(" ")}\nFound not ignored packages: ${notSkippedPackages.join(" ")}\nMixed changesets that contain both ignored and not ignored packages are not allowed`);
|
|
66380
67853
|
}
|
|
66381
|
-
if (preState && preState.mode !== "exit")
|
|
66382
|
-
const usedChangesetIds = new Set(preState.changesets);
|
|
66383
|
-
return changesets.filter((changeset) => !usedChangesetIds.has(changeset.id));
|
|
66384
|
-
}
|
|
67854
|
+
if (preState && preState.mode !== "exit") return changesets.filter((changeset) => !changeset.id.startsWith("pre/"));
|
|
66385
67855
|
return changesets;
|
|
66386
67856
|
}
|
|
66387
67857
|
function getHighestPreVersion(groupKind, packageGroup, packagesByName) {
|
|
@@ -66392,12 +67862,8 @@ function getHighestPreVersion(groupKind, packageGroup, packagesByName) {
|
|
|
66392
67862
|
}
|
|
66393
67863
|
return highestPreVersion;
|
|
66394
67864
|
}
|
|
66395
|
-
function getPreInfo(
|
|
67865
|
+
function getPreInfo(packagesByName, config, preState) {
|
|
66396
67866
|
if (preState == null) return;
|
|
66397
|
-
const updatedPreState = {
|
|
66398
|
-
...preState,
|
|
66399
|
-
changesets: changesets.map((changeset) => changeset.id)
|
|
66400
|
-
};
|
|
66401
67867
|
const preVersions = /* @__PURE__ */ new Map();
|
|
66402
67868
|
for (const [, pkg] of packagesByName) {
|
|
66403
67869
|
if (shouldSkipPackage(pkg, {
|
|
@@ -66415,13 +67881,13 @@ function getPreInfo(changesets, packagesByName, config, preState) {
|
|
|
66415
67881
|
for (const linkedPackage of linkedGroup) preVersions.set(linkedPackage, highestPreVersion);
|
|
66416
67882
|
}
|
|
66417
67883
|
return {
|
|
66418
|
-
state:
|
|
67884
|
+
state: preState,
|
|
66419
67885
|
preVersions
|
|
66420
67886
|
};
|
|
66421
67887
|
}
|
|
66422
67888
|
|
|
66423
67889
|
//#endregion
|
|
66424
|
-
//#region ../../node_modules/.pnpm/@changesets+pre@3.0.0-next.
|
|
67890
|
+
//#region ../../node_modules/.pnpm/@changesets+pre@3.0.0-next.9/node_modules/@changesets/pre/dist/index.mjs
|
|
66425
67891
|
async function outputFile(filePath, content) {
|
|
66426
67892
|
await fs$1.mkdir(path$1.dirname(filePath), { recursive: true });
|
|
66427
67893
|
await fs$1.writeFile(filePath, content, "utf8");
|
|
@@ -66444,14 +67910,26 @@ async function readPreState(rootDir) {
|
|
|
66444
67910
|
return preState;
|
|
66445
67911
|
}
|
|
66446
67912
|
async function migratePreState(rootDir, preState) {
|
|
66447
|
-
if (preState.initialVersions == null) return preState;
|
|
66448
|
-
delete preState.initialVersions;
|
|
67913
|
+
if (preState.initialVersions == null && preState.changesets == null) return preState;
|
|
67914
|
+
if (preState.initialVersions != null) delete preState.initialVersions;
|
|
67915
|
+
if (preState.changesets != null) {
|
|
67916
|
+
const preChangesetsDir = path$1.resolve(rootDir, ".changeset", "pre");
|
|
67917
|
+
await fs$1.mkdir(preChangesetsDir, { recursive: true });
|
|
67918
|
+
for (const changeset of preState.changesets) {
|
|
67919
|
+
const oldPath = path$1.resolve(rootDir, ".changeset", `${changeset}.md`);
|
|
67920
|
+
const newPath = path$1.resolve(preChangesetsDir, `${changeset}.md`);
|
|
67921
|
+
try {
|
|
67922
|
+
await fs$1.rename(oldPath, newPath);
|
|
67923
|
+
} catch {}
|
|
67924
|
+
}
|
|
67925
|
+
delete preState.changesets;
|
|
67926
|
+
}
|
|
66449
67927
|
await outputFile(path$1.resolve(rootDir, ".changeset", "pre.json"), JSON.stringify(preState, null, 2) + "\n");
|
|
66450
67928
|
return preState;
|
|
66451
67929
|
}
|
|
66452
67930
|
|
|
66453
67931
|
//#endregion
|
|
66454
|
-
//#region ../../node_modules/.pnpm/@changesets+parse@1.0.0-next.
|
|
67932
|
+
//#region ../../node_modules/.pnpm/@changesets+parse@1.0.0-next.10/node_modules/@changesets/parse/dist/index.mjs
|
|
66455
67933
|
const mdRegex = /\s*---([^]*?)\r?\n\s*---(\s*(?:\n|$)[^]*)/;
|
|
66456
67934
|
const EXAMPLE_FORMAT = `---\n"package-name": patch\n---`;
|
|
66457
67935
|
const validVersionTypes = [
|
|
@@ -66505,7 +67983,7 @@ YAML error: ${e instanceof Error ? e.message : String(e)}\nFrontmatter content:\
|
|
|
66505
67983
|
}
|
|
66506
67984
|
|
|
66507
67985
|
//#endregion
|
|
66508
|
-
//#region ../../node_modules/.pnpm/@changesets+read@1.0.0-next.
|
|
67986
|
+
//#region ../../node_modules/.pnpm/@changesets+read@1.0.0-next.10/node_modules/@changesets/read/dist/index.mjs
|
|
66509
67987
|
const ignoredMdFiles = [
|
|
66510
67988
|
/^README\.md$/i,
|
|
66511
67989
|
"AGENTS.md",
|
|
@@ -66516,30 +67994,40 @@ async function filterChangesetsSinceRef(changesets, changesetBase, sinceRef) {
|
|
|
66516
67994
|
const newHashes = (await getChangedChangesetFilesSinceRef({
|
|
66517
67995
|
cwd: changesetBase,
|
|
66518
67996
|
ref: sinceRef
|
|
66519
|
-
})).map((c) => c.
|
|
67997
|
+
})).map((c) => c.replace(/^.*\.changeset\//, ""));
|
|
66520
67998
|
return changesets.filter((dir) => newHashes.includes(dir));
|
|
66521
67999
|
}
|
|
66522
68000
|
async function readChangesets(rootDir, sinceRef) {
|
|
66523
68001
|
const changesetBase = path$1.join(rootDir, ".changeset");
|
|
66524
|
-
let
|
|
68002
|
+
let changesets = [];
|
|
66525
68003
|
try {
|
|
66526
|
-
|
|
68004
|
+
changesets.push(...await fs$1.readdir(changesetBase));
|
|
66527
68005
|
} catch (err) {
|
|
66528
68006
|
if (err.code === "ENOENT") throw new Error("There is no .changeset directory in this project", { cause: err });
|
|
66529
68007
|
throw err;
|
|
66530
68008
|
}
|
|
66531
|
-
|
|
66532
|
-
|
|
68009
|
+
try {
|
|
68010
|
+
changesets.push(...(await fs$1.readdir(path$1.join(changesetBase, "pre"))).map((file) => `pre/${file}`));
|
|
68011
|
+
} catch (err) {
|
|
68012
|
+
if (err.code !== "ENOENT") throw err;
|
|
68013
|
+
}
|
|
68014
|
+
console.log(changesets);
|
|
68015
|
+
if (sinceRef != null) changesets = await filterChangesetsSinceRef(changesets, changesetBase, sinceRef);
|
|
68016
|
+
changesets = changesets.filter((file) => {
|
|
68017
|
+
file = path$1.basename(file);
|
|
68018
|
+
return !file.startsWith(".") && file.endsWith(".md") && !ignoredMdFiles.some((pattern) => typeof pattern === "string" ? pattern === file : pattern.test(file));
|
|
68019
|
+
});
|
|
68020
|
+
const changesetContents = changesets.map(async (file) => {
|
|
66533
68021
|
return {
|
|
66534
68022
|
...parseChangesetFile(await fs$1.readFile(path$1.join(changesetBase, file), "utf8")),
|
|
66535
|
-
id: file.replace(
|
|
68023
|
+
id: file.replace(/\.md$/, "")
|
|
66536
68024
|
};
|
|
66537
68025
|
});
|
|
66538
68026
|
return await Promise.all(changesetContents);
|
|
66539
68027
|
}
|
|
66540
68028
|
|
|
66541
68029
|
//#endregion
|
|
66542
|
-
//#region ../../node_modules/.pnpm/@changesets+get-release-plan@5.0.0-next.
|
|
68030
|
+
//#region ../../node_modules/.pnpm/@changesets+get-release-plan@5.0.0-next.10/node_modules/@changesets/get-release-plan/dist/index.mjs
|
|
66543
68031
|
async function getReleasePlan(cwd, sinceRef, passedConfig) {
|
|
66544
68032
|
const packages = await getPackages(cwd);
|
|
66545
68033
|
const configResult = await readConfig(packages.rootDir, packages);
|