@savvy-web/silk 3.5.2 → 3.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/changesets-changelog.cjs +926 -281
- package/changesets-changelog.d.cts +2 -2
- package/changesets-changelog.d.ts +2 -2
- package/changesets-changelog.js +925 -281
- package/changesets-markdownlint.cjs +926 -281
- package/changesets-markdownlint.d.cts +2 -2
- package/changesets-markdownlint.d.ts +2 -2
- package/changesets-markdownlint.js +925 -281
- package/package.json +4 -4
- package/tsconfig/node/dist/tsconfig.tsbuildinfo +1 -1
|
@@ -2339,7 +2339,7 @@ var GlobSet = class GlobSet extends effect.Schema.Class("GlobSet")(effect.Schema
|
|
|
2339
2339
|
}
|
|
2340
2340
|
};
|
|
2341
2341
|
//#endregion
|
|
2342
|
-
//#region ../../node_modules/.pnpm/@effected+lockfiles@0.4.
|
|
2342
|
+
//#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
|
|
2343
2343
|
/**
|
|
2344
2344
|
* Extension data specific to bun lockfiles, attached to `Lockfile.extension`
|
|
2345
2345
|
* when the format is `"bun"`.
|
|
@@ -5473,7 +5473,7 @@ var ReleaseAgeGate = class ReleaseAgeGate extends effect.Schema.Class("ReleaseAg
|
|
|
5473
5473
|
}
|
|
5474
5474
|
};
|
|
5475
5475
|
//#endregion
|
|
5476
|
-
//#region ../../node_modules/.pnpm/@effected+lockfiles@0.4.
|
|
5476
|
+
//#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
|
|
5477
5477
|
/**
|
|
5478
5478
|
* One declared dependency of one workspace importer, as the lockfile records it.
|
|
5479
5479
|
*
|
|
@@ -5511,7 +5511,7 @@ var ImporterDependency = class extends effect.Schema.Class("ImporterDependency")
|
|
|
5511
5511
|
depType: DependencyField
|
|
5512
5512
|
}) {};
|
|
5513
5513
|
//#endregion
|
|
5514
|
-
//#region ../../node_modules/.pnpm/@effected+lockfiles@0.4.
|
|
5514
|
+
//#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
|
|
5515
5515
|
/**
|
|
5516
5516
|
* One workspace importer's declared dependencies, as the lockfile records them.
|
|
5517
5517
|
*
|
|
@@ -5535,7 +5535,7 @@ var LockfileImporter = class extends effect.Schema.Class("LockfileImporter")({
|
|
|
5535
5535
|
dependencies: effect.Schema.Array(ImporterDependency)
|
|
5536
5536
|
}) {};
|
|
5537
5537
|
//#endregion
|
|
5538
|
-
//#region ../../node_modules/.pnpm/@effected+lockfiles@0.4.
|
|
5538
|
+
//#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
|
|
5539
5539
|
const EMPTY_DEPENDENCIES = {};
|
|
5540
5540
|
/**
|
|
5541
5541
|
* A package resolved from a lockfile.
|
|
@@ -5570,7 +5570,7 @@ var ResolvedPackage = class extends effect.Schema.Class("ResolvedPackage")({
|
|
|
5570
5570
|
dependencies: effect.Schema.Record(effect.Schema.String, effect.Schema.String).pipe(effect.Schema.withDecodingDefaultKey(effect.Effect.succeed(EMPTY_DEPENDENCIES)), effect.Schema.withConstructorDefault(effect.Effect.succeed(EMPTY_DEPENDENCIES)))
|
|
5571
5571
|
}) {};
|
|
5572
5572
|
//#endregion
|
|
5573
|
-
//#region ../../node_modules/.pnpm/@effected+lockfiles@0.4.
|
|
5573
|
+
//#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
|
|
5574
5574
|
/**
|
|
5575
5575
|
* A directed dependency edge between two workspace packages as recorded in
|
|
5576
5576
|
* the lockfile.
|
|
@@ -5592,7 +5592,7 @@ var WorkspaceDependency = class extends effect.Schema.Class("WorkspaceDependency
|
|
|
5592
5592
|
constraint: effect.Schema.String
|
|
5593
5593
|
}) {};
|
|
5594
5594
|
//#endregion
|
|
5595
|
-
//#region ../../node_modules/.pnpm/@effected+lockfiles@0.4.
|
|
5595
|
+
//#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
|
|
5596
5596
|
/**
|
|
5597
5597
|
* Extension data specific to pnpm lockfiles, attached to `Lockfile.extension`
|
|
5598
5598
|
* when the format is `"pnpm"`.
|
|
@@ -5617,7 +5617,7 @@ var PnpmExtension = class extends effect.Schema.Class("PnpmExtension")({
|
|
|
5617
5617
|
}))
|
|
5618
5618
|
}) {};
|
|
5619
5619
|
//#endregion
|
|
5620
|
-
//#region ../../node_modules/.pnpm/@effected+lockfiles@0.4.
|
|
5620
|
+
//#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
|
|
5621
5621
|
/**
|
|
5622
5622
|
* The lockfile formats this package parses: bun's `bun.lock` (JSONC), npm's
|
|
5623
5623
|
* `package-lock.json` (v2/v3 JSON), pnpm's `pnpm-lock.yaml` and yarn Berry's
|
|
@@ -5655,7 +5655,7 @@ const FILENAMES = {
|
|
|
5655
5655
|
*/
|
|
5656
5656
|
const filenameFor = (format) => FILENAMES[format][0];
|
|
5657
5657
|
//#endregion
|
|
5658
|
-
//#region ../../node_modules/.pnpm/@effected+lockfiles@0.4.
|
|
5658
|
+
//#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
|
|
5659
5659
|
/**
|
|
5660
5660
|
* The four dependency sections of a manifest, in a stable order — the shared
|
|
5661
5661
|
* dependency-sections table (v3's `DEP_SECTIONS`). Each entry is both the
|
|
@@ -7584,7 +7584,7 @@ var JsoncModifier = class {
|
|
|
7584
7584
|
});
|
|
7585
7585
|
};
|
|
7586
7586
|
//#endregion
|
|
7587
|
-
//#region ../../node_modules/.pnpm/@effected+lockfiles@0.4.
|
|
7587
|
+
//#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
|
|
7588
7588
|
const DepRecord$2 = effect.Schema.optionalKey(effect.Schema.Record(effect.Schema.String, effect.Schema.String));
|
|
7589
7589
|
const BunWorkspaceEntry = effect.Schema.Struct({
|
|
7590
7590
|
name: effect.Schema.optionalKey(effect.Schema.String),
|
|
@@ -7677,7 +7677,7 @@ const toFields$3 = (raw) => effect.Effect.gen(function* () {
|
|
|
7677
7677
|
};
|
|
7678
7678
|
});
|
|
7679
7679
|
//#endregion
|
|
7680
|
-
//#region ../../node_modules/.pnpm/@effected+lockfiles@0.4.
|
|
7680
|
+
//#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
|
|
7681
7681
|
const DepRecord$1 = effect.Schema.optionalKey(effect.Schema.Record(effect.Schema.String, effect.Schema.String));
|
|
7682
7682
|
const NpmPackageEntry = effect.Schema.Struct({
|
|
7683
7683
|
name: effect.Schema.optionalKey(effect.Schema.String),
|
|
@@ -7775,7 +7775,7 @@ const toFields$2 = (raw) => effect.Effect.gen(function* () {
|
|
|
7775
7775
|
};
|
|
7776
7776
|
});
|
|
7777
7777
|
//#endregion
|
|
7778
|
-
//#region ../../node_modules/.pnpm/@effected+yaml@0.
|
|
7778
|
+
//#region ../../node_modules/.pnpm/@effected+yaml@0.8.0_effect@4.0.0-beta.107/node_modules/@effected/yaml/YamlNode.js
|
|
7779
7779
|
/**
|
|
7780
7780
|
* YAML scalar presentation styles.
|
|
7781
7781
|
*
|
|
@@ -7824,9 +7824,17 @@ const ScalarChomp = effect.Schema.Literals([
|
|
|
7824
7824
|
* - `style` — the scalar presentation style in the source document.
|
|
7825
7825
|
* - `tag` — optional explicit YAML tag (e.g. `!!str`, `!!int`).
|
|
7826
7826
|
* - `anchor` — optional anchor name for aliasing.
|
|
7827
|
-
* - `
|
|
7827
|
+
* - `commentBefore` — own-line comment text directly above the node
|
|
7828
|
+
* (multiple consecutive comment lines join with `\n`).
|
|
7829
|
+
* - `comment` — trailing comment text on the node's line (strictly trailing;
|
|
7830
|
+
* own-line comments live on `commentBefore`).
|
|
7831
|
+
* - `spaceBefore` — `true` when a blank line precedes the node (and its
|
|
7832
|
+
* `commentBefore` block, when present) in the source.
|
|
7828
7833
|
* - `chomp` — block-scalar chomping indicator, when the scalar is a block
|
|
7829
7834
|
* scalar.
|
|
7835
|
+
* - `blockIndent` — the EXPLICIT indentation-indicator digit from a block
|
|
7836
|
+
* scalar's header (`|2`, `>1+`), when the source spelled one; absent when
|
|
7837
|
+
* the header let the reader auto-detect the indent.
|
|
7830
7838
|
* - `raw` — the raw source text, preserved when it differs from the resolved
|
|
7831
7839
|
* value in a way stringification needs to know about.
|
|
7832
7840
|
* - `sourceMultiline` — `true` when the source span covers two or more lines;
|
|
@@ -7840,8 +7848,11 @@ var YamlScalar = class extends effect.Schema.TaggedClass()("YamlScalar", {
|
|
|
7840
7848
|
tag: effect.Schema.optionalKey(effect.Schema.String),
|
|
7841
7849
|
style: ScalarStyle,
|
|
7842
7850
|
anchor: effect.Schema.optionalKey(effect.Schema.String),
|
|
7851
|
+
commentBefore: effect.Schema.optionalKey(effect.Schema.String),
|
|
7843
7852
|
comment: effect.Schema.optionalKey(effect.Schema.String),
|
|
7853
|
+
spaceBefore: effect.Schema.optionalKey(effect.Schema.Boolean),
|
|
7844
7854
|
chomp: effect.Schema.optionalKey(ScalarChomp),
|
|
7855
|
+
blockIndent: effect.Schema.optionalKey(effect.Schema.Number),
|
|
7845
7856
|
raw: effect.Schema.optionalKey(effect.Schema.String),
|
|
7846
7857
|
sourceMultiline: effect.Schema.optionalKey(effect.Schema.Boolean),
|
|
7847
7858
|
offset: effect.Schema.Number,
|
|
@@ -7932,18 +7943,31 @@ const YamlNode = effect.Schema.suspend(() => effect.Schema.Union([
|
|
|
7932
7943
|
* A YAML key-value pair AST node, representing one entry within a mapping.
|
|
7933
7944
|
* `value` is `null` when absent (e.g. `key:` with no value).
|
|
7934
7945
|
*
|
|
7946
|
+
* - `commentBefore` — own-line comment text directly above the pair's key
|
|
7947
|
+
* (multiple consecutive comment lines join with `\n`).
|
|
7948
|
+
* - `comment` — trailing comment text on the pair's line (strictly trailing).
|
|
7949
|
+
* - `spaceBefore` — `true` when a blank line precedes the pair (and its
|
|
7950
|
+
* `commentBefore` block, when present) in the source.
|
|
7951
|
+
*
|
|
7935
7952
|
* @public
|
|
7936
7953
|
*/
|
|
7937
7954
|
var YamlPair = class extends effect.Schema.TaggedClass()("YamlPair", {
|
|
7938
7955
|
key: effect.Schema.suspend(() => YamlNode),
|
|
7939
7956
|
value: effect.Schema.NullOr(effect.Schema.suspend(() => YamlNode)),
|
|
7940
|
-
|
|
7957
|
+
commentBefore: effect.Schema.optionalKey(effect.Schema.String),
|
|
7958
|
+
comment: effect.Schema.optionalKey(effect.Schema.String),
|
|
7959
|
+
spaceBefore: effect.Schema.optionalKey(effect.Schema.Boolean)
|
|
7941
7960
|
}) {};
|
|
7942
7961
|
/**
|
|
7943
7962
|
* A YAML mapping AST node, representing a collection of {@link YamlPair}
|
|
7944
7963
|
* entries.
|
|
7945
7964
|
*
|
|
7946
7965
|
* - `style` — the presentation style: `"block"` or `"flow"`.
|
|
7966
|
+
* - `commentBefore` — own-line comment text directly above the mapping.
|
|
7967
|
+
* - `comment` — trailing comment text: own-line comment lines after the
|
|
7968
|
+
* mapping's last entry (still at the mapping's item indent), or a same-line
|
|
7969
|
+
* trailing comment for a flow mapping.
|
|
7970
|
+
* - `spaceBefore` — `true` when a blank line precedes the mapping.
|
|
7947
7971
|
* - `sourceMultiline` — `true` when the source span covers two or more lines;
|
|
7948
7972
|
* used by the canonical stringifier. Absent on synthetic nodes.
|
|
7949
7973
|
*
|
|
@@ -7954,7 +7978,9 @@ var YamlMap = class extends effect.Schema.TaggedClass()("YamlMap", {
|
|
|
7954
7978
|
tag: effect.Schema.optionalKey(effect.Schema.String),
|
|
7955
7979
|
anchor: effect.Schema.optionalKey(effect.Schema.String),
|
|
7956
7980
|
style: CollectionStyle,
|
|
7981
|
+
commentBefore: effect.Schema.optionalKey(effect.Schema.String),
|
|
7957
7982
|
comment: effect.Schema.optionalKey(effect.Schema.String),
|
|
7983
|
+
spaceBefore: effect.Schema.optionalKey(effect.Schema.Boolean),
|
|
7958
7984
|
sourceMultiline: effect.Schema.optionalKey(effect.Schema.Boolean),
|
|
7959
7985
|
offset: effect.Schema.Number,
|
|
7960
7986
|
length: effect.Schema.Number
|
|
@@ -7980,6 +8006,12 @@ var YamlMap = class extends effect.Schema.TaggedClass()("YamlMap", {
|
|
|
7980
8006
|
* A YAML sequence AST node, representing an ordered list of
|
|
7981
8007
|
* {@link (YamlNode:type)} values.
|
|
7982
8008
|
*
|
|
8009
|
+
* - `commentBefore` — own-line comment text directly above the sequence.
|
|
8010
|
+
* - `comment` — trailing comment text: own-line comment lines after the
|
|
8011
|
+
* sequence's last item (still at the sequence's item indent), or a
|
|
8012
|
+
* same-line trailing comment for a flow sequence.
|
|
8013
|
+
* - `spaceBefore` — `true` when a blank line precedes the sequence.
|
|
8014
|
+
*
|
|
7983
8015
|
* @public
|
|
7984
8016
|
*/
|
|
7985
8017
|
var YamlSeq = class extends effect.Schema.TaggedClass()("YamlSeq", {
|
|
@@ -7987,7 +8019,9 @@ var YamlSeq = class extends effect.Schema.TaggedClass()("YamlSeq", {
|
|
|
7987
8019
|
tag: effect.Schema.optionalKey(effect.Schema.String),
|
|
7988
8020
|
anchor: effect.Schema.optionalKey(effect.Schema.String),
|
|
7989
8021
|
style: CollectionStyle,
|
|
8022
|
+
commentBefore: effect.Schema.optionalKey(effect.Schema.String),
|
|
7990
8023
|
comment: effect.Schema.optionalKey(effect.Schema.String),
|
|
8024
|
+
spaceBefore: effect.Schema.optionalKey(effect.Schema.Boolean),
|
|
7991
8025
|
sourceMultiline: effect.Schema.optionalKey(effect.Schema.Boolean),
|
|
7992
8026
|
offset: effect.Schema.Number,
|
|
7993
8027
|
length: effect.Schema.Number
|
|
@@ -8177,7 +8211,7 @@ function nodeToValue(node, anchors, budget, counting = false) {
|
|
|
8177
8211
|
return null;
|
|
8178
8212
|
}
|
|
8179
8213
|
//#endregion
|
|
8180
|
-
//#region ../../node_modules/.pnpm/@effected+yaml@0.
|
|
8214
|
+
//#region ../../node_modules/.pnpm/@effected+yaml@0.8.0_effect@4.0.0-beta.107/node_modules/@effected/yaml/internal/diagnostics.js
|
|
8181
8215
|
/** Error codes emitted by the lexer stage. */
|
|
8182
8216
|
const YAML_LEX_ERROR_CODES = [
|
|
8183
8217
|
"UnexpectedCharacter",
|
|
@@ -8222,14 +8256,23 @@ const YAML_COMPOSE_ERROR_CODES = [
|
|
|
8222
8256
|
*/
|
|
8223
8257
|
const YAML_STRINGIFY_ERROR_CODES = ["CircularReference"];
|
|
8224
8258
|
/**
|
|
8225
|
-
* Error codes for the modify stage (`YamlFormat.modify`'s path
|
|
8226
|
-
* against an already-composed AST). Not raised by the
|
|
8259
|
+
* Error codes for the modify stage (`YamlFormat.modify`'s guards and path
|
|
8260
|
+
* navigation against an already-composed AST). Not raised by the
|
|
8261
|
+
* parser/composer. `MultiDocumentStream` is the single-document-contract
|
|
8262
|
+
* refusal: `modify` re-emits exactly one document, so a multi-document
|
|
8263
|
+
* stream fails typed rather than silently truncating documents 2..n.
|
|
8264
|
+
* `DirectiveCarryingDocument` is the directive refusal: the stringifier does
|
|
8265
|
+
* not re-emit `%YAML`/`%TAG` directive lines, and re-emitting a document
|
|
8266
|
+
* without its `%TAG` orphans every shorthand tag that depends on it — the
|
|
8267
|
+
* output would be unparseable — so modify fails typed rather than corrupting.
|
|
8227
8268
|
*/
|
|
8228
8269
|
const YAML_MODIFY_ERROR_CODES = [
|
|
8229
8270
|
"EmptyDocument",
|
|
8230
8271
|
"PathNotFound",
|
|
8231
8272
|
"InvalidIndex",
|
|
8232
|
-
"NotNavigable"
|
|
8273
|
+
"NotNavigable",
|
|
8274
|
+
"MultiDocumentStream",
|
|
8275
|
+
"DirectiveCarryingDocument"
|
|
8233
8276
|
];
|
|
8234
8277
|
/**
|
|
8235
8278
|
* The single source of truth for which diagnostic codes are fatal to a
|
|
@@ -8255,7 +8298,7 @@ function isFatalCode(code) {
|
|
|
8255
8298
|
return FATAL_CODES.has(code);
|
|
8256
8299
|
}
|
|
8257
8300
|
//#endregion
|
|
8258
|
-
//#region ../../node_modules/.pnpm/@effected+yaml@0.
|
|
8301
|
+
//#region ../../node_modules/.pnpm/@effected+yaml@0.8.0_effect@4.0.0-beta.107/node_modules/@effected/yaml/YamlDiagnostic.js
|
|
8259
8302
|
/**
|
|
8260
8303
|
* Error codes emitted by the lexer stage.
|
|
8261
8304
|
*
|
|
@@ -8376,100 +8419,7 @@ function lineChar(text, offset) {
|
|
|
8376
8419
|
};
|
|
8377
8420
|
}
|
|
8378
8421
|
//#endregion
|
|
8379
|
-
//#region ../../node_modules/.pnpm/@effected+yaml@0.
|
|
8380
|
-
/**
|
|
8381
|
-
* Check if a pending anchor is being applied to an alias node (invalid in YAML 1.2 §3.2.2).
|
|
8382
|
-
* Aliases represent references to existing anchored nodes and cannot have their own anchors.
|
|
8383
|
-
*
|
|
8384
|
-
* Uses `DuplicateAnchor` error code as a pragmatic reuse — semantically this is
|
|
8385
|
-
* "anchor on alias" rather than "same anchor name defined twice", but adding a
|
|
8386
|
-
* dedicated `AnchorOnAlias` code would be a public API change. The error message
|
|
8387
|
-
* distinguishes the two cases for consumers inspecting the message text.
|
|
8388
|
-
*/
|
|
8389
|
-
function checkAnchorOnAlias(pendingMeta, cst, state) {
|
|
8390
|
-
if (pendingMeta.anchor !== void 0) state.errors.push({
|
|
8391
|
-
code: "DuplicateAnchor",
|
|
8392
|
-
message: `Anchor &${pendingMeta.anchor} cannot be applied to alias *${getAliasName(cst, state.text)}`,
|
|
8393
|
-
offset: cst.offset,
|
|
8394
|
-
length: cst.length
|
|
8395
|
-
});
|
|
8396
|
-
}
|
|
8397
|
-
function makeAlias(cst, state) {
|
|
8398
|
-
const name = getAliasName(cst, state.text);
|
|
8399
|
-
if (!state.anchors.has(name)) state.errors.push({
|
|
8400
|
-
code: "UndefinedAlias",
|
|
8401
|
-
message: `Undefined alias: *${name}`,
|
|
8402
|
-
offset: cst.offset,
|
|
8403
|
-
length: cst.length
|
|
8404
|
-
});
|
|
8405
|
-
else {
|
|
8406
|
-
state.aliasCount++;
|
|
8407
|
-
if (state.aliasCount > state.options.maxAliasCount) state.errors.push({
|
|
8408
|
-
code: "AliasCountExceeded",
|
|
8409
|
-
message: `Alias count exceeded maximum of ${state.options.maxAliasCount}`,
|
|
8410
|
-
offset: cst.offset,
|
|
8411
|
-
length: cst.length
|
|
8412
|
-
});
|
|
8413
|
-
}
|
|
8414
|
-
return new YamlAlias({
|
|
8415
|
-
name,
|
|
8416
|
-
offset: cst.offset,
|
|
8417
|
-
length: cst.length
|
|
8418
|
-
});
|
|
8419
|
-
}
|
|
8420
|
-
function registerAnchor(node, anchor, state, offset) {
|
|
8421
|
-
if (state.anchors.has(anchor)) state.warnings.push({
|
|
8422
|
-
code: "DuplicateAnchor",
|
|
8423
|
-
message: `Duplicate anchor: &${anchor}`,
|
|
8424
|
-
offset,
|
|
8425
|
-
length: anchor.length + 1
|
|
8426
|
-
});
|
|
8427
|
-
state.anchors.set(anchor, node);
|
|
8428
|
-
}
|
|
8429
|
-
function getAnchorName(cst, text) {
|
|
8430
|
-
if (text[cst.offset] === "&") return scanName(text, cst.offset + 1);
|
|
8431
|
-
return cst.source;
|
|
8432
|
-
}
|
|
8433
|
-
function getAliasName(cst, text) {
|
|
8434
|
-
if (text[cst.offset] === "*") return scanName(text, cst.offset + 1);
|
|
8435
|
-
return cst.source;
|
|
8436
|
-
}
|
|
8437
|
-
function scanName(text, start) {
|
|
8438
|
-
let end = start;
|
|
8439
|
-
while (end < text.length) {
|
|
8440
|
-
const ch = text[end];
|
|
8441
|
-
if (ch === " " || ch === " " || ch === "\n" || ch === "\r" || ch === "{" || ch === "}" || ch === "[" || ch === "]" || ch === "," || ch === void 0) break;
|
|
8442
|
-
end++;
|
|
8443
|
-
}
|
|
8444
|
-
return text.slice(start, end);
|
|
8445
|
-
}
|
|
8446
|
-
/**
|
|
8447
|
-
* Build an anchor map by walking the AST, collecting nodes that have anchors.
|
|
8448
|
-
* Used to resolve aliases when extracting plain JavaScript values from
|
|
8449
|
-
* parsed YAML documents.
|
|
8450
|
-
*/
|
|
8451
|
-
function buildAnchorMap(node) {
|
|
8452
|
-
const anchors = /* @__PURE__ */ new Map();
|
|
8453
|
-
collectAnchors(node, anchors);
|
|
8454
|
-
return anchors;
|
|
8455
|
-
}
|
|
8456
|
-
function collectAnchors(node, anchors) {
|
|
8457
|
-
if (node === null) return;
|
|
8458
|
-
if (node instanceof YamlScalar) {
|
|
8459
|
-
if (node.anchor !== void 0) anchors.set(node.anchor, node);
|
|
8460
|
-
} else if (node instanceof YamlMap) {
|
|
8461
|
-
if (node.anchor !== void 0) anchors.set(node.anchor, node);
|
|
8462
|
-
for (const pair of node.items) {
|
|
8463
|
-
collectAnchors(pair.key, anchors);
|
|
8464
|
-
collectAnchors(pair.value, anchors);
|
|
8465
|
-
}
|
|
8466
|
-
} else if (node instanceof YamlSeq) {
|
|
8467
|
-
if (node.anchor !== void 0) anchors.set(node.anchor, node);
|
|
8468
|
-
for (const item of node.items) collectAnchors(item, anchors);
|
|
8469
|
-
}
|
|
8470
|
-
}
|
|
8471
|
-
//#endregion
|
|
8472
|
-
//#region ../../node_modules/.pnpm/@effected+yaml@0.7.0_effect@4.0.0-beta.107/node_modules/@effected/yaml/internal/lexer.js
|
|
8422
|
+
//#region ../../node_modules/.pnpm/@effected+yaml@0.8.0_effect@4.0.0-beta.107/node_modules/@effected/yaml/internal/lexer.js
|
|
8473
8423
|
/**
|
|
8474
8424
|
* Create a new YAML scanner for the given source text.
|
|
8475
8425
|
*
|
|
@@ -9432,7 +9382,7 @@ function lexAll(text) {
|
|
|
9432
9382
|
return tokens;
|
|
9433
9383
|
}
|
|
9434
9384
|
//#endregion
|
|
9435
|
-
//#region ../../node_modules/.pnpm/@effected+yaml@0.
|
|
9385
|
+
//#region ../../node_modules/.pnpm/@effected+yaml@0.8.0_effect@4.0.0-beta.107/node_modules/@effected/yaml/internal/cst-parser.js
|
|
9436
9386
|
/**
|
|
9437
9387
|
* Hardening: cap CST nesting so hostile inputs cannot overflow the stack
|
|
9438
9388
|
* while the tree is being BUILT. Set slightly above the composer's
|
|
@@ -9797,7 +9747,8 @@ function parseBlockValue(state, parentIndent, explicitKey = false) {
|
|
|
9797
9747
|
const token = peek(state);
|
|
9798
9748
|
if (!token) break;
|
|
9799
9749
|
if (token.kind === "whitespace") {
|
|
9800
|
-
|
|
9750
|
+
advance(state);
|
|
9751
|
+
nodes.push(makeLeafNode("whitespace", token, state.text));
|
|
9801
9752
|
continue;
|
|
9802
9753
|
}
|
|
9803
9754
|
if (token.kind === "newline") break;
|
|
@@ -10152,7 +10103,258 @@ function parseCSTAll(text) {
|
|
|
10152
10103
|
return parseDocuments(lexAll(text), text);
|
|
10153
10104
|
}
|
|
10154
10105
|
//#endregion
|
|
10155
|
-
//#region ../../node_modules/.pnpm/@effected+yaml@0.
|
|
10106
|
+
//#region ../../node_modules/.pnpm/@effected+yaml@0.8.0_effect@4.0.0-beta.107/node_modules/@effected/yaml/internal/composer/anchors.js
|
|
10107
|
+
/**
|
|
10108
|
+
* Check if a pending anchor is being applied to an alias node (invalid in YAML 1.2 §3.2.2).
|
|
10109
|
+
* Aliases represent references to existing anchored nodes and cannot have their own anchors.
|
|
10110
|
+
*
|
|
10111
|
+
* Uses `DuplicateAnchor` error code as a pragmatic reuse — semantically this is
|
|
10112
|
+
* "anchor on alias" rather than "same anchor name defined twice", but adding a
|
|
10113
|
+
* dedicated `AnchorOnAlias` code would be a public API change. The error message
|
|
10114
|
+
* distinguishes the two cases for consumers inspecting the message text.
|
|
10115
|
+
*/
|
|
10116
|
+
function checkAnchorOnAlias(pendingMeta, cst, state) {
|
|
10117
|
+
if (pendingMeta.anchor !== void 0) state.errors.push({
|
|
10118
|
+
code: "DuplicateAnchor",
|
|
10119
|
+
message: `Anchor &${pendingMeta.anchor} cannot be applied to alias *${getAliasName(cst, state.text)}`,
|
|
10120
|
+
offset: cst.offset,
|
|
10121
|
+
length: cst.length
|
|
10122
|
+
});
|
|
10123
|
+
}
|
|
10124
|
+
function makeAlias(cst, state) {
|
|
10125
|
+
const name = getAliasName(cst, state.text);
|
|
10126
|
+
if (!state.anchors.has(name)) state.errors.push({
|
|
10127
|
+
code: "UndefinedAlias",
|
|
10128
|
+
message: `Undefined alias: *${name}`,
|
|
10129
|
+
offset: cst.offset,
|
|
10130
|
+
length: cst.length
|
|
10131
|
+
});
|
|
10132
|
+
else {
|
|
10133
|
+
state.aliasCount++;
|
|
10134
|
+
if (state.aliasCount > state.options.maxAliasCount) state.errors.push({
|
|
10135
|
+
code: "AliasCountExceeded",
|
|
10136
|
+
message: `Alias count exceeded maximum of ${state.options.maxAliasCount}`,
|
|
10137
|
+
offset: cst.offset,
|
|
10138
|
+
length: cst.length
|
|
10139
|
+
});
|
|
10140
|
+
}
|
|
10141
|
+
return new YamlAlias({
|
|
10142
|
+
name,
|
|
10143
|
+
offset: cst.offset,
|
|
10144
|
+
length: cst.length
|
|
10145
|
+
});
|
|
10146
|
+
}
|
|
10147
|
+
function registerAnchor(node, anchor, state, offset) {
|
|
10148
|
+
if (state.anchors.has(anchor)) state.warnings.push({
|
|
10149
|
+
code: "DuplicateAnchor",
|
|
10150
|
+
message: `Duplicate anchor: &${anchor}`,
|
|
10151
|
+
offset,
|
|
10152
|
+
length: anchor.length + 1
|
|
10153
|
+
});
|
|
10154
|
+
state.anchors.set(anchor, node);
|
|
10155
|
+
}
|
|
10156
|
+
function getAnchorName(cst, text) {
|
|
10157
|
+
if (text[cst.offset] === "&") return scanName(text, cst.offset + 1);
|
|
10158
|
+
return cst.source;
|
|
10159
|
+
}
|
|
10160
|
+
function getAliasName(cst, text) {
|
|
10161
|
+
if (text[cst.offset] === "*") return scanName(text, cst.offset + 1);
|
|
10162
|
+
return cst.source;
|
|
10163
|
+
}
|
|
10164
|
+
function scanName(text, start) {
|
|
10165
|
+
let end = start;
|
|
10166
|
+
while (end < text.length) {
|
|
10167
|
+
const ch = text[end];
|
|
10168
|
+
if (ch === " " || ch === " " || ch === "\n" || ch === "\r" || ch === "{" || ch === "}" || ch === "[" || ch === "]" || ch === "," || ch === void 0) break;
|
|
10169
|
+
end++;
|
|
10170
|
+
}
|
|
10171
|
+
return text.slice(start, end);
|
|
10172
|
+
}
|
|
10173
|
+
//#endregion
|
|
10174
|
+
//#region ../../node_modules/.pnpm/@effected+yaml@0.8.0_effect@4.0.0-beta.107/node_modules/@effected/yaml/internal/composer/comments.js
|
|
10175
|
+
/** True when there is no line break between `start` and `end` in `text`. */
|
|
10176
|
+
function sameLineSpan(text, start, end) {
|
|
10177
|
+
if (start < 0) return false;
|
|
10178
|
+
return !text.slice(Math.max(0, start), Math.max(0, end)).includes("\n");
|
|
10179
|
+
}
|
|
10180
|
+
/**
|
|
10181
|
+
* True when only horizontal whitespace precedes `offset` on its line — i.e.
|
|
10182
|
+
* the token at `offset` starts its own line. Purely local, so it stays
|
|
10183
|
+
* correct even when a preceding node's span over-extends past line ends.
|
|
10184
|
+
*/
|
|
10185
|
+
function isOwnLineAt(text, offset) {
|
|
10186
|
+
let i = offset - 1;
|
|
10187
|
+
while (i >= 0) {
|
|
10188
|
+
const ch = text[i];
|
|
10189
|
+
if (ch === " " || ch === " ") {
|
|
10190
|
+
i--;
|
|
10191
|
+
continue;
|
|
10192
|
+
}
|
|
10193
|
+
return ch === "\n" || ch === "\r";
|
|
10194
|
+
}
|
|
10195
|
+
return true;
|
|
10196
|
+
}
|
|
10197
|
+
/**
|
|
10198
|
+
* True when the line immediately above the line containing `offset` is blank
|
|
10199
|
+
* (empty or horizontal whitespace only). Purely local — see
|
|
10200
|
+
* {@link isOwnLineAt} for why span-based gap checks are not used.
|
|
10201
|
+
*/
|
|
10202
|
+
function hasBlankLineAbove(text, offset) {
|
|
10203
|
+
return blankLineAboveStart(text, offset) >= 0;
|
|
10204
|
+
}
|
|
10205
|
+
/**
|
|
10206
|
+
* Start offset of the blank line immediately above the line containing
|
|
10207
|
+
* `offset`, or `-1` when that line is not blank. The offset form of
|
|
10208
|
+
* {@link hasBlankLineAbove}, for callers that must locate the blank line
|
|
10209
|
+
* (e.g. to test whether it falls inside a preceding scalar token's span).
|
|
10210
|
+
*/
|
|
10211
|
+
function blankLineAboveStart(text, offset) {
|
|
10212
|
+
const lineBreak = text.lastIndexOf("\n", Math.max(0, offset - 1));
|
|
10213
|
+
if (lineBreak < 0) return -1;
|
|
10214
|
+
const prevBreak = text.lastIndexOf("\n", lineBreak - 1);
|
|
10215
|
+
return text.slice(prevBreak + 1, lineBreak).trim() === "" ? prevBreak + 1 : -1;
|
|
10216
|
+
}
|
|
10217
|
+
/**
|
|
10218
|
+
* The deepest trailing scalar reached by descending last-child edges from
|
|
10219
|
+
* `node` (a map's last pair's value, a seq's last item) — the node whose
|
|
10220
|
+
* token span a textually-following blank line could fall inside.
|
|
10221
|
+
*/
|
|
10222
|
+
function deepestTrailingScalar(node) {
|
|
10223
|
+
let current = node;
|
|
10224
|
+
for (;;) {
|
|
10225
|
+
if (current instanceof YamlScalar) return current;
|
|
10226
|
+
if (current instanceof YamlMap) {
|
|
10227
|
+
const last = current.items[current.items.length - 1];
|
|
10228
|
+
if (last === void 0) return void 0;
|
|
10229
|
+
current = last.value ?? last.key;
|
|
10230
|
+
continue;
|
|
10231
|
+
}
|
|
10232
|
+
if (current instanceof YamlSeq) {
|
|
10233
|
+
const last = current.items[current.items.length - 1];
|
|
10234
|
+
if (last === void 0) return void 0;
|
|
10235
|
+
current = last;
|
|
10236
|
+
continue;
|
|
10237
|
+
}
|
|
10238
|
+
return;
|
|
10239
|
+
}
|
|
10240
|
+
}
|
|
10241
|
+
/**
|
|
10242
|
+
* True when the blank line immediately above `offset` is CONTENT of the
|
|
10243
|
+
* preceding keep-chomp block scalar, not a stylistic blank. Under `+`
|
|
10244
|
+
* chomping the trailing line breaks are part of the scalar's VALUE (the
|
|
10245
|
+
* composer already stores them there), so recording the same blank line as
|
|
10246
|
+
* `spaceBefore` (or a leading-blank embed on a terminal comment run) would
|
|
10247
|
+
* double-count it: emission renders both the kept newline and the stylistic
|
|
10248
|
+
* blank, growing the document on every format pass. Clip/strip scalars are
|
|
10249
|
+
* deliberately NOT excluded — their emission drops the trailing blank from
|
|
10250
|
+
* the value, so the `spaceBefore` capture is exactly what re-creates it.
|
|
10251
|
+
*
|
|
10252
|
+
* `prev` is the last composed node before `offset` (a pair's value, a seq
|
|
10253
|
+
* item); the check descends to its deepest trailing scalar and requires the
|
|
10254
|
+
* blank line to start inside that scalar's token span.
|
|
10255
|
+
*/
|
|
10256
|
+
function blankAboveIsKeepChompContent(text, offset, prev) {
|
|
10257
|
+
if (prev === void 0) return false;
|
|
10258
|
+
const scalar = deepestTrailingScalar(prev);
|
|
10259
|
+
if (scalar === void 0 || scalar.chomp !== "keep") return false;
|
|
10260
|
+
if (scalar.style !== "block-literal" && scalar.style !== "block-folded") return false;
|
|
10261
|
+
const start = blankLineAboveStart(text, offset);
|
|
10262
|
+
return start >= scalar.offset && start < scalar.offset + scalar.length;
|
|
10263
|
+
}
|
|
10264
|
+
/**
|
|
10265
|
+
* True when the line immediately below the line containing `offset` is blank
|
|
10266
|
+
* (empty or horizontal whitespace only) AND is itself followed by another
|
|
10267
|
+
* line. Purely local, the mirror of {@link hasBlankLineAbove} — used to embed
|
|
10268
|
+
* a blank line AFTER a comment run as a trailing empty line in the stored
|
|
10269
|
+
* comment string.
|
|
10270
|
+
*/
|
|
10271
|
+
function hasBlankLineBelow(text, offset) {
|
|
10272
|
+
const lineEnd = text.indexOf("\n", Math.max(0, offset));
|
|
10273
|
+
if (lineEnd < 0) return false;
|
|
10274
|
+
const nextEnd = text.indexOf("\n", lineEnd + 1);
|
|
10275
|
+
if (nextEnd < 0) return false;
|
|
10276
|
+
return text.slice(lineEnd + 1, nextEnd).trim() === "";
|
|
10277
|
+
}
|
|
10278
|
+
/**
|
|
10279
|
+
* The stored text of a comment token: the RAW post-`#` slice, reference
|
|
10280
|
+
* parity with the `yaml` npm package — `# section` stores `" section"`,
|
|
10281
|
+
* `#no-space` stores `"no-space"`, `# aligned` keeps its alignment.
|
|
10282
|
+
*
|
|
10283
|
+
* The one reserved string is `""`, which encodes an embedded blank line
|
|
10284
|
+
* inside a joined comment run — so a spaces-only raw slice stores with ONE
|
|
10285
|
+
* extra trailing space and the renderers strip it back off. A bare `#`
|
|
10286
|
+
* (raw `""`) stores `" "`, `# ` (raw `" "`) stores `" "`, and so on; the
|
|
10287
|
+
* escape is injective, so every comment spelling roundtrips byte-intact.
|
|
10288
|
+
* Raw storage is what makes byte-intact roundtrip possible; trimming would
|
|
10289
|
+
* canonicalize every comment to `# text`.
|
|
10290
|
+
*/
|
|
10291
|
+
function rawCommentText(source) {
|
|
10292
|
+
const raw = source.startsWith("#") ? source.slice(1) : source;
|
|
10293
|
+
return /^ *$/.test(raw) ? `${raw} ` : raw;
|
|
10294
|
+
}
|
|
10295
|
+
/** Join two optional comment blocks with a newline. */
|
|
10296
|
+
function joinComments(a, b) {
|
|
10297
|
+
return a === void 0 ? b : `${a}\n${b}`;
|
|
10298
|
+
}
|
|
10299
|
+
/** Zero-based column of `offset` within its line. */
|
|
10300
|
+
function columnAt(text, offset) {
|
|
10301
|
+
if (offset <= 0) return 0;
|
|
10302
|
+
return offset - (text.lastIndexOf("\n", offset - 1) + 1);
|
|
10303
|
+
}
|
|
10304
|
+
/**
|
|
10305
|
+
* Rebuild `node` with the given comment fields merged in (existing fields are
|
|
10306
|
+
* kept unless overridden; `commentBefore`/`comment` join with a newline when
|
|
10307
|
+
* both sides are present). Aliases are returned unchanged — they carry no
|
|
10308
|
+
* comment fields.
|
|
10309
|
+
*/
|
|
10310
|
+
function withCommentFields(node, fields) {
|
|
10311
|
+
if (node instanceof YamlScalar) return new YamlScalar({
|
|
10312
|
+
value: node.value,
|
|
10313
|
+
style: node.style,
|
|
10314
|
+
...node.tag !== void 0 ? { tag: node.tag } : {},
|
|
10315
|
+
...node.anchor !== void 0 ? { anchor: node.anchor } : {},
|
|
10316
|
+
...mergedCommentFields(node, fields),
|
|
10317
|
+
...node.chomp !== void 0 ? { chomp: node.chomp } : {},
|
|
10318
|
+
...node.blockIndent !== void 0 ? { blockIndent: node.blockIndent } : {},
|
|
10319
|
+
...node.raw !== void 0 ? { raw: node.raw } : {},
|
|
10320
|
+
...node.sourceMultiline !== void 0 ? { sourceMultiline: node.sourceMultiline } : {},
|
|
10321
|
+
offset: node.offset,
|
|
10322
|
+
length: node.length
|
|
10323
|
+
});
|
|
10324
|
+
if (node instanceof YamlMap) return new YamlMap({
|
|
10325
|
+
items: node.items,
|
|
10326
|
+
style: node.style,
|
|
10327
|
+
...node.tag !== void 0 ? { tag: node.tag } : {},
|
|
10328
|
+
...node.anchor !== void 0 ? { anchor: node.anchor } : {},
|
|
10329
|
+
...mergedCommentFields(node, fields),
|
|
10330
|
+
...node.sourceMultiline !== void 0 ? { sourceMultiline: node.sourceMultiline } : {},
|
|
10331
|
+
offset: node.offset,
|
|
10332
|
+
length: node.length
|
|
10333
|
+
});
|
|
10334
|
+
if (node instanceof YamlSeq) return new YamlSeq({
|
|
10335
|
+
items: node.items,
|
|
10336
|
+
style: node.style,
|
|
10337
|
+
...node.tag !== void 0 ? { tag: node.tag } : {},
|
|
10338
|
+
...node.anchor !== void 0 ? { anchor: node.anchor } : {},
|
|
10339
|
+
...mergedCommentFields(node, fields),
|
|
10340
|
+
...node.sourceMultiline !== void 0 ? { sourceMultiline: node.sourceMultiline } : {},
|
|
10341
|
+
offset: node.offset,
|
|
10342
|
+
length: node.length
|
|
10343
|
+
});
|
|
10344
|
+
return node;
|
|
10345
|
+
}
|
|
10346
|
+
function mergedCommentFields(existing, incoming) {
|
|
10347
|
+
const commentBefore = incoming.commentBefore !== void 0 ? existing.commentBefore !== void 0 ? `${existing.commentBefore}\n${incoming.commentBefore}` : incoming.commentBefore : existing.commentBefore;
|
|
10348
|
+
const comment = incoming.comment !== void 0 ? existing.comment !== void 0 ? `${existing.comment}\n${incoming.comment}` : incoming.comment : existing.comment;
|
|
10349
|
+
const spaceBefore = incoming.spaceBefore ?? existing.spaceBefore;
|
|
10350
|
+
return {
|
|
10351
|
+
...commentBefore !== void 0 ? { commentBefore } : {},
|
|
10352
|
+
...comment !== void 0 ? { comment } : {},
|
|
10353
|
+
...spaceBefore !== void 0 ? { spaceBefore } : {}
|
|
10354
|
+
};
|
|
10355
|
+
}
|
|
10356
|
+
//#endregion
|
|
10357
|
+
//#region ../../node_modules/.pnpm/@effected+yaml@0.8.0_effect@4.0.0-beta.107/node_modules/@effected/yaml/internal/composer/state.js
|
|
10156
10358
|
let lineStartsText;
|
|
10157
10359
|
let lineStartsCache = [];
|
|
10158
10360
|
function getLineStarts(text) {
|
|
@@ -10217,6 +10419,19 @@ function clearMeta(m) {
|
|
|
10217
10419
|
delete m.tag;
|
|
10218
10420
|
delete m.comment;
|
|
10219
10421
|
}
|
|
10422
|
+
/**
|
|
10423
|
+
* The comment-fidelity field triple carried by the four public node classes
|
|
10424
|
+
* (and `YamlPair`). Conditional-spread helper so AST rebuild sites copy all
|
|
10425
|
+
* three without hand-maintaining the list — and never emit an explicit
|
|
10426
|
+
* `undefined` into a v4 `optionalKey` field.
|
|
10427
|
+
*/
|
|
10428
|
+
function commentProps(n) {
|
|
10429
|
+
return {
|
|
10430
|
+
...n.commentBefore !== void 0 ? { commentBefore: n.commentBefore } : {},
|
|
10431
|
+
...n.comment !== void 0 ? { comment: n.comment } : {},
|
|
10432
|
+
...n.spaceBefore !== void 0 ? { spaceBefore: n.spaceBefore } : {}
|
|
10433
|
+
};
|
|
10434
|
+
}
|
|
10220
10435
|
function createState(text, flow, options) {
|
|
10221
10436
|
return {
|
|
10222
10437
|
text,
|
|
@@ -10231,7 +10446,8 @@ function createState(text, flow, options) {
|
|
|
10231
10446
|
},
|
|
10232
10447
|
tagMap: /* @__PURE__ */ new Map(),
|
|
10233
10448
|
flow,
|
|
10234
|
-
depth: 0
|
|
10449
|
+
depth: 0,
|
|
10450
|
+
escapedComments: []
|
|
10235
10451
|
};
|
|
10236
10452
|
}
|
|
10237
10453
|
/**
|
|
@@ -10258,7 +10474,7 @@ function exitNesting(state) {
|
|
|
10258
10474
|
state.depth--;
|
|
10259
10475
|
}
|
|
10260
10476
|
//#endregion
|
|
10261
|
-
//#region ../../node_modules/.pnpm/@effected+yaml@0.
|
|
10477
|
+
//#region ../../node_modules/.pnpm/@effected+yaml@0.8.0_effect@4.0.0-beta.107/node_modules/@effected/yaml/internal/composer/tags.js
|
|
10262
10478
|
/**
|
|
10263
10479
|
* Resolve a tag shorthand using the document's %TAG directives.
|
|
10264
10480
|
* For example, with `%TAG !! tag:example.com,2000:app/`, the tag `!!int`
|
|
@@ -10344,7 +10560,7 @@ function validateTagHandlesInDocument(docCst, state) {
|
|
|
10344
10560
|
}
|
|
10345
10561
|
}
|
|
10346
10562
|
//#endregion
|
|
10347
|
-
//#region ../../node_modules/.pnpm/@effected+yaml@0.
|
|
10563
|
+
//#region ../../node_modules/.pnpm/@effected+yaml@0.8.0_effect@4.0.0-beta.107/node_modules/@effected/yaml/internal/composer/scalars.js
|
|
10348
10564
|
const NULL_RE$1 = /^(?:null|Null|NULL|~)$/;
|
|
10349
10565
|
const TRUE_RE$1 = /^(?:true|True|TRUE)$/;
|
|
10350
10566
|
const FALSE_RE$1 = /^(?:false|False|FALSE)$/;
|
|
@@ -10439,13 +10655,42 @@ function getScalarStyle(node) {
|
|
|
10439
10655
|
*/
|
|
10440
10656
|
function getBlockChomp(node) {
|
|
10441
10657
|
if (node.type !== "block-scalar") return void 0;
|
|
10442
|
-
const
|
|
10443
|
-
|
|
10444
|
-
|
|
10445
|
-
if (header.includes("+")) return "keep";
|
|
10446
|
-
if (header.includes("-")) return "strip";
|
|
10658
|
+
const indicators = node.source.trimStart().match(/^[|>]([0-9+-]*)/)?.[1] ?? "";
|
|
10659
|
+
if (indicators.includes("+")) return "keep";
|
|
10660
|
+
if (indicators.includes("-")) return "strip";
|
|
10447
10661
|
return "clip";
|
|
10448
10662
|
}
|
|
10663
|
+
/**
|
|
10664
|
+
* Extracts the EXPLICIT indentation-indicator digit from a block scalar's
|
|
10665
|
+
* header (`|2`, `>1+`), or undefined when the header carries none (the
|
|
10666
|
+
* reader auto-detects) or the node is not a block scalar. Inspects only the
|
|
10667
|
+
* indicator run — see {@link getBlockChomp} for why the rest of the header
|
|
10668
|
+
* line (a comment can contain digits) must not be read.
|
|
10669
|
+
*/
|
|
10670
|
+
function getBlockIndent(node) {
|
|
10671
|
+
if (node.type !== "block-scalar") return void 0;
|
|
10672
|
+
const digit = (node.source.trimStart().match(/^[|>]([0-9+-]*)/)?.[1] ?? "").match(/[1-9]/)?.[0];
|
|
10673
|
+
return digit === void 0 ? void 0 : Number(digit);
|
|
10674
|
+
}
|
|
10675
|
+
/**
|
|
10676
|
+
* The trailing comment on a block scalar's HEADER line (`key: | # c`,
|
|
10677
|
+
* `- >-2 # c`) as stored raw-slice text, or `undefined` when the header
|
|
10678
|
+
* carries none. The header is the only line of a block scalar that can carry
|
|
10679
|
+
* a `#` comment — body lines absorb `#` as content — and the lexer packs the
|
|
10680
|
+
* whole scalar (header comment included) into one CST token, so the comment
|
|
10681
|
+
* never surfaces as a sibling comment token for the ordinary attribution
|
|
10682
|
+
* pass (#341).
|
|
10683
|
+
*/
|
|
10684
|
+
function blockScalarHeaderComment(cst) {
|
|
10685
|
+
const src = cst.source.trimStart();
|
|
10686
|
+
const nl = src.search(/[\r\n]/);
|
|
10687
|
+
const header = nl < 0 ? src : src.slice(0, nl);
|
|
10688
|
+
const hash = header.indexOf("#");
|
|
10689
|
+
if (hash < 1) return void 0;
|
|
10690
|
+
const before = header[hash - 1];
|
|
10691
|
+
if (before !== " " && before !== " ") return void 0;
|
|
10692
|
+
return rawCommentText(header.slice(hash));
|
|
10693
|
+
}
|
|
10449
10694
|
function getScalarValue(node, fullText) {
|
|
10450
10695
|
if (node.type === "block-scalar") return decodeBlockScalar(node.source, fullText, node.offset);
|
|
10451
10696
|
const style = getScalarStyle(node);
|
|
@@ -11131,18 +11376,22 @@ function decodeBlockScalar(raw, fullText, nodeOffset) {
|
|
|
11131
11376
|
}
|
|
11132
11377
|
if (hadContent || trailingNewlines.length > 0) {
|
|
11133
11378
|
if (chomp === "keep") {
|
|
11134
|
-
result += "\n";
|
|
11379
|
+
if (hadContent) result += "\n";
|
|
11135
11380
|
for (const _nl of trailingNewlines) result += "\n";
|
|
11136
|
-
} else if (chomp !== "strip")
|
|
11381
|
+
} else if (chomp !== "strip") {
|
|
11382
|
+
if (hadContent) result += "\n";
|
|
11383
|
+
}
|
|
11137
11384
|
}
|
|
11138
11385
|
value = result;
|
|
11139
11386
|
} else {
|
|
11140
11387
|
value = lines.join("\n");
|
|
11141
11388
|
if (lines.length > 0 || trailingNewlines.length > 0) {
|
|
11142
11389
|
if (chomp === "keep") {
|
|
11143
|
-
value += "\n";
|
|
11390
|
+
if (lines.length > 0) value += "\n";
|
|
11144
11391
|
for (const _nl of trailingNewlines) value += "\n";
|
|
11145
|
-
} else if (chomp !== "strip")
|
|
11392
|
+
} else if (chomp !== "strip") {
|
|
11393
|
+
if (lines.length > 0) value += "\n";
|
|
11394
|
+
}
|
|
11146
11395
|
}
|
|
11147
11396
|
}
|
|
11148
11397
|
return value;
|
|
@@ -11201,6 +11450,8 @@ function makeScalar(cst, state, meta) {
|
|
|
11201
11450
|
const rawValue = getScalarValue(cst, state.text);
|
|
11202
11451
|
const value = resolveScalar(rawValue, style, meta?.tag, state);
|
|
11203
11452
|
const chomp = getBlockChomp(cst);
|
|
11453
|
+
const blockIndent = getBlockIndent(cst);
|
|
11454
|
+
const comment = (style === "block-literal" || style === "block-folded" ? blockScalarHeaderComment(cst) : void 0) ?? meta?.comment;
|
|
11204
11455
|
const needsRaw = style === "plain" && typeof value !== "string" && value !== void 0 && shouldPreserveRaw(rawValue, value);
|
|
11205
11456
|
const scalar = new YamlScalar({
|
|
11206
11457
|
value,
|
|
@@ -11209,8 +11460,9 @@ function makeScalar(cst, state, meta) {
|
|
|
11209
11460
|
length: cst.length,
|
|
11210
11461
|
...meta?.tag !== void 0 ? { tag: meta.tag } : {},
|
|
11211
11462
|
...meta?.anchor !== void 0 ? { anchor: meta.anchor } : {},
|
|
11212
|
-
...
|
|
11463
|
+
...comment !== void 0 ? { comment } : {},
|
|
11213
11464
|
...chomp !== void 0 ? { chomp } : {},
|
|
11465
|
+
...blockIndent !== void 0 ? { blockIndent } : {},
|
|
11214
11466
|
...needsRaw ? { raw: rawValue } : {}
|
|
11215
11467
|
});
|
|
11216
11468
|
if (meta?.anchor) registerAnchor(scalar, meta.anchor, state, cst.offset);
|
|
@@ -11234,7 +11486,7 @@ function shouldPreserveRaw(rawValue, value) {
|
|
|
11234
11486
|
return false;
|
|
11235
11487
|
}
|
|
11236
11488
|
//#endregion
|
|
11237
|
-
//#region ../../node_modules/.pnpm/@effected+yaml@0.
|
|
11489
|
+
//#region ../../node_modules/.pnpm/@effected+yaml@0.8.0_effect@4.0.0-beta.107/node_modules/@effected/yaml/internal/composer/block.js
|
|
11238
11490
|
/**
|
|
11239
11491
|
* Compose a block map from its CST children, with an optional external first key.
|
|
11240
11492
|
*
|
|
@@ -11266,18 +11518,20 @@ function composeBlockMapInner(blockMapCst, state, externalFirstKey, meta) {
|
|
|
11266
11518
|
kind: "key",
|
|
11267
11519
|
node: externalFirstKey
|
|
11268
11520
|
});
|
|
11269
|
-
buildPairs(items, pairs, state.text);
|
|
11521
|
+
const trailingComment = buildPairs(items, pairs, state.text, state.escapedComments);
|
|
11270
11522
|
if (state.options.uniqueKeys) checkDuplicateKeys(pairs, state);
|
|
11271
11523
|
checkMultilineImplicitKeys(pairs, state);
|
|
11272
11524
|
const offset = externalFirstKey ? "offset" in externalFirstKey ? externalFirstKey.offset : blockMapCst.offset : blockMapCst.offset;
|
|
11525
|
+
const length = blockMapCst.offset + blockMapCst.length - offset;
|
|
11526
|
+
const mapComment = meta?.comment !== void 0 ? trailingComment !== void 0 ? `${meta.comment}\n${trailingComment}` : meta.comment : trailingComment;
|
|
11273
11527
|
const map = new YamlMap({
|
|
11274
11528
|
items: pairs,
|
|
11275
11529
|
style: "block",
|
|
11276
11530
|
offset,
|
|
11277
|
-
length
|
|
11531
|
+
length,
|
|
11278
11532
|
...meta?.tag !== void 0 ? { tag: meta.tag } : {},
|
|
11279
11533
|
...meta?.anchor !== void 0 ? { anchor: meta.anchor } : {},
|
|
11280
|
-
...
|
|
11534
|
+
...mapComment !== void 0 ? { comment: mapComment } : {}
|
|
11281
11535
|
});
|
|
11282
11536
|
if (meta?.anchor) registerAnchor(map, meta.anchor, state, offset);
|
|
11283
11537
|
return map;
|
|
@@ -11334,6 +11588,14 @@ function flattenBlockMapChildren(children, state, externalKeyColumn, externalKey
|
|
|
11334
11588
|
kind: "node",
|
|
11335
11589
|
node
|
|
11336
11590
|
});
|
|
11591
|
+
if (state.escapedComments.length > 0) {
|
|
11592
|
+
for (const ec of state.escapedComments) items.push({
|
|
11593
|
+
kind: "comment",
|
|
11594
|
+
comment: ec.text,
|
|
11595
|
+
offset: ec.offset
|
|
11596
|
+
});
|
|
11597
|
+
state.escapedComments.length = 0;
|
|
11598
|
+
}
|
|
11337
11599
|
afterValueSep = false;
|
|
11338
11600
|
}
|
|
11339
11601
|
for (let i = 0; i < children.length; i++) {
|
|
@@ -11362,7 +11624,7 @@ function flattenBlockMapChildren(children, state, externalKeyColumn, externalKey
|
|
|
11362
11624
|
const sliceChildren = children.slice(i + 1, lookahead.endIdx);
|
|
11363
11625
|
const innerItems = flattenBlockMapChildren(sliceChildren, state);
|
|
11364
11626
|
const innerPairs = [];
|
|
11365
|
-
buildPairs(innerItems, innerPairs, state.text);
|
|
11627
|
+
const innerTrailing = buildPairs(innerItems, innerPairs, state.text);
|
|
11366
11628
|
const firstC = findFirstContent(sliceChildren);
|
|
11367
11629
|
const lastC = findLastContent(sliceChildren);
|
|
11368
11630
|
const innerOffset = firstC ? firstC.offset : child.offset;
|
|
@@ -11370,7 +11632,8 @@ function flattenBlockMapChildren(children, state, externalKeyColumn, externalKey
|
|
|
11370
11632
|
items: innerPairs,
|
|
11371
11633
|
style: "block",
|
|
11372
11634
|
offset: innerOffset,
|
|
11373
|
-
length: (lastC ? lastC.offset + lastC.length : child.offset + child.length) - innerOffset
|
|
11635
|
+
length: (lastC ? lastC.offset + lastC.length : child.offset + child.length) - innerOffset,
|
|
11636
|
+
...innerTrailing !== void 0 ? { comment: innerTrailing } : {}
|
|
11374
11637
|
}), innerOffset);
|
|
11375
11638
|
i = lookahead.endIdx - 1;
|
|
11376
11639
|
continue;
|
|
@@ -11415,10 +11678,10 @@ function flattenBlockMapChildren(children, state, externalKeyColumn, externalKey
|
|
|
11415
11678
|
continue;
|
|
11416
11679
|
}
|
|
11417
11680
|
if (child.type === "comment") {
|
|
11418
|
-
const text = child.source.startsWith("#") ? child.source.slice(1).trim() : child.source;
|
|
11419
11681
|
items.push({
|
|
11420
11682
|
kind: "comment",
|
|
11421
|
-
comment:
|
|
11683
|
+
comment: rawCommentText(child.source),
|
|
11684
|
+
offset: child.offset
|
|
11422
11685
|
});
|
|
11423
11686
|
continue;
|
|
11424
11687
|
}
|
|
@@ -11703,9 +11966,51 @@ function flattenBlockMapChildren(children, state, externalKeyColumn, externalKey
|
|
|
11703
11966
|
* Pattern: node, value-sep, node produces a key:value pair.
|
|
11704
11967
|
* Pattern: node, value-sep (no node) produces a key:null pair.
|
|
11705
11968
|
* Pattern: value-sep, node produces a null:value pair.
|
|
11969
|
+
*
|
|
11970
|
+
* Comment attribution (#127): a comment on the same line as the end of the
|
|
11971
|
+
* previous pair attaches to it as the trailing `comment`; an own-line
|
|
11972
|
+
* comment attaches FORWARD to the next pair as `commentBefore` (consecutive
|
|
11973
|
+
* lines join with `\n`); a blank line before a pair (or before its
|
|
11974
|
+
* `commentBefore` block) sets `spaceBefore`. Own-line comments left over
|
|
11975
|
+
* after the last pair are returned so the caller can attach them as the
|
|
11976
|
+
* containing collection's trailing `comment`.
|
|
11706
11977
|
*/
|
|
11707
|
-
function buildPairs(items, pairs, text) {
|
|
11978
|
+
function buildPairs(items, pairs, text, escaped) {
|
|
11708
11979
|
let i = 0;
|
|
11980
|
+
let pending = [];
|
|
11981
|
+
let pendingSpace = false;
|
|
11982
|
+
let lastEnd = -1;
|
|
11983
|
+
let lastNode;
|
|
11984
|
+
let contentColumn = -1;
|
|
11985
|
+
const nodeEnd = (n) => n.offset + n.length;
|
|
11986
|
+
const noteContentColumn = (offset) => {
|
|
11987
|
+
if (contentColumn < 0 && offset >= 0) contentColumn = columnAt(text, offset);
|
|
11988
|
+
};
|
|
11989
|
+
/** Join pending parts: `\n` between lines, an extra `\n` per embedded blank. */
|
|
11990
|
+
const joinPending = (parts) => {
|
|
11991
|
+
if (parts.length === 0) return void 0;
|
|
11992
|
+
let out = parts[0].text;
|
|
11993
|
+
for (let k = 1; k < parts.length; k++) {
|
|
11994
|
+
const part = parts[k];
|
|
11995
|
+
out += part.blankAbove ? `\n\n${part.text}` : `\n${part.text}`;
|
|
11996
|
+
}
|
|
11997
|
+
return out;
|
|
11998
|
+
};
|
|
11999
|
+
/** The pending comment fields for the pair being constructed, then reset. */
|
|
12000
|
+
const takePendingFields = (anchorOffset) => {
|
|
12001
|
+
let commentBefore = joinPending(pending);
|
|
12002
|
+
if (anchorOffset >= 0 && hasBlankLineAbove(text, anchorOffset)) {
|
|
12003
|
+
if (commentBefore !== void 0) commentBefore = `${commentBefore}\n`;
|
|
12004
|
+
else if (!pendingSpace && lastEnd >= 0 && !blankAboveIsKeepChompContent(text, anchorOffset, lastNode)) pendingSpace = true;
|
|
12005
|
+
}
|
|
12006
|
+
const fields = {
|
|
12007
|
+
...commentBefore !== void 0 ? { commentBefore } : {},
|
|
12008
|
+
...pendingSpace ? { spaceBefore: true } : {}
|
|
12009
|
+
};
|
|
12010
|
+
pending = [];
|
|
12011
|
+
pendingSpace = false;
|
|
12012
|
+
return fields;
|
|
12013
|
+
};
|
|
11709
12014
|
while (i < items.length) {
|
|
11710
12015
|
const item = items[i];
|
|
11711
12016
|
if (!item) {
|
|
@@ -11713,12 +12018,24 @@ function buildPairs(items, pairs, text) {
|
|
|
11713
12018
|
continue;
|
|
11714
12019
|
}
|
|
11715
12020
|
if (item.kind === "comment") {
|
|
11716
|
-
|
|
12021
|
+
const cOff = item.offset ?? -1;
|
|
12022
|
+
const cText = item.comment ?? "";
|
|
12023
|
+
if (!(cOff < 0 ? true : isOwnLineAt(text, cOff)) && pairs.length > 0) {
|
|
11717
12024
|
const last = pairs[pairs.length - 1];
|
|
11718
12025
|
if (last) pairs[pairs.length - 1] = new YamlPair({
|
|
11719
12026
|
key: last.key,
|
|
11720
12027
|
value: last.value,
|
|
11721
|
-
...
|
|
12028
|
+
...last.commentBefore !== void 0 ? { commentBefore: last.commentBefore } : {},
|
|
12029
|
+
comment: last.comment !== void 0 ? `${last.comment}\n${cText}` : cText,
|
|
12030
|
+
...last.spaceBefore !== void 0 ? { spaceBefore: last.spaceBefore } : {}
|
|
12031
|
+
});
|
|
12032
|
+
} else {
|
|
12033
|
+
const blankAbove = cOff >= 0 && hasBlankLineAbove(text, cOff) && !blankAboveIsKeepChompContent(text, cOff, lastNode);
|
|
12034
|
+
if (blankAbove && pending.length === 0 && lastEnd >= 0) pendingSpace = true;
|
|
12035
|
+
pending.push({
|
|
12036
|
+
text: cText,
|
|
12037
|
+
offset: cOff,
|
|
12038
|
+
blankAbove: blankAbove && pending.length > 0
|
|
11722
12039
|
});
|
|
11723
12040
|
}
|
|
11724
12041
|
i++;
|
|
@@ -11727,30 +12044,32 @@ function buildPairs(items, pairs, text) {
|
|
|
11727
12044
|
if (item.kind === "value-sep") {
|
|
11728
12045
|
const valueSepOffset = item.offset ?? 0;
|
|
11729
12046
|
i++;
|
|
12047
|
+
const pendingFields = takePendingFields(valueSepOffset);
|
|
12048
|
+
noteContentColumn(valueSepOffset);
|
|
11730
12049
|
const valueNode = consumeValueNodeForNullKey(items, i, text, valueSepOffset);
|
|
12050
|
+
const nullKey = new YamlScalar({
|
|
12051
|
+
value: null,
|
|
12052
|
+
style: "plain",
|
|
12053
|
+
offset: valueSepOffset,
|
|
12054
|
+
length: 0
|
|
12055
|
+
});
|
|
11731
12056
|
if (valueNode) {
|
|
11732
|
-
const nullKey = new YamlScalar({
|
|
11733
|
-
value: null,
|
|
11734
|
-
style: "plain",
|
|
11735
|
-
offset: valueSepOffset,
|
|
11736
|
-
length: 0
|
|
11737
|
-
});
|
|
11738
12057
|
pairs.push(new YamlPair({
|
|
11739
12058
|
key: nullKey,
|
|
11740
|
-
value: valueNode.node ?? null
|
|
12059
|
+
value: valueNode.node ?? null,
|
|
12060
|
+
...pendingFields
|
|
11741
12061
|
}));
|
|
11742
12062
|
i = valueNode.nextIdx;
|
|
12063
|
+
lastEnd = valueNode.node ? nodeEnd(valueNode.node) : valueSepOffset + 1;
|
|
12064
|
+
lastNode = valueNode.node ?? void 0;
|
|
11743
12065
|
} else {
|
|
11744
|
-
const nullKey = new YamlScalar({
|
|
11745
|
-
value: null,
|
|
11746
|
-
style: "plain",
|
|
11747
|
-
offset: valueSepOffset,
|
|
11748
|
-
length: 0
|
|
11749
|
-
});
|
|
11750
12066
|
pairs.push(new YamlPair({
|
|
11751
12067
|
key: nullKey,
|
|
11752
|
-
value: null
|
|
12068
|
+
value: null,
|
|
12069
|
+
...pendingFields
|
|
11753
12070
|
}));
|
|
12071
|
+
lastEnd = valueSepOffset + 1;
|
|
12072
|
+
lastNode = void 0;
|
|
11754
12073
|
}
|
|
11755
12074
|
continue;
|
|
11756
12075
|
}
|
|
@@ -11764,62 +12083,109 @@ function buildPairs(items, pairs, text) {
|
|
|
11764
12083
|
i++;
|
|
11765
12084
|
}
|
|
11766
12085
|
}
|
|
11767
|
-
|
|
12086
|
+
if (keyNode) noteContentColumn(keyNode.offset);
|
|
12087
|
+
const pendingFields = takePendingFields(keyNode ? keyNode.offset : -1);
|
|
12088
|
+
let pairTrailing;
|
|
12089
|
+
while (i < items.length && items[i]?.kind === "comment") {
|
|
12090
|
+
const c = items[i]?.comment;
|
|
12091
|
+
if (c !== void 0) pairTrailing = joinComments(pairTrailing, c);
|
|
12092
|
+
i++;
|
|
12093
|
+
}
|
|
12094
|
+
const keyOrNull = () => keyNode ?? new YamlScalar({
|
|
12095
|
+
value: null,
|
|
12096
|
+
style: "plain",
|
|
12097
|
+
offset: 0,
|
|
12098
|
+
length: 0
|
|
12099
|
+
});
|
|
11768
12100
|
if (i < items.length && items[i]?.kind === "value-sep") {
|
|
12101
|
+
const sepOffset = items[i]?.offset ?? (keyNode ? nodeEnd(keyNode) : 0);
|
|
11769
12102
|
i++;
|
|
11770
|
-
const valueResult = consumeValueNode(items, i);
|
|
12103
|
+
const valueResult = consumeValueNode(items, i, text, sepOffset);
|
|
11771
12104
|
if (valueResult) {
|
|
12105
|
+
for (const c of valueResult.sameLineComments) pairTrailing = joinComments(pairTrailing, c);
|
|
12106
|
+
let valNode = valueResult.node;
|
|
12107
|
+
if (valNode !== null && valueResult.leadingComments.length > 0) valNode = withCommentFields(valNode, { commentBefore: valueResult.leadingComments.join("\n") });
|
|
11772
12108
|
pairs.push(new YamlPair({
|
|
11773
|
-
key:
|
|
11774
|
-
|
|
11775
|
-
|
|
11776
|
-
|
|
11777
|
-
length: 0
|
|
11778
|
-
}),
|
|
11779
|
-
value: valueResult.node ?? null
|
|
12109
|
+
key: keyOrNull(),
|
|
12110
|
+
value: valNode,
|
|
12111
|
+
...pendingFields,
|
|
12112
|
+
...pairTrailing !== void 0 ? { comment: pairTrailing } : {}
|
|
11780
12113
|
}));
|
|
11781
12114
|
i = valueResult.nextIdx;
|
|
11782
|
-
|
|
11783
|
-
|
|
12115
|
+
lastEnd = valNode ? nodeEnd(valNode) : sepOffset + 1;
|
|
12116
|
+
lastNode = valNode ?? void 0;
|
|
12117
|
+
} else {
|
|
12118
|
+
pairs.push(new YamlPair({
|
|
12119
|
+
key: keyOrNull(),
|
|
11784
12120
|
value: null,
|
|
11785
|
-
|
|
11786
|
-
|
|
11787
|
-
|
|
11788
|
-
|
|
11789
|
-
|
|
11790
|
-
}
|
|
11791
|
-
} else
|
|
11792
|
-
|
|
12121
|
+
...pendingFields,
|
|
12122
|
+
...pairTrailing !== void 0 ? { comment: pairTrailing } : {}
|
|
12123
|
+
}));
|
|
12124
|
+
lastEnd = sepOffset + 1;
|
|
12125
|
+
lastNode = void 0;
|
|
12126
|
+
}
|
|
12127
|
+
} else {
|
|
12128
|
+
pairs.push(new YamlPair({
|
|
12129
|
+
key: keyOrNull(),
|
|
11793
12130
|
value: null,
|
|
11794
|
-
|
|
11795
|
-
|
|
11796
|
-
|
|
11797
|
-
|
|
11798
|
-
|
|
11799
|
-
}
|
|
12131
|
+
...pendingFields,
|
|
12132
|
+
...pairTrailing !== void 0 ? { comment: pairTrailing } : {}
|
|
12133
|
+
}));
|
|
12134
|
+
lastEnd = keyNode ? nodeEnd(keyNode) : lastEnd;
|
|
12135
|
+
if (keyNode) lastNode = keyNode;
|
|
12136
|
+
}
|
|
11800
12137
|
continue;
|
|
11801
12138
|
}
|
|
11802
12139
|
i++;
|
|
11803
12140
|
}
|
|
12141
|
+
if (pending.length === 0) return void 0;
|
|
12142
|
+
const withLeadingBlank = (parts) => {
|
|
12143
|
+
const joined = joinPending(parts);
|
|
12144
|
+
const first = parts[0];
|
|
12145
|
+
return joined !== void 0 && first !== void 0 && lastEnd >= 0 && first.offset >= 0 && hasBlankLineAbove(text, first.offset) && !blankAboveIsKeepChompContent(text, first.offset, lastNode) ? `\n${joined}` : joined;
|
|
12146
|
+
};
|
|
12147
|
+
if (escaped !== void 0 && contentColumn > 0) {
|
|
12148
|
+
const kept = [];
|
|
12149
|
+
for (const part of pending) if (part.offset >= 0 && columnAt(text, part.offset) < contentColumn) escaped.push({
|
|
12150
|
+
text: part.text,
|
|
12151
|
+
offset: part.offset
|
|
12152
|
+
});
|
|
12153
|
+
else kept.push(part);
|
|
12154
|
+
return withLeadingBlank(kept);
|
|
12155
|
+
}
|
|
12156
|
+
return withLeadingBlank(pending);
|
|
11804
12157
|
}
|
|
11805
|
-
function consumeValueNode(items, startIdx) {
|
|
12158
|
+
function consumeValueNode(items, startIdx, text, sepOffset) {
|
|
12159
|
+
let peek = startIdx;
|
|
12160
|
+
while (peek < items.length && items[peek]?.kind === "comment") peek++;
|
|
12161
|
+
const candidate = peek < items.length ? items[peek] : void 0;
|
|
12162
|
+
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;
|
|
11806
12163
|
let i = startIdx;
|
|
12164
|
+
const sameLineComments = [];
|
|
12165
|
+
const leadingComments = [];
|
|
11807
12166
|
while (i < items.length) {
|
|
11808
12167
|
const item = items[i];
|
|
11809
12168
|
if (!item) break;
|
|
11810
12169
|
if (item.kind === "comment") {
|
|
12170
|
+
const cText = item.comment ?? "";
|
|
12171
|
+
if (item.offset !== void 0 && sameLineSpan(text, sepOffset, item.offset)) sameLineComments.push(cText);
|
|
12172
|
+
else leadingComments.push(cText);
|
|
11811
12173
|
i++;
|
|
11812
12174
|
continue;
|
|
11813
12175
|
}
|
|
11814
12176
|
if (item.kind === "node") return {
|
|
11815
12177
|
node: item.node ?? null,
|
|
11816
|
-
nextIdx: i + 1
|
|
12178
|
+
nextIdx: i + 1,
|
|
12179
|
+
sameLineComments,
|
|
12180
|
+
leadingComments
|
|
11817
12181
|
};
|
|
11818
12182
|
break;
|
|
11819
12183
|
}
|
|
11820
12184
|
return i > startIdx ? {
|
|
11821
12185
|
node: null,
|
|
11822
|
-
nextIdx: i
|
|
12186
|
+
nextIdx: i,
|
|
12187
|
+
sameLineComments,
|
|
12188
|
+
leadingComments
|
|
11823
12189
|
} : null;
|
|
11824
12190
|
}
|
|
11825
12191
|
/**
|
|
@@ -12173,11 +12539,59 @@ function composeBlockSeq(cst, state, meta) {
|
|
|
12173
12539
|
}
|
|
12174
12540
|
function composeBlockSeqInner(cst, state, meta) {
|
|
12175
12541
|
const children = cst.children ?? [];
|
|
12176
|
-
const
|
|
12542
|
+
const rawItems = [];
|
|
12177
12543
|
let pendingMeta = {};
|
|
12178
12544
|
let sawEntry = false;
|
|
12179
12545
|
const seqIndent = lineIndentColumn(state.text, cst.offset);
|
|
12180
12546
|
let sawNewlineSincePending = false;
|
|
12547
|
+
let pending = [];
|
|
12548
|
+
let pendingSpace = false;
|
|
12549
|
+
let lastItemEnd = -1;
|
|
12550
|
+
let lastItemNode;
|
|
12551
|
+
const joinPending = (parts) => {
|
|
12552
|
+
if (parts.length === 0) return void 0;
|
|
12553
|
+
let out = parts[0].text;
|
|
12554
|
+
for (let k = 1; k < parts.length; k++) {
|
|
12555
|
+
const part = parts[k];
|
|
12556
|
+
out += part.blankAbove ? `\n\n${part.text}` : `\n${part.text}`;
|
|
12557
|
+
}
|
|
12558
|
+
return out;
|
|
12559
|
+
};
|
|
12560
|
+
const acceptOwnLineComment = (cText, cOff) => {
|
|
12561
|
+
const blankAbove = cOff >= 0 && hasBlankLineAbove(state.text, cOff) && !blankAboveIsKeepChompContent(state.text, cOff, lastItemNode);
|
|
12562
|
+
if (blankAbove && pending.length === 0 && lastItemEnd >= 0) pendingSpace = true;
|
|
12563
|
+
pending.push({
|
|
12564
|
+
text: cText,
|
|
12565
|
+
offset: cOff,
|
|
12566
|
+
blankAbove: blankAbove && pending.length > 0
|
|
12567
|
+
});
|
|
12568
|
+
};
|
|
12569
|
+
const items = {
|
|
12570
|
+
get length() {
|
|
12571
|
+
return rawItems.length;
|
|
12572
|
+
},
|
|
12573
|
+
push(node) {
|
|
12574
|
+
let commentBefore = joinPending(pending);
|
|
12575
|
+
if (node.length > 0 && hasBlankLineAbove(state.text, node.offset)) {
|
|
12576
|
+
if (commentBefore !== void 0) commentBefore = `${commentBefore}\n`;
|
|
12577
|
+
else if (!pendingSpace && lastItemEnd >= 0 && !blankAboveIsKeepChompContent(state.text, node.offset, lastItemNode)) pendingSpace = true;
|
|
12578
|
+
}
|
|
12579
|
+
let decorated = node;
|
|
12580
|
+
if (commentBefore !== void 0 || pendingSpace) decorated = withCommentFields(node, {
|
|
12581
|
+
...commentBefore !== void 0 ? { commentBefore } : {},
|
|
12582
|
+
...pendingSpace ? { spaceBefore: true } : {}
|
|
12583
|
+
});
|
|
12584
|
+
pending = [];
|
|
12585
|
+
pendingSpace = false;
|
|
12586
|
+
rawItems.push(decorated);
|
|
12587
|
+
lastItemEnd = node.offset + node.length;
|
|
12588
|
+
lastItemNode = node;
|
|
12589
|
+
if (state.escapedComments.length > 0) {
|
|
12590
|
+
for (const ec of state.escapedComments) acceptOwnLineComment(ec.text, ec.offset);
|
|
12591
|
+
state.escapedComments.length = 0;
|
|
12592
|
+
}
|
|
12593
|
+
}
|
|
12594
|
+
};
|
|
12181
12595
|
for (let ci = 0; ci < children.length; ci++) {
|
|
12182
12596
|
const child = children[ci];
|
|
12183
12597
|
if (!child) continue;
|
|
@@ -12185,7 +12599,14 @@ function composeBlockSeqInner(cst, state, meta) {
|
|
|
12185
12599
|
if (hasMeta(pendingMeta)) sawNewlineSincePending = true;
|
|
12186
12600
|
continue;
|
|
12187
12601
|
}
|
|
12188
|
-
if (child.type === "comment")
|
|
12602
|
+
if (child.type === "comment") {
|
|
12603
|
+
const cText = rawCommentText(child.source);
|
|
12604
|
+
if (rawItems.length > 0 && !isOwnLineAt(state.text, child.offset)) {
|
|
12605
|
+
const prev = rawItems[rawItems.length - 1];
|
|
12606
|
+
if (prev) rawItems[rawItems.length - 1] = withCommentFields(prev, { comment: cText });
|
|
12607
|
+
} else acceptOwnLineComment(cText, child.offset);
|
|
12608
|
+
continue;
|
|
12609
|
+
}
|
|
12189
12610
|
if (child.type === "whitespace") {
|
|
12190
12611
|
if (child.source.trim() === "-") {
|
|
12191
12612
|
if (sawEntry) {
|
|
@@ -12342,14 +12763,32 @@ function composeBlockSeqInner(cst, state, meta) {
|
|
|
12342
12763
|
if (pendingMeta.anchor) registerAnchor(scalar, pendingMeta.anchor, state, 0);
|
|
12343
12764
|
items.push(scalar);
|
|
12344
12765
|
}
|
|
12766
|
+
const withLeadingBlank = (parts) => {
|
|
12767
|
+
const joined = joinPending(parts);
|
|
12768
|
+
const first = parts[0];
|
|
12769
|
+
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;
|
|
12770
|
+
};
|
|
12771
|
+
let seqTrailing;
|
|
12772
|
+
if (pending.length > 0) {
|
|
12773
|
+
if (seqIndent > 0) {
|
|
12774
|
+
const kept = [];
|
|
12775
|
+
for (const part of pending) if (part.offset >= 0 && columnAt(state.text, part.offset) < seqIndent) state.escapedComments.push({
|
|
12776
|
+
text: part.text,
|
|
12777
|
+
offset: part.offset
|
|
12778
|
+
});
|
|
12779
|
+
else kept.push(part);
|
|
12780
|
+
seqTrailing = withLeadingBlank(kept);
|
|
12781
|
+
} else seqTrailing = withLeadingBlank(pending);
|
|
12782
|
+
}
|
|
12783
|
+
const seqComment = meta?.comment !== void 0 ? seqTrailing !== void 0 ? `${meta.comment}\n${seqTrailing}` : meta.comment : seqTrailing;
|
|
12345
12784
|
const seq = new YamlSeq({
|
|
12346
|
-
items,
|
|
12785
|
+
items: rawItems,
|
|
12347
12786
|
style: "block",
|
|
12348
12787
|
offset: cst.offset,
|
|
12349
12788
|
length: cst.length,
|
|
12350
12789
|
...meta?.tag !== void 0 ? { tag: meta.tag } : {},
|
|
12351
12790
|
...meta?.anchor !== void 0 ? { anchor: meta.anchor } : {},
|
|
12352
|
-
...
|
|
12791
|
+
...seqComment !== void 0 ? { comment: seqComment } : {}
|
|
12353
12792
|
});
|
|
12354
12793
|
if (meta?.anchor) registerAnchor(seq, meta.anchor, state, cst.offset);
|
|
12355
12794
|
return seq;
|
|
@@ -12365,24 +12804,26 @@ function composeFlatBlockMap(children, startIdx, parentCst, state, externalFirst
|
|
|
12365
12804
|
node: externalFirstKey
|
|
12366
12805
|
});
|
|
12367
12806
|
const pairs = [];
|
|
12368
|
-
buildPairs(items, pairs, state.text);
|
|
12807
|
+
const trailingComment = buildPairs(items, pairs, state.text, state.escapedComments);
|
|
12369
12808
|
if (state.options.uniqueKeys) checkDuplicateKeys(pairs, state);
|
|
12370
12809
|
checkMultilineImplicitKeys(pairs, state);
|
|
12371
12810
|
const offset = "offset" in externalFirstKey ? externalFirstKey.offset : parentCst.offset;
|
|
12811
|
+
const end = parentCst.offset + parentCst.length;
|
|
12812
|
+
const mapComment = meta?.comment !== void 0 ? trailingComment !== void 0 ? `${meta.comment}\n${trailingComment}` : meta.comment : trailingComment;
|
|
12372
12813
|
const map = new YamlMap({
|
|
12373
12814
|
items: pairs,
|
|
12374
12815
|
style: "block",
|
|
12375
12816
|
offset,
|
|
12376
|
-
length:
|
|
12817
|
+
length: end - offset,
|
|
12377
12818
|
...meta?.tag !== void 0 ? { tag: meta.tag } : {},
|
|
12378
12819
|
...meta?.anchor !== void 0 ? { anchor: meta.anchor } : {},
|
|
12379
|
-
...
|
|
12820
|
+
...mapComment !== void 0 ? { comment: mapComment } : {}
|
|
12380
12821
|
});
|
|
12381
12822
|
if (meta?.anchor) registerAnchor(map, meta.anchor, state, offset);
|
|
12382
12823
|
return map;
|
|
12383
12824
|
}
|
|
12384
12825
|
//#endregion
|
|
12385
|
-
//#region ../../node_modules/.pnpm/@effected+yaml@0.
|
|
12826
|
+
//#region ../../node_modules/.pnpm/@effected+yaml@0.8.0_effect@4.0.0-beta.107/node_modules/@effected/yaml/internal/composer/flow.js
|
|
12386
12827
|
/**
|
|
12387
12828
|
* Validate that flow collection entries are separated by commas.
|
|
12388
12829
|
*
|
|
@@ -12494,8 +12935,9 @@ function composeFlowMapInner(cst, state, meta, parentBlockColumn) {
|
|
|
12494
12935
|
});
|
|
12495
12936
|
validateFlowContentIndent(cst, state, parentBlockColumn);
|
|
12496
12937
|
validateFlowSeparators(children, state, "{", "}");
|
|
12497
|
-
buildPairs(flattenFlowChildren(children.filter((c) => !(c.type === "whitespace" && (c.source === "{" || c.source === "}" || c.source.trim() === ""))), state), pairs, state.text);
|
|
12938
|
+
const trailingComment = buildPairs(flattenFlowChildren(children.filter((c) => !(c.type === "whitespace" && (c.source === "{" || c.source === "}" || c.source.trim() === ""))), state), pairs, state.text);
|
|
12498
12939
|
if (state.options.uniqueKeys) checkDuplicateKeys(pairs, state);
|
|
12940
|
+
const mapComment = meta?.comment !== void 0 ? trailingComment !== void 0 ? `${meta.comment}\n${trailingComment}` : meta.comment : trailingComment;
|
|
12499
12941
|
const map = new YamlMap({
|
|
12500
12942
|
items: pairs,
|
|
12501
12943
|
style: "flow",
|
|
@@ -12503,7 +12945,7 @@ function composeFlowMapInner(cst, state, meta, parentBlockColumn) {
|
|
|
12503
12945
|
length: cst.length,
|
|
12504
12946
|
...meta?.tag !== void 0 ? { tag: meta.tag } : {},
|
|
12505
12947
|
...meta?.anchor !== void 0 ? { anchor: meta.anchor } : {},
|
|
12506
|
-
...
|
|
12948
|
+
...mapComment !== void 0 ? { comment: mapComment } : {}
|
|
12507
12949
|
});
|
|
12508
12950
|
if (meta?.anchor) registerAnchor(map, meta.anchor, state, cst.offset);
|
|
12509
12951
|
return map;
|
|
@@ -12563,7 +13005,8 @@ function flattenFlowChildren(children, state) {
|
|
|
12563
13005
|
if (child.type === "comment") {
|
|
12564
13006
|
items.push({
|
|
12565
13007
|
kind: "comment",
|
|
12566
|
-
comment:
|
|
13008
|
+
comment: rawCommentText(child.source),
|
|
13009
|
+
offset: child.offset
|
|
12567
13010
|
});
|
|
12568
13011
|
continue;
|
|
12569
13012
|
}
|
|
@@ -12742,25 +13185,95 @@ function composeFlowSeqInner(cst, state, meta, parentBlockColumn) {
|
|
|
12742
13185
|
current.push(child);
|
|
12743
13186
|
}
|
|
12744
13187
|
if (current.length > 0) segments.push(current);
|
|
13188
|
+
let seqTrailing;
|
|
13189
|
+
let pending = [];
|
|
13190
|
+
let pendingSpace = false;
|
|
13191
|
+
let lastItemEnd = -1;
|
|
13192
|
+
let pushedIdx = -1;
|
|
13193
|
+
const joinPending = (parts) => {
|
|
13194
|
+
if (parts.length === 0) return void 0;
|
|
13195
|
+
let out = parts[0].text;
|
|
13196
|
+
for (let k = 1; k < parts.length; k++) {
|
|
13197
|
+
const part = parts[k];
|
|
13198
|
+
out += part.blankAbove ? `\n\n${part.text}` : `\n${part.text}`;
|
|
13199
|
+
}
|
|
13200
|
+
return out;
|
|
13201
|
+
};
|
|
13202
|
+
const blankIsBetweenItems = (anchorOffset) => blankLineAboveStart(state.text, anchorOffset) >= lastItemEnd;
|
|
13203
|
+
const acceptOwnLineComment = (cText, cOff) => {
|
|
13204
|
+
const blankAbove = cOff >= 0 && hasBlankLineAbove(state.text, cOff);
|
|
13205
|
+
if (blankAbove && pending.length === 0 && lastItemEnd >= 0 && blankIsBetweenItems(cOff)) pendingSpace = true;
|
|
13206
|
+
pending.push({
|
|
13207
|
+
text: cText,
|
|
13208
|
+
offset: cOff,
|
|
13209
|
+
blankAbove: blankAbove && pending.length > 0
|
|
13210
|
+
});
|
|
13211
|
+
};
|
|
13212
|
+
/** The pending comment fields for the item being pushed, then reset. */
|
|
13213
|
+
const takePendingFields = (anchorOffset) => {
|
|
13214
|
+
let commentBefore = joinPending(pending);
|
|
13215
|
+
if (anchorOffset >= 0 && hasBlankLineAbove(state.text, anchorOffset)) {
|
|
13216
|
+
if (commentBefore !== void 0) commentBefore = `${commentBefore}\n`;
|
|
13217
|
+
else if (!pendingSpace && lastItemEnd >= 0 && blankIsBetweenItems(anchorOffset)) pendingSpace = true;
|
|
13218
|
+
}
|
|
13219
|
+
const fields = {
|
|
13220
|
+
...commentBefore !== void 0 ? { commentBefore } : {},
|
|
13221
|
+
...pendingSpace ? { spaceBefore: true } : {}
|
|
13222
|
+
};
|
|
13223
|
+
pending = [];
|
|
13224
|
+
pendingSpace = false;
|
|
13225
|
+
return fields;
|
|
13226
|
+
};
|
|
13227
|
+
const hasPendingFields = (fields) => fields.commentBefore !== void 0 || fields.spaceBefore === true;
|
|
12745
13228
|
for (const segment of segments) if (segment.some((c) => c.type === "whitespace" && c.source === ":")) {
|
|
12746
|
-
const
|
|
13229
|
+
const content = segment.filter((c) => !(c.type === "whitespace" && c.source.trim() === ""));
|
|
13230
|
+
const semItems = flattenFlowChildren(content, state);
|
|
12747
13231
|
const pairs = [];
|
|
12748
|
-
buildPairs(semItems, pairs, state.text);
|
|
13232
|
+
const segTrailing = buildPairs(semItems, pairs, state.text);
|
|
12749
13233
|
if (!segment.some((c) => c.type === "whitespace" && c.source === "?")) checkMultilineImplicitKeys(pairs, state, semItems);
|
|
12750
13234
|
const firstPair = pairs[0];
|
|
12751
13235
|
if (firstPair) {
|
|
13236
|
+
const segFirst = content[0];
|
|
13237
|
+
const fields = takePendingFields(segFirst !== void 0 ? segFirst.offset : -1);
|
|
12752
13238
|
const map = new YamlMap({
|
|
12753
13239
|
items: pairs,
|
|
12754
13240
|
style: "flow",
|
|
12755
13241
|
offset: firstPair.key.offset,
|
|
12756
|
-
length: 0
|
|
13242
|
+
length: 0,
|
|
13243
|
+
...fields,
|
|
13244
|
+
...segTrailing !== void 0 ? { comment: segTrailing } : {}
|
|
12757
13245
|
});
|
|
12758
13246
|
items.push(map);
|
|
12759
|
-
|
|
13247
|
+
pushedIdx = items.length - 1;
|
|
13248
|
+
lastItemEnd = map.offset + map.length;
|
|
13249
|
+
} else if (segTrailing !== void 0) seqTrailing = joinComments(seqTrailing, segTrailing);
|
|
12760
13250
|
} else {
|
|
12761
13251
|
const semItems = flattenFlowChildren(segment.filter((c) => !(c.type === "whitespace" && c.source.trim() === "")), state);
|
|
12762
|
-
for (const si of semItems)
|
|
13252
|
+
for (const si of semItems) {
|
|
13253
|
+
if (si.kind === "comment") {
|
|
13254
|
+
const cText = si.comment ?? "";
|
|
13255
|
+
if (!(si.offset === void 0 ? true : isOwnLineAt(state.text, si.offset)) && pushedIdx >= 0) {
|
|
13256
|
+
const prev = items[pushedIdx];
|
|
13257
|
+
if (prev) items[pushedIdx] = withCommentFields(prev, { comment: cText });
|
|
13258
|
+
} else acceptOwnLineComment(cText, si.offset ?? -1);
|
|
13259
|
+
continue;
|
|
13260
|
+
}
|
|
13261
|
+
if (si.kind === "node" && si.node) {
|
|
13262
|
+
const fields = takePendingFields(si.node.length > 0 ? si.node.offset : -1);
|
|
13263
|
+
const node = hasPendingFields(fields) ? withCommentFields(si.node, fields) : si.node;
|
|
13264
|
+
items.push(node);
|
|
13265
|
+
pushedIdx = items.length - 1;
|
|
13266
|
+
lastItemEnd = si.node.offset + si.node.length;
|
|
13267
|
+
}
|
|
13268
|
+
}
|
|
13269
|
+
}
|
|
13270
|
+
if (pending.length > 0) {
|
|
13271
|
+
const joined = joinPending(pending);
|
|
13272
|
+
const first = pending[0];
|
|
13273
|
+
const withLead = joined !== void 0 && first !== void 0 && lastItemEnd >= 0 && first.offset >= 0 && hasBlankLineAbove(state.text, first.offset) ? `\n${joined}` : joined;
|
|
13274
|
+
if (withLead !== void 0) seqTrailing = joinComments(seqTrailing, withLead);
|
|
12763
13275
|
}
|
|
13276
|
+
const seqComment = meta?.comment !== void 0 ? seqTrailing !== void 0 ? `${meta.comment}\n${seqTrailing}` : meta.comment : seqTrailing;
|
|
12764
13277
|
const seq = new YamlSeq({
|
|
12765
13278
|
items,
|
|
12766
13279
|
style: "flow",
|
|
@@ -12768,13 +13281,13 @@ function composeFlowSeqInner(cst, state, meta, parentBlockColumn) {
|
|
|
12768
13281
|
length: cst.length,
|
|
12769
13282
|
...meta?.tag !== void 0 ? { tag: meta.tag } : {},
|
|
12770
13283
|
...meta?.anchor !== void 0 ? { anchor: meta.anchor } : {},
|
|
12771
|
-
...
|
|
13284
|
+
...seqComment !== void 0 ? { comment: seqComment } : {}
|
|
12772
13285
|
});
|
|
12773
13286
|
if (meta?.anchor) registerAnchor(seq, meta.anchor, state, cst.offset);
|
|
12774
13287
|
return seq;
|
|
12775
13288
|
}
|
|
12776
13289
|
//#endregion
|
|
12777
|
-
//#region ../../node_modules/.pnpm/@effected+yaml@0.
|
|
13290
|
+
//#region ../../node_modules/.pnpm/@effected+yaml@0.8.0_effect@4.0.0-beta.107/node_modules/@effected/yaml/internal/composer/document.js
|
|
12778
13291
|
/** The flow-composer dispatch wired into every state this module creates. */
|
|
12779
13292
|
const FLOW = {
|
|
12780
13293
|
composeFlowMap,
|
|
@@ -12898,6 +13411,9 @@ function composeDocument(cst, state, hasSubsequentDocuments = false, nextDocCst)
|
|
|
12898
13411
|
const directives = [];
|
|
12899
13412
|
let contents = null;
|
|
12900
13413
|
let documentComment;
|
|
13414
|
+
let documentCommentAfter;
|
|
13415
|
+
let lastLeadingCommentOffset = -1;
|
|
13416
|
+
let sawDocEndMarker = false;
|
|
12901
13417
|
const hasDocStart = children.some((c) => c.type === "whitespace" && c.source === "---");
|
|
12902
13418
|
let i = 0;
|
|
12903
13419
|
const meta = {};
|
|
@@ -12933,6 +13449,7 @@ function composeDocument(cst, state, hasSubsequentDocuments = false, nextDocCst)
|
|
|
12933
13449
|
}
|
|
12934
13450
|
if (child.type === "newline" && hasMeta(meta)) sawNewlineSinceMeta = true;
|
|
12935
13451
|
if (child.type === "whitespace" || child.type === "newline") {
|
|
13452
|
+
if (child.type === "whitespace" && child.source === "...") sawDocEndMarker = true;
|
|
12936
13453
|
if (child.type === "whitespace" && (child.source === "]" || child.source === "}")) state.errors.push({
|
|
12937
13454
|
code: "MalformedFlowCollection",
|
|
12938
13455
|
message: `Unexpected flow indicator '${child.source}' at document level`,
|
|
@@ -12942,8 +13459,18 @@ function composeDocument(cst, state, hasSubsequentDocuments = false, nextDocCst)
|
|
|
12942
13459
|
i++;
|
|
12943
13460
|
continue;
|
|
12944
13461
|
}
|
|
12945
|
-
if (child.type === "comment" && contents === null) {
|
|
12946
|
-
|
|
13462
|
+
if (child.type === "comment" && contents === null && !sawDocEndMarker) {
|
|
13463
|
+
const text = rawCommentText(child.source);
|
|
13464
|
+
if (documentComment !== void 0 && hasBlankLineAbove(state.text, child.offset)) documentComment = `${documentComment}\n`;
|
|
13465
|
+
documentComment = documentComment === void 0 ? text : `${documentComment}\n${text}`;
|
|
13466
|
+
lastLeadingCommentOffset = child.offset;
|
|
13467
|
+
i++;
|
|
13468
|
+
continue;
|
|
13469
|
+
}
|
|
13470
|
+
if (child.type === "comment") {
|
|
13471
|
+
const text = rawCommentText(child.source);
|
|
13472
|
+
if (documentCommentAfter !== void 0 && hasBlankLineAbove(state.text, child.offset)) documentCommentAfter = `${documentCommentAfter}\n`;
|
|
13473
|
+
documentCommentAfter = documentCommentAfter === void 0 ? text : `${documentCommentAfter}\n${text}`;
|
|
12947
13474
|
i++;
|
|
12948
13475
|
continue;
|
|
12949
13476
|
}
|
|
@@ -13162,6 +13689,8 @@ function composeDocument(cst, state, hasSubsequentDocuments = false, nextDocCst)
|
|
|
13162
13689
|
break;
|
|
13163
13690
|
}
|
|
13164
13691
|
}
|
|
13692
|
+
if (documentComment !== void 0 && contents !== null && hasBlankLineBelow(state.text, lastLeadingCommentOffset)) documentComment = `${documentComment}\n`;
|
|
13693
|
+
state.escapedComments.length = 0;
|
|
13165
13694
|
return {
|
|
13166
13695
|
contents,
|
|
13167
13696
|
errors: [...state.errors],
|
|
@@ -13170,7 +13699,8 @@ function composeDocument(cst, state, hasSubsequentDocuments = false, nextDocCst)
|
|
|
13170
13699
|
hasDocumentStart: hasDocStart,
|
|
13171
13700
|
hasDocumentEnd: hasDocEnd,
|
|
13172
13701
|
hasDocumentStartTab: hasDocStartTab,
|
|
13173
|
-
...documentComment !== void 0 ? { comment: documentComment } : {}
|
|
13702
|
+
...documentComment !== void 0 ? { comment: documentComment } : {},
|
|
13703
|
+
...documentCommentAfter !== void 0 ? { commentAfter: documentCommentAfter } : {}
|
|
13174
13704
|
};
|
|
13175
13705
|
}
|
|
13176
13706
|
/**
|
|
@@ -13335,8 +13865,9 @@ function decorateSourceMultiline(node, text) {
|
|
|
13335
13865
|
style: node.style,
|
|
13336
13866
|
...node.tag !== void 0 ? { tag: node.tag } : {},
|
|
13337
13867
|
...node.anchor !== void 0 ? { anchor: node.anchor } : {},
|
|
13338
|
-
...node
|
|
13868
|
+
...commentProps(node),
|
|
13339
13869
|
...node.chomp !== void 0 ? { chomp: node.chomp } : {},
|
|
13870
|
+
...node.blockIndent !== void 0 ? { blockIndent: node.blockIndent } : {},
|
|
13340
13871
|
...node.raw !== void 0 ? { raw: node.raw } : {},
|
|
13341
13872
|
sourceMultiline: true,
|
|
13342
13873
|
offset: node.offset,
|
|
@@ -13347,7 +13878,7 @@ function decorateSourceMultiline(node, text) {
|
|
|
13347
13878
|
const newItems = node.items.map((pair) => new YamlPair({
|
|
13348
13879
|
key: decorateSourceMultiline(pair.key, text) ?? pair.key,
|
|
13349
13880
|
value: pair.value === null ? null : decorateSourceMultiline(pair.value, text),
|
|
13350
|
-
...pair
|
|
13881
|
+
...commentProps(pair)
|
|
13351
13882
|
}));
|
|
13352
13883
|
const multiline = isSourceMultiline(text, node.offset, node.length);
|
|
13353
13884
|
return new YamlMap({
|
|
@@ -13355,7 +13886,7 @@ function decorateSourceMultiline(node, text) {
|
|
|
13355
13886
|
style: node.style,
|
|
13356
13887
|
...node.tag !== void 0 ? { tag: node.tag } : {},
|
|
13357
13888
|
...node.anchor !== void 0 ? { anchor: node.anchor } : {},
|
|
13358
|
-
...node
|
|
13889
|
+
...commentProps(node),
|
|
13359
13890
|
...multiline ? { sourceMultiline: true } : {},
|
|
13360
13891
|
offset: node.offset,
|
|
13361
13892
|
length: node.length
|
|
@@ -13369,7 +13900,7 @@ function decorateSourceMultiline(node, text) {
|
|
|
13369
13900
|
style: node.style,
|
|
13370
13901
|
...node.tag !== void 0 ? { tag: node.tag } : {},
|
|
13371
13902
|
...node.anchor !== void 0 ? { anchor: node.anchor } : {},
|
|
13372
|
-
...node
|
|
13903
|
+
...commentProps(node),
|
|
13373
13904
|
...multiline ? { sourceMultiline: true } : {},
|
|
13374
13905
|
offset: node.offset,
|
|
13375
13906
|
length: node.length
|
|
@@ -13386,6 +13917,7 @@ function decorateDocumentSourceMultiline(doc, text) {
|
|
|
13386
13917
|
warnings: doc.warnings,
|
|
13387
13918
|
directives: doc.directives,
|
|
13388
13919
|
...doc.comment !== void 0 ? { comment: doc.comment } : {},
|
|
13920
|
+
...doc.commentAfter !== void 0 ? { commentAfter: doc.commentAfter } : {},
|
|
13389
13921
|
hasDocumentStart: doc.hasDocumentStart,
|
|
13390
13922
|
hasDocumentEnd: doc.hasDocumentEnd,
|
|
13391
13923
|
hasDocumentStartTab: doc.hasDocumentStartTab
|
|
@@ -13408,12 +13940,29 @@ const EMPTY_DOCUMENT = {
|
|
|
13408
13940
|
* state and therefore appear in the returned document's `errors`.
|
|
13409
13941
|
*/
|
|
13410
13942
|
function composeFirstDocument(text, options) {
|
|
13943
|
+
return composeFirstDocumentCounted(text, options).document;
|
|
13944
|
+
}
|
|
13945
|
+
/**
|
|
13946
|
+
* {@link composeFirstDocument} plus the CST-level document count of the whole
|
|
13947
|
+
* stream, from the single CST parse the compose already performs — no second
|
|
13948
|
+
* walk, and correct where a regex on `---` is not (a `---` inside a block
|
|
13949
|
+
* scalar or quoted string is content, not a document marker). Callers that
|
|
13950
|
+
* must refuse multi-document input (the `YamlFormat` single-document
|
|
13951
|
+
* contract) read `documentCount` instead of re-parsing.
|
|
13952
|
+
*/
|
|
13953
|
+
function composeFirstDocumentCounted(text, options) {
|
|
13411
13954
|
const cstNodes = parseCSTAll(text);
|
|
13412
13955
|
const state = createState(text, FLOW, options);
|
|
13413
13956
|
validateCrossDocumentDirectives(cstNodes, state);
|
|
13414
13957
|
const doc = cstNodes[0];
|
|
13415
|
-
if (!doc) return
|
|
13416
|
-
|
|
13958
|
+
if (!doc) return {
|
|
13959
|
+
document: EMPTY_DOCUMENT,
|
|
13960
|
+
documentCount: 0
|
|
13961
|
+
};
|
|
13962
|
+
return {
|
|
13963
|
+
document: decorateDocumentSourceMultiline(composeDocument(doc, state, cstNodes.length > 1, cstNodes[1]), text),
|
|
13964
|
+
documentCount: cstNodes.length
|
|
13965
|
+
};
|
|
13417
13966
|
}
|
|
13418
13967
|
/**
|
|
13419
13968
|
* Compose every document of `text` with full error recovery — v3
|
|
@@ -13440,7 +13989,7 @@ function composeAllDocuments(text, options) {
|
|
|
13440
13989
|
};
|
|
13441
13990
|
}
|
|
13442
13991
|
//#endregion
|
|
13443
|
-
//#region ../../node_modules/.pnpm/@effected+yaml@0.
|
|
13992
|
+
//#region ../../node_modules/.pnpm/@effected+yaml@0.8.0_effect@4.0.0-beta.107/node_modules/@effected/yaml/internal/fold.js
|
|
13444
13993
|
/**
|
|
13445
13994
|
* Column-based line folding for a single logical scalar line (YAML 1.2 flow
|
|
13446
13995
|
* folding, §7.3 / §8.2.1). Breaks the content at "safe" single-space
|
|
@@ -13616,12 +14165,18 @@ function renderSingleQuotedMultiline(s, indent) {
|
|
|
13616
14165
|
* @param explicitChomp - Original chomp indicator from the AST, when known.
|
|
13617
14166
|
* `keep` (`+`) and `strip` (`-`) preserve trailing-newline semantics that
|
|
13618
14167
|
* cannot be inferred from the resolved value alone.
|
|
14168
|
+
* @param preserveKeep - Re-emit a REDUNDANT explicit `+` (a keep header whose
|
|
14169
|
+
* value ends in exactly one newline, where clip would read identically) —
|
|
14170
|
+
* fidelity-path header preservation; canonical mode passes false.
|
|
14171
|
+
* @param explicitIndent - Explicit indentation-indicator digit from the AST,
|
|
14172
|
+
* re-emitted only when it matches the rendered indent (fidelity path).
|
|
13619
14173
|
*/
|
|
13620
|
-
function renderBlockLiteral(s, indent, explicitChomp, parentPosition) {
|
|
14174
|
+
function renderBlockLiteral(s, indent, explicitChomp, parentPosition, preserveKeep = false, explicitIndent) {
|
|
13621
14175
|
let chomp = "";
|
|
13622
14176
|
const onlyNewlines = s.length > 0 && /^\n+$/.test(s);
|
|
13623
14177
|
if (s.endsWith("\n\n") || onlyNewlines && explicitChomp === "keep") chomp = "+";
|
|
13624
14178
|
else if (!s.endsWith("\n")) chomp = "-";
|
|
14179
|
+
else if (preserveKeep && explicitChomp === "keep") chomp = "+";
|
|
13625
14180
|
const lines = s.split("\n");
|
|
13626
14181
|
if (s.endsWith("\n")) lines.pop();
|
|
13627
14182
|
let indentIndicator = "";
|
|
@@ -13629,6 +14184,7 @@ function renderBlockLiteral(s, indent, explicitChomp, parentPosition) {
|
|
|
13629
14184
|
const hasContent = firstContent !== void 0;
|
|
13630
14185
|
if (firstContent?.startsWith(" ") || lines.length > 0 && lines[0] === "" && hasContent) indentIndicator = String(indent.length);
|
|
13631
14186
|
else if (!hasContent && chomp === "+" && parentPosition === "block-map-value" && indent.length > 0) indentIndicator = String(indent.length);
|
|
14187
|
+
else if (explicitIndent !== void 0 && explicitIndent === indent.length) indentIndicator = String(explicitIndent);
|
|
13632
14188
|
return `|${indentIndicator}${chomp}\n${lines.map((l) => l === "" ? "" : `${indent}${l}`).join("\n")}`;
|
|
13633
14189
|
}
|
|
13634
14190
|
/**
|
|
@@ -13639,34 +14195,39 @@ function renderBlockLiteral(s, indent, explicitChomp, parentPosition) {
|
|
|
13639
14195
|
* the output must contain an empty line (double newline). Each empty line
|
|
13640
14196
|
* in the value already produces the correct number of blank lines.
|
|
13641
14197
|
*/
|
|
13642
|
-
function renderBlockFolded(s, indent) {
|
|
14198
|
+
function renderBlockFolded(s, indent, explicitChomp, explicitIndent) {
|
|
13643
14199
|
let chomp = "";
|
|
13644
14200
|
if (s.endsWith("\n\n")) chomp = "+";
|
|
13645
14201
|
else if (!s.endsWith("\n")) chomp = "-";
|
|
14202
|
+
else if (explicitChomp === "keep") chomp = "+";
|
|
13646
14203
|
const valueLines = s.split("\n");
|
|
13647
14204
|
if (s.endsWith("\n")) valueLines.pop();
|
|
13648
14205
|
let indentIndicator = "";
|
|
13649
14206
|
const firstContent = valueLines.find((l) => l !== "");
|
|
13650
14207
|
if (firstContent?.startsWith(" ") || valueLines.length >= 2 && valueLines[0] === "" && valueLines[1] === "" && firstContent !== void 0) indentIndicator = String(indent.length);
|
|
14208
|
+
else if (explicitIndent !== void 0 && explicitIndent === indent.length) indentIndicator = String(explicitIndent);
|
|
13651
14209
|
const outputLines = [];
|
|
14210
|
+
let lastContentIdx = -1;
|
|
14211
|
+
for (let i = valueLines.length - 1; i >= 0; i--) if (valueLines[i] !== "") {
|
|
14212
|
+
lastContentIdx = i;
|
|
14213
|
+
break;
|
|
14214
|
+
}
|
|
13652
14215
|
let prevNonEmpty = false;
|
|
13653
14216
|
let prevMoreIndented = false;
|
|
14217
|
+
let pendingCompensation = false;
|
|
13654
14218
|
for (let i = 0; i < valueLines.length; i++) {
|
|
13655
14219
|
const line = valueLines[i];
|
|
13656
14220
|
if (line === "") {
|
|
13657
|
-
if (prevNonEmpty && !prevMoreIndented)
|
|
13658
|
-
let nextContentMoreIndented = false;
|
|
13659
|
-
for (let j = i + 1; j < valueLines.length; j++) if (valueLines[j] !== "") {
|
|
13660
|
-
nextContentMoreIndented = valueLines[j].startsWith(" ") || valueLines[j].startsWith(" ");
|
|
13661
|
-
break;
|
|
13662
|
-
}
|
|
13663
|
-
if (!nextContentMoreIndented) outputLines.push("");
|
|
13664
|
-
}
|
|
14221
|
+
if (prevNonEmpty && !prevMoreIndented && i < lastContentIdx) pendingCompensation = true;
|
|
13665
14222
|
outputLines.push("");
|
|
13666
14223
|
prevNonEmpty = false;
|
|
13667
14224
|
prevMoreIndented = false;
|
|
13668
14225
|
} else {
|
|
13669
14226
|
const isMoreIndented = line.startsWith(" ") || line.startsWith(" ");
|
|
14227
|
+
if (pendingCompensation) {
|
|
14228
|
+
if (!isMoreIndented) outputLines.push("");
|
|
14229
|
+
pendingCompensation = false;
|
|
14230
|
+
}
|
|
13670
14231
|
if (prevNonEmpty && !isMoreIndented) outputLines.push("");
|
|
13671
14232
|
outputLines.push(`${indent}${line}`);
|
|
13672
14233
|
prevNonEmpty = true;
|
|
@@ -13676,7 +14237,7 @@ function renderBlockFolded(s, indent) {
|
|
|
13676
14237
|
return `>${indentIndicator}${chomp}\n${outputLines.join("\n")}`;
|
|
13677
14238
|
}
|
|
13678
14239
|
//#endregion
|
|
13679
|
-
//#region ../../node_modules/.pnpm/@effected+yaml@0.
|
|
14240
|
+
//#region ../../node_modules/.pnpm/@effected+yaml@0.8.0_effect@4.0.0-beta.107/node_modules/@effected/yaml/internal/stringifier.js
|
|
13680
14241
|
/**
|
|
13681
14242
|
* Thrown by the stringifier on its failure paths (circular references). The
|
|
13682
14243
|
* facade catches this and materializes the public stringify error.
|
|
@@ -13704,6 +14265,27 @@ var StringifyDepthExceeded = class extends Error {
|
|
|
13704
14265
|
this.name = "StringifyDepthExceeded";
|
|
13705
14266
|
}
|
|
13706
14267
|
};
|
|
14268
|
+
/**
|
|
14269
|
+
* YAML 1.2 §8.1.3 caps an implicit block-mapping key: the `:` indicator must
|
|
14270
|
+
* appear at most 1024 characters after the start of the key. A key whose
|
|
14271
|
+
* RENDERED form (quotes and escapes count, the source scalar does not) is
|
|
14272
|
+
* longer than this must spill to explicit-key form (`? key` / `: value`) or
|
|
14273
|
+
* strict parsers reject the output. Matches the reference `yaml` package
|
|
14274
|
+
* (`stringifyPair`: `str.length > 1024`, block context only — flow contexts
|
|
14275
|
+
* never spill): a rendered key of exactly 1024 characters stays implicit.
|
|
14276
|
+
*/
|
|
14277
|
+
const IMPLICIT_KEY_MAX_LENGTH = 1024;
|
|
14278
|
+
/**
|
|
14279
|
+
* Continuation-line padding for explicit-key compact notation. Structurally
|
|
14280
|
+
* the width of the `? ` / `: ` indicators — two columns — and deliberately
|
|
14281
|
+
* NOT `ctx.indent`: compact continuation lines must align with the first
|
|
14282
|
+
* item, which always starts two columns in, so any other pad silently
|
|
14283
|
+
* re-nests (or corrupts) the value on reparse once `indent !== 2`. This is a
|
|
14284
|
+
* recorded divergence from the reference `yaml` package, which pads these
|
|
14285
|
+
* lines with the configured indent and emits output its own strict parser
|
|
14286
|
+
* misreads or rejects at indent ≠ 2.
|
|
14287
|
+
*/
|
|
14288
|
+
const EXPLICIT_COMPACT_PAD = " ";
|
|
13707
14289
|
const NULL_RE = /^(?:null|Null|NULL|~)$/;
|
|
13708
14290
|
const TRUE_RE = /^(?:true|True|TRUE)$/;
|
|
13709
14291
|
const FALSE_RE = /^(?:false|False|FALSE)$/;
|
|
@@ -13851,7 +14433,9 @@ function renderSingleQuoted(s) {
|
|
|
13851
14433
|
* Block literal and block folded styles are always accepted for single-line
|
|
13852
14434
|
* strings even though the output is unusual.
|
|
13853
14435
|
*/
|
|
13854
|
-
function renderString(s, style, indent, ignoreType = false, canonical = false, explicitChomp, parentPosition, quoteStyle = "single") {
|
|
14436
|
+
function renderString(s, style, indent, ignoreType = false, canonical = false, explicitChomp, parentPosition, quoteStyle = "single", explicitIndent) {
|
|
14437
|
+
const fidelity = !canonical;
|
|
14438
|
+
const fidelityIndent = fidelity ? explicitIndent : void 0;
|
|
13855
14439
|
if (s.includes("\n")) {
|
|
13856
14440
|
let hasControl = false;
|
|
13857
14441
|
for (let i = 0; i < s.length; i++) {
|
|
@@ -13867,14 +14451,14 @@ function renderString(s, style, indent, ignoreType = false, canonical = false, e
|
|
|
13867
14451
|
if (hasInteriorTrailingWhitespace(s)) return renderDoubleQuoted(s, canonical);
|
|
13868
14452
|
if (hasNewlineSpacesTab(s)) return renderDoubleQuoted(s, canonical);
|
|
13869
14453
|
}
|
|
13870
|
-
if (style === "block-literal") return renderBlockLiteral(s, indent, explicitChomp, parentPosition);
|
|
13871
|
-
if (style === "block-folded") return renderBlockFolded(s, indent);
|
|
14454
|
+
if (style === "block-literal") return renderBlockLiteral(s, indent, explicitChomp, parentPosition, fidelity, fidelityIndent);
|
|
14455
|
+
if (style === "block-folded") return renderBlockFolded(s, indent, fidelity ? explicitChomp : void 0, fidelityIndent);
|
|
13872
14456
|
if (style === "plain" || style === "single-quoted") {
|
|
13873
14457
|
if (canonical) {
|
|
13874
14458
|
const sq = renderSingleQuotedMultiline(s, indent);
|
|
13875
14459
|
if (sq !== null) return sq;
|
|
13876
14460
|
}
|
|
13877
|
-
return renderBlockLiteral(s, indent, explicitChomp, parentPosition);
|
|
14461
|
+
return renderBlockLiteral(s, indent, explicitChomp, parentPosition, fidelity, fidelityIndent);
|
|
13878
14462
|
}
|
|
13879
14463
|
return renderDoubleQuoted(s, canonical);
|
|
13880
14464
|
}
|
|
@@ -13890,8 +14474,8 @@ function renderString(s, style, indent, ignoreType = false, canonical = false, e
|
|
|
13890
14474
|
return s;
|
|
13891
14475
|
case "single-quoted": return renderSingleQuoted(s);
|
|
13892
14476
|
case "double-quoted": return renderDoubleQuoted(s, canonical);
|
|
13893
|
-
case "block-literal": return renderBlockLiteral(s, indent, explicitChomp, parentPosition);
|
|
13894
|
-
case "block-folded": return renderBlockFolded(s, indent);
|
|
14477
|
+
case "block-literal": return renderBlockLiteral(s, indent, explicitChomp, parentPosition, fidelity, fidelityIndent);
|
|
14478
|
+
case "block-folded": return renderBlockFolded(s, indent, fidelity ? explicitChomp : void 0, fidelityIndent);
|
|
13895
14479
|
}
|
|
13896
14480
|
}
|
|
13897
14481
|
/**
|
|
@@ -14021,6 +14605,18 @@ function stringifyObjectLines(obj, ctx, depth) {
|
|
|
14021
14605
|
const keyStr = renderKey(k);
|
|
14022
14606
|
const val = obj[k];
|
|
14023
14607
|
const valLines = stringifyLines(val, ctx, depth + 1);
|
|
14608
|
+
if (keyStr.length > IMPLICIT_KEY_MAX_LENGTH) {
|
|
14609
|
+
lines.push(`? ${keyStr}`);
|
|
14610
|
+
if (valLines.length === 1) lines.push(`: ${valLines[0]}`);
|
|
14611
|
+
else if (valLines[0].startsWith("|") || valLines[0].startsWith(">") || typeof val === "string") {
|
|
14612
|
+
lines.push(`: ${valLines[0]}`);
|
|
14613
|
+
for (let i = 1; i < valLines.length; i++) lines.push(valLines[i]);
|
|
14614
|
+
} else {
|
|
14615
|
+
lines.push(`: ${valLines[0]}`);
|
|
14616
|
+
for (let i = 1; i < valLines.length; i++) lines.push(valLines[i] === "" ? valLines[i] : `${EXPLICIT_COMPACT_PAD}${valLines[i]}`);
|
|
14617
|
+
}
|
|
14618
|
+
continue;
|
|
14619
|
+
}
|
|
14024
14620
|
if (valLines.length === 1 && !isBlockCollection(val, ctx)) lines.push(`${keyStr}: ${valLines[0]}`);
|
|
14025
14621
|
else {
|
|
14026
14622
|
const first = valLines[0];
|
|
@@ -14093,7 +14689,9 @@ effect.Schema.Class("YamlStringifyOptions")({
|
|
|
14093
14689
|
* Error-recovery parse failure: aggregates every fatal {@link YamlDiagnostic}
|
|
14094
14690
|
* encountered, so a single failure reports the whole batch. Raised by
|
|
14095
14691
|
* {@link Yaml.parse}, {@link Yaml.parseAll}, `YamlDocument.parse`/`parseAll`
|
|
14096
|
-
* and the decode direction of the schema factories.
|
|
14692
|
+
* and the decode direction of the schema factories. The error itself has no
|
|
14693
|
+
* `code` field: read the code from the diagnostics —
|
|
14694
|
+
* `error.diagnostics[0].code` is the primary failure.
|
|
14097
14695
|
*
|
|
14098
14696
|
* @public
|
|
14099
14697
|
*/
|
|
@@ -14111,7 +14709,8 @@ var YamlParseError = class extends effect.Schema.TaggedError()("YamlParseError",
|
|
|
14111
14709
|
* Stringification failure (the circular-reference guard), carrying structured
|
|
14112
14710
|
* {@link YamlDiagnostic} entries and the offending value. Raised by
|
|
14113
14711
|
* {@link Yaml.stringify}, `YamlDocument#stringify` and the encode direction of
|
|
14114
|
-
* the schema factories.
|
|
14712
|
+
* the schema factories. The error itself has no `code` field: read the code
|
|
14713
|
+
* from the diagnostics — `error.diagnostics[0].code` is the primary failure.
|
|
14115
14714
|
*
|
|
14116
14715
|
* @public
|
|
14117
14716
|
*/
|
|
@@ -14209,6 +14808,35 @@ const parseResultImpl = (text, options) => {
|
|
|
14209
14808
|
}
|
|
14210
14809
|
};
|
|
14211
14810
|
/**
|
|
14811
|
+
* Synchronous multi-document parse returning a `Result`. Mirrors
|
|
14812
|
+
* {@link parseResultImpl} over the whole stream: stream-level
|
|
14813
|
+
* directive-placement errors and every document's failure records aggregate
|
|
14814
|
+
* into one {@link YamlParseError}; each document's value is extracted against
|
|
14815
|
+
* its own independent anchor map (anchors are document-scoped in a stream),
|
|
14816
|
+
* with the alias-expansion budget materialized as a typed failure.
|
|
14817
|
+
*/
|
|
14818
|
+
const parseAllResultImpl = (text, options) => {
|
|
14819
|
+
const { documents, streamErrors } = composeAllDocuments(text, toParseInput(options));
|
|
14820
|
+
const uniqueKeys = options?.uniqueKeys ?? true;
|
|
14821
|
+
const failures = [...streamErrors.filter((e) => isFatalCode(e.code)), ...documents.flatMap((d) => failureRecords(d, uniqueKeys))];
|
|
14822
|
+
if (failures.length > 0) return effect.Result.fail(new YamlParseError({
|
|
14823
|
+
diagnostics: toDiagnostics(text, failures),
|
|
14824
|
+
input: text
|
|
14825
|
+
}));
|
|
14826
|
+
const maxAliasCount = options?.maxAliasCount ?? 100;
|
|
14827
|
+
const values = [];
|
|
14828
|
+
for (const d of documents) {
|
|
14829
|
+
const anchors = /* @__PURE__ */ new Map();
|
|
14830
|
+
try {
|
|
14831
|
+
values.push(nodeToJsValue(d.contents, anchors, maxAliasCount));
|
|
14832
|
+
} catch (defect) {
|
|
14833
|
+
if (defect instanceof AliasExpansionBudgetExceeded) return effect.Result.fail(aliasCountExceededError(defect.message, text));
|
|
14834
|
+
throw defect;
|
|
14835
|
+
}
|
|
14836
|
+
}
|
|
14837
|
+
return effect.Result.succeed(values);
|
|
14838
|
+
};
|
|
14839
|
+
/**
|
|
14212
14840
|
* Synchronous stringify returning a `Result`. Mirrors {@link Yaml.stringify}
|
|
14213
14841
|
* without the Effect wrapper: a circular reference or a value nested past the
|
|
14214
14842
|
* recursion budget yields a `Failure` carrying a typed {@link YamlStringifyError},
|
|
@@ -14234,19 +14862,6 @@ const failureRecords = (doc, uniqueKeys) => {
|
|
|
14234
14862
|
if (fatal.length > 0) return fatal;
|
|
14235
14863
|
return uniqueKeys ? doc.warnings.filter((w) => w.code === "DuplicateKey") : [];
|
|
14236
14864
|
};
|
|
14237
|
-
/**
|
|
14238
|
-
* Extract a document's plain-JS value with an alias-expansion budget derived
|
|
14239
|
-
* from `maxAliasCount`, materializing a "billion laughs" blow-up as a typed
|
|
14240
|
-
* fatal {@link YamlParseError} (`AliasCountExceeded`) instead of letting the
|
|
14241
|
-
* heap-exhausting expansion escape as an unhandled defect.
|
|
14242
|
-
*/
|
|
14243
|
-
const extractDocumentValue = (contents, anchors, maxAliasCount, text) => effect.Effect.try({
|
|
14244
|
-
try: () => nodeToJsValue(contents, anchors, maxAliasCount),
|
|
14245
|
-
catch: (defect) => {
|
|
14246
|
-
if (defect instanceof AliasExpansionBudgetExceeded) return aliasCountExceededError(defect.message, text);
|
|
14247
|
-
throw defect;
|
|
14248
|
-
}
|
|
14249
|
-
});
|
|
14250
14865
|
const stringifyOrFail = (value, options) => effect.Effect.try({
|
|
14251
14866
|
try: () => stringifyValue(value, toStringifyInput(options)),
|
|
14252
14867
|
catch: (defect) => {
|
|
@@ -14305,23 +14920,11 @@ var Yaml = class Yaml {
|
|
|
14305
14920
|
* A "billion laughs" alias-expansion blow-up in any document also fails
|
|
14306
14921
|
* through {@link YamlParseError} with an `AliasCountExceeded` diagnostic,
|
|
14307
14922
|
* never as an unhandled defect.
|
|
14923
|
+
*
|
|
14924
|
+
* Defined in terms of {@link Yaml.parseAllResult} — synchronous callers
|
|
14925
|
+
* can use that variant directly.
|
|
14308
14926
|
*/
|
|
14309
|
-
static parseAll = effect.Effect.fn("Yaml.parseAll")(
|
|
14310
|
-
const { documents, streamErrors } = composeAllDocuments(text, toParseInput(options));
|
|
14311
|
-
const uniqueKeys = options?.uniqueKeys ?? true;
|
|
14312
|
-
const failures = [...streamErrors.filter((e) => e.code === "InvalidDirective"), ...documents.flatMap((d) => failureRecords(d, uniqueKeys))];
|
|
14313
|
-
if (failures.length > 0) return yield* new YamlParseError({
|
|
14314
|
-
diagnostics: toDiagnostics(text, failures),
|
|
14315
|
-
input: text
|
|
14316
|
-
});
|
|
14317
|
-
const maxAliasCount = options?.maxAliasCount ?? 100;
|
|
14318
|
-
const values = [];
|
|
14319
|
-
for (const d of documents) {
|
|
14320
|
-
const anchors = buildAnchorMap(d.contents);
|
|
14321
|
-
values.push(yield* extractDocumentValue(d.contents, anchors, maxAliasCount, text));
|
|
14322
|
-
}
|
|
14323
|
-
return values;
|
|
14324
|
-
});
|
|
14927
|
+
static parseAll = effect.Effect.fn("Yaml.parseAll")((text, options) => effect.Effect.fromResult(Yaml.parseAllResult(text, options)));
|
|
14325
14928
|
/**
|
|
14326
14929
|
* Stringify a plain JavaScript value as YAML. Fails with
|
|
14327
14930
|
* {@link YamlStringifyError} on circular references (`CircularReference`)
|
|
@@ -14377,6 +14980,48 @@ var Yaml = class Yaml {
|
|
|
14377
14980
|
return parseResultImpl(text, options);
|
|
14378
14981
|
}
|
|
14379
14982
|
/**
|
|
14983
|
+
* Synchronous multi-document parse, returning a `Result` instead of an
|
|
14984
|
+
* `Effect` — the {@link Yaml.parseResult} counterpart to
|
|
14985
|
+
* {@link Yaml.parseAll}. Empty input succeeds with `[null]` (the engine
|
|
14986
|
+
* reads `""` as one empty document, exactly as {@link Yaml.parse} yields
|
|
14987
|
+
* `null` for it); a single-document stream succeeds with a one-element
|
|
14988
|
+
* array whose value is exactly what {@link Yaml.parseResult} yields.
|
|
14989
|
+
*
|
|
14990
|
+
* @remarks
|
|
14991
|
+
* This is the package's single multi-document parse path.
|
|
14992
|
+
* {@link Yaml.parseAll} is defined in terms of it (`Effect.fromResult`
|
|
14993
|
+
* behind the named span), so the two variants cannot diverge. Anchors are
|
|
14994
|
+
* document-scoped: each document's aliases resolve against its own anchor
|
|
14995
|
+
* map, never a neighbor's.
|
|
14996
|
+
*
|
|
14997
|
+
* Fails with the aggregate {@link YamlParseError} when **any** document in
|
|
14998
|
+
* the stream carries a fatal diagnostic (or a stream-level
|
|
14999
|
+
* directive-placement error), which makes it a whole-stream validity
|
|
15000
|
+
* check: a `Success` means every document parsed clean. Preserves the
|
|
15001
|
+
* package contract — malformed and adversarial input (including a
|
|
15002
|
+
* "billion laughs" alias bomb in any document) fails typed, never as a
|
|
15003
|
+
* defect; the method never throws.
|
|
15004
|
+
*
|
|
15005
|
+
* @example
|
|
15006
|
+
* ```ts
|
|
15007
|
+
* import { Yaml } from "@effected/yaml";
|
|
15008
|
+
* import { Result } from "effect";
|
|
15009
|
+
*
|
|
15010
|
+
* // Whole-stream validity check: fails if ANY document is invalid.
|
|
15011
|
+
* const result = Yaml.parseAllResult("a: 1\n---\nb: 2\n");
|
|
15012
|
+
* if (Result.isSuccess(result)) {
|
|
15013
|
+
* result.success; // [{ a: 1 }, { b: 2 }]
|
|
15014
|
+
* } else {
|
|
15015
|
+
* result.failure; // YamlParseError aggregating every fatal diagnostic
|
|
15016
|
+
* }
|
|
15017
|
+
* ```
|
|
15018
|
+
*
|
|
15019
|
+
* @public
|
|
15020
|
+
*/
|
|
15021
|
+
static parseAllResult(text, options) {
|
|
15022
|
+
return parseAllResultImpl(text, options);
|
|
15023
|
+
}
|
|
15024
|
+
/**
|
|
14380
15025
|
* Synchronous stringify, returning a `Result` instead of an `Effect`.
|
|
14381
15026
|
* The pure counterpart to {@link Yaml.stringify} for config-time callers
|
|
14382
15027
|
* that cannot `await`.
|
|
@@ -14628,7 +15273,7 @@ function deepEqualValues(a, b) {
|
|
|
14628
15273
|
return false;
|
|
14629
15274
|
}
|
|
14630
15275
|
//#endregion
|
|
14631
|
-
//#region ../../node_modules/.pnpm/@effected+lockfiles@0.4.
|
|
15276
|
+
//#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
|
|
14632
15277
|
/**
|
|
14633
15278
|
* An empty YAML document composes to `null` (`Yaml.parseAll("")` is `[null]`,
|
|
14634
15279
|
* and the trailing document of an env-only `pnpm-lock.yaml` is `null` too).
|
|
@@ -14698,7 +15343,7 @@ const selectSoleDocument = (content) => effect.Effect.gen(function* () {
|
|
|
14698
15343
|
};
|
|
14699
15344
|
});
|
|
14700
15345
|
//#endregion
|
|
14701
|
-
//#region ../../node_modules/.pnpm/@effected+lockfiles@0.4.
|
|
15346
|
+
//#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
|
|
14702
15347
|
const PnpmImporterDeps = effect.Schema.optionalKey(effect.Schema.Record(effect.Schema.String, effect.Schema.Struct({
|
|
14703
15348
|
specifier: effect.Schema.String,
|
|
14704
15349
|
version: effect.Schema.String
|
|
@@ -14823,7 +15468,7 @@ const toFields$1 = (raw) => effect.Effect.gen(function* () {
|
|
|
14823
15468
|
};
|
|
14824
15469
|
});
|
|
14825
15470
|
//#endregion
|
|
14826
|
-
//#region ../../node_modules/.pnpm/@effected+lockfiles@0.4.
|
|
15471
|
+
//#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
|
|
14827
15472
|
const YarnLockfileRaw = effect.Schema.Record(effect.Schema.String, effect.Schema.Unknown);
|
|
14828
15473
|
const DepRecord = effect.Schema.optionalKey(effect.Schema.Record(effect.Schema.String, effect.Schema.String));
|
|
14829
15474
|
const YarnEntry = effect.Schema.Struct({
|
|
@@ -14946,7 +15591,7 @@ const cleanYarnDeps = (deps) => {
|
|
|
14946
15591
|
return Object.fromEntries(Object.entries(deps).map(([name, value]) => [name, value.startsWith("npm:") ? value.slice(4) : value]));
|
|
14947
15592
|
};
|
|
14948
15593
|
//#endregion
|
|
14949
|
-
//#region ../../node_modules/.pnpm/@effected+lockfiles@0.4.
|
|
15594
|
+
//#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
|
|
14950
15595
|
const EMPTY_IMPORTERS = [];
|
|
14951
15596
|
/**
|
|
14952
15597
|
* Failure of `Lockfile.parse`: the given content is not a valid lockfile of
|
|
@@ -15190,7 +15835,7 @@ var Lockfile = class Lockfile extends effect.Schema.Class("Lockfile")({
|
|
|
15190
15835
|
}
|
|
15191
15836
|
};
|
|
15192
15837
|
//#endregion
|
|
15193
|
-
//#region ../../node_modules/.pnpm/@effected+lockfiles@0.4.
|
|
15838
|
+
//#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
|
|
15194
15839
|
/**
|
|
15195
15840
|
* The minimal manifest shape {@link LockfileIntegrity.compare} checks a
|
|
15196
15841
|
* lockfile against: a package name plus the four optional dependency maps.
|
|
@@ -17989,7 +18634,7 @@ var Package = class Package extends effect.Schema.Class("Package")({
|
|
|
17989
18634
|
}
|
|
17990
18635
|
};
|
|
17991
18636
|
//#endregion
|
|
17992
|
-
//#region ../../node_modules/.pnpm/@effected+workspaces@0.11.
|
|
18637
|
+
//#region ../../node_modules/.pnpm/@effected+workspaces@0.11.2_@effected+jsonc@0.6.0_effect@4.0.0-beta.107__effect@4.0.0-beta.107/node_modules/@effected/workspaces/WorkspacePackage.js
|
|
17993
18638
|
const EMPTY$1 = Object.freeze(Object.create(null));
|
|
17994
18639
|
const EMPTY_MANIFEST = Object.freeze(Object.create(null));
|
|
17995
18640
|
/**
|
|
@@ -18587,7 +19232,7 @@ var Walker$1 = class {
|
|
|
18587
19232
|
static findRoot = findRoot$1;
|
|
18588
19233
|
};
|
|
18589
19234
|
//#endregion
|
|
18590
|
-
//#region ../../node_modules/.pnpm/@effected+workspaces@0.11.
|
|
19235
|
+
//#region ../../node_modules/.pnpm/@effected+workspaces@0.11.2_@effected+jsonc@0.6.0_effect@4.0.0-beta.107__effect@4.0.0-beta.107/node_modules/@effected/workspaces/WorkspaceRoot.js
|
|
18591
19236
|
/**
|
|
18592
19237
|
* The marker filenames {@link WorkspaceRoot} probes for, in priority order.
|
|
18593
19238
|
*
|
|
@@ -18774,7 +19419,7 @@ var WorkspaceRoot = class WorkspaceRoot extends effect.Context.Service()("@effec
|
|
|
18774
19419
|
static layerTest = (root) => effect.Layer.effect(WorkspaceRoot, WorkspaceRoot.makeTest(root)).pipe(effect.Layer.provide(effect.Path.layer));
|
|
18775
19420
|
};
|
|
18776
19421
|
//#endregion
|
|
18777
|
-
//#region ../../node_modules/.pnpm/@effected+workspaces@0.11.
|
|
19422
|
+
//#region ../../node_modules/.pnpm/@effected+workspaces@0.11.2_@effected+jsonc@0.6.0_effect@4.0.0-beta.107__effect@4.0.0-beta.107/node_modules/@effected/workspaces/internal/limits.js
|
|
18778
19423
|
/**
|
|
18779
19424
|
* Hard ceiling on directories the enumerator will visit for one pattern set.
|
|
18780
19425
|
* Guards the pathological case a depth cap alone does not: a wide, shallow
|
|
@@ -18792,7 +19437,7 @@ const MAX_ENUMERATION_ENTRIES = 1e5;
|
|
|
18792
19437
|
*/
|
|
18793
19438
|
const PRUNED_DIRECTORIES = /* @__PURE__ */ new Set([".git", "node_modules"]);
|
|
18794
19439
|
//#endregion
|
|
18795
|
-
//#region ../../node_modules/.pnpm/@effected+workspaces@0.11.
|
|
19440
|
+
//#region ../../node_modules/.pnpm/@effected+workspaces@0.11.2_@effected+jsonc@0.6.0_effect@4.0.0-beta.107__effect@4.0.0-beta.107/node_modules/@effected/workspaces/internal/traverse.js
|
|
18796
19441
|
/** Directory names never descended into. */
|
|
18797
19442
|
const isPruned = (entry) => PRUNED_DIRECTORIES.has(entry);
|
|
18798
19443
|
/** Join root-relative POSIX segments; `""` is the root itself. */
|
|
@@ -18882,7 +19527,7 @@ var Traversal = class {
|
|
|
18882
19527
|
}
|
|
18883
19528
|
};
|
|
18884
19529
|
//#endregion
|
|
18885
|
-
//#region ../../node_modules/.pnpm/@effected+workspaces@0.11.
|
|
19530
|
+
//#region ../../node_modules/.pnpm/@effected+workspaces@0.11.2_@effected+jsonc@0.6.0_effect@4.0.0-beta.107__effect@4.0.0-beta.107/node_modules/@effected/workspaces/internal/enumerate.js
|
|
18886
19531
|
/** Strip a trailing slash from `GlobPattern.enumerationPrefix` to get a relative directory. */
|
|
18887
19532
|
const baseOf = (pattern) => pattern.enumerationPrefix.replace(/\/$/, "");
|
|
18888
19533
|
/**
|
|
@@ -18952,7 +19597,7 @@ const enumerate = (root, globs, options) => effect.Effect.gen(function* () {
|
|
|
18952
19597
|
return results;
|
|
18953
19598
|
});
|
|
18954
19599
|
//#endregion
|
|
18955
|
-
//#region ../../node_modules/.pnpm/@effected+workspaces@0.11.
|
|
19600
|
+
//#region ../../node_modules/.pnpm/@effected+workspaces@0.11.2_@effected+jsonc@0.6.0_effect@4.0.0-beta.107__effect@4.0.0-beta.107/node_modules/@effected/workspaces/internal/patterns.js
|
|
18956
19601
|
const stringsOf = (value) => Array.isArray(value) ? value.filter((entry) => typeof entry === "string") : void 0;
|
|
18957
19602
|
/** The `packages:` list of a `pnpm-workspace.yaml` document. Total on a parsed document. */
|
|
18958
19603
|
const pnpmPatternsOf = (document) => {
|
|
@@ -19009,7 +19654,7 @@ const readPatterns = (root) => effect.Effect.gen(function* () {
|
|
|
19009
19654
|
return manifestPatternsOf(manifest);
|
|
19010
19655
|
});
|
|
19011
19656
|
//#endregion
|
|
19012
|
-
//#region ../../node_modules/.pnpm/@effected+workspaces@0.11.
|
|
19657
|
+
//#region ../../node_modules/.pnpm/@effected+workspaces@0.11.2_@effected+jsonc@0.6.0_effect@4.0.0-beta.107__effect@4.0.0-beta.107/node_modules/@effected/workspaces/WorkspaceDiscovery.js
|
|
19013
19658
|
/**
|
|
19014
19659
|
* Raised when a workspace member's `package.json` cannot be read, parsed, or
|
|
19015
19660
|
* used — it is missing, malformed, or lacks a `name` or `version`.
|
|
@@ -19465,7 +20110,7 @@ var WorkspaceDiscovery = class WorkspaceDiscovery extends effect.Context.Service
|
|
|
19465
20110
|
};
|
|
19466
20111
|
const isStringRecord$2 = (value) => value !== null && typeof value === "object" && !Array.isArray(value) && Object.values(value).every((entry) => typeof entry === "string");
|
|
19467
20112
|
//#endregion
|
|
19468
|
-
//#region ../../node_modules/.pnpm/@effected+workspaces@0.11.
|
|
20113
|
+
//#region ../../node_modules/.pnpm/@effected+workspaces@0.11.2_@effected+jsonc@0.6.0_effect@4.0.0-beta.107__effect@4.0.0-beta.107/node_modules/@effected/workspaces/DependencyGraph.js
|
|
19469
20114
|
/**
|
|
19470
20115
|
* Raised when the workspace dependency graph cannot be topologically ordered
|
|
19471
20116
|
* because it contains a cycle.
|
|
@@ -22957,7 +23602,7 @@ var Git = class Git extends effect.Context.Service()("@effected/git/Git") {
|
|
|
22957
23602
|
static layerTest = (overrides = {}) => effect.Layer.succeed(Git, Git.makeTest(overrides));
|
|
22958
23603
|
};
|
|
22959
23604
|
//#endregion
|
|
22960
|
-
//#region ../../node_modules/.pnpm/@effected+workspaces@0.11.
|
|
23605
|
+
//#region ../../node_modules/.pnpm/@effected+workspaces@0.11.2_@effected+jsonc@0.6.0_effect@4.0.0-beta.107__effect@4.0.0-beta.107/node_modules/@effected/workspaces/ChangeDetector.js
|
|
22961
23606
|
/**
|
|
22962
23607
|
* Which git refs to compare, and whether to fold in the working tree.
|
|
22963
23608
|
*
|
|
@@ -23213,7 +23858,7 @@ function resolveFromCatalog(catalogs, wantedDependency) {
|
|
|
23213
23858
|
};
|
|
23214
23859
|
}
|
|
23215
23860
|
//#endregion
|
|
23216
|
-
//#region ../../node_modules/.pnpm/@effected+workspaces@0.11.
|
|
23861
|
+
//#region ../../node_modules/.pnpm/@effected+workspaces@0.11.2_@effected+jsonc@0.6.0_effect@4.0.0-beta.107__effect@4.0.0-beta.107/node_modules/@effected/workspaces/internal/catalogs.js
|
|
23217
23862
|
/** Project a pnpm-workspace manifest's `catalog` / `catalogs` fields into a `Catalogs` map. */
|
|
23218
23863
|
const inlineCatalogs = (manifest) => {
|
|
23219
23864
|
if (manifest.catalog === void 0 && manifest.catalogs === void 0) return {};
|
|
@@ -23277,7 +23922,7 @@ const rangeOf = (catalogs, dependency, specifier) => {
|
|
|
23277
23922
|
});
|
|
23278
23923
|
};
|
|
23279
23924
|
//#endregion
|
|
23280
|
-
//#region ../../node_modules/.pnpm/@effected+workspaces@0.11.
|
|
23925
|
+
//#region ../../node_modules/.pnpm/@effected+workspaces@0.11.2_@effected+jsonc@0.6.0_effect@4.0.0-beta.107__effect@4.0.0-beta.107/node_modules/@effected/workspaces/ConfigDependencyHooks.js
|
|
23281
23926
|
/** Whether `value` is a non-null, non-array object. */
|
|
23282
23927
|
const isObject$2 = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
23283
23928
|
/**
|
|
@@ -23688,7 +24333,7 @@ var ConfigDependencyHooks = class ConfigDependencyHooks extends effect.Context.S
|
|
|
23688
24333
|
}));
|
|
23689
24334
|
};
|
|
23690
24335
|
//#endregion
|
|
23691
|
-
//#region ../../node_modules/.pnpm/@effected+workspaces@0.11.
|
|
24336
|
+
//#region ../../node_modules/.pnpm/@effected+workspaces@0.11.2_@effected+jsonc@0.6.0_effect@4.0.0-beta.107__effect@4.0.0-beta.107/node_modules/@effected/workspaces/PackageManagerName.js
|
|
23692
24337
|
/**
|
|
23693
24338
|
* The four package managers this package understands.
|
|
23694
24339
|
*
|
|
@@ -24016,7 +24661,7 @@ var PackageManagerDetector = class PackageManagerDetector extends effect.Context
|
|
|
24016
24661
|
static layerTest = (overrides = {}) => effect.Layer.succeed(PackageManagerDetector, PackageManagerDetector.makeTest(overrides));
|
|
24017
24662
|
};
|
|
24018
24663
|
//#endregion
|
|
24019
|
-
//#region ../../node_modules/.pnpm/@effected+workspaces@0.11.
|
|
24664
|
+
//#region ../../node_modules/.pnpm/@effected+workspaces@0.11.2_@effected+jsonc@0.6.0_effect@4.0.0-beta.107__effect@4.0.0-beta.107/node_modules/@effected/workspaces/LockfileReader.js
|
|
24020
24665
|
/**
|
|
24021
24666
|
* Raised when the workspace's lockfile cannot be read off disk.
|
|
24022
24667
|
*
|
|
@@ -24196,7 +24841,7 @@ var LockfileReader = class LockfileReader extends effect.Context.Service()("@eff
|
|
|
24196
24841
|
static layerTest = (overrides = {}) => effect.Layer.succeed(LockfileReader, LockfileReader.makeTest(overrides));
|
|
24197
24842
|
};
|
|
24198
24843
|
//#endregion
|
|
24199
|
-
//#region ../../node_modules/.pnpm/@effected+workspaces@0.11.
|
|
24844
|
+
//#region ../../node_modules/.pnpm/@effected+workspaces@0.11.2_@effected+jsonc@0.6.0_effect@4.0.0-beta.107__effect@4.0.0-beta.107/node_modules/@effected/workspaces/Publishability.js
|
|
24200
24845
|
/** The public npm registry, used when `publishConfig.registry` says nothing. */
|
|
24201
24846
|
const DEFAULT_REGISTRY = "https://registry.npmjs.org/";
|
|
24202
24847
|
/**
|
|
@@ -24355,7 +25000,7 @@ var PublishabilityDetector = class extends effect.Context.Service()("@effected/w
|
|
|
24355
25000
|
static layerNone = effect.Layer.succeed(this, this.none);
|
|
24356
25001
|
};
|
|
24357
25002
|
//#endregion
|
|
24358
|
-
//#region ../../node_modules/.pnpm/@effected+workspaces@0.11.
|
|
25003
|
+
//#region ../../node_modules/.pnpm/@effected+workspaces@0.11.2_@effected+jsonc@0.6.0_effect@4.0.0-beta.107__effect@4.0.0-beta.107/node_modules/@effected/workspaces/internal/importerVersions.js
|
|
24359
25004
|
/**
|
|
24360
25005
|
* Strip pnpm's peer-disambiguation suffix from a recorded importer version.
|
|
24361
25006
|
*
|
|
@@ -24441,7 +25086,7 @@ const unanimousVersionOf = (index, dependency) => {
|
|
|
24441
25086
|
return agreed;
|
|
24442
25087
|
};
|
|
24443
25088
|
//#endregion
|
|
24444
|
-
//#region ../../node_modules/.pnpm/@effected+workspaces@0.11.
|
|
25089
|
+
//#region ../../node_modules/.pnpm/@effected+workspaces@0.11.2_@effected+jsonc@0.6.0_effect@4.0.0-beta.107__effect@4.0.0-beta.107/node_modules/@effected/workspaces/WorkspaceCatalogs.js
|
|
24445
25090
|
/**
|
|
24446
25091
|
* An immutable, fully-normalized catalog collection — the one catalog
|
|
24447
25092
|
* resolution semantic in the package.
|
|
@@ -24968,7 +25613,7 @@ var WorkspaceCatalogs = class WorkspaceCatalogs extends effect.Context.Service()
|
|
|
24968
25613
|
}));
|
|
24969
25614
|
};
|
|
24970
25615
|
//#endregion
|
|
24971
|
-
//#region ../../node_modules/.pnpm/@effected+workspaces@0.11.
|
|
25616
|
+
//#region ../../node_modules/.pnpm/@effected+workspaces@0.11.2_@effected+jsonc@0.6.0_effect@4.0.0-beta.107__effect@4.0.0-beta.107/node_modules/@effected/workspaces/WorkspaceStateSnapshot.js
|
|
24972
25617
|
const EMPTY = Object.freeze(Object.create(null));
|
|
24973
25618
|
const DependencyMap = effect.Schema.Record(effect.Schema.String, effect.Schema.String).pipe(effect.Schema.withDecodingDefaultKey(effect.Effect.succeed(EMPTY)), effect.Schema.withConstructorDefault(effect.Effect.succeed(EMPTY)));
|
|
24974
25619
|
/**
|
|
@@ -25191,7 +25836,7 @@ var WorkspaceStateSnapshot = class extends effect.Schema.Class("WorkspaceStateSn
|
|
|
25191
25836
|
}
|
|
25192
25837
|
};
|
|
25193
25838
|
//#endregion
|
|
25194
|
-
//#region ../../node_modules/.pnpm/@effected+workspaces@0.11.
|
|
25839
|
+
//#region ../../node_modules/.pnpm/@effected+workspaces@0.11.2_@effected+jsonc@0.6.0_effect@4.0.0-beta.107__effect@4.0.0-beta.107/node_modules/@effected/workspaces/WorkspaceSnapshots.js
|
|
25195
25840
|
/** Whether `value` is a non-null, non-array object. */
|
|
25196
25841
|
const isObject = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
25197
25842
|
/** Whether every value in a record is a string — a usable dependency map. */
|
|
@@ -25468,7 +26113,7 @@ var WorkspaceSnapshots = class WorkspaceSnapshots extends effect.Context.Service
|
|
|
25468
26113
|
static layerTest = (overrides = {}) => effect.Layer.succeed(WorkspaceSnapshots, WorkspaceSnapshots.makeTest(overrides));
|
|
25469
26114
|
};
|
|
25470
26115
|
//#endregion
|
|
25471
|
-
//#region ../../node_modules/.pnpm/@effected+workspaces@0.11.
|
|
26116
|
+
//#region ../../node_modules/.pnpm/@effected+workspaces@0.11.2_@effected+jsonc@0.6.0_effect@4.0.0-beta.107__effect@4.0.0-beta.107/node_modules/@effected/workspaces/Workspaces.js
|
|
25472
26117
|
const compose = (options, catalogsFactory) => {
|
|
25473
26118
|
const roots = WorkspaceRoot.layer;
|
|
25474
26119
|
const detector = PackageManagerDetector.layer;
|