@savvy-web/silk 3.6.0 → 3.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/changesets-changelog.cjs +1032 -312
- package/changesets-changelog.d.cts +3 -3
- package/changesets-changelog.d.ts +3 -3
- package/changesets-changelog.js +1032 -313
- package/changesets-markdownlint.cjs +1032 -312
- package/changesets-markdownlint.d.cts +3 -3
- package/changesets-markdownlint.d.ts +3 -3
- package/changesets-markdownlint.js +1032 -313
- package/package.json +4 -4
- package/tsconfig/node/dist/tsconfig.tsbuildinfo +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { builtinModules, createRequire } from "node:module";
|
|
2
|
-
import { Context, Data, Duration, Effect, Equal, Exit, FileSystem, Function, Hash, HashMap, Layer, Option, Order, Path, Pipeable, PlatformError, Predicate, Redacted, Ref, Result, Schema, SchemaIssue, SchemaTransformation, Stdio, Stream } from "effect";
|
|
2
|
+
import { Context, Data, Duration, Effect, Equal, Exit, FileSystem, Function, Graph, Hash, HashMap, Layer, Option, Order, Path, Pipeable, PlatformError, Predicate, Redacted, Ref, Result, Schema, SchemaIssue, SchemaTransformation, Stdio, Stream } from "effect";
|
|
3
3
|
import * as path$1 from "node:path";
|
|
4
4
|
import { basename, delimiter, dirname, isAbsolute, join, normalize, relative, resolve } from "node:path";
|
|
5
5
|
import { ChildProcess, ChildProcessSpawner } from "effect/unstable/process";
|
|
@@ -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.
|
|
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
|
|
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.
|
|
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
|
|
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.
|
|
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
|
|
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.
|
|
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
|
|
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.
|
|
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
|
|
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.
|
|
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
|
|
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.
|
|
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
|
|
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.
|
|
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
|
|
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.
|
|
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
|
|
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.
|
|
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
|
|
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.
|
|
7877
|
+
//#region ../../node_modules/.pnpm/@effected+yaml@0.8.0_effect@4.0.0-beta.107/node_modules/@effected/yaml/YamlNode.js
|
|
7878
7878
|
/**
|
|
7879
7879
|
* YAML scalar presentation styles.
|
|
7880
7880
|
*
|
|
@@ -7923,9 +7923,17 @@ const ScalarChomp = Schema.Literals([
|
|
|
7923
7923
|
* - `style` — the scalar presentation style in the source document.
|
|
7924
7924
|
* - `tag` — optional explicit YAML tag (e.g. `!!str`, `!!int`).
|
|
7925
7925
|
* - `anchor` — optional anchor name for aliasing.
|
|
7926
|
-
* - `
|
|
7926
|
+
* - `commentBefore` — own-line comment text directly above the node
|
|
7927
|
+
* (multiple consecutive comment lines join with `\n`).
|
|
7928
|
+
* - `comment` — trailing comment text on the node's line (strictly trailing;
|
|
7929
|
+
* own-line comments live on `commentBefore`).
|
|
7930
|
+
* - `spaceBefore` — `true` when a blank line precedes the node (and its
|
|
7931
|
+
* `commentBefore` block, when present) in the source.
|
|
7927
7932
|
* - `chomp` — block-scalar chomping indicator, when the scalar is a block
|
|
7928
7933
|
* scalar.
|
|
7934
|
+
* - `blockIndent` — the EXPLICIT indentation-indicator digit from a block
|
|
7935
|
+
* scalar's header (`|2`, `>1+`), when the source spelled one; absent when
|
|
7936
|
+
* the header let the reader auto-detect the indent.
|
|
7929
7937
|
* - `raw` — the raw source text, preserved when it differs from the resolved
|
|
7930
7938
|
* value in a way stringification needs to know about.
|
|
7931
7939
|
* - `sourceMultiline` — `true` when the source span covers two or more lines;
|
|
@@ -7939,8 +7947,11 @@ var YamlScalar = class extends Schema.TaggedClass()("YamlScalar", {
|
|
|
7939
7947
|
tag: Schema.optionalKey(Schema.String),
|
|
7940
7948
|
style: ScalarStyle,
|
|
7941
7949
|
anchor: Schema.optionalKey(Schema.String),
|
|
7950
|
+
commentBefore: Schema.optionalKey(Schema.String),
|
|
7942
7951
|
comment: Schema.optionalKey(Schema.String),
|
|
7952
|
+
spaceBefore: Schema.optionalKey(Schema.Boolean),
|
|
7943
7953
|
chomp: Schema.optionalKey(ScalarChomp),
|
|
7954
|
+
blockIndent: Schema.optionalKey(Schema.Number),
|
|
7944
7955
|
raw: Schema.optionalKey(Schema.String),
|
|
7945
7956
|
sourceMultiline: Schema.optionalKey(Schema.Boolean),
|
|
7946
7957
|
offset: Schema.Number,
|
|
@@ -8031,18 +8042,31 @@ const YamlNode = Schema.suspend(() => Schema.Union([
|
|
|
8031
8042
|
* A YAML key-value pair AST node, representing one entry within a mapping.
|
|
8032
8043
|
* `value` is `null` when absent (e.g. `key:` with no value).
|
|
8033
8044
|
*
|
|
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.
|
|
8050
|
+
*
|
|
8034
8051
|
* @public
|
|
8035
8052
|
*/
|
|
8036
8053
|
var YamlPair = class extends Schema.TaggedClass()("YamlPair", {
|
|
8037
8054
|
key: Schema.suspend(() => YamlNode),
|
|
8038
8055
|
value: Schema.NullOr(Schema.suspend(() => YamlNode)),
|
|
8039
|
-
|
|
8056
|
+
commentBefore: Schema.optionalKey(Schema.String),
|
|
8057
|
+
comment: Schema.optionalKey(Schema.String),
|
|
8058
|
+
spaceBefore: Schema.optionalKey(Schema.Boolean)
|
|
8040
8059
|
}) {};
|
|
8041
8060
|
/**
|
|
8042
8061
|
* A YAML mapping AST node, representing a collection of {@link YamlPair}
|
|
8043
8062
|
* entries.
|
|
8044
8063
|
*
|
|
8045
8064
|
* - `style` — the presentation style: `"block"` or `"flow"`.
|
|
8065
|
+
* - `commentBefore` — own-line comment text directly above the mapping.
|
|
8066
|
+
* - `comment` — trailing comment text: own-line comment lines after the
|
|
8067
|
+
* mapping's last entry (still at the mapping's item indent), or a same-line
|
|
8068
|
+
* trailing comment for a flow mapping.
|
|
8069
|
+
* - `spaceBefore` — `true` when a blank line precedes the mapping.
|
|
8046
8070
|
* - `sourceMultiline` — `true` when the source span covers two or more lines;
|
|
8047
8071
|
* used by the canonical stringifier. Absent on synthetic nodes.
|
|
8048
8072
|
*
|
|
@@ -8053,7 +8077,9 @@ var YamlMap = class extends Schema.TaggedClass()("YamlMap", {
|
|
|
8053
8077
|
tag: Schema.optionalKey(Schema.String),
|
|
8054
8078
|
anchor: Schema.optionalKey(Schema.String),
|
|
8055
8079
|
style: CollectionStyle,
|
|
8080
|
+
commentBefore: Schema.optionalKey(Schema.String),
|
|
8056
8081
|
comment: Schema.optionalKey(Schema.String),
|
|
8082
|
+
spaceBefore: Schema.optionalKey(Schema.Boolean),
|
|
8057
8083
|
sourceMultiline: Schema.optionalKey(Schema.Boolean),
|
|
8058
8084
|
offset: Schema.Number,
|
|
8059
8085
|
length: Schema.Number
|
|
@@ -8079,6 +8105,12 @@ var YamlMap = class extends Schema.TaggedClass()("YamlMap", {
|
|
|
8079
8105
|
* A YAML sequence AST node, representing an ordered list of
|
|
8080
8106
|
* {@link (YamlNode:type)} values.
|
|
8081
8107
|
*
|
|
8108
|
+
* - `commentBefore` — own-line comment text directly above the sequence.
|
|
8109
|
+
* - `comment` — trailing comment text: own-line comment lines after the
|
|
8110
|
+
* sequence's last item (still at the sequence's item indent), or a
|
|
8111
|
+
* same-line trailing comment for a flow sequence.
|
|
8112
|
+
* - `spaceBefore` — `true` when a blank line precedes the sequence.
|
|
8113
|
+
*
|
|
8082
8114
|
* @public
|
|
8083
8115
|
*/
|
|
8084
8116
|
var YamlSeq = class extends Schema.TaggedClass()("YamlSeq", {
|
|
@@ -8086,7 +8118,9 @@ var YamlSeq = class extends Schema.TaggedClass()("YamlSeq", {
|
|
|
8086
8118
|
tag: Schema.optionalKey(Schema.String),
|
|
8087
8119
|
anchor: Schema.optionalKey(Schema.String),
|
|
8088
8120
|
style: CollectionStyle,
|
|
8121
|
+
commentBefore: Schema.optionalKey(Schema.String),
|
|
8089
8122
|
comment: Schema.optionalKey(Schema.String),
|
|
8123
|
+
spaceBefore: Schema.optionalKey(Schema.Boolean),
|
|
8090
8124
|
sourceMultiline: Schema.optionalKey(Schema.Boolean),
|
|
8091
8125
|
offset: Schema.Number,
|
|
8092
8126
|
length: Schema.Number
|
|
@@ -8277,7 +8311,7 @@ function nodeToValue(node, anchors, budget, counting = false) {
|
|
|
8277
8311
|
}
|
|
8278
8312
|
|
|
8279
8313
|
//#endregion
|
|
8280
|
-
//#region ../../node_modules/.pnpm/@effected+yaml@0.
|
|
8314
|
+
//#region ../../node_modules/.pnpm/@effected+yaml@0.8.0_effect@4.0.0-beta.107/node_modules/@effected/yaml/internal/diagnostics.js
|
|
8281
8315
|
/** Error codes emitted by the lexer stage. */
|
|
8282
8316
|
const YAML_LEX_ERROR_CODES = [
|
|
8283
8317
|
"UnexpectedCharacter",
|
|
@@ -8322,14 +8356,23 @@ const YAML_COMPOSE_ERROR_CODES = [
|
|
|
8322
8356
|
*/
|
|
8323
8357
|
const YAML_STRINGIFY_ERROR_CODES = ["CircularReference"];
|
|
8324
8358
|
/**
|
|
8325
|
-
* Error codes for the modify stage (`YamlFormat.modify`'s path
|
|
8326
|
-
* against an already-composed AST). Not raised by the
|
|
8359
|
+
* Error codes for the modify stage (`YamlFormat.modify`'s guards and path
|
|
8360
|
+
* navigation against an already-composed AST). Not raised by the
|
|
8361
|
+
* parser/composer. `MultiDocumentStream` is the single-document-contract
|
|
8362
|
+
* refusal: `modify` re-emits exactly one document, so a multi-document
|
|
8363
|
+
* stream fails typed rather than silently truncating documents 2..n.
|
|
8364
|
+
* `DirectiveCarryingDocument` is the directive refusal: the stringifier does
|
|
8365
|
+
* not re-emit `%YAML`/`%TAG` directive lines, and re-emitting a document
|
|
8366
|
+
* without its `%TAG` orphans every shorthand tag that depends on it — the
|
|
8367
|
+
* output would be unparseable — so modify fails typed rather than corrupting.
|
|
8327
8368
|
*/
|
|
8328
8369
|
const YAML_MODIFY_ERROR_CODES = [
|
|
8329
8370
|
"EmptyDocument",
|
|
8330
8371
|
"PathNotFound",
|
|
8331
8372
|
"InvalidIndex",
|
|
8332
|
-
"NotNavigable"
|
|
8373
|
+
"NotNavigable",
|
|
8374
|
+
"MultiDocumentStream",
|
|
8375
|
+
"DirectiveCarryingDocument"
|
|
8333
8376
|
];
|
|
8334
8377
|
/**
|
|
8335
8378
|
* The single source of truth for which diagnostic codes are fatal to a
|
|
@@ -8356,7 +8399,7 @@ function isFatalCode(code) {
|
|
|
8356
8399
|
}
|
|
8357
8400
|
|
|
8358
8401
|
//#endregion
|
|
8359
|
-
//#region ../../node_modules/.pnpm/@effected+yaml@0.
|
|
8402
|
+
//#region ../../node_modules/.pnpm/@effected+yaml@0.8.0_effect@4.0.0-beta.107/node_modules/@effected/yaml/YamlDiagnostic.js
|
|
8360
8403
|
/**
|
|
8361
8404
|
* Error codes emitted by the lexer stage.
|
|
8362
8405
|
*
|
|
@@ -8478,101 +8521,7 @@ function lineChar(text, offset) {
|
|
|
8478
8521
|
}
|
|
8479
8522
|
|
|
8480
8523
|
//#endregion
|
|
8481
|
-
//#region ../../node_modules/.pnpm/@effected+yaml@0.
|
|
8482
|
-
/**
|
|
8483
|
-
* Check if a pending anchor is being applied to an alias node (invalid in YAML 1.2 §3.2.2).
|
|
8484
|
-
* Aliases represent references to existing anchored nodes and cannot have their own anchors.
|
|
8485
|
-
*
|
|
8486
|
-
* Uses `DuplicateAnchor` error code as a pragmatic reuse — semantically this is
|
|
8487
|
-
* "anchor on alias" rather than "same anchor name defined twice", but adding a
|
|
8488
|
-
* dedicated `AnchorOnAlias` code would be a public API change. The error message
|
|
8489
|
-
* distinguishes the two cases for consumers inspecting the message text.
|
|
8490
|
-
*/
|
|
8491
|
-
function checkAnchorOnAlias(pendingMeta, cst, state) {
|
|
8492
|
-
if (pendingMeta.anchor !== void 0) state.errors.push({
|
|
8493
|
-
code: "DuplicateAnchor",
|
|
8494
|
-
message: `Anchor &${pendingMeta.anchor} cannot be applied to alias *${getAliasName(cst, state.text)}`,
|
|
8495
|
-
offset: cst.offset,
|
|
8496
|
-
length: cst.length
|
|
8497
|
-
});
|
|
8498
|
-
}
|
|
8499
|
-
function makeAlias(cst, state) {
|
|
8500
|
-
const name = getAliasName(cst, state.text);
|
|
8501
|
-
if (!state.anchors.has(name)) state.errors.push({
|
|
8502
|
-
code: "UndefinedAlias",
|
|
8503
|
-
message: `Undefined alias: *${name}`,
|
|
8504
|
-
offset: cst.offset,
|
|
8505
|
-
length: cst.length
|
|
8506
|
-
});
|
|
8507
|
-
else {
|
|
8508
|
-
state.aliasCount++;
|
|
8509
|
-
if (state.aliasCount > state.options.maxAliasCount) state.errors.push({
|
|
8510
|
-
code: "AliasCountExceeded",
|
|
8511
|
-
message: `Alias count exceeded maximum of ${state.options.maxAliasCount}`,
|
|
8512
|
-
offset: cst.offset,
|
|
8513
|
-
length: cst.length
|
|
8514
|
-
});
|
|
8515
|
-
}
|
|
8516
|
-
return new YamlAlias({
|
|
8517
|
-
name,
|
|
8518
|
-
offset: cst.offset,
|
|
8519
|
-
length: cst.length
|
|
8520
|
-
});
|
|
8521
|
-
}
|
|
8522
|
-
function registerAnchor(node, anchor, state, offset) {
|
|
8523
|
-
if (state.anchors.has(anchor)) state.warnings.push({
|
|
8524
|
-
code: "DuplicateAnchor",
|
|
8525
|
-
message: `Duplicate anchor: &${anchor}`,
|
|
8526
|
-
offset,
|
|
8527
|
-
length: anchor.length + 1
|
|
8528
|
-
});
|
|
8529
|
-
state.anchors.set(anchor, node);
|
|
8530
|
-
}
|
|
8531
|
-
function getAnchorName(cst, text) {
|
|
8532
|
-
if (text[cst.offset] === "&") return scanName(text, cst.offset + 1);
|
|
8533
|
-
return cst.source;
|
|
8534
|
-
}
|
|
8535
|
-
function getAliasName(cst, text) {
|
|
8536
|
-
if (text[cst.offset] === "*") return scanName(text, cst.offset + 1);
|
|
8537
|
-
return cst.source;
|
|
8538
|
-
}
|
|
8539
|
-
function scanName(text, start) {
|
|
8540
|
-
let end = start;
|
|
8541
|
-
while (end < text.length) {
|
|
8542
|
-
const ch = text[end];
|
|
8543
|
-
if (ch === " " || ch === " " || ch === "\n" || ch === "\r" || ch === "{" || ch === "}" || ch === "[" || ch === "]" || ch === "," || ch === void 0) break;
|
|
8544
|
-
end++;
|
|
8545
|
-
}
|
|
8546
|
-
return text.slice(start, end);
|
|
8547
|
-
}
|
|
8548
|
-
/**
|
|
8549
|
-
* Build an anchor map by walking the AST, collecting nodes that have anchors.
|
|
8550
|
-
* Used to resolve aliases when extracting plain JavaScript values from
|
|
8551
|
-
* parsed YAML documents.
|
|
8552
|
-
*/
|
|
8553
|
-
function buildAnchorMap(node) {
|
|
8554
|
-
const anchors = /* @__PURE__ */ new Map();
|
|
8555
|
-
collectAnchors(node, anchors);
|
|
8556
|
-
return anchors;
|
|
8557
|
-
}
|
|
8558
|
-
function collectAnchors(node, anchors) {
|
|
8559
|
-
if (node === null) return;
|
|
8560
|
-
if (node instanceof YamlScalar) {
|
|
8561
|
-
if (node.anchor !== void 0) anchors.set(node.anchor, node);
|
|
8562
|
-
} else if (node instanceof YamlMap) {
|
|
8563
|
-
if (node.anchor !== void 0) anchors.set(node.anchor, node);
|
|
8564
|
-
for (const pair of node.items) {
|
|
8565
|
-
collectAnchors(pair.key, anchors);
|
|
8566
|
-
collectAnchors(pair.value, anchors);
|
|
8567
|
-
}
|
|
8568
|
-
} else if (node instanceof YamlSeq) {
|
|
8569
|
-
if (node.anchor !== void 0) anchors.set(node.anchor, node);
|
|
8570
|
-
for (const item of node.items) collectAnchors(item, anchors);
|
|
8571
|
-
}
|
|
8572
|
-
}
|
|
8573
|
-
|
|
8574
|
-
//#endregion
|
|
8575
|
-
//#region ../../node_modules/.pnpm/@effected+yaml@0.7.0_effect@4.0.0-beta.107/node_modules/@effected/yaml/internal/lexer.js
|
|
8524
|
+
//#region ../../node_modules/.pnpm/@effected+yaml@0.8.0_effect@4.0.0-beta.107/node_modules/@effected/yaml/internal/lexer.js
|
|
8576
8525
|
/**
|
|
8577
8526
|
* Create a new YAML scanner for the given source text.
|
|
8578
8527
|
*
|
|
@@ -9536,7 +9485,7 @@ function lexAll(text) {
|
|
|
9536
9485
|
}
|
|
9537
9486
|
|
|
9538
9487
|
//#endregion
|
|
9539
|
-
//#region ../../node_modules/.pnpm/@effected+yaml@0.
|
|
9488
|
+
//#region ../../node_modules/.pnpm/@effected+yaml@0.8.0_effect@4.0.0-beta.107/node_modules/@effected/yaml/internal/cst-parser.js
|
|
9540
9489
|
/**
|
|
9541
9490
|
* Hardening: cap CST nesting so hostile inputs cannot overflow the stack
|
|
9542
9491
|
* while the tree is being BUILT. Set slightly above the composer's
|
|
@@ -9901,7 +9850,8 @@ function parseBlockValue(state, parentIndent, explicitKey = false) {
|
|
|
9901
9850
|
const token = peek(state);
|
|
9902
9851
|
if (!token) break;
|
|
9903
9852
|
if (token.kind === "whitespace") {
|
|
9904
|
-
|
|
9853
|
+
advance(state);
|
|
9854
|
+
nodes.push(makeLeafNode("whitespace", token, state.text));
|
|
9905
9855
|
continue;
|
|
9906
9856
|
}
|
|
9907
9857
|
if (token.kind === "newline") break;
|
|
@@ -10257,7 +10207,260 @@ function parseCSTAll(text) {
|
|
|
10257
10207
|
}
|
|
10258
10208
|
|
|
10259
10209
|
//#endregion
|
|
10260
|
-
//#region ../../node_modules/.pnpm/@effected+yaml@0.
|
|
10210
|
+
//#region ../../node_modules/.pnpm/@effected+yaml@0.8.0_effect@4.0.0-beta.107/node_modules/@effected/yaml/internal/composer/anchors.js
|
|
10211
|
+
/**
|
|
10212
|
+
* Check if a pending anchor is being applied to an alias node (invalid in YAML 1.2 §3.2.2).
|
|
10213
|
+
* Aliases represent references to existing anchored nodes and cannot have their own anchors.
|
|
10214
|
+
*
|
|
10215
|
+
* Uses `DuplicateAnchor` error code as a pragmatic reuse — semantically this is
|
|
10216
|
+
* "anchor on alias" rather than "same anchor name defined twice", but adding a
|
|
10217
|
+
* dedicated `AnchorOnAlias` code would be a public API change. The error message
|
|
10218
|
+
* distinguishes the two cases for consumers inspecting the message text.
|
|
10219
|
+
*/
|
|
10220
|
+
function checkAnchorOnAlias(pendingMeta, cst, state) {
|
|
10221
|
+
if (pendingMeta.anchor !== void 0) state.errors.push({
|
|
10222
|
+
code: "DuplicateAnchor",
|
|
10223
|
+
message: `Anchor &${pendingMeta.anchor} cannot be applied to alias *${getAliasName(cst, state.text)}`,
|
|
10224
|
+
offset: cst.offset,
|
|
10225
|
+
length: cst.length
|
|
10226
|
+
});
|
|
10227
|
+
}
|
|
10228
|
+
function makeAlias(cst, state) {
|
|
10229
|
+
const name = getAliasName(cst, state.text);
|
|
10230
|
+
if (!state.anchors.has(name)) state.errors.push({
|
|
10231
|
+
code: "UndefinedAlias",
|
|
10232
|
+
message: `Undefined alias: *${name}`,
|
|
10233
|
+
offset: cst.offset,
|
|
10234
|
+
length: cst.length
|
|
10235
|
+
});
|
|
10236
|
+
else {
|
|
10237
|
+
state.aliasCount++;
|
|
10238
|
+
if (state.aliasCount > state.options.maxAliasCount) state.errors.push({
|
|
10239
|
+
code: "AliasCountExceeded",
|
|
10240
|
+
message: `Alias count exceeded maximum of ${state.options.maxAliasCount}`,
|
|
10241
|
+
offset: cst.offset,
|
|
10242
|
+
length: cst.length
|
|
10243
|
+
});
|
|
10244
|
+
}
|
|
10245
|
+
return new YamlAlias({
|
|
10246
|
+
name,
|
|
10247
|
+
offset: cst.offset,
|
|
10248
|
+
length: cst.length
|
|
10249
|
+
});
|
|
10250
|
+
}
|
|
10251
|
+
function registerAnchor(node, anchor, state, offset) {
|
|
10252
|
+
if (state.anchors.has(anchor)) state.warnings.push({
|
|
10253
|
+
code: "DuplicateAnchor",
|
|
10254
|
+
message: `Duplicate anchor: &${anchor}`,
|
|
10255
|
+
offset,
|
|
10256
|
+
length: anchor.length + 1
|
|
10257
|
+
});
|
|
10258
|
+
state.anchors.set(anchor, node);
|
|
10259
|
+
}
|
|
10260
|
+
function getAnchorName(cst, text) {
|
|
10261
|
+
if (text[cst.offset] === "&") return scanName(text, cst.offset + 1);
|
|
10262
|
+
return cst.source;
|
|
10263
|
+
}
|
|
10264
|
+
function getAliasName(cst, text) {
|
|
10265
|
+
if (text[cst.offset] === "*") return scanName(text, cst.offset + 1);
|
|
10266
|
+
return cst.source;
|
|
10267
|
+
}
|
|
10268
|
+
function scanName(text, start) {
|
|
10269
|
+
let end = start;
|
|
10270
|
+
while (end < text.length) {
|
|
10271
|
+
const ch = text[end];
|
|
10272
|
+
if (ch === " " || ch === " " || ch === "\n" || ch === "\r" || ch === "{" || ch === "}" || ch === "[" || ch === "]" || ch === "," || ch === void 0) break;
|
|
10273
|
+
end++;
|
|
10274
|
+
}
|
|
10275
|
+
return text.slice(start, end);
|
|
10276
|
+
}
|
|
10277
|
+
|
|
10278
|
+
//#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
|
|
10280
|
+
/** True when there is no line break between `start` and `end` in `text`. */
|
|
10281
|
+
function sameLineSpan(text, start, end) {
|
|
10282
|
+
if (start < 0) return false;
|
|
10283
|
+
return !text.slice(Math.max(0, start), Math.max(0, end)).includes("\n");
|
|
10284
|
+
}
|
|
10285
|
+
/**
|
|
10286
|
+
* True when only horizontal whitespace precedes `offset` on its line — i.e.
|
|
10287
|
+
* the token at `offset` starts its own line. Purely local, so it stays
|
|
10288
|
+
* correct even when a preceding node's span over-extends past line ends.
|
|
10289
|
+
*/
|
|
10290
|
+
function isOwnLineAt(text, offset) {
|
|
10291
|
+
let i = offset - 1;
|
|
10292
|
+
while (i >= 0) {
|
|
10293
|
+
const ch = text[i];
|
|
10294
|
+
if (ch === " " || ch === " ") {
|
|
10295
|
+
i--;
|
|
10296
|
+
continue;
|
|
10297
|
+
}
|
|
10298
|
+
return ch === "\n" || ch === "\r";
|
|
10299
|
+
}
|
|
10300
|
+
return true;
|
|
10301
|
+
}
|
|
10302
|
+
/**
|
|
10303
|
+
* True when the line immediately above the line containing `offset` is blank
|
|
10304
|
+
* (empty or horizontal whitespace only). Purely local — see
|
|
10305
|
+
* {@link isOwnLineAt} for why span-based gap checks are not used.
|
|
10306
|
+
*/
|
|
10307
|
+
function hasBlankLineAbove(text, offset) {
|
|
10308
|
+
return blankLineAboveStart(text, offset) >= 0;
|
|
10309
|
+
}
|
|
10310
|
+
/**
|
|
10311
|
+
* Start offset of the blank line immediately above the line containing
|
|
10312
|
+
* `offset`, or `-1` when that line is not blank. The offset form of
|
|
10313
|
+
* {@link hasBlankLineAbove}, for callers that must locate the blank line
|
|
10314
|
+
* (e.g. to test whether it falls inside a preceding scalar token's span).
|
|
10315
|
+
*/
|
|
10316
|
+
function blankLineAboveStart(text, offset) {
|
|
10317
|
+
const lineBreak = text.lastIndexOf("\n", Math.max(0, offset - 1));
|
|
10318
|
+
if (lineBreak < 0) return -1;
|
|
10319
|
+
const prevBreak = text.lastIndexOf("\n", lineBreak - 1);
|
|
10320
|
+
return text.slice(prevBreak + 1, lineBreak).trim() === "" ? prevBreak + 1 : -1;
|
|
10321
|
+
}
|
|
10322
|
+
/**
|
|
10323
|
+
* The deepest trailing scalar reached by descending last-child edges from
|
|
10324
|
+
* `node` (a map's last pair's value, a seq's last item) — the node whose
|
|
10325
|
+
* token span a textually-following blank line could fall inside.
|
|
10326
|
+
*/
|
|
10327
|
+
function deepestTrailingScalar(node) {
|
|
10328
|
+
let current = node;
|
|
10329
|
+
for (;;) {
|
|
10330
|
+
if (current instanceof YamlScalar) return current;
|
|
10331
|
+
if (current instanceof YamlMap) {
|
|
10332
|
+
const last = current.items[current.items.length - 1];
|
|
10333
|
+
if (last === void 0) return void 0;
|
|
10334
|
+
current = last.value ?? last.key;
|
|
10335
|
+
continue;
|
|
10336
|
+
}
|
|
10337
|
+
if (current instanceof YamlSeq) {
|
|
10338
|
+
const last = current.items[current.items.length - 1];
|
|
10339
|
+
if (last === void 0) return void 0;
|
|
10340
|
+
current = last;
|
|
10341
|
+
continue;
|
|
10342
|
+
}
|
|
10343
|
+
return;
|
|
10344
|
+
}
|
|
10345
|
+
}
|
|
10346
|
+
/**
|
|
10347
|
+
* True when the blank line immediately above `offset` is CONTENT of the
|
|
10348
|
+
* preceding keep-chomp block scalar, not a stylistic blank. Under `+`
|
|
10349
|
+
* chomping the trailing line breaks are part of the scalar's VALUE (the
|
|
10350
|
+
* composer already stores them there), so recording the same blank line as
|
|
10351
|
+
* `spaceBefore` (or a leading-blank embed on a terminal comment run) would
|
|
10352
|
+
* double-count it: emission renders both the kept newline and the stylistic
|
|
10353
|
+
* blank, growing the document on every format pass. Clip/strip scalars are
|
|
10354
|
+
* deliberately NOT excluded — their emission drops the trailing blank from
|
|
10355
|
+
* the value, so the `spaceBefore` capture is exactly what re-creates it.
|
|
10356
|
+
*
|
|
10357
|
+
* `prev` is the last composed node before `offset` (a pair's value, a seq
|
|
10358
|
+
* item); the check descends to its deepest trailing scalar and requires the
|
|
10359
|
+
* blank line to start inside that scalar's token span.
|
|
10360
|
+
*/
|
|
10361
|
+
function blankAboveIsKeepChompContent(text, offset, prev) {
|
|
10362
|
+
if (prev === void 0) return false;
|
|
10363
|
+
const scalar = deepestTrailingScalar(prev);
|
|
10364
|
+
if (scalar === void 0 || scalar.chomp !== "keep") return false;
|
|
10365
|
+
if (scalar.style !== "block-literal" && scalar.style !== "block-folded") return false;
|
|
10366
|
+
const start = blankLineAboveStart(text, offset);
|
|
10367
|
+
return start >= scalar.offset && start < scalar.offset + scalar.length;
|
|
10368
|
+
}
|
|
10369
|
+
/**
|
|
10370
|
+
* True when the line immediately below the line containing `offset` is blank
|
|
10371
|
+
* (empty or horizontal whitespace only) AND is itself followed by another
|
|
10372
|
+
* line. Purely local, the mirror of {@link hasBlankLineAbove} — used to embed
|
|
10373
|
+
* a blank line AFTER a comment run as a trailing empty line in the stored
|
|
10374
|
+
* comment string.
|
|
10375
|
+
*/
|
|
10376
|
+
function hasBlankLineBelow(text, offset) {
|
|
10377
|
+
const lineEnd = text.indexOf("\n", Math.max(0, offset));
|
|
10378
|
+
if (lineEnd < 0) return false;
|
|
10379
|
+
const nextEnd = text.indexOf("\n", lineEnd + 1);
|
|
10380
|
+
if (nextEnd < 0) return false;
|
|
10381
|
+
return text.slice(lineEnd + 1, nextEnd).trim() === "";
|
|
10382
|
+
}
|
|
10383
|
+
/**
|
|
10384
|
+
* The stored text of a comment token: the RAW post-`#` slice, reference
|
|
10385
|
+
* parity with the `yaml` npm package — `# section` stores `" section"`,
|
|
10386
|
+
* `#no-space` stores `"no-space"`, `# aligned` keeps its alignment.
|
|
10387
|
+
*
|
|
10388
|
+
* The one reserved string is `""`, which encodes an embedded blank line
|
|
10389
|
+
* inside a joined comment run — so a spaces-only raw slice stores with ONE
|
|
10390
|
+
* extra trailing space and the renderers strip it back off. A bare `#`
|
|
10391
|
+
* (raw `""`) stores `" "`, `# ` (raw `" "`) stores `" "`, and so on; the
|
|
10392
|
+
* escape is injective, so every comment spelling roundtrips byte-intact.
|
|
10393
|
+
* Raw storage is what makes byte-intact roundtrip possible; trimming would
|
|
10394
|
+
* canonicalize every comment to `# text`.
|
|
10395
|
+
*/
|
|
10396
|
+
function rawCommentText(source) {
|
|
10397
|
+
const raw = source.startsWith("#") ? source.slice(1) : source;
|
|
10398
|
+
return /^ *$/.test(raw) ? `${raw} ` : raw;
|
|
10399
|
+
}
|
|
10400
|
+
/** Join two optional comment blocks with a newline. */
|
|
10401
|
+
function joinComments(a, b) {
|
|
10402
|
+
return a === void 0 ? b : `${a}\n${b}`;
|
|
10403
|
+
}
|
|
10404
|
+
/** Zero-based column of `offset` within its line. */
|
|
10405
|
+
function columnAt(text, offset) {
|
|
10406
|
+
if (offset <= 0) return 0;
|
|
10407
|
+
return offset - (text.lastIndexOf("\n", offset - 1) + 1);
|
|
10408
|
+
}
|
|
10409
|
+
/**
|
|
10410
|
+
* Rebuild `node` with the given comment fields merged in (existing fields are
|
|
10411
|
+
* 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.
|
|
10414
|
+
*/
|
|
10415
|
+
function withCommentFields(node, fields) {
|
|
10416
|
+
if (node instanceof YamlScalar) return new YamlScalar({
|
|
10417
|
+
value: node.value,
|
|
10418
|
+
style: node.style,
|
|
10419
|
+
...node.tag !== void 0 ? { tag: node.tag } : {},
|
|
10420
|
+
...node.anchor !== void 0 ? { anchor: node.anchor } : {},
|
|
10421
|
+
...mergedCommentFields(node, fields),
|
|
10422
|
+
...node.chomp !== void 0 ? { chomp: node.chomp } : {},
|
|
10423
|
+
...node.blockIndent !== void 0 ? { blockIndent: node.blockIndent } : {},
|
|
10424
|
+
...node.raw !== void 0 ? { raw: node.raw } : {},
|
|
10425
|
+
...node.sourceMultiline !== void 0 ? { sourceMultiline: node.sourceMultiline } : {},
|
|
10426
|
+
offset: node.offset,
|
|
10427
|
+
length: node.length
|
|
10428
|
+
});
|
|
10429
|
+
if (node instanceof YamlMap) return new YamlMap({
|
|
10430
|
+
items: node.items,
|
|
10431
|
+
style: node.style,
|
|
10432
|
+
...node.tag !== void 0 ? { tag: node.tag } : {},
|
|
10433
|
+
...node.anchor !== void 0 ? { anchor: node.anchor } : {},
|
|
10434
|
+
...mergedCommentFields(node, fields),
|
|
10435
|
+
...node.sourceMultiline !== void 0 ? { sourceMultiline: node.sourceMultiline } : {},
|
|
10436
|
+
offset: node.offset,
|
|
10437
|
+
length: node.length
|
|
10438
|
+
});
|
|
10439
|
+
if (node instanceof YamlSeq) return new YamlSeq({
|
|
10440
|
+
items: node.items,
|
|
10441
|
+
style: node.style,
|
|
10442
|
+
...node.tag !== void 0 ? { tag: node.tag } : {},
|
|
10443
|
+
...node.anchor !== void 0 ? { anchor: node.anchor } : {},
|
|
10444
|
+
...mergedCommentFields(node, fields),
|
|
10445
|
+
...node.sourceMultiline !== void 0 ? { sourceMultiline: node.sourceMultiline } : {},
|
|
10446
|
+
offset: node.offset,
|
|
10447
|
+
length: node.length
|
|
10448
|
+
});
|
|
10449
|
+
return node;
|
|
10450
|
+
}
|
|
10451
|
+
function mergedCommentFields(existing, incoming) {
|
|
10452
|
+
const commentBefore = incoming.commentBefore !== void 0 ? existing.commentBefore !== void 0 ? `${existing.commentBefore}\n${incoming.commentBefore}` : incoming.commentBefore : existing.commentBefore;
|
|
10453
|
+
const comment = incoming.comment !== void 0 ? existing.comment !== void 0 ? `${existing.comment}\n${incoming.comment}` : incoming.comment : existing.comment;
|
|
10454
|
+
const spaceBefore = incoming.spaceBefore ?? existing.spaceBefore;
|
|
10455
|
+
return {
|
|
10456
|
+
...commentBefore !== void 0 ? { commentBefore } : {},
|
|
10457
|
+
...comment !== void 0 ? { comment } : {},
|
|
10458
|
+
...spaceBefore !== void 0 ? { spaceBefore } : {}
|
|
10459
|
+
};
|
|
10460
|
+
}
|
|
10461
|
+
|
|
10462
|
+
//#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
|
|
10261
10464
|
let lineStartsText;
|
|
10262
10465
|
let lineStartsCache = [];
|
|
10263
10466
|
function getLineStarts(text) {
|
|
@@ -10322,6 +10525,19 @@ function clearMeta(m) {
|
|
|
10322
10525
|
delete m.tag;
|
|
10323
10526
|
delete m.comment;
|
|
10324
10527
|
}
|
|
10528
|
+
/**
|
|
10529
|
+
* The comment-fidelity field triple carried by the four public node classes
|
|
10530
|
+
* (and `YamlPair`). Conditional-spread helper so AST rebuild sites copy all
|
|
10531
|
+
* three without hand-maintaining the list — and never emit an explicit
|
|
10532
|
+
* `undefined` into a v4 `optionalKey` field.
|
|
10533
|
+
*/
|
|
10534
|
+
function commentProps(n) {
|
|
10535
|
+
return {
|
|
10536
|
+
...n.commentBefore !== void 0 ? { commentBefore: n.commentBefore } : {},
|
|
10537
|
+
...n.comment !== void 0 ? { comment: n.comment } : {},
|
|
10538
|
+
...n.spaceBefore !== void 0 ? { spaceBefore: n.spaceBefore } : {}
|
|
10539
|
+
};
|
|
10540
|
+
}
|
|
10325
10541
|
function createState(text, flow, options) {
|
|
10326
10542
|
return {
|
|
10327
10543
|
text,
|
|
@@ -10336,7 +10552,8 @@ function createState(text, flow, options) {
|
|
|
10336
10552
|
},
|
|
10337
10553
|
tagMap: /* @__PURE__ */ new Map(),
|
|
10338
10554
|
flow,
|
|
10339
|
-
depth: 0
|
|
10555
|
+
depth: 0,
|
|
10556
|
+
escapedComments: []
|
|
10340
10557
|
};
|
|
10341
10558
|
}
|
|
10342
10559
|
/**
|
|
@@ -10364,7 +10581,7 @@ function exitNesting(state) {
|
|
|
10364
10581
|
}
|
|
10365
10582
|
|
|
10366
10583
|
//#endregion
|
|
10367
|
-
//#region ../../node_modules/.pnpm/@effected+yaml@0.
|
|
10584
|
+
//#region ../../node_modules/.pnpm/@effected+yaml@0.8.0_effect@4.0.0-beta.107/node_modules/@effected/yaml/internal/composer/tags.js
|
|
10368
10585
|
/**
|
|
10369
10586
|
* Resolve a tag shorthand using the document's %TAG directives.
|
|
10370
10587
|
* For example, with `%TAG !! tag:example.com,2000:app/`, the tag `!!int`
|
|
@@ -10451,7 +10668,7 @@ function validateTagHandlesInDocument(docCst, state) {
|
|
|
10451
10668
|
}
|
|
10452
10669
|
|
|
10453
10670
|
//#endregion
|
|
10454
|
-
//#region ../../node_modules/.pnpm/@effected+yaml@0.
|
|
10671
|
+
//#region ../../node_modules/.pnpm/@effected+yaml@0.8.0_effect@4.0.0-beta.107/node_modules/@effected/yaml/internal/composer/scalars.js
|
|
10455
10672
|
const NULL_RE$1 = /^(?:null|Null|NULL|~)$/;
|
|
10456
10673
|
const TRUE_RE$1 = /^(?:true|True|TRUE)$/;
|
|
10457
10674
|
const FALSE_RE$1 = /^(?:false|False|FALSE)$/;
|
|
@@ -10546,13 +10763,42 @@ function getScalarStyle(node) {
|
|
|
10546
10763
|
*/
|
|
10547
10764
|
function getBlockChomp(node) {
|
|
10548
10765
|
if (node.type !== "block-scalar") return void 0;
|
|
10549
|
-
const
|
|
10550
|
-
|
|
10551
|
-
|
|
10552
|
-
if (header.includes("+")) return "keep";
|
|
10553
|
-
if (header.includes("-")) return "strip";
|
|
10766
|
+
const indicators = node.source.trimStart().match(/^[|>]([0-9+-]*)/)?.[1] ?? "";
|
|
10767
|
+
if (indicators.includes("+")) return "keep";
|
|
10768
|
+
if (indicators.includes("-")) return "strip";
|
|
10554
10769
|
return "clip";
|
|
10555
10770
|
}
|
|
10771
|
+
/**
|
|
10772
|
+
* Extracts the EXPLICIT indentation-indicator digit from a block scalar's
|
|
10773
|
+
* header (`|2`, `>1+`), or undefined when the header carries none (the
|
|
10774
|
+
* reader auto-detects) or the node is not a block scalar. Inspects only the
|
|
10775
|
+
* indicator run — see {@link getBlockChomp} for why the rest of the header
|
|
10776
|
+
* line (a comment can contain digits) must not be read.
|
|
10777
|
+
*/
|
|
10778
|
+
function getBlockIndent(node) {
|
|
10779
|
+
if (node.type !== "block-scalar") return void 0;
|
|
10780
|
+
const digit = (node.source.trimStart().match(/^[|>]([0-9+-]*)/)?.[1] ?? "").match(/[1-9]/)?.[0];
|
|
10781
|
+
return digit === void 0 ? void 0 : Number(digit);
|
|
10782
|
+
}
|
|
10783
|
+
/**
|
|
10784
|
+
* The trailing comment on a block scalar's HEADER line (`key: | # c`,
|
|
10785
|
+
* `- >-2 # c`) as stored raw-slice text, or `undefined` when the header
|
|
10786
|
+
* carries none. The header is the only line of a block scalar that can carry
|
|
10787
|
+
* a `#` comment — body lines absorb `#` as content — and the lexer packs the
|
|
10788
|
+
* whole scalar (header comment included) into one CST token, so the comment
|
|
10789
|
+
* never surfaces as a sibling comment token for the ordinary attribution
|
|
10790
|
+
* pass (#341).
|
|
10791
|
+
*/
|
|
10792
|
+
function blockScalarHeaderComment(cst) {
|
|
10793
|
+
const src = cst.source.trimStart();
|
|
10794
|
+
const nl = src.search(/[\r\n]/);
|
|
10795
|
+
const header = nl < 0 ? src : src.slice(0, nl);
|
|
10796
|
+
const hash = header.indexOf("#");
|
|
10797
|
+
if (hash < 1) return void 0;
|
|
10798
|
+
const before = header[hash - 1];
|
|
10799
|
+
if (before !== " " && before !== " ") return void 0;
|
|
10800
|
+
return rawCommentText(header.slice(hash));
|
|
10801
|
+
}
|
|
10556
10802
|
function getScalarValue(node, fullText) {
|
|
10557
10803
|
if (node.type === "block-scalar") return decodeBlockScalar(node.source, fullText, node.offset);
|
|
10558
10804
|
const style = getScalarStyle(node);
|
|
@@ -11238,18 +11484,22 @@ function decodeBlockScalar(raw, fullText, nodeOffset) {
|
|
|
11238
11484
|
}
|
|
11239
11485
|
if (hadContent || trailingNewlines.length > 0) {
|
|
11240
11486
|
if (chomp === "keep") {
|
|
11241
|
-
result += "\n";
|
|
11487
|
+
if (hadContent) result += "\n";
|
|
11242
11488
|
for (const _nl of trailingNewlines) result += "\n";
|
|
11243
|
-
} else if (chomp !== "strip")
|
|
11489
|
+
} else if (chomp !== "strip") {
|
|
11490
|
+
if (hadContent) result += "\n";
|
|
11491
|
+
}
|
|
11244
11492
|
}
|
|
11245
11493
|
value = result;
|
|
11246
11494
|
} else {
|
|
11247
11495
|
value = lines.join("\n");
|
|
11248
11496
|
if (lines.length > 0 || trailingNewlines.length > 0) {
|
|
11249
11497
|
if (chomp === "keep") {
|
|
11250
|
-
value += "\n";
|
|
11498
|
+
if (lines.length > 0) value += "\n";
|
|
11251
11499
|
for (const _nl of trailingNewlines) value += "\n";
|
|
11252
|
-
} else if (chomp !== "strip")
|
|
11500
|
+
} else if (chomp !== "strip") {
|
|
11501
|
+
if (lines.length > 0) value += "\n";
|
|
11502
|
+
}
|
|
11253
11503
|
}
|
|
11254
11504
|
}
|
|
11255
11505
|
return value;
|
|
@@ -11308,6 +11558,8 @@ function makeScalar(cst, state, meta) {
|
|
|
11308
11558
|
const rawValue = getScalarValue(cst, state.text);
|
|
11309
11559
|
const value = resolveScalar(rawValue, style, meta?.tag, state);
|
|
11310
11560
|
const chomp = getBlockChomp(cst);
|
|
11561
|
+
const blockIndent = getBlockIndent(cst);
|
|
11562
|
+
const comment = (style === "block-literal" || style === "block-folded" ? blockScalarHeaderComment(cst) : void 0) ?? meta?.comment;
|
|
11311
11563
|
const needsRaw = style === "plain" && typeof value !== "string" && value !== void 0 && shouldPreserveRaw(rawValue, value);
|
|
11312
11564
|
const scalar = new YamlScalar({
|
|
11313
11565
|
value,
|
|
@@ -11316,8 +11568,9 @@ function makeScalar(cst, state, meta) {
|
|
|
11316
11568
|
length: cst.length,
|
|
11317
11569
|
...meta?.tag !== void 0 ? { tag: meta.tag } : {},
|
|
11318
11570
|
...meta?.anchor !== void 0 ? { anchor: meta.anchor } : {},
|
|
11319
|
-
...
|
|
11571
|
+
...comment !== void 0 ? { comment } : {},
|
|
11320
11572
|
...chomp !== void 0 ? { chomp } : {},
|
|
11573
|
+
...blockIndent !== void 0 ? { blockIndent } : {},
|
|
11321
11574
|
...needsRaw ? { raw: rawValue } : {}
|
|
11322
11575
|
});
|
|
11323
11576
|
if (meta?.anchor) registerAnchor(scalar, meta.anchor, state, cst.offset);
|
|
@@ -11342,7 +11595,7 @@ function shouldPreserveRaw(rawValue, value) {
|
|
|
11342
11595
|
}
|
|
11343
11596
|
|
|
11344
11597
|
//#endregion
|
|
11345
|
-
//#region ../../node_modules/.pnpm/@effected+yaml@0.
|
|
11598
|
+
//#region ../../node_modules/.pnpm/@effected+yaml@0.8.0_effect@4.0.0-beta.107/node_modules/@effected/yaml/internal/composer/block.js
|
|
11346
11599
|
/**
|
|
11347
11600
|
* Compose a block map from its CST children, with an optional external first key.
|
|
11348
11601
|
*
|
|
@@ -11374,11 +11627,12 @@ function composeBlockMapInner(blockMapCst, state, externalFirstKey, meta) {
|
|
|
11374
11627
|
kind: "key",
|
|
11375
11628
|
node: externalFirstKey
|
|
11376
11629
|
});
|
|
11377
|
-
buildPairs(items, pairs, state.text);
|
|
11630
|
+
const trailingComment = buildPairs(items, pairs, state.text, state.escapedComments);
|
|
11378
11631
|
if (state.options.uniqueKeys) checkDuplicateKeys(pairs, state);
|
|
11379
11632
|
checkMultilineImplicitKeys(pairs, state);
|
|
11380
11633
|
const offset = externalFirstKey ? "offset" in externalFirstKey ? externalFirstKey.offset : blockMapCst.offset : blockMapCst.offset;
|
|
11381
11634
|
const length = blockMapCst.offset + blockMapCst.length - offset;
|
|
11635
|
+
const mapComment = meta?.comment !== void 0 ? trailingComment !== void 0 ? `${meta.comment}\n${trailingComment}` : meta.comment : trailingComment;
|
|
11382
11636
|
const map = new YamlMap({
|
|
11383
11637
|
items: pairs,
|
|
11384
11638
|
style: "block",
|
|
@@ -11386,7 +11640,7 @@ function composeBlockMapInner(blockMapCst, state, externalFirstKey, meta) {
|
|
|
11386
11640
|
length,
|
|
11387
11641
|
...meta?.tag !== void 0 ? { tag: meta.tag } : {},
|
|
11388
11642
|
...meta?.anchor !== void 0 ? { anchor: meta.anchor } : {},
|
|
11389
|
-
...
|
|
11643
|
+
...mapComment !== void 0 ? { comment: mapComment } : {}
|
|
11390
11644
|
});
|
|
11391
11645
|
if (meta?.anchor) registerAnchor(map, meta.anchor, state, offset);
|
|
11392
11646
|
return map;
|
|
@@ -11443,6 +11697,14 @@ function flattenBlockMapChildren(children, state, externalKeyColumn, externalKey
|
|
|
11443
11697
|
kind: "node",
|
|
11444
11698
|
node
|
|
11445
11699
|
});
|
|
11700
|
+
if (state.escapedComments.length > 0) {
|
|
11701
|
+
for (const ec of state.escapedComments) items.push({
|
|
11702
|
+
kind: "comment",
|
|
11703
|
+
comment: ec.text,
|
|
11704
|
+
offset: ec.offset
|
|
11705
|
+
});
|
|
11706
|
+
state.escapedComments.length = 0;
|
|
11707
|
+
}
|
|
11446
11708
|
afterValueSep = false;
|
|
11447
11709
|
}
|
|
11448
11710
|
for (let i = 0; i < children.length; i++) {
|
|
@@ -11471,7 +11733,7 @@ function flattenBlockMapChildren(children, state, externalKeyColumn, externalKey
|
|
|
11471
11733
|
const sliceChildren = children.slice(i + 1, lookahead.endIdx);
|
|
11472
11734
|
const innerItems = flattenBlockMapChildren(sliceChildren, state);
|
|
11473
11735
|
const innerPairs = [];
|
|
11474
|
-
buildPairs(innerItems, innerPairs, state.text);
|
|
11736
|
+
const innerTrailing = buildPairs(innerItems, innerPairs, state.text);
|
|
11475
11737
|
const firstC = findFirstContent(sliceChildren);
|
|
11476
11738
|
const lastC = findLastContent(sliceChildren);
|
|
11477
11739
|
const innerOffset = firstC ? firstC.offset : child.offset;
|
|
@@ -11480,7 +11742,8 @@ function flattenBlockMapChildren(children, state, externalKeyColumn, externalKey
|
|
|
11480
11742
|
items: innerPairs,
|
|
11481
11743
|
style: "block",
|
|
11482
11744
|
offset: innerOffset,
|
|
11483
|
-
length: innerEnd - innerOffset
|
|
11745
|
+
length: innerEnd - innerOffset,
|
|
11746
|
+
...innerTrailing !== void 0 ? { comment: innerTrailing } : {}
|
|
11484
11747
|
}), innerOffset);
|
|
11485
11748
|
i = lookahead.endIdx - 1;
|
|
11486
11749
|
continue;
|
|
@@ -11526,10 +11789,10 @@ function flattenBlockMapChildren(children, state, externalKeyColumn, externalKey
|
|
|
11526
11789
|
continue;
|
|
11527
11790
|
}
|
|
11528
11791
|
if (child.type === "comment") {
|
|
11529
|
-
const text = child.source.startsWith("#") ? child.source.slice(1).trim() : child.source;
|
|
11530
11792
|
items.push({
|
|
11531
11793
|
kind: "comment",
|
|
11532
|
-
comment:
|
|
11794
|
+
comment: rawCommentText(child.source),
|
|
11795
|
+
offset: child.offset
|
|
11533
11796
|
});
|
|
11534
11797
|
continue;
|
|
11535
11798
|
}
|
|
@@ -11818,9 +12081,51 @@ function flattenBlockMapChildren(children, state, externalKeyColumn, externalKey
|
|
|
11818
12081
|
* Pattern: node, value-sep, node produces a key:value pair.
|
|
11819
12082
|
* Pattern: node, value-sep (no node) produces a key:null pair.
|
|
11820
12083
|
* Pattern: value-sep, node produces a null:value pair.
|
|
12084
|
+
*
|
|
12085
|
+
* Comment attribution (#127): a comment on the same line as the end of the
|
|
12086
|
+
* previous pair attaches to it as the trailing `comment`; an own-line
|
|
12087
|
+
* comment attaches FORWARD to the next pair as `commentBefore` (consecutive
|
|
12088
|
+
* lines join with `\n`); a blank line before a pair (or before its
|
|
12089
|
+
* `commentBefore` block) sets `spaceBefore`. Own-line comments left over
|
|
12090
|
+
* after the last pair are returned so the caller can attach them as the
|
|
12091
|
+
* containing collection's trailing `comment`.
|
|
11821
12092
|
*/
|
|
11822
|
-
function buildPairs(items, pairs, text) {
|
|
12093
|
+
function buildPairs(items, pairs, text, escaped) {
|
|
11823
12094
|
let i = 0;
|
|
12095
|
+
let pending = [];
|
|
12096
|
+
let pendingSpace = false;
|
|
12097
|
+
let lastEnd = -1;
|
|
12098
|
+
let lastNode;
|
|
12099
|
+
let contentColumn = -1;
|
|
12100
|
+
const nodeEnd = (n) => n.offset + n.length;
|
|
12101
|
+
const noteContentColumn = (offset) => {
|
|
12102
|
+
if (contentColumn < 0 && offset >= 0) contentColumn = columnAt(text, offset);
|
|
12103
|
+
};
|
|
12104
|
+
/** Join pending parts: `\n` between lines, an extra `\n` per embedded blank. */
|
|
12105
|
+
const joinPending = (parts) => {
|
|
12106
|
+
if (parts.length === 0) return void 0;
|
|
12107
|
+
let out = parts[0].text;
|
|
12108
|
+
for (let k = 1; k < parts.length; k++) {
|
|
12109
|
+
const part = parts[k];
|
|
12110
|
+
out += part.blankAbove ? `\n\n${part.text}` : `\n${part.text}`;
|
|
12111
|
+
}
|
|
12112
|
+
return out;
|
|
12113
|
+
};
|
|
12114
|
+
/** The pending comment fields for the pair being constructed, then reset. */
|
|
12115
|
+
const takePendingFields = (anchorOffset) => {
|
|
12116
|
+
let commentBefore = joinPending(pending);
|
|
12117
|
+
if (anchorOffset >= 0 && hasBlankLineAbove(text, anchorOffset)) {
|
|
12118
|
+
if (commentBefore !== void 0) commentBefore = `${commentBefore}\n`;
|
|
12119
|
+
else if (!pendingSpace && lastEnd >= 0 && !blankAboveIsKeepChompContent(text, anchorOffset, lastNode)) pendingSpace = true;
|
|
12120
|
+
}
|
|
12121
|
+
const fields = {
|
|
12122
|
+
...commentBefore !== void 0 ? { commentBefore } : {},
|
|
12123
|
+
...pendingSpace ? { spaceBefore: true } : {}
|
|
12124
|
+
};
|
|
12125
|
+
pending = [];
|
|
12126
|
+
pendingSpace = false;
|
|
12127
|
+
return fields;
|
|
12128
|
+
};
|
|
11824
12129
|
while (i < items.length) {
|
|
11825
12130
|
const item = items[i];
|
|
11826
12131
|
if (!item) {
|
|
@@ -11828,12 +12133,24 @@ function buildPairs(items, pairs, text) {
|
|
|
11828
12133
|
continue;
|
|
11829
12134
|
}
|
|
11830
12135
|
if (item.kind === "comment") {
|
|
11831
|
-
|
|
12136
|
+
const cOff = item.offset ?? -1;
|
|
12137
|
+
const cText = item.comment ?? "";
|
|
12138
|
+
if (!(cOff < 0 ? true : isOwnLineAt(text, cOff)) && pairs.length > 0) {
|
|
11832
12139
|
const last = pairs[pairs.length - 1];
|
|
11833
12140
|
if (last) pairs[pairs.length - 1] = new YamlPair({
|
|
11834
12141
|
key: last.key,
|
|
11835
12142
|
value: last.value,
|
|
11836
|
-
...
|
|
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
|
+
});
|
|
12147
|
+
} else {
|
|
12148
|
+
const blankAbove = cOff >= 0 && hasBlankLineAbove(text, cOff) && !blankAboveIsKeepChompContent(text, cOff, lastNode);
|
|
12149
|
+
if (blankAbove && pending.length === 0 && lastEnd >= 0) pendingSpace = true;
|
|
12150
|
+
pending.push({
|
|
12151
|
+
text: cText,
|
|
12152
|
+
offset: cOff,
|
|
12153
|
+
blankAbove: blankAbove && pending.length > 0
|
|
11837
12154
|
});
|
|
11838
12155
|
}
|
|
11839
12156
|
i++;
|
|
@@ -11842,30 +12159,32 @@ function buildPairs(items, pairs, text) {
|
|
|
11842
12159
|
if (item.kind === "value-sep") {
|
|
11843
12160
|
const valueSepOffset = item.offset ?? 0;
|
|
11844
12161
|
i++;
|
|
12162
|
+
const pendingFields = takePendingFields(valueSepOffset);
|
|
12163
|
+
noteContentColumn(valueSepOffset);
|
|
11845
12164
|
const valueNode = consumeValueNodeForNullKey(items, i, text, valueSepOffset);
|
|
12165
|
+
const nullKey = new YamlScalar({
|
|
12166
|
+
value: null,
|
|
12167
|
+
style: "plain",
|
|
12168
|
+
offset: valueSepOffset,
|
|
12169
|
+
length: 0
|
|
12170
|
+
});
|
|
11846
12171
|
if (valueNode) {
|
|
11847
|
-
const nullKey = new YamlScalar({
|
|
11848
|
-
value: null,
|
|
11849
|
-
style: "plain",
|
|
11850
|
-
offset: valueSepOffset,
|
|
11851
|
-
length: 0
|
|
11852
|
-
});
|
|
11853
12172
|
pairs.push(new YamlPair({
|
|
11854
12173
|
key: nullKey,
|
|
11855
|
-
value: valueNode.node ?? null
|
|
12174
|
+
value: valueNode.node ?? null,
|
|
12175
|
+
...pendingFields
|
|
11856
12176
|
}));
|
|
11857
12177
|
i = valueNode.nextIdx;
|
|
12178
|
+
lastEnd = valueNode.node ? nodeEnd(valueNode.node) : valueSepOffset + 1;
|
|
12179
|
+
lastNode = valueNode.node ?? void 0;
|
|
11858
12180
|
} else {
|
|
11859
|
-
const nullKey = new YamlScalar({
|
|
11860
|
-
value: null,
|
|
11861
|
-
style: "plain",
|
|
11862
|
-
offset: valueSepOffset,
|
|
11863
|
-
length: 0
|
|
11864
|
-
});
|
|
11865
12181
|
pairs.push(new YamlPair({
|
|
11866
12182
|
key: nullKey,
|
|
11867
|
-
value: null
|
|
12183
|
+
value: null,
|
|
12184
|
+
...pendingFields
|
|
11868
12185
|
}));
|
|
12186
|
+
lastEnd = valueSepOffset + 1;
|
|
12187
|
+
lastNode = void 0;
|
|
11869
12188
|
}
|
|
11870
12189
|
continue;
|
|
11871
12190
|
}
|
|
@@ -11879,62 +12198,109 @@ function buildPairs(items, pairs, text) {
|
|
|
11879
12198
|
i++;
|
|
11880
12199
|
}
|
|
11881
12200
|
}
|
|
11882
|
-
|
|
12201
|
+
if (keyNode) noteContentColumn(keyNode.offset);
|
|
12202
|
+
const pendingFields = takePendingFields(keyNode ? keyNode.offset : -1);
|
|
12203
|
+
let pairTrailing;
|
|
12204
|
+
while (i < items.length && items[i]?.kind === "comment") {
|
|
12205
|
+
const c = items[i]?.comment;
|
|
12206
|
+
if (c !== void 0) pairTrailing = joinComments(pairTrailing, c);
|
|
12207
|
+
i++;
|
|
12208
|
+
}
|
|
12209
|
+
const keyOrNull = () => keyNode ?? new YamlScalar({
|
|
12210
|
+
value: null,
|
|
12211
|
+
style: "plain",
|
|
12212
|
+
offset: 0,
|
|
12213
|
+
length: 0
|
|
12214
|
+
});
|
|
11883
12215
|
if (i < items.length && items[i]?.kind === "value-sep") {
|
|
12216
|
+
const sepOffset = items[i]?.offset ?? (keyNode ? nodeEnd(keyNode) : 0);
|
|
11884
12217
|
i++;
|
|
11885
|
-
const valueResult = consumeValueNode(items, i);
|
|
12218
|
+
const valueResult = consumeValueNode(items, i, text, sepOffset);
|
|
11886
12219
|
if (valueResult) {
|
|
12220
|
+
for (const c of valueResult.sameLineComments) pairTrailing = joinComments(pairTrailing, c);
|
|
12221
|
+
let valNode = valueResult.node;
|
|
12222
|
+
if (valNode !== null && valueResult.leadingComments.length > 0) valNode = withCommentFields(valNode, { commentBefore: valueResult.leadingComments.join("\n") });
|
|
11887
12223
|
pairs.push(new YamlPair({
|
|
11888
|
-
key:
|
|
11889
|
-
|
|
11890
|
-
|
|
11891
|
-
|
|
11892
|
-
length: 0
|
|
11893
|
-
}),
|
|
11894
|
-
value: valueResult.node ?? null
|
|
12224
|
+
key: keyOrNull(),
|
|
12225
|
+
value: valNode,
|
|
12226
|
+
...pendingFields,
|
|
12227
|
+
...pairTrailing !== void 0 ? { comment: pairTrailing } : {}
|
|
11895
12228
|
}));
|
|
11896
12229
|
i = valueResult.nextIdx;
|
|
11897
|
-
|
|
11898
|
-
|
|
12230
|
+
lastEnd = valNode ? nodeEnd(valNode) : sepOffset + 1;
|
|
12231
|
+
lastNode = valNode ?? void 0;
|
|
12232
|
+
} else {
|
|
12233
|
+
pairs.push(new YamlPair({
|
|
12234
|
+
key: keyOrNull(),
|
|
11899
12235
|
value: null,
|
|
11900
|
-
|
|
11901
|
-
|
|
11902
|
-
|
|
11903
|
-
|
|
11904
|
-
|
|
11905
|
-
}
|
|
11906
|
-
} else
|
|
11907
|
-
|
|
12236
|
+
...pendingFields,
|
|
12237
|
+
...pairTrailing !== void 0 ? { comment: pairTrailing } : {}
|
|
12238
|
+
}));
|
|
12239
|
+
lastEnd = sepOffset + 1;
|
|
12240
|
+
lastNode = void 0;
|
|
12241
|
+
}
|
|
12242
|
+
} else {
|
|
12243
|
+
pairs.push(new YamlPair({
|
|
12244
|
+
key: keyOrNull(),
|
|
11908
12245
|
value: null,
|
|
11909
|
-
|
|
11910
|
-
|
|
11911
|
-
|
|
11912
|
-
|
|
11913
|
-
|
|
11914
|
-
}
|
|
12246
|
+
...pendingFields,
|
|
12247
|
+
...pairTrailing !== void 0 ? { comment: pairTrailing } : {}
|
|
12248
|
+
}));
|
|
12249
|
+
lastEnd = keyNode ? nodeEnd(keyNode) : lastEnd;
|
|
12250
|
+
if (keyNode) lastNode = keyNode;
|
|
12251
|
+
}
|
|
11915
12252
|
continue;
|
|
11916
12253
|
}
|
|
11917
12254
|
i++;
|
|
11918
12255
|
}
|
|
12256
|
+
if (pending.length === 0) return void 0;
|
|
12257
|
+
const withLeadingBlank = (parts) => {
|
|
12258
|
+
const joined = joinPending(parts);
|
|
12259
|
+
const first = parts[0];
|
|
12260
|
+
return joined !== void 0 && first !== void 0 && lastEnd >= 0 && first.offset >= 0 && hasBlankLineAbove(text, first.offset) && !blankAboveIsKeepChompContent(text, first.offset, lastNode) ? `\n${joined}` : joined;
|
|
12261
|
+
};
|
|
12262
|
+
if (escaped !== void 0 && contentColumn > 0) {
|
|
12263
|
+
const kept = [];
|
|
12264
|
+
for (const part of pending) if (part.offset >= 0 && columnAt(text, part.offset) < contentColumn) escaped.push({
|
|
12265
|
+
text: part.text,
|
|
12266
|
+
offset: part.offset
|
|
12267
|
+
});
|
|
12268
|
+
else kept.push(part);
|
|
12269
|
+
return withLeadingBlank(kept);
|
|
12270
|
+
}
|
|
12271
|
+
return withLeadingBlank(pending);
|
|
11919
12272
|
}
|
|
11920
|
-
function consumeValueNode(items, startIdx) {
|
|
12273
|
+
function consumeValueNode(items, startIdx, text, sepOffset) {
|
|
12274
|
+
let peek = startIdx;
|
|
12275
|
+
while (peek < items.length && items[peek]?.kind === "comment") peek++;
|
|
12276
|
+
const candidate = peek < items.length ? items[peek] : void 0;
|
|
12277
|
+
if (candidate?.kind === "node" && peek + 1 < items.length && items[peek + 1]?.kind === "value-sep" && candidate.node !== void 0 && text.slice(sepOffset, candidate.node.offset).includes("\n")) return null;
|
|
11921
12278
|
let i = startIdx;
|
|
12279
|
+
const sameLineComments = [];
|
|
12280
|
+
const leadingComments = [];
|
|
11922
12281
|
while (i < items.length) {
|
|
11923
12282
|
const item = items[i];
|
|
11924
12283
|
if (!item) break;
|
|
11925
12284
|
if (item.kind === "comment") {
|
|
12285
|
+
const cText = item.comment ?? "";
|
|
12286
|
+
if (item.offset !== void 0 && sameLineSpan(text, sepOffset, item.offset)) sameLineComments.push(cText);
|
|
12287
|
+
else leadingComments.push(cText);
|
|
11926
12288
|
i++;
|
|
11927
12289
|
continue;
|
|
11928
12290
|
}
|
|
11929
12291
|
if (item.kind === "node") return {
|
|
11930
12292
|
node: item.node ?? null,
|
|
11931
|
-
nextIdx: i + 1
|
|
12293
|
+
nextIdx: i + 1,
|
|
12294
|
+
sameLineComments,
|
|
12295
|
+
leadingComments
|
|
11932
12296
|
};
|
|
11933
12297
|
break;
|
|
11934
12298
|
}
|
|
11935
12299
|
return i > startIdx ? {
|
|
11936
12300
|
node: null,
|
|
11937
|
-
nextIdx: i
|
|
12301
|
+
nextIdx: i,
|
|
12302
|
+
sameLineComments,
|
|
12303
|
+
leadingComments
|
|
11938
12304
|
} : null;
|
|
11939
12305
|
}
|
|
11940
12306
|
/**
|
|
@@ -12289,11 +12655,59 @@ function composeBlockSeq(cst, state, meta) {
|
|
|
12289
12655
|
}
|
|
12290
12656
|
function composeBlockSeqInner(cst, state, meta) {
|
|
12291
12657
|
const children = cst.children ?? [];
|
|
12292
|
-
const
|
|
12658
|
+
const rawItems = [];
|
|
12293
12659
|
let pendingMeta = {};
|
|
12294
12660
|
let sawEntry = false;
|
|
12295
12661
|
const seqIndent = lineIndentColumn(state.text, cst.offset);
|
|
12296
12662
|
let sawNewlineSincePending = false;
|
|
12663
|
+
let pending = [];
|
|
12664
|
+
let pendingSpace = false;
|
|
12665
|
+
let lastItemEnd = -1;
|
|
12666
|
+
let lastItemNode;
|
|
12667
|
+
const joinPending = (parts) => {
|
|
12668
|
+
if (parts.length === 0) return void 0;
|
|
12669
|
+
let out = parts[0].text;
|
|
12670
|
+
for (let k = 1; k < parts.length; k++) {
|
|
12671
|
+
const part = parts[k];
|
|
12672
|
+
out += part.blankAbove ? `\n\n${part.text}` : `\n${part.text}`;
|
|
12673
|
+
}
|
|
12674
|
+
return out;
|
|
12675
|
+
};
|
|
12676
|
+
const acceptOwnLineComment = (cText, cOff) => {
|
|
12677
|
+
const blankAbove = cOff >= 0 && hasBlankLineAbove(state.text, cOff) && !blankAboveIsKeepChompContent(state.text, cOff, lastItemNode);
|
|
12678
|
+
if (blankAbove && pending.length === 0 && lastItemEnd >= 0) pendingSpace = true;
|
|
12679
|
+
pending.push({
|
|
12680
|
+
text: cText,
|
|
12681
|
+
offset: cOff,
|
|
12682
|
+
blankAbove: blankAbove && pending.length > 0
|
|
12683
|
+
});
|
|
12684
|
+
};
|
|
12685
|
+
const items = {
|
|
12686
|
+
get length() {
|
|
12687
|
+
return rawItems.length;
|
|
12688
|
+
},
|
|
12689
|
+
push(node) {
|
|
12690
|
+
let commentBefore = joinPending(pending);
|
|
12691
|
+
if (node.length > 0 && hasBlankLineAbove(state.text, node.offset)) {
|
|
12692
|
+
if (commentBefore !== void 0) commentBefore = `${commentBefore}\n`;
|
|
12693
|
+
else if (!pendingSpace && lastItemEnd >= 0 && !blankAboveIsKeepChompContent(state.text, node.offset, lastItemNode)) pendingSpace = true;
|
|
12694
|
+
}
|
|
12695
|
+
let decorated = node;
|
|
12696
|
+
if (commentBefore !== void 0 || pendingSpace) decorated = withCommentFields(node, {
|
|
12697
|
+
...commentBefore !== void 0 ? { commentBefore } : {},
|
|
12698
|
+
...pendingSpace ? { spaceBefore: true } : {}
|
|
12699
|
+
});
|
|
12700
|
+
pending = [];
|
|
12701
|
+
pendingSpace = false;
|
|
12702
|
+
rawItems.push(decorated);
|
|
12703
|
+
lastItemEnd = node.offset + node.length;
|
|
12704
|
+
lastItemNode = node;
|
|
12705
|
+
if (state.escapedComments.length > 0) {
|
|
12706
|
+
for (const ec of state.escapedComments) acceptOwnLineComment(ec.text, ec.offset);
|
|
12707
|
+
state.escapedComments.length = 0;
|
|
12708
|
+
}
|
|
12709
|
+
}
|
|
12710
|
+
};
|
|
12297
12711
|
for (let ci = 0; ci < children.length; ci++) {
|
|
12298
12712
|
const child = children[ci];
|
|
12299
12713
|
if (!child) continue;
|
|
@@ -12301,7 +12715,14 @@ function composeBlockSeqInner(cst, state, meta) {
|
|
|
12301
12715
|
if (hasMeta(pendingMeta)) sawNewlineSincePending = true;
|
|
12302
12716
|
continue;
|
|
12303
12717
|
}
|
|
12304
|
-
if (child.type === "comment")
|
|
12718
|
+
if (child.type === "comment") {
|
|
12719
|
+
const cText = rawCommentText(child.source);
|
|
12720
|
+
if (rawItems.length > 0 && !isOwnLineAt(state.text, child.offset)) {
|
|
12721
|
+
const prev = rawItems[rawItems.length - 1];
|
|
12722
|
+
if (prev) rawItems[rawItems.length - 1] = withCommentFields(prev, { comment: cText });
|
|
12723
|
+
} else acceptOwnLineComment(cText, child.offset);
|
|
12724
|
+
continue;
|
|
12725
|
+
}
|
|
12305
12726
|
if (child.type === "whitespace") {
|
|
12306
12727
|
if (child.source.trim() === "-") {
|
|
12307
12728
|
if (sawEntry) {
|
|
@@ -12460,14 +12881,32 @@ function composeBlockSeqInner(cst, state, meta) {
|
|
|
12460
12881
|
if (pendingMeta.anchor) registerAnchor(scalar, pendingMeta.anchor, state, 0);
|
|
12461
12882
|
items.push(scalar);
|
|
12462
12883
|
}
|
|
12884
|
+
const withLeadingBlank = (parts) => {
|
|
12885
|
+
const joined = joinPending(parts);
|
|
12886
|
+
const first = parts[0];
|
|
12887
|
+
return joined !== void 0 && first !== void 0 && lastItemEnd >= 0 && first.offset >= 0 && hasBlankLineAbove(state.text, first.offset) && !blankAboveIsKeepChompContent(state.text, first.offset, lastItemNode) ? `\n${joined}` : joined;
|
|
12888
|
+
};
|
|
12889
|
+
let seqTrailing;
|
|
12890
|
+
if (pending.length > 0) {
|
|
12891
|
+
if (seqIndent > 0) {
|
|
12892
|
+
const kept = [];
|
|
12893
|
+
for (const part of pending) if (part.offset >= 0 && columnAt(state.text, part.offset) < seqIndent) state.escapedComments.push({
|
|
12894
|
+
text: part.text,
|
|
12895
|
+
offset: part.offset
|
|
12896
|
+
});
|
|
12897
|
+
else kept.push(part);
|
|
12898
|
+
seqTrailing = withLeadingBlank(kept);
|
|
12899
|
+
} else seqTrailing = withLeadingBlank(pending);
|
|
12900
|
+
}
|
|
12901
|
+
const seqComment = meta?.comment !== void 0 ? seqTrailing !== void 0 ? `${meta.comment}\n${seqTrailing}` : meta.comment : seqTrailing;
|
|
12463
12902
|
const seq = new YamlSeq({
|
|
12464
|
-
items,
|
|
12903
|
+
items: rawItems,
|
|
12465
12904
|
style: "block",
|
|
12466
12905
|
offset: cst.offset,
|
|
12467
12906
|
length: cst.length,
|
|
12468
12907
|
...meta?.tag !== void 0 ? { tag: meta.tag } : {},
|
|
12469
12908
|
...meta?.anchor !== void 0 ? { anchor: meta.anchor } : {},
|
|
12470
|
-
...
|
|
12909
|
+
...seqComment !== void 0 ? { comment: seqComment } : {}
|
|
12471
12910
|
});
|
|
12472
12911
|
if (meta?.anchor) registerAnchor(seq, meta.anchor, state, cst.offset);
|
|
12473
12912
|
return seq;
|
|
@@ -12483,11 +12922,12 @@ function composeFlatBlockMap(children, startIdx, parentCst, state, externalFirst
|
|
|
12483
12922
|
node: externalFirstKey
|
|
12484
12923
|
});
|
|
12485
12924
|
const pairs = [];
|
|
12486
|
-
buildPairs(items, pairs, state.text);
|
|
12925
|
+
const trailingComment = buildPairs(items, pairs, state.text, state.escapedComments);
|
|
12487
12926
|
if (state.options.uniqueKeys) checkDuplicateKeys(pairs, state);
|
|
12488
12927
|
checkMultilineImplicitKeys(pairs, state);
|
|
12489
12928
|
const offset = "offset" in externalFirstKey ? externalFirstKey.offset : parentCst.offset;
|
|
12490
12929
|
const end = parentCst.offset + parentCst.length;
|
|
12930
|
+
const mapComment = meta?.comment !== void 0 ? trailingComment !== void 0 ? `${meta.comment}\n${trailingComment}` : meta.comment : trailingComment;
|
|
12491
12931
|
const map = new YamlMap({
|
|
12492
12932
|
items: pairs,
|
|
12493
12933
|
style: "block",
|
|
@@ -12495,14 +12935,14 @@ function composeFlatBlockMap(children, startIdx, parentCst, state, externalFirst
|
|
|
12495
12935
|
length: end - offset,
|
|
12496
12936
|
...meta?.tag !== void 0 ? { tag: meta.tag } : {},
|
|
12497
12937
|
...meta?.anchor !== void 0 ? { anchor: meta.anchor } : {},
|
|
12498
|
-
...
|
|
12938
|
+
...mapComment !== void 0 ? { comment: mapComment } : {}
|
|
12499
12939
|
});
|
|
12500
12940
|
if (meta?.anchor) registerAnchor(map, meta.anchor, state, offset);
|
|
12501
12941
|
return map;
|
|
12502
12942
|
}
|
|
12503
12943
|
|
|
12504
12944
|
//#endregion
|
|
12505
|
-
//#region ../../node_modules/.pnpm/@effected+yaml@0.
|
|
12945
|
+
//#region ../../node_modules/.pnpm/@effected+yaml@0.8.0_effect@4.0.0-beta.107/node_modules/@effected/yaml/internal/composer/flow.js
|
|
12506
12946
|
/**
|
|
12507
12947
|
* Validate that flow collection entries are separated by commas.
|
|
12508
12948
|
*
|
|
@@ -12615,8 +13055,9 @@ function composeFlowMapInner(cst, state, meta, parentBlockColumn) {
|
|
|
12615
13055
|
validateFlowContentIndent(cst, state, parentBlockColumn);
|
|
12616
13056
|
validateFlowSeparators(children, state, "{", "}");
|
|
12617
13057
|
const items = flattenFlowChildren(children.filter((c) => !(c.type === "whitespace" && (c.source === "{" || c.source === "}" || c.source.trim() === ""))), state);
|
|
12618
|
-
buildPairs(items, pairs, state.text);
|
|
13058
|
+
const trailingComment = buildPairs(items, pairs, state.text);
|
|
12619
13059
|
if (state.options.uniqueKeys) checkDuplicateKeys(pairs, state);
|
|
13060
|
+
const mapComment = meta?.comment !== void 0 ? trailingComment !== void 0 ? `${meta.comment}\n${trailingComment}` : meta.comment : trailingComment;
|
|
12620
13061
|
const map = new YamlMap({
|
|
12621
13062
|
items: pairs,
|
|
12622
13063
|
style: "flow",
|
|
@@ -12624,7 +13065,7 @@ function composeFlowMapInner(cst, state, meta, parentBlockColumn) {
|
|
|
12624
13065
|
length: cst.length,
|
|
12625
13066
|
...meta?.tag !== void 0 ? { tag: meta.tag } : {},
|
|
12626
13067
|
...meta?.anchor !== void 0 ? { anchor: meta.anchor } : {},
|
|
12627
|
-
...
|
|
13068
|
+
...mapComment !== void 0 ? { comment: mapComment } : {}
|
|
12628
13069
|
});
|
|
12629
13070
|
if (meta?.anchor) registerAnchor(map, meta.anchor, state, cst.offset);
|
|
12630
13071
|
return map;
|
|
@@ -12686,7 +13127,8 @@ function flattenFlowChildren(children, state) {
|
|
|
12686
13127
|
if (child.type === "comment") {
|
|
12687
13128
|
items.push({
|
|
12688
13129
|
kind: "comment",
|
|
12689
|
-
comment:
|
|
13130
|
+
comment: rawCommentText(child.source),
|
|
13131
|
+
offset: child.offset
|
|
12690
13132
|
});
|
|
12691
13133
|
continue;
|
|
12692
13134
|
}
|
|
@@ -12868,25 +13310,95 @@ function composeFlowSeqInner(cst, state, meta, parentBlockColumn) {
|
|
|
12868
13310
|
current.push(child);
|
|
12869
13311
|
}
|
|
12870
13312
|
if (current.length > 0) segments.push(current);
|
|
13313
|
+
let seqTrailing;
|
|
13314
|
+
let pending = [];
|
|
13315
|
+
let pendingSpace = false;
|
|
13316
|
+
let lastItemEnd = -1;
|
|
13317
|
+
let pushedIdx = -1;
|
|
13318
|
+
const joinPending = (parts) => {
|
|
13319
|
+
if (parts.length === 0) return void 0;
|
|
13320
|
+
let out = parts[0].text;
|
|
13321
|
+
for (let k = 1; k < parts.length; k++) {
|
|
13322
|
+
const part = parts[k];
|
|
13323
|
+
out += part.blankAbove ? `\n\n${part.text}` : `\n${part.text}`;
|
|
13324
|
+
}
|
|
13325
|
+
return out;
|
|
13326
|
+
};
|
|
13327
|
+
const blankIsBetweenItems = (anchorOffset) => blankLineAboveStart(state.text, anchorOffset) >= lastItemEnd;
|
|
13328
|
+
const acceptOwnLineComment = (cText, cOff) => {
|
|
13329
|
+
const blankAbove = cOff >= 0 && hasBlankLineAbove(state.text, cOff);
|
|
13330
|
+
if (blankAbove && pending.length === 0 && lastItemEnd >= 0 && blankIsBetweenItems(cOff)) pendingSpace = true;
|
|
13331
|
+
pending.push({
|
|
13332
|
+
text: cText,
|
|
13333
|
+
offset: cOff,
|
|
13334
|
+
blankAbove: blankAbove && pending.length > 0
|
|
13335
|
+
});
|
|
13336
|
+
};
|
|
13337
|
+
/** The pending comment fields for the item being pushed, then reset. */
|
|
13338
|
+
const takePendingFields = (anchorOffset) => {
|
|
13339
|
+
let commentBefore = joinPending(pending);
|
|
13340
|
+
if (anchorOffset >= 0 && hasBlankLineAbove(state.text, anchorOffset)) {
|
|
13341
|
+
if (commentBefore !== void 0) commentBefore = `${commentBefore}\n`;
|
|
13342
|
+
else if (!pendingSpace && lastItemEnd >= 0 && blankIsBetweenItems(anchorOffset)) pendingSpace = true;
|
|
13343
|
+
}
|
|
13344
|
+
const fields = {
|
|
13345
|
+
...commentBefore !== void 0 ? { commentBefore } : {},
|
|
13346
|
+
...pendingSpace ? { spaceBefore: true } : {}
|
|
13347
|
+
};
|
|
13348
|
+
pending = [];
|
|
13349
|
+
pendingSpace = false;
|
|
13350
|
+
return fields;
|
|
13351
|
+
};
|
|
13352
|
+
const hasPendingFields = (fields) => fields.commentBefore !== void 0 || fields.spaceBefore === true;
|
|
12871
13353
|
for (const segment of segments) if (segment.some((c) => c.type === "whitespace" && c.source === ":")) {
|
|
12872
|
-
const
|
|
13354
|
+
const content = segment.filter((c) => !(c.type === "whitespace" && c.source.trim() === ""));
|
|
13355
|
+
const semItems = flattenFlowChildren(content, state);
|
|
12873
13356
|
const pairs = [];
|
|
12874
|
-
buildPairs(semItems, pairs, state.text);
|
|
13357
|
+
const segTrailing = buildPairs(semItems, pairs, state.text);
|
|
12875
13358
|
if (!segment.some((c) => c.type === "whitespace" && c.source === "?")) checkMultilineImplicitKeys(pairs, state, semItems);
|
|
12876
13359
|
const firstPair = pairs[0];
|
|
12877
13360
|
if (firstPair) {
|
|
13361
|
+
const segFirst = content[0];
|
|
13362
|
+
const fields = takePendingFields(segFirst !== void 0 ? segFirst.offset : -1);
|
|
12878
13363
|
const map = new YamlMap({
|
|
12879
13364
|
items: pairs,
|
|
12880
13365
|
style: "flow",
|
|
12881
13366
|
offset: firstPair.key.offset,
|
|
12882
|
-
length: 0
|
|
13367
|
+
length: 0,
|
|
13368
|
+
...fields,
|
|
13369
|
+
...segTrailing !== void 0 ? { comment: segTrailing } : {}
|
|
12883
13370
|
});
|
|
12884
13371
|
items.push(map);
|
|
12885
|
-
|
|
13372
|
+
pushedIdx = items.length - 1;
|
|
13373
|
+
lastItemEnd = map.offset + map.length;
|
|
13374
|
+
} else if (segTrailing !== void 0) seqTrailing = joinComments(seqTrailing, segTrailing);
|
|
12886
13375
|
} else {
|
|
12887
13376
|
const semItems = flattenFlowChildren(segment.filter((c) => !(c.type === "whitespace" && c.source.trim() === "")), state);
|
|
12888
|
-
for (const si of semItems)
|
|
13377
|
+
for (const si of semItems) {
|
|
13378
|
+
if (si.kind === "comment") {
|
|
13379
|
+
const cText = si.comment ?? "";
|
|
13380
|
+
if (!(si.offset === void 0 ? true : isOwnLineAt(state.text, si.offset)) && pushedIdx >= 0) {
|
|
13381
|
+
const prev = items[pushedIdx];
|
|
13382
|
+
if (prev) items[pushedIdx] = withCommentFields(prev, { comment: cText });
|
|
13383
|
+
} else acceptOwnLineComment(cText, si.offset ?? -1);
|
|
13384
|
+
continue;
|
|
13385
|
+
}
|
|
13386
|
+
if (si.kind === "node" && si.node) {
|
|
13387
|
+
const fields = takePendingFields(si.node.length > 0 ? si.node.offset : -1);
|
|
13388
|
+
const node = hasPendingFields(fields) ? withCommentFields(si.node, fields) : si.node;
|
|
13389
|
+
items.push(node);
|
|
13390
|
+
pushedIdx = items.length - 1;
|
|
13391
|
+
lastItemEnd = si.node.offset + si.node.length;
|
|
13392
|
+
}
|
|
13393
|
+
}
|
|
13394
|
+
}
|
|
13395
|
+
if (pending.length > 0) {
|
|
13396
|
+
const joined = joinPending(pending);
|
|
13397
|
+
const first = pending[0];
|
|
13398
|
+
const withLead = joined !== void 0 && first !== void 0 && lastItemEnd >= 0 && first.offset >= 0 && hasBlankLineAbove(state.text, first.offset) ? `\n${joined}` : joined;
|
|
13399
|
+
if (withLead !== void 0) seqTrailing = joinComments(seqTrailing, withLead);
|
|
12889
13400
|
}
|
|
13401
|
+
const seqComment = meta?.comment !== void 0 ? seqTrailing !== void 0 ? `${meta.comment}\n${seqTrailing}` : meta.comment : seqTrailing;
|
|
12890
13402
|
const seq = new YamlSeq({
|
|
12891
13403
|
items,
|
|
12892
13404
|
style: "flow",
|
|
@@ -12894,14 +13406,14 @@ function composeFlowSeqInner(cst, state, meta, parentBlockColumn) {
|
|
|
12894
13406
|
length: cst.length,
|
|
12895
13407
|
...meta?.tag !== void 0 ? { tag: meta.tag } : {},
|
|
12896
13408
|
...meta?.anchor !== void 0 ? { anchor: meta.anchor } : {},
|
|
12897
|
-
...
|
|
13409
|
+
...seqComment !== void 0 ? { comment: seqComment } : {}
|
|
12898
13410
|
});
|
|
12899
13411
|
if (meta?.anchor) registerAnchor(seq, meta.anchor, state, cst.offset);
|
|
12900
13412
|
return seq;
|
|
12901
13413
|
}
|
|
12902
13414
|
|
|
12903
13415
|
//#endregion
|
|
12904
|
-
//#region ../../node_modules/.pnpm/@effected+yaml@0.
|
|
13416
|
+
//#region ../../node_modules/.pnpm/@effected+yaml@0.8.0_effect@4.0.0-beta.107/node_modules/@effected/yaml/internal/composer/document.js
|
|
12905
13417
|
/** The flow-composer dispatch wired into every state this module creates. */
|
|
12906
13418
|
const FLOW = {
|
|
12907
13419
|
composeFlowMap,
|
|
@@ -13025,6 +13537,9 @@ function composeDocument(cst, state, hasSubsequentDocuments = false, nextDocCst)
|
|
|
13025
13537
|
const directives = [];
|
|
13026
13538
|
let contents = null;
|
|
13027
13539
|
let documentComment;
|
|
13540
|
+
let documentCommentAfter;
|
|
13541
|
+
let lastLeadingCommentOffset = -1;
|
|
13542
|
+
let sawDocEndMarker = false;
|
|
13028
13543
|
const hasDocStart = children.some((c) => c.type === "whitespace" && c.source === "---");
|
|
13029
13544
|
let i = 0;
|
|
13030
13545
|
const meta = {};
|
|
@@ -13060,6 +13575,7 @@ function composeDocument(cst, state, hasSubsequentDocuments = false, nextDocCst)
|
|
|
13060
13575
|
}
|
|
13061
13576
|
if (child.type === "newline" && hasMeta(meta)) sawNewlineSinceMeta = true;
|
|
13062
13577
|
if (child.type === "whitespace" || child.type === "newline") {
|
|
13578
|
+
if (child.type === "whitespace" && child.source === "...") sawDocEndMarker = true;
|
|
13063
13579
|
if (child.type === "whitespace" && (child.source === "]" || child.source === "}")) state.errors.push({
|
|
13064
13580
|
code: "MalformedFlowCollection",
|
|
13065
13581
|
message: `Unexpected flow indicator '${child.source}' at document level`,
|
|
@@ -13069,8 +13585,18 @@ function composeDocument(cst, state, hasSubsequentDocuments = false, nextDocCst)
|
|
|
13069
13585
|
i++;
|
|
13070
13586
|
continue;
|
|
13071
13587
|
}
|
|
13072
|
-
if (child.type === "comment" && contents === null) {
|
|
13073
|
-
|
|
13588
|
+
if (child.type === "comment" && contents === null && !sawDocEndMarker) {
|
|
13589
|
+
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;
|
|
13593
|
+
i++;
|
|
13594
|
+
continue;
|
|
13595
|
+
}
|
|
13596
|
+
if (child.type === "comment") {
|
|
13597
|
+
const text = rawCommentText(child.source);
|
|
13598
|
+
if (documentCommentAfter !== void 0 && hasBlankLineAbove(state.text, child.offset)) documentCommentAfter = `${documentCommentAfter}\n`;
|
|
13599
|
+
documentCommentAfter = documentCommentAfter === void 0 ? text : `${documentCommentAfter}\n${text}`;
|
|
13074
13600
|
i++;
|
|
13075
13601
|
continue;
|
|
13076
13602
|
}
|
|
@@ -13289,6 +13815,8 @@ function composeDocument(cst, state, hasSubsequentDocuments = false, nextDocCst)
|
|
|
13289
13815
|
break;
|
|
13290
13816
|
}
|
|
13291
13817
|
}
|
|
13818
|
+
if (documentComment !== void 0 && contents !== null && hasBlankLineBelow(state.text, lastLeadingCommentOffset)) documentComment = `${documentComment}\n`;
|
|
13819
|
+
state.escapedComments.length = 0;
|
|
13292
13820
|
return {
|
|
13293
13821
|
contents,
|
|
13294
13822
|
errors: [...state.errors],
|
|
@@ -13297,7 +13825,8 @@ function composeDocument(cst, state, hasSubsequentDocuments = false, nextDocCst)
|
|
|
13297
13825
|
hasDocumentStart: hasDocStart,
|
|
13298
13826
|
hasDocumentEnd: hasDocEnd,
|
|
13299
13827
|
hasDocumentStartTab: hasDocStartTab,
|
|
13300
|
-
...documentComment !== void 0 ? { comment: documentComment } : {}
|
|
13828
|
+
...documentComment !== void 0 ? { comment: documentComment } : {},
|
|
13829
|
+
...documentCommentAfter !== void 0 ? { commentAfter: documentCommentAfter } : {}
|
|
13301
13830
|
};
|
|
13302
13831
|
}
|
|
13303
13832
|
/**
|
|
@@ -13462,8 +13991,9 @@ function decorateSourceMultiline(node, text) {
|
|
|
13462
13991
|
style: node.style,
|
|
13463
13992
|
...node.tag !== void 0 ? { tag: node.tag } : {},
|
|
13464
13993
|
...node.anchor !== void 0 ? { anchor: node.anchor } : {},
|
|
13465
|
-
...node
|
|
13994
|
+
...commentProps(node),
|
|
13466
13995
|
...node.chomp !== void 0 ? { chomp: node.chomp } : {},
|
|
13996
|
+
...node.blockIndent !== void 0 ? { blockIndent: node.blockIndent } : {},
|
|
13467
13997
|
...node.raw !== void 0 ? { raw: node.raw } : {},
|
|
13468
13998
|
sourceMultiline: true,
|
|
13469
13999
|
offset: node.offset,
|
|
@@ -13474,7 +14004,7 @@ function decorateSourceMultiline(node, text) {
|
|
|
13474
14004
|
const newItems = node.items.map((pair) => new YamlPair({
|
|
13475
14005
|
key: decorateSourceMultiline(pair.key, text) ?? pair.key,
|
|
13476
14006
|
value: pair.value === null ? null : decorateSourceMultiline(pair.value, text),
|
|
13477
|
-
...pair
|
|
14007
|
+
...commentProps(pair)
|
|
13478
14008
|
}));
|
|
13479
14009
|
const multiline = isSourceMultiline(text, node.offset, node.length);
|
|
13480
14010
|
return new YamlMap({
|
|
@@ -13482,7 +14012,7 @@ function decorateSourceMultiline(node, text) {
|
|
|
13482
14012
|
style: node.style,
|
|
13483
14013
|
...node.tag !== void 0 ? { tag: node.tag } : {},
|
|
13484
14014
|
...node.anchor !== void 0 ? { anchor: node.anchor } : {},
|
|
13485
|
-
...node
|
|
14015
|
+
...commentProps(node),
|
|
13486
14016
|
...multiline ? { sourceMultiline: true } : {},
|
|
13487
14017
|
offset: node.offset,
|
|
13488
14018
|
length: node.length
|
|
@@ -13496,7 +14026,7 @@ function decorateSourceMultiline(node, text) {
|
|
|
13496
14026
|
style: node.style,
|
|
13497
14027
|
...node.tag !== void 0 ? { tag: node.tag } : {},
|
|
13498
14028
|
...node.anchor !== void 0 ? { anchor: node.anchor } : {},
|
|
13499
|
-
...node
|
|
14029
|
+
...commentProps(node),
|
|
13500
14030
|
...multiline ? { sourceMultiline: true } : {},
|
|
13501
14031
|
offset: node.offset,
|
|
13502
14032
|
length: node.length
|
|
@@ -13513,6 +14043,7 @@ function decorateDocumentSourceMultiline(doc, text) {
|
|
|
13513
14043
|
warnings: doc.warnings,
|
|
13514
14044
|
directives: doc.directives,
|
|
13515
14045
|
...doc.comment !== void 0 ? { comment: doc.comment } : {},
|
|
14046
|
+
...doc.commentAfter !== void 0 ? { commentAfter: doc.commentAfter } : {},
|
|
13516
14047
|
hasDocumentStart: doc.hasDocumentStart,
|
|
13517
14048
|
hasDocumentEnd: doc.hasDocumentEnd,
|
|
13518
14049
|
hasDocumentStartTab: doc.hasDocumentStartTab
|
|
@@ -13535,12 +14066,29 @@ const EMPTY_DOCUMENT = {
|
|
|
13535
14066
|
* state and therefore appear in the returned document's `errors`.
|
|
13536
14067
|
*/
|
|
13537
14068
|
function composeFirstDocument(text, options) {
|
|
14069
|
+
return composeFirstDocumentCounted(text, options).document;
|
|
14070
|
+
}
|
|
14071
|
+
/**
|
|
14072
|
+
* {@link composeFirstDocument} plus the CST-level document count of the whole
|
|
14073
|
+
* stream, from the single CST parse the compose already performs — no second
|
|
14074
|
+
* walk, and correct where a regex on `---` is not (a `---` inside a block
|
|
14075
|
+
* scalar or quoted string is content, not a document marker). Callers that
|
|
14076
|
+
* must refuse multi-document input (the `YamlFormat` single-document
|
|
14077
|
+
* contract) read `documentCount` instead of re-parsing.
|
|
14078
|
+
*/
|
|
14079
|
+
function composeFirstDocumentCounted(text, options) {
|
|
13538
14080
|
const cstNodes = parseCSTAll(text);
|
|
13539
14081
|
const state = createState(text, FLOW, options);
|
|
13540
14082
|
validateCrossDocumentDirectives(cstNodes, state);
|
|
13541
14083
|
const doc = cstNodes[0];
|
|
13542
|
-
if (!doc) return
|
|
13543
|
-
|
|
14084
|
+
if (!doc) return {
|
|
14085
|
+
document: EMPTY_DOCUMENT,
|
|
14086
|
+
documentCount: 0
|
|
14087
|
+
};
|
|
14088
|
+
return {
|
|
14089
|
+
document: decorateDocumentSourceMultiline(composeDocument(doc, state, cstNodes.length > 1, cstNodes[1]), text),
|
|
14090
|
+
documentCount: cstNodes.length
|
|
14091
|
+
};
|
|
13544
14092
|
}
|
|
13545
14093
|
/**
|
|
13546
14094
|
* Compose every document of `text` with full error recovery — v3
|
|
@@ -13568,7 +14116,7 @@ function composeAllDocuments(text, options) {
|
|
|
13568
14116
|
}
|
|
13569
14117
|
|
|
13570
14118
|
//#endregion
|
|
13571
|
-
//#region ../../node_modules/.pnpm/@effected+yaml@0.
|
|
14119
|
+
//#region ../../node_modules/.pnpm/@effected+yaml@0.8.0_effect@4.0.0-beta.107/node_modules/@effected/yaml/internal/fold.js
|
|
13572
14120
|
/**
|
|
13573
14121
|
* Column-based line folding for a single logical scalar line (YAML 1.2 flow
|
|
13574
14122
|
* folding, §7.3 / §8.2.1). Breaks the content at "safe" single-space
|
|
@@ -13744,12 +14292,18 @@ function renderSingleQuotedMultiline(s, indent) {
|
|
|
13744
14292
|
* @param explicitChomp - Original chomp indicator from the AST, when known.
|
|
13745
14293
|
* `keep` (`+`) and `strip` (`-`) preserve trailing-newline semantics that
|
|
13746
14294
|
* cannot be inferred from the resolved value alone.
|
|
14295
|
+
* @param preserveKeep - Re-emit a REDUNDANT explicit `+` (a keep header whose
|
|
14296
|
+
* value ends in exactly one newline, where clip would read identically) —
|
|
14297
|
+
* fidelity-path header preservation; canonical mode passes false.
|
|
14298
|
+
* @param explicitIndent - Explicit indentation-indicator digit from the AST,
|
|
14299
|
+
* re-emitted only when it matches the rendered indent (fidelity path).
|
|
13747
14300
|
*/
|
|
13748
|
-
function renderBlockLiteral(s, indent, explicitChomp, parentPosition) {
|
|
14301
|
+
function renderBlockLiteral(s, indent, explicitChomp, parentPosition, preserveKeep = false, explicitIndent) {
|
|
13749
14302
|
let chomp = "";
|
|
13750
14303
|
const onlyNewlines = s.length > 0 && /^\n+$/.test(s);
|
|
13751
14304
|
if (s.endsWith("\n\n") || onlyNewlines && explicitChomp === "keep") chomp = "+";
|
|
13752
14305
|
else if (!s.endsWith("\n")) chomp = "-";
|
|
14306
|
+
else if (preserveKeep && explicitChomp === "keep") chomp = "+";
|
|
13753
14307
|
const lines = s.split("\n");
|
|
13754
14308
|
if (s.endsWith("\n")) lines.pop();
|
|
13755
14309
|
let indentIndicator = "";
|
|
@@ -13757,6 +14311,7 @@ function renderBlockLiteral(s, indent, explicitChomp, parentPosition) {
|
|
|
13757
14311
|
const hasContent = firstContent !== void 0;
|
|
13758
14312
|
if (firstContent?.startsWith(" ") || lines.length > 0 && lines[0] === "" && hasContent) indentIndicator = String(indent.length);
|
|
13759
14313
|
else if (!hasContent && chomp === "+" && parentPosition === "block-map-value" && indent.length > 0) indentIndicator = String(indent.length);
|
|
14314
|
+
else if (explicitIndent !== void 0 && explicitIndent === indent.length) indentIndicator = String(explicitIndent);
|
|
13760
14315
|
return `|${indentIndicator}${chomp}\n${lines.map((l) => l === "" ? "" : `${indent}${l}`).join("\n")}`;
|
|
13761
14316
|
}
|
|
13762
14317
|
/**
|
|
@@ -13767,34 +14322,39 @@ function renderBlockLiteral(s, indent, explicitChomp, parentPosition) {
|
|
|
13767
14322
|
* the output must contain an empty line (double newline). Each empty line
|
|
13768
14323
|
* in the value already produces the correct number of blank lines.
|
|
13769
14324
|
*/
|
|
13770
|
-
function renderBlockFolded(s, indent) {
|
|
14325
|
+
function renderBlockFolded(s, indent, explicitChomp, explicitIndent) {
|
|
13771
14326
|
let chomp = "";
|
|
13772
14327
|
if (s.endsWith("\n\n")) chomp = "+";
|
|
13773
14328
|
else if (!s.endsWith("\n")) chomp = "-";
|
|
14329
|
+
else if (explicitChomp === "keep") chomp = "+";
|
|
13774
14330
|
const valueLines = s.split("\n");
|
|
13775
14331
|
if (s.endsWith("\n")) valueLines.pop();
|
|
13776
14332
|
let indentIndicator = "";
|
|
13777
14333
|
const firstContent = valueLines.find((l) => l !== "");
|
|
13778
14334
|
if (firstContent?.startsWith(" ") || valueLines.length >= 2 && valueLines[0] === "" && valueLines[1] === "" && firstContent !== void 0) indentIndicator = String(indent.length);
|
|
14335
|
+
else if (explicitIndent !== void 0 && explicitIndent === indent.length) indentIndicator = String(explicitIndent);
|
|
13779
14336
|
const outputLines = [];
|
|
14337
|
+
let lastContentIdx = -1;
|
|
14338
|
+
for (let i = valueLines.length - 1; i >= 0; i--) if (valueLines[i] !== "") {
|
|
14339
|
+
lastContentIdx = i;
|
|
14340
|
+
break;
|
|
14341
|
+
}
|
|
13780
14342
|
let prevNonEmpty = false;
|
|
13781
14343
|
let prevMoreIndented = false;
|
|
14344
|
+
let pendingCompensation = false;
|
|
13782
14345
|
for (let i = 0; i < valueLines.length; i++) {
|
|
13783
14346
|
const line = valueLines[i];
|
|
13784
14347
|
if (line === "") {
|
|
13785
|
-
if (prevNonEmpty && !prevMoreIndented)
|
|
13786
|
-
let nextContentMoreIndented = false;
|
|
13787
|
-
for (let j = i + 1; j < valueLines.length; j++) if (valueLines[j] !== "") {
|
|
13788
|
-
nextContentMoreIndented = valueLines[j].startsWith(" ") || valueLines[j].startsWith(" ");
|
|
13789
|
-
break;
|
|
13790
|
-
}
|
|
13791
|
-
if (!nextContentMoreIndented) outputLines.push("");
|
|
13792
|
-
}
|
|
14348
|
+
if (prevNonEmpty && !prevMoreIndented && i < lastContentIdx) pendingCompensation = true;
|
|
13793
14349
|
outputLines.push("");
|
|
13794
14350
|
prevNonEmpty = false;
|
|
13795
14351
|
prevMoreIndented = false;
|
|
13796
14352
|
} else {
|
|
13797
14353
|
const isMoreIndented = line.startsWith(" ") || line.startsWith(" ");
|
|
14354
|
+
if (pendingCompensation) {
|
|
14355
|
+
if (!isMoreIndented) outputLines.push("");
|
|
14356
|
+
pendingCompensation = false;
|
|
14357
|
+
}
|
|
13798
14358
|
if (prevNonEmpty && !isMoreIndented) outputLines.push("");
|
|
13799
14359
|
outputLines.push(`${indent}${line}`);
|
|
13800
14360
|
prevNonEmpty = true;
|
|
@@ -13805,7 +14365,7 @@ function renderBlockFolded(s, indent) {
|
|
|
13805
14365
|
}
|
|
13806
14366
|
|
|
13807
14367
|
//#endregion
|
|
13808
|
-
//#region ../../node_modules/.pnpm/@effected+yaml@0.
|
|
14368
|
+
//#region ../../node_modules/.pnpm/@effected+yaml@0.8.0_effect@4.0.0-beta.107/node_modules/@effected/yaml/internal/stringifier.js
|
|
13809
14369
|
/**
|
|
13810
14370
|
* Thrown by the stringifier on its failure paths (circular references). The
|
|
13811
14371
|
* facade catches this and materializes the public stringify error.
|
|
@@ -13833,6 +14393,27 @@ var StringifyDepthExceeded = class extends Error {
|
|
|
13833
14393
|
this.name = "StringifyDepthExceeded";
|
|
13834
14394
|
}
|
|
13835
14395
|
};
|
|
14396
|
+
/**
|
|
14397
|
+
* YAML 1.2 §8.1.3 caps an implicit block-mapping key: the `:` indicator must
|
|
14398
|
+
* appear at most 1024 characters after the start of the key. A key whose
|
|
14399
|
+
* RENDERED form (quotes and escapes count, the source scalar does not) is
|
|
14400
|
+
* longer than this must spill to explicit-key form (`? key` / `: value`) or
|
|
14401
|
+
* strict parsers reject the output. Matches the reference `yaml` package
|
|
14402
|
+
* (`stringifyPair`: `str.length > 1024`, block context only — flow contexts
|
|
14403
|
+
* never spill): a rendered key of exactly 1024 characters stays implicit.
|
|
14404
|
+
*/
|
|
14405
|
+
const IMPLICIT_KEY_MAX_LENGTH = 1024;
|
|
14406
|
+
/**
|
|
14407
|
+
* Continuation-line padding for explicit-key compact notation. Structurally
|
|
14408
|
+
* the width of the `? ` / `: ` indicators — two columns — and deliberately
|
|
14409
|
+
* NOT `ctx.indent`: compact continuation lines must align with the first
|
|
14410
|
+
* item, which always starts two columns in, so any other pad silently
|
|
14411
|
+
* re-nests (or corrupts) the value on reparse once `indent !== 2`. This is a
|
|
14412
|
+
* recorded divergence from the reference `yaml` package, which pads these
|
|
14413
|
+
* lines with the configured indent and emits output its own strict parser
|
|
14414
|
+
* misreads or rejects at indent ≠ 2.
|
|
14415
|
+
*/
|
|
14416
|
+
const EXPLICIT_COMPACT_PAD = " ";
|
|
13836
14417
|
const NULL_RE = /^(?:null|Null|NULL|~)$/;
|
|
13837
14418
|
const TRUE_RE = /^(?:true|True|TRUE)$/;
|
|
13838
14419
|
const FALSE_RE = /^(?:false|False|FALSE)$/;
|
|
@@ -13980,7 +14561,9 @@ function renderSingleQuoted(s) {
|
|
|
13980
14561
|
* Block literal and block folded styles are always accepted for single-line
|
|
13981
14562
|
* strings even though the output is unusual.
|
|
13982
14563
|
*/
|
|
13983
|
-
function renderString(s, style, indent, ignoreType = false, canonical = false, explicitChomp, parentPosition, quoteStyle = "single") {
|
|
14564
|
+
function renderString(s, style, indent, ignoreType = false, canonical = false, explicitChomp, parentPosition, quoteStyle = "single", explicitIndent) {
|
|
14565
|
+
const fidelity = !canonical;
|
|
14566
|
+
const fidelityIndent = fidelity ? explicitIndent : void 0;
|
|
13984
14567
|
if (s.includes("\n")) {
|
|
13985
14568
|
let hasControl = false;
|
|
13986
14569
|
for (let i = 0; i < s.length; i++) {
|
|
@@ -13996,14 +14579,14 @@ function renderString(s, style, indent, ignoreType = false, canonical = false, e
|
|
|
13996
14579
|
if (hasInteriorTrailingWhitespace(s)) return renderDoubleQuoted(s, canonical);
|
|
13997
14580
|
if (hasNewlineSpacesTab(s)) return renderDoubleQuoted(s, canonical);
|
|
13998
14581
|
}
|
|
13999
|
-
if (style === "block-literal") return renderBlockLiteral(s, indent, explicitChomp, parentPosition);
|
|
14000
|
-
if (style === "block-folded") return renderBlockFolded(s, indent);
|
|
14582
|
+
if (style === "block-literal") return renderBlockLiteral(s, indent, explicitChomp, parentPosition, fidelity, fidelityIndent);
|
|
14583
|
+
if (style === "block-folded") return renderBlockFolded(s, indent, fidelity ? explicitChomp : void 0, fidelityIndent);
|
|
14001
14584
|
if (style === "plain" || style === "single-quoted") {
|
|
14002
14585
|
if (canonical) {
|
|
14003
14586
|
const sq = renderSingleQuotedMultiline(s, indent);
|
|
14004
14587
|
if (sq !== null) return sq;
|
|
14005
14588
|
}
|
|
14006
|
-
return renderBlockLiteral(s, indent, explicitChomp, parentPosition);
|
|
14589
|
+
return renderBlockLiteral(s, indent, explicitChomp, parentPosition, fidelity, fidelityIndent);
|
|
14007
14590
|
}
|
|
14008
14591
|
return renderDoubleQuoted(s, canonical);
|
|
14009
14592
|
}
|
|
@@ -14019,8 +14602,8 @@ function renderString(s, style, indent, ignoreType = false, canonical = false, e
|
|
|
14019
14602
|
return s;
|
|
14020
14603
|
case "single-quoted": return renderSingleQuoted(s);
|
|
14021
14604
|
case "double-quoted": return renderDoubleQuoted(s, canonical);
|
|
14022
|
-
case "block-literal": return renderBlockLiteral(s, indent, explicitChomp, parentPosition);
|
|
14023
|
-
case "block-folded": return renderBlockFolded(s, indent);
|
|
14605
|
+
case "block-literal": return renderBlockLiteral(s, indent, explicitChomp, parentPosition, fidelity, fidelityIndent);
|
|
14606
|
+
case "block-folded": return renderBlockFolded(s, indent, fidelity ? explicitChomp : void 0, fidelityIndent);
|
|
14024
14607
|
}
|
|
14025
14608
|
}
|
|
14026
14609
|
/**
|
|
@@ -14150,6 +14733,18 @@ function stringifyObjectLines(obj, ctx, depth) {
|
|
|
14150
14733
|
const keyStr = renderKey(k);
|
|
14151
14734
|
const val = obj[k];
|
|
14152
14735
|
const valLines = stringifyLines(val, ctx, depth + 1);
|
|
14736
|
+
if (keyStr.length > IMPLICIT_KEY_MAX_LENGTH) {
|
|
14737
|
+
lines.push(`? ${keyStr}`);
|
|
14738
|
+
if (valLines.length === 1) lines.push(`: ${valLines[0]}`);
|
|
14739
|
+
else if (valLines[0].startsWith("|") || valLines[0].startsWith(">") || typeof val === "string") {
|
|
14740
|
+
lines.push(`: ${valLines[0]}`);
|
|
14741
|
+
for (let i = 1; i < valLines.length; i++) lines.push(valLines[i]);
|
|
14742
|
+
} else {
|
|
14743
|
+
lines.push(`: ${valLines[0]}`);
|
|
14744
|
+
for (let i = 1; i < valLines.length; i++) lines.push(valLines[i] === "" ? valLines[i] : `${EXPLICIT_COMPACT_PAD}${valLines[i]}`);
|
|
14745
|
+
}
|
|
14746
|
+
continue;
|
|
14747
|
+
}
|
|
14153
14748
|
if (valLines.length === 1 && !isBlockCollection(val, ctx)) lines.push(`${keyStr}: ${valLines[0]}`);
|
|
14154
14749
|
else {
|
|
14155
14750
|
const first = valLines[0];
|
|
@@ -14180,7 +14775,7 @@ function stringifyValue(value, options) {
|
|
|
14180
14775
|
}
|
|
14181
14776
|
|
|
14182
14777
|
//#endregion
|
|
14183
|
-
//#region ../../node_modules/.pnpm/@effected+yaml@0.
|
|
14778
|
+
//#region ../../node_modules/.pnpm/@effected+yaml@0.8.0_effect@4.0.0-beta.107/node_modules/@effected/yaml/Yaml.js
|
|
14184
14779
|
/**
|
|
14185
14780
|
* Options controlling parse behavior. All fields are omissible; absent fields
|
|
14186
14781
|
* resolve to `strict` `true`, `maxAliasCount` `100` (the alias-based
|
|
@@ -14296,7 +14891,9 @@ var YamlStringifyOptions = class extends Schema.Class("YamlStringifyOptions")({
|
|
|
14296
14891
|
* Error-recovery parse failure: aggregates every fatal {@link YamlDiagnostic}
|
|
14297
14892
|
* encountered, so a single failure reports the whole batch. Raised by
|
|
14298
14893
|
* {@link Yaml.parse}, {@link Yaml.parseAll}, `YamlDocument.parse`/`parseAll`
|
|
14299
|
-
* and the decode direction of the schema factories.
|
|
14894
|
+
* and the decode direction of the schema factories. The error itself has no
|
|
14895
|
+
* `code` field: read the code from the diagnostics —
|
|
14896
|
+
* `error.diagnostics[0].code` is the primary failure.
|
|
14300
14897
|
*
|
|
14301
14898
|
* @public
|
|
14302
14899
|
*/
|
|
@@ -14314,7 +14911,8 @@ var YamlParseError = class extends Schema.TaggedError()("YamlParseError", {
|
|
|
14314
14911
|
* Stringification failure (the circular-reference guard), carrying structured
|
|
14315
14912
|
* {@link YamlDiagnostic} entries and the offending value. Raised by
|
|
14316
14913
|
* {@link Yaml.stringify}, `YamlDocument#stringify` and the encode direction of
|
|
14317
|
-
* the schema factories.
|
|
14914
|
+
* the schema factories. The error itself has no `code` field: read the code
|
|
14915
|
+
* from the diagnostics — `error.diagnostics[0].code` is the primary failure.
|
|
14318
14916
|
*
|
|
14319
14917
|
* @public
|
|
14320
14918
|
*/
|
|
@@ -14412,6 +15010,35 @@ const parseResultImpl = (text, options) => {
|
|
|
14412
15010
|
}
|
|
14413
15011
|
};
|
|
14414
15012
|
/**
|
|
15013
|
+
* Synchronous multi-document parse returning a `Result`. Mirrors
|
|
15014
|
+
* {@link parseResultImpl} over the whole stream: stream-level
|
|
15015
|
+
* directive-placement errors and every document's failure records aggregate
|
|
15016
|
+
* into one {@link YamlParseError}; each document's value is extracted against
|
|
15017
|
+
* its own independent anchor map (anchors are document-scoped in a stream),
|
|
15018
|
+
* with the alias-expansion budget materialized as a typed failure.
|
|
15019
|
+
*/
|
|
15020
|
+
const parseAllResultImpl = (text, options) => {
|
|
15021
|
+
const { documents, streamErrors } = composeAllDocuments(text, toParseInput(options));
|
|
15022
|
+
const uniqueKeys = options?.uniqueKeys ?? true;
|
|
15023
|
+
const failures = [...streamErrors.filter((e) => isFatalCode(e.code)), ...documents.flatMap((d) => failureRecords(d, uniqueKeys))];
|
|
15024
|
+
if (failures.length > 0) return Result.fail(new YamlParseError({
|
|
15025
|
+
diagnostics: toDiagnostics(text, failures),
|
|
15026
|
+
input: text
|
|
15027
|
+
}));
|
|
15028
|
+
const maxAliasCount = options?.maxAliasCount ?? 100;
|
|
15029
|
+
const values = [];
|
|
15030
|
+
for (const d of documents) {
|
|
15031
|
+
const anchors = /* @__PURE__ */ new Map();
|
|
15032
|
+
try {
|
|
15033
|
+
values.push(nodeToJsValue(d.contents, anchors, maxAliasCount));
|
|
15034
|
+
} catch (defect) {
|
|
15035
|
+
if (defect instanceof AliasExpansionBudgetExceeded) return Result.fail(aliasCountExceededError(defect.message, text));
|
|
15036
|
+
throw defect;
|
|
15037
|
+
}
|
|
15038
|
+
}
|
|
15039
|
+
return Result.succeed(values);
|
|
15040
|
+
};
|
|
15041
|
+
/**
|
|
14415
15042
|
* Synchronous stringify returning a `Result`. Mirrors {@link Yaml.stringify}
|
|
14416
15043
|
* without the Effect wrapper: a circular reference or a value nested past the
|
|
14417
15044
|
* recursion budget yields a `Failure` carrying a typed {@link YamlStringifyError},
|
|
@@ -14437,19 +15064,6 @@ const failureRecords = (doc, uniqueKeys) => {
|
|
|
14437
15064
|
if (fatal.length > 0) return fatal;
|
|
14438
15065
|
return uniqueKeys ? doc.warnings.filter((w) => w.code === "DuplicateKey") : [];
|
|
14439
15066
|
};
|
|
14440
|
-
/**
|
|
14441
|
-
* Extract a document's plain-JS value with an alias-expansion budget derived
|
|
14442
|
-
* from `maxAliasCount`, materializing a "billion laughs" blow-up as a typed
|
|
14443
|
-
* fatal {@link YamlParseError} (`AliasCountExceeded`) instead of letting the
|
|
14444
|
-
* heap-exhausting expansion escape as an unhandled defect.
|
|
14445
|
-
*/
|
|
14446
|
-
const extractDocumentValue = (contents, anchors, maxAliasCount, text) => Effect.try({
|
|
14447
|
-
try: () => nodeToJsValue(contents, anchors, maxAliasCount),
|
|
14448
|
-
catch: (defect) => {
|
|
14449
|
-
if (defect instanceof AliasExpansionBudgetExceeded) return aliasCountExceededError(defect.message, text);
|
|
14450
|
-
throw defect;
|
|
14451
|
-
}
|
|
14452
|
-
});
|
|
14453
15067
|
const stringifyOrFail = (value, options) => Effect.try({
|
|
14454
15068
|
try: () => stringifyValue(value, toStringifyInput(options)),
|
|
14455
15069
|
catch: (defect) => {
|
|
@@ -14508,23 +15122,11 @@ var Yaml = class Yaml {
|
|
|
14508
15122
|
* A "billion laughs" alias-expansion blow-up in any document also fails
|
|
14509
15123
|
* through {@link YamlParseError} with an `AliasCountExceeded` diagnostic,
|
|
14510
15124
|
* never as an unhandled defect.
|
|
15125
|
+
*
|
|
15126
|
+
* Defined in terms of {@link Yaml.parseAllResult} — synchronous callers
|
|
15127
|
+
* can use that variant directly.
|
|
14511
15128
|
*/
|
|
14512
|
-
static parseAll = Effect.fn("Yaml.parseAll")(
|
|
14513
|
-
const { documents, streamErrors } = composeAllDocuments(text, toParseInput(options));
|
|
14514
|
-
const uniqueKeys = options?.uniqueKeys ?? true;
|
|
14515
|
-
const failures = [...streamErrors.filter((e) => e.code === "InvalidDirective"), ...documents.flatMap((d) => failureRecords(d, uniqueKeys))];
|
|
14516
|
-
if (failures.length > 0) return yield* new YamlParseError({
|
|
14517
|
-
diagnostics: toDiagnostics(text, failures),
|
|
14518
|
-
input: text
|
|
14519
|
-
});
|
|
14520
|
-
const maxAliasCount = options?.maxAliasCount ?? 100;
|
|
14521
|
-
const values = [];
|
|
14522
|
-
for (const d of documents) {
|
|
14523
|
-
const anchors = buildAnchorMap(d.contents);
|
|
14524
|
-
values.push(yield* extractDocumentValue(d.contents, anchors, maxAliasCount, text));
|
|
14525
|
-
}
|
|
14526
|
-
return values;
|
|
14527
|
-
});
|
|
15129
|
+
static parseAll = Effect.fn("Yaml.parseAll")((text, options) => Effect.fromResult(Yaml.parseAllResult(text, options)));
|
|
14528
15130
|
/**
|
|
14529
15131
|
* Stringify a plain JavaScript value as YAML. Fails with
|
|
14530
15132
|
* {@link YamlStringifyError} on circular references (`CircularReference`)
|
|
@@ -14580,6 +15182,48 @@ var Yaml = class Yaml {
|
|
|
14580
15182
|
return parseResultImpl(text, options);
|
|
14581
15183
|
}
|
|
14582
15184
|
/**
|
|
15185
|
+
* Synchronous multi-document parse, returning a `Result` instead of an
|
|
15186
|
+
* `Effect` — the {@link Yaml.parseResult} counterpart to
|
|
15187
|
+
* {@link Yaml.parseAll}. Empty input succeeds with `[null]` (the engine
|
|
15188
|
+
* reads `""` as one empty document, exactly as {@link Yaml.parse} yields
|
|
15189
|
+
* `null` for it); a single-document stream succeeds with a one-element
|
|
15190
|
+
* array whose value is exactly what {@link Yaml.parseResult} yields.
|
|
15191
|
+
*
|
|
15192
|
+
* @remarks
|
|
15193
|
+
* This is the package's single multi-document parse path.
|
|
15194
|
+
* {@link Yaml.parseAll} is defined in terms of it (`Effect.fromResult`
|
|
15195
|
+
* behind the named span), so the two variants cannot diverge. Anchors are
|
|
15196
|
+
* document-scoped: each document's aliases resolve against its own anchor
|
|
15197
|
+
* map, never a neighbor's.
|
|
15198
|
+
*
|
|
15199
|
+
* Fails with the aggregate {@link YamlParseError} when **any** document in
|
|
15200
|
+
* the stream carries a fatal diagnostic (or a stream-level
|
|
15201
|
+
* directive-placement error), which makes it a whole-stream validity
|
|
15202
|
+
* check: a `Success` means every document parsed clean. Preserves the
|
|
15203
|
+
* package contract — malformed and adversarial input (including a
|
|
15204
|
+
* "billion laughs" alias bomb in any document) fails typed, never as a
|
|
15205
|
+
* defect; the method never throws.
|
|
15206
|
+
*
|
|
15207
|
+
* @example
|
|
15208
|
+
* ```ts
|
|
15209
|
+
* import { Yaml } from "@effected/yaml";
|
|
15210
|
+
* import { Result } from "effect";
|
|
15211
|
+
*
|
|
15212
|
+
* // Whole-stream validity check: fails if ANY document is invalid.
|
|
15213
|
+
* const result = Yaml.parseAllResult("a: 1\n---\nb: 2\n");
|
|
15214
|
+
* if (Result.isSuccess(result)) {
|
|
15215
|
+
* result.success; // [{ a: 1 }, { b: 2 }]
|
|
15216
|
+
* } else {
|
|
15217
|
+
* result.failure; // YamlParseError aggregating every fatal diagnostic
|
|
15218
|
+
* }
|
|
15219
|
+
* ```
|
|
15220
|
+
*
|
|
15221
|
+
* @public
|
|
15222
|
+
*/
|
|
15223
|
+
static parseAllResult(text, options) {
|
|
15224
|
+
return parseAllResultImpl(text, options);
|
|
15225
|
+
}
|
|
15226
|
+
/**
|
|
14583
15227
|
* Synchronous stringify, returning a `Result` instead of an `Effect`.
|
|
14584
15228
|
* The pure counterpart to {@link Yaml.stringify} for config-time callers
|
|
14585
15229
|
* that cannot `await`.
|
|
@@ -14832,7 +15476,7 @@ function deepEqualValues(a, b) {
|
|
|
14832
15476
|
}
|
|
14833
15477
|
|
|
14834
15478
|
//#endregion
|
|
14835
|
-
//#region ../../node_modules/.pnpm/@effected+lockfiles@0.4.
|
|
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
|
|
14836
15480
|
/**
|
|
14837
15481
|
* An empty YAML document composes to `null` (`Yaml.parseAll("")` is `[null]`,
|
|
14838
15482
|
* and the trailing document of an env-only `pnpm-lock.yaml` is `null` too).
|
|
@@ -14903,7 +15547,7 @@ const selectSoleDocument = (content) => Effect.gen(function* () {
|
|
|
14903
15547
|
});
|
|
14904
15548
|
|
|
14905
15549
|
//#endregion
|
|
14906
|
-
//#region ../../node_modules/.pnpm/@effected+lockfiles@0.4.
|
|
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
|
|
14907
15551
|
const PnpmImporterDeps = Schema.optionalKey(Schema.Record(Schema.String, Schema.Struct({
|
|
14908
15552
|
specifier: Schema.String,
|
|
14909
15553
|
version: Schema.String
|
|
@@ -15029,7 +15673,7 @@ const toFields$1 = (raw) => Effect.gen(function* () {
|
|
|
15029
15673
|
});
|
|
15030
15674
|
|
|
15031
15675
|
//#endregion
|
|
15032
|
-
//#region ../../node_modules/.pnpm/@effected+lockfiles@0.4.
|
|
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
|
|
15033
15677
|
const YarnLockfileRaw = Schema.Record(Schema.String, Schema.Unknown);
|
|
15034
15678
|
const DepRecord = Schema.optionalKey(Schema.Record(Schema.String, Schema.String));
|
|
15035
15679
|
const YarnEntry = Schema.Struct({
|
|
@@ -15153,7 +15797,7 @@ const cleanYarnDeps = (deps) => {
|
|
|
15153
15797
|
};
|
|
15154
15798
|
|
|
15155
15799
|
//#endregion
|
|
15156
|
-
//#region ../../node_modules/.pnpm/@effected+lockfiles@0.4.
|
|
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
|
|
15157
15801
|
const EMPTY_IMPORTERS = [];
|
|
15158
15802
|
/**
|
|
15159
15803
|
* Failure of `Lockfile.parse`: the given content is not a valid lockfile of
|
|
@@ -15398,7 +16042,7 @@ var Lockfile = class Lockfile extends Schema.Class("Lockfile")({
|
|
|
15398
16042
|
};
|
|
15399
16043
|
|
|
15400
16044
|
//#endregion
|
|
15401
|
-
//#region ../../node_modules/.pnpm/@effected+lockfiles@0.4.
|
|
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
|
|
15402
16046
|
/**
|
|
15403
16047
|
* The minimal manifest shape {@link LockfileIntegrity.compare} checks a
|
|
15404
16048
|
* lockfile against: a package name plus the four optional dependency maps.
|
|
@@ -17067,7 +17711,7 @@ const SpdxExpressionUnion = Schema.Union([
|
|
|
17067
17711
|
AndNode,
|
|
17068
17712
|
OrNode
|
|
17069
17713
|
]);
|
|
17070
|
-
function materialize(raw) {
|
|
17714
|
+
function materialize$1(raw) {
|
|
17071
17715
|
switch (raw.kind) {
|
|
17072
17716
|
case "license": return LicenseNode.make({
|
|
17073
17717
|
id: raw.id,
|
|
@@ -17085,12 +17729,12 @@ function materialize(raw) {
|
|
|
17085
17729
|
exception: raw.exception
|
|
17086
17730
|
});
|
|
17087
17731
|
case "and": return AndNode.make({
|
|
17088
|
-
left: materialize(raw.left),
|
|
17089
|
-
right: materialize(raw.right)
|
|
17732
|
+
left: materialize$1(raw.left),
|
|
17733
|
+
right: materialize$1(raw.right)
|
|
17090
17734
|
});
|
|
17091
17735
|
case "or": return OrNode.make({
|
|
17092
|
-
left: materialize(raw.left),
|
|
17093
|
-
right: materialize(raw.right)
|
|
17736
|
+
left: materialize$1(raw.left),
|
|
17737
|
+
right: materialize$1(raw.right)
|
|
17094
17738
|
});
|
|
17095
17739
|
}
|
|
17096
17740
|
}
|
|
@@ -17107,7 +17751,7 @@ function materialize(raw) {
|
|
|
17107
17751
|
*/
|
|
17108
17752
|
const parseResult = (input) => {
|
|
17109
17753
|
const raw = parse$2(input);
|
|
17110
|
-
return raw === void 0 ? Result.fail(new InvalidSpdxExpressionError({ input })) : Result.succeed(materialize(raw));
|
|
17754
|
+
return raw === void 0 ? Result.fail(new InvalidSpdxExpressionError({ input })) : Result.succeed(materialize$1(raw));
|
|
17111
17755
|
};
|
|
17112
17756
|
/**
|
|
17113
17757
|
* Whether `input` is a syntactically and catalog-valid SPDX license expression.
|
|
@@ -18259,7 +18903,7 @@ var Package = class Package extends Schema.Class("Package")({
|
|
|
18259
18903
|
};
|
|
18260
18904
|
|
|
18261
18905
|
//#endregion
|
|
18262
|
-
//#region ../../node_modules/.pnpm/@effected+workspaces@0.
|
|
18906
|
+
//#region ../../node_modules/.pnpm/@effected+workspaces@0.12.0_@effected+jsonc@0.6.0_effect@4.0.0-beta.107__effect@4.0.0-beta.107/node_modules/@effected/workspaces/WorkspacePackage.js
|
|
18263
18907
|
const EMPTY$1 = Object.freeze(Object.create(null));
|
|
18264
18908
|
const EMPTY_MANIFEST = Object.freeze(Object.create(null));
|
|
18265
18909
|
/**
|
|
@@ -18861,7 +19505,7 @@ var Walker$1 = class {
|
|
|
18861
19505
|
};
|
|
18862
19506
|
|
|
18863
19507
|
//#endregion
|
|
18864
|
-
//#region ../../node_modules/.pnpm/@effected+workspaces@0.
|
|
19508
|
+
//#region ../../node_modules/.pnpm/@effected+workspaces@0.12.0_@effected+jsonc@0.6.0_effect@4.0.0-beta.107__effect@4.0.0-beta.107/node_modules/@effected/workspaces/WorkspaceRoot.js
|
|
18865
19509
|
/**
|
|
18866
19510
|
* The marker filenames {@link WorkspaceRoot} probes for, in priority order.
|
|
18867
19511
|
*
|
|
@@ -19049,7 +19693,7 @@ var WorkspaceRoot = class WorkspaceRoot extends Context.Service()("@effected/wor
|
|
|
19049
19693
|
};
|
|
19050
19694
|
|
|
19051
19695
|
//#endregion
|
|
19052
|
-
//#region ../../node_modules/.pnpm/@effected+workspaces@0.
|
|
19696
|
+
//#region ../../node_modules/.pnpm/@effected+workspaces@0.12.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
|
|
19053
19697
|
/**
|
|
19054
19698
|
* Hard ceiling on directories the enumerator will visit for one pattern set.
|
|
19055
19699
|
* Guards the pathological case a depth cap alone does not: a wide, shallow
|
|
@@ -19068,7 +19712,7 @@ const MAX_ENUMERATION_ENTRIES = 1e5;
|
|
|
19068
19712
|
const PRUNED_DIRECTORIES = /* @__PURE__ */ new Set([".git", "node_modules"]);
|
|
19069
19713
|
|
|
19070
19714
|
//#endregion
|
|
19071
|
-
//#region ../../node_modules/.pnpm/@effected+workspaces@0.
|
|
19715
|
+
//#region ../../node_modules/.pnpm/@effected+workspaces@0.12.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
|
|
19072
19716
|
/** Directory names never descended into. */
|
|
19073
19717
|
const isPruned = (entry) => PRUNED_DIRECTORIES.has(entry);
|
|
19074
19718
|
/** Join root-relative POSIX segments; `""` is the root itself. */
|
|
@@ -19159,7 +19803,7 @@ var Traversal = class {
|
|
|
19159
19803
|
};
|
|
19160
19804
|
|
|
19161
19805
|
//#endregion
|
|
19162
|
-
//#region ../../node_modules/.pnpm/@effected+workspaces@0.
|
|
19806
|
+
//#region ../../node_modules/.pnpm/@effected+workspaces@0.12.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
|
|
19163
19807
|
/** Strip a trailing slash from `GlobPattern.enumerationPrefix` to get a relative directory. */
|
|
19164
19808
|
const baseOf = (pattern) => pattern.enumerationPrefix.replace(/\/$/, "");
|
|
19165
19809
|
/**
|
|
@@ -19230,7 +19874,7 @@ const enumerate = (root, globs, options) => Effect.gen(function* () {
|
|
|
19230
19874
|
});
|
|
19231
19875
|
|
|
19232
19876
|
//#endregion
|
|
19233
|
-
//#region ../../node_modules/.pnpm/@effected+workspaces@0.
|
|
19877
|
+
//#region ../../node_modules/.pnpm/@effected+workspaces@0.12.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
|
|
19234
19878
|
const stringsOf = (value) => Array.isArray(value) ? value.filter((entry) => typeof entry === "string") : void 0;
|
|
19235
19879
|
/** The `packages:` list of a `pnpm-workspace.yaml` document. Total on a parsed document. */
|
|
19236
19880
|
const pnpmPatternsOf = (document) => {
|
|
@@ -19288,7 +19932,7 @@ const readPatterns = (root) => Effect.gen(function* () {
|
|
|
19288
19932
|
});
|
|
19289
19933
|
|
|
19290
19934
|
//#endregion
|
|
19291
|
-
//#region ../../node_modules/.pnpm/@effected+workspaces@0.
|
|
19935
|
+
//#region ../../node_modules/.pnpm/@effected+workspaces@0.12.0_@effected+jsonc@0.6.0_effect@4.0.0-beta.107__effect@4.0.0-beta.107/node_modules/@effected/workspaces/WorkspaceDiscovery.js
|
|
19292
19936
|
/**
|
|
19293
19937
|
* Raised when a workspace member's `package.json` cannot be read, parsed, or
|
|
19294
19938
|
* used — it is missing, malformed, or lacks a `name` or `version`.
|
|
@@ -19745,15 +20389,16 @@ var WorkspaceDiscovery = class WorkspaceDiscovery extends Context.Service()("@ef
|
|
|
19745
20389
|
const isStringRecord$2 = (value) => value !== null && typeof value === "object" && !Array.isArray(value) && Object.values(value).every((entry) => typeof entry === "string");
|
|
19746
20390
|
|
|
19747
20391
|
//#endregion
|
|
19748
|
-
//#region ../../node_modules/.pnpm/@effected+workspaces@0.
|
|
20392
|
+
//#region ../../node_modules/.pnpm/@effected+workspaces@0.12.0_@effected+jsonc@0.6.0_effect@4.0.0-beta.107__effect@4.0.0-beta.107/node_modules/@effected/workspaces/DependencyGraph.js
|
|
19749
20393
|
/**
|
|
19750
20394
|
* Raised when the workspace dependency graph cannot be topologically ordered
|
|
19751
20395
|
* because it contains a cycle.
|
|
19752
20396
|
*
|
|
19753
20397
|
* @remarks
|
|
19754
|
-
* `cycle`
|
|
19755
|
-
*
|
|
19756
|
-
* set to break, not necessarily
|
|
20398
|
+
* `cycle` names the actual cycle members — the sorted union of every strongly
|
|
20399
|
+
* connected component with more than one package. Packages merely downstream
|
|
20400
|
+
* of a cycle are excluded, so it is exactly the set to break, not necessarily
|
|
20401
|
+
* a single ordered loop.
|
|
19757
20402
|
*
|
|
19758
20403
|
* @public
|
|
19759
20404
|
*/
|
|
@@ -19908,7 +20553,11 @@ packages: Schema.Array(WorkspacePackage) }) {
|
|
|
19908
20553
|
* the whole adjacency map per processed node. Each level is sorted
|
|
19909
20554
|
* lexicographically, so the output is deterministic.
|
|
19910
20555
|
*/
|
|
19911
|
-
levels = Effect.fn("DependencyGraph.levels")(() => Effect.suspend(() =>
|
|
20556
|
+
levels = Effect.fn("DependencyGraph.levels")(() => Effect.suspend(() => {
|
|
20557
|
+
const edges = this.#index();
|
|
20558
|
+
const result = kahn(edges);
|
|
20559
|
+
return result.stalled.length > 0 ? Effect.fail(new CyclicDependencyError({ cycle: cycleMembers(edges) })) : Effect.succeed(result.levels);
|
|
20560
|
+
}));
|
|
19912
20561
|
/** The flattened topological order — `levels()` concatenated. */
|
|
19913
20562
|
sort = Effect.fn("DependencyGraph.sort")(() => this.levels().pipe(Effect.map((levels) => levels.flat())));
|
|
19914
20563
|
/**
|
|
@@ -19938,17 +20587,78 @@ packages: Schema.Array(WorkspacePackage) }) {
|
|
|
19938
20587
|
subForward.set(node, deps);
|
|
19939
20588
|
for (const dep of deps) subReverse.get(dep)?.add(node);
|
|
19940
20589
|
}
|
|
19941
|
-
const
|
|
20590
|
+
const subEdges = {
|
|
19942
20591
|
forward: subForward,
|
|
19943
20592
|
reverse: subReverse
|
|
19944
|
-
}
|
|
19945
|
-
|
|
20593
|
+
};
|
|
20594
|
+
const result = kahn(subEdges);
|
|
20595
|
+
return result.stalled.length > 0 ? Effect.fail(new CyclicDependencyError({ cycle: cycleMembers(subEdges) })) : Effect.succeed(result.levels.flat());
|
|
19946
20596
|
}));
|
|
20597
|
+
/**
|
|
20598
|
+
* The graph rendered as a Mermaid `flowchart TD`. Total.
|
|
20599
|
+
*
|
|
20600
|
+
* @remarks
|
|
20601
|
+
* Renders through core's `Graph.toMermaid` over a transient graph built from
|
|
20602
|
+
* the edge index. Node IDs are numeric indexes assigned in sorted-name order
|
|
20603
|
+
* and package names appear only inside quoted labels, so scoped names
|
|
20604
|
+
* (`@scope/a`) never break Mermaid syntax. Nodes and each node's edges are
|
|
20605
|
+
* emitted in sorted order — the output is deterministic regardless of
|
|
20606
|
+
* manifest key order.
|
|
20607
|
+
*/
|
|
20608
|
+
toMermaid() {
|
|
20609
|
+
return Graph.toMermaid(materialize(this.#index()).graph, { edgeLabel: () => "" });
|
|
20610
|
+
}
|
|
20611
|
+
};
|
|
20612
|
+
/**
|
|
20613
|
+
* Materializes the forward map into a transient core `Graph`: nodes in
|
|
20614
|
+
* sorted-name order (so `NodeIndex` *i* is `names[i]`) and each node's edges
|
|
20615
|
+
* in sorted-target order, making the graph — and everything derived from it —
|
|
20616
|
+
* deterministic for a given edge index.
|
|
20617
|
+
*/
|
|
20618
|
+
const materialize = (edges) => {
|
|
20619
|
+
const names = [...edges.forward.keys()].sort();
|
|
20620
|
+
return {
|
|
20621
|
+
graph: Graph.directed((mutable) => {
|
|
20622
|
+
const indexOf = /* @__PURE__ */ new Map();
|
|
20623
|
+
for (const name of names) indexOf.set(name, Graph.addNode(mutable, name));
|
|
20624
|
+
for (const name of names) {
|
|
20625
|
+
const source = indexOf.get(name);
|
|
20626
|
+
if (source === void 0) continue;
|
|
20627
|
+
for (const dependency of [...edges.forward.get(name) ?? []].sort()) {
|
|
20628
|
+
const target = indexOf.get(dependency);
|
|
20629
|
+
if (target !== void 0) Graph.addEdge(mutable, source, target, "");
|
|
20630
|
+
}
|
|
20631
|
+
}
|
|
20632
|
+
}),
|
|
20633
|
+
names
|
|
20634
|
+
};
|
|
20635
|
+
};
|
|
20636
|
+
/**
|
|
20637
|
+
* The packages participating in a dependency cycle — the sorted union of every
|
|
20638
|
+
* strongly connected component with more than one member, via core's
|
|
20639
|
+
* `Graph.stronglyConnectedComponents`. Self-edges are dropped at index time,
|
|
20640
|
+
* so a single-member component is never cyclic here.
|
|
20641
|
+
*/
|
|
20642
|
+
const cycleMembers = (edges) => {
|
|
20643
|
+
const { graph, names } = materialize(edges);
|
|
20644
|
+
const members = /* @__PURE__ */ new Set();
|
|
20645
|
+
for (const component of Graph.stronglyConnectedComponents(graph)) {
|
|
20646
|
+
if (component.length < 2) continue;
|
|
20647
|
+
for (const index of component) {
|
|
20648
|
+
const name = names[index];
|
|
20649
|
+
if (name !== void 0) members.add(name);
|
|
20650
|
+
}
|
|
20651
|
+
}
|
|
20652
|
+
return [...members].sort();
|
|
19947
20653
|
};
|
|
19948
20654
|
/**
|
|
19949
20655
|
* Kahn's algorithm. `forward[A] = {B}` reads "A depends on B", so level 0 is
|
|
19950
20656
|
* the set with an out-degree of zero and each completed level decrements its
|
|
19951
20657
|
* dependents through the reverse index.
|
|
20658
|
+
*
|
|
20659
|
+
* A non-empty `stalled` only signals *that* a cycle exists — it holds every
|
|
20660
|
+
* unprocessed node, including ones merely downstream of a cycle. The error
|
|
20661
|
+
* payload names the actual members via `cycleMembers`.
|
|
19952
20662
|
*/
|
|
19953
20663
|
const kahn = (edges) => {
|
|
19954
20664
|
const remaining = /* @__PURE__ */ new Map();
|
|
@@ -23241,7 +23951,7 @@ var Git = class Git extends Context.Service()("@effected/git/Git") {
|
|
|
23241
23951
|
};
|
|
23242
23952
|
|
|
23243
23953
|
//#endregion
|
|
23244
|
-
//#region ../../node_modules/.pnpm/@effected+workspaces@0.
|
|
23954
|
+
//#region ../../node_modules/.pnpm/@effected+workspaces@0.12.0_@effected+jsonc@0.6.0_effect@4.0.0-beta.107__effect@4.0.0-beta.107/node_modules/@effected/workspaces/ChangeDetector.js
|
|
23245
23955
|
/**
|
|
23246
23956
|
* Which git refs to compare, and whether to fold in the working tree.
|
|
23247
23957
|
*
|
|
@@ -23541,7 +24251,7 @@ function resolveFromCatalog(catalogs, wantedDependency) {
|
|
|
23541
24251
|
}
|
|
23542
24252
|
|
|
23543
24253
|
//#endregion
|
|
23544
|
-
//#region ../../node_modules/.pnpm/@effected+workspaces@0.
|
|
24254
|
+
//#region ../../node_modules/.pnpm/@effected+workspaces@0.12.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
|
|
23545
24255
|
/** Project a pnpm-workspace manifest's `catalog` / `catalogs` fields into a `Catalogs` map. */
|
|
23546
24256
|
const inlineCatalogs = (manifest) => {
|
|
23547
24257
|
if (manifest.catalog === void 0 && manifest.catalogs === void 0) return {};
|
|
@@ -23607,7 +24317,7 @@ const rangeOf = (catalogs, dependency, specifier) => {
|
|
|
23607
24317
|
};
|
|
23608
24318
|
|
|
23609
24319
|
//#endregion
|
|
23610
|
-
//#region ../../node_modules/.pnpm/@effected+workspaces@0.
|
|
24320
|
+
//#region ../../node_modules/.pnpm/@effected+workspaces@0.12.0_@effected+jsonc@0.6.0_effect@4.0.0-beta.107__effect@4.0.0-beta.107/node_modules/@effected/workspaces/ConfigDependencyHooks.js
|
|
23611
24321
|
/** Whether `value` is a non-null, non-array object. */
|
|
23612
24322
|
const isObject$2 = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
23613
24323
|
/**
|
|
@@ -24019,7 +24729,7 @@ var ConfigDependencyHooks = class ConfigDependencyHooks extends Context.Service(
|
|
|
24019
24729
|
};
|
|
24020
24730
|
|
|
24021
24731
|
//#endregion
|
|
24022
|
-
//#region ../../node_modules/.pnpm/@effected+workspaces@0.
|
|
24732
|
+
//#region ../../node_modules/.pnpm/@effected+workspaces@0.12.0_@effected+jsonc@0.6.0_effect@4.0.0-beta.107__effect@4.0.0-beta.107/node_modules/@effected/workspaces/PackageManagerName.js
|
|
24023
24733
|
/**
|
|
24024
24734
|
* The four package managers this package understands.
|
|
24025
24735
|
*
|
|
@@ -24348,7 +25058,7 @@ var PackageManagerDetector = class PackageManagerDetector extends Context.Servic
|
|
|
24348
25058
|
};
|
|
24349
25059
|
|
|
24350
25060
|
//#endregion
|
|
24351
|
-
//#region ../../node_modules/.pnpm/@effected+workspaces@0.
|
|
25061
|
+
//#region ../../node_modules/.pnpm/@effected+workspaces@0.12.0_@effected+jsonc@0.6.0_effect@4.0.0-beta.107__effect@4.0.0-beta.107/node_modules/@effected/workspaces/LockfileReader.js
|
|
24352
25062
|
/**
|
|
24353
25063
|
* Raised when the workspace's lockfile cannot be read off disk.
|
|
24354
25064
|
*
|
|
@@ -24529,7 +25239,7 @@ var LockfileReader = class LockfileReader extends Context.Service()("@effected/w
|
|
|
24529
25239
|
};
|
|
24530
25240
|
|
|
24531
25241
|
//#endregion
|
|
24532
|
-
//#region ../../node_modules/.pnpm/@effected+workspaces@0.
|
|
25242
|
+
//#region ../../node_modules/.pnpm/@effected+workspaces@0.12.0_@effected+jsonc@0.6.0_effect@4.0.0-beta.107__effect@4.0.0-beta.107/node_modules/@effected/workspaces/Publishability.js
|
|
24533
25243
|
/** The public npm registry, used when `publishConfig.registry` says nothing. */
|
|
24534
25244
|
const DEFAULT_REGISTRY = "https://registry.npmjs.org/";
|
|
24535
25245
|
/**
|
|
@@ -24689,7 +25399,7 @@ var PublishabilityDetector = class extends Context.Service()("@effected/workspac
|
|
|
24689
25399
|
};
|
|
24690
25400
|
|
|
24691
25401
|
//#endregion
|
|
24692
|
-
//#region ../../node_modules/.pnpm/@effected+workspaces@0.
|
|
25402
|
+
//#region ../../node_modules/.pnpm/@effected+workspaces@0.12.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
|
|
24693
25403
|
/**
|
|
24694
25404
|
* Strip pnpm's peer-disambiguation suffix from a recorded importer version.
|
|
24695
25405
|
*
|
|
@@ -24776,7 +25486,7 @@ const unanimousVersionOf = (index, dependency) => {
|
|
|
24776
25486
|
};
|
|
24777
25487
|
|
|
24778
25488
|
//#endregion
|
|
24779
|
-
//#region ../../node_modules/.pnpm/@effected+workspaces@0.
|
|
25489
|
+
//#region ../../node_modules/.pnpm/@effected+workspaces@0.12.0_@effected+jsonc@0.6.0_effect@4.0.0-beta.107__effect@4.0.0-beta.107/node_modules/@effected/workspaces/WorkspaceCatalogs.js
|
|
24780
25490
|
/**
|
|
24781
25491
|
* An immutable, fully-normalized catalog collection — the one catalog
|
|
24782
25492
|
* resolution semantic in the package.
|
|
@@ -25304,7 +26014,7 @@ var WorkspaceCatalogs = class WorkspaceCatalogs extends Context.Service()("@effe
|
|
|
25304
26014
|
};
|
|
25305
26015
|
|
|
25306
26016
|
//#endregion
|
|
25307
|
-
//#region ../../node_modules/.pnpm/@effected+workspaces@0.
|
|
26017
|
+
//#region ../../node_modules/.pnpm/@effected+workspaces@0.12.0_@effected+jsonc@0.6.0_effect@4.0.0-beta.107__effect@4.0.0-beta.107/node_modules/@effected/workspaces/WorkspaceStateSnapshot.js
|
|
25308
26018
|
const EMPTY = Object.freeze(Object.create(null));
|
|
25309
26019
|
const DependencyMap = Schema.Record(Schema.String, Schema.String).pipe(Schema.withDecodingDefaultKey(Effect.succeed(EMPTY)), Schema.withConstructorDefault(Effect.succeed(EMPTY)));
|
|
25310
26020
|
/**
|
|
@@ -25528,7 +26238,7 @@ var WorkspaceStateSnapshot = class extends Schema.Class("WorkspaceStateSnapshot"
|
|
|
25528
26238
|
};
|
|
25529
26239
|
|
|
25530
26240
|
//#endregion
|
|
25531
|
-
//#region ../../node_modules/.pnpm/@effected+workspaces@0.
|
|
26241
|
+
//#region ../../node_modules/.pnpm/@effected+workspaces@0.12.0_@effected+jsonc@0.6.0_effect@4.0.0-beta.107__effect@4.0.0-beta.107/node_modules/@effected/workspaces/WorkspaceSnapshots.js
|
|
25532
26242
|
/** Whether `value` is a non-null, non-array object. */
|
|
25533
26243
|
const isObject = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
25534
26244
|
/** Whether every value in a record is a string — a usable dependency map. */
|
|
@@ -25806,7 +26516,7 @@ var WorkspaceSnapshots = class WorkspaceSnapshots extends Context.Service()("@ef
|
|
|
25806
26516
|
};
|
|
25807
26517
|
|
|
25808
26518
|
//#endregion
|
|
25809
|
-
//#region ../../node_modules/.pnpm/@effected+workspaces@0.
|
|
26519
|
+
//#region ../../node_modules/.pnpm/@effected+workspaces@0.12.0_@effected+jsonc@0.6.0_effect@4.0.0-beta.107__effect@4.0.0-beta.107/node_modules/@effected/workspaces/Workspaces.js
|
|
25810
26520
|
const compose = (options, catalogsFactory) => {
|
|
25811
26521
|
const roots = WorkspaceRoot.layer;
|
|
25812
26522
|
const detector = PackageManagerDetector.layer;
|
|
@@ -27939,7 +28649,7 @@ var require_dataloader = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
27939
28649
|
}));
|
|
27940
28650
|
|
|
27941
28651
|
//#endregion
|
|
27942
|
-
//#region ../../node_modules/.pnpm/@changesets+get-github-info@1.0.0
|
|
28652
|
+
//#region ../../node_modules/.pnpm/@changesets+get-github-info@1.0.0/node_modules/@changesets/get-github-info/dist/index.mjs
|
|
27943
28653
|
var import_dataloader = /* @__PURE__ */ __toESM(require_dataloader(), 1);
|
|
27944
28654
|
async function readEnvFile() {
|
|
27945
28655
|
const envFile = path$1.resolve(process.cwd(), ".env");
|
|
@@ -64195,7 +64905,7 @@ function validatePackages(packages) {
|
|
|
64195
64905
|
}
|
|
64196
64906
|
|
|
64197
64907
|
//#endregion
|
|
64198
|
-
//#region ../../node_modules/.pnpm/@changesets+get-dependents-graph@3.0.0
|
|
64908
|
+
//#region ../../node_modules/.pnpm/@changesets+get-dependents-graph@3.0.0/node_modules/@changesets/get-dependents-graph/dist/index.mjs
|
|
64199
64909
|
var src_default = new Proxy({}, { get(target, color) {
|
|
64200
64910
|
target[color] ??= (text) => styleText(color, text);
|
|
64201
64911
|
return target[color];
|
|
@@ -64316,7 +65026,7 @@ function getDependentsGraph(packages, opts) {
|
|
|
64316
65026
|
}
|
|
64317
65027
|
|
|
64318
65028
|
//#endregion
|
|
64319
|
-
//#region ../../node_modules/.pnpm/@changesets+should-skip-package@1.0.0
|
|
65029
|
+
//#region ../../node_modules/.pnpm/@changesets+should-skip-package@1.0.0/node_modules/@changesets/should-skip-package/dist/index.mjs
|
|
64320
65030
|
function shouldSkipPackage({ packageJson }, { ignore, allowPrivatePackages }) {
|
|
64321
65031
|
if (ignore.includes(packageJson.name)) return true;
|
|
64322
65032
|
if (packageJson.private && !allowPrivatePackages) return true;
|
|
@@ -64324,7 +65034,7 @@ function shouldSkipPackage({ packageJson }, { ignore, allowPrivatePackages }) {
|
|
|
64324
65034
|
}
|
|
64325
65035
|
|
|
64326
65036
|
//#endregion
|
|
64327
|
-
//#region ../../node_modules/.pnpm/@changesets+config@4.0.0
|
|
65037
|
+
//#region ../../node_modules/.pnpm/@changesets+config@4.0.0/node_modules/@changesets/config/dist/index.mjs
|
|
64328
65038
|
const DEFAULT_CONFIG = {
|
|
64329
65039
|
lang: void 0,
|
|
64330
65040
|
message: void 0,
|
|
@@ -65238,7 +65948,7 @@ async function readConfig(cwd, packages) {
|
|
|
65238
65948
|
packages ??= await getPackages(cwd);
|
|
65239
65949
|
return validateConfig(JSON.parse(await fs$1.readFile(path$1.join(packages.rootDir, ".changeset", "config.json"), "utf8")), packages);
|
|
65240
65950
|
}
|
|
65241
|
-
var version = "4.0.0
|
|
65951
|
+
var version = "4.0.0";
|
|
65242
65952
|
const defaultWrittenConfig = {
|
|
65243
65953
|
["$schema"]: `https://unpkg.com/@changesets/config@${version}/schema.json`,
|
|
65244
65954
|
baseBranch: "main",
|
|
@@ -66316,7 +67026,7 @@ const x = (command, args, userOptions) => {
|
|
|
66316
67026
|
const exec = x;
|
|
66317
67027
|
|
|
66318
67028
|
//#endregion
|
|
66319
|
-
//#region ../../node_modules/.pnpm/@changesets+format@0.1.
|
|
67029
|
+
//#region ../../node_modules/.pnpm/@changesets+format@0.1.2/node_modules/@changesets/format/dist/index.js
|
|
66320
67030
|
/**
|
|
66321
67031
|
* Traverse upwards from `startDir` to `stopDir` (inclusive), calling `cb` in each directory. If
|
|
66322
67032
|
* `cb` returns a non-null value, it'll stop and return that value.
|
|
@@ -66377,6 +67087,7 @@ const formatters = {
|
|
|
66377
67087
|
await packageManagerExecute(await ctx.getPackageManager(), [
|
|
66378
67088
|
"prettier",
|
|
66379
67089
|
"--write",
|
|
67090
|
+
"--no-error-on-unmatched-pattern",
|
|
66380
67091
|
...files
|
|
66381
67092
|
], ctx.cwd);
|
|
66382
67093
|
}
|
|
@@ -66395,6 +67106,7 @@ const formatters = {
|
|
|
66395
67106
|
"@biomejs/biome",
|
|
66396
67107
|
"format",
|
|
66397
67108
|
"--write",
|
|
67109
|
+
"--no-errors-on-unmatched",
|
|
66398
67110
|
...files
|
|
66399
67111
|
], ctx.cwd);
|
|
66400
67112
|
}
|
|
@@ -66405,12 +67117,14 @@ const formatters = {
|
|
|
66405
67117
|
configFiles: [
|
|
66406
67118
|
".oxfmtrc.json",
|
|
66407
67119
|
".oxfmtrc.jsonc",
|
|
66408
|
-
"oxfmt.config.ts"
|
|
67120
|
+
"oxfmt.config.ts",
|
|
67121
|
+
"oxfmt.config.mts"
|
|
66409
67122
|
],
|
|
66410
67123
|
async format(files, ctx) {
|
|
66411
67124
|
await packageManagerExecute(await ctx.getPackageManager(), [
|
|
66412
67125
|
"oxfmt",
|
|
66413
67126
|
"--write",
|
|
67127
|
+
"--no-error-on-unmatched-pattern",
|
|
66414
67128
|
...files
|
|
66415
67129
|
], ctx.cwd);
|
|
66416
67130
|
}
|
|
@@ -66426,7 +67140,11 @@ const formatters = {
|
|
|
66426
67140
|
}
|
|
66427
67141
|
],
|
|
66428
67142
|
async format(files, ctx) {
|
|
66429
|
-
await spawnProcess("deno", [
|
|
67143
|
+
await spawnProcess("deno", [
|
|
67144
|
+
"fmt",
|
|
67145
|
+
"--permit-no-files",
|
|
67146
|
+
...files
|
|
67147
|
+
], ctx.cwd);
|
|
66430
67148
|
}
|
|
66431
67149
|
},
|
|
66432
67150
|
dprint: {
|
|
@@ -66442,6 +67160,7 @@ const formatters = {
|
|
|
66442
67160
|
await packageManagerExecute(await ctx.getPackageManager(), [
|
|
66443
67161
|
"dprint",
|
|
66444
67162
|
"fmt",
|
|
67163
|
+
"--allow-no-files",
|
|
66445
67164
|
...files
|
|
66446
67165
|
], ctx.cwd);
|
|
66447
67166
|
}
|
|
@@ -66491,7 +67210,8 @@ function checkConfigFileWithKeyExists(configFile, key) {
|
|
|
66491
67210
|
}
|
|
66492
67211
|
/**
|
|
66493
67212
|
* Format the given patterns with a specified or auto-detected formatter. It returns `true` if a
|
|
66494
|
-
* formatter is found and the formatting process passes
|
|
67213
|
+
* formatter is found and the formatting process passes (even if the patterns didn't match any
|
|
67214
|
+
* files), otherwise returns `false`.
|
|
66495
67215
|
*/
|
|
66496
67216
|
async function format$1(patterns, options = {}) {
|
|
66497
67217
|
const formatterName = options.formatter ?? await detect({
|
|
@@ -66515,7 +67235,7 @@ async function format$1(patterns, options = {}) {
|
|
|
66515
67235
|
}
|
|
66516
67236
|
|
|
66517
67237
|
//#endregion
|
|
66518
|
-
//#region ../../node_modules/.pnpm/@changesets+errors@1.0.0
|
|
67238
|
+
//#region ../../node_modules/.pnpm/@changesets+errors@1.0.0/node_modules/@changesets/errors/dist/index.mjs
|
|
66519
67239
|
var GitError = class extends Error {
|
|
66520
67240
|
code;
|
|
66521
67241
|
constructor(code, message) {
|
|
@@ -66530,7 +67250,7 @@ var InternalError = class extends Error {
|
|
|
66530
67250
|
};
|
|
66531
67251
|
|
|
66532
67252
|
//#endregion
|
|
66533
|
-
//#region ../../node_modules/.pnpm/@changesets+git@4.0.0
|
|
67253
|
+
//#region ../../node_modules/.pnpm/@changesets+git@4.0.0/node_modules/@changesets/git/dist/index.mjs
|
|
66534
67254
|
async function getDivergedCommit(cwd, ref) {
|
|
66535
67255
|
const cmd = await exec("git", [
|
|
66536
67256
|
"merge-base",
|
|
@@ -68710,7 +69430,7 @@ function applyEdits(text, edits) {
|
|
|
68710
69430
|
}
|
|
68711
69431
|
|
|
68712
69432
|
//#endregion
|
|
68713
|
-
//#region ../../node_modules/.pnpm/@changesets+apply-release-plan@8.0.0
|
|
69433
|
+
//#region ../../node_modules/.pnpm/@changesets+apply-release-plan@8.0.0/node_modules/@changesets/apply-release-plan/dist/index.mjs
|
|
68714
69434
|
/**
|
|
68715
69435
|
* A simple JSON editing utility that preserves formatting. They specified operation keys
|
|
68716
69436
|
* must exist in the JSON for this implementation.
|
|
@@ -69064,7 +69784,7 @@ async function updateChangelog(changelogPath, changelog, name) {
|
|
|
69064
69784
|
}
|
|
69065
69785
|
|
|
69066
69786
|
//#endregion
|
|
69067
|
-
//#region ../../node_modules/.pnpm/@changesets+assemble-release-plan@7.0.0
|
|
69787
|
+
//#region ../../node_modules/.pnpm/@changesets+assemble-release-plan@7.0.0/node_modules/@changesets/assemble-release-plan/dist/index.mjs
|
|
69068
69788
|
function getHighestReleaseType(releases) {
|
|
69069
69789
|
if (releases.length === 0) throw new Error(`Large internal Changesets error when calculating highest release type in the set of releases. Please contact the maintainers`);
|
|
69070
69790
|
let highestReleaseType = "none";
|
|
@@ -69406,7 +70126,7 @@ function getPreInfo(packagesByName, config, preState) {
|
|
|
69406
70126
|
}
|
|
69407
70127
|
|
|
69408
70128
|
//#endregion
|
|
69409
|
-
//#region ../../node_modules/.pnpm/@changesets+pre@3.0.0
|
|
70129
|
+
//#region ../../node_modules/.pnpm/@changesets+pre@3.0.0/node_modules/@changesets/pre/dist/index.mjs
|
|
69410
70130
|
async function outputFile(filePath, content) {
|
|
69411
70131
|
await fs$1.mkdir(path$1.dirname(filePath), { recursive: true });
|
|
69412
70132
|
await fs$1.writeFile(filePath, content, "utf8");
|
|
@@ -69448,7 +70168,7 @@ async function migratePreState(rootDir, preState) {
|
|
|
69448
70168
|
}
|
|
69449
70169
|
|
|
69450
70170
|
//#endregion
|
|
69451
|
-
//#region ../../node_modules/.pnpm/@changesets+parse@1.0.0
|
|
70171
|
+
//#region ../../node_modules/.pnpm/@changesets+parse@1.0.0/node_modules/@changesets/parse/dist/index.mjs
|
|
69452
70172
|
const mdRegex = /\s*---([^]*?)\r?\n\s*---(\s*(?:\n|$)[^]*)/;
|
|
69453
70173
|
const EXAMPLE_FORMAT = `---\n"package-name": patch\n---`;
|
|
69454
70174
|
const validVersionTypes = [
|
|
@@ -69502,7 +70222,7 @@ YAML error: ${e instanceof Error ? e.message : String(e)}\nFrontmatter content:\
|
|
|
69502
70222
|
}
|
|
69503
70223
|
|
|
69504
70224
|
//#endregion
|
|
69505
|
-
//#region ../../node_modules/.pnpm/@changesets+read@1.0.0
|
|
70225
|
+
//#region ../../node_modules/.pnpm/@changesets+read@1.0.0/node_modules/@changesets/read/dist/index.mjs
|
|
69506
70226
|
const ignoredMdFiles = [
|
|
69507
70227
|
/^README\.md$/i,
|
|
69508
70228
|
"AGENTS.md",
|
|
@@ -69530,7 +70250,6 @@ async function readChangesets(rootDir, sinceRef) {
|
|
|
69530
70250
|
} catch (err) {
|
|
69531
70251
|
if (err.code !== "ENOENT") throw err;
|
|
69532
70252
|
}
|
|
69533
|
-
console.log(changesets);
|
|
69534
70253
|
if (sinceRef != null) changesets = await filterChangesetsSinceRef(changesets, changesetBase, sinceRef);
|
|
69535
70254
|
changesets = changesets.filter((file) => {
|
|
69536
70255
|
file = path$1.basename(file);
|
|
@@ -69546,7 +70265,7 @@ async function readChangesets(rootDir, sinceRef) {
|
|
|
69546
70265
|
}
|
|
69547
70266
|
|
|
69548
70267
|
//#endregion
|
|
69549
|
-
//#region ../../node_modules/.pnpm/@changesets+get-release-plan@5.0.0
|
|
70268
|
+
//#region ../../node_modules/.pnpm/@changesets+get-release-plan@5.0.0/node_modules/@changesets/get-release-plan/dist/index.mjs
|
|
69550
70269
|
async function getReleasePlan(cwd, sinceRef, passedConfig) {
|
|
69551
70270
|
const packages = await getPackages(cwd);
|
|
69552
70271
|
const configResult = await readConfig(packages.rootDir, packages);
|