@effected/workspaces 0.16.0 → 0.17.0

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.
@@ -444,7 +444,8 @@ var WorkspaceCatalogs = class WorkspaceCatalogs extends Context.Service()("@effe
444
444
  }),
445
445
  importerVersions: Effect.fn("WorkspaceCatalogs.importerVersions")(function* () {
446
446
  return (yield* memo).importerVersions;
447
- })
447
+ }),
448
+ refresh: () => invalidate
448
449
  };
449
450
  });
450
451
  /**
@@ -509,6 +510,11 @@ var WorkspaceCatalogs = class WorkspaceCatalogs extends Context.Service()("@effe
509
510
  * the importer index from the lockfile's importer blocks — neither is in a
510
511
  * `CatalogSet`) and always die unless stubbed.
511
512
  *
513
+ * `refresh` defaults to `Effect.void` honestly: the double holds no memo,
514
+ * so "drop the memoized assembly" is genuinely a no-op — the stubs answer
515
+ * fresh on every call already. This mirrors `WorkspaceDiscovery.makeTest`'s
516
+ * `refresh`.
517
+ *
512
518
  * @example
513
519
  * ```ts
514
520
  * import { CatalogSet, WorkspaceCatalogs } from "@effected/workspaces";
@@ -528,6 +534,7 @@ var WorkspaceCatalogs = class WorkspaceCatalogs extends Context.Service()("@effe
528
534
  peerDependencyRules: () => unstubbed("peerDependencyRules"),
529
535
  releaseAgeGate: () => unstubbed("releaseAgeGate"),
530
536
  importerVersions: () => unstubbed("importerVersions"),
537
+ refresh: () => Effect.void,
531
538
  ...overrides
532
539
  };
533
540
  };
package/index.d.ts CHANGED
@@ -2449,6 +2449,26 @@ interface WorkspaceCatalogsShape {
2449
2449
  * nothing rather than failing.
2450
2450
  */
2451
2451
  readonly importerVersions: () => Effect.Effect<ImporterVersions, CatalogAssemblyFailure>;
2452
+ /**
2453
+ * Discard the memoized assembly so the **next** read re-assembles — the same
2454
+ * single read and hook replay as the first, over the workspace as it stands
2455
+ * then.
2456
+ *
2457
+ * @remarks
2458
+ * The explicit memoization boundary for a tool that **mutates the workspace
2459
+ * mid-run** — installs, bumps a config dependency, regenerates the lockfile.
2460
+ * Release-age gating wants the before-state, a post-install peer check the
2461
+ * after-state, and one infinite memo cannot serve both without this call in
2462
+ * between; without it, `peerDependencyRules` keeps answering from the
2463
+ * pre-mutation hook replay and the checker reports findings the new rules
2464
+ * suppress.
2465
+ *
2466
+ * Unconditional and infallible: the memo is already success-only (a failed
2467
+ * or interrupted assembly retries by itself), so `refresh` exists solely to
2468
+ * discard a *successful* assembly that mutation has made stale. Calling it
2469
+ * before any read is harmless.
2470
+ */
2471
+ readonly refresh: () => Effect.Effect<void>;
2452
2472
  }
2453
2473
  /**
2454
2474
  * Options for the {@link WorkspaceCatalogs} layer.
@@ -2554,6 +2574,11 @@ declare class WorkspaceCatalogs extends WorkspaceCatalogs_base {
2554
2574
  * the importer index from the lockfile's importer blocks — neither is in a
2555
2575
  * `CatalogSet`) and always die unless stubbed.
2556
2576
  *
2577
+ * `refresh` defaults to `Effect.void` honestly: the double holds no memo,
2578
+ * so "drop the memoized assembly" is genuinely a no-op — the stubs answer
2579
+ * fresh on every call already. This mirrors `WorkspaceDiscovery.makeTest`'s
2580
+ * `refresh`.
2581
+ *
2557
2582
  * @example
2558
2583
  * ```ts
2559
2584
  * import { CatalogSet, WorkspaceCatalogs } from "@effected/workspaces";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@effected/workspaces",
3
- "version": "0.16.0",
3
+ "version": "0.17.0",
4
4
  "private": false,
5
5
  "description": "Monorepo workspace tooling as Effect services — root discovery, package enumeration, the dependency graph, package-manager detection, pnpm catalog resolution, lockfile IO and git-based change detection.",
6
6
  "keywords": [
@@ -49,7 +49,7 @@
49
49
  "@effected/commands": "^0.5.0",
50
50
  "@effected/git": "^0.9.0",
51
51
  "@effected/glob": "^0.4.0",
52
- "@effected/lockfiles": "^0.6.1",
52
+ "@effected/lockfiles": "^0.6.2",
53
53
  "@effected/npm": "^0.11.1",
54
54
  "@effected/package-json": "^0.10.2",
55
55
  "@effected/semver": "^0.5.0",