@voidzero-dev/vite-plus-core 0.2.8 → 0.3.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/LICENSE +30 -1
- package/dist/rolldown/cli.mjs +14 -10
- package/dist/rolldown/config.d.mts +1 -1
- package/dist/rolldown/config.mjs +2 -2
- package/dist/rolldown/experimental-index.d.mts +5 -5
- package/dist/rolldown/experimental-index.mjs +11 -9
- package/dist/rolldown/filter-index.d.mts +1 -1
- package/dist/rolldown/index.d.mts +2 -2
- package/dist/rolldown/index.mjs +4 -4
- package/dist/rolldown/parallel-plugin-worker.mjs +2 -2
- package/dist/rolldown/parallel-plugin.d.mts +1 -1
- package/dist/rolldown/parse-ast-index.d.mts +1 -1
- package/dist/rolldown/parse-ast-index.mjs +1 -1
- package/dist/rolldown/plugins-index.d.mts +3 -3
- package/dist/rolldown/plugins-index.mjs +2 -2
- package/dist/rolldown/shared/{binding-CVtkJvyl.d.mts → binding-Bvw14S3g.d.mts} +70 -1
- package/dist/rolldown/shared/binding-C__LJDBG.mjs +675 -0
- package/dist/rolldown/shared/{bindingify-input-options-B03y7DfJ.mjs → bindingify-input-options-V9YvAjrr.mjs} +6 -10
- package/dist/rolldown/shared/{constructors-ALilxAii.d.mts → constructors-CRumnw21.d.mts} +2 -2
- package/dist/rolldown/shared/{constructors-COwFYQna.mjs → constructors-DklcHr18.mjs} +1 -1
- package/dist/rolldown/shared/{create-bundler-option-B-tSTZRt.mjs → create-bundler-option-DbV2ud0B.mjs} +5 -4
- package/dist/rolldown/shared/{define-config-DSMNXceb.d.mts → define-config-DwTNhgWB.d.mts} +12 -10
- package/dist/rolldown/shared/{error-nLggAzpQ.mjs → error-NcRuXAVN.mjs} +1 -1
- package/dist/rolldown/shared/{load-config-O4G7NVNA.mjs → load-config-Dd7jKGUy.mjs} +1 -1
- package/dist/rolldown/shared/{normalize-string-or-regex-Cj-DgIV1.mjs → normalize-string-or-regex-CFtim40S.mjs} +1 -1
- package/dist/rolldown/shared/{parse-CQfUbVuN.mjs → parse-rvxTD36n.mjs} +2 -2
- package/dist/rolldown/shared/{resolve-tsconfig-CE3HNSOK.mjs → resolve-tsconfig-D2vSIIkR.mjs} +2 -2
- package/dist/rolldown/shared/{rolldown-qV_fUwyM.mjs → rolldown-Bblizyw1.mjs} +4 -4
- package/dist/rolldown/shared/{transform-WmU_cI8e.d.mts → transform--WSMLt1x.d.mts} +1 -1
- package/dist/rolldown/shared/{watch-BNIsji74.mjs → watch-DPvOlccK.mjs} +5 -5
- package/dist/rolldown/utils-index.d.mts +3 -3
- package/dist/rolldown/utils-index.mjs +15 -13
- package/dist/tsdown/{build-D_enfyvD-X5SFXZZc.js → build-D_enfyvD-tOzhITac.js} +1076 -20
- package/dist/tsdown/{debug-CKcBYQLP-avlAPNcV.js → debug-CKcBYQLP-By_AQqN8.js} +3 -3
- package/dist/tsdown/{detect-DGhJGEqb-CGd2brAW.js → detect-DGhJGEqb-LL52mV6u.js} +1 -1
- package/dist/tsdown/{dist-BZO8q3c0.js → dist-BsS7BOcb.js} +5 -5
- package/dist/tsdown/index-types.d.ts +4 -4
- package/dist/tsdown/index.js +4 -4
- package/dist/tsdown/internal-DSmmwu4u.js +3 -0
- package/dist/tsdown/{main-Jz_9T-KA.js → main-Bcv7jU2b.js} +210 -196
- package/dist/tsdown/npm_entry_picomatch.cjs +10 -6
- package/dist/tsdown/npm_entry_tree-kill.cjs +4 -2
- package/dist/tsdown/{resolver-cwLsPb2o-BqQjnCbF.js → resolver-cwLsPb2o-Bb9SDBm6.js} +2 -2
- package/dist/tsdown/run.js +6 -6
- package/dist/tsdown/{src-D5keKqGd.js → src-JVSpR8xt.js} +5 -5
- package/dist/tsdown/{target-Bab3CUeB-CERZYTwS.js → target-Bab3CUeB-8PBzMh3p.js} +5 -5
- package/dist/tsdown/{tsc-DmzrnJwy.js → tsc-B8FD48Oc.js} +3 -3
- package/dist/tsdown/tsdown-css.js +5 -5
- package/dist/tsdown/tsdown-exe.js +4 -4
- package/dist/vite/client/bundledDevClient.mjs +393 -27
- package/dist/vite/client/client.mjs +20 -14
- package/dist/vite/node/chunks/build.js +70 -64
- package/dist/vite/node/chunks/dist.js +36 -29
- package/dist/vite/node/chunks/dist2.js +193 -149
- package/dist/vite/node/chunks/node.js +1047 -875
- package/dist/vite/node/chunks/postcss-import.js +23 -25
- package/dist/vite/node/index.d.ts +63 -58
- package/dist/vite/node/module-runner.d.ts +13 -13
- package/dist/vite/node/module-runner.js +24 -19
- package/package.json +32 -26
- package/dist/rolldown/shared/binding-DwUQWZOo.mjs +0 -662
- package/dist/tsdown/dist-CMKwGGNp.js +0 -1059
- package/dist/tsdown/internal-DyaNxVWW.js +0 -3
|
@@ -227,9 +227,10 @@ var require_visit = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
227
227
|
function replaceNode(key, path, node) {
|
|
228
228
|
const parent = path[path.length - 1];
|
|
229
229
|
if (identity.isCollection(parent)) parent.items[key] = node;
|
|
230
|
-
else if (identity.isPair(parent))
|
|
231
|
-
|
|
232
|
-
|
|
230
|
+
else if (identity.isPair(parent)) {
|
|
231
|
+
if (key === "key") parent.key = node;
|
|
232
|
+
else parent.value = node;
|
|
233
|
+
} else if (identity.isDocument(parent)) parent.contents = node;
|
|
233
234
|
else {
|
|
234
235
|
const pt = identity.isAlias(parent) ? "alias" : "scalar";
|
|
235
236
|
throw new Error(`Cannot replace node with ${pt} parent`);
|
|
@@ -480,30 +481,32 @@ var require_applyReviver = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
480
481
|
* Includes extensions for handling Map and Set objects.
|
|
481
482
|
*/
|
|
482
483
|
function applyReviver(reviver, obj, key, val) {
|
|
483
|
-
if (val && typeof val === "object")
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
const
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
484
|
+
if (val && typeof val === "object") {
|
|
485
|
+
if (Array.isArray(val)) for (let i = 0, len = val.length; i < len; ++i) {
|
|
486
|
+
const v0 = val[i];
|
|
487
|
+
const v1 = applyReviver(reviver, val, String(i), v0);
|
|
488
|
+
if (v1 === void 0) delete val[i];
|
|
489
|
+
else if (v1 !== v0) val[i] = v1;
|
|
490
|
+
}
|
|
491
|
+
else if (val instanceof Map) for (const k of Array.from(val.keys())) {
|
|
492
|
+
const v0 = val.get(k);
|
|
493
|
+
const v1 = applyReviver(reviver, val, k, v0);
|
|
494
|
+
if (v1 === void 0) val.delete(k);
|
|
495
|
+
else if (v1 !== v0) val.set(k, v1);
|
|
496
|
+
}
|
|
497
|
+
else if (val instanceof Set) for (const v0 of Array.from(val)) {
|
|
498
|
+
const v1 = applyReviver(reviver, val, v0, v0);
|
|
499
|
+
if (v1 === void 0) val.delete(v0);
|
|
500
|
+
else if (v1 !== v0) {
|
|
501
|
+
val.delete(v0);
|
|
502
|
+
val.add(v1);
|
|
503
|
+
}
|
|
504
|
+
}
|
|
505
|
+
else for (const [k, v0] of Object.entries(val)) {
|
|
506
|
+
const v1 = applyReviver(reviver, val, k, v0);
|
|
507
|
+
if (v1 === void 0) delete val[k];
|
|
508
|
+
else if (v1 !== v0) val[k] = v1;
|
|
509
|
+
}
|
|
507
510
|
}
|
|
508
511
|
return reviver.call(obj, key, val);
|
|
509
512
|
}
|
|
@@ -924,8 +927,10 @@ var require_foldFlowLines = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
924
927
|
const folds = [];
|
|
925
928
|
const escapedFolds = {};
|
|
926
929
|
let end = lineWidth - indent.length;
|
|
927
|
-
if (typeof indentAtStart === "number")
|
|
928
|
-
|
|
930
|
+
if (typeof indentAtStart === "number") {
|
|
931
|
+
if (indentAtStart > lineWidth - Math.max(2, minContentWidth)) folds.push(0);
|
|
932
|
+
else end = lineWidth - indentAtStart;
|
|
933
|
+
}
|
|
929
934
|
let split = void 0;
|
|
930
935
|
let prev = void 0;
|
|
931
936
|
let overflow = false;
|
|
@@ -962,23 +967,25 @@ var require_foldFlowLines = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
962
967
|
const next = text[i + 1];
|
|
963
968
|
if (next && next !== " " && next !== "\n" && next !== " ") split = i;
|
|
964
969
|
}
|
|
965
|
-
if (i >= end)
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
prev
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
970
|
+
if (i >= end) {
|
|
971
|
+
if (split) {
|
|
972
|
+
folds.push(split);
|
|
973
|
+
end = split + endStep;
|
|
974
|
+
split = void 0;
|
|
975
|
+
} else if (mode === FOLD_QUOTED) {
|
|
976
|
+
while (prev === " " || prev === " ") {
|
|
977
|
+
prev = ch;
|
|
978
|
+
ch = text[i += 1];
|
|
979
|
+
overflow = true;
|
|
980
|
+
}
|
|
981
|
+
const j = i > escEnd + 1 ? i - 2 : escStart - 1;
|
|
982
|
+
if (escapedFolds[j]) return text;
|
|
983
|
+
folds.push(j);
|
|
984
|
+
escapedFolds[j] = true;
|
|
985
|
+
end = j + endStep;
|
|
986
|
+
split = void 0;
|
|
987
|
+
} else overflow = true;
|
|
988
|
+
}
|
|
982
989
|
}
|
|
983
990
|
prev = ch;
|
|
984
991
|
}
|
|
@@ -1454,8 +1461,10 @@ var require_log = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
1454
1461
|
if (logLevel === "debug") console.log(...messages);
|
|
1455
1462
|
}
|
|
1456
1463
|
function warn(logLevel, warning) {
|
|
1457
|
-
if (logLevel === "debug" || logLevel === "warn")
|
|
1458
|
-
|
|
1464
|
+
if (logLevel === "debug" || logLevel === "warn") {
|
|
1465
|
+
if (typeof node_process$2.emitWarning === "function") node_process$2.emitWarning(warning);
|
|
1466
|
+
else console.warn(warning);
|
|
1467
|
+
}
|
|
1459
1468
|
}
|
|
1460
1469
|
exports.debug = debug;
|
|
1461
1470
|
exports.warn = warn;
|
|
@@ -2280,11 +2289,12 @@ var require_pairs = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
2280
2289
|
if (iterable && Symbol.iterator in Object(iterable)) for (let it of iterable) {
|
|
2281
2290
|
if (typeof replacer === "function") it = replacer.call(iterable, String(i++), it);
|
|
2282
2291
|
let key, value;
|
|
2283
|
-
if (Array.isArray(it))
|
|
2284
|
-
|
|
2285
|
-
|
|
2286
|
-
|
|
2287
|
-
|
|
2292
|
+
if (Array.isArray(it)) {
|
|
2293
|
+
if (it.length === 2) {
|
|
2294
|
+
key = it[0];
|
|
2295
|
+
value = it[1];
|
|
2296
|
+
} else throw new TypeError(`Expected [key, value] tuple: ${it}`);
|
|
2297
|
+
} else if (it && it instanceof Object) {
|
|
2288
2298
|
const keys = Object.keys(it);
|
|
2289
2299
|
if (keys.length === 1) {
|
|
2290
2300
|
key = keys[0];
|
|
@@ -2360,8 +2370,10 @@ var require_omap = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
2360
2370
|
resolve(seq, onError) {
|
|
2361
2371
|
const pairs$1 = pairs.resolvePairs(seq, onError);
|
|
2362
2372
|
const seenKeys = [];
|
|
2363
|
-
for (const { key } of pairs$1.items) if (identity.isScalar(key))
|
|
2364
|
-
|
|
2373
|
+
for (const { key } of pairs$1.items) if (identity.isScalar(key)) {
|
|
2374
|
+
if (seenKeys.includes(key.value)) onError(`Ordered maps must not include duplicate keys: ${key.value}`);
|
|
2375
|
+
else seenKeys.push(key.value);
|
|
2376
|
+
}
|
|
2365
2377
|
return Object.assign(new YAMLOMap(), pairs$1);
|
|
2366
2378
|
},
|
|
2367
2379
|
createNode: (schema, iterable, ctx) => YAMLOMap.from(schema, iterable, ctx)
|
|
@@ -2572,9 +2584,10 @@ var require_set = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
2572
2584
|
tag: "tag:yaml.org,2002:set",
|
|
2573
2585
|
createNode: (schema, iterable, ctx) => YAMLSet.from(schema, iterable, ctx),
|
|
2574
2586
|
resolve(map, onError) {
|
|
2575
|
-
if (identity.isMap(map))
|
|
2576
|
-
|
|
2577
|
-
|
|
2587
|
+
if (identity.isMap(map)) {
|
|
2588
|
+
if (map.hasAllNullValues(true)) return Object.assign(new YAMLSet(), map);
|
|
2589
|
+
else onError("Set items must all have null values");
|
|
2590
|
+
} else onError("Expected a mapping for this tag");
|
|
2578
2591
|
return map;
|
|
2579
2592
|
}
|
|
2580
2593
|
};
|
|
@@ -2766,10 +2779,12 @@ var require_tags = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
2766
2779
|
const schemaTags = schemas.get(schemaName);
|
|
2767
2780
|
if (schemaTags && !customTags) return addMergeTag && !schemaTags.includes(merge.merge) ? schemaTags.concat(merge.merge) : schemaTags.slice();
|
|
2768
2781
|
let tags = schemaTags;
|
|
2769
|
-
if (!tags)
|
|
2770
|
-
|
|
2771
|
-
|
|
2772
|
-
|
|
2782
|
+
if (!tags) {
|
|
2783
|
+
if (Array.isArray(customTags)) tags = [];
|
|
2784
|
+
else {
|
|
2785
|
+
const keys = Array.from(schemas.keys()).filter((key) => key !== "yaml11").map((key) => JSON.stringify(key)).join(", ");
|
|
2786
|
+
throw new Error(`Unknown schema "${schemaName}"; use one of ${keys} or define customTags array`);
|
|
2787
|
+
}
|
|
2773
2788
|
}
|
|
2774
2789
|
if (Array.isArray(customTags)) for (const tag of customTags) tags = tags.concat(tag);
|
|
2775
2790
|
else if (typeof customTags === "function") tags = customTags(tags.slice());
|
|
@@ -2857,14 +2872,15 @@ var require_stringifyDocument = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
2857
2872
|
if ((body[0] === "|" || body[0] === ">") && lines[lines.length - 1] === "---") lines[lines.length - 1] = `--- ${body}`;
|
|
2858
2873
|
else lines.push(body);
|
|
2859
2874
|
} else lines.push(stringify.stringify(doc.contents, ctx));
|
|
2860
|
-
if (doc.directives?.docEnd)
|
|
2861
|
-
|
|
2862
|
-
|
|
2863
|
-
|
|
2864
|
-
|
|
2865
|
-
|
|
2866
|
-
|
|
2867
|
-
|
|
2875
|
+
if (doc.directives?.docEnd) {
|
|
2876
|
+
if (doc.comment) {
|
|
2877
|
+
const cs = commentString(doc.comment);
|
|
2878
|
+
if (cs.includes("\n")) {
|
|
2879
|
+
lines.push("...");
|
|
2880
|
+
lines.push(stringifyComment.indentComment(cs, ""));
|
|
2881
|
+
} else lines.push(`... ${cs}`);
|
|
2882
|
+
} else lines.push("...");
|
|
2883
|
+
} else {
|
|
2868
2884
|
let dc = doc.comment;
|
|
2869
2885
|
if (dc && chompKeep) dc = dc.replace(/^\n+/, "");
|
|
2870
2886
|
if (dc) {
|
|
@@ -3403,8 +3419,10 @@ var require_resolve_block_map = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
3403
3419
|
}
|
|
3404
3420
|
if (!keyProps.anchor && !keyProps.tag && !sep) {
|
|
3405
3421
|
commentEnd = keyProps.end;
|
|
3406
|
-
if (keyProps.comment)
|
|
3407
|
-
|
|
3422
|
+
if (keyProps.comment) {
|
|
3423
|
+
if (map.comment) map.comment += "\n" + keyProps.comment;
|
|
3424
|
+
else map.comment = keyProps.comment;
|
|
3425
|
+
}
|
|
3408
3426
|
continue;
|
|
3409
3427
|
}
|
|
3410
3428
|
if (keyProps.newlineAfterProp || utilContainsNewline.containsNewline(key)) onError(key ?? start[start.length - 1], "MULTILINE_IMPLICIT_KEY", "Implicit keys need to be on a single line");
|
|
@@ -3437,8 +3455,10 @@ var require_resolve_block_map = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
3437
3455
|
map.items.push(pair);
|
|
3438
3456
|
} else {
|
|
3439
3457
|
if (implicitKey) onError(keyNode.range, "MISSING_CHAR", "Implicit map keys need to be followed by map values");
|
|
3440
|
-
if (valueProps.comment)
|
|
3441
|
-
|
|
3458
|
+
if (valueProps.comment) {
|
|
3459
|
+
if (keyNode.comment) keyNode.comment += "\n" + valueProps.comment;
|
|
3460
|
+
else keyNode.comment = valueProps.comment;
|
|
3461
|
+
}
|
|
3442
3462
|
const pair = new Pair.Pair(keyNode);
|
|
3443
3463
|
if (ctx.options.keepSourceTokens) pair.srcToken = collItem;
|
|
3444
3464
|
map.items.push(pair);
|
|
@@ -3475,12 +3495,15 @@ var require_resolve_block_seq = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
3475
3495
|
parentIndent: bs.indent,
|
|
3476
3496
|
startOnNewline: true
|
|
3477
3497
|
});
|
|
3478
|
-
if (!props.found)
|
|
3479
|
-
|
|
3480
|
-
|
|
3481
|
-
|
|
3482
|
-
|
|
3483
|
-
|
|
3498
|
+
if (!props.found) {
|
|
3499
|
+
if (props.anchor || props.tag || value) {
|
|
3500
|
+
if (value?.type === "block-seq") onError(props.end, "BAD_INDENT", "All sequence items must start at the same column");
|
|
3501
|
+
else onError(offset, "MISSING_CHAR", "Sequence item without - indicator");
|
|
3502
|
+
} else {
|
|
3503
|
+
commentEnd = props.end;
|
|
3504
|
+
if (props.comment) seq.comment = props.comment;
|
|
3505
|
+
continue;
|
|
3506
|
+
}
|
|
3484
3507
|
}
|
|
3485
3508
|
const node = value ? composeNode(ctx, value, props, onError) : composeEmptyNode(ctx, props.end, start, null, props, onError);
|
|
3486
3509
|
if (ctx.schema.compat) utilFlowIndentCheck.flowIndentCheck(bs.indent, value, onError);
|
|
@@ -3572,8 +3595,10 @@ var require_resolve_flow_collection = /* @__PURE__ */ __commonJSMin(((exports) =
|
|
|
3572
3595
|
if (!props.anchor && !props.tag && !sep && !value) {
|
|
3573
3596
|
if (i === 0 && props.comma) onError(props.comma, "UNEXPECTED_TOKEN", `Unexpected , in ${fcName}`);
|
|
3574
3597
|
else if (i < fc.items.length - 1) onError(props.start, "UNEXPECTED_TOKEN", `Unexpected empty item in ${fcName}`);
|
|
3575
|
-
if (props.comment)
|
|
3576
|
-
|
|
3598
|
+
if (props.comment) {
|
|
3599
|
+
if (coll.comment) coll.comment += "\n" + props.comment;
|
|
3600
|
+
else coll.comment = props.comment;
|
|
3601
|
+
}
|
|
3577
3602
|
offset = props.end;
|
|
3578
3603
|
continue;
|
|
3579
3604
|
}
|
|
@@ -3633,13 +3658,17 @@ var require_resolve_flow_collection = /* @__PURE__ */ __commonJSMin(((exports) =
|
|
|
3633
3658
|
}
|
|
3634
3659
|
if (props.start < valueProps.found.offset - 1024) onError(valueProps.found, "KEY_OVER_1024_CHARS", "The : indicator must be at most 1024 chars after the start of an implicit flow sequence key");
|
|
3635
3660
|
}
|
|
3636
|
-
} else if (value)
|
|
3637
|
-
|
|
3661
|
+
} else if (value) {
|
|
3662
|
+
if ("source" in value && value.source?.[0] === ":") onError(value, "MISSING_CHAR", `Missing space after : in ${fcName}`);
|
|
3663
|
+
else onError(valueProps.start, "MISSING_CHAR", `Missing , or : between ${fcName} items`);
|
|
3664
|
+
}
|
|
3638
3665
|
const valueNode = value ? composeNode(ctx, value, valueProps, onError) : valueProps.found ? composeEmptyNode(ctx, valueProps.end, sep, null, valueProps, onError) : null;
|
|
3639
3666
|
if (valueNode) {
|
|
3640
3667
|
if (isBlock(value)) onError(valueNode.range, "BLOCK_IN_FLOW", blockMsg);
|
|
3641
|
-
} else if (valueProps.comment)
|
|
3642
|
-
|
|
3668
|
+
} else if (valueProps.comment) {
|
|
3669
|
+
if (keyNode.comment) keyNode.comment += "\n" + valueProps.comment;
|
|
3670
|
+
else keyNode.comment = valueProps.comment;
|
|
3671
|
+
}
|
|
3643
3672
|
const pair = new Pair.Pair(keyNode, valueNode);
|
|
3644
3673
|
if (ctx.options.keepSourceTokens) pair.srcToken = collItem;
|
|
3645
3674
|
if (isMap) {
|
|
@@ -3673,8 +3702,10 @@ var require_resolve_flow_collection = /* @__PURE__ */ __commonJSMin(((exports) =
|
|
|
3673
3702
|
}
|
|
3674
3703
|
if (ee.length > 0) {
|
|
3675
3704
|
const end = resolveEnd.resolveEnd(ee, cePos, ctx.options.strict, onError);
|
|
3676
|
-
if (end.comment)
|
|
3677
|
-
|
|
3705
|
+
if (end.comment) {
|
|
3706
|
+
if (coll.comment) coll.comment += "\n" + end.comment;
|
|
3707
|
+
else coll.comment = end.comment;
|
|
3708
|
+
}
|
|
3678
3709
|
coll.range = [
|
|
3679
3710
|
fc.offset,
|
|
3680
3711
|
cePos,
|
|
@@ -3822,9 +3853,10 @@ var require_resolve_block_scalar = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
3822
3853
|
value += sep + indent.slice(trimIndent) + content;
|
|
3823
3854
|
sep = "\n";
|
|
3824
3855
|
prevMoreIndented = true;
|
|
3825
|
-
} else if (content === "")
|
|
3826
|
-
|
|
3827
|
-
|
|
3856
|
+
} else if (content === "") {
|
|
3857
|
+
if (sep === "\n") value += "\n";
|
|
3858
|
+
else sep = "\n";
|
|
3859
|
+
} else {
|
|
3828
3860
|
value += sep + content;
|
|
3829
3861
|
sep = " ";
|
|
3830
3862
|
prevMoreIndented = false;
|
|
@@ -4017,9 +4049,10 @@ var require_resolve_flow_scalar = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
4017
4049
|
let pos = first.lastIndex;
|
|
4018
4050
|
line.lastIndex = pos;
|
|
4019
4051
|
while (match = line.exec(source)) {
|
|
4020
|
-
if (match[1] === "")
|
|
4021
|
-
|
|
4022
|
-
|
|
4052
|
+
if (match[1] === "") {
|
|
4053
|
+
if (sep === "\n") res += sep;
|
|
4054
|
+
else sep = "\n";
|
|
4055
|
+
} else {
|
|
4023
4056
|
res += sep + match[1];
|
|
4024
4057
|
sep = " ";
|
|
4025
4058
|
}
|
|
@@ -4155,8 +4188,10 @@ var require_compose_scalar = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
4155
4188
|
function findScalarTagByName(schema, value, tagName, tagToken, onError) {
|
|
4156
4189
|
if (tagName === "!") return schema[identity.SCALAR];
|
|
4157
4190
|
const matchWithTest = [];
|
|
4158
|
-
for (const tag of schema.tags) if (!tag.collection && tag.tag === tagName)
|
|
4159
|
-
|
|
4191
|
+
for (const tag of schema.tags) if (!tag.collection && tag.tag === tagName) {
|
|
4192
|
+
if (tag.default && tag.test) matchWithTest.push(tag);
|
|
4193
|
+
else return tag;
|
|
4194
|
+
}
|
|
4160
4195
|
for (const tag of matchWithTest) if (tag.test?.test(value)) return tag;
|
|
4161
4196
|
const kt = schema.knownTags[tagName];
|
|
4162
4197
|
if (kt && !kt.collection) {
|
|
@@ -4254,8 +4289,10 @@ var require_compose_node = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
4254
4289
|
if (anchor && node.anchor === "") onError(anchor, "BAD_ALIAS", "Anchor cannot be an empty string");
|
|
4255
4290
|
if (atKey && ctx.options.stringKeys && (!identity.isScalar(node) || typeof node.value !== "string" || node.tag && node.tag !== "tag:yaml.org,2002:str")) onError(tag ?? token, "NON_STRING_KEY", "With stringKeys, all keys must be strings");
|
|
4256
4291
|
if (spaceBefore) node.spaceBefore = true;
|
|
4257
|
-
if (comment)
|
|
4258
|
-
|
|
4292
|
+
if (comment) {
|
|
4293
|
+
if (token.type === "scalar" && token.source === "") node.comment = comment;
|
|
4294
|
+
else node.commentBefore = comment;
|
|
4295
|
+
}
|
|
4259
4296
|
if (ctx.options.keepSourceTokens && isSrcToken) node.srcToken = token;
|
|
4260
4297
|
return node;
|
|
4261
4298
|
}
|
|
@@ -5444,11 +5481,13 @@ var require_lexer = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
5444
5481
|
end = i;
|
|
5445
5482
|
} else if (isEmpty(ch)) {
|
|
5446
5483
|
let next = this.buffer[i + 1];
|
|
5447
|
-
if (ch === "\r")
|
|
5448
|
-
|
|
5449
|
-
|
|
5450
|
-
|
|
5451
|
-
|
|
5484
|
+
if (ch === "\r") {
|
|
5485
|
+
if (next === "\n") {
|
|
5486
|
+
i += 1;
|
|
5487
|
+
ch = "\n";
|
|
5488
|
+
next = this.buffer[i + 1];
|
|
5489
|
+
} else end = i;
|
|
5490
|
+
}
|
|
5452
5491
|
if (next === "#" || inFlow && flowIndicatorChars.has(next)) break;
|
|
5453
5492
|
if (ch === "\n") {
|
|
5454
5493
|
const cs = this.continueScalar(i + 1);
|
|
@@ -5665,9 +5704,10 @@ var require_parser = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
5665
5704
|
for (const it of fc.items) if (it.sep && !it.value && !includesToken(it.start, "explicit-key-ind") && !includesToken(it.sep, "map-value-ind")) {
|
|
5666
5705
|
if (it.key) it.value = it.key;
|
|
5667
5706
|
delete it.key;
|
|
5668
|
-
if (isFlowToken(it.value))
|
|
5669
|
-
|
|
5670
|
-
|
|
5707
|
+
if (isFlowToken(it.value)) {
|
|
5708
|
+
if (it.value.end) arrayPushArray(it.value.end, it.sep);
|
|
5709
|
+
else it.value.end = it.sep;
|
|
5710
|
+
} else arrayPushArray(it.start, it.sep);
|
|
5671
5711
|
delete it.sep;
|
|
5672
5712
|
}
|
|
5673
5713
|
}
|
|
@@ -6102,58 +6142,60 @@ var require_parser = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
6102
6142
|
this.onKeyLine = true;
|
|
6103
6143
|
return;
|
|
6104
6144
|
case "map-value-ind":
|
|
6105
|
-
if (it.explicitKey)
|
|
6106
|
-
|
|
6107
|
-
|
|
6108
|
-
});
|
|
6109
|
-
else {
|
|
6110
|
-
const start = getFirstKeyStartProps(it.start);
|
|
6111
|
-
this.stack.push({
|
|
6112
|
-
type: "block-map",
|
|
6113
|
-
offset: this.offset,
|
|
6114
|
-
indent: this.indent,
|
|
6115
|
-
items: [{
|
|
6116
|
-
start,
|
|
6145
|
+
if (it.explicitKey) {
|
|
6146
|
+
if (!it.sep) {
|
|
6147
|
+
if (includesToken(it.start, "newline")) Object.assign(it, {
|
|
6117
6148
|
key: null,
|
|
6118
6149
|
sep: [this.sourceToken]
|
|
6119
|
-
}
|
|
6120
|
-
|
|
6121
|
-
|
|
6122
|
-
|
|
6123
|
-
|
|
6124
|
-
|
|
6125
|
-
|
|
6126
|
-
|
|
6127
|
-
|
|
6128
|
-
|
|
6129
|
-
|
|
6130
|
-
|
|
6131
|
-
|
|
6132
|
-
|
|
6150
|
+
});
|
|
6151
|
+
else {
|
|
6152
|
+
const start = getFirstKeyStartProps(it.start);
|
|
6153
|
+
this.stack.push({
|
|
6154
|
+
type: "block-map",
|
|
6155
|
+
offset: this.offset,
|
|
6156
|
+
indent: this.indent,
|
|
6157
|
+
items: [{
|
|
6158
|
+
start,
|
|
6159
|
+
key: null,
|
|
6160
|
+
sep: [this.sourceToken]
|
|
6161
|
+
}]
|
|
6162
|
+
});
|
|
6163
|
+
}
|
|
6164
|
+
} else if (it.value) map.items.push({
|
|
6165
|
+
start: [],
|
|
6133
6166
|
key: null,
|
|
6134
6167
|
sep: [this.sourceToken]
|
|
6135
|
-
}
|
|
6136
|
-
|
|
6137
|
-
else if (isFlowToken(it.key) && !includesToken(it.sep, "newline")) {
|
|
6138
|
-
const start = getFirstKeyStartProps(it.start);
|
|
6139
|
-
const key = it.key;
|
|
6140
|
-
const sep = it.sep;
|
|
6141
|
-
sep.push(this.sourceToken);
|
|
6142
|
-
delete it.key;
|
|
6143
|
-
delete it.sep;
|
|
6144
|
-
this.stack.push({
|
|
6168
|
+
});
|
|
6169
|
+
else if (includesToken(it.sep, "map-value-ind")) this.stack.push({
|
|
6145
6170
|
type: "block-map",
|
|
6146
6171
|
offset: this.offset,
|
|
6147
6172
|
indent: this.indent,
|
|
6148
6173
|
items: [{
|
|
6149
6174
|
start,
|
|
6150
|
-
key,
|
|
6151
|
-
sep
|
|
6175
|
+
key: null,
|
|
6176
|
+
sep: [this.sourceToken]
|
|
6152
6177
|
}]
|
|
6153
6178
|
});
|
|
6154
|
-
|
|
6155
|
-
|
|
6156
|
-
|
|
6179
|
+
else if (isFlowToken(it.key) && !includesToken(it.sep, "newline")) {
|
|
6180
|
+
const start = getFirstKeyStartProps(it.start);
|
|
6181
|
+
const key = it.key;
|
|
6182
|
+
const sep = it.sep;
|
|
6183
|
+
sep.push(this.sourceToken);
|
|
6184
|
+
delete it.key;
|
|
6185
|
+
delete it.sep;
|
|
6186
|
+
this.stack.push({
|
|
6187
|
+
type: "block-map",
|
|
6188
|
+
offset: this.offset,
|
|
6189
|
+
indent: this.indent,
|
|
6190
|
+
items: [{
|
|
6191
|
+
start,
|
|
6192
|
+
key,
|
|
6193
|
+
sep
|
|
6194
|
+
}]
|
|
6195
|
+
});
|
|
6196
|
+
} else if (start.length > 0) it.sep = it.sep.concat(start, this.sourceToken);
|
|
6197
|
+
else it.sep.push(this.sourceToken);
|
|
6198
|
+
} else if (!it.sep) Object.assign(it, {
|
|
6157
6199
|
key: null,
|
|
6158
6200
|
sep: [this.sourceToken]
|
|
6159
6201
|
});
|
|
@@ -6526,8 +6568,10 @@ var require_public_api = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
6526
6568
|
const doc = parseDocument(src, options);
|
|
6527
6569
|
if (!doc) return null;
|
|
6528
6570
|
doc.warnings.forEach((warning) => log.warn(doc.options.logLevel, warning));
|
|
6529
|
-
if (doc.errors.length > 0)
|
|
6530
|
-
|
|
6571
|
+
if (doc.errors.length > 0) {
|
|
6572
|
+
if (doc.options.logLevel !== "silent") throw doc.errors[0];
|
|
6573
|
+
else doc.errors = [];
|
|
6574
|
+
}
|
|
6531
6575
|
return doc.toJS(Object.assign({ reviver: _reviver }, options));
|
|
6532
6576
|
}
|
|
6533
6577
|
function stringify(value, replacer, options) {
|