@savvy-web/silk 3.2.1 → 3.2.3
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 +775 -128
- package/changesets-changelog.d.cts +329 -11
- package/changesets-changelog.d.ts +329 -11
- package/changesets-changelog.js +777 -129
- package/changesets-markdownlint.cjs +775 -128
- package/changesets-markdownlint.d.cts +329 -11
- package/changesets-markdownlint.d.ts +329 -11
- package/changesets-markdownlint.js +777 -129
- package/package.json +4 -4
- package/tsconfig/node/dist/tsconfig.tsbuildinfo +1 -1
|
@@ -3296,7 +3296,7 @@ type Label = Label$1;
|
|
|
3296
3296
|
type Severity = Severity$1;
|
|
3297
3297
|
type Plugin<Tree extends Node$3 = Node$3, Option extends unknown = unknown> = (config?: [level: Label | Severity | boolean, option?: Option] | Label | Option | Severity) => ((tree: Tree, file: VFile, next: TransformCallback<Tree>) => undefined) | undefined;
|
|
3298
3298
|
//#endregion
|
|
3299
|
-
//#region ../../node_modules/.pnpm/@effected+git@0.
|
|
3299
|
+
//#region ../../node_modules/.pnpm/@effected+git@0.5.0_effect@4.0.0-beta.101/node_modules/@effected/git/index.d.ts
|
|
3300
3300
|
//#region src/Git.d.ts
|
|
3301
3301
|
declare const GitCommandError_base: Schema.Class<GitCommandError, Schema.TaggedStruct<"GitCommandError", {
|
|
3302
3302
|
/**
|
|
@@ -3648,6 +3648,65 @@ declare const Git_base: Context.ServiceClass<Git, "@effected/git/Git", GitShape>
|
|
|
3648
3648
|
declare class Git extends Git_base {
|
|
3649
3649
|
/** Resolves `ChildProcessSpawner` once, at construction — every method's `R` is `never`. */
|
|
3650
3650
|
static readonly layer: Layer.Layer<Git, never, ChildProcessSpawner.ChildProcessSpawner>;
|
|
3651
|
+
/**
|
|
3652
|
+
* An in-memory test double of the service shape: stub only the methods the
|
|
3653
|
+
* test exercises, every other method **dies** with a defect naming itself.
|
|
3654
|
+
*
|
|
3655
|
+
* @remarks
|
|
3656
|
+
* Unlike `WorkspaceDiscovery.makeTest`, **no method here has an honest
|
|
3657
|
+
* default** — the shape is twenty-six unrelated git operations, and a
|
|
3658
|
+
* fabricated answer for any of them (an empty tree, a made-up sha, a silent
|
|
3659
|
+
* no-op `checkout`) would leak into consumer logic as fact. So every
|
|
3660
|
+
* unstubbed method fails loudly as a defect
|
|
3661
|
+
* (`Git.makeTest: <name>() was called but not stubbed`) rather than
|
|
3662
|
+
* succeeding with a lie or failing with a dishonest typed error — which is
|
|
3663
|
+
* also what makes the double a proof that a test touches *nothing but* the
|
|
3664
|
+
* methods it stubbed.
|
|
3665
|
+
*
|
|
3666
|
+
* The double deliberately models **none** of the live service's semantics:
|
|
3667
|
+
* no stderr classification, no option-injection guard (an option-like ref a
|
|
3668
|
+
* stub accepts would be refused live), no `LC_ALL=C` pinning, no timeout,
|
|
3669
|
+
* and no `./`-vs-bare path resolution on `show` — a stub answers exactly
|
|
3670
|
+
* what it is told and nothing else. A suite exercising any of those wants
|
|
3671
|
+
* `Git.layer` over a mocked `ChildProcessSpawner` (or real git) instead.
|
|
3672
|
+
*
|
|
3673
|
+
* @example
|
|
3674
|
+
* ```ts
|
|
3675
|
+
* import { Git } from "@effected/git";
|
|
3676
|
+
* import { Effect, Option } from "effect";
|
|
3677
|
+
*
|
|
3678
|
+
* const double = Git.makeTest({
|
|
3679
|
+
* show: (_cwd, _ref, path) =>
|
|
3680
|
+
* Effect.succeed(path === "./package.json" ? Option.some("{}") : Option.none()),
|
|
3681
|
+
* });
|
|
3682
|
+
* // `double.show(...)` answers; `double.status(...)` dies, named.
|
|
3683
|
+
* ```
|
|
3684
|
+
*/
|
|
3685
|
+
static readonly makeTest: (overrides?: Partial<GitShape>) => GitShape;
|
|
3686
|
+
/**
|
|
3687
|
+
* The test layer: {@link Git.makeTest} behind `Layer.succeed`, so a suite
|
|
3688
|
+
* provides only the methods it exercises.
|
|
3689
|
+
*
|
|
3690
|
+
* @remarks
|
|
3691
|
+
* A parameterized layer factory mints a **fresh reference per call**, and
|
|
3692
|
+
* layers memoize by reference — bind the result to a `const` and reuse it
|
|
3693
|
+
* rather than calling `layerTest(...)` at each composition site.
|
|
3694
|
+
*
|
|
3695
|
+
* @example
|
|
3696
|
+
* ```ts
|
|
3697
|
+
* import { Git, LsTreeEntry } from "@effected/git";
|
|
3698
|
+
* import { Effect } from "effect";
|
|
3699
|
+
*
|
|
3700
|
+
* const TestGit = Git.layerTest({
|
|
3701
|
+
* lsTree: () =>
|
|
3702
|
+
* Effect.succeed([
|
|
3703
|
+
* LsTreeEntry.make({ mode: "100644", type: "blob", oid: "0".repeat(40), path: "package.json" }),
|
|
3704
|
+
* ]),
|
|
3705
|
+
* });
|
|
3706
|
+
* // program.pipe(Effect.provide(TestGit))
|
|
3707
|
+
* ```
|
|
3708
|
+
*/
|
|
3709
|
+
static readonly layerTest: (overrides?: Partial<GitShape>) => Layer.Layer<Git>;
|
|
3651
3710
|
}
|
|
3652
3711
|
//#endregion
|
|
3653
3712
|
//#region ../../node_modules/.pnpm/@effected+semver@0.2.1_effect@4.0.0-beta.101/node_modules/@effected/semver/index.d.ts
|
|
@@ -4225,7 +4284,7 @@ declare class UnsatisfiableConstraintError extends UnsatisfiableConstraintError_
|
|
|
4225
4284
|
get message(): string;
|
|
4226
4285
|
}
|
|
4227
4286
|
//#endregion
|
|
4228
|
-
//#region ../../node_modules/.pnpm/@effected+npm@0.
|
|
4287
|
+
//#region ../../node_modules/.pnpm/@effected+npm@0.4.0_@effected+semver@0.2.1_effect@4.0.0-beta.101__effect@4.0.0-beta.101/node_modules/@effected/npm/index.d.ts
|
|
4229
4288
|
//#region src/CatalogAssemblyError.d.ts
|
|
4230
4289
|
declare const CatalogAssemblyError_base: Schema.Class<CatalogAssemblyError, Schema.TaggedStruct<"CatalogAssemblyError", {
|
|
4231
4290
|
/**
|
|
@@ -4567,7 +4626,9 @@ declare class ReleaseAgeGate extends ReleaseAgeGate_base {
|
|
|
4567
4626
|
* Combine partial contributions from multiple sources into one effective
|
|
4568
4627
|
* gate: **strictest age wins** (the maximum of the contributed ages,
|
|
4569
4628
|
* clamped to be non-negative) and the exclude sets **union** (deduplicated,
|
|
4570
|
-
*
|
|
4629
|
+
* lexicographically sorted — a canonical wire form, so the combined gate is
|
|
4630
|
+
* deterministic regardless of the order contributions arrive in). A
|
|
4631
|
+
* contribution's absent field adds nothing; a
|
|
4571
4632
|
* negative or non-finite contributed age is ignored by the clamp. With no
|
|
4572
4633
|
* contributions (or only empty ones) the result is the inert zero gate
|
|
4573
4634
|
* (`ageMinutes: 0`, `exclude: []`).
|
|
@@ -4791,7 +4852,7 @@ declare class GlobPattern extends GlobPattern_base {
|
|
|
4791
4852
|
static readonly FromString: Schema.Codec<GlobPattern, string>;
|
|
4792
4853
|
}
|
|
4793
4854
|
//#endregion
|
|
4794
|
-
//#region ../../node_modules/.pnpm/@effected+lockfiles@0.
|
|
4855
|
+
//#region ../../node_modules/.pnpm/@effected+lockfiles@0.2.0_@effected+jsonc@0.5.1_effect@4.0.0-beta.101__@effected+npm@0._bb7f362bdd42193e6ed4fc5154b217f4/node_modules/@effected/lockfiles/index.d.ts
|
|
4795
4856
|
//#region src/BunExtension.d.ts
|
|
4796
4857
|
declare const BunExtension_base: Schema.Class<BunExtension, Schema.Struct<{
|
|
4797
4858
|
readonly _tag: Schema.tag<"bun">;
|
|
@@ -4819,6 +4880,7 @@ declare const ImporterDependency_base: Schema.Class<ImporterDependency, Schema.S
|
|
|
4819
4880
|
readonly name: Schema.NonEmptyString;
|
|
4820
4881
|
readonly specifier: Schema.Codec<ClassifiedSpecifier, string, never, never>;
|
|
4821
4882
|
readonly version: Schema.optionalKey<Schema.String>;
|
|
4883
|
+
readonly peerSuffix: Schema.optionalKey<Schema.String>;
|
|
4822
4884
|
readonly depType: Schema.Literals<readonly ["dependencies", "devDependencies", "peerDependencies", "optionalDependencies"]>;
|
|
4823
4885
|
}>, {}>;
|
|
4824
4886
|
/**
|
|
@@ -4831,11 +4893,20 @@ declare const ImporterDependency_base: Schema.Class<ImporterDependency, Schema.S
|
|
|
4831
4893
|
* `ClassifiedSpecifier` (`catalog:` / `workspace:` / range / dist-tag / raw),
|
|
4832
4894
|
* while encoding round-trips the **exact original string byte-for-byte** — the
|
|
4833
4895
|
* guarantee a before/after lockfile diff relies on.
|
|
4834
|
-
* - `version` — the concrete resolved version, **populated by pnpm only
|
|
4835
|
-
* records `{ specifier, version }`
|
|
4836
|
-
*
|
|
4837
|
-
* `version` is
|
|
4838
|
-
* `
|
|
4896
|
+
* - `version` — the concrete resolved version, **populated by pnpm only**:
|
|
4897
|
+
* comparable across refs and printable. pnpm records `{ specifier, version }`
|
|
4898
|
+
* per importer dependency, and the parser splits pnpm's peer-disambiguation
|
|
4899
|
+
* suffix off into `peerSuffix`, so `version` is always the plain version — or
|
|
4900
|
+
* a non-registry resolution (`link:../utils`, `file:...`), passed through
|
|
4901
|
+
* verbatim. bun and npm record resolved versions on their package entries
|
|
4902
|
+
* instead, so for those formats `version` is absent and a consumer joins by
|
|
4903
|
+
* `name` against `Lockfile.packages`.
|
|
4904
|
+
* - `peerSuffix` — pnpm's peer-disambiguation context: the raw parenthesized
|
|
4905
|
+
* chain the lockfile recorded after the version, e.g.
|
|
4906
|
+
* `(effect@4.0.0-beta.101)(ioredis@5.11.1(supports-color@8.1.1))`. Present
|
|
4907
|
+
* only when the lockfile recorded one — never for suffix-free pnpm entries,
|
|
4908
|
+
* and never for the other formats, which do not record peer context per
|
|
4909
|
+
* importer dependency.
|
|
4839
4910
|
* - `depType` — which dependency map declared it, spelled with `@effected/npm`'s
|
|
4840
4911
|
* kit-wide `DependencyField` vocabulary.
|
|
4841
4912
|
*
|
|
@@ -5211,7 +5282,7 @@ declare class LockfileIntegrity extends LockfileIntegrity_base {
|
|
|
5211
5282
|
static compare(lockfile: Lockfile, manifests: ReadonlyArray<WorkspaceManifest>): LockfileIntegrity;
|
|
5212
5283
|
}
|
|
5213
5284
|
//#endregion
|
|
5214
|
-
//#region ../../node_modules/.pnpm/@effected+package-json@0.5.
|
|
5285
|
+
//#region ../../node_modules/.pnpm/@effected+package-json@0.5.2_effect@4.0.0-beta.101/node_modules/@effected/package-json/index.d.ts
|
|
5215
5286
|
//#region src/Dependency.d.ts
|
|
5216
5287
|
declare const Dependency_base: Schema.Class<Dependency, Schema.Struct<{
|
|
5217
5288
|
/** The package name. */
|
|
@@ -5659,7 +5730,7 @@ declare class Package extends Package_base {
|
|
|
5659
5730
|
toJsonString(options?: PackageFormatOptions): string;
|
|
5660
5731
|
}
|
|
5661
5732
|
//#endregion
|
|
5662
|
-
//#region ../../node_modules/.pnpm/@effected+workspaces@0.
|
|
5733
|
+
//#region ../../node_modules/.pnpm/@effected+workspaces@0.8.0_@effected+jsonc@0.5.1_effect@4.0.0-beta.101__effect@4.0.0-beta.101/node_modules/@effected/workspaces/index.d.ts
|
|
5663
5734
|
//#region src/WorkspacePackage.d.ts
|
|
5664
5735
|
declare const PublishConfig_base: Schema.Class<PublishConfig, Schema.Struct<{
|
|
5665
5736
|
/** Scoped-package visibility. Its presence overrides `private`. */
|
|
@@ -6636,6 +6707,65 @@ declare class LockfileReader extends LockfileReader_base {
|
|
|
6636
6707
|
* `const` and reuse it.
|
|
6637
6708
|
*/
|
|
6638
6709
|
static readonly layer: (options?: LockfileReaderOptions) => Layer.Layer<LockfileReader, never, WorkspaceRoot | PackageManagerDetector | WorkspaceDiscovery | FileSystem.FileSystem | Path.Path>;
|
|
6710
|
+
/**
|
|
6711
|
+
* A test double satisfying the full {@link LockfileReaderShape} with no
|
|
6712
|
+
* filesystem, root walk, or package-manager detection.
|
|
6713
|
+
*
|
|
6714
|
+
* @remarks
|
|
6715
|
+
* There is **no honest default lockfile**: an empty one that looks like a
|
|
6716
|
+
* legitimate answer is indistinguishable from "this workspace resolves
|
|
6717
|
+
* nothing" — the silent-empty failure class this package documents on the
|
|
6718
|
+
* live paths — so `read` **dies** with an instructive defect until stubbed.
|
|
6719
|
+
*
|
|
6720
|
+
* The one derivation mirrors `WorkspaceDiscovery.makeTest`'s
|
|
6721
|
+
* derived-from-the-primary rule: when a `read` override is supplied,
|
|
6722
|
+
* `resolvedVersion` answers as the live service does — the **first** entry
|
|
6723
|
+
* of `lockfile.packagesNamed(name)` in lockfile order, `Option.none()` on a
|
|
6724
|
+
* miss — so the two stay consistent by construction. `integrity` is **not**
|
|
6725
|
+
* derivable: the live method compares the lockfile against the workspace
|
|
6726
|
+
* manifests discovery enumerates, and the double has no discovery to ask, so
|
|
6727
|
+
* it dies unless stubbed.
|
|
6728
|
+
*
|
|
6729
|
+
* `refresh` defaults to `Effect.void` honestly: the live contract is "drop
|
|
6730
|
+
* the memoized read so the next call re-reads", and this double memoizes
|
|
6731
|
+
* nothing — every `read()` call re-invokes the override — so there is
|
|
6732
|
+
* nothing to drop and the no-op is truthful, the same reasoning as
|
|
6733
|
+
* `WorkspaceDiscovery.makeTest`'s `refresh`.
|
|
6734
|
+
*
|
|
6735
|
+
* @example
|
|
6736
|
+
* ```ts
|
|
6737
|
+
* import { Lockfile } from "@effected/lockfiles";
|
|
6738
|
+
* import { LockfileReader } from "@effected/workspaces";
|
|
6739
|
+
* import { Effect } from "effect";
|
|
6740
|
+
*
|
|
6741
|
+
* const double = LockfileReader.makeTest({
|
|
6742
|
+
* read: () =>
|
|
6743
|
+
* Effect.succeed(
|
|
6744
|
+
* Lockfile.make({ format: "pnpm", lockfileVersion: "9.0", packages: [], workspaceDependencies: [] }),
|
|
6745
|
+
* ),
|
|
6746
|
+
* });
|
|
6747
|
+
* // `resolvedVersion` now answers consistently from that lockfile.
|
|
6748
|
+
* ```
|
|
6749
|
+
*/
|
|
6750
|
+
static readonly makeTest: (overrides?: Partial<LockfileReaderShape>) => LockfileReaderShape;
|
|
6751
|
+
/**
|
|
6752
|
+
* The test layer: {@link LockfileReader.makeTest} behind `Layer.succeed`, so
|
|
6753
|
+
* a suite provides only the methods it exercises.
|
|
6754
|
+
*
|
|
6755
|
+
* @remarks
|
|
6756
|
+
* A parameterized layer factory mints a **fresh reference per call**, and
|
|
6757
|
+
* layers memoize by reference — bind the result to a `const` and reuse it
|
|
6758
|
+
* rather than calling `layerTest(...)` at each composition site.
|
|
6759
|
+
*
|
|
6760
|
+
* @example
|
|
6761
|
+
* ```ts
|
|
6762
|
+
* import { LockfileReader } from "@effected/workspaces";
|
|
6763
|
+
*
|
|
6764
|
+
* const TestLockfiles = LockfileReader.layerTest();
|
|
6765
|
+
* // program.pipe(Effect.provide(TestLockfiles)) — dies loudly if touched.
|
|
6766
|
+
* ```
|
|
6767
|
+
*/
|
|
6768
|
+
static readonly layerTest: (overrides?: Partial<LockfileReaderShape>) => Layer.Layer<LockfileReader>;
|
|
6639
6769
|
}
|
|
6640
6770
|
//#endregion
|
|
6641
6771
|
//#region src/Publishability.d.ts
|
|
@@ -6747,6 +6877,26 @@ declare class PublishabilityDetector extends PublishabilityDetector_base {
|
|
|
6747
6877
|
}
|
|
6748
6878
|
//#endregion
|
|
6749
6879
|
//#region src/WorkspaceCatalogs.d.ts
|
|
6880
|
+
/**
|
|
6881
|
+
* Each importer's dependency-name → resolved-version map, keyed by importer path
|
|
6882
|
+
* (`"."` for the root package — the same keys `WorkspaceDiscovery.importerMap()`
|
|
6883
|
+
* uses, and the same value `PackageStateSnapshot.relativePath` carries).
|
|
6884
|
+
*
|
|
6885
|
+
* @remarks
|
|
6886
|
+
* What a manager's lockfile records as actually installed, as opposed to what a
|
|
6887
|
+
* manifest declares. It answers a `catalog:` specifier no committed catalog
|
|
6888
|
+
* source declares — the shape a pnpm config-dependency pnpmfile hook produces —
|
|
6889
|
+
* which would otherwise resolve to nothing on both sides of a diff and hide a
|
|
6890
|
+
* real version movement.
|
|
6891
|
+
*
|
|
6892
|
+
* Versions are normalized: pnpm's peer-disambiguation suffix
|
|
6893
|
+
* (`1.2.3(effect@4.0.0)`) is stripped, and `link:` / `file:` entries are omitted
|
|
6894
|
+
* because a filesystem edge is not a version. Only pnpm records importer
|
|
6895
|
+
* versions; bun and npm yield an empty index.
|
|
6896
|
+
*
|
|
6897
|
+
* @public
|
|
6898
|
+
*/
|
|
6899
|
+
type ImporterVersions = Readonly<Record<string, Readonly<Record<string, string>>>>;
|
|
6750
6900
|
declare const CatalogSet_base: Schema.Class<CatalogSet, Schema.Struct<{
|
|
6751
6901
|
/** Catalog name → dependency name → version range. */
|
|
6752
6902
|
readonly entries: Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.String>>;
|
|
@@ -6879,6 +7029,19 @@ interface WorkspaceCatalogsShape {
|
|
|
6879
7029
|
* workspace) has no release-age keys, so the gate is the inert zero gate.
|
|
6880
7030
|
*/
|
|
6881
7031
|
readonly releaseAgeGate: () => Effect.Effect<ReleaseAgeGate, CatalogAssemblyFailure>;
|
|
7032
|
+
/**
|
|
7033
|
+
* Each importer's dependency-name → resolved-version map, as the manager's
|
|
7034
|
+
* lockfile records it. Read from the same single lockfile read as `set`, and
|
|
7035
|
+
* memoized with it.
|
|
7036
|
+
*
|
|
7037
|
+
* @remarks
|
|
7038
|
+
* Feeds `WorkspaceStateSnapshot`'s fallback for a `catalog:` specifier no
|
|
7039
|
+
* committed catalog source declares — the shape a config-dependency pnpmfile
|
|
7040
|
+
* hook produces. Only pnpm records importer versions; a bun or npm workspace
|
|
7041
|
+
* yields an empty index, and an absent or unreadable lockfile contributes
|
|
7042
|
+
* nothing rather than failing.
|
|
7043
|
+
*/
|
|
7044
|
+
readonly importerVersions: () => Effect.Effect<ImporterVersions, CatalogAssemblyFailure>;
|
|
6882
7045
|
}
|
|
6883
7046
|
/**
|
|
6884
7047
|
* Options for the {@link WorkspaceCatalogs} layer.
|
|
@@ -6944,6 +7107,61 @@ declare class WorkspaceCatalogs extends WorkspaceCatalogs_base {
|
|
|
6944
7107
|
* Parameterized, so bind it to a `const` and reuse it.
|
|
6945
7108
|
*/
|
|
6946
7109
|
static readonly layerWithConfigDependencies: (options?: WorkspaceCatalogsOptions) => Layer.Layer<WorkspaceCatalogs, never, WorkspaceRoot | LockfileReader | FileSystem.FileSystem | Path.Path>;
|
|
7110
|
+
/**
|
|
7111
|
+
* A test double satisfying the full {@link WorkspaceCatalogsShape} with no
|
|
7112
|
+
* filesystem, lockfile read, or hook replay.
|
|
7113
|
+
*
|
|
7114
|
+
* @remarks
|
|
7115
|
+
* There is **no honest default catalog set**: an empty `CatalogSet` that
|
|
7116
|
+
* looks like a legitimate answer is the "every dependency looks newly added"
|
|
7117
|
+
* failure class the live assembler hard-fails to prevent, so every method
|
|
7118
|
+
* **dies** with an instructive defect until stubbed — a test-wiring mistake
|
|
7119
|
+
* fails loudly as a defect rather than succeeding with a lie or failing with
|
|
7120
|
+
* a dishonest typed error.
|
|
7121
|
+
*
|
|
7122
|
+
* The one derivation mirrors `WorkspaceDiscovery.makeTest`'s
|
|
7123
|
+
* derived-from-the-primary rule: when a `set` override is supplied,
|
|
7124
|
+
* `resolveSpecifier` answers from that `CatalogSet`'s own
|
|
7125
|
+
* {@link CatalogSet.resolveSpecifier} — exactly what the live service runs
|
|
7126
|
+
* over its assembled set — so the two stay consistent by construction.
|
|
7127
|
+
* `releaseAgeGate` and `importerVersions` are **not** derivable from a
|
|
7128
|
+
* catalog set (the gate comes from release-age keys and hook contributions,
|
|
7129
|
+
* the importer index from the lockfile's importer blocks — neither is in a
|
|
7130
|
+
* `CatalogSet`) and always die unless stubbed.
|
|
7131
|
+
*
|
|
7132
|
+
* @example
|
|
7133
|
+
* ```ts
|
|
7134
|
+
* import { CatalogSet, WorkspaceCatalogs } from "@effected/workspaces";
|
|
7135
|
+
* import { Effect } from "effect";
|
|
7136
|
+
*
|
|
7137
|
+
* const double = WorkspaceCatalogs.makeTest({
|
|
7138
|
+
* set: () => Effect.succeed(CatalogSet.fromCatalogs({ default: { effect: "4.0.0" } })),
|
|
7139
|
+
* });
|
|
7140
|
+
* // `resolveSpecifier` now answers consistently from that set.
|
|
7141
|
+
* ```
|
|
7142
|
+
*/
|
|
7143
|
+
static readonly makeTest: (overrides?: Partial<WorkspaceCatalogsShape>) => WorkspaceCatalogsShape;
|
|
7144
|
+
/**
|
|
7145
|
+
* The test layer: {@link WorkspaceCatalogs.makeTest} behind `Layer.succeed`,
|
|
7146
|
+
* so a suite provides only the methods it exercises.
|
|
7147
|
+
*
|
|
7148
|
+
* @remarks
|
|
7149
|
+
* A parameterized layer factory mints a **fresh reference per call**, and
|
|
7150
|
+
* layers memoize by reference — bind the result to a `const` and reuse it
|
|
7151
|
+
* rather than calling `layerTest(...)` at each composition site.
|
|
7152
|
+
*
|
|
7153
|
+
* @example
|
|
7154
|
+
* ```ts
|
|
7155
|
+
* import { CatalogSet, WorkspaceCatalogs } from "@effected/workspaces";
|
|
7156
|
+
* import { Effect } from "effect";
|
|
7157
|
+
*
|
|
7158
|
+
* const TestCatalogs = WorkspaceCatalogs.layerTest({
|
|
7159
|
+
* set: () => Effect.succeed(CatalogSet.empty()),
|
|
7160
|
+
* });
|
|
7161
|
+
* // program.pipe(Effect.provide(TestCatalogs))
|
|
7162
|
+
* ```
|
|
7163
|
+
*/
|
|
7164
|
+
static readonly layerTest: (overrides?: Partial<WorkspaceCatalogsShape>) => Layer.Layer<WorkspaceCatalogs>;
|
|
6947
7165
|
/**
|
|
6948
7166
|
* The real implementation of `@effected/npm`'s `CatalogResolver` contract —
|
|
6949
7167
|
* the one `@effected/package-json` declares but cannot fill.
|
|
@@ -7007,6 +7225,18 @@ declare const WorkspaceStateSnapshot_base: Schema.Class<WorkspaceStateSnapshot,
|
|
|
7007
7225
|
readonly packages: Schema.$Array<typeof PackageStateSnapshot>;
|
|
7008
7226
|
/** The catalog set assembled at this moment. */
|
|
7009
7227
|
readonly catalogs: typeof CatalogSet;
|
|
7228
|
+
/**
|
|
7229
|
+
* Each importer's dependency-name → resolved-version map, as the manager's
|
|
7230
|
+
* lockfile recorded it at this moment.
|
|
7231
|
+
*
|
|
7232
|
+
* @remarks
|
|
7233
|
+
* Defaults to `{}`, so a `WorkspaceStateSnapshot` serialized before this field
|
|
7234
|
+
* existed still decodes — and an empty index simply makes the `catalog:`
|
|
7235
|
+
* fallback in {@link WorkspaceStateSnapshot.resolve} inert, which is exactly
|
|
7236
|
+
* the behavior those older values were captured under. Only pnpm records
|
|
7237
|
+
* importer versions; bun and npm yield an empty index.
|
|
7238
|
+
*/
|
|
7239
|
+
readonly importerVersions: Schema.optionalKey<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.String>>>;
|
|
7010
7240
|
}>, {}>;
|
|
7011
7241
|
/**
|
|
7012
7242
|
* The state of a whole workspace at one moment — its packages and its assembled
|
|
@@ -7056,11 +7286,43 @@ declare class WorkspaceStateSnapshot extends WorkspaceStateSnapshot_base {
|
|
|
7056
7286
|
* unparseable string — is `Option.none()`, because there is no indirection to
|
|
7057
7287
|
* resolve. Total.
|
|
7058
7288
|
*
|
|
7289
|
+
* A `catalog:` specifier the catalog set cannot resolve falls back to this
|
|
7290
|
+
* snapshot's `importerVersions` — but only to a version
|
|
7291
|
+
* **every** importer recording that dependency agrees on. A catalog injected
|
|
7292
|
+
* by a config-dependency pnpmfile hook appears in no committed catalog source,
|
|
7293
|
+
* so without this fallback both sides of a before/after diff resolve it to the
|
|
7294
|
+
* same raw string and a real version movement produces no row. When importers
|
|
7295
|
+
* disagree there is no single correct answer, so this stays `Option.none()`
|
|
7296
|
+
* rather than inventing one; {@link WorkspaceStateSnapshot.resolveIn} answers
|
|
7297
|
+
* precisely for callers that know which importer is asking.
|
|
7298
|
+
*
|
|
7059
7299
|
* @param dependency - The dependency's package name (what `workspace:` /
|
|
7060
7300
|
* `catalog:` resolve for).
|
|
7061
7301
|
* @param specifier - The raw specifier string.
|
|
7062
7302
|
*/
|
|
7063
7303
|
resolve(dependency: string, specifier: string): Option.Option<string>;
|
|
7304
|
+
/**
|
|
7305
|
+
* The concrete range or version a specifier resolved to AS OF this snapshot,
|
|
7306
|
+
* scoped to the importer that declared it.
|
|
7307
|
+
*
|
|
7308
|
+
* @remarks
|
|
7309
|
+
* Identical to {@link WorkspaceStateSnapshot.resolve} except in how an
|
|
7310
|
+
* unresolvable `catalog:` specifier falls back: this consults **only**
|
|
7311
|
+
* `importerPath`'s own recorded versions, so a monorepo whose packages hold
|
|
7312
|
+
* different versions of one dependency still gets an exact answer where
|
|
7313
|
+
* `resolve` must abstain. Prefer this whenever the caller knows the importer —
|
|
7314
|
+
* a consumer iterating `packages` has `relativePath` in hand, which is the
|
|
7315
|
+
* importer key (`"."` for the root package).
|
|
7316
|
+
*
|
|
7317
|
+
* An unknown `importerPath`, or one recording nothing for `dependency`, is
|
|
7318
|
+
* `Option.none()`. Total.
|
|
7319
|
+
*
|
|
7320
|
+
* @param importerPath - The importer's path relative to the workspace root,
|
|
7321
|
+
* `"."` for the root package — `PackageStateSnapshot.relativePath`.
|
|
7322
|
+
* @param dependency - The dependency's package name.
|
|
7323
|
+
* @param specifier - The raw specifier string.
|
|
7324
|
+
*/
|
|
7325
|
+
resolveIn(importerPath: string, dependency: string, specifier: string): Option.Option<string>;
|
|
7064
7326
|
/**
|
|
7065
7327
|
* A `CatalogResolver` layer implementing `@effected/npm`'s contract against
|
|
7066
7328
|
* THIS snapshot's catalog set — so code written to the contract resolves
|
|
@@ -7175,6 +7437,62 @@ declare class WorkspaceSnapshots extends WorkspaceSnapshots_base {
|
|
|
7175
7437
|
* `const` and reuse it, or layer memoization does not apply.
|
|
7176
7438
|
*/
|
|
7177
7439
|
static readonly layer: (options?: WorkspaceSnapshotsOptions) => Layer.Layer<WorkspaceSnapshots, never, Git | WorkspaceRoot | WorkspaceDiscovery | WorkspaceCatalogs>;
|
|
7440
|
+
/**
|
|
7441
|
+
* A test double satisfying the full {@link WorkspaceSnapshotsShape} with no
|
|
7442
|
+
* git, filesystem, discovery, or catalog assembly.
|
|
7443
|
+
*
|
|
7444
|
+
* @remarks
|
|
7445
|
+
* There are **no honest defaults and no derivations** here: `at(ref)` and
|
|
7446
|
+
* `worktree()` are two independent reads of two different sources (a git ref
|
|
7447
|
+
* vs. the live tree), so neither can be honestly derived from the other, and
|
|
7448
|
+
* a fabricated empty {@link WorkspaceStateSnapshot} on either side of a
|
|
7449
|
+
* before/after diff reads as every dependency newly added or removed — the
|
|
7450
|
+
* exact silent-empty failure class this package documents on the live paths.
|
|
7451
|
+
* Both methods therefore **die** with an instructive defect until stubbed; a
|
|
7452
|
+
* test-wiring mistake fails loudly as a defect rather than succeeding with a
|
|
7453
|
+
* lie.
|
|
7454
|
+
*
|
|
7455
|
+
* @example
|
|
7456
|
+
* ```ts
|
|
7457
|
+
* import { CatalogSet, WorkspaceSnapshots, WorkspaceStateSnapshot } from "@effected/workspaces";
|
|
7458
|
+
* import { Effect } from "effect";
|
|
7459
|
+
*
|
|
7460
|
+
* const empty = WorkspaceStateSnapshot.make({
|
|
7461
|
+
* packages: [],
|
|
7462
|
+
* catalogs: CatalogSet.empty(),
|
|
7463
|
+
* importerVersions: {},
|
|
7464
|
+
* });
|
|
7465
|
+
* const double = WorkspaceSnapshots.makeTest({
|
|
7466
|
+
* at: () => Effect.succeed(empty),
|
|
7467
|
+
* worktree: () => Effect.succeed(empty),
|
|
7468
|
+
* });
|
|
7469
|
+
* ```
|
|
7470
|
+
*/
|
|
7471
|
+
static readonly makeTest: (overrides?: Partial<WorkspaceSnapshotsShape>) => WorkspaceSnapshotsShape;
|
|
7472
|
+
/**
|
|
7473
|
+
* The test layer: {@link WorkspaceSnapshots.makeTest} behind `Layer.succeed`,
|
|
7474
|
+
* so a suite provides only the methods it exercises.
|
|
7475
|
+
*
|
|
7476
|
+
* @remarks
|
|
7477
|
+
* A parameterized layer factory mints a **fresh reference per call**, and
|
|
7478
|
+
* layers memoize by reference — bind the result to a `const` and reuse it
|
|
7479
|
+
* rather than calling `layerTest(...)` at each composition site.
|
|
7480
|
+
*
|
|
7481
|
+
* @example
|
|
7482
|
+
* ```ts
|
|
7483
|
+
* import { CatalogSet, WorkspaceSnapshots, WorkspaceStateSnapshot } from "@effected/workspaces";
|
|
7484
|
+
* import { Effect } from "effect";
|
|
7485
|
+
*
|
|
7486
|
+
* const TestSnapshots = WorkspaceSnapshots.layerTest({
|
|
7487
|
+
* worktree: () =>
|
|
7488
|
+
* Effect.succeed(
|
|
7489
|
+
* WorkspaceStateSnapshot.make({ packages: [], catalogs: CatalogSet.empty(), importerVersions: {} }),
|
|
7490
|
+
* ),
|
|
7491
|
+
* });
|
|
7492
|
+
* // program.pipe(Effect.provide(TestSnapshots))
|
|
7493
|
+
* ```
|
|
7494
|
+
*/
|
|
7495
|
+
static readonly layerTest: (overrides?: Partial<WorkspaceSnapshotsShape>) => Layer.Layer<WorkspaceSnapshots>;
|
|
7178
7496
|
}
|
|
7179
7497
|
//#endregion
|
|
7180
7498
|
//#region src/Workspaces.d.ts
|