@effected/workspaces 0.47.0 → 0.48.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/Workspaces.js CHANGED
@@ -238,7 +238,7 @@ var Workspaces = class Workspaces {
238
238
  * package ships the layer.
239
239
  *
240
240
  * **The argv knowledge is not duplicated.** `LocalExec.prefixes(name)` is
241
- * the one home of the four managers' `exec`/`dlx`/script-runner prefixes;
241
+ * the one home of the three managers' `exec`/`dlx`/script-runner prefixes;
242
242
  * this layer
243
243
  * detects *which* manager owns the directory and asks `commands` what that
244
244
  * manager's argv looks like. Neither package reimplements the other's
@@ -252,7 +252,10 @@ var Workspaces = class Workspaces {
252
252
  * `LocalExecError` is reserved for **mechanism** failure — a manifest that
253
253
  * exists but cannot be read or parsed, which means something is broken
254
254
  * rather than absent. That is npm's resolver convention, adopted
255
- * verbatim.
255
+ * verbatim. A root run by a manager this package does not launch (an
256
+ * `UnsupportedPackageManagerError`) fails the same way: the manager is
257
+ * known, and answering `None` would let a caller run a global tool in its
258
+ * place.
256
259
  *
257
260
  * `directory` is the resolved **workspace root**, not the caller's cwd: a
258
261
  * project-local launcher has to run where the workspace is. `stopAt` caps
package/WorkspacesSync.js CHANGED
@@ -3,7 +3,7 @@ import { membershipOf, rulesFor } from "./internal/membership.js";
3
3
  import { decidePackageManager } from "./internal/packageManagerDecision.js";
4
4
  import { manifestPatternsOf, pnpmPatternsOf } from "./internal/patterns.js";
5
5
  import { Traversal, badMaxDepthMessage, isPruned, isValidMaxDepth, joinRelative } from "./internal/traverse.js";
6
- import { DetectedPackageManager, PackageManagerDetectionError, PackageManagerEvidence } from "./PackageManagerName.js";
6
+ import { PackageManagerDetectionError, PackageManagerEvidence, verdictResult } from "./PackageManagerName.js";
7
7
  import { WorkspaceDiscoveryError, WorkspacePatternError } from "./WorkspaceDiscovery.js";
8
8
  import { WorkspaceRootMatch, probedMarkers } from "./WorkspaceMarker.js";
9
9
  import { PublishConfig, WorkspaceManifestError, WorkspacePackage } from "./WorkspacePackage.js";
@@ -347,8 +347,8 @@ const readPackageSync = (options, root, directory, relativePath) => {
347
347
  * one decision too: on an npm root (as `detectPackageManagerSync` would
348
348
  * report it) `package.json#workspaces` is read the way npm reads it, through
349
349
  * `@effected/npm`'s `NpmWorkspacePatterns` — ordered negation, a trailing
350
- * `/`, an even `!` run, a backslash as a separator — and on a pnpm, yarn or
351
- * bun root as one `GlobSet`.
350
+ * `/`, an even `!` run, a backslash as a separator — and on every other root
351
+ * as one `GlobSet`.
352
352
  *
353
353
  * The one deliberate difference is what happens at a bound: the Effect surface
354
354
  * fails typed (`depthExceeded` / `budgetExceeded`), while this one truncates.
@@ -546,7 +546,7 @@ const detectPackageManagerSync = (root, options) => {
546
546
  return decision === void 0 ? Result.fail(new PackageManagerDetectionError({
547
547
  root,
548
548
  checked: PackageManagerEvidence.literals
549
- })) : Result.succeed(DetectedPackageManager.make(decision));
549
+ })) : verdictResult(root, decision);
550
550
  };
551
551
  /**
552
552
  * The project-local execution context for `cwd`, synchronously — what
@@ -563,7 +563,9 @@ const detectPackageManagerSync = (root, options) => {
563
563
  * - a detection refusal (`PackageManagerDetectionError`) is also
564
564
  * `Option.none()`: no identifiable launcher is not a failure;
565
565
  * - a root manifest that cannot be read or parsed is a mechanism failure, the
566
- * `Result`'s `LocalExecError` with the `WorkspaceManifestError` as its cause.
566
+ * `Result`'s `LocalExecError` with the `WorkspaceManifestError` as its cause;
567
+ * - a root run by a manager the kit does not launch fails the same way, with
568
+ * the `UnsupportedPackageManagerError` as the cause.
567
569
  *
568
570
  * The argv prefixes come from `LocalExec.prefixes` — the one home of that
569
571
  * knowledge — so nothing here re-derives `pnpm exec` or `npx --no --`.