@savvy-web/silk 3.0.4 → 3.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/changesets-changelog.cjs +1073 -257
- package/changesets-changelog.d.cts +596 -37
- package/changesets-changelog.d.ts +596 -37
- package/changesets-changelog.js +1091 -261
- package/changesets-markdownlint.cjs +1073 -257
- package/changesets-markdownlint.d.cts +596 -37
- package/changesets-markdownlint.d.ts +596 -37
- package/changesets-markdownlint.js +1091 -261
- package/package.json +6 -6
- package/tsconfig/node/dist/tsconfig.tsbuildinfo +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Brand, Context, Effect, Equal, FileSystem, Hash, HashMap, Layer, Option, Order, Path, Schema } from "effect";
|
|
1
|
+
import { Brand, Context, Effect, Equal, FileSystem, Hash, HashMap, Layer, Option, Order, Path, Result, Schema } from "effect";
|
|
2
2
|
import { ChildProcessSpawner } from "effect/unstable/process";
|
|
3
3
|
//#region ../../node_modules/.pnpm/@types+unist@3.0.3/node_modules/@types/unist/index.d.ts
|
|
4
4
|
// ## Interfaces
|
|
@@ -3650,7 +3650,7 @@ declare class Git extends Git_base {
|
|
|
3650
3650
|
static readonly layer: Layer.Layer<Git, never, ChildProcessSpawner.ChildProcessSpawner>;
|
|
3651
3651
|
}
|
|
3652
3652
|
//#endregion
|
|
3653
|
-
//#region ../../node_modules/.pnpm/@effected+semver@0.
|
|
3653
|
+
//#region ../../node_modules/.pnpm/@effected+semver@0.2.0_effect@4.0.0-beta.99/node_modules/@effected/semver/index.d.ts
|
|
3654
3654
|
//#region src/SemVer.d.ts
|
|
3655
3655
|
declare const InvalidVersionError_base: Schema.Class<InvalidVersionError, Schema.TaggedStruct<"InvalidVersionError", {
|
|
3656
3656
|
/** The raw input string that failed to parse. */
|
|
@@ -3719,11 +3719,45 @@ declare class SemVer extends SemVer_base {
|
|
|
3719
3719
|
*/
|
|
3720
3720
|
static readonly FromString: Schema.Codec<SemVer, string>;
|
|
3721
3721
|
/**
|
|
3722
|
-
* Parse a strict SemVer 2.0.0 version string
|
|
3722
|
+
* Parse a strict SemVer 2.0.0 version string, synchronously, returning a
|
|
3723
|
+
* `Result` instead of an `Effect`.
|
|
3723
3724
|
*
|
|
3724
3725
|
* Rejects `v`/`V` prefixes, `=` prefixes, leading zeros on numeric
|
|
3725
3726
|
* identifiers and partially consumed input.
|
|
3726
3727
|
*
|
|
3728
|
+
* @remarks
|
|
3729
|
+
* {@link SemVer.parse} is defined in terms of this function; the two never
|
|
3730
|
+
* diverge. Reach for the `Effect` variant inside Effect code — it carries
|
|
3731
|
+
* the `SemVer.parse` tracing span — and for this one at synchronous
|
|
3732
|
+
* boundaries.
|
|
3733
|
+
*
|
|
3734
|
+
* @example
|
|
3735
|
+
* ```ts
|
|
3736
|
+
* import { SemVer } from "@effected/semver";
|
|
3737
|
+
* import { Result } from "effect";
|
|
3738
|
+
*
|
|
3739
|
+
* const ok = SemVer.parseResult("1.2.3");
|
|
3740
|
+
* if (Result.isSuccess(ok)) {
|
|
3741
|
+
* console.log(ok.success.major); // => 1
|
|
3742
|
+
* }
|
|
3743
|
+
*
|
|
3744
|
+
* const bad = SemVer.parseResult("v1.2.3");
|
|
3745
|
+
* if (Result.isFailure(bad)) {
|
|
3746
|
+
* console.log(bad.failure._tag); // => "InvalidVersionError"
|
|
3747
|
+
* }
|
|
3748
|
+
* ```
|
|
3749
|
+
*
|
|
3750
|
+
* @param input - the version string to parse
|
|
3751
|
+
* @returns a `Result` succeeding with the parsed {@link SemVer}, or failing
|
|
3752
|
+
* with {@link InvalidVersionError} when `input` is not a valid version
|
|
3753
|
+
* string.
|
|
3754
|
+
*/
|
|
3755
|
+
static parseResult(input: string): Result.Result<SemVer, InvalidVersionError>;
|
|
3756
|
+
/**
|
|
3757
|
+
* Parse a strict SemVer 2.0.0 version string. Defined in terms of
|
|
3758
|
+
* {@link SemVer.parseResult} — synchronous callers can use that variant
|
|
3759
|
+
* directly.
|
|
3760
|
+
*
|
|
3727
3761
|
* @param input - the version string to parse
|
|
3728
3762
|
* @returns the parsed {@link SemVer}. Fails with {@link InvalidVersionError}
|
|
3729
3763
|
* when `input` is not a valid version string.
|
|
@@ -3924,7 +3958,41 @@ declare class Comparator extends Comparator_base {
|
|
|
3924
3958
|
* and {@link Comparator}.
|
|
3925
3959
|
*/
|
|
3926
3960
|
static readonly FromString: Schema.Codec<Comparator, string>;
|
|
3927
|
-
/**
|
|
3961
|
+
/**
|
|
3962
|
+
* Parse a comparator string (e.g. `">=1.2.3"`), synchronously, returning a
|
|
3963
|
+
* `Result` instead of an `Effect`.
|
|
3964
|
+
*
|
|
3965
|
+
* @remarks
|
|
3966
|
+
* {@link Comparator.parse} is defined in terms of this function; the two
|
|
3967
|
+
* never diverge. Reach for the `Effect` variant inside Effect code — it
|
|
3968
|
+
* carries the `Comparator.parse` tracing span — and for this one at
|
|
3969
|
+
* synchronous boundaries.
|
|
3970
|
+
*
|
|
3971
|
+
* @example
|
|
3972
|
+
* ```ts
|
|
3973
|
+
* import { Comparator } from "@effected/semver";
|
|
3974
|
+
* import { Result } from "effect";
|
|
3975
|
+
*
|
|
3976
|
+
* const ok = Comparator.parseResult(">=1.2.3");
|
|
3977
|
+
* if (Result.isSuccess(ok)) {
|
|
3978
|
+
* console.log(ok.success.operator); // => ">="
|
|
3979
|
+
* }
|
|
3980
|
+
* ```
|
|
3981
|
+
*
|
|
3982
|
+
* @param input - the comparator string to parse
|
|
3983
|
+
* @returns a `Result` succeeding with the parsed {@link Comparator}, or
|
|
3984
|
+
* failing with {@link InvalidComparatorError}.
|
|
3985
|
+
*/
|
|
3986
|
+
static parseResult(input: string): Result.Result<Comparator, InvalidComparatorError>;
|
|
3987
|
+
/**
|
|
3988
|
+
* Parse a comparator string (e.g. `">=1.2.3"`). Defined in terms of
|
|
3989
|
+
* {@link Comparator.parseResult} — synchronous callers can use that variant
|
|
3990
|
+
* directly.
|
|
3991
|
+
*
|
|
3992
|
+
* @param input - the comparator string to parse
|
|
3993
|
+
* @returns the parsed {@link Comparator}. Fails with
|
|
3994
|
+
* {@link InvalidComparatorError}.
|
|
3995
|
+
*/
|
|
3928
3996
|
static readonly parse: (input: string) => Effect.Effect<Comparator, InvalidComparatorError, never>;
|
|
3929
3997
|
/** Test whether a version satisfies this comparator. */
|
|
3930
3998
|
test(version: SemVer): boolean;
|
|
@@ -3986,7 +4054,40 @@ declare class Range extends Range_base {
|
|
|
3986
4054
|
* prints `a b || c d`.
|
|
3987
4055
|
*/
|
|
3988
4056
|
static readonly FromString: Schema.Codec<Range, string>;
|
|
3989
|
-
/**
|
|
4057
|
+
/**
|
|
4058
|
+
* Parse a range expression and normalize its comparator sets,
|
|
4059
|
+
* synchronously, returning a `Result` instead of an `Effect`.
|
|
4060
|
+
*
|
|
4061
|
+
* @remarks
|
|
4062
|
+
* {@link Range.parse} is defined in terms of this function; the two never
|
|
4063
|
+
* diverge. Reach for the `Effect` variant inside Effect code — it carries
|
|
4064
|
+
* the `Range.parse` tracing span — and for this one at synchronous
|
|
4065
|
+
* boundaries.
|
|
4066
|
+
*
|
|
4067
|
+
* @example
|
|
4068
|
+
* ```ts
|
|
4069
|
+
* import { Range } from "@effected/semver";
|
|
4070
|
+
* import { Result } from "effect";
|
|
4071
|
+
*
|
|
4072
|
+
* const ok = Range.parseResult("^1.0.0");
|
|
4073
|
+
* if (Result.isSuccess(ok)) {
|
|
4074
|
+
* console.log(ok.success.toString()); // => ">=1.0.0 <2.0.0-0"
|
|
4075
|
+
* }
|
|
4076
|
+
* ```
|
|
4077
|
+
*
|
|
4078
|
+
* @param input - the range expression to parse
|
|
4079
|
+
* @returns a `Result` succeeding with the parsed {@link Range}, or failing
|
|
4080
|
+
* with {@link InvalidRangeError}.
|
|
4081
|
+
*/
|
|
4082
|
+
static parseResult(input: string): Result.Result<Range, InvalidRangeError>;
|
|
4083
|
+
/**
|
|
4084
|
+
* Parse a range expression and normalize its comparator sets. Defined in
|
|
4085
|
+
* terms of {@link Range.parseResult} — synchronous callers can use that
|
|
4086
|
+
* variant directly.
|
|
4087
|
+
*
|
|
4088
|
+
* @param input - the range expression to parse
|
|
4089
|
+
* @returns the parsed {@link Range}. Fails with {@link InvalidRangeError}.
|
|
4090
|
+
*/
|
|
3990
4091
|
static readonly parse: (input: string) => Effect.Effect<Range, InvalidRangeError, never>;
|
|
3991
4092
|
/**
|
|
3992
4093
|
* Test whether a version satisfies a range; see {@link Range.test} for the
|
|
@@ -4019,11 +4120,44 @@ declare class Range extends Range_base {
|
|
|
4019
4120
|
(that: Range): (self: Range) => Range;
|
|
4020
4121
|
(self: Range, that: Range): Range;
|
|
4021
4122
|
};
|
|
4123
|
+
/**
|
|
4124
|
+
* Intersect two ranges via a cross-product of their comparator sets,
|
|
4125
|
+
* keeping only satisfiable combinations, synchronously, returning a
|
|
4126
|
+
* `Result` instead of an `Effect`. Fails with
|
|
4127
|
+
* {@link UnsatisfiableConstraintError} when no satisfiable set remains —
|
|
4128
|
+
* an honest typed failure instead of an unsatisfiable range. Dual API.
|
|
4129
|
+
*
|
|
4130
|
+
* @remarks
|
|
4131
|
+
* {@link Range.intersect} is defined in terms of this function; the two
|
|
4132
|
+
* never diverge. Reach for the `Effect` variant inside Effect code — it
|
|
4133
|
+
* carries the `Range.intersect` tracing span — and for this one at
|
|
4134
|
+
* synchronous boundaries.
|
|
4135
|
+
*
|
|
4136
|
+
* @example
|
|
4137
|
+
* ```ts
|
|
4138
|
+
* import { Range } from "@effected/semver";
|
|
4139
|
+
* import { Result } from "effect";
|
|
4140
|
+
*
|
|
4141
|
+
* const a = Result.getOrThrow(Range.parseResult("^1.0.0"));
|
|
4142
|
+
* const b = Result.getOrThrow(Range.parseResult(">=1.5.0"));
|
|
4143
|
+
* const merged = Range.intersectResult(a, b);
|
|
4144
|
+
* if (Result.isSuccess(merged)) {
|
|
4145
|
+
* console.log(merged.success.toString()); // => ">=1.0.0 <2.0.0-0 >=1.5.0"
|
|
4146
|
+
* }
|
|
4147
|
+
* ```
|
|
4148
|
+
*/
|
|
4149
|
+
static readonly intersectResult: {
|
|
4150
|
+
(that: Range): (self: Range) => Result.Result<Range, UnsatisfiableConstraintError>;
|
|
4151
|
+
(self: Range, that: Range): Result.Result<Range, UnsatisfiableConstraintError>;
|
|
4152
|
+
};
|
|
4022
4153
|
/**
|
|
4023
4154
|
* Intersect two ranges via a cross-product of their comparator sets,
|
|
4024
4155
|
* keeping only satisfiable combinations. Fails with
|
|
4025
4156
|
* {@link UnsatisfiableConstraintError} when no satisfiable set remains —
|
|
4026
4157
|
* an honest typed failure instead of an unsatisfiable range. Dual API.
|
|
4158
|
+
*
|
|
4159
|
+
* Defined in terms of {@link Range.intersectResult} — synchronous callers
|
|
4160
|
+
* can use that variant directly.
|
|
4027
4161
|
*/
|
|
4028
4162
|
static readonly intersect: {
|
|
4029
4163
|
(that: Range): (self: Range) => Effect.Effect<Range, UnsatisfiableConstraintError>;
|
|
@@ -4091,7 +4225,7 @@ declare class UnsatisfiableConstraintError extends UnsatisfiableConstraintError_
|
|
|
4091
4225
|
get message(): string;
|
|
4092
4226
|
}
|
|
4093
4227
|
//#endregion
|
|
4094
|
-
//#region ../../node_modules/.pnpm/@effected+npm@0.
|
|
4228
|
+
//#region ../../node_modules/.pnpm/@effected+npm@0.3.0_@effected+semver@0.2.0_effect@4.0.0-beta.99__effect@4.0.0-beta.99/node_modules/@effected/npm/index.d.ts
|
|
4095
4229
|
//#region src/CatalogAssemblyError.d.ts
|
|
4096
4230
|
declare const CatalogAssemblyError_base: Schema.Class<CatalogAssemblyError, Schema.TaggedStruct<"CatalogAssemblyError", {
|
|
4097
4231
|
/**
|
|
@@ -4363,7 +4497,136 @@ declare class InvalidIntegrityHashError extends InvalidIntegrityHashError_base {
|
|
|
4363
4497
|
*/
|
|
4364
4498
|
type IntegrityHashBrand = string & Brand.Brand<"IntegrityHash">;
|
|
4365
4499
|
//#endregion
|
|
4366
|
-
//#region
|
|
4500
|
+
//#region src/ReleaseAgeGate.d.ts
|
|
4501
|
+
/**
|
|
4502
|
+
* A source's partial contribution to a {@link ReleaseAgeGate}: the effective
|
|
4503
|
+
* gate is assembled from more than one place (inline `pnpm-workspace.yaml`
|
|
4504
|
+
* keys, replayed `updateConfig` hooks, `pnpm config get` output), and each
|
|
4505
|
+
* source may set the age, the exclude list, both, or neither. Absent fields
|
|
4506
|
+
* contribute nothing to the combination.
|
|
4507
|
+
*
|
|
4508
|
+
* Deliberately permissive: unlike {@link ReleaseAgeGate} it does not constrain
|
|
4509
|
+
* `ageMinutes` to be non-negative, because the raw values arrive from arbitrary
|
|
4510
|
+
* config sources and {@link ReleaseAgeGate.combine} is the single authority
|
|
4511
|
+
* that clamps them.
|
|
4512
|
+
*
|
|
4513
|
+
* @public
|
|
4514
|
+
*/
|
|
4515
|
+
declare const PartialReleaseAgeGate: Schema.Struct<{
|
|
4516
|
+
/** Minutes a release must age; absent means this source sets no age. */
|
|
4517
|
+
readonly ageMinutes: Schema.optionalKey<Schema.Number>;
|
|
4518
|
+
/** Exempt package-name patterns; absent means this source adds no exemptions. */
|
|
4519
|
+
readonly exclude: Schema.optionalKey<Schema.$Array<Schema.String>>;
|
|
4520
|
+
}>;
|
|
4521
|
+
/**
|
|
4522
|
+
* One source's partial contribution to a release-age gate. All fields optional.
|
|
4523
|
+
*
|
|
4524
|
+
* @public
|
|
4525
|
+
*/
|
|
4526
|
+
type PartialReleaseAgeGate = typeof PartialReleaseAgeGate.Type;
|
|
4527
|
+
declare const ReleaseAgeGate_base: Schema.Class<ReleaseAgeGate, Schema.Struct<{
|
|
4528
|
+
/** Minutes a published version must age before it is eligible (non-negative, finite). */
|
|
4529
|
+
readonly ageMinutes: Schema.Number;
|
|
4530
|
+
/** Package-name patterns exempt from the gate (exact names or `*`-globs). */
|
|
4531
|
+
readonly exclude: Schema.$Array<Schema.String>;
|
|
4532
|
+
}>, {}>;
|
|
4533
|
+
/**
|
|
4534
|
+
* pnpm's publish-time release-age gate: the number of minutes a published
|
|
4535
|
+
* version must age before it is eligible, and the set of package-name patterns
|
|
4536
|
+
* exempt from the gate. Mirrors pnpm's `minimumReleaseAge` /
|
|
4537
|
+
* `minimumReleaseAgeExclude` config so a resolver can drop too-young candidate
|
|
4538
|
+
* versions before picking, avoiding `ERR_PNPM_NO_MATURE_MATCHING_VERSION`.
|
|
4539
|
+
*
|
|
4540
|
+
* `ageMinutes` is constrained non-negative and finite; a `ReleaseAgeGate` with
|
|
4541
|
+
* `ageMinutes <= 0` is an inert gate that filters nothing. Assemble a gate from
|
|
4542
|
+
* multiple config sources with {@link ReleaseAgeGate.combine}, and apply it to
|
|
4543
|
+
* a package's candidate versions with {@link ReleaseAgeGate.filterVersions}.
|
|
4544
|
+
*
|
|
4545
|
+
* @example
|
|
4546
|
+
* ```ts
|
|
4547
|
+
* import { ReleaseAgeGate } from "@effected/npm";
|
|
4548
|
+
*
|
|
4549
|
+
* const gate = ReleaseAgeGate.combine(
|
|
4550
|
+
* { ageMinutes: 1440 },
|
|
4551
|
+
* { exclude: ["@my-scope/*"] },
|
|
4552
|
+
* );
|
|
4553
|
+
* // gate.ageMinutes === 1440, gate.exclude === ["@my-scope/*"]
|
|
4554
|
+
*
|
|
4555
|
+
* const eligible = gate.filterVersions(
|
|
4556
|
+
* ["1.0.0", "1.0.1"],
|
|
4557
|
+
* { "1.0.0": "2020-01-01T00:00:00Z", "1.0.1": "2026-07-21T00:00:00Z" },
|
|
4558
|
+
* "prettier",
|
|
4559
|
+
* Date.now(),
|
|
4560
|
+
* );
|
|
4561
|
+
* ```
|
|
4562
|
+
*
|
|
4563
|
+
* @public
|
|
4564
|
+
*/
|
|
4565
|
+
declare class ReleaseAgeGate extends ReleaseAgeGate_base {
|
|
4566
|
+
/**
|
|
4567
|
+
* Combine partial contributions from multiple sources into one effective
|
|
4568
|
+
* gate: **strictest age wins** (the maximum of the contributed ages,
|
|
4569
|
+
* clamped to be non-negative) and the exclude sets **union** (deduplicated,
|
|
4570
|
+
* insertion order preserved). A contribution's absent field adds nothing; a
|
|
4571
|
+
* negative or non-finite contributed age is ignored by the clamp. With no
|
|
4572
|
+
* contributions (or only empty ones) the result is the inert zero gate
|
|
4573
|
+
* (`ageMinutes: 0`, `exclude: []`).
|
|
4574
|
+
*
|
|
4575
|
+
* `combine` is total — it never throws on a fractional, negative, or
|
|
4576
|
+
* non-finite contribution — which is why {@link (PartialReleaseAgeGate:variable)}
|
|
4577
|
+
* does not constrain its `ageMinutes` and this method owns the clamp.
|
|
4578
|
+
*
|
|
4579
|
+
* @param contributions - the partial gates to merge, one per source.
|
|
4580
|
+
*/
|
|
4581
|
+
static combine(...contributions: readonly PartialReleaseAgeGate[]): ReleaseAgeGate;
|
|
4582
|
+
/**
|
|
4583
|
+
* Whether a package name matches any of `patterns`, using pnpm's
|
|
4584
|
+
* `@pnpm/matcher` semantics: an exact-name match, or a `*`-glob where `*`
|
|
4585
|
+
* matches any run of characters **including `/`** — so a bare `*` matches a
|
|
4586
|
+
* scoped name like `@scope/pkg`, and `@scope/*` matches every package in a
|
|
4587
|
+
* scope.
|
|
4588
|
+
*
|
|
4589
|
+
* @remarks
|
|
4590
|
+
* This is deliberately **NOT** `@effected/glob`'s minimatch dialect, in
|
|
4591
|
+
* which `*` refuses to cross `/` (there `*` matches `pkg` but not
|
|
4592
|
+
* `@scope/pkg`, and you would need `**`). pnpm treats the package name as a
|
|
4593
|
+
* flat string, so this matcher does too. Do not "fix" this to route through
|
|
4594
|
+
* `@effected/glob`: it would silently change which packages a gate exempts
|
|
4595
|
+
* and diverge from pnpm's own behavior.
|
|
4596
|
+
*
|
|
4597
|
+
* @param name - the package name to test.
|
|
4598
|
+
* @param patterns - the exclude patterns (exact names or `*`-globs).
|
|
4599
|
+
*/
|
|
4600
|
+
static matchesExclude(name: string, patterns: readonly string[]): boolean;
|
|
4601
|
+
/**
|
|
4602
|
+
* Whether this gate exempts the given package name from the release-age
|
|
4603
|
+
* check — `ReleaseAgeGate.matchesExclude(name, this.exclude)`.
|
|
4604
|
+
*
|
|
4605
|
+
* @param name - the package name to test.
|
|
4606
|
+
*/
|
|
4607
|
+
isExcluded(name: string): boolean;
|
|
4608
|
+
/**
|
|
4609
|
+
* Filter a package's candidate versions to those old enough to pass the
|
|
4610
|
+
* gate, given each version's publish timestamp and a caller-supplied `now`.
|
|
4611
|
+
*
|
|
4612
|
+
* A version is kept when it has a parseable publish timestamp at or before
|
|
4613
|
+
* the cutoff (`now - ageMinutes * 60000`). A version with a **missing or
|
|
4614
|
+
* unparseable** timestamp in `times` is **dropped** — matching pnpm's strict
|
|
4615
|
+
* posture: a version whose age cannot be established is treated as too young.
|
|
4616
|
+
* The clock is the caller's; this method reads no wall clock.
|
|
4617
|
+
*
|
|
4618
|
+
* Returns all versions unchanged (a no-op) when the gate is inert
|
|
4619
|
+
* (`ageMinutes <= 0`) or the package name is excluded.
|
|
4620
|
+
*
|
|
4621
|
+
* @param versions - the candidate version strings.
|
|
4622
|
+
* @param times - a map from version string to its ISO-8601 publish date.
|
|
4623
|
+
* @param name - the package name (checked against the gate's `exclude` list).
|
|
4624
|
+
* @param now - the current time in epoch milliseconds (the caller's clock).
|
|
4625
|
+
*/
|
|
4626
|
+
filterVersions(versions: readonly string[], times: Readonly<Record<string, string>>, name: string, now: number): readonly string[];
|
|
4627
|
+
}
|
|
4628
|
+
//#endregion
|
|
4629
|
+
//#region ../../node_modules/.pnpm/@effected+glob@0.2.0_effect@4.0.0-beta.99/node_modules/@effected/glob/index.d.ts
|
|
4367
4630
|
//#region src/GlobPattern.d.ts
|
|
4368
4631
|
declare const GlobPatternError_base: Schema.Class<GlobPatternError, Schema.TaggedStruct<"GlobPatternError", {
|
|
4369
4632
|
readonly pattern: Schema.String;
|
|
@@ -4436,15 +4699,40 @@ declare const GlobPattern_base: Schema.Class<GlobPattern, Schema.Struct<{
|
|
|
4436
4699
|
declare class GlobPattern extends GlobPattern_base {
|
|
4437
4700
|
#private;
|
|
4438
4701
|
/**
|
|
4439
|
-
* Compile a pattern under the given options — the package's
|
|
4440
|
-
* boundary
|
|
4441
|
-
*
|
|
4442
|
-
*
|
|
4702
|
+
* Compile a pattern under the given options, synchronously — the package's
|
|
4703
|
+
* fallible boundary in its primitive form. Compilation is pure
|
|
4704
|
+
* string→predicate work with no IO, no services and no async step, so the
|
|
4705
|
+
* sync form is the real primitive and {@link GlobPattern.compile} is
|
|
4706
|
+
* derived from it.
|
|
4707
|
+
*
|
|
4708
|
+
* Total: never throws for pattern input. Guard trips (over-length,
|
|
4709
|
+
* expansion budget, nesting depth) come back as a `Result` failure holding
|
|
4710
|
+
* {@link GlobPatternError}; invalid *options* never reach here (they throw
|
|
4711
|
+
* at `GlobPatternOptions.make`, a wiring defect).
|
|
4443
4712
|
*
|
|
4444
4713
|
* The pattern must also compile under DEFAULT options, whatever the
|
|
4445
4714
|
* effective options are — permissive options (say `nobrace` over a brace
|
|
4446
4715
|
* bomb) do not admit a defaults-rejected pattern; the same typed error
|
|
4447
4716
|
* surfaces instead.
|
|
4717
|
+
*
|
|
4718
|
+
* @remarks
|
|
4719
|
+
* For synchronous call sites that cannot host an Effect — a lint-staged
|
|
4720
|
+
* handler, a config predicate — this removes the
|
|
4721
|
+
* `Effect.runSync(Effect.result(...))` escape hatch: pair it with
|
|
4722
|
+
* `Result.isSuccess` and read `.success` directly. Effect call sites should
|
|
4723
|
+
* prefer {@link GlobPattern.compile}, which carries the tracing span.
|
|
4724
|
+
*/
|
|
4725
|
+
static compileResult(source: string, options?: GlobPatternOptions): Result.Result<GlobPattern, GlobPatternError>;
|
|
4726
|
+
/**
|
|
4727
|
+
* Compile a pattern under the given options — the package's fallible
|
|
4728
|
+
* boundary, and the form Effect call sites should reach for. Guard trips
|
|
4729
|
+
* (over-length, expansion budget, nesting depth) fail typed with
|
|
4730
|
+
* {@link GlobPatternError}; invalid options never reach here (they throw at
|
|
4731
|
+
* `GlobPatternOptions.make`, a wiring defect).
|
|
4732
|
+
*
|
|
4733
|
+
* Defined in terms of {@link GlobPattern.compileResult} — synchronous
|
|
4734
|
+
* callers can use that variant directly. Same semantics, same errors; this
|
|
4735
|
+
* form adds only the `GlobPattern.compile` tracing span.
|
|
4448
4736
|
*/
|
|
4449
4737
|
static readonly compile: (source: string, options?: GlobPatternOptions | undefined) => Effect.Effect<GlobPattern, GlobPatternError, never>;
|
|
4450
4738
|
/**
|
|
@@ -4503,7 +4791,7 @@ declare class GlobPattern extends GlobPattern_base {
|
|
|
4503
4791
|
static readonly FromString: Schema.Codec<GlobPattern, string>;
|
|
4504
4792
|
}
|
|
4505
4793
|
//#endregion
|
|
4506
|
-
//#region ../../node_modules/.pnpm/@effected+lockfiles@0.1.
|
|
4794
|
+
//#region ../../node_modules/.pnpm/@effected+lockfiles@0.1.9_@effected+jsonc@0.5.0_effect@4.0.0-beta.99__@effected+npm@0.3_d470055e7ca4b6a23d413cae592e2835/node_modules/@effected/lockfiles/index.d.ts
|
|
4507
4795
|
//#region src/BunExtension.d.ts
|
|
4508
4796
|
declare const BunExtension_base: Schema.Class<BunExtension, Schema.Struct<{
|
|
4509
4797
|
readonly _tag: Schema.tag<"bun">;
|
|
@@ -4923,7 +5211,7 @@ declare class LockfileIntegrity extends LockfileIntegrity_base {
|
|
|
4923
5211
|
static compare(lockfile: Lockfile, manifests: ReadonlyArray<WorkspaceManifest>): LockfileIntegrity;
|
|
4924
5212
|
}
|
|
4925
5213
|
//#endregion
|
|
4926
|
-
//#region ../../node_modules/.pnpm/@effected+package-json@0.
|
|
5214
|
+
//#region ../../node_modules/.pnpm/@effected+package-json@0.4.2_effect@4.0.0-beta.99/node_modules/@effected/package-json/index.d.ts
|
|
4927
5215
|
//#region src/Dependency.d.ts
|
|
4928
5216
|
declare const Dependency_base: Schema.Class<Dependency, Schema.Struct<{
|
|
4929
5217
|
/** The package name. */
|
|
@@ -5056,23 +5344,60 @@ declare const Person_base: Schema.Class<Person, Schema.Struct<{
|
|
|
5056
5344
|
readonly email: Schema.optionalKey<Schema.String>;
|
|
5057
5345
|
/** The optional homepage URL. */
|
|
5058
5346
|
readonly url: Schema.optionalKey<Schema.String>;
|
|
5347
|
+
/** Any additional keys, preserved verbatim and flattened back on encode. */
|
|
5348
|
+
readonly rest: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Unknown>>;
|
|
5059
5349
|
}>, {}>;
|
|
5060
5350
|
/**
|
|
5061
|
-
* A structured person object with `name
|
|
5351
|
+
* A structured person object with `name`, optional `email` / `url`, and a
|
|
5352
|
+
* `rest` catch-all preserving any additional keys across a read/write cycle.
|
|
5062
5353
|
*
|
|
5063
5354
|
* @public
|
|
5064
5355
|
*/
|
|
5065
5356
|
declare class Person extends Person_base {
|
|
5357
|
+
/**
|
|
5358
|
+
* The object wire codec: an open JSON object ↔ a {@link Person}, partitioning
|
|
5359
|
+
* unknown keys into `rest` and flattening them back on encode so the on-disk
|
|
5360
|
+
* shape never carries a literal `rest` key.
|
|
5361
|
+
*/
|
|
5362
|
+
static readonly schema: Schema.Codec<Person, {
|
|
5363
|
+
readonly [k: string]: unknown;
|
|
5364
|
+
}>;
|
|
5066
5365
|
/**
|
|
5067
5366
|
* Schema transformation between the `"Name <email> (url)"` shorthand string
|
|
5068
|
-
* and a {@link Person}.
|
|
5367
|
+
* and a {@link Person}. Decoding remembers the input text so that encoding
|
|
5368
|
+
* reproduces it verbatim; see {@link Person.wireStringOf}.
|
|
5069
5369
|
*/
|
|
5070
5370
|
static readonly FromString: Schema.Codec<Person, string>;
|
|
5071
5371
|
/**
|
|
5072
5372
|
* The `author` / `contributors` value: either the shorthand string or the
|
|
5073
5373
|
* structured object, always decoded to a {@link Person}.
|
|
5374
|
+
*
|
|
5375
|
+
* The wire form is preserved across a round trip — a person read from the
|
|
5376
|
+
* shorthand string encodes back to that string, byte for byte, and one read
|
|
5377
|
+
* from an object encodes back to an object with its unknown keys intact.
|
|
5378
|
+
* Formatting a manifest therefore never rewrites one legal encoding into the
|
|
5379
|
+
* other.
|
|
5380
|
+
*
|
|
5381
|
+
* Provenance belongs to the instance, so a person that is *rebuilt* (rather
|
|
5382
|
+
* than carried through unchanged) has none and encodes in the canonical
|
|
5383
|
+
* object form. Editing an unrelated field of the surrounding `Package`
|
|
5384
|
+
* carries the same person instance through and preserves its encoding.
|
|
5074
5385
|
*/
|
|
5075
|
-
static readonly FromValue: Schema.
|
|
5386
|
+
static readonly FromValue: Schema.Codec<Person, string | {
|
|
5387
|
+
readonly [k: string]: unknown;
|
|
5388
|
+
}>;
|
|
5389
|
+
/**
|
|
5390
|
+
* The shorthand text this person was decoded from, when it was decoded from
|
|
5391
|
+
* the string form and still matches its fields; `None` for a person built
|
|
5392
|
+
* from an object or by hand.
|
|
5393
|
+
*
|
|
5394
|
+
* Exposed so callers can tell which encoding a manifest used without
|
|
5395
|
+
* re-reading the file.
|
|
5396
|
+
*
|
|
5397
|
+
* @param person - the person to inspect
|
|
5398
|
+
* @returns the original shorthand text, or `None`
|
|
5399
|
+
*/
|
|
5400
|
+
static wireStringOf(person: Person): Option.Option<string>;
|
|
5076
5401
|
}
|
|
5077
5402
|
declare const PackageDecodeError_base: Schema.Class<PackageDecodeError, Schema.TaggedStruct<"PackageDecodeError", {
|
|
5078
5403
|
/** The underlying `SchemaError`, preserved structurally rather than stringified. */
|
|
@@ -5142,8 +5467,12 @@ declare const Package_base: Schema.Class<Package, Schema.Struct<{
|
|
|
5142
5467
|
readonly type: Schema.optionalKey<Schema.Literals<readonly ["module", "commonjs"]>>;
|
|
5143
5468
|
readonly main: Schema.optionalKey<Schema.String>;
|
|
5144
5469
|
readonly license: Schema.optionalKey<Schema.brand<Schema.String, "SpdxLicense">>;
|
|
5145
|
-
readonly author: Schema.optionalKey<Schema.
|
|
5146
|
-
|
|
5470
|
+
readonly author: Schema.optionalKey<Schema.Codec<Person, string | {
|
|
5471
|
+
readonly [k: string]: unknown;
|
|
5472
|
+
}, never, never>>;
|
|
5473
|
+
readonly contributors: Schema.optionalKey<Schema.$Array<Schema.Codec<Person, string | {
|
|
5474
|
+
readonly [k: string]: unknown;
|
|
5475
|
+
}, never, never>>>;
|
|
5147
5476
|
readonly repository: Schema.optionalKey<Schema.Union<readonly [Schema.String, Schema.$Record<Schema.String, Schema.Unknown>]>>;
|
|
5148
5477
|
readonly dependencies: Schema.decodeTo<Schema.HashMap<Schema.String, Schema.String>, Schema.withDecodingDefaultKey<Schema.$Record<Schema.String, Schema.String>, never>, never, never>;
|
|
5149
5478
|
readonly devDependencies: Schema.decodeTo<Schema.HashMap<Schema.String, Schema.String>, Schema.withDecodingDefaultKey<Schema.$Record<Schema.String, Schema.String>, never>, never, never>;
|
|
@@ -5330,7 +5659,7 @@ declare class Package extends Package_base {
|
|
|
5330
5659
|
toJsonString(options?: PackageFormatOptions): string;
|
|
5331
5660
|
}
|
|
5332
5661
|
//#endregion
|
|
5333
|
-
//#region ../../node_modules/.pnpm/@effected+workspaces@0.
|
|
5662
|
+
//#region ../../node_modules/.pnpm/@effected+workspaces@0.6.0_@effected+jsonc@0.5.0_effect@4.0.0-beta.99__effect@4.0.0-beta.99/node_modules/@effected/workspaces/index.d.ts
|
|
5334
5663
|
//#region src/WorkspacePackage.d.ts
|
|
5335
5664
|
declare const PublishConfig_base: Schema.Class<PublishConfig, Schema.Struct<{
|
|
5336
5665
|
/** Scoped-package visibility. Its presence overrides `private`. */
|
|
@@ -5416,6 +5745,21 @@ declare const WorkspacePackage_base: Schema.Class<WorkspacePackage, Schema.Struc
|
|
|
5416
5745
|
readonly packageJsonPath: Schema.NonEmptyString;
|
|
5417
5746
|
/** POSIX path relative to the workspace root; `"."` for the root package. */
|
|
5418
5747
|
readonly relativePath: Schema.String;
|
|
5748
|
+
/**
|
|
5749
|
+
* Absolute path to the workspace root this package was discovered under.
|
|
5750
|
+
*
|
|
5751
|
+
* @remarks
|
|
5752
|
+
* Carried, not derived. Whoever built this value already knew the root —
|
|
5753
|
+
* `WorkspaceDiscovery` resolved it before enumerating, and the sync entry
|
|
5754
|
+
* point is handed it — so dropping it forced every consumer into per-package
|
|
5755
|
+
* root arithmetic (counting `relativePath` segments and re-ascending that
|
|
5756
|
+
* many `..`). That reconstruction is exact only while `path` and
|
|
5757
|
+
* `relativePath` agree, and it re-derives something the kit never had to
|
|
5758
|
+
* lose.
|
|
5759
|
+
*
|
|
5760
|
+
* For the root package this equals `path`, and `relativePath` is `"."`.
|
|
5761
|
+
*/
|
|
5762
|
+
readonly workspaceRoot: Schema.NonEmptyString;
|
|
5419
5763
|
/** Whether the package is marked private. */
|
|
5420
5764
|
readonly private: Schema.withConstructorDefault<Schema.withDecodingDefaultKey<Schema.Boolean, never>>;
|
|
5421
5765
|
/** Production dependencies. */
|
|
@@ -5461,10 +5805,12 @@ declare const WorkspacePackage_base: Schema.Class<WorkspacePackage, Schema.Struc
|
|
|
5461
5805
|
* path: "/repo/packages/utils",
|
|
5462
5806
|
* packageJsonPath: "/repo/packages/utils/package.json",
|
|
5463
5807
|
* relativePath: "packages/utils",
|
|
5808
|
+
* workspaceRoot: "/repo",
|
|
5464
5809
|
* });
|
|
5465
5810
|
*
|
|
5466
5811
|
* pkg.isRootWorkspace; // false
|
|
5467
5812
|
* pkg.unscopedName; // "utils"
|
|
5813
|
+
* pkg.workspaceRoot; // "/repo"
|
|
5468
5814
|
* ```
|
|
5469
5815
|
*
|
|
5470
5816
|
* @public
|
|
@@ -5530,11 +5876,53 @@ declare class WorkspacePackage extends WorkspacePackage_base {
|
|
|
5530
5876
|
/** Instance form of `WorkspacePackage.manifest`. */
|
|
5531
5877
|
manifest(): Effect.Effect<Package, WorkspaceManifestError, FileSystem.FileSystem>;
|
|
5532
5878
|
}
|
|
5879
|
+
/**
|
|
5880
|
+
* Options for {@link WorkspaceRoot}'s `find`.
|
|
5881
|
+
*
|
|
5882
|
+
* @remarks
|
|
5883
|
+
* Both bounds are passed straight through to `@effected/walker`'s
|
|
5884
|
+
* `Walker.ascend`; this package does not re-decide either.
|
|
5885
|
+
*
|
|
5886
|
+
* @public
|
|
5887
|
+
*/
|
|
5888
|
+
interface FindWorkspaceRootOptions {
|
|
5889
|
+
/**
|
|
5890
|
+
* A ceiling directory. The ascent stops after probing it, so an unmarked
|
|
5891
|
+
* `stopAt` fails typed as {@link WorkspaceRootNotFoundError} rather than
|
|
5892
|
+
* silently escaping into an enclosing repository.
|
|
5893
|
+
*
|
|
5894
|
+
* @remarks
|
|
5895
|
+
* Resolved to an absolute path before comparison, exactly as `cwd` is — a
|
|
5896
|
+
* relative or non-normalized ceiling that never string-matched an ancestor
|
|
5897
|
+
* would reintroduce the unbounded ascent it was passed to prevent.
|
|
5898
|
+
*/
|
|
5899
|
+
readonly stopAt?: string;
|
|
5900
|
+
/**
|
|
5901
|
+
* Hard cap on the number of directories probed.
|
|
5902
|
+
*
|
|
5903
|
+
* @remarks
|
|
5904
|
+
* A non-integer or non-positive value is a **defect**, not a typed failure —
|
|
5905
|
+
* it is developer wiring, and walker's guard raises it.
|
|
5906
|
+
*
|
|
5907
|
+
* @defaultValue 256
|
|
5908
|
+
*/
|
|
5909
|
+
readonly maxDepth?: number;
|
|
5910
|
+
}
|
|
5533
5911
|
declare const WorkspaceRootNotFoundError_base: Schema.Class<WorkspaceRootNotFoundError, Schema.TaggedStruct<"WorkspaceRootNotFoundError", {
|
|
5534
5912
|
/** The directory the ascent started from. */
|
|
5535
5913
|
readonly searchPath: Schema.String;
|
|
5536
5914
|
/** The marker filenames probed at each ancestor. */
|
|
5537
5915
|
readonly markers: Schema.$Array<Schema.String>;
|
|
5916
|
+
/**
|
|
5917
|
+
* The resolved ceiling the ascent was bounded by, when one was supplied.
|
|
5918
|
+
*
|
|
5919
|
+
* @remarks
|
|
5920
|
+
* Absent means the ascent ran to the filesystem root. Its presence is what
|
|
5921
|
+
* lets a caller tell "there is no workspace root anywhere above me" from
|
|
5922
|
+
* "there is none below the ceiling I set" — two failures that otherwise
|
|
5923
|
+
* render identically.
|
|
5924
|
+
*/
|
|
5925
|
+
readonly stopAt: Schema.optionalKey<Schema.String>;
|
|
5538
5926
|
}>, import("effect/Cause").YieldableError>;
|
|
5539
5927
|
/**
|
|
5540
5928
|
* Raised when no workspace root can be found by ascending from a directory.
|
|
@@ -5546,18 +5934,32 @@ declare const WorkspaceRootNotFoundError_base: Schema.Class<WorkspaceRootNotFoun
|
|
|
5546
5934
|
* @public
|
|
5547
5935
|
*/
|
|
5548
5936
|
declare class WorkspaceRootNotFoundError extends WorkspaceRootNotFoundError_base {
|
|
5549
|
-
/** Renders the search path
|
|
5937
|
+
/** Renders the search path, probed markers and any ceiling into a one-line message. */
|
|
5550
5938
|
get message(): string;
|
|
5551
5939
|
}
|
|
5552
|
-
|
|
5940
|
+
/**
|
|
5941
|
+
* The {@link WorkspaceRoot} service contract.
|
|
5942
|
+
*
|
|
5943
|
+
* @remarks
|
|
5944
|
+
* Named so a consumer can type its own double — or a `Layer.succeed` — against
|
|
5945
|
+
* the contract rather than re-deriving it, exactly as `WorkspaceDiscoveryShape`
|
|
5946
|
+
* does. Prefer {@link WorkspaceRoot.layerTest} to hand-rolling one.
|
|
5947
|
+
*
|
|
5948
|
+
* @public
|
|
5949
|
+
*/
|
|
5950
|
+
interface WorkspaceRootShape {
|
|
5553
5951
|
/**
|
|
5554
5952
|
* The nearest workspace root at or above `cwd`.
|
|
5555
5953
|
*
|
|
5556
5954
|
* @param cwd - The directory to start the ascent from; resolved to an
|
|
5557
5955
|
* absolute path first.
|
|
5956
|
+
* @param options - Optional ascent bounds. Unbounded by default, which
|
|
5957
|
+
* walks to the filesystem root and can therefore resolve to an enclosing
|
|
5958
|
+
* repository's root; pass `stopAt` when the caller knows the ceiling.
|
|
5558
5959
|
*/
|
|
5559
|
-
readonly find: (cwd: string) => Effect.Effect<string, WorkspaceRootNotFoundError>;
|
|
5560
|
-
}
|
|
5960
|
+
readonly find: (cwd: string, options?: FindWorkspaceRootOptions) => Effect.Effect<string, WorkspaceRootNotFoundError>;
|
|
5961
|
+
}
|
|
5962
|
+
declare const WorkspaceRoot_base: Context.ServiceClass<WorkspaceRoot, "@effected/workspaces/WorkspaceRoot", WorkspaceRootShape>;
|
|
5561
5963
|
/**
|
|
5562
5964
|
* Locates the workspace root by ascending from a starting directory.
|
|
5563
5965
|
*
|
|
@@ -5572,15 +5974,86 @@ declare const WorkspaceRoot_base: Context.ServiceClass<WorkspaceRoot, "@effected
|
|
|
5572
5974
|
* });
|
|
5573
5975
|
* ```
|
|
5574
5976
|
*
|
|
5977
|
+
* @example
|
|
5978
|
+
* Bounded: an unmarked fixture directory fails typed instead of escaping into
|
|
5979
|
+
* the enclosing repository.
|
|
5980
|
+
*
|
|
5981
|
+
* ```ts
|
|
5982
|
+
* import { WorkspaceRoot } from "@effected/workspaces";
|
|
5983
|
+
* import { Effect } from "effect";
|
|
5984
|
+
*
|
|
5985
|
+
* const program = Effect.gen(function* () {
|
|
5986
|
+
* const roots = yield* WorkspaceRoot;
|
|
5987
|
+
* return yield* roots.find("/tmp/fixture/packages/a", { stopAt: "/tmp/fixture" });
|
|
5988
|
+
* });
|
|
5989
|
+
* ```
|
|
5990
|
+
*
|
|
5575
5991
|
* @public
|
|
5576
5992
|
*/
|
|
5577
5993
|
declare class WorkspaceRoot extends WorkspaceRoot_base {
|
|
5578
5994
|
/** Builds the service over core `FileSystem` and `Path`. */
|
|
5579
|
-
static readonly make: Effect.Effect<
|
|
5580
|
-
readonly find: (cwd: string) => Effect.Effect<string, WorkspaceRootNotFoundError>;
|
|
5581
|
-
}, never, FileSystem.FileSystem | Path.Path>;
|
|
5995
|
+
static readonly make: Effect.Effect<WorkspaceRootShape, never, FileSystem.FileSystem | Path.Path>;
|
|
5582
5996
|
/** The live layer. */
|
|
5583
5997
|
static readonly layer: Layer.Layer<WorkspaceRoot, never, FileSystem.FileSystem | Path.Path>;
|
|
5998
|
+
/**
|
|
5999
|
+
* A test double resolving every `find` to `root`, with no filesystem.
|
|
6000
|
+
*
|
|
6001
|
+
* @remarks
|
|
6002
|
+
* The nine-copies-of-a-four-line-mock case — a `Layer.succeed` over a `find`
|
|
6003
|
+
* that ignores its arguments and succeeds with a fixed root is what consumers
|
|
6004
|
+
* were writing by hand. The difference is that this double **honours
|
|
6005
|
+
* `stopAt`**: a hand-rolled `find` that ignores the ceiling makes a bounded
|
|
6006
|
+
* call pass under test and fail against the live service, which is the
|
|
6007
|
+
* failure mode the option exists to catch. A `root` above the ceiling fails
|
|
6008
|
+
* here exactly as it would live, with the same
|
|
6009
|
+
* {@link WorkspaceRootNotFoundError}.
|
|
6010
|
+
*
|
|
6011
|
+
* The ceiling is `path.resolve`d through the injected `Path` service before
|
|
6012
|
+
* the comparison, exactly as the live `make` path does — so a `stopAt`
|
|
6013
|
+
* carrying `..` segments bounds the double identically to the live service,
|
|
6014
|
+
* not by raw string. This is why `makeTest` yields an `Effect` requiring
|
|
6015
|
+
* `Path`: it captures the service once at construction, the same shape as
|
|
6016
|
+
* `make`. Consumers reach for {@link WorkspaceRoot.layerTest}, which provides
|
|
6017
|
+
* `Path.layer` internally, so the requirement never surfaces at their call
|
|
6018
|
+
* site.
|
|
6019
|
+
*
|
|
6020
|
+
* `maxDepth` is deliberately NOT modelled: the double does not walk, so it has
|
|
6021
|
+
* no depth to cap, and pretending otherwise would encode a fiction. A suite
|
|
6022
|
+
* exercising the depth guard wants the live service over a fixture tree.
|
|
6023
|
+
*
|
|
6024
|
+
* @param root - The root every unbounded `find` resolves to.
|
|
6025
|
+
*/
|
|
6026
|
+
static readonly makeTest: (root: string) => Effect.Effect<WorkspaceRootShape, never, Path.Path>;
|
|
6027
|
+
/**
|
|
6028
|
+
* The test layer: {@link WorkspaceRoot.makeTest} with `Path.layer` provided.
|
|
6029
|
+
*
|
|
6030
|
+
* @remarks
|
|
6031
|
+
* `makeTest` requires `Path` to normalize the `stopAt` ceiling; this layer
|
|
6032
|
+
* supplies core's `Path.layer` internally, so the requirement never reaches a
|
|
6033
|
+
* consumer — the published type stays `Layer.Layer<WorkspaceRoot>`.
|
|
6034
|
+
*
|
|
6035
|
+
* A parameterized layer factory mints a **fresh reference per call**, and
|
|
6036
|
+
* layers memoize by reference — bind the result to a `const` and reuse it
|
|
6037
|
+
* rather than calling `layerTest(...)` at each composition site.
|
|
6038
|
+
*
|
|
6039
|
+
* Pair it with `WorkspaceDiscovery.layerTest` to stand up the whole discovery
|
|
6040
|
+
* path without a filesystem; between them there is nothing left for a
|
|
6041
|
+
* module-level mock of `@effected/workspaces` to do, and a provided layer
|
|
6042
|
+
* keeps the service graph — and its typed errors — intact.
|
|
6043
|
+
*
|
|
6044
|
+
* @example
|
|
6045
|
+
* ```ts
|
|
6046
|
+
* import { WorkspaceDiscovery, WorkspaceRoot } from "@effected/workspaces";
|
|
6047
|
+
* import { Effect } from "effect";
|
|
6048
|
+
*
|
|
6049
|
+
* const TestRoot = WorkspaceRoot.layerTest("/repo");
|
|
6050
|
+
* const TestDiscovery = WorkspaceDiscovery.layerTest({
|
|
6051
|
+
* listPackages: () => Effect.succeed([]),
|
|
6052
|
+
* });
|
|
6053
|
+
* // program.pipe(Effect.provide(TestRoot), Effect.provide(TestDiscovery))
|
|
6054
|
+
* ```
|
|
6055
|
+
*/
|
|
6056
|
+
static readonly layerTest: (root: string) => Layer.Layer<WorkspaceRoot>;
|
|
5584
6057
|
}
|
|
5585
6058
|
//#endregion
|
|
5586
6059
|
//#region src/WorkspaceDiscovery.d.ts
|
|
@@ -5796,6 +6269,7 @@ declare class WorkspaceDiscovery extends WorkspaceDiscovery_base {
|
|
|
5796
6269
|
* path: "/repo/packages/utils",
|
|
5797
6270
|
* packageJsonPath: "/repo/packages/utils/package.json",
|
|
5798
6271
|
* relativePath: "packages/utils",
|
|
6272
|
+
* workspaceRoot: "/repo",
|
|
5799
6273
|
* }),
|
|
5800
6274
|
* ]),
|
|
5801
6275
|
* });
|
|
@@ -5850,22 +6324,56 @@ declare class WorkspaceDiscovery extends WorkspaceDiscovery_base {
|
|
|
5850
6324
|
}
|
|
5851
6325
|
//#endregion
|
|
5852
6326
|
//#region src/ConfigDependencyHooks.d.ts
|
|
6327
|
+
/**
|
|
6328
|
+
* The result of replaying a workspace's `configDependencies` hooks: the catalogs
|
|
6329
|
+
* the hooks yield, and the release-age gate contribution they leave on the
|
|
6330
|
+
* config (pnpm's `minimumReleaseAge` / `minimumReleaseAgeExclude`).
|
|
6331
|
+
*
|
|
6332
|
+
* @remarks
|
|
6333
|
+
* `releaseAge` is a `PartialReleaseAgeGate` — the age, the exclude list,
|
|
6334
|
+
* both, or neither, depending on what the replayed hooks set. It is deliberately
|
|
6335
|
+
* a *partial* contribution: a consumer folds it into an effective gate with
|
|
6336
|
+
* `ReleaseAgeGate.combine` alongside inline `pnpm-workspace.yaml` values. Hooks
|
|
6337
|
+
* that set no release-age keys contribute an empty gate (`{}`).
|
|
6338
|
+
*
|
|
6339
|
+
* @public
|
|
6340
|
+
*/
|
|
6341
|
+
interface HookInjection {
|
|
6342
|
+
/** The catalogs the replayed hooks yield, as `catalog name → dependency → range`. */
|
|
6343
|
+
readonly catalogs: Readonly<Record<string, Readonly<Record<string, string>>>>;
|
|
6344
|
+
/** The release-age gate contribution the replayed hooks leave on the config. */
|
|
6345
|
+
readonly releaseAge: PartialReleaseAgeGate;
|
|
6346
|
+
}
|
|
5853
6347
|
/**
|
|
5854
6348
|
* The {@link ConfigDependencyHooks} service shape.
|
|
5855
6349
|
*
|
|
5856
6350
|
* @remarks
|
|
5857
6351
|
* `inject` is given the workspace root, the manifest's `configDependencies`
|
|
5858
6352
|
* (name → version+integrity), and the inline-catalog seed as a plain
|
|
5859
|
-
* `catalog name → dependency name → range` record, and produces
|
|
5860
|
-
*
|
|
5861
|
-
*
|
|
6353
|
+
* `catalog name → dependency name → range` record, and produces a
|
|
6354
|
+
* {@link HookInjection}: the catalogs the replayed hooks yield **and** the
|
|
6355
|
+
* release-age gate contribution they leave on the config. The default (no-op)
|
|
6356
|
+
* implementation returns the seed catalogs unchanged, contributes an empty
|
|
6357
|
+
* release-age gate, and loads nothing.
|
|
5862
6358
|
*
|
|
5863
6359
|
* @public
|
|
5864
6360
|
*/
|
|
5865
6361
|
interface ConfigDependencyHooksShape {
|
|
5866
6362
|
/**
|
|
5867
6363
|
* Replay each config dependency's `updateConfig` hook over `seed`, in
|
|
5868
|
-
* declaration order, and return the resulting catalogs
|
|
6364
|
+
* declaration order, and return both the resulting catalogs and the
|
|
6365
|
+
* release-age gate contribution the hooks leave behind.
|
|
6366
|
+
*
|
|
6367
|
+
* @remarks
|
|
6368
|
+
* The hooks are replayed once over a single threaded config object, exactly
|
|
6369
|
+
* as pnpm does — so catalogs and the release-age keys
|
|
6370
|
+
* (`minimumReleaseAge` / `minimumReleaseAgeExclude`) are both read off that
|
|
6371
|
+
* one final object, and the config-dependency code executes only once. When
|
|
6372
|
+
* two hooks both set a release-age key the **later hook wins** (it rewrites
|
|
6373
|
+
* the threaded value); a hook that returns a malformed value for a key leaves
|
|
6374
|
+
* the prior threaded value in place (tolerant threading, matching the catalog
|
|
6375
|
+
* slice). A hook failing to load or replay fails typed with a
|
|
6376
|
+
* `hooks`-source `CatalogAssemblyError`, never a silent skip.
|
|
5869
6377
|
*
|
|
5870
6378
|
* @param root - The workspace root; config dependencies resolve under
|
|
5871
6379
|
* `<root>/node_modules/.pnpm-config/<name>`.
|
|
@@ -5873,7 +6381,7 @@ interface ConfigDependencyHooksShape {
|
|
|
5873
6381
|
* version+integrity) declared in `pnpm-workspace.yaml`.
|
|
5874
6382
|
* @param seed - The inline catalogs, as `catalog name → dependency → range`.
|
|
5875
6383
|
*/
|
|
5876
|
-
readonly inject: (root: string, configDependencies: Readonly<Record<string, string>>, seed: Readonly<Record<string, Readonly<Record<string, string>>>>) => Effect.Effect<
|
|
6384
|
+
readonly inject: (root: string, configDependencies: Readonly<Record<string, string>>, seed: Readonly<Record<string, Readonly<Record<string, string>>>>) => Effect.Effect<HookInjection, CatalogAssemblyError>;
|
|
5877
6385
|
}
|
|
5878
6386
|
declare const ConfigDependencyHooks_base: Context.ServiceClass<ConfigDependencyHooks, "@effected/workspaces/ConfigDependencyHooks", ConfigDependencyHooksShape>;
|
|
5879
6387
|
/**
|
|
@@ -5906,9 +6414,13 @@ declare class ConfigDependencyHooks extends ConfigDependencyHooks_base {
|
|
|
5906
6414
|
* `hooks`-source `CatalogAssemblyError`, never a silent skip.
|
|
5907
6415
|
*
|
|
5908
6416
|
* @remarks
|
|
5909
|
-
*
|
|
5910
|
-
*
|
|
5911
|
-
*
|
|
6417
|
+
* Runtime-coupled by design, not node-exclusive. The `import()` below loads
|
|
6418
|
+
* **and executes** a config dependency's pnpmfile in-process — code execution,
|
|
6419
|
+
* not IO, so no `FileSystem` / `Path` service abstracts it. The `node:path` and
|
|
6420
|
+
* `node:url` imports (`join`, `pathToFileURL`) exist only to build the URL that
|
|
6421
|
+
* `import()` consumes; node and bun both implement those builtins and dynamic
|
|
6422
|
+
* import, so this layer runs on either runtime. Only ever wired by
|
|
6423
|
+
* `WorkspaceCatalogs.layerWithConfigDependencies`.
|
|
5912
6424
|
*/
|
|
5913
6425
|
static readonly layerLive: Layer.Layer<ConfigDependencyHooks>;
|
|
5914
6426
|
}
|
|
@@ -6353,6 +6865,20 @@ interface WorkspaceCatalogsShape {
|
|
|
6353
6865
|
readonly set: () => Effect.Effect<CatalogSet, CatalogAssemblyFailure>;
|
|
6354
6866
|
/** Resolve one `catalog:` specifier; `Option.none()` when it names nothing. */
|
|
6355
6867
|
readonly resolveSpecifier: (dependency: string, specifier: string) => Effect.Effect<Option.Option<string>, CatalogAssemblyFailure>;
|
|
6868
|
+
/**
|
|
6869
|
+
* The effective pnpm release-age gate for the workspace, combined
|
|
6870
|
+
* strictest-wins from the inline `pnpm-workspace.yaml` keys
|
|
6871
|
+
* (`minimumReleaseAge` / `minimumReleaseAgeExclude`) and the replayed
|
|
6872
|
+
* config-dependency hooks. Assembled from the same single read and hook
|
|
6873
|
+
* replay as `set`, and memoized with it.
|
|
6874
|
+
*
|
|
6875
|
+
* @remarks
|
|
6876
|
+
* Under the default layer (no-op hooks) only inline values contribute; under
|
|
6877
|
+
* {@link WorkspaceCatalogs.layerWithConfigDependencies} the replayed hooks
|
|
6878
|
+
* contribute too. A workspace with no pnpm-workspace.yaml (a bun/npm
|
|
6879
|
+
* workspace) has no release-age keys, so the gate is the inert zero gate.
|
|
6880
|
+
*/
|
|
6881
|
+
readonly releaseAgeGate: () => Effect.Effect<ReleaseAgeGate, CatalogAssemblyFailure>;
|
|
6356
6882
|
}
|
|
6357
6883
|
/**
|
|
6358
6884
|
* Options for the {@link WorkspaceCatalogs} layer.
|
|
@@ -6669,7 +7195,7 @@ interface WorkspacesOptions {
|
|
|
6669
7195
|
readonly maxDepth?: number;
|
|
6670
7196
|
}
|
|
6671
7197
|
//#endregion
|
|
6672
|
-
//#region ../../node_modules/.pnpm/@effected+walker@0.
|
|
7198
|
+
//#region ../../node_modules/.pnpm/@effected+walker@0.3.1_@effected+glob@0.2.0_effect@4.0.0-beta.99__effect@4.0.0-beta.99/node_modules/@effected/walker/index.d.ts
|
|
6673
7199
|
declare const DescendError_base: Schema.Class<DescendError, Schema.TaggedStruct<"DescendError", {
|
|
6674
7200
|
/** The glob pattern's source text. */
|
|
6675
7201
|
readonly pattern: Schema.String;
|
|
@@ -6690,6 +7216,39 @@ declare const DescendError_base: Schema.Class<DescendError, Schema.TaggedStruct<
|
|
|
6690
7216
|
declare class DescendError extends DescendError_base {
|
|
6691
7217
|
get message(): string;
|
|
6692
7218
|
}
|
|
7219
|
+
declare const GlobExpansionError_base: Schema.Class<GlobExpansionError, Schema.TaggedStruct<"GlobExpansionError", {
|
|
7220
|
+
/** The glob pattern's source text, as handed to {@link compileAndExpand}. */
|
|
7221
|
+
readonly pattern: Schema.String;
|
|
7222
|
+
/** The underlying typed failure, intact: a compile guard trip or a descent failure. */
|
|
7223
|
+
readonly cause: Schema.Union<readonly [typeof GlobPatternError, typeof DescendError]>;
|
|
7224
|
+
}>, import("effect/Cause").YieldableError>;
|
|
7225
|
+
/**
|
|
7226
|
+
* Typed failure raised by {@link compileAndExpand}: the single error the
|
|
7227
|
+
* compile+expand recipe fails with, so a caller catches one tag rather than
|
|
7228
|
+
* folding two error channels by hand.
|
|
7229
|
+
*
|
|
7230
|
+
* @remarks
|
|
7231
|
+
* One tag, two genuinely different causes — "your pattern is malformed" and
|
|
7232
|
+
* "that directory is unreadable" are different problems with different fixes,
|
|
7233
|
+
* so `cause` keeps the underlying typed error intact
|
|
7234
|
+
* rather than flattening it into a string. Discriminate on `cause._tag`
|
|
7235
|
+
* (`"GlobPatternError"` vs `"DescendError"`), or read
|
|
7236
|
+
* {@link GlobExpansionError.stage} when only the phase matters; either way the
|
|
7237
|
+
* original payload — a guard's `limit`/`actual`, a descent's `path` — is still
|
|
7238
|
+
* there. `cause` is also the native `Error` cause, so error chaining and
|
|
7239
|
+
* stack-printing work without extra wiring.
|
|
7240
|
+
*
|
|
7241
|
+
* @public
|
|
7242
|
+
*/
|
|
7243
|
+
declare class GlobExpansionError extends GlobExpansionError_base {
|
|
7244
|
+
/**
|
|
7245
|
+
* Which phase failed — `"compile"` when the pattern itself was rejected,
|
|
7246
|
+
* `"descend"` when the filesystem walk failed. A convenience over
|
|
7247
|
+
* `cause._tag` for callers that only need the phase.
|
|
7248
|
+
*/
|
|
7249
|
+
get stage(): "compile" | "descend";
|
|
7250
|
+
get message(): string;
|
|
7251
|
+
}
|
|
6693
7252
|
//#endregion
|
|
6694
7253
|
//#region ../silk-effects/dist/dev/pkg/index.d.ts
|
|
6695
7254
|
//#endregion
|
|
@@ -11560,7 +12119,7 @@ declare class VersionFiles {
|
|
|
11560
12119
|
* @param cwd - Project root directory
|
|
11561
12120
|
* @returns Effect of `[filePath, config]` tuples
|
|
11562
12121
|
*/
|
|
11563
|
-
static resolveGlobs(configs: readonly LegacyVersionFileConfig[], cwd: string): Effect.Effect<Array<[string, LegacyVersionFileConfig]>,
|
|
12122
|
+
static resolveGlobs(configs: readonly LegacyVersionFileConfig[], cwd: string): Effect.Effect<Array<[string, LegacyVersionFileConfig]>, GlobExpansionError, FileSystem.FileSystem>;
|
|
11564
12123
|
/**
|
|
11565
12124
|
* Detect indentation from file content.
|
|
11566
12125
|
*
|
|
@@ -11662,7 +12221,7 @@ declare class VersionFiles {
|
|
|
11662
12221
|
name: string;
|
|
11663
12222
|
version: string;
|
|
11664
12223
|
path: string;
|
|
11665
|
-
}>): Effect.Effect<VersionFileUpdate[],
|
|
12224
|
+
}>): Effect.Effect<VersionFileUpdate[], GlobExpansionError, FileSystem.FileSystem>;
|
|
11666
12225
|
/**
|
|
11667
12226
|
* Apply version-file updates from the resolved (post-`ConfigInspector`)
|
|
11668
12227
|
* representation. Each {@link ResolvedPackageScope} already names the
|