@savvy-web/silk 2.4.0 → 2.4.2

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.
@@ -1,5 +1,5 @@
1
1
  import { builtinModules, createRequire } from "node:module";
2
- import { Cache, Chunk, Context, Data, Duration, Effect, Exit, Function, Layer, Option, Schema, Stream } from "effect";
2
+ import { Cache, Chunk, Context, Data, Duration, Effect, Exit, Function, Layer, Option, ParseResult, Schema, Stream } from "effect";
3
3
  import { Command, CommandExecutor, FileSystem, Path } from "@effect/platform";
4
4
  import * as path$1 from "node:path";
5
5
  import { basename, delimiter, dirname, isAbsolute, join, normalize, relative, resolve } from "node:path";
@@ -417,7 +417,7 @@ const trimTrailingSlashes = (s) => {
417
417
  };
418
418
 
419
419
  //#endregion
420
- //#region ../../node_modules/.pnpm/workspaces-effect@2.0.3_@effect+platform@0.96.2_effect@3.21.4__effect@3.21.4/node_modules/workspaces-effect/errors/CatalogAssemblyError.js
420
+ //#region ../../node_modules/.pnpm/workspaces-effect@2.1.0_@effect+platform@0.96.2_effect@3.21.4__effect@3.21.4/node_modules/workspaces-effect/errors/CatalogAssemblyError.js
421
421
  /**
422
422
  * Base constant for {@link CatalogAssemblyError}.
423
423
  *
@@ -445,7 +445,7 @@ var CatalogAssemblyError = class extends CatalogAssemblyErrorBase {
445
445
  };
446
446
 
447
447
  //#endregion
448
- //#region ../../node_modules/.pnpm/workspaces-effect@2.0.3_@effect+platform@0.96.2_effect@3.21.4__effect@3.21.4/node_modules/workspaces-effect/errors/CatalogResolutionError.js
448
+ //#region ../../node_modules/.pnpm/workspaces-effect@2.1.0_@effect+platform@0.96.2_effect@3.21.4__effect@3.21.4/node_modules/workspaces-effect/errors/CatalogResolutionError.js
449
449
  /**
450
450
  * Base constant for {@link CatalogResolutionError}.
451
451
  *
@@ -472,7 +472,7 @@ var CatalogResolutionError = class extends CatalogResolutionErrorBase {
472
472
  };
473
473
 
474
474
  //#endregion
475
- //#region ../../node_modules/.pnpm/workspaces-effect@2.0.3_@effect+platform@0.96.2_effect@3.21.4__effect@3.21.4/node_modules/workspaces-effect/errors/GitReadError.js
475
+ //#region ../../node_modules/.pnpm/workspaces-effect@2.1.0_@effect+platform@0.96.2_effect@3.21.4__effect@3.21.4/node_modules/workspaces-effect/errors/GitReadError.js
476
476
  /**
477
477
  * Base constant for {@link GitReadError}.
478
478
  *
@@ -498,7 +498,7 @@ var GitReadError = class extends GitReadErrorBase {
498
498
  };
499
499
 
500
500
  //#endregion
501
- //#region ../../node_modules/.pnpm/workspaces-effect@2.0.3_@effect+platform@0.96.2_effect@3.21.4__effect@3.21.4/node_modules/workspaces-effect/errors/PackageNotFoundError.js
501
+ //#region ../../node_modules/.pnpm/workspaces-effect@2.1.0_@effect+platform@0.96.2_effect@3.21.4__effect@3.21.4/node_modules/workspaces-effect/errors/PackageNotFoundError.js
502
502
  /**
503
503
  * Base constant for {@link PackageNotFoundError}.
504
504
  *
@@ -550,7 +550,7 @@ var PackageNotFoundError = class extends PackageNotFoundErrorBase {
550
550
  };
551
551
 
552
552
  //#endregion
553
- //#region ../../node_modules/.pnpm/workspaces-effect@2.0.3_@effect+platform@0.96.2_effect@3.21.4__effect@3.21.4/node_modules/workspaces-effect/errors/WorkspaceDiscoveryError.js
553
+ //#region ../../node_modules/.pnpm/workspaces-effect@2.1.0_@effect+platform@0.96.2_effect@3.21.4__effect@3.21.4/node_modules/workspaces-effect/errors/WorkspaceDiscoveryError.js
554
554
  /**
555
555
  * Base constant for {@link WorkspaceDiscoveryError}.
556
556
  *
@@ -602,7 +602,7 @@ var WorkspaceDiscoveryError = class extends WorkspaceDiscoveryErrorBase {
602
602
  };
603
603
 
604
604
  //#endregion
605
- //#region ../../node_modules/.pnpm/workspaces-effect@2.0.3_@effect+platform@0.96.2_effect@3.21.4__effect@3.21.4/node_modules/workspaces-effect/errors/WorkspaceRootNotFoundError.js
605
+ //#region ../../node_modules/.pnpm/workspaces-effect@2.1.0_@effect+platform@0.96.2_effect@3.21.4__effect@3.21.4/node_modules/workspaces-effect/errors/WorkspaceRootNotFoundError.js
606
606
  /**
607
607
  * Base constant for {@link WorkspaceRootNotFoundError}.
608
608
  *
@@ -653,7 +653,7 @@ var WorkspaceRootNotFoundError = class extends WorkspaceRootNotFoundErrorBase {
653
653
  };
654
654
 
655
655
  //#endregion
656
- //#region ../../node_modules/.pnpm/workspaces-effect@2.0.3_@effect+platform@0.96.2_effect@3.21.4__effect@3.21.4/node_modules/workspaces-effect/services/WorkspaceDiscovery.js
656
+ //#region ../../node_modules/.pnpm/workspaces-effect@2.1.0_@effect+platform@0.96.2_effect@3.21.4__effect@3.21.4/node_modules/workspaces-effect/services/WorkspaceDiscovery.js
657
657
  /**
658
658
  * Service for discovering workspace packages in a monorepo.
659
659
  *
@@ -704,7 +704,7 @@ var WorkspaceRootNotFoundError = class extends WorkspaceRootNotFoundErrorBase {
704
704
  var WorkspaceDiscovery = class extends Context.Tag("@spencerbeggs/workspaces-effect/WorkspaceDiscovery")() {};
705
705
 
706
706
  //#endregion
707
- //#region ../../node_modules/.pnpm/workspaces-effect@2.0.3_@effect+platform@0.96.2_effect@3.21.4__effect@3.21.4/node_modules/workspaces-effect/services/WorkspaceRoot.js
707
+ //#region ../../node_modules/.pnpm/workspaces-effect@2.1.0_@effect+platform@0.96.2_effect@3.21.4__effect@3.21.4/node_modules/workspaces-effect/services/WorkspaceRoot.js
708
708
  /**
709
709
  * Service for finding the workspace root directory.
710
710
  *
@@ -6447,7 +6447,7 @@ function parse$3(text, options) {
6447
6447
  }
6448
6448
 
6449
6449
  //#endregion
6450
- //#region ../../node_modules/.pnpm/workspaces-effect@2.0.3_@effect+platform@0.96.2_effect@3.21.4__effect@3.21.4/node_modules/workspaces-effect/layers/catalog/workspace-manifest.js
6450
+ //#region ../../node_modules/.pnpm/workspaces-effect@2.1.0_@effect+platform@0.96.2_effect@3.21.4__effect@3.21.4/node_modules/workspaces-effect/layers/catalog/workspace-manifest.js
6451
6451
  /**
6452
6452
  * Parse a pnpm-workspace.yaml text into its catalog/config-dependency/packages
6453
6453
  * slice. Pure with respect to the filesystem.
@@ -6523,7 +6523,7 @@ function checkDefaultCatalogIsDefinedOnce(manifest) {
6523
6523
  }
6524
6524
 
6525
6525
  //#endregion
6526
- //#region ../../node_modules/.pnpm/workspaces-effect@2.0.3_@effect+platform@0.96.2_effect@3.21.4__effect@3.21.4/node_modules/workspaces-effect/layers/catalog/assemble.js
6526
+ //#region ../../node_modules/.pnpm/workspaces-effect@2.1.0_@effect+platform@0.96.2_effect@3.21.4__effect@3.21.4/node_modules/workspaces-effect/layers/catalog/assemble.js
6527
6527
  /** Merge catalog sources; later sources win per dependency within a catalog. */
6528
6528
  function mergeCatalogs(...sources) {
6529
6529
  const result = {};
@@ -6608,7 +6608,7 @@ function resolveFromCatalog(catalogs, wantedDependency) {
6608
6608
  }
6609
6609
 
6610
6610
  //#endregion
6611
- //#region ../../node_modules/.pnpm/workspaces-effect@2.0.3_@effect+platform@0.96.2_effect@3.21.4__effect@3.21.4/node_modules/workspaces-effect/layers/catalog/resolve.js
6611
+ //#region ../../node_modules/.pnpm/workspaces-effect@2.1.0_@effect+platform@0.96.2_effect@3.21.4__effect@3.21.4/node_modules/workspaces-effect/layers/catalog/resolve.js
6612
6612
  const DEP_FIELDS = [
6613
6613
  "dependencies",
6614
6614
  "devDependencies",
@@ -6679,7 +6679,7 @@ function resolveManifest(catalogs, workspaceVersions, manifest) {
6679
6679
  }
6680
6680
 
6681
6681
  //#endregion
6682
- //#region ../../node_modules/.pnpm/workspaces-effect@2.0.3_@effect+platform@0.96.2_effect@3.21.4__effect@3.21.4/node_modules/workspaces-effect/schemas/CatalogSet.js
6682
+ //#region ../../node_modules/.pnpm/workspaces-effect@2.1.0_@effect+platform@0.96.2_effect@3.21.4__effect@3.21.4/node_modules/workspaces-effect/schemas/CatalogSet.js
6683
6683
  /**
6684
6684
  * An immutable, fully-normalized catalog collection with the one
6685
6685
  * resolution semantic shared by live and point-in-time resolution.
@@ -6770,7 +6770,110 @@ var CatalogSet = class CatalogSet extends Schema.Class("CatalogSet")({ entries:
6770
6770
  };
6771
6771
 
6772
6772
  //#endregion
6773
- //#region ../../node_modules/.pnpm/workspaces-effect@2.0.3_@effect+platform@0.96.2_effect@3.21.4__effect@3.21.4/node_modules/workspaces-effect/layers/point-in-time/worktree-catalogs.js
6773
+ //#region ../../node_modules/.pnpm/workspaces-effect@2.1.0_@effect+platform@0.96.2_effect@3.21.4__effect@3.21.4/node_modules/workspaces-effect/layers/catalog/package-json-workspaces.js
6774
+ /**
6775
+ * Reader for the npm/bun `workspaces` field of a root `package.json` — the
6776
+ * package.json counterpart to `workspace-manifest.ts` (which reads pnpm's
6777
+ * `pnpm-workspace.yaml`). Pure with respect to the filesystem.
6778
+ *
6779
+ * @packageDocumentation
6780
+ * @internal
6781
+ */
6782
+ const CatalogRecordSchema = Schema.Record({
6783
+ key: Schema.String,
6784
+ value: Schema.String
6785
+ }).annotations({ identifier: "CatalogRecord" });
6786
+ const CatalogsRecordSchema = Schema.Record({
6787
+ key: Schema.String,
6788
+ value: CatalogRecordSchema
6789
+ }).annotations({ identifier: "CatalogsRecord" });
6790
+ const PackageJsonWorkspacesArraySchema = Schema.mutable(Schema.Array(Schema.String)).annotations({ identifier: "PackageJsonWorkspacesArray" });
6791
+ const PackageJsonWorkspacesObjectSchema = Schema.Struct({
6792
+ packages: Schema.optional(Schema.Array(Schema.String)),
6793
+ catalog: Schema.optional(CatalogRecordSchema),
6794
+ catalogs: Schema.optional(CatalogsRecordSchema)
6795
+ }).annotations({ identifier: "PackageJsonWorkspacesObject" });
6796
+ /**
6797
+ * The shape npm/bun accept for a root `package.json`'s `workspaces` field:
6798
+ * an array of globs, or an object carrying `packages` and (for bun) `catalog`
6799
+ * / `catalogs`. Any other JSON value (a number, string, boolean, `null`, or
6800
+ * an object with malformed `packages`/`catalog`/`catalogs`) is malformed.
6801
+ */
6802
+ const WorkspacesFieldSchema = Schema.Union(PackageJsonWorkspacesArraySchema, PackageJsonWorkspacesObjectSchema).annotations({ identifier: "PackageJsonWorkspacesField" });
6803
+ const PackageJsonWithWorkspacesSchema = Schema.Struct({ workspaces: Schema.optionalWith(WorkspacesFieldSchema, { nullable: true }) });
6804
+ /**
6805
+ * Parse the `workspaces` field out of a root `package.json`'s text.
6806
+ *
6807
+ * @param content - Raw `package.json` text.
6808
+ * @returns An Effect yielding the workspaces slice; all fields are `undefined`
6809
+ * when the manifest has no `workspaces` field, or when `workspaces` is
6810
+ * explicitly `null` (both are legitimate, common shapes — not every root
6811
+ * `package.json` declares workspaces, and `null` is a plausible output of
6812
+ * tooling that serializes a stripped field). Fails with
6813
+ * {@link CatalogAssemblyError} when the text is not valid JSON, or when a
6814
+ * present, non-null `workspaces` field is not a valid npm/bun shape (not an
6815
+ * array of strings and not an object with valid
6816
+ * `packages`/`catalog`/`catalogs`) — an unreadable manifest must never be
6817
+ * silently treated as an empty one, since that would make every dependency
6818
+ * in the workspace look "added".
6819
+ *
6820
+ * @public
6821
+ */
6822
+ const parsePackageJsonWorkspaces = (content) => Effect.gen(function* () {
6823
+ const parsed = yield* Effect.try({
6824
+ try: () => JSON.parse(content),
6825
+ catch: (error) => new CatalogAssemblyError({
6826
+ source: "manifest",
6827
+ reason: `invalid json: ${String(error)}`
6828
+ })
6829
+ });
6830
+ const ws = (yield* Schema.decodeUnknown(PackageJsonWithWorkspacesSchema)(parsed).pipe(Effect.mapError((error) => new CatalogAssemblyError({
6831
+ source: "manifest",
6832
+ reason: `malformed workspaces field: ${ParseResult.TreeFormatter.formatErrorSync(error)}`
6833
+ })))).workspaces;
6834
+ if (ws === void 0) return {};
6835
+ if (Array.isArray(ws)) return { packages: ws };
6836
+ return {
6837
+ packages: ws.packages,
6838
+ catalog: ws.catalog,
6839
+ catalogs: ws.catalogs
6840
+ };
6841
+ });
6842
+ /**
6843
+ * Build a {@link CatalogSet} from a root `package.json`'s `workspaces` field.
6844
+ *
6845
+ * @remarks
6846
+ * `workspaces.catalog` becomes the `"default"` catalog; every key of
6847
+ * `workspaces.catalogs` becomes a catalog of that name. This mirrors how
6848
+ * {@link CatalogSet.fromWorkspaceYaml} treats pnpm's `catalog:` / `catalogs:`.
6849
+ *
6850
+ * Declaring the default catalog twice — once as `workspaces.catalog` and
6851
+ * again as `workspaces.catalogs.default` — is rejected with
6852
+ * {@link CatalogAssemblyError} rather than silently resolved (pnpm itself
6853
+ * rejects the equivalent duplication in `pnpm-workspace.yaml`). Presence is
6854
+ * checked structurally (`!== undefined` / `Object.hasOwn`), not by
6855
+ * truthiness, so an explicitly-declared empty catalog (`catalog: {}` or
6856
+ * `catalogs: { default: {} }`) still counts as a declaration.
6857
+ *
6858
+ * @param content - Raw `package.json` text.
6859
+ *
6860
+ * @public
6861
+ */
6862
+ const catalogSetFromPackageJson = (content) => parsePackageJsonWorkspaces(content).pipe(Effect.flatMap((ws) => {
6863
+ const hasCatalog = ws.catalog !== void 0;
6864
+ const hasCatalogsDefault = ws.catalogs !== void 0 && Object.hasOwn(ws.catalogs, "default");
6865
+ if (hasCatalog && hasCatalogsDefault) return Effect.fail(new CatalogAssemblyError({
6866
+ source: "manifest",
6867
+ reason: "the default catalog is defined twice: once as `workspaces.catalog` and once as `workspaces.catalogs.default` — remove one"
6868
+ }));
6869
+ return Effect.succeed(CatalogSet.fromCatalogs({
6870
+ ...hasCatalog ? { default: ws.catalog } : {},
6871
+ ...ws.catalogs ?? {}
6872
+ }));
6873
+ }));
6874
+
6875
+ //#endregion
6876
+ //#region ../../node_modules/.pnpm/workspaces-effect@2.1.0_@effect+platform@0.96.2_effect@3.21.4__effect@3.21.4/node_modules/workspaces-effect/layers/point-in-time/worktree-catalogs.js
6774
6877
  /**
6775
6878
  * The ONE code path that reads the working tree's catalog sources
6776
6879
  * (`pnpm-workspace.yaml` + `pnpm-lock.yaml`). Consumed by
@@ -6789,6 +6892,20 @@ var CatalogSet = class CatalogSet extends Schema.Class("CatalogSet")({ entries:
6789
6892
  */
6790
6893
  const lockfileCatalogsFromText = (text) => parse$3(text).pipe(Effect.map((parsed) => CatalogSet.fromLockfileCatalogs(parsed?.catalogs)), Effect.orElseSucceed(() => CatalogSet.empty()));
6791
6894
  /**
6895
+ * Read catalogs from the root `package.json` `workspaces` field. Missing or
6896
+ * unreadable manifest yields an empty set — a repo with no catalogs is normal.
6897
+ *
6898
+ * @internal
6899
+ */
6900
+ const readPackageJsonCatalogs = (fs, path, root) => Effect.gen(function* () {
6901
+ const pkgPath = path.join(root, "package.json");
6902
+ if (!(yield* fs.exists(pkgPath).pipe(Effect.orElseSucceed(() => false)))) return CatalogSet.empty();
6903
+ return yield* catalogSetFromPackageJson(yield* fs.readFileString(pkgPath).pipe(Effect.mapError((error) => new CatalogAssemblyError({
6904
+ source: "manifest",
6905
+ reason: `failed to read ${pkgPath}: ${String(error)}`
6906
+ }))));
6907
+ });
6908
+ /**
6792
6909
  * Read the working tree's catalog state at `root`.
6793
6910
  *
6794
6911
  * A missing `pnpm-lock.yaml` yields empty lockfile catalogs; any OTHER read
@@ -6800,11 +6917,17 @@ const lockfileCatalogsFromText = (text) => parse$3(text).pipe(Effect.map((parsed
6800
6917
  const readWorktreeCatalogState = (root) => Effect.gen(function* () {
6801
6918
  const fs = yield* FileSystem.FileSystem;
6802
6919
  const path = yield* Path.Path;
6803
- const manifest = yield* readWorkspaceManifest(root);
6804
- const inline = CatalogSet.fromCatalogs(inlineCatalogs({
6920
+ const manifestPath = path.join(root, "pnpm-workspace.yaml");
6921
+ const hasPnpmManifest = yield* fs.exists(manifestPath).pipe(Effect.orElseSucceed(() => false));
6922
+ const manifest = hasPnpmManifest ? yield* readWorkspaceManifest(root) : {
6923
+ catalog: void 0,
6924
+ catalogs: void 0,
6925
+ configDependencies: void 0
6926
+ };
6927
+ const inline = hasPnpmManifest ? CatalogSet.fromCatalogs(inlineCatalogs({
6805
6928
  catalog: manifest.catalog,
6806
6929
  catalogs: manifest.catalogs
6807
- }));
6930
+ })) : yield* readPackageJsonCatalogs(fs, path, root);
6808
6931
  const lockPath = path.join(root, "pnpm-lock.yaml");
6809
6932
  const lockText = yield* fs.readFileString(lockPath).pipe(Effect.catchAll((error) => error._tag === "SystemError" && error.reason === "NotFound" ? Effect.succeed(null) : Effect.fail(new CatalogAssemblyError({
6810
6933
  source: "lockfile",
@@ -8326,7 +8449,7 @@ minimatch.escape = escape;
8326
8449
  minimatch.unescape = unescape;
8327
8450
 
8328
8451
  //#endregion
8329
- //#region ../../node_modules/.pnpm/workspaces-effect@2.0.3_@effect+platform@0.96.2_effect@3.21.4__effect@3.21.4/node_modules/workspaces-effect/schemas/core.js
8452
+ //#region ../../node_modules/.pnpm/workspaces-effect@2.1.0_@effect+platform@0.96.2_effect@3.21.4__effect@3.21.4/node_modules/workspaces-effect/schemas/core.js
8330
8453
  /**
8331
8454
  * Schema for supported package manager identifiers.
8332
8455
  *
@@ -9949,7 +10072,7 @@ function modifyImpl(text, path, value, formattingOptions) {
9949
10072
  }
9950
10073
 
9951
10074
  //#endregion
9952
- //#region ../../node_modules/.pnpm/workspaces-effect@2.0.3_@effect+platform@0.96.2_effect@3.21.4__effect@3.21.4/node_modules/workspaces-effect/schemas/WorkspaceStateSnapshot.js
10075
+ //#region ../../node_modules/.pnpm/workspaces-effect@2.1.0_@effect+platform@0.96.2_effect@3.21.4__effect@3.21.4/node_modules/workspaces-effect/schemas/WorkspaceStateSnapshot.js
9953
10076
  const DepRecord = Schema.optionalWith(Schema.Record({
9954
10077
  key: Schema.String,
9955
10078
  value: Schema.String
@@ -10019,7 +10142,7 @@ var WorkspaceStateSnapshot = class extends Schema.Class("WorkspaceStateSnapshot"
10019
10142
  };
10020
10143
 
10021
10144
  //#endregion
10022
- //#region ../../node_modules/.pnpm/workspaces-effect@2.0.3_@effect+platform@0.96.2_effect@3.21.4__effect@3.21.4/node_modules/workspaces-effect/services/PointInTimeWorkspace.js
10145
+ //#region ../../node_modules/.pnpm/workspaces-effect@2.1.0_@effect+platform@0.96.2_effect@3.21.4__effect@3.21.4/node_modules/workspaces-effect/services/PointInTimeWorkspace.js
10023
10146
  /**
10024
10147
  * Service for reading a monorepo's workspace state at a specific moment: any
10025
10148
  * git ref (via `git show`/`git ls-tree`, without checking the ref out) or the
@@ -10047,7 +10170,7 @@ var WorkspaceStateSnapshot = class extends Schema.Class("WorkspaceStateSnapshot"
10047
10170
  var PointInTimeWorkspace = class extends Context.Tag("@spencerbeggs/workspaces-effect/PointInTimeWorkspace")() {};
10048
10171
 
10049
10172
  //#endregion
10050
- //#region ../../node_modules/.pnpm/workspaces-effect@2.0.3_@effect+platform@0.96.2_effect@3.21.4__effect@3.21.4/node_modules/workspaces-effect/layers/discovery/glob-core.js
10173
+ //#region ../../node_modules/.pnpm/workspaces-effect@2.1.0_@effect+platform@0.96.2_effect@3.21.4__effect@3.21.4/node_modules/workspaces-effect/layers/discovery/glob-core.js
10051
10174
  const normalize$2 = (pattern) => pattern.replace(/\/\*\*$/, "/*");
10052
10175
  const toRegex = (glob) => new RegExp(`^${glob.replace(/[.+^${}()|[\]\\]/g, "\\$&").replace(/\*/g, "[^/]*").replace(/\?/g, "[^/]")}$`);
10053
10176
  /**
@@ -10091,7 +10214,7 @@ const compileWorkspaceGlobs = (patterns) => {
10091
10214
  };
10092
10215
 
10093
10216
  //#endregion
10094
- //#region ../../node_modules/.pnpm/workspaces-effect@2.0.3_@effect+platform@0.96.2_effect@3.21.4__effect@3.21.4/node_modules/workspaces-effect/layers/point-in-time/git.js
10217
+ //#region ../../node_modules/.pnpm/workspaces-effect@2.1.0_@effect+platform@0.96.2_effect@3.21.4__effect@3.21.4/node_modules/workspaces-effect/layers/point-in-time/git.js
10095
10218
  /**
10096
10219
  * Stderr shapes that mean "the path is not present at this ref" rather than
10097
10220
  * "the git command failed."
@@ -10184,7 +10307,7 @@ const makeGitReader = (executor, options) => {
10184
10307
  };
10185
10308
 
10186
10309
  //#endregion
10187
- //#region ../../node_modules/.pnpm/workspaces-effect@2.0.3_@effect+platform@0.96.2_effect@3.21.4__effect@3.21.4/node_modules/workspaces-effect/layers/PointInTimeWorkspaceLive.js
10310
+ //#region ../../node_modules/.pnpm/workspaces-effect@2.1.0_@effect+platform@0.96.2_effect@3.21.4__effect@3.21.4/node_modules/workspaces-effect/layers/PointInTimeWorkspaceLive.js
10188
10311
  /**
10189
10312
  * Live layer for the {@link PointInTimeWorkspace} service.
10190
10313
  *
@@ -10259,16 +10382,17 @@ const PointInTimeWorkspaceLive = Layer.effect(PointInTimeWorkspace, Effect.gen(f
10259
10382
  const resolveRoot = (cwd) => workspaceRoot.find(cwd ?? process.cwd());
10260
10383
  const readAtRef = (root, ref) => Effect.gen(function* () {
10261
10384
  const wsYaml = yield* reader.show(root, ref, "pnpm-workspace.yaml");
10262
- const manifest = Option.isSome(wsYaml) ? yield* workspaceManifestFromYaml(wsYaml.value) : {
10385
+ const rootPkgJson = Option.isSome(wsYaml) ? Option.none() : yield* reader.show(root, ref, "package.json");
10386
+ const manifest = Option.isSome(wsYaml) ? yield* workspaceManifestFromYaml(wsYaml.value) : Option.isSome(rootPkgJson) ? yield* parsePackageJsonWorkspaces(rootPkgJson.value) : {
10263
10387
  catalog: void 0,
10264
10388
  catalogs: void 0,
10265
10389
  configDependencies: void 0,
10266
10390
  packages: void 0
10267
10391
  };
10268
- const inline = CatalogSet.fromCatalogs(inlineCatalogs({
10392
+ const inline = Option.isSome(wsYaml) ? CatalogSet.fromCatalogs(inlineCatalogs({
10269
10393
  catalog: manifest.catalog,
10270
10394
  catalogs: manifest.catalogs
10271
- }));
10395
+ })) : Option.isSome(rootPkgJson) ? yield* catalogSetFromPackageJson(rootPkgJson.value) : CatalogSet.empty();
10272
10396
  const lockText = yield* reader.show(root, ref, "pnpm-lock.yaml");
10273
10397
  const lockCatalogs = yield* lockfileCatalogsAtRef(lockText);
10274
10398
  const compiled = compileWorkspaceGlobs(manifest.packages ?? []);
@@ -10327,7 +10451,7 @@ const PointInTimeWorkspaceLive = Layer.effect(PointInTimeWorkspace, Effect.gen(f
10327
10451
  }));
10328
10452
 
10329
10453
  //#endregion
10330
- //#region ../../node_modules/.pnpm/workspaces-effect@2.0.3_@effect+platform@0.96.2_effect@3.21.4__effect@3.21.4/node_modules/workspaces-effect/schemas/publish.js
10454
+ //#region ../../node_modules/.pnpm/workspaces-effect@2.1.0_@effect+platform@0.96.2_effect@3.21.4__effect@3.21.4/node_modules/workspaces-effect/schemas/publish.js
10331
10455
  /**
10332
10456
  * Schema for package publish targets.
10333
10457
  *
@@ -10371,7 +10495,7 @@ var PublishTarget = class extends Schema.Class("PublishTarget")({
10371
10495
  }) {};
10372
10496
 
10373
10497
  //#endregion
10374
- //#region ../../node_modules/.pnpm/workspaces-effect@2.0.3_@effect+platform@0.96.2_effect@3.21.4__effect@3.21.4/node_modules/workspaces-effect/services/PublishabilityDetector.js
10498
+ //#region ../../node_modules/.pnpm/workspaces-effect@2.1.0_@effect+platform@0.96.2_effect@3.21.4__effect@3.21.4/node_modules/workspaces-effect/services/PublishabilityDetector.js
10375
10499
  /**
10376
10500
  * Service for detecting whether a workspace package is publishable and
10377
10501
  * identifying its publish targets (npm, GitHub Packages, etc.).
@@ -10434,7 +10558,7 @@ var PublishTarget = class extends Schema.Class("PublishTarget")({
10434
10558
  var PublishabilityDetector = class extends Context.Tag("@spencerbeggs/workspaces-effect/PublishabilityDetector")() {};
10435
10559
 
10436
10560
  //#endregion
10437
- //#region ../../node_modules/.pnpm/workspaces-effect@2.0.3_@effect+platform@0.96.2_effect@3.21.4__effect@3.21.4/node_modules/workspaces-effect/layers/PublishabilityDetectorLive.js
10561
+ //#region ../../node_modules/.pnpm/workspaces-effect@2.1.0_@effect+platform@0.96.2_effect@3.21.4__effect@3.21.4/node_modules/workspaces-effect/layers/PublishabilityDetectorLive.js
10438
10562
  /**
10439
10563
  * Default live implementation of the {@link PublishabilityDetector} service.
10440
10564
  *
@@ -10507,7 +10631,7 @@ const PublishabilityDetectorLive = Layer.succeed(PublishabilityDetector, { detec
10507
10631
  }).pipe(Effect.withSpan("PublishabilityDetector.detect", { attributes: { "workspace.package": pkg.name } })) });
10508
10632
 
10509
10633
  //#endregion
10510
- //#region ../../node_modules/.pnpm/workspaces-effect@2.0.3_@effect+platform@0.96.2_effect@3.21.4__effect@3.21.4/node_modules/workspaces-effect/layers/WorkspaceDiscoveryLive.js
10634
+ //#region ../../node_modules/.pnpm/workspaces-effect@2.1.0_@effect+platform@0.96.2_effect@3.21.4__effect@3.21.4/node_modules/workspaces-effect/layers/WorkspaceDiscoveryLive.js
10511
10635
  /**
10512
10636
  * Live implementation of the {@link WorkspaceDiscovery} service.
10513
10637
  *
@@ -10795,7 +10919,7 @@ const WorkspaceDiscoveryLive = Layer.effect(WorkspaceDiscovery, Effect.gen(funct
10795
10919
  }));
10796
10920
 
10797
10921
  //#endregion
10798
- //#region ../../node_modules/.pnpm/workspaces-effect@2.0.3_@effect+platform@0.96.2_effect@3.21.4__effect@3.21.4/node_modules/workspaces-effect/layers/WorkspaceRootLive.js
10922
+ //#region ../../node_modules/.pnpm/workspaces-effect@2.1.0_@effect+platform@0.96.2_effect@3.21.4__effect@3.21.4/node_modules/workspaces-effect/layers/WorkspaceRootLive.js
10799
10923
  /**
10800
10924
  * Live implementation of the {@link WorkspaceRoot} service.
10801
10925
  *