@savvy-web/silk 3.7.5 → 3.7.7

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.
@@ -2353,7 +2353,7 @@ var GlobSet = class GlobSet extends Schema.Class("GlobSet")(Schema.Struct({ patt
2353
2353
  };
2354
2354
 
2355
2355
  //#endregion
2356
- //#region ../../node_modules/.pnpm/@effected+lockfiles@0.4.1_@effected+jsonc@0.6.0_effect@4.0.0-beta.107__@effected+npm@0._0858c2cd87fcfa2cb556a350de7e385b/node_modules/@effected/lockfiles/BunExtension.js
2356
+ //#region ../../node_modules/.pnpm/@effected+lockfiles@0.4.2_@effected+jsonc@0.6.0_effect@4.0.0-beta.107__@effected+npm@0._ed7d42fde2c58956d6dad4ab1717694c/node_modules/@effected/lockfiles/BunExtension.js
2357
2357
  /**
2358
2358
  * Extension data specific to bun lockfiles, attached to `Lockfile.extension`
2359
2359
  * when the format is `"bun"`.
@@ -5521,7 +5521,7 @@ var ReleaseAgeGate = class ReleaseAgeGate extends Schema.Class("ReleaseAgeGate")
5521
5521
  };
5522
5522
 
5523
5523
  //#endregion
5524
- //#region ../../node_modules/.pnpm/@effected+lockfiles@0.4.1_@effected+jsonc@0.6.0_effect@4.0.0-beta.107__@effected+npm@0._0858c2cd87fcfa2cb556a350de7e385b/node_modules/@effected/lockfiles/ImporterDependency.js
5524
+ //#region ../../node_modules/.pnpm/@effected+lockfiles@0.4.2_@effected+jsonc@0.6.0_effect@4.0.0-beta.107__@effected+npm@0._ed7d42fde2c58956d6dad4ab1717694c/node_modules/@effected/lockfiles/ImporterDependency.js
5525
5525
  /**
5526
5526
  * One declared dependency of one workspace importer, as the lockfile records it.
5527
5527
  *
@@ -5560,7 +5560,7 @@ var ImporterDependency = class extends Schema.Class("ImporterDependency")({
5560
5560
  }) {};
5561
5561
 
5562
5562
  //#endregion
5563
- //#region ../../node_modules/.pnpm/@effected+lockfiles@0.4.1_@effected+jsonc@0.6.0_effect@4.0.0-beta.107__@effected+npm@0._0858c2cd87fcfa2cb556a350de7e385b/node_modules/@effected/lockfiles/LockfileImporter.js
5563
+ //#region ../../node_modules/.pnpm/@effected+lockfiles@0.4.2_@effected+jsonc@0.6.0_effect@4.0.0-beta.107__@effected+npm@0._ed7d42fde2c58956d6dad4ab1717694c/node_modules/@effected/lockfiles/LockfileImporter.js
5564
5564
  /**
5565
5565
  * One workspace importer's declared dependencies, as the lockfile records them.
5566
5566
  *
@@ -5585,7 +5585,7 @@ var LockfileImporter = class extends Schema.Class("LockfileImporter")({
5585
5585
  }) {};
5586
5586
 
5587
5587
  //#endregion
5588
- //#region ../../node_modules/.pnpm/@effected+lockfiles@0.4.1_@effected+jsonc@0.6.0_effect@4.0.0-beta.107__@effected+npm@0._0858c2cd87fcfa2cb556a350de7e385b/node_modules/@effected/lockfiles/ResolvedPackage.js
5588
+ //#region ../../node_modules/.pnpm/@effected+lockfiles@0.4.2_@effected+jsonc@0.6.0_effect@4.0.0-beta.107__@effected+npm@0._ed7d42fde2c58956d6dad4ab1717694c/node_modules/@effected/lockfiles/ResolvedPackage.js
5589
5589
  const EMPTY_DEPENDENCIES = {};
5590
5590
  /**
5591
5591
  * A package resolved from a lockfile.
@@ -5621,7 +5621,7 @@ var ResolvedPackage = class extends Schema.Class("ResolvedPackage")({
5621
5621
  }) {};
5622
5622
 
5623
5623
  //#endregion
5624
- //#region ../../node_modules/.pnpm/@effected+lockfiles@0.4.1_@effected+jsonc@0.6.0_effect@4.0.0-beta.107__@effected+npm@0._0858c2cd87fcfa2cb556a350de7e385b/node_modules/@effected/lockfiles/WorkspaceDependency.js
5624
+ //#region ../../node_modules/.pnpm/@effected+lockfiles@0.4.2_@effected+jsonc@0.6.0_effect@4.0.0-beta.107__@effected+npm@0._ed7d42fde2c58956d6dad4ab1717694c/node_modules/@effected/lockfiles/WorkspaceDependency.js
5625
5625
  /**
5626
5626
  * A directed dependency edge between two workspace packages as recorded in
5627
5627
  * the lockfile.
@@ -5644,7 +5644,7 @@ var WorkspaceDependency = class extends Schema.Class("WorkspaceDependency")({
5644
5644
  }) {};
5645
5645
 
5646
5646
  //#endregion
5647
- //#region ../../node_modules/.pnpm/@effected+lockfiles@0.4.1_@effected+jsonc@0.6.0_effect@4.0.0-beta.107__@effected+npm@0._0858c2cd87fcfa2cb556a350de7e385b/node_modules/@effected/lockfiles/PnpmExtension.js
5647
+ //#region ../../node_modules/.pnpm/@effected+lockfiles@0.4.2_@effected+jsonc@0.6.0_effect@4.0.0-beta.107__@effected+npm@0._ed7d42fde2c58956d6dad4ab1717694c/node_modules/@effected/lockfiles/PnpmExtension.js
5648
5648
  /**
5649
5649
  * Extension data specific to pnpm lockfiles, attached to `Lockfile.extension`
5650
5650
  * when the format is `"pnpm"`.
@@ -5670,7 +5670,7 @@ var PnpmExtension = class extends Schema.Class("PnpmExtension")({
5670
5670
  }) {};
5671
5671
 
5672
5672
  //#endregion
5673
- //#region ../../node_modules/.pnpm/@effected+lockfiles@0.4.1_@effected+jsonc@0.6.0_effect@4.0.0-beta.107__@effected+npm@0._0858c2cd87fcfa2cb556a350de7e385b/node_modules/@effected/lockfiles/LockfileFormat.js
5673
+ //#region ../../node_modules/.pnpm/@effected+lockfiles@0.4.2_@effected+jsonc@0.6.0_effect@4.0.0-beta.107__@effected+npm@0._ed7d42fde2c58956d6dad4ab1717694c/node_modules/@effected/lockfiles/LockfileFormat.js
5674
5674
  /**
5675
5675
  * The lockfile formats this package parses: bun's `bun.lock` (JSONC), npm's
5676
5676
  * `package-lock.json` (v2/v3 JSON), pnpm's `pnpm-lock.yaml` and yarn Berry's
@@ -5709,7 +5709,7 @@ const FILENAMES = {
5709
5709
  const filenameFor = (format) => FILENAMES[format][0];
5710
5710
 
5711
5711
  //#endregion
5712
- //#region ../../node_modules/.pnpm/@effected+lockfiles@0.4.1_@effected+jsonc@0.6.0_effect@4.0.0-beta.107__@effected+npm@0._0858c2cd87fcfa2cb556a350de7e385b/node_modules/@effected/lockfiles/internal/shared.js
5712
+ //#region ../../node_modules/.pnpm/@effected+lockfiles@0.4.2_@effected+jsonc@0.6.0_effect@4.0.0-beta.107__@effected+npm@0._ed7d42fde2c58956d6dad4ab1717694c/node_modules/@effected/lockfiles/internal/shared.js
5713
5713
  /**
5714
5714
  * The four dependency sections of a manifest, in a stable order — the shared
5715
5715
  * dependency-sections table (v3's `DEP_SECTIONS`). Each entry is both the
@@ -7681,7 +7681,7 @@ var JsoncModifier = class {
7681
7681
  };
7682
7682
 
7683
7683
  //#endregion
7684
- //#region ../../node_modules/.pnpm/@effected+lockfiles@0.4.1_@effected+jsonc@0.6.0_effect@4.0.0-beta.107__@effected+npm@0._0858c2cd87fcfa2cb556a350de7e385b/node_modules/@effected/lockfiles/internal/bun.js
7684
+ //#region ../../node_modules/.pnpm/@effected+lockfiles@0.4.2_@effected+jsonc@0.6.0_effect@4.0.0-beta.107__@effected+npm@0._ed7d42fde2c58956d6dad4ab1717694c/node_modules/@effected/lockfiles/internal/bun.js
7685
7685
  const DepRecord$2 = Schema.optionalKey(Schema.Record(Schema.String, Schema.String));
7686
7686
  const BunWorkspaceEntry = Schema.Struct({
7687
7687
  name: Schema.optionalKey(Schema.String),
@@ -7775,7 +7775,7 @@ const toFields$3 = (raw) => Effect.gen(function* () {
7775
7775
  });
7776
7776
 
7777
7777
  //#endregion
7778
- //#region ../../node_modules/.pnpm/@effected+lockfiles@0.4.1_@effected+jsonc@0.6.0_effect@4.0.0-beta.107__@effected+npm@0._0858c2cd87fcfa2cb556a350de7e385b/node_modules/@effected/lockfiles/internal/npm.js
7778
+ //#region ../../node_modules/.pnpm/@effected+lockfiles@0.4.2_@effected+jsonc@0.6.0_effect@4.0.0-beta.107__@effected+npm@0._ed7d42fde2c58956d6dad4ab1717694c/node_modules/@effected/lockfiles/internal/npm.js
7779
7779
  const DepRecord$1 = Schema.optionalKey(Schema.Record(Schema.String, Schema.String));
7780
7780
  const NpmPackageEntry = Schema.Struct({
7781
7781
  name: Schema.optionalKey(Schema.String),
@@ -7874,7 +7874,7 @@ const toFields$2 = (raw) => Effect.gen(function* () {
7874
7874
  });
7875
7875
 
7876
7876
  //#endregion
7877
- //#region ../../node_modules/.pnpm/@effected+yaml@0.8.0_effect@4.0.0-beta.107/node_modules/@effected/yaml/YamlNode.js
7877
+ //#region ../../node_modules/.pnpm/@effected+yaml@0.9.0_effect@4.0.0-beta.107/node_modules/@effected/yaml/YamlNode.js
7878
7878
  /**
7879
7879
  * YAML scalar presentation styles.
7880
7880
  *
@@ -7994,12 +7994,19 @@ var YamlScalar = class extends Schema.TaggedClass()("YamlScalar", {
7994
7994
  * A YAML alias AST node, referencing a previously defined anchor by name
7995
7995
  * (without the leading `*`).
7996
7996
  *
7997
+ * Carries the same comment triple as every other node class — see
7998
+ * {@link YamlScalar} for the field semantics. An alias is a node like any
7999
+ * other and a comment can legally sit above or after one.
8000
+ *
7997
8001
  * @public
7998
8002
  */
7999
8003
  var YamlAlias = class extends Schema.TaggedClass()("YamlAlias", {
8000
8004
  name: Schema.String,
8001
8005
  offset: Schema.Number,
8002
- length: Schema.Number
8006
+ length: Schema.Number,
8007
+ commentBefore: Schema.optionalKey(Schema.String),
8008
+ comment: Schema.optionalKey(Schema.String),
8009
+ spaceBefore: Schema.optionalKey(Schema.Boolean)
8003
8010
  }) {
8004
8011
  /** See `YamlScalar.find`. Pure. */
8005
8012
  find(path) {
@@ -8042,20 +8049,18 @@ const YamlNode = Schema.suspend(() => Schema.Union([
8042
8049
  * A YAML key-value pair AST node, representing one entry within a mapping.
8043
8050
  * `value` is `null` when absent (e.g. `key:` with no value).
8044
8051
  *
8045
- * - `commentBefore` own-line comment text directly above the pair's key
8046
- * (multiple consecutive comment lines join with `\n`).
8047
- * - `comment` trailing comment text on the pair's line (strictly trailing).
8048
- * - `spaceBefore` `true` when a blank line precedes the pair (and its
8049
- * `commentBefore` block, when present) in the source.
8052
+ * A pair carries **no comment fields**. Comments belong to the pair's `key`
8053
+ * and `value` nodes, which have one comment slot each: an own-line comment
8054
+ * above the entry leads the `key`, and a trailing comment on the entry's line
8055
+ * follows the `value`. Two slots rather than one is what lets `a: # kc` keep
8056
+ * its comment where the author wrote it instead of relocating it onto the
8057
+ * value's line.
8050
8058
  *
8051
8059
  * @public
8052
8060
  */
8053
8061
  var YamlPair = class extends Schema.TaggedClass()("YamlPair", {
8054
8062
  key: Schema.suspend(() => YamlNode),
8055
- value: Schema.NullOr(Schema.suspend(() => YamlNode)),
8056
- commentBefore: Schema.optionalKey(Schema.String),
8057
- comment: Schema.optionalKey(Schema.String),
8058
- spaceBefore: Schema.optionalKey(Schema.Boolean)
8063
+ value: Schema.NullOr(Schema.suspend(() => YamlNode))
8059
8064
  }) {};
8060
8065
  /**
8061
8066
  * A YAML mapping AST node, representing a collection of {@link YamlPair}
@@ -8311,7 +8316,7 @@ function nodeToValue(node, anchors, budget, counting = false) {
8311
8316
  }
8312
8317
 
8313
8318
  //#endregion
8314
- //#region ../../node_modules/.pnpm/@effected+yaml@0.8.0_effect@4.0.0-beta.107/node_modules/@effected/yaml/internal/diagnostics.js
8319
+ //#region ../../node_modules/.pnpm/@effected+yaml@0.9.0_effect@4.0.0-beta.107/node_modules/@effected/yaml/internal/diagnostics.js
8315
8320
  /** Error codes emitted by the lexer stage. */
8316
8321
  const YAML_LEX_ERROR_CODES = [
8317
8322
  "UnexpectedCharacter",
@@ -8399,7 +8404,7 @@ function isFatalCode(code) {
8399
8404
  }
8400
8405
 
8401
8406
  //#endregion
8402
- //#region ../../node_modules/.pnpm/@effected+yaml@0.8.0_effect@4.0.0-beta.107/node_modules/@effected/yaml/YamlDiagnostic.js
8407
+ //#region ../../node_modules/.pnpm/@effected+yaml@0.9.0_effect@4.0.0-beta.107/node_modules/@effected/yaml/YamlDiagnostic.js
8403
8408
  /**
8404
8409
  * Error codes emitted by the lexer stage.
8405
8410
  *
@@ -8521,7 +8526,7 @@ function lineChar(text, offset) {
8521
8526
  }
8522
8527
 
8523
8528
  //#endregion
8524
- //#region ../../node_modules/.pnpm/@effected+yaml@0.8.0_effect@4.0.0-beta.107/node_modules/@effected/yaml/internal/lexer.js
8529
+ //#region ../../node_modules/.pnpm/@effected+yaml@0.9.0_effect@4.0.0-beta.107/node_modules/@effected/yaml/internal/lexer.js
8525
8530
  /**
8526
8531
  * Create a new YAML scanner for the given source text.
8527
8532
  *
@@ -9485,7 +9490,7 @@ function lexAll(text) {
9485
9490
  }
9486
9491
 
9487
9492
  //#endregion
9488
- //#region ../../node_modules/.pnpm/@effected+yaml@0.8.0_effect@4.0.0-beta.107/node_modules/@effected/yaml/internal/cst-parser.js
9493
+ //#region ../../node_modules/.pnpm/@effected+yaml@0.9.0_effect@4.0.0-beta.107/node_modules/@effected/yaml/internal/cst-parser.js
9489
9494
  /**
9490
9495
  * Hardening: cap CST nesting so hostile inputs cannot overflow the stack
9491
9496
  * while the tree is being BUILT. Set slightly above the composer's
@@ -10207,7 +10212,7 @@ function parseCSTAll(text) {
10207
10212
  }
10208
10213
 
10209
10214
  //#endregion
10210
- //#region ../../node_modules/.pnpm/@effected+yaml@0.8.0_effect@4.0.0-beta.107/node_modules/@effected/yaml/internal/composer/anchors.js
10215
+ //#region ../../node_modules/.pnpm/@effected+yaml@0.9.0_effect@4.0.0-beta.107/node_modules/@effected/yaml/internal/composer/anchors.js
10211
10216
  /**
10212
10217
  * Check if a pending anchor is being applied to an alias node (invalid in YAML 1.2 §3.2.2).
10213
10218
  * Aliases represent references to existing anchored nodes and cannot have their own anchors.
@@ -10276,7 +10281,7 @@ function scanName(text, start) {
10276
10281
  }
10277
10282
 
10278
10283
  //#endregion
10279
- //#region ../../node_modules/.pnpm/@effected+yaml@0.8.0_effect@4.0.0-beta.107/node_modules/@effected/yaml/internal/composer/comments.js
10284
+ //#region ../../node_modules/.pnpm/@effected+yaml@0.9.0_effect@4.0.0-beta.107/node_modules/@effected/yaml/internal/composer/comments.js
10280
10285
  /** True when there is no line break between `start` and `end` in `text`. */
10281
10286
  function sameLineSpan(text, start, end) {
10282
10287
  if (start < 0) return false;
@@ -10300,6 +10305,31 @@ function isOwnLineAt(text, offset) {
10300
10305
  return true;
10301
10306
  }
10302
10307
  /**
10308
+ * True when the only thing before `offset` on its line is a block indicator —
10309
+ * `?`, `:` or `-` — plus whitespace. Such a comment sits on an indicator line
10310
+ * with its node BELOW, so it leads that node rather than trailing whatever
10311
+ * came before (`? # c` / ` - seq1`). Without this, the `? ` prefix makes the
10312
+ * comment look like a trailing comment on the previous entry.
10313
+ */
10314
+ function isAfterIndicatorOnly(text, offset) {
10315
+ let i = offset - 1;
10316
+ let sawIndicator = false;
10317
+ while (i >= 0) {
10318
+ const ch = text[i];
10319
+ if (ch === " " || ch === " ") {
10320
+ i--;
10321
+ continue;
10322
+ }
10323
+ if (!sawIndicator && (ch === "?" || ch === "-" || ch === ":")) {
10324
+ sawIndicator = true;
10325
+ i--;
10326
+ continue;
10327
+ }
10328
+ return sawIndicator && (ch === "\n" || ch === "\r");
10329
+ }
10330
+ return sawIndicator;
10331
+ }
10332
+ /**
10303
10333
  * True when the line immediately above the line containing `offset` is blank
10304
10334
  * (empty or horizontal whitespace only). Purely local — see
10305
10335
  * {@link isOwnLineAt} for why span-based gap checks are not used.
@@ -10409,8 +10439,8 @@ function columnAt(text, offset) {
10409
10439
  /**
10410
10440
  * Rebuild `node` with the given comment fields merged in (existing fields are
10411
10441
  * kept unless overridden; `commentBefore`/`comment` join with a newline when
10412
- * both sides are present). Aliases are returned unchanged they carry no
10413
- * comment fields.
10442
+ * both sides are present). Every node class carries the triple, aliases
10443
+ * included.
10414
10444
  */
10415
10445
  function withCommentFields(node, fields) {
10416
10446
  if (node instanceof YamlScalar) return new YamlScalar({
@@ -10446,7 +10476,12 @@ function withCommentFields(node, fields) {
10446
10476
  offset: node.offset,
10447
10477
  length: node.length
10448
10478
  });
10449
- return node;
10479
+ return new YamlAlias({
10480
+ name: node.name,
10481
+ ...mergedCommentFields(node, fields),
10482
+ offset: node.offset,
10483
+ length: node.length
10484
+ });
10450
10485
  }
10451
10486
  function mergedCommentFields(existing, incoming) {
10452
10487
  const commentBefore = incoming.commentBefore !== void 0 ? existing.commentBefore !== void 0 ? `${existing.commentBefore}\n${incoming.commentBefore}` : incoming.commentBefore : existing.commentBefore;
@@ -10460,7 +10495,7 @@ function mergedCommentFields(existing, incoming) {
10460
10495
  }
10461
10496
 
10462
10497
  //#endregion
10463
- //#region ../../node_modules/.pnpm/@effected+yaml@0.8.0_effect@4.0.0-beta.107/node_modules/@effected/yaml/internal/composer/state.js
10498
+ //#region ../../node_modules/.pnpm/@effected+yaml@0.9.0_effect@4.0.0-beta.107/node_modules/@effected/yaml/internal/composer/state.js
10464
10499
  let lineStartsText;
10465
10500
  let lineStartsCache = [];
10466
10501
  function getLineStarts(text) {
@@ -10581,7 +10616,7 @@ function exitNesting(state) {
10581
10616
  }
10582
10617
 
10583
10618
  //#endregion
10584
- //#region ../../node_modules/.pnpm/@effected+yaml@0.8.0_effect@4.0.0-beta.107/node_modules/@effected/yaml/internal/composer/tags.js
10619
+ //#region ../../node_modules/.pnpm/@effected+yaml@0.9.0_effect@4.0.0-beta.107/node_modules/@effected/yaml/internal/composer/tags.js
10585
10620
  /**
10586
10621
  * Resolve a tag shorthand using the document's %TAG directives.
10587
10622
  * For example, with `%TAG !! tag:example.com,2000:app/`, the tag `!!int`
@@ -10668,7 +10703,7 @@ function validateTagHandlesInDocument(docCst, state) {
10668
10703
  }
10669
10704
 
10670
10705
  //#endregion
10671
- //#region ../../node_modules/.pnpm/@effected+yaml@0.8.0_effect@4.0.0-beta.107/node_modules/@effected/yaml/internal/composer/scalars.js
10706
+ //#region ../../node_modules/.pnpm/@effected+yaml@0.9.0_effect@4.0.0-beta.107/node_modules/@effected/yaml/internal/composer/scalars.js
10672
10707
  const NULL_RE$1 = /^(?:null|Null|NULL|~)$/;
10673
10708
  const TRUE_RE$1 = /^(?:true|True|TRUE)$/;
10674
10709
  const FALSE_RE$1 = /^(?:false|False|FALSE)$/;
@@ -11595,7 +11630,7 @@ function shouldPreserveRaw(rawValue, value) {
11595
11630
  }
11596
11631
 
11597
11632
  //#endregion
11598
- //#region ../../node_modules/.pnpm/@effected+yaml@0.8.0_effect@4.0.0-beta.107/node_modules/@effected/yaml/internal/composer/block.js
11633
+ //#region ../../node_modules/.pnpm/@effected+yaml@0.9.0_effect@4.0.0-beta.107/node_modules/@effected/yaml/internal/composer/block.js
11599
11634
  /**
11600
11635
  * Compose a block map from its CST children, with an optional external first key.
11601
11636
  *
@@ -12098,6 +12133,29 @@ function buildPairs(items, pairs, text, escaped) {
12098
12133
  let lastNode;
12099
12134
  let contentColumn = -1;
12100
12135
  const nodeEnd = (n) => n.offset + n.length;
12136
+ /**
12137
+ * Rebuild `pair` with `text` appended to the trailing comment of whichever
12138
+ * node owns the pair's last line: the value when present, otherwise the key.
12139
+ */
12140
+ const withTrailingComment = (pair, text, onKey = false) => pair.value !== null && !onKey ? new YamlPair({
12141
+ key: pair.key,
12142
+ value: withCommentFields(pair.value, { comment: text })
12143
+ }) : new YamlPair({
12144
+ key: withCommentFields(pair.key, { comment: text }),
12145
+ value: pair.value
12146
+ });
12147
+ /**
12148
+ * Finish a pair: the pending leading fields go to its KEY node, the entry's
12149
+ * trailing comment to whichever node owns the last line. The one place the
12150
+ * node-level split is applied, so no construction site has to know it.
12151
+ */
12152
+ const pushPair = (pair, leading, trailing, trailingOnKey = false) => {
12153
+ const withLeading = Object.keys(leading).length === 0 ? pair : new YamlPair({
12154
+ key: withCommentFields(pair.key, leading),
12155
+ value: pair.value
12156
+ });
12157
+ return trailing === void 0 ? withLeading : withTrailingComment(withLeading, trailing, trailingOnKey);
12158
+ };
12101
12159
  const noteContentColumn = (offset) => {
12102
12160
  if (contentColumn < 0 && offset >= 0) contentColumn = columnAt(text, offset);
12103
12161
  };
@@ -12135,15 +12193,9 @@ function buildPairs(items, pairs, text, escaped) {
12135
12193
  if (item.kind === "comment") {
12136
12194
  const cOff = item.offset ?? -1;
12137
12195
  const cText = item.comment ?? "";
12138
- if (!(cOff < 0 ? true : isOwnLineAt(text, cOff)) && pairs.length > 0) {
12196
+ if (!(cOff < 0 ? true : isOwnLineAt(text, cOff) || isAfterIndicatorOnly(text, cOff)) && pairs.length > 0) {
12139
12197
  const last = pairs[pairs.length - 1];
12140
- if (last) pairs[pairs.length - 1] = new YamlPair({
12141
- key: last.key,
12142
- value: last.value,
12143
- ...last.commentBefore !== void 0 ? { commentBefore: last.commentBefore } : {},
12144
- comment: last.comment !== void 0 ? `${last.comment}\n${cText}` : cText,
12145
- ...last.spaceBefore !== void 0 ? { spaceBefore: last.spaceBefore } : {}
12146
- });
12198
+ if (last) pairs[pairs.length - 1] = withTrailingComment(last, cText);
12147
12199
  } else {
12148
12200
  const blankAbove = cOff >= 0 && hasBlankLineAbove(text, cOff) && !blankAboveIsKeepChompContent(text, cOff, lastNode);
12149
12201
  if (blankAbove && pending.length === 0 && lastEnd >= 0) pendingSpace = true;
@@ -12169,20 +12221,18 @@ function buildPairs(items, pairs, text, escaped) {
12169
12221
  length: 0
12170
12222
  });
12171
12223
  if (valueNode) {
12172
- pairs.push(new YamlPair({
12224
+ pairs.push(pushPair(new YamlPair({
12173
12225
  key: nullKey,
12174
- value: valueNode.node ?? null,
12175
- ...pendingFields
12176
- }));
12226
+ value: valueNode.node ?? null
12227
+ }), pendingFields, void 0));
12177
12228
  i = valueNode.nextIdx;
12178
12229
  lastEnd = valueNode.node ? nodeEnd(valueNode.node) : valueSepOffset + 1;
12179
12230
  lastNode = valueNode.node ?? void 0;
12180
12231
  } else {
12181
- pairs.push(new YamlPair({
12232
+ pairs.push(pushPair(new YamlPair({
12182
12233
  key: nullKey,
12183
- value: null,
12184
- ...pendingFields
12185
- }));
12234
+ value: null
12235
+ }), pendingFields, void 0));
12186
12236
  lastEnd = valueSepOffset + 1;
12187
12237
  lastNode = void 0;
12188
12238
  }
@@ -12220,32 +12270,26 @@ function buildPairs(items, pairs, text, escaped) {
12220
12270
  for (const c of valueResult.sameLineComments) pairTrailing = joinComments(pairTrailing, c);
12221
12271
  let valNode = valueResult.node;
12222
12272
  if (valNode !== null && valueResult.leadingComments.length > 0) valNode = withCommentFields(valNode, { commentBefore: valueResult.leadingComments.join("\n") });
12223
- pairs.push(new YamlPair({
12273
+ pairs.push(pushPair(new YamlPair({
12224
12274
  key: keyOrNull(),
12225
- value: valNode,
12226
- ...pendingFields,
12227
- ...pairTrailing !== void 0 ? { comment: pairTrailing } : {}
12228
- }));
12275
+ value: valNode
12276
+ }), pendingFields, pairTrailing, keyIsSimple(keyNode) && (valNode === null || !sameLineSpan(text, sepOffset, valNode.offset))));
12229
12277
  i = valueResult.nextIdx;
12230
12278
  lastEnd = valNode ? nodeEnd(valNode) : sepOffset + 1;
12231
12279
  lastNode = valNode ?? void 0;
12232
12280
  } else {
12233
- pairs.push(new YamlPair({
12281
+ pairs.push(pushPair(new YamlPair({
12234
12282
  key: keyOrNull(),
12235
- value: null,
12236
- ...pendingFields,
12237
- ...pairTrailing !== void 0 ? { comment: pairTrailing } : {}
12238
- }));
12283
+ value: null
12284
+ }), pendingFields, pairTrailing));
12239
12285
  lastEnd = sepOffset + 1;
12240
12286
  lastNode = void 0;
12241
12287
  }
12242
12288
  } else {
12243
- pairs.push(new YamlPair({
12289
+ pairs.push(pushPair(new YamlPair({
12244
12290
  key: keyOrNull(),
12245
- value: null,
12246
- ...pendingFields,
12247
- ...pairTrailing !== void 0 ? { comment: pairTrailing } : {}
12248
- }));
12291
+ value: null
12292
+ }), pendingFields, pairTrailing));
12249
12293
  lastEnd = keyNode ? nodeEnd(keyNode) : lastEnd;
12250
12294
  if (keyNode) lastNode = keyNode;
12251
12295
  }
@@ -12270,6 +12314,17 @@ function buildPairs(items, pairs, text, escaped) {
12270
12314
  }
12271
12315
  return withLeadingBlank(pending);
12272
12316
  }
12317
+ /**
12318
+ * True when a key renders in implicit `key: value` form, so the `:` sits on
12319
+ * the key's own line. A multi-line or block-scalar key forces the explicit
12320
+ * `? key` / `: value` spelling, where the `:` gets a line of its own.
12321
+ */
12322
+ function keyIsSimple(keyNode) {
12323
+ if (keyNode instanceof YamlAlias) return true;
12324
+ if (!(keyNode instanceof YamlScalar)) return false;
12325
+ if (typeof keyNode.value === "string" && keyNode.value.includes("\n")) return false;
12326
+ return keyNode.style !== "block-literal" && keyNode.style !== "block-folded";
12327
+ }
12273
12328
  function consumeValueNode(items, startIdx, text, sepOffset) {
12274
12329
  let peek = startIdx;
12275
12330
  while (peek < items.length && items[peek]?.kind === "comment") peek++;
@@ -12278,13 +12333,17 @@ function consumeValueNode(items, startIdx, text, sepOffset) {
12278
12333
  let i = startIdx;
12279
12334
  const sameLineComments = [];
12280
12335
  const leadingComments = [];
12336
+ let firstOwnLineIdx = -1;
12281
12337
  while (i < items.length) {
12282
12338
  const item = items[i];
12283
12339
  if (!item) break;
12284
12340
  if (item.kind === "comment") {
12285
12341
  const cText = item.comment ?? "";
12286
12342
  if (item.offset !== void 0 && sameLineSpan(text, sepOffset, item.offset)) sameLineComments.push(cText);
12287
- else leadingComments.push(cText);
12343
+ else {
12344
+ if (firstOwnLineIdx < 0) firstOwnLineIdx = i;
12345
+ leadingComments.push(cText);
12346
+ }
12288
12347
  i++;
12289
12348
  continue;
12290
12349
  }
@@ -12296,6 +12355,12 @@ function consumeValueNode(items, startIdx, text, sepOffset) {
12296
12355
  };
12297
12356
  break;
12298
12357
  }
12358
+ if (firstOwnLineIdx >= 0) return {
12359
+ node: null,
12360
+ nextIdx: firstOwnLineIdx,
12361
+ sameLineComments,
12362
+ leadingComments: []
12363
+ };
12299
12364
  return i > startIdx ? {
12300
12365
  node: null,
12301
12366
  nextIdx: i,
@@ -12314,10 +12379,12 @@ function consumeValueNode(items, startIdx, text, sepOffset) {
12314
12379
  */
12315
12380
  function consumeValueNodeForNullKey(items, startIdx, text, valueSepOffset) {
12316
12381
  let i = startIdx;
12382
+ let firstOwnLineIdx = -1;
12317
12383
  while (i < items.length) {
12318
12384
  const item = items[i];
12319
12385
  if (!item) break;
12320
12386
  if (item.kind === "comment") {
12387
+ if (firstOwnLineIdx < 0 && item.offset !== void 0 && !sameLineSpan(text, valueSepOffset, item.offset)) firstOwnLineIdx = i;
12321
12388
  i++;
12322
12389
  continue;
12323
12390
  }
@@ -12333,6 +12400,10 @@ function consumeValueNodeForNullKey(items, startIdx, text, valueSepOffset) {
12333
12400
  }
12334
12401
  break;
12335
12402
  }
12403
+ if (firstOwnLineIdx >= 0) return {
12404
+ node: null,
12405
+ nextIdx: firstOwnLineIdx
12406
+ };
12336
12407
  return i > startIdx ? {
12337
12408
  node: null,
12338
12409
  nextIdx: i
@@ -12942,7 +13013,7 @@ function composeFlatBlockMap(children, startIdx, parentCst, state, externalFirst
12942
13013
  }
12943
13014
 
12944
13015
  //#endregion
12945
- //#region ../../node_modules/.pnpm/@effected+yaml@0.8.0_effect@4.0.0-beta.107/node_modules/@effected/yaml/internal/composer/flow.js
13016
+ //#region ../../node_modules/.pnpm/@effected+yaml@0.9.0_effect@4.0.0-beta.107/node_modules/@effected/yaml/internal/composer/flow.js
12946
13017
  /**
12947
13018
  * Validate that flow collection entries are separated by commas.
12948
13019
  *
@@ -13014,7 +13085,7 @@ function validateFlowContentIndent(cst, state, parentBlockColumn) {
13014
13085
  i++;
13015
13086
  continue;
13016
13087
  }
13017
- if (i - lineStart <= parentBlockColumn) {
13088
+ if (i - lineStart <= parentBlockColumn && !isClosersOnly(text, i, end)) {
13018
13089
  state.errors.push({
13019
13090
  code: "InvalidIndentation",
13020
13091
  message: "Flow content continuation line must be indented past the parent block",
@@ -13028,6 +13099,26 @@ function validateFlowContentIndent(cst, state, parentBlockColumn) {
13028
13099
  i++;
13029
13100
  }
13030
13101
  }
13102
+ /**
13103
+ * True when everything from `start` to the end of that line (bounded by `end`)
13104
+ * is flow closing punctuation — `}`, `]`, separating commas and whitespace.
13105
+ * Such a line closes the collection rather than carrying content, so the
13106
+ * continuation-indent floor does not apply to it.
13107
+ */
13108
+ function isClosersOnly(text, start, end) {
13109
+ let sawCloser = false;
13110
+ for (let i = start; i < end && i < text.length; i++) {
13111
+ const ch = text[i];
13112
+ if (ch === "\n") break;
13113
+ if (ch === "}" || ch === "]") {
13114
+ sawCloser = true;
13115
+ continue;
13116
+ }
13117
+ if (ch === "," || ch === " " || ch === " " || ch === "\r") continue;
13118
+ return false;
13119
+ }
13120
+ return sawCloser;
13121
+ }
13031
13122
  function composeFlowMap(cst, state, meta, parentBlockColumn) {
13032
13123
  if (!enterNesting(state, cst)) return new YamlMap({
13033
13124
  items: [],
@@ -13413,7 +13504,7 @@ function composeFlowSeqInner(cst, state, meta, parentBlockColumn) {
13413
13504
  }
13414
13505
 
13415
13506
  //#endregion
13416
- //#region ../../node_modules/.pnpm/@effected+yaml@0.8.0_effect@4.0.0-beta.107/node_modules/@effected/yaml/internal/composer/document.js
13507
+ //#region ../../node_modules/.pnpm/@effected+yaml@0.9.0_effect@4.0.0-beta.107/node_modules/@effected/yaml/internal/composer/document.js
13417
13508
  /** The flow-composer dispatch wired into every state this module creates. */
13418
13509
  const FLOW = {
13419
13510
  composeFlowMap,
@@ -13539,7 +13630,10 @@ function composeDocument(cst, state, hasSubsequentDocuments = false, nextDocCst)
13539
13630
  let documentComment;
13540
13631
  let documentCommentAfter;
13541
13632
  let lastLeadingCommentOffset = -1;
13633
+ let lastAfterMarkerCommentOffset = -1;
13542
13634
  let sawDocEndMarker = false;
13635
+ let sawDocStartMarker = false;
13636
+ let afterMarkerComment;
13543
13637
  const hasDocStart = children.some((c) => c.type === "whitespace" && c.source === "---");
13544
13638
  let i = 0;
13545
13639
  const meta = {};
@@ -13576,6 +13670,7 @@ function composeDocument(cst, state, hasSubsequentDocuments = false, nextDocCst)
13576
13670
  if (child.type === "newline" && hasMeta(meta)) sawNewlineSinceMeta = true;
13577
13671
  if (child.type === "whitespace" || child.type === "newline") {
13578
13672
  if (child.type === "whitespace" && child.source === "...") sawDocEndMarker = true;
13673
+ if (child.type === "whitespace" && child.source === "---") sawDocStartMarker = true;
13579
13674
  if (child.type === "whitespace" && (child.source === "]" || child.source === "}")) state.errors.push({
13580
13675
  code: "MalformedFlowCollection",
13581
13676
  message: `Unexpected flow indicator '${child.source}' at document level`,
@@ -13587,9 +13682,15 @@ function composeDocument(cst, state, hasSubsequentDocuments = false, nextDocCst)
13587
13682
  }
13588
13683
  if (child.type === "comment" && contents === null && !sawDocEndMarker) {
13589
13684
  const text = rawCommentText(child.source);
13590
- if (documentComment !== void 0 && hasBlankLineAbove(state.text, child.offset)) documentComment = `${documentComment}\n`;
13591
- documentComment = documentComment === void 0 ? text : `${documentComment}\n${text}`;
13592
- lastLeadingCommentOffset = child.offset;
13685
+ if (sawDocStartMarker) {
13686
+ if (afterMarkerComment !== void 0 && hasBlankLineAbove(state.text, child.offset)) afterMarkerComment = `${afterMarkerComment}\n`;
13687
+ afterMarkerComment = afterMarkerComment === void 0 ? text : `${afterMarkerComment}\n${text}`;
13688
+ lastAfterMarkerCommentOffset = child.offset;
13689
+ } else {
13690
+ if (documentComment !== void 0 && hasBlankLineAbove(state.text, child.offset)) documentComment = `${documentComment}\n`;
13691
+ documentComment = documentComment === void 0 ? text : `${documentComment}\n${text}`;
13692
+ lastLeadingCommentOffset = child.offset;
13693
+ }
13593
13694
  i++;
13594
13695
  continue;
13595
13696
  }
@@ -13816,17 +13917,32 @@ function composeDocument(cst, state, hasSubsequentDocuments = false, nextDocCst)
13816
13917
  }
13817
13918
  }
13818
13919
  if (documentComment !== void 0 && contents !== null && hasBlankLineBelow(state.text, lastLeadingCommentOffset)) documentComment = `${documentComment}\n`;
13920
+ if (afterMarkerComment !== void 0 && contents !== null && hasBlankLineBelow(state.text, lastAfterMarkerCommentOffset)) afterMarkerComment = `${afterMarkerComment}\n`;
13819
13921
  state.escapedComments.length = 0;
13922
+ if (documentCommentAfter === void 0 && contents !== null && contents.comment !== void 0) {
13923
+ if ((contents instanceof YamlMap || contents instanceof YamlSeq) && contents.style !== "flow") {
13924
+ documentCommentAfter = contents.comment;
13925
+ contents = stripOwnComment(contents);
13926
+ }
13927
+ }
13928
+ let headerForDocument;
13929
+ let decorated = contents;
13930
+ if (documentComment !== void 0) {
13931
+ if (hasDocStart || contents === null) headerForDocument = documentComment;
13932
+ else decorated = attachHeaderToFirstEntry(contents, documentComment);
13933
+ }
13934
+ if (afterMarkerComment !== void 0 && decorated !== null) decorated = withCommentFields(decorated, { commentBefore: afterMarkerComment });
13935
+ else if (afterMarkerComment !== void 0) headerForDocument = headerForDocument === void 0 ? afterMarkerComment : `${headerForDocument}\n${afterMarkerComment}`;
13820
13936
  return {
13821
- contents,
13937
+ contents: decorated,
13822
13938
  errors: [...state.errors],
13823
13939
  warnings: [...state.warnings],
13824
13940
  directives,
13825
13941
  hasDocumentStart: hasDocStart,
13826
13942
  hasDocumentEnd: hasDocEnd,
13827
13943
  hasDocumentStartTab: hasDocStartTab,
13828
- ...documentComment !== void 0 ? { comment: documentComment } : {},
13829
- ...documentCommentAfter !== void 0 ? { commentAfter: documentCommentAfter } : {}
13944
+ ...headerForDocument !== void 0 ? { commentBefore: headerForDocument } : {},
13945
+ ...documentCommentAfter !== void 0 ? { comment: documentCommentAfter } : {}
13830
13946
  };
13831
13947
  }
13832
13948
  /**
@@ -14003,8 +14119,7 @@ function decorateSourceMultiline(node, text) {
14003
14119
  if (node instanceof YamlMap) {
14004
14120
  const newItems = node.items.map((pair) => new YamlPair({
14005
14121
  key: decorateSourceMultiline(pair.key, text) ?? pair.key,
14006
- value: pair.value === null ? null : decorateSourceMultiline(pair.value, text),
14007
- ...commentProps(pair)
14122
+ value: pair.value === null ? null : decorateSourceMultiline(pair.value, text)
14008
14123
  }));
14009
14124
  const multiline = isSourceMultiline(text, node.offset, node.length);
14010
14125
  return new YamlMap({
@@ -14042,8 +14157,8 @@ function decorateDocumentSourceMultiline(doc, text) {
14042
14157
  errors: doc.errors,
14043
14158
  warnings: doc.warnings,
14044
14159
  directives: doc.directives,
14160
+ ...doc.commentBefore !== void 0 ? { commentBefore: doc.commentBefore } : {},
14045
14161
  ...doc.comment !== void 0 ? { comment: doc.comment } : {},
14046
- ...doc.commentAfter !== void 0 ? { commentAfter: doc.commentAfter } : {},
14047
14162
  hasDocumentStart: doc.hasDocumentStart,
14048
14163
  hasDocumentEnd: doc.hasDocumentEnd,
14049
14164
  hasDocumentStartTab: doc.hasDocumentStartTab
@@ -14114,9 +14229,75 @@ function composeAllDocuments(text, options) {
14114
14229
  streamErrors: crossDocState.errors
14115
14230
  };
14116
14231
  }
14232
+ /**
14233
+ * Attach a marker-less document header to the FIRST entry of the content — the
14234
+ * first pair's key for a mapping, the first item for a sequence, the node
14235
+ * itself for a scalar. Without a `---` boundary the header is just the first
14236
+ * own-line comment in the document's item stream, so it forward-attributes
14237
+ * like any other.
14238
+ */
14239
+ function attachHeaderToFirstEntry(contents, header) {
14240
+ if (contents instanceof YamlMap && contents.items.length > 0) {
14241
+ const first = contents.items[0];
14242
+ const items = [...contents.items];
14243
+ items[0] = new YamlPair({
14244
+ key: withCommentFields(first.key, { commentBefore: header }),
14245
+ value: first.value
14246
+ });
14247
+ return new YamlMap({
14248
+ items,
14249
+ style: contents.style,
14250
+ ...contents.tag !== void 0 ? { tag: contents.tag } : {},
14251
+ ...contents.anchor !== void 0 ? { anchor: contents.anchor } : {},
14252
+ ...contents.commentBefore !== void 0 ? { commentBefore: contents.commentBefore } : {},
14253
+ ...contents.comment !== void 0 ? { comment: contents.comment } : {},
14254
+ ...contents.spaceBefore !== void 0 ? { spaceBefore: contents.spaceBefore } : {},
14255
+ ...contents.sourceMultiline !== void 0 ? { sourceMultiline: contents.sourceMultiline } : {},
14256
+ offset: contents.offset,
14257
+ length: contents.length
14258
+ });
14259
+ }
14260
+ if (contents instanceof YamlSeq && contents.items.length > 0) {
14261
+ const items = [...contents.items];
14262
+ items[0] = withCommentFields(items[0], { commentBefore: header });
14263
+ return new YamlSeq({
14264
+ items,
14265
+ style: contents.style,
14266
+ ...contents.tag !== void 0 ? { tag: contents.tag } : {},
14267
+ ...contents.anchor !== void 0 ? { anchor: contents.anchor } : {},
14268
+ ...contents.commentBefore !== void 0 ? { commentBefore: contents.commentBefore } : {},
14269
+ ...contents.comment !== void 0 ? { comment: contents.comment } : {},
14270
+ ...contents.spaceBefore !== void 0 ? { spaceBefore: contents.spaceBefore } : {},
14271
+ ...contents.sourceMultiline !== void 0 ? { sourceMultiline: contents.sourceMultiline } : {},
14272
+ offset: contents.offset,
14273
+ length: contents.length
14274
+ });
14275
+ }
14276
+ return withCommentFields(contents, { commentBefore: header });
14277
+ }
14278
+ /** Rebuild a collection without its own trailing `comment`. */
14279
+ function stripOwnComment(node) {
14280
+ const shared = {
14281
+ style: node.style,
14282
+ ...node.tag !== void 0 ? { tag: node.tag } : {},
14283
+ ...node.anchor !== void 0 ? { anchor: node.anchor } : {},
14284
+ ...node.commentBefore !== void 0 ? { commentBefore: node.commentBefore } : {},
14285
+ ...node.spaceBefore !== void 0 ? { spaceBefore: node.spaceBefore } : {},
14286
+ ...node.sourceMultiline !== void 0 ? { sourceMultiline: node.sourceMultiline } : {},
14287
+ offset: node.offset,
14288
+ length: node.length
14289
+ };
14290
+ return node instanceof YamlMap ? new YamlMap({
14291
+ items: node.items,
14292
+ ...shared
14293
+ }) : new YamlSeq({
14294
+ items: node.items,
14295
+ ...shared
14296
+ });
14297
+ }
14117
14298
 
14118
14299
  //#endregion
14119
- //#region ../../node_modules/.pnpm/@effected+yaml@0.8.0_effect@4.0.0-beta.107/node_modules/@effected/yaml/internal/fold.js
14300
+ //#region ../../node_modules/.pnpm/@effected+yaml@0.9.0_effect@4.0.0-beta.107/node_modules/@effected/yaml/internal/fold.js
14120
14301
  /**
14121
14302
  * Column-based line folding for a single logical scalar line (YAML 1.2 flow
14122
14303
  * folding, §7.3 / §8.2.1). Breaks the content at "safe" single-space
@@ -14365,7 +14546,7 @@ function renderBlockFolded(s, indent, explicitChomp, explicitIndent) {
14365
14546
  }
14366
14547
 
14367
14548
  //#endregion
14368
- //#region ../../node_modules/.pnpm/@effected+yaml@0.8.0_effect@4.0.0-beta.107/node_modules/@effected/yaml/internal/stringifier.js
14549
+ //#region ../../node_modules/.pnpm/@effected+yaml@0.9.0_effect@4.0.0-beta.107/node_modules/@effected/yaml/internal/stringifier.js
14369
14550
  /**
14370
14551
  * Thrown by the stringifier on its failure paths (circular references). The
14371
14552
  * facade catches this and materializes the public stringify error.
@@ -14775,7 +14956,7 @@ function stringifyValue(value, options) {
14775
14956
  }
14776
14957
 
14777
14958
  //#endregion
14778
- //#region ../../node_modules/.pnpm/@effected+yaml@0.8.0_effect@4.0.0-beta.107/node_modules/@effected/yaml/Yaml.js
14959
+ //#region ../../node_modules/.pnpm/@effected+yaml@0.9.0_effect@4.0.0-beta.107/node_modules/@effected/yaml/Yaml.js
14779
14960
  /**
14780
14961
  * Options controlling parse behavior. All fields are omissible; absent fields
14781
14962
  * resolve to `strict` `true`, `maxAliasCount` `100` (the alias-based
@@ -15476,7 +15657,7 @@ function deepEqualValues(a, b) {
15476
15657
  }
15477
15658
 
15478
15659
  //#endregion
15479
- //#region ../../node_modules/.pnpm/@effected+lockfiles@0.4.1_@effected+jsonc@0.6.0_effect@4.0.0-beta.107__@effected+npm@0._0858c2cd87fcfa2cb556a350de7e385b/node_modules/@effected/lockfiles/internal/documents.js
15660
+ //#region ../../node_modules/.pnpm/@effected+lockfiles@0.4.2_@effected+jsonc@0.6.0_effect@4.0.0-beta.107__@effected+npm@0._ed7d42fde2c58956d6dad4ab1717694c/node_modules/@effected/lockfiles/internal/documents.js
15480
15661
  /**
15481
15662
  * An empty YAML document composes to `null` (`Yaml.parseAll("")` is `[null]`,
15482
15663
  * and the trailing document of an env-only `pnpm-lock.yaml` is `null` too).
@@ -15547,7 +15728,7 @@ const selectSoleDocument = (content) => Effect.gen(function* () {
15547
15728
  });
15548
15729
 
15549
15730
  //#endregion
15550
- //#region ../../node_modules/.pnpm/@effected+lockfiles@0.4.1_@effected+jsonc@0.6.0_effect@4.0.0-beta.107__@effected+npm@0._0858c2cd87fcfa2cb556a350de7e385b/node_modules/@effected/lockfiles/internal/pnpm.js
15731
+ //#region ../../node_modules/.pnpm/@effected+lockfiles@0.4.2_@effected+jsonc@0.6.0_effect@4.0.0-beta.107__@effected+npm@0._ed7d42fde2c58956d6dad4ab1717694c/node_modules/@effected/lockfiles/internal/pnpm.js
15551
15732
  const PnpmImporterDeps = Schema.optionalKey(Schema.Record(Schema.String, Schema.Struct({
15552
15733
  specifier: Schema.String,
15553
15734
  version: Schema.String
@@ -15673,7 +15854,7 @@ const toFields$1 = (raw) => Effect.gen(function* () {
15673
15854
  });
15674
15855
 
15675
15856
  //#endregion
15676
- //#region ../../node_modules/.pnpm/@effected+lockfiles@0.4.1_@effected+jsonc@0.6.0_effect@4.0.0-beta.107__@effected+npm@0._0858c2cd87fcfa2cb556a350de7e385b/node_modules/@effected/lockfiles/internal/yarn.js
15857
+ //#region ../../node_modules/.pnpm/@effected+lockfiles@0.4.2_@effected+jsonc@0.6.0_effect@4.0.0-beta.107__@effected+npm@0._ed7d42fde2c58956d6dad4ab1717694c/node_modules/@effected/lockfiles/internal/yarn.js
15677
15858
  const YarnLockfileRaw = Schema.Record(Schema.String, Schema.Unknown);
15678
15859
  const DepRecord = Schema.optionalKey(Schema.Record(Schema.String, Schema.String));
15679
15860
  const YarnEntry = Schema.Struct({
@@ -15797,7 +15978,7 @@ const cleanYarnDeps = (deps) => {
15797
15978
  };
15798
15979
 
15799
15980
  //#endregion
15800
- //#region ../../node_modules/.pnpm/@effected+lockfiles@0.4.1_@effected+jsonc@0.6.0_effect@4.0.0-beta.107__@effected+npm@0._0858c2cd87fcfa2cb556a350de7e385b/node_modules/@effected/lockfiles/Lockfile.js
15981
+ //#region ../../node_modules/.pnpm/@effected+lockfiles@0.4.2_@effected+jsonc@0.6.0_effect@4.0.0-beta.107__@effected+npm@0._ed7d42fde2c58956d6dad4ab1717694c/node_modules/@effected/lockfiles/Lockfile.js
15801
15982
  const EMPTY_IMPORTERS = [];
15802
15983
  /**
15803
15984
  * Failure of `Lockfile.parse`: the given content is not a valid lockfile of
@@ -16042,7 +16223,7 @@ var Lockfile = class Lockfile extends Schema.Class("Lockfile")({
16042
16223
  };
16043
16224
 
16044
16225
  //#endregion
16045
- //#region ../../node_modules/.pnpm/@effected+lockfiles@0.4.1_@effected+jsonc@0.6.0_effect@4.0.0-beta.107__@effected+npm@0._0858c2cd87fcfa2cb556a350de7e385b/node_modules/@effected/lockfiles/LockfileIntegrity.js
16226
+ //#region ../../node_modules/.pnpm/@effected+lockfiles@0.4.2_@effected+jsonc@0.6.0_effect@4.0.0-beta.107__@effected+npm@0._ed7d42fde2c58956d6dad4ab1717694c/node_modules/@effected/lockfiles/LockfileIntegrity.js
16046
16227
  /**
16047
16228
  * The minimal manifest shape {@link LockfileIntegrity.compare} checks a
16048
16229
  * lockfile against: a package name plus the four optional dependency maps.
@@ -18918,7 +19099,7 @@ var Package = class Package extends Schema.Class("Package")({
18918
19099
  };
18919
19100
 
18920
19101
  //#endregion
18921
- //#region ../../node_modules/.pnpm/@effected+workspaces@0.13.0_@effected+jsonc@0.6.0_effect@4.0.0-beta.107__effect@4.0.0-beta.107/node_modules/@effected/workspaces/WorkspacePackage.js
19102
+ //#region ../../node_modules/.pnpm/@effected+workspaces@0.13.1_@effected+jsonc@0.6.0_effect@4.0.0-beta.107__effect@4.0.0-beta.107/node_modules/@effected/workspaces/WorkspacePackage.js
18922
19103
  const EMPTY$1 = Object.freeze(Object.create(null));
18923
19104
  const EMPTY_MANIFEST = Object.freeze(Object.create(null));
18924
19105
  /**
@@ -19520,7 +19701,7 @@ var Walker$1 = class {
19520
19701
  };
19521
19702
 
19522
19703
  //#endregion
19523
- //#region ../../node_modules/.pnpm/@effected+workspaces@0.13.0_@effected+jsonc@0.6.0_effect@4.0.0-beta.107__effect@4.0.0-beta.107/node_modules/@effected/workspaces/WorkspaceRoot.js
19704
+ //#region ../../node_modules/.pnpm/@effected+workspaces@0.13.1_@effected+jsonc@0.6.0_effect@4.0.0-beta.107__effect@4.0.0-beta.107/node_modules/@effected/workspaces/WorkspaceRoot.js
19524
19705
  /**
19525
19706
  * The marker filenames {@link WorkspaceRoot} probes for, in priority order.
19526
19707
  *
@@ -19708,7 +19889,7 @@ var WorkspaceRoot = class WorkspaceRoot extends Context.Service()("@effected/wor
19708
19889
  };
19709
19890
 
19710
19891
  //#endregion
19711
- //#region ../../node_modules/.pnpm/@effected+workspaces@0.13.0_@effected+jsonc@0.6.0_effect@4.0.0-beta.107__effect@4.0.0-beta.107/node_modules/@effected/workspaces/internal/limits.js
19892
+ //#region ../../node_modules/.pnpm/@effected+workspaces@0.13.1_@effected+jsonc@0.6.0_effect@4.0.0-beta.107__effect@4.0.0-beta.107/node_modules/@effected/workspaces/internal/limits.js
19712
19893
  /**
19713
19894
  * Hard ceiling on directories the enumerator will visit for one pattern set.
19714
19895
  * Guards the pathological case a depth cap alone does not: a wide, shallow
@@ -19727,7 +19908,7 @@ const MAX_ENUMERATION_ENTRIES = 1e5;
19727
19908
  const PRUNED_DIRECTORIES = /* @__PURE__ */ new Set([".git", "node_modules"]);
19728
19909
 
19729
19910
  //#endregion
19730
- //#region ../../node_modules/.pnpm/@effected+workspaces@0.13.0_@effected+jsonc@0.6.0_effect@4.0.0-beta.107__effect@4.0.0-beta.107/node_modules/@effected/workspaces/internal/traverse.js
19911
+ //#region ../../node_modules/.pnpm/@effected+workspaces@0.13.1_@effected+jsonc@0.6.0_effect@4.0.0-beta.107__effect@4.0.0-beta.107/node_modules/@effected/workspaces/internal/traverse.js
19731
19912
  /** Directory names never descended into. */
19732
19913
  const isPruned = (entry) => PRUNED_DIRECTORIES.has(entry);
19733
19914
  /** Join root-relative POSIX segments; `""` is the root itself. */
@@ -19818,7 +19999,7 @@ var Traversal = class {
19818
19999
  };
19819
20000
 
19820
20001
  //#endregion
19821
- //#region ../../node_modules/.pnpm/@effected+workspaces@0.13.0_@effected+jsonc@0.6.0_effect@4.0.0-beta.107__effect@4.0.0-beta.107/node_modules/@effected/workspaces/internal/enumerate.js
20002
+ //#region ../../node_modules/.pnpm/@effected+workspaces@0.13.1_@effected+jsonc@0.6.0_effect@4.0.0-beta.107__effect@4.0.0-beta.107/node_modules/@effected/workspaces/internal/enumerate.js
19822
20003
  /** Strip a trailing slash from `GlobPattern.enumerationPrefix` to get a relative directory. */
19823
20004
  const baseOf = (pattern) => pattern.enumerationPrefix.replace(/\/$/, "");
19824
20005
  /**
@@ -19889,7 +20070,7 @@ const enumerate = (root, globs, options) => Effect.gen(function* () {
19889
20070
  });
19890
20071
 
19891
20072
  //#endregion
19892
- //#region ../../node_modules/.pnpm/@effected+workspaces@0.13.0_@effected+jsonc@0.6.0_effect@4.0.0-beta.107__effect@4.0.0-beta.107/node_modules/@effected/workspaces/internal/patterns.js
20073
+ //#region ../../node_modules/.pnpm/@effected+workspaces@0.13.1_@effected+jsonc@0.6.0_effect@4.0.0-beta.107__effect@4.0.0-beta.107/node_modules/@effected/workspaces/internal/patterns.js
19893
20074
  const stringsOf = (value) => Array.isArray(value) ? value.filter((entry) => typeof entry === "string") : void 0;
19894
20075
  /** The `packages:` list of a `pnpm-workspace.yaml` document. Total on a parsed document. */
19895
20076
  const pnpmPatternsOf = (document) => {
@@ -19947,7 +20128,7 @@ const readPatterns = (root) => Effect.gen(function* () {
19947
20128
  });
19948
20129
 
19949
20130
  //#endregion
19950
- //#region ../../node_modules/.pnpm/@effected+workspaces@0.13.0_@effected+jsonc@0.6.0_effect@4.0.0-beta.107__effect@4.0.0-beta.107/node_modules/@effected/workspaces/WorkspaceDiscovery.js
20131
+ //#region ../../node_modules/.pnpm/@effected+workspaces@0.13.1_@effected+jsonc@0.6.0_effect@4.0.0-beta.107__effect@4.0.0-beta.107/node_modules/@effected/workspaces/WorkspaceDiscovery.js
19951
20132
  /**
19952
20133
  * Raised when a workspace member's `package.json` cannot be read, parsed, or
19953
20134
  * used — it is missing, malformed, or lacks a `name` or `version`.
@@ -20404,7 +20585,7 @@ var WorkspaceDiscovery = class WorkspaceDiscovery extends Context.Service()("@ef
20404
20585
  const isStringRecord$2 = (value) => value !== null && typeof value === "object" && !Array.isArray(value) && Object.values(value).every((entry) => typeof entry === "string");
20405
20586
 
20406
20587
  //#endregion
20407
- //#region ../../node_modules/.pnpm/@effected+workspaces@0.13.0_@effected+jsonc@0.6.0_effect@4.0.0-beta.107__effect@4.0.0-beta.107/node_modules/@effected/workspaces/DependencyGraph.js
20588
+ //#region ../../node_modules/.pnpm/@effected+workspaces@0.13.1_@effected+jsonc@0.6.0_effect@4.0.0-beta.107__effect@4.0.0-beta.107/node_modules/@effected/workspaces/DependencyGraph.js
20408
20589
  /**
20409
20590
  * Raised when the workspace dependency graph cannot be topologically ordered
20410
20591
  * because it contains a cycle.
@@ -24104,7 +24285,7 @@ var Git = class Git extends Context.Service()("@effected/git/Git") {
24104
24285
  };
24105
24286
 
24106
24287
  //#endregion
24107
- //#region ../../node_modules/.pnpm/@effected+workspaces@0.13.0_@effected+jsonc@0.6.0_effect@4.0.0-beta.107__effect@4.0.0-beta.107/node_modules/@effected/workspaces/ChangeDetector.js
24288
+ //#region ../../node_modules/.pnpm/@effected+workspaces@0.13.1_@effected+jsonc@0.6.0_effect@4.0.0-beta.107__effect@4.0.0-beta.107/node_modules/@effected/workspaces/ChangeDetector.js
24108
24289
  /**
24109
24290
  * Which git refs to compare, and whether to fold in the working tree.
24110
24291
  *
@@ -24276,7 +24457,7 @@ const BUILTIN_NAMED_REGISTRIES = Object.freeze({
24276
24457
  });
24277
24458
 
24278
24459
  //#endregion
24279
- //#region ../../node_modules/.pnpm/@pnpm+error@1100.1.1/node_modules/@pnpm/error/lib/index.js
24460
+ //#region ../../node_modules/.pnpm/@pnpm+error@1100.1.2/node_modules/@pnpm/error/lib/index.js
24280
24461
  var PnpmError = class extends Error {
24281
24462
  code;
24282
24463
  hint;
@@ -24292,7 +24473,7 @@ var PnpmError = class extends Error {
24292
24473
  };
24293
24474
 
24294
24475
  //#endregion
24295
- //#region ../../node_modules/.pnpm/@pnpm+catalogs.config@1100.0.4/node_modules/@pnpm/catalogs.config/lib/getCatalogsFromWorkspaceManifest.js
24476
+ //#region ../../node_modules/.pnpm/@pnpm+catalogs.config@1100.0.5/node_modules/@pnpm/catalogs.config/lib/getCatalogsFromWorkspaceManifest.js
24296
24477
  function getCatalogsFromWorkspaceManifest(workspaceManifest) {
24297
24478
  if (workspaceManifest == null) return {};
24298
24479
  checkDefaultCatalogIsDefinedOnce(workspaceManifest);
@@ -24306,7 +24487,7 @@ function checkDefaultCatalogIsDefinedOnce(manifest) {
24306
24487
  }
24307
24488
 
24308
24489
  //#endregion
24309
- //#region ../../node_modules/.pnpm/@pnpm+catalogs.config@1100.0.4/node_modules/@pnpm/catalogs.config/lib/mergeCatalogs.js
24490
+ //#region ../../node_modules/.pnpm/@pnpm+catalogs.config@1100.0.5/node_modules/@pnpm/catalogs.config/lib/mergeCatalogs.js
24310
24491
  /**
24311
24492
  * Deep-merges catalog definitions, later arguments taking precedence over
24312
24493
  * earlier ones at the individual entry level. Use it to fold the catalog
@@ -24404,7 +24585,7 @@ function resolveFromCatalog(catalogs, wantedDependency) {
24404
24585
  }
24405
24586
 
24406
24587
  //#endregion
24407
- //#region ../../node_modules/.pnpm/@effected+workspaces@0.13.0_@effected+jsonc@0.6.0_effect@4.0.0-beta.107__effect@4.0.0-beta.107/node_modules/@effected/workspaces/internal/catalogs.js
24588
+ //#region ../../node_modules/.pnpm/@effected+workspaces@0.13.1_@effected+jsonc@0.6.0_effect@4.0.0-beta.107__effect@4.0.0-beta.107/node_modules/@effected/workspaces/internal/catalogs.js
24408
24589
  /** Project a pnpm-workspace manifest's `catalog` / `catalogs` fields into a `Catalogs` map. */
24409
24590
  const inlineCatalogs = (manifest) => {
24410
24591
  if (manifest.catalog === void 0 && manifest.catalogs === void 0) return {};
@@ -24470,7 +24651,7 @@ const rangeOf = (catalogs, dependency, specifier) => {
24470
24651
  };
24471
24652
 
24472
24653
  //#endregion
24473
- //#region ../../node_modules/.pnpm/@effected+workspaces@0.13.0_@effected+jsonc@0.6.0_effect@4.0.0-beta.107__effect@4.0.0-beta.107/node_modules/@effected/workspaces/ConfigDependencyHooks.js
24654
+ //#region ../../node_modules/.pnpm/@effected+workspaces@0.13.1_@effected+jsonc@0.6.0_effect@4.0.0-beta.107__effect@4.0.0-beta.107/node_modules/@effected/workspaces/ConfigDependencyHooks.js
24474
24655
  /** Whether `value` is a non-null, non-array object. */
24475
24656
  const isObject$2 = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
24476
24657
  /**
@@ -24885,7 +25066,7 @@ var ConfigDependencyHooks = class ConfigDependencyHooks extends Context.Service(
24885
25066
  };
24886
25067
 
24887
25068
  //#endregion
24888
- //#region ../../node_modules/.pnpm/@effected+workspaces@0.13.0_@effected+jsonc@0.6.0_effect@4.0.0-beta.107__effect@4.0.0-beta.107/node_modules/@effected/workspaces/PackageManagerName.js
25069
+ //#region ../../node_modules/.pnpm/@effected+workspaces@0.13.1_@effected+jsonc@0.6.0_effect@4.0.0-beta.107__effect@4.0.0-beta.107/node_modules/@effected/workspaces/PackageManagerName.js
24889
25070
  /**
24890
25071
  * The four package managers this package understands.
24891
25072
  *
@@ -25261,7 +25442,7 @@ var PackageManagerDetector = class PackageManagerDetector extends Context.Servic
25261
25442
  };
25262
25443
 
25263
25444
  //#endregion
25264
- //#region ../../node_modules/.pnpm/@effected+workspaces@0.13.0_@effected+jsonc@0.6.0_effect@4.0.0-beta.107__effect@4.0.0-beta.107/node_modules/@effected/workspaces/LockfileReader.js
25445
+ //#region ../../node_modules/.pnpm/@effected+workspaces@0.13.1_@effected+jsonc@0.6.0_effect@4.0.0-beta.107__effect@4.0.0-beta.107/node_modules/@effected/workspaces/LockfileReader.js
25265
25446
  /**
25266
25447
  * Raised when the workspace's lockfile cannot be read off disk.
25267
25448
  *
@@ -25442,7 +25623,7 @@ var LockfileReader = class LockfileReader extends Context.Service()("@effected/w
25442
25623
  };
25443
25624
 
25444
25625
  //#endregion
25445
- //#region ../../node_modules/.pnpm/@effected+workspaces@0.13.0_@effected+jsonc@0.6.0_effect@4.0.0-beta.107__effect@4.0.0-beta.107/node_modules/@effected/workspaces/Publishability.js
25626
+ //#region ../../node_modules/.pnpm/@effected+workspaces@0.13.1_@effected+jsonc@0.6.0_effect@4.0.0-beta.107__effect@4.0.0-beta.107/node_modules/@effected/workspaces/Publishability.js
25446
25627
  /** The public npm registry, used when `publishConfig.registry` says nothing. */
25447
25628
  const DEFAULT_REGISTRY = "https://registry.npmjs.org/";
25448
25629
  /**
@@ -25602,7 +25783,7 @@ var PublishabilityDetector = class extends Context.Service()("@effected/workspac
25602
25783
  };
25603
25784
 
25604
25785
  //#endregion
25605
- //#region ../../node_modules/.pnpm/@effected+workspaces@0.13.0_@effected+jsonc@0.6.0_effect@4.0.0-beta.107__effect@4.0.0-beta.107/node_modules/@effected/workspaces/internal/importerVersions.js
25786
+ //#region ../../node_modules/.pnpm/@effected+workspaces@0.13.1_@effected+jsonc@0.6.0_effect@4.0.0-beta.107__effect@4.0.0-beta.107/node_modules/@effected/workspaces/internal/importerVersions.js
25606
25787
  /**
25607
25788
  * Strip pnpm's peer-disambiguation suffix from a recorded importer version.
25608
25789
  *
@@ -25689,7 +25870,7 @@ const unanimousVersionOf = (index, dependency) => {
25689
25870
  };
25690
25871
 
25691
25872
  //#endregion
25692
- //#region ../../node_modules/.pnpm/@effected+workspaces@0.13.0_@effected+jsonc@0.6.0_effect@4.0.0-beta.107__effect@4.0.0-beta.107/node_modules/@effected/workspaces/WorkspaceCatalogs.js
25873
+ //#region ../../node_modules/.pnpm/@effected+workspaces@0.13.1_@effected+jsonc@0.6.0_effect@4.0.0-beta.107__effect@4.0.0-beta.107/node_modules/@effected/workspaces/WorkspaceCatalogs.js
25693
25874
  /**
25694
25875
  * An immutable, fully-normalized catalog collection — the one catalog
25695
25876
  * resolution semantic in the package.
@@ -26217,7 +26398,7 @@ var WorkspaceCatalogs = class WorkspaceCatalogs extends Context.Service()("@effe
26217
26398
  };
26218
26399
 
26219
26400
  //#endregion
26220
- //#region ../../node_modules/.pnpm/@effected+workspaces@0.13.0_@effected+jsonc@0.6.0_effect@4.0.0-beta.107__effect@4.0.0-beta.107/node_modules/@effected/workspaces/WorkspaceStateSnapshot.js
26401
+ //#region ../../node_modules/.pnpm/@effected+workspaces@0.13.1_@effected+jsonc@0.6.0_effect@4.0.0-beta.107__effect@4.0.0-beta.107/node_modules/@effected/workspaces/WorkspaceStateSnapshot.js
26221
26402
  const EMPTY = Object.freeze(Object.create(null));
26222
26403
  const DependencyMap = Schema.Record(Schema.String, Schema.String).pipe(Schema.withDecodingDefaultKey(Effect.succeed(EMPTY)), Schema.withConstructorDefault(Effect.succeed(EMPTY)));
26223
26404
  /**
@@ -26441,7 +26622,7 @@ var WorkspaceStateSnapshot = class extends Schema.Class("WorkspaceStateSnapshot"
26441
26622
  };
26442
26623
 
26443
26624
  //#endregion
26444
- //#region ../../node_modules/.pnpm/@effected+workspaces@0.13.0_@effected+jsonc@0.6.0_effect@4.0.0-beta.107__effect@4.0.0-beta.107/node_modules/@effected/workspaces/WorkspaceSnapshots.js
26625
+ //#region ../../node_modules/.pnpm/@effected+workspaces@0.13.1_@effected+jsonc@0.6.0_effect@4.0.0-beta.107__effect@4.0.0-beta.107/node_modules/@effected/workspaces/WorkspaceSnapshots.js
26445
26626
  /** Whether `value` is a non-null, non-array object. */
26446
26627
  const isObject = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
26447
26628
  /** Whether every value in a record is a string — a usable dependency map. */
@@ -26719,7 +26900,7 @@ var WorkspaceSnapshots = class WorkspaceSnapshots extends Context.Service()("@ef
26719
26900
  };
26720
26901
 
26721
26902
  //#endregion
26722
- //#region ../../node_modules/.pnpm/@effected+workspaces@0.13.0_@effected+jsonc@0.6.0_effect@4.0.0-beta.107__effect@4.0.0-beta.107/node_modules/@effected/workspaces/Workspaces.js
26903
+ //#region ../../node_modules/.pnpm/@effected+workspaces@0.13.1_@effected+jsonc@0.6.0_effect@4.0.0-beta.107__effect@4.0.0-beta.107/node_modules/@effected/workspaces/Workspaces.js
26723
26904
  const compose = (options, catalogsFactory) => {
26724
26905
  const roots = WorkspaceRoot.layer;
26725
26906
  const detector = PackageManagerDetector.layer;
@@ -53565,34 +53746,32 @@ var VersionFiles = class VersionFiles {
53565
53746
  * @returns Array of workspace packages with versions
53566
53747
  */
53567
53748
  static discoverVersions(cwd, packages) {
53568
- const resolvedCwd = resolve(cwd);
53569
- const results = [];
53570
- const seen = /* @__PURE__ */ new Set();
53571
- for (const pkg of packages) {
53572
- if (seen.has(pkg.path) || !pkg.version) continue;
53573
- seen.add(pkg.path);
53574
- results.push({
53575
- name: pkg.name,
53576
- path: pkg.path,
53577
- version: pkg.version
53578
- });
53579
- }
53580
- if (!seen.has(resolvedCwd)) {
53581
- const version = readPackageVersion(resolvedCwd);
53582
- if (version) {
53583
- let rootName = "root";
53584
- try {
53585
- const pkg = JSON.parse(readFileSync(join(resolvedCwd, "package.json"), "utf-8"));
53586
- if (pkg.name) rootName = pkg.name;
53587
- } catch {}
53749
+ return Effect.gen(function* () {
53750
+ const resolvedCwd = resolve(cwd);
53751
+ const results = [];
53752
+ const seen = /* @__PURE__ */ new Set();
53753
+ for (const pkg of packages) {
53754
+ if (seen.has(pkg.path) || !pkg.version) continue;
53755
+ seen.add(pkg.path);
53588
53756
  results.push({
53589
- name: rootName,
53590
- path: resolvedCwd,
53591
- version
53757
+ name: pkg.name,
53758
+ path: pkg.path,
53759
+ version: pkg.version
53592
53760
  });
53593
53761
  }
53594
- }
53595
- return results;
53762
+ if (!seen.has(resolvedCwd)) {
53763
+ const version = yield* readPackageVersion(resolvedCwd);
53764
+ if (version) {
53765
+ const rootName = yield* readPackageName(resolvedCwd);
53766
+ results.push({
53767
+ name: rootName,
53768
+ path: resolvedCwd,
53769
+ version
53770
+ });
53771
+ }
53772
+ }
53773
+ return results;
53774
+ });
53596
53775
  }
53597
53776
  /**
53598
53777
  * Determine which workspace version applies to a given file path
@@ -53687,16 +53866,19 @@ var VersionFiles = class VersionFiles {
53687
53866
  * @see {@link VersionFiles.applyVersionEdit} for the per-path edit
53688
53867
  */
53689
53868
  static updateFile(filePath, jsonPaths, version) {
53690
- const original = readFileSync(filePath, "utf-8");
53691
- const { content, previousValues, totalChanged } = VersionFiles.computeUpdate(original, jsonPaths, version);
53692
- if (totalChanged === 0) return;
53693
- writeFileSync(filePath, content, "utf-8");
53694
- return {
53695
- filePath,
53696
- jsonPaths,
53697
- version,
53698
- previousValues
53699
- };
53869
+ return Effect.gen(function* () {
53870
+ const fs = yield* FileSystem.FileSystem;
53871
+ const original = yield* fs.readFileString(filePath);
53872
+ const { content, previousValues, totalChanged } = VersionFiles.computeUpdate(original, jsonPaths, version);
53873
+ if (totalChanged === 0) return;
53874
+ yield* fs.writeFileString(filePath, content);
53875
+ return {
53876
+ filePath,
53877
+ jsonPaths,
53878
+ version,
53879
+ previousValues
53880
+ };
53881
+ });
53700
53882
  }
53701
53883
  /**
53702
53884
  * Compute the full update for a document without touching the filesystem:
@@ -53793,30 +53975,15 @@ var VersionFiles = class VersionFiles {
53793
53975
  */
53794
53976
  static processVersionFiles(cwd, configs, dryRun = false, packages = []) {
53795
53977
  return Effect.gen(function* () {
53796
- const workspaces = VersionFiles.discoverVersions(cwd, packages);
53978
+ const workspaces = yield* VersionFiles.discoverVersions(cwd, packages);
53797
53979
  const rootVersion = workspaces.find((ws) => ws.path === resolve(cwd))?.version ?? "0.0.0";
53798
53980
  const resolved = yield* VersionFiles.resolveGlobs(configs, cwd);
53799
53981
  const updates = [];
53800
53982
  for (const [filePath, config] of resolved) {
53801
53983
  const jsonPaths = config.paths ?? ["$.version"];
53802
53984
  const version = config.package ? workspaces.find((ws) => ws.name === config.package)?.version ?? rootVersion : VersionFiles.resolveVersion(filePath, workspaces, rootVersion);
53803
- try {
53804
- if (dryRun) {
53805
- const content = readFileSync(filePath, "utf-8");
53806
- const { previousValues, totalChanged } = VersionFiles.computeUpdate(content, jsonPaths, version);
53807
- if (totalChanged > 0) updates.push({
53808
- filePath,
53809
- jsonPaths,
53810
- version,
53811
- previousValues
53812
- });
53813
- } else {
53814
- const result = VersionFiles.updateFile(filePath, jsonPaths, version);
53815
- if (result) updates.push(result);
53816
- }
53817
- } catch (error) {
53818
- throw new Error(`Failed to update ${filePath}: ${error instanceof Error ? error.message : String(error)}`);
53819
- }
53985
+ const result = yield* VersionFiles.applyOne(filePath, jsonPaths, version, dryRun).pipe(Effect.orDie);
53986
+ if (result) updates.push(result);
53820
53987
  }
53821
53988
  return updates;
53822
53989
  });
@@ -53843,28 +54010,61 @@ var VersionFiles = class VersionFiles {
53843
54010
  * @internal
53844
54011
  */
53845
54012
  static processResolvedVersionFiles(scopes, dryRun = false) {
53846
- const updates = [];
53847
- for (const scope of scopes) for (const vf of scope.versionFiles) {
53848
- const jsonPaths = vf.paths.length > 0 ? vf.paths : ["$.version"];
53849
- for (const filePath of vf.matchedFiles) try {
53850
- if (dryRun) {
53851
- const content = readFileSync(filePath, "utf-8");
53852
- const { previousValues, totalChanged } = VersionFiles.computeUpdate(content, jsonPaths, scope.version);
53853
- if (totalChanged > 0) updates.push({
53854
- filePath,
53855
- jsonPaths,
53856
- version: scope.version,
53857
- previousValues
53858
- });
53859
- } else {
53860
- const result = VersionFiles.updateFile(filePath, jsonPaths, scope.version);
54013
+ return Effect.gen(function* () {
54014
+ const updates = [];
54015
+ for (const scope of scopes) for (const vf of scope.versionFiles) {
54016
+ const jsonPaths = vf.paths.length > 0 ? vf.paths : ["$.version"];
54017
+ for (const filePath of vf.matchedFiles) {
54018
+ const result = yield* VersionFiles.applyOne(filePath, jsonPaths, scope.version, dryRun);
53861
54019
  if (result) updates.push(result);
53862
54020
  }
53863
- } catch (error) {
53864
- throw new Error(`Failed to update ${filePath}: ${error instanceof Error ? error.message : String(error)}`);
53865
54021
  }
54022
+ return updates;
54023
+ });
54024
+ }
54025
+ /**
54026
+ * Apply one version file's update, shared by both process entry points.
54027
+ *
54028
+ * @remarks
54029
+ * Fails TYPED with `VersionFileError`, carrying the offending `filePath`. The two callers then
54030
+ * choose their own posture, which is not the same and must not be unified:
54031
+ * {@link VersionFiles.processVersionFiles} (legacy) turns it into a DEFECT,
54032
+ * matching the synchronous throw it had under `node:fs`, while
54033
+ * {@link VersionFiles.processResolvedVersionFiles} leaves it typed because
54034
+ * `ReleasePlanner.apply` converts it to a `ReleasePlanError` — a defect there
54035
+ * would bypass the inspector's catch and crash `apply()`.
54036
+ *
54037
+ * @internal
54038
+ */
54039
+ static applyOne(filePath, jsonPaths, version, dryRun) {
54040
+ return Effect.gen(function* () {
54041
+ if (dryRun) {
54042
+ const content = yield* (yield* FileSystem.FileSystem).readFileString(filePath);
54043
+ const { previousValues, totalChanged } = VersionFiles.computeUpdate(content, jsonPaths, version);
54044
+ return totalChanged > 0 ? {
54045
+ filePath,
54046
+ jsonPaths,
54047
+ version,
54048
+ previousValues
54049
+ } : void 0;
54050
+ }
54051
+ return yield* VersionFiles.updateFile(filePath, jsonPaths, version);
54052
+ }).pipe(Effect.mapError((error) => new VersionFileError({
54053
+ filePath,
54054
+ reason: VersionFiles.describeFailure(error)
54055
+ })), Effect.catchDefect((defect) => Effect.fail(new VersionFileError({
54056
+ filePath,
54057
+ reason: VersionFiles.describeFailure(defect)
54058
+ }))));
54059
+ }
54060
+ /** Render a `PlatformError` the way the old `node:fs` catch rendered an `Error`. */
54061
+ static describeFailure(error) {
54062
+ if (typeof error === "object" && error !== null) {
54063
+ const e = error;
54064
+ if (typeof e.message === "string") return e.message;
54065
+ if (typeof e.reason === "string") return e.reason;
53866
54066
  }
53867
- return updates;
54067
+ return String(error);
53868
54068
  }
53869
54069
  };
53870
54070
  /**
@@ -53913,12 +54113,32 @@ function expandGlob(source, cwd) {
53913
54113
  *
53914
54114
  * @internal
53915
54115
  */
54116
+ /**
54117
+ * Read the `name` field from a `package.json` in the given directory, falling
54118
+ * back to `"root"` when it is absent, unreadable, or malformed.
54119
+ *
54120
+ * @param dir - Absolute path to the directory containing `package.json`
54121
+ * @returns The package name, or `"root"`
54122
+ *
54123
+ * @internal
54124
+ */
54125
+ function readPackageName(dir) {
54126
+ return Effect.gen(function* () {
54127
+ const raw = yield* (yield* FileSystem.FileSystem).readFileString(join(dir, "package.json"));
54128
+ return yield* Effect.try({
54129
+ try: () => JSON.parse(raw).name,
54130
+ catch: (e) => e
54131
+ });
54132
+ }).pipe(Effect.map((name) => name ?? "root"), Effect.orElseSucceed(() => "root"));
54133
+ }
53916
54134
  function readPackageVersion(dir) {
53917
- try {
53918
- return JSON.parse(readFileSync(join(dir, "package.json"), "utf-8")).version;
53919
- } catch {
53920
- return;
53921
- }
54135
+ return Effect.gen(function* () {
54136
+ const raw = yield* (yield* FileSystem.FileSystem).readFileString(join(dir, "package.json"));
54137
+ return yield* Effect.try({
54138
+ try: () => JSON.parse(raw).version,
54139
+ catch: (e) => e
54140
+ });
54141
+ }).pipe(Effect.orElseSucceed(() => void 0));
53922
54142
  }
53923
54143
 
53924
54144
  //#endregion
@@ -70809,13 +71029,10 @@ function applyEffect(root, dryRun, changelogModules, inspector, fs) {
70809
71029
  version: fresh
70810
71030
  } : p;
70811
71031
  });
70812
- versionFileUpdates = yield* Effect.try({
70813
- try: () => scopes.length > 0 ? VersionFiles.processResolvedVersionFiles(scopes, dryRun) : [],
70814
- catch: (e) => new ReleasePlanError({
70815
- phase: "apply",
70816
- reason: errMsg(e)
70817
- })
70818
- });
71032
+ versionFileUpdates = scopes.length > 0 ? yield* VersionFiles.processResolvedVersionFiles(scopes, dryRun).pipe(Effect.provideService(FileSystem.FileSystem, fs), Effect.mapError((e) => new ReleasePlanError({
71033
+ phase: "apply",
71034
+ reason: errMsg(e)
71035
+ }))) : [];
70819
71036
  }
70820
71037
  return {
70821
71038
  dryRun,