@effected/workspaces 0.41.0 → 0.43.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.
package/ChangeDetector.js CHANGED
@@ -1,5 +1,5 @@
1
- import { WorkspaceDiscovery } from "./WorkspaceDiscovery.js";
2
1
  import { DependencyGraph } from "./DependencyGraph.js";
2
+ import { WorkspaceDiscovery } from "./WorkspaceDiscovery.js";
3
3
  import { Git } from "@effected/git";
4
4
  import { Context, Effect, Layer, Schema } from "effect";
5
5
 
@@ -1,5 +1,5 @@
1
- import { WorkspacePackage } from "./WorkspacePackage.js";
2
1
  import { PackageNotFoundError } from "./WorkspaceDiscovery.js";
2
+ import { WorkspacePackage } from "./WorkspacePackage.js";
3
3
  import { Effect, Graph, Schema } from "effect";
4
4
 
5
5
  // src/DependencyGraph.ts
package/ImportGraph.js CHANGED
@@ -1,8 +1,8 @@
1
- import { WorkspaceDiscovery } from "./WorkspaceDiscovery.js";
2
- import { isIdentifierChar, lex, locate, specifierLiterals, wordEndingAt } from "./internal/sourceText.js";
3
1
  import { isTypePositionImport } from "./internal/importPosition.js";
2
+ import { isIdentifierChar, lex, locate, specifierLiterals, wordEndingAt } from "./internal/sourceText.js";
4
3
  import { DEFAULT_EXTENSIONS, walkSources } from "./internal/sourceWalk.js";
5
4
  import { SourceBoundary } from "./SourceBoundary.js";
5
+ import { WorkspaceDiscovery } from "./WorkspaceDiscovery.js";
6
6
  import { Effect, FileSystem, Option, Path, Schema } from "effect";
7
7
  import { GlobSet } from "@effected/glob";
8
8
 
package/LockfileReader.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { findLayerRoot } from "./internal/layerRoot.js";
2
- import { WorkspaceRoot } from "./WorkspaceRoot.js";
3
- import { WorkspaceDiscovery } from "./WorkspaceDiscovery.js";
4
2
  import { PackageManagerDetector } from "./PackageManagerName.js";
3
+ import { WorkspaceDiscovery } from "./WorkspaceDiscovery.js";
4
+ import { WorkspaceRoot } from "./WorkspaceRoot.js";
5
5
  import { Context, Duration, Effect, Exit, FileSystem, Layer, Option, Path, Result, Schema } from "effect";
6
6
  import { PackageJsonFormat } from "@effected/package-json";
7
7
  import { Lockfile, LockfileFormat, LockfileIntegrity, filenameFor } from "@effected/lockfiles";
@@ -1,5 +1,5 @@
1
- import { WorkspaceManifestError } from "./WorkspacePackage.js";
2
1
  import { MARKER_FILES, decidePackageManager } from "./internal/packageManagerDecision.js";
2
+ import { WorkspaceManifestError } from "./WorkspacePackage.js";
3
3
  import { Context, Effect, FileSystem, Layer, Option, Path, Predicate, Schema } from "effect";
4
4
  import { PackageJsonFormat } from "@effected/package-json";
5
5
 
package/PackedInstall.js CHANGED
@@ -1,6 +1,6 @@
1
- import { WorkspaceDiscovery } from "./WorkspaceDiscovery.js";
2
- import { PackageManagerName } from "./PackageManagerName.js";
3
1
  import { binConflict, binTargetOf, closureOf, consumerFiles, fileOverridesOf, installArgs, overridePath, readPackedManifest, scrubEnv, versionOf } from "./internal/packedInstallPlan.js";
2
+ import { PackageManagerName } from "./PackageManagerName.js";
3
+ import { WorkspaceDiscovery } from "./WorkspaceDiscovery.js";
4
4
  import { Config, Duration, Effect, FileSystem, Option, Path, Redacted, Result, Schema, Stream } from "effect";
5
5
  import { PackageJsonFormat } from "@effected/package-json";
6
6
  import { Yaml } from "@effected/yaml";
@@ -152,7 +152,7 @@ var InstalledConsumer = class extends Schema.Class("InstalledConsumer")({
152
152
  /**
153
153
  * The command {@link InstalledConsumer.runBin} spawns for the bin `name`,
154
154
  * for a caller that drives the child itself, such as `McpProbe.initialize`
155
- * from `@effected/mcp/testing`.
155
+ * from `@effected/mcp-kit/testing`.
156
156
  *
157
157
  * @remarks
158
158
  * {@link InstalledConsumer.binPath}, from the consumer's directory, under
@@ -165,7 +165,7 @@ var InstalledConsumer = class extends Schema.Class("InstalledConsumer")({
165
165
  *
166
166
  * @example
167
167
  * ```ts
168
- * import { McpProbe } from "@effected/mcp/testing";
168
+ * import { McpProbe } from "@effected/mcp-kit/testing";
169
169
  * import type { InstalledConsumer } from "@effected/workspaces/testing";
170
170
  *
171
171
  * declare const consumer: InstalledConsumer;
@@ -470,7 +470,7 @@ const planClosure = (carrier, options) => Effect.gen(function* () {
470
470
  *
471
471
  * It asserts nothing about what the bins DO: run them from the test through
472
472
  * `InstalledConsumer.runBin`, or for an MCP bin through `McpProbe` from
473
- * `@effected/mcp/testing` at `InstalledConsumer.binPath`, inside the same
473
+ * `@effected/mcp-kit/testing` at `InstalledConsumer.binPath`, inside the same
474
474
  * scope, because the scratch directory (`PackedInstallResult.scratch`) is
475
475
  * removed when the scope closes. Size the test's outer timeout with
476
476
  * {@link PackedInstall.timeoutBudget}. POSIX only.
package/PeerCheck.js CHANGED
@@ -1,5 +1,5 @@
1
- import { indexInstances, rootInstances } from "./internal/roots.js";
2
1
  import { peerNameMatcher } from "./internal/peerPatterns.js";
2
+ import { indexInstances, rootInstances } from "./internal/roots.js";
3
3
  import { Option, Result, Schema } from "effect";
4
4
  import { Range, SemVer } from "@effected/semver";
5
5
 
package/README.md CHANGED
@@ -464,7 +464,7 @@ Both checks are static analysis of literal specifiers — there is no dynamic-im
464
464
 
465
465
  `PackedInstall.run` packs a carrier and every workspace package it needs, then installs the carrier into a fresh project outside the workspace under each package manager that answers `--version`, and checks every expected bin is linked and executable. It carries the traps each manager sets: the parent run's `npm_*` and `pnpm_config_*` context is scrubbed, pnpm's overrides go in `pnpm-workspace.yaml`, Yarn Berry gets the `node-modules` linker, `packageManager` is pinned to the probed version, and lifecycle scripts are skipped. By default it packs each package's built `dist/prod/npm/pkg`, the artifact a release publishes; build first.
466
466
 
467
- It does not run the bins; the test does, inside the same scope, because the scratch directory (`result.scratch`) is removed when the scope closes. `consumer.runBin(name, args, options?)` runs one to completion and returns `{ stdout, stderr, exitCode }`, with no direct `@effected/commands` dependency. `consumer.command(name, args?, options?)` returns the `ChildProcess` command `runBin` builds, same environment and working directory, with stdin left open, so a probe that writes to the bin can spawn it. `consumer.binProvenance(name)` names the package a `.bin` symlink resolves into. `PackedInstall.closure(carrier, options?)` names every package the run will pack before it runs, and `PackedInstall.timeoutBudget` sizes the outer timeout from those names and the run's own ceilings. For an MCP server bin, `McpProbe` from `@effected/mcp/testing` is the proof:
467
+ It does not run the bins; the test does, inside the same scope, because the scratch directory (`result.scratch`) is removed when the scope closes. `consumer.runBin(name, args, options?)` runs one to completion and returns `{ stdout, stderr, exitCode }`, with no direct `@effected/commands` dependency. `consumer.command(name, args?, options?)` returns the `ChildProcess` command `runBin` builds, same environment and working directory, with stdin left open, so a probe that writes to the bin can spawn it. `consumer.binProvenance(name)` names the package a `.bin` symlink resolves into. `PackedInstall.closure(carrier, options?)` names every package the run will pack before it runs, and `PackedInstall.timeoutBudget` sizes the outer timeout from those names and the run's own ceilings. For an MCP server bin, `McpProbe` from `@effected/mcp-kit/testing` is the proof:
468
468
 
469
469
  ```ts
470
470
  // __test__/e2e/packed-install.e2e.test.ts, two levels below the workspace root
@@ -472,7 +472,7 @@ import { dirname, resolve } from "node:path";
472
472
  import { fileURLToPath } from "node:url";
473
473
  import { NodeServices } from "@effect/platform-node";
474
474
  import { assert, describe, layer } from "@effect/vitest";
475
- import { McpProbe } from "@effected/mcp/testing";
475
+ import { McpProbe } from "@effected/mcp-kit/testing";
476
476
  import { Workspaces } from "@effected/workspaces";
477
477
  import { PackedInstall } from "@effected/workspaces/testing";
478
478
  import { Duration, Effect, Layer } from "effect";
package/SourceBoundary.js CHANGED
@@ -25,7 +25,8 @@ var Offence = class extends Schema.Class("Offence")({
25
25
  "console-stdout",
26
26
  "forbidImports",
27
27
  "forbidTokens",
28
- "forbidImportedNames"
28
+ "forbidImportedNames",
29
+ "promiseInExclusive"
29
30
  ]),
30
31
  /**
31
32
  * What matched: the identifier, the call, the import specifier, the token,
@@ -283,6 +284,37 @@ const tokenOccurrences = (code, token) => {
283
284
  };
284
285
  const forbids = (entry, specifier) => entry.endsWith("*") ? specifier.startsWith(entry.slice(0, -1)) : specifier === entry || specifier.startsWith(`${entry}/`);
285
286
  const isNodeModule = (specifier, module) => [module, `node:${module}`].some((name) => specifier === name || specifier.startsWith(`${name}/`));
287
+ const LANE_BINDING = /(?<![\p{ID_Continue}$.#])(?:const|let|var)\s+([\p{ID_Start}$_][\p{ID_Continue}$]*)\s*=\s*(?:(?:yield\s*\*|await)\s*)?Exclusive\s*\.\s*make(?![\p{ID_Continue}$])/gu;
288
+ const PROMISE_CALL = /(?<![\p{ID_Continue}$.#])Effect\s*\.\s*(promise|runPromiseExit|runPromise)\s*(?:<[^()]*>\s*)?\(/gu;
289
+ /** Where `code` calls `<lane>.run(`, as the offsets just inside the opening paren and of the matching close (end of text when unbalanced). */
290
+ const runSpans = (code, lane) => {
291
+ const call = new RegExp(`(?<![\\p{ID_Continue}$.#])${lane.replace(/[.*+?^${}()|[\]\\]/gu, "\\$&")}\\s*(?:\\?\\.|\\.)\\s*run\\s*\\(`, "gu");
292
+ return [...code.matchAll(call)].map((match) => {
293
+ const from = (match.index ?? 0) + match[0].length;
294
+ let depth = 1;
295
+ let to = from;
296
+ for (; to < code.length && depth > 0; to++) if (code[to] === "(") depth++;
297
+ else if (code[to] === ")") depth--;
298
+ return {
299
+ from,
300
+ to
301
+ };
302
+ });
303
+ };
304
+ /** Every `Effect.promise(` or `Effect.runPromise(` lexically inside a `<lane>.run(` call, for each lane the file binds from `Exclusive.make` or `lanes` names. */
305
+ const promisesInLanes = (code, lanes) => {
306
+ const names = /* @__PURE__ */ new Set([...[...code.matchAll(LANE_BINDING)].map((match) => match[1] ?? ""), ...lanes]);
307
+ names.delete("");
308
+ const found = /* @__PURE__ */ new Map();
309
+ for (const lane of names) for (const { from, to } of runSpans(code, lane)) for (const call of code.slice(from, to).matchAll(PROMISE_CALL)) {
310
+ const offset = from + (call.index ?? 0);
311
+ if (!found.has(offset)) found.set(offset, `${lane}.run: Effect.${call[1]}`);
312
+ }
313
+ return [...found].map(([offset, detail]) => ({
314
+ offset,
315
+ detail
316
+ }));
317
+ };
286
318
  const FIXTURES = [
287
319
  {
288
320
  name: "process: destructuring",
@@ -635,6 +667,72 @@ const FIXTURES = [
635
667
  } },
636
668
  flagged: false
637
669
  },
670
+ {
671
+ name: "promiseInExclusive: Effect.promise in a lane body",
672
+ source: "const lane = yield* Exclusive.make;\nlane.run(Effect.promise(() => f()), { timeout: \"1s\" });",
673
+ rule: { promiseInExclusive: {} },
674
+ flagged: true
675
+ },
676
+ {
677
+ name: "promiseInExclusive: Effect.promise nested in Effect.gen in a lane body",
678
+ source: "const lane = yield* Exclusive.make;\nlane.run(Effect.gen(function* () { yield* Effect.promise(() => f()); }), { timeout: 1 });",
679
+ rule: { promiseInExclusive: {} },
680
+ flagged: true
681
+ },
682
+ {
683
+ name: "promiseInExclusive: Effect.runPromise in a lane body",
684
+ source: "const lane = yield* Exclusive.make;\nlane.run(Effect.sync(() => Effect.runPromise(g)), { timeout: 1 });",
685
+ rule: { promiseInExclusive: {} },
686
+ flagged: true
687
+ },
688
+ {
689
+ name: "promiseInExclusive: Effect.promise with a type argument in a lane body",
690
+ source: "const lane = yield* Exclusive.make;\nlane.run(Effect.promise<void>(() => f()), { timeout: 1 });",
691
+ rule: { promiseInExclusive: {} },
692
+ flagged: true
693
+ },
694
+ {
695
+ name: "promiseInExclusive: Effect.runPromiseExit in a lane body",
696
+ source: "const lane = yield* Exclusive.make;\nlane.run(Effect.sync(() => Effect.runPromiseExit(g)), { timeout: 1 });",
697
+ rule: { promiseInExclusive: {} },
698
+ flagged: true
699
+ },
700
+ {
701
+ name: "promiseInExclusive: a lane passed in and named in lanes",
702
+ source: "lane.run(Effect.promise(() => f()), { timeout: 1 });",
703
+ rule: { promiseInExclusive: { lanes: ["lane"] } },
704
+ flagged: true
705
+ },
706
+ {
707
+ name: "promiseInExclusive: Exclusive.promise in a lane body",
708
+ source: "const lane = yield* Exclusive.make;\nlane.run(Exclusive.promise(lane, (s) => f(s)), { timeout: 1 });",
709
+ rule: { promiseInExclusive: {} },
710
+ flagged: false
711
+ },
712
+ {
713
+ name: "promiseInExclusive: Effect.promise after the run call closes",
714
+ source: "const lane = yield* Exclusive.make;\nlane.run(body, { timeout: 1 });\nconst p = Effect.promise(() => f());",
715
+ rule: { promiseInExclusive: {} },
716
+ flagged: false
717
+ },
718
+ {
719
+ name: "promiseInExclusive: the call named in a string",
720
+ source: "const lane = yield* Exclusive.make;\nlane.run(Effect.succeed(\"Effect.promise(x)\"), { timeout: 1 });",
721
+ rule: { promiseInExclusive: {} },
722
+ flagged: false
723
+ },
724
+ {
725
+ name: "promiseInExclusive: the call named in a comment",
726
+ source: "const lane = yield* Exclusive.make;\nlane.run(body /* Effect.promise(x) */, { timeout: 1 });",
727
+ rule: { promiseInExclusive: {} },
728
+ flagged: false
729
+ },
730
+ {
731
+ name: "promiseInExclusive: a receiver nothing binds from Exclusive.make",
732
+ source: "other.run(Effect.promise(() => f()), { timeout: 1 });",
733
+ rule: { promiseInExclusive: {} },
734
+ flagged: false
735
+ },
638
736
  {
639
737
  name: "forbidTokens: a private field",
640
738
  source: "const v = this.#process.env.__PACKAGE_VERSION__;",
@@ -715,8 +813,27 @@ var SourceBoundary = class SourceBoundary {
715
813
  static stripComments = (text) => lex(text).withoutComments;
716
814
  /** Whether `text` reads the global `process` in code (see {@link BoundaryRule}). */
717
815
  static referencesProcess = (text, options) => processReads(lex(text).code, [...EXEMPT, ...options?.ignoreTokens ?? []]).length > 0;
718
- /** Every module specifier `text` imports: static, side-effect, re-export, type-only, `import(...)` with a literal, and `require(...)`. */
816
+ /**
817
+ * Every module specifier `text` imports: static, side-effect, re-export, type-only, `import(...)` with a literal, and `require(...)`.
818
+ *
819
+ * @remarks
820
+ * One entry per occurrence, in source order: a module imported twice appears twice. Wrap the result in
821
+ * `new Set(...)` for the set of modules.
822
+ */
719
823
  static importSpecifiers = (text) => specifierLiterals(lex(text)).map((literal) => literal.value);
824
+ /**
825
+ * The rule for platform-free code: every Node built-in, bare or `node:`-prefixed, and `@effect/platform*`.
826
+ *
827
+ * @remarks
828
+ * Pass `builtinModules` from `node:module` as `builtins`; no list ships here because it would drift with Node
829
+ * releases. A bare-name list also forbids npm packages that share a built-in's name (`events`, `buffer`,
830
+ * `punycode`).
831
+ */
832
+ static platformFree = (builtins) => ({ forbidImports: [
833
+ "node:*",
834
+ "@effect/platform*",
835
+ ...builtins
836
+ ] });
720
837
  /** Whether `text` imports the Node built-in `module`, in either its `node:` or bare form. */
721
838
  static importsNode = (text, module) => SourceBoundary.importSpecifiers(text).some((specifier) => isNodeModule(specifier, module));
722
839
  /**
@@ -775,6 +892,11 @@ var SourceBoundary = class SourceBoundary {
775
892
  rule: "forbidImportedNames",
776
893
  detail
777
894
  });
895
+ else if ("promiseInExclusive" in rule) for (const { offset, detail } of promisesInLanes(lexed.code, rule.promiseInExclusive.lanes ?? [])) found.push({
896
+ offset,
897
+ rule: "promiseInExclusive",
898
+ detail
899
+ });
778
900
  else if ("forbidTokens" in rule) for (const token of new Set(rule.forbidTokens)) for (const offset of tokenOccurrences(lexed.code, token)) found.push({
779
901
  offset,
780
902
  rule: "forbidTokens",
@@ -1,6 +1,6 @@
1
- import { WorkspaceDiscovery } from "./WorkspaceDiscovery.js";
2
1
  import { PublishabilityDetector } from "./Publishability.js";
3
2
  import { ReleaseTag } from "./ReleaseTag.js";
3
+ import { WorkspaceDiscovery } from "./WorkspaceDiscovery.js";
4
4
  import { Effect, Schema } from "effect";
5
5
 
6
6
  // src/VersioningStrategy.ts
@@ -1,11 +1,11 @@
1
- import { isStringRecord } from "./internal/guards.js";
2
- import { findLayerRoot } from "./internal/layerRoot.js";
3
- import { WorkspaceRoot } from "./WorkspaceRoot.js";
4
- import { inlineCatalogs, merge, normalize, rangeOf } from "./internal/catalogs.js";
5
1
  import { ConfigDependencyHooks, NoPeerDependencyRules } from "./ConfigDependencyHooks.js";
6
- import { LockfileReader } from "./LockfileReader.js";
2
+ import { inlineCatalogs, merge, normalize, rangeOf } from "./internal/catalogs.js";
3
+ import { isStringRecord } from "./internal/guards.js";
7
4
  import { importerVersionsOf } from "./internal/importerVersions.js";
5
+ import { findLayerRoot } from "./internal/layerRoot.js";
8
6
  import { configDependenciesOf, inlinePeerDependencyRules } from "./internal/workspaceYaml.js";
7
+ import { LockfileReader } from "./LockfileReader.js";
8
+ import { WorkspaceRoot } from "./WorkspaceRoot.js";
9
9
  import { Context, Duration, Effect, Exit, FileSystem, Layer, Option, Path, PlatformError, Predicate, Schema } from "effect";
10
10
  import { CatalogAssemblyError, CatalogResolver, DependencyResolutionError, PartialReleaseAgeGate, ReleaseAgeGate } from "@effected/npm";
11
11
  import { PackageJsonFormat } from "@effected/package-json";
@@ -1,5 +1,5 @@
1
- import { WorkspaceDiscovery } from "./WorkspaceDiscovery.js";
2
1
  import { ALL_DEPENDENCY_FIELDS } from "./internal/dependencyFields.js";
2
+ import { WorkspaceDiscovery } from "./WorkspaceDiscovery.js";
3
3
  import { Effect, Graph, Option, Schema } from "effect";
4
4
  import { GlobSet } from "@effected/glob";
5
5
  import { DependencyField } from "@effected/npm";
@@ -1,11 +1,11 @@
1
+ import { ConfigDependencyHooks } from "./ConfigDependencyHooks.js";
1
2
  import { isStringRecord } from "./internal/guards.js";
3
+ import { importerVersionsOf } from "./internal/importerVersions.js";
2
4
  import { findLayerRoot } from "./internal/layerRoot.js";
3
5
  import { manifestPatternsOf, pnpmPatternsOf } from "./internal/patterns.js";
4
- import { WorkspaceRoot } from "./WorkspaceRoot.js";
5
- import { WorkspaceDiscovery } from "./WorkspaceDiscovery.js";
6
- import { ConfigDependencyHooks } from "./ConfigDependencyHooks.js";
7
- import { importerVersionsOf } from "./internal/importerVersions.js";
8
6
  import { CatalogSet, WorkspaceCatalogs, injectFromDocument } from "./WorkspaceCatalogs.js";
7
+ import { WorkspaceDiscovery } from "./WorkspaceDiscovery.js";
8
+ import { WorkspaceRoot } from "./WorkspaceRoot.js";
9
9
  import { PackageStateSnapshot, WorkspaceStateSnapshot } from "./WorkspaceStateSnapshot.js";
10
10
  import { Git } from "@effected/git";
11
11
  import { Context, Duration, Effect, Exit, Layer, Option, Predicate, Result } from "effect";
package/Workspaces.js CHANGED
@@ -1,11 +1,11 @@
1
- import { layerFindOptions } from "./internal/layerRoot.js";
2
- import { WorkspaceRoot } from "./WorkspaceRoot.js";
3
- import { WorkspaceDiscovery } from "./WorkspaceDiscovery.js";
4
1
  import { ChangeDetector } from "./ChangeDetector.js";
5
2
  import { ConfigDependencyHooks } from "./ConfigDependencyHooks.js";
6
- import { PackageManagerDetector } from "./PackageManagerName.js";
3
+ import { layerFindOptions } from "./internal/layerRoot.js";
7
4
  import { LockfileReader } from "./LockfileReader.js";
5
+ import { PackageManagerDetector } from "./PackageManagerName.js";
8
6
  import { WorkspaceCatalogs } from "./WorkspaceCatalogs.js";
7
+ import { WorkspaceDiscovery } from "./WorkspaceDiscovery.js";
8
+ import { WorkspaceRoot } from "./WorkspaceRoot.js";
9
9
  import { WorkspaceSnapshots } from "./WorkspaceSnapshots.js";
10
10
  import { Git } from "@effected/git";
11
11
  import { Effect, Layer, Option } from "effect";
package/WorkspacesSync.js CHANGED
@@ -1,10 +1,10 @@
1
- import { Traversal, badMaxDepthMessage, isPruned, isValidMaxDepth, joinRelative } from "./internal/traverse.js";
2
1
  import { isStringRecord } from "./internal/guards.js";
3
- import { manifestPatternsOf, pnpmPatternsOf } from "./internal/patterns.js";
4
- import { PublishConfig, WorkspaceManifestError, WorkspacePackage } from "./WorkspacePackage.js";
5
- import { WorkspaceRootMatch, probedMarkers } from "./WorkspaceMarker.js";
6
2
  import { decidePackageManager } from "./internal/packageManagerDecision.js";
3
+ import { manifestPatternsOf, pnpmPatternsOf } from "./internal/patterns.js";
4
+ import { Traversal, badMaxDepthMessage, isPruned, isValidMaxDepth, joinRelative } from "./internal/traverse.js";
7
5
  import { DetectedPackageManager, PackageManagerDetectionError, PackageManagerEvidence } from "./PackageManagerName.js";
6
+ import { WorkspaceRootMatch, probedMarkers } from "./WorkspaceMarker.js";
7
+ import { PublishConfig, WorkspaceManifestError, WorkspacePackage } from "./WorkspacePackage.js";
8
8
  import { Effect, Exit, Option, Result, Schema } from "effect";
9
9
  import { GlobSet } from "@effected/glob";
10
10
  import { PackageJsonFormat } from "@effected/package-json";
package/index.js CHANGED
@@ -1,21 +1,21 @@
1
- import { PublishConfig, WorkspaceManifestError, WorkspacePackage } from "./WorkspacePackage.js";
2
- import { WORKSPACE_MARKERS, WorkspaceMarker, WorkspaceRootMatch } from "./WorkspaceMarker.js";
3
- import { WorkspaceRoot, WorkspaceRootNotFoundError } from "./WorkspaceRoot.js";
4
- import { PackageNotFoundError, WorkspaceDiscovery, WorkspaceDiscoveryError, WorkspaceInfo, WorkspacePatternError } from "./WorkspaceDiscovery.js";
5
- import { CyclicDependencyError, DependencyGraph } from "./DependencyGraph.js";
6
1
  import { ChangeDetectionError, ChangeDetectionOptions, ChangeDetector } from "./ChangeDetector.js";
7
2
  import { ConfigDependencyHooks, NoPeerDependencyRules } from "./ConfigDependencyHooks.js";
8
3
  import { ConfigDependencySpec, InvalidConfigDependencySpecError } from "./ConfigDependencySpec.js";
4
+ import { CyclicDependencyError, DependencyGraph } from "./DependencyGraph.js";
9
5
  import { Dependent, DuplicateCheck, DuplicateInstance, DuplicatedPackage, DuplicatedVersion } from "./DuplicateCheck.js";
10
- import { DetectedPackageManager, PackageManagerDetectionError, PackageManagerDetector, PackageManagerEvidence, PackageManagerName } from "./PackageManagerName.js";
11
6
  import { LockfileReadError, LockfileReader } from "./LockfileReader.js";
7
+ import { DetectedPackageManager, PackageManagerDetectionError, PackageManagerDetector, PackageManagerEvidence, PackageManagerName } from "./PackageManagerName.js";
12
8
  import { PeerCheck, PeerParent, UnsatisfiedPeer } from "./PeerCheck.js";
13
9
  import { PublishTarget, PublishabilityDetector } from "./Publishability.js";
14
10
  import { ReleaseTag, TagStyle, TrackingTag, classifyTag } from "./ReleaseTag.js";
15
11
  import { VersioningStrategy, VersioningStrategyType } from "./VersioningStrategy.js";
16
12
  import { CatalogSet, WorkspaceCatalogs } from "./WorkspaceCatalogs.js";
17
- import { PackageStateSnapshot, WorkspaceStateSnapshot } from "./WorkspaceStateSnapshot.js";
13
+ import { PackageNotFoundError, WorkspaceDiscovery, WorkspaceDiscoveryError, WorkspaceInfo, WorkspacePatternError } from "./WorkspaceDiscovery.js";
14
+ import { WORKSPACE_MARKERS, WorkspaceMarker, WorkspaceRootMatch } from "./WorkspaceMarker.js";
15
+ import { PublishConfig, WorkspaceManifestError, WorkspacePackage } from "./WorkspacePackage.js";
16
+ import { WorkspaceRoot, WorkspaceRootNotFoundError } from "./WorkspaceRoot.js";
18
17
  import { WorkspaceSnapshots } from "./WorkspaceSnapshots.js";
18
+ import { PackageStateSnapshot, WorkspaceStateSnapshot } from "./WorkspaceStateSnapshot.js";
19
19
  import { Workspaces } from "./Workspaces.js";
20
20
  import { detectPackageManagerSync, findWorkspaceRootSync, getWorkspacePackagesSync, localExecContextSync, locateWorkspaceRootSync } from "./WorkspacesSync.js";
21
21
 
@@ -1,5 +1,5 @@
1
- import { stringsOf } from "./patterns.js";
2
1
  import { NoPeerDependencyRules } from "../ConfigDependencyHooks.js";
2
+ import { stringsOf } from "./patterns.js";
3
3
  import { Predicate } from "effect";
4
4
 
5
5
  // src/internal/workspaceYaml.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@effected/workspaces",
3
- "version": "0.41.0",
3
+ "version": "0.43.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": [
@@ -51,16 +51,16 @@
51
51
  "./package.json": "./package.json"
52
52
  },
53
53
  "dependencies": {
54
- "@effected/commands": "^0.19.0",
55
- "@effected/git": "^0.29.0",
56
- "@effected/glob": "^0.17.0",
57
- "@effected/jsonc": "^0.22.0",
58
- "@effected/lockfiles": "^0.21.0",
59
- "@effected/npm": "^0.29.0",
60
- "@effected/package-json": "^0.28.0",
61
- "@effected/semver": "^0.20.0",
62
- "@effected/walker": "^0.24.0",
63
- "@effected/yaml": "^0.27.0",
54
+ "@effected/commands": "^0.20.0",
55
+ "@effected/git": "^0.30.0",
56
+ "@effected/glob": "^0.19.0",
57
+ "@effected/jsonc": "^0.24.0",
58
+ "@effected/lockfiles": "^0.22.1",
59
+ "@effected/npm": "^0.30.1",
60
+ "@effected/package-json": "^0.30.0",
61
+ "@effected/semver": "^0.22.0",
62
+ "@effected/walker": "^0.25.1",
63
+ "@effected/yaml": "^0.29.0",
64
64
  "@pnpm/catalogs.config": "^1100.0.5",
65
65
  "@pnpm/catalogs.protocol-parser": "^1100.0.0",
66
66
  "@pnpm/catalogs.resolver": "^1100.0.0",
package/testing.d.ts CHANGED
@@ -1614,7 +1614,7 @@ export declare class InstalledConsumer extends InstalledConsumer_base {
1614
1614
  /**
1615
1615
  * The command {@link InstalledConsumer.runBin} spawns for the bin `name`,
1616
1616
  * for a caller that drives the child itself, such as `McpProbe.initialize`
1617
- * from `@effected/mcp/testing`.
1617
+ * from `@effected/mcp-kit/testing`.
1618
1618
  *
1619
1619
  * @remarks
1620
1620
  * {@link InstalledConsumer.binPath}, from the consumer's directory, under
@@ -1627,7 +1627,7 @@ export declare class InstalledConsumer extends InstalledConsumer_base {
1627
1627
  *
1628
1628
  * @example
1629
1629
  * ```ts
1630
- * import { McpProbe } from "@effected/mcp/testing";
1630
+ * import { McpProbe } from "@effected/mcp-kit/testing";
1631
1631
  * import type { InstalledConsumer } from "@effected/workspaces/testing";
1632
1632
  *
1633
1633
  * declare const consumer: InstalledConsumer;
@@ -1820,7 +1820,7 @@ interface PackedInstallGate {
1820
1820
  *
1821
1821
  * It asserts nothing about what the bins DO: run them from the test through
1822
1822
  * `InstalledConsumer.runBin`, or for an MCP bin through `McpProbe` from
1823
- * `@effected/mcp/testing` at `InstalledConsumer.binPath`, inside the same
1823
+ * `@effected/mcp-kit/testing` at `InstalledConsumer.binPath`, inside the same
1824
1824
  * scope, because the scratch directory (`PackedInstallResult.scratch`) is
1825
1825
  * removed when the scope closes. Size the test's outer timeout with
1826
1826
  * {@link PackedInstall.timeoutBudget}. POSIX only.
@@ -2067,8 +2067,18 @@ export declare class PackedInstall {
2067
2067
  * re-export (`export { App } from ...`), an `export * from` of the module,
2068
2068
  * and a member access on a namespace binding (`import * as m from ...` or the
2069
2069
  * TypeScript `import m = require(...)`, then `m.App`). `from` must equal the specifier
2070
- * exactly; a subpath is a different module. See {@link SourceBoundary}'s
2071
- * remarks for what this lexer cannot see.
2070
+ * exactly; a subpath is a different module. `{ promiseInExclusive }` forbids
2071
+ * `Effect.promise(`, `Effect.runPromise(` and `Effect.runPromiseExit(` inside the argument span of a
2072
+ * `<lane>.run(` call, where `<lane>` is a name the same file binds from
2073
+ * `Exclusive.make` (`const lane = yield* Exclusive.make`) or one listed in
2074
+ * `lanes`. Core's `Effect.promise` abandons the promise when the lane's timeout
2075
+ * interrupts the body, so the permit is released while the work still runs;
2076
+ * `Exclusive.promise` aborts and waits. `Exclusive.promise` and
2077
+ * `Effect.tryPromise` are not flagged. The check is lexical: a helper called
2078
+ * from the body, a body bound to a variable before `run`, a member receiver
2079
+ * (`this.lane.run(`), an aliased import of `Effect`, a destructured `run` and a
2080
+ * call through a local alias of `Effect.promise` all pass. See
2081
+ * {@link SourceBoundary}'s remarks for what this lexer cannot see.
2072
2082
  *
2073
2083
  * To confine a token to named files rather than forbid it everywhere, forbid
2074
2084
  * it and waive the rule for those files through
@@ -2084,7 +2094,8 @@ export declare class PackedInstall {
2084
2094
  * `{ forbidImports: ["node:*", ...builtinModules] }` with `builtinModules`
2085
2095
  * from `node:module`. That also forbids npm packages that share a built-in's
2086
2096
  * name (`events`, `buffer`, `punycode`). No built-in list ships here: it
2087
- * would drift with Node releases.
2097
+ * would drift with Node releases. {@link SourceBoundary.platformFree} builds
2098
+ * the rule from that list.
2088
2099
  *
2089
2100
  * @public
2090
2101
  */
@@ -2094,6 +2105,8 @@ type BoundaryRule = "process" | "node:process" | "stdout-write" | "console" | "c
2094
2105
  readonly forbidTokens: ReadonlyArray<string>;
2095
2106
  } | {
2096
2107
  readonly forbidImportedNames: ForbiddenImportedNames;
2108
+ } | {
2109
+ readonly promiseInExclusive: PromiseInExclusiveOptions;
2097
2110
  };
2098
2111
  /**
2099
2112
  * The names a `{ forbidImportedNames }` rule forbids, and the module they must
@@ -2107,6 +2120,15 @@ interface ForbiddenImportedNames {
2107
2120
  /** The export names that must not be imported from it. `"default"` names the default export. */
2108
2121
  readonly names: ReadonlyArray<string>;
2109
2122
  }
2123
+ /**
2124
+ * The options of a `{ promiseInExclusive }` rule.
2125
+ *
2126
+ * @public
2127
+ */
2128
+ interface PromiseInExclusiveOptions {
2129
+ /** Names of lanes this file receives rather than binds from `Exclusive.make`, such as a parameter. */
2130
+ readonly lanes?: ReadonlyArray<string> | undefined;
2131
+ }
2110
2132
  /**
2111
2133
  * Options for the `process` rule.
2112
2134
  *
@@ -2145,7 +2167,7 @@ declare const Offence_base: Schema.Class<Offence, Schema.Struct<{
2145
2167
  /** The 1-based column, in UTF-16 code units. */
2146
2168
  readonly column: Schema.Number;
2147
2169
  /** The rule broken. */
2148
- readonly rule: Schema.Literals<readonly ["process", "node:process", "stdout-write", "console", "console-stdout", "forbidImports", "forbidTokens", "forbidImportedNames"]>;
2170
+ readonly rule: Schema.Literals<readonly ["process", "node:process", "stdout-write", "console", "console-stdout", "forbidImports", "forbidTokens", "forbidImportedNames", "promiseInExclusive"]>;
2149
2171
  /**
2150
2172
  * What matched: the identifier, the call, the import specifier, the token,
2151
2173
  * or, for `forbidImportedNames`, `<name> from <specifier>` (`*` for an
@@ -2166,7 +2188,8 @@ export declare class Offence extends Offence_base {
2166
2188
  * The rule an {@link Offence} names: every string {@link BoundaryRule}, plus
2167
2189
  * `"forbidImports"` for any `{ forbidImports }` rule, `"forbidTokens"` for
2168
2190
  * any `{ forbidTokens }` rule and `"forbidImportedNames"` for any
2169
- * `{ forbidImportedNames }` rule. These are the keys of
2191
+ * `{ forbidImportedNames }` rule and `"promiseInExclusive"` for any
2192
+ * `{ promiseInExclusive }` rule. These are the keys of
2170
2193
  * {@link ScanOptions.allowRules}.
2171
2194
  *
2172
2195
  * @public
@@ -2298,8 +2321,23 @@ export declare class SourceBoundary {
2298
2321
  static readonly stripComments: (text: string) => string;
2299
2322
  /** Whether `text` reads the global `process` in code (see {@link BoundaryRule}). */
2300
2323
  static readonly referencesProcess: (text: string, options?: ReferenceOptions) => boolean;
2301
- /** Every module specifier `text` imports: static, side-effect, re-export, type-only, `import(...)` with a literal, and `require(...)`. */
2324
+ /**
2325
+ * Every module specifier `text` imports: static, side-effect, re-export, type-only, `import(...)` with a literal, and `require(...)`.
2326
+ *
2327
+ * @remarks
2328
+ * One entry per occurrence, in source order: a module imported twice appears twice. Wrap the result in
2329
+ * `new Set(...)` for the set of modules.
2330
+ */
2302
2331
  static readonly importSpecifiers: (text: string) => ReadonlyArray<string>;
2332
+ /**
2333
+ * The rule for platform-free code: every Node built-in, bare or `node:`-prefixed, and `@effect/platform*`.
2334
+ *
2335
+ * @remarks
2336
+ * Pass `builtinModules` from `node:module` as `builtins`; no list ships here because it would drift with Node
2337
+ * releases. A bare-name list also forbids npm packages that share a built-in's name (`events`, `buffer`,
2338
+ * `punycode`).
2339
+ */
2340
+ static readonly platformFree: (builtins: ReadonlyArray<string>) => BoundaryRule;
2303
2341
  /** Whether `text` imports the Node built-in `module`, in either its `node:` or bare form. */
2304
2342
  static readonly importsNode: (text: string, module: string) => boolean;
2305
2343
  /**
@@ -2443,5 +2481,5 @@ export declare class WorkspaceLayering {
2443
2481
  /** Discover the workspace and check it against `policy`. */
2444
2482
  static readonly checkWorkspace: (policy: LayerPolicy) => Effect.Effect<LayeringReport, WorkspaceDiscoveryFailure, WorkspaceDiscovery>;
2445
2483
  }
2446
- export type { BinCommandOptions, BinProvenance, BoundaryFixture, BoundaryRule, DependencyDiff, FindWorkspaceRootOptions, ForbiddenImportedNames, LayeringGraph, OffenceRule, PackSource, PackedInstallBudget, PackedInstallClosureOptions, PackedInstallGate, PackedInstallOptions, PackedInstallPreflight, PackedInstallPreflightOptions, ReachabilityOptions, ReferenceOptions, RunBinOptions, ScanOptions, UndeclaredOptions, WorkspaceDiscoveryFailure, WorkspaceDiscoveryOptions, WorkspaceDiscoveryShape, WorkspaceLookupFailure, WorkspaceRootShape };
2484
+ export type { BinCommandOptions, BinProvenance, BoundaryFixture, BoundaryRule, DependencyDiff, FindWorkspaceRootOptions, ForbiddenImportedNames, LayeringGraph, OffenceRule, PackSource, PackedInstallBudget, PackedInstallClosureOptions, PackedInstallGate, PackedInstallOptions, PackedInstallPreflight, PackedInstallPreflightOptions, PromiseInExclusiveOptions, ReachabilityOptions, ReferenceOptions, RunBinOptions, ScanOptions, UndeclaredOptions, WorkspaceDiscoveryFailure, WorkspaceDiscoveryOptions, WorkspaceDiscoveryShape, WorkspaceLookupFailure, WorkspaceRootShape };
2447
2485
  //# sourceMappingURL=testing.d.ts.map
package/testing.js CHANGED
@@ -1,12 +1,12 @@
1
- import { PublishConfig, WorkspaceManifestError, WorkspacePackage } from "./WorkspacePackage.js";
2
- import { WorkspaceMarker, WorkspaceRootMatch } from "./WorkspaceMarker.js";
3
- import { WorkspaceRoot, WorkspaceRootNotFoundError } from "./WorkspaceRoot.js";
4
- import { PackageNotFoundError, WorkspaceDiscovery, WorkspaceDiscoveryError, WorkspaceInfo, WorkspacePatternError } from "./WorkspaceDiscovery.js";
5
- import { PackageManagerName } from "./PackageManagerName.js";
6
- import { Offence, SourceBoundary, SourceScan } from "./SourceBoundary.js";
7
1
  import { EntryNotFoundError, ImportGraph, NoEntriesError, ReachOffence, ReachabilityScan, UndeclaredImport, UndeclaredScan, UnresolvedImport } from "./ImportGraph.js";
8
2
  import { LayerPolicy, LayerPolicyError } from "./LayerPolicy.js";
3
+ import { PackageManagerName } from "./PackageManagerName.js";
9
4
  import { InstalledConsumer, PackedInstall, PackedInstallError, PackedInstallResult } from "./PackedInstall.js";
5
+ import { Offence, SourceBoundary, SourceScan } from "./SourceBoundary.js";
6
+ import { PackageNotFoundError, WorkspaceDiscovery, WorkspaceDiscoveryError, WorkspaceInfo, WorkspacePatternError } from "./WorkspaceDiscovery.js";
10
7
  import { LayerEdge, LayeringReport, WorkspaceLayering } from "./WorkspaceLayering.js";
8
+ import { WorkspaceMarker, WorkspaceRootMatch } from "./WorkspaceMarker.js";
9
+ import { PublishConfig, WorkspaceManifestError, WorkspacePackage } from "./WorkspacePackage.js";
10
+ import { WorkspaceRoot, WorkspaceRootNotFoundError } from "./WorkspaceRoot.js";
11
11
 
12
12
  export { EntryNotFoundError, ImportGraph, InstalledConsumer, LayerEdge, LayerPolicy, LayerPolicyError, LayeringReport, NoEntriesError, Offence, PackageManagerName, PackageNotFoundError, PackedInstall, PackedInstallError, PackedInstallResult, PublishConfig, ReachOffence, ReachabilityScan, SourceBoundary, SourceScan, UndeclaredImport, UndeclaredScan, UnresolvedImport, WorkspaceDiscovery, WorkspaceDiscoveryError, WorkspaceInfo, WorkspaceLayering, WorkspaceManifestError, WorkspaceMarker, WorkspacePackage, WorkspacePatternError, WorkspaceRoot, WorkspaceRootMatch, WorkspaceRootNotFoundError };
@@ -5,7 +5,7 @@
5
5
  "toolPackages": [
6
6
  {
7
7
  "packageName": "@microsoft/api-extractor",
8
- "packageVersion": "7.60.0"
8
+ "packageVersion": "7.60.1"
9
9
  }
10
10
  ]
11
11
  }