vite-plus 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/AGENTS.md +7 -0
- package/README.md +13 -6
- package/binding/index.cjs +57 -54
- package/binding/index.d.cts +100 -3
- package/dist/{agent-CI79DuSy.js → agent-Wqx0MPk0.js} +4 -188
- package/dist/bin.js +298 -278
- package/dist/command-CLJK5jGW.js +2 -0
- package/dist/command-CguLh2KL.js +471 -0
- package/dist/config/bin.js +29 -15
- package/dist/{constants-BppDcRc1.js → constants-Bn-U8o4v.js} +13 -3
- package/dist/create/bin.js +197 -247
- package/dist/{define-config-DPnHe1Mx.js → define-config-GXUdVT-0.js} +3 -3
- package/dist/{define-config-CEm_MtvJ.cjs → define-config-WiVlryJ2.cjs} +2 -2
- package/dist/define-config.cjs +1 -1
- package/dist/define-config.js +1 -1
- package/dist/{dist-CSQWHI6y.js → dist-BDYZP12R.js} +193 -149
- package/dist/dist-Dqv1-Clg.js +3 -0
- package/dist/{editor-CGWdbLgD.js → editor-CC4DqODz.js} +736 -153
- package/dist/{terminal-CrqqK8WT.js → help-BmKpeOP9.js} +27 -34
- package/dist/hooks/bin.d.ts +1 -0
- package/dist/hooks/bin.js +131 -0
- package/dist/hooks-DFqViZqZ.js +573 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/{json-BU88uu6o.js → json-cULBl7Pi.js} +145 -139
- package/dist/migration/bin.js +67 -21
- package/dist/migration/compat/worker.js +1 -1
- package/dist/{oxlint-plugin-config-BHOzlwMw.js → oxlint-plugin-config-DX5ezKbB.js} +1 -1
- package/dist/oxlint-plugin.js +1 -1
- package/dist/pack-bin.js +5 -4
- package/dist/{package-hV-77cBb.js → package-CBe9EWPY.js} +2 -2
- package/dist/{prompts-DYap08te.js → prompts-DF3yU-eU.js} +136 -512
- package/dist/{report-BS7ULx7A.js → report-ZNR1Mk6h.js} +1 -0
- package/dist/{resolve-vite-config-EWXclqvV.js → resolve-vite-config-ipGb39Jo.js} +2 -9
- package/dist/staged/bin.js +299 -251
- package/dist/terminal-MKGAuy-p.js +39 -0
- package/dist/test/browser/providers/playwright/context.d.ts +1 -1
- package/dist/test/browser/providers/playwright.d.ts +6 -6
- package/dist/test/browser/providers/preview/context.d.ts +1 -1
- package/dist/test/browser/providers/preview.d.ts +4 -4
- package/dist/test/browser/providers/webdriverio/context.d.ts +1 -1
- package/dist/test/browser/providers/webdriverio.d.ts +6 -6
- package/dist/test/browser-playwright/context.d.ts +1 -1
- package/dist/test/browser-playwright.d.ts +6 -6
- package/dist/test/browser-preview/context.d.ts +1 -1
- package/dist/test/browser-preview.d.ts +4 -4
- package/dist/test/browser-webdriverio/context.d.ts +1 -1
- package/dist/test/browser-webdriverio.d.ts +6 -6
- package/dist/test/context.d.ts +3 -3
- package/dist/test/locators.d.ts +1 -1
- package/dist/toolchain.d.ts +25 -0
- package/dist/toolchain.js +194 -0
- package/dist/toolchain.json +193 -0
- package/dist/tsconfig-BVHG3DpR.js +2 -0
- package/dist/{tsconfig-CVUKLfL8.js → tsconfig-LD2QhQ0O.js} +5 -4
- package/dist/tsgolint-path.js +1 -1
- package/dist/version.js +5 -4
- package/dist/versions.d.ts +3 -3
- package/dist/versions.js +6 -6
- package/docs/guide/ci.md +37 -4
- package/docs/guide/commit-hooks.md +87 -14
- package/docs/guide/create.md +7 -4
- package/docs/guide/env.md +20 -6
- package/docs/guide/fmt.md +2 -2
- package/docs/guide/github-actions-cache.md +5 -1
- package/docs/guide/ide-integration.md +61 -2
- package/docs/guide/index.md +3 -1
- package/docs/guide/install.md +27 -1
- package/docs/guide/installer-env-vars.md +53 -6
- package/docs/guide/lint.md +3 -1
- package/docs/guide/migrate-rules.md +9 -0
- package/docs/guide/migrate.md +41 -4
- package/docs/guide/monorepo.md +4 -4
- package/docs/guide/test.md +8 -0
- package/docs/guide/troubleshooting.md +12 -4
- package/docs/guide/upgrade.md +75 -5
- package/package.json +36 -33
- package/rules/vite-tools.yml +0 -7
- package/dist/dist-DT25H9pj.js +0 -3
- package/docs/_data/team.ts +0 -131
- package/docs/package.json +0 -30
- package/docs/pnpm-lock.yaml +0 -4003
- package/docs/pnpm-workspace.yaml +0 -6
- package/docs/public/checkmark.svg +0 -1
- package/docs/public/cta-background.jpg +0 -0
- package/docs/public/favicon.svg +0 -1
- package/docs/public/icon.svg +0 -1
- package/docs/public/logo.svg +0 -1
- package/docs/public/og.jpg +0 -0
- package/docs/vite.config.ts +0 -17
- package/dist/{log-update-CoW8Z4Dl.js → log-update-DHZRyJ2m.js} +1 -1
- package/dist/{tsgolint-path-eMZT-oea.js → tsgolint-path-CbDReEOx.js} +1 -1
|
@@ -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
|
}
|
|
@@ -1458,8 +1465,10 @@ var require_log = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
1458
1465
|
if (logLevel === "debug") console.log(...messages);
|
|
1459
1466
|
}
|
|
1460
1467
|
function warn(logLevel, warning) {
|
|
1461
|
-
if (logLevel === "debug" || logLevel === "warn")
|
|
1462
|
-
|
|
1468
|
+
if (logLevel === "debug" || logLevel === "warn") {
|
|
1469
|
+
if (typeof node_process$2.emitWarning === "function") node_process$2.emitWarning(warning);
|
|
1470
|
+
else console.warn(warning);
|
|
1471
|
+
}
|
|
1463
1472
|
}
|
|
1464
1473
|
exports.debug = debug;
|
|
1465
1474
|
exports.warn = warn;
|
|
@@ -2286,11 +2295,12 @@ var require_pairs = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
2286
2295
|
if (iterable && Symbol.iterator in Object(iterable)) for (let it of iterable) {
|
|
2287
2296
|
if (typeof replacer === "function") it = replacer.call(iterable, String(i++), it);
|
|
2288
2297
|
let key, value;
|
|
2289
|
-
if (Array.isArray(it))
|
|
2290
|
-
|
|
2291
|
-
|
|
2292
|
-
|
|
2293
|
-
|
|
2298
|
+
if (Array.isArray(it)) {
|
|
2299
|
+
if (it.length === 2) {
|
|
2300
|
+
key = it[0];
|
|
2301
|
+
value = it[1];
|
|
2302
|
+
} else throw new TypeError(`Expected [key, value] tuple: ${it}`);
|
|
2303
|
+
} else if (it && it instanceof Object) {
|
|
2294
2304
|
const keys = Object.keys(it);
|
|
2295
2305
|
if (keys.length === 1) {
|
|
2296
2306
|
key = keys[0];
|
|
@@ -2366,8 +2376,10 @@ var require_omap = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
2366
2376
|
resolve(seq, onError) {
|
|
2367
2377
|
const pairs$1 = pairs.resolvePairs(seq, onError);
|
|
2368
2378
|
const seenKeys = [];
|
|
2369
|
-
for (const { key } of pairs$1.items) if (identity.isScalar(key))
|
|
2370
|
-
|
|
2379
|
+
for (const { key } of pairs$1.items) if (identity.isScalar(key)) {
|
|
2380
|
+
if (seenKeys.includes(key.value)) onError(`Ordered maps must not include duplicate keys: ${key.value}`);
|
|
2381
|
+
else seenKeys.push(key.value);
|
|
2382
|
+
}
|
|
2371
2383
|
return Object.assign(new YAMLOMap(), pairs$1);
|
|
2372
2384
|
},
|
|
2373
2385
|
createNode: (schema, iterable, ctx) => YAMLOMap.from(schema, iterable, ctx)
|
|
@@ -2578,9 +2590,10 @@ var require_set = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
2578
2590
|
tag: "tag:yaml.org,2002:set",
|
|
2579
2591
|
createNode: (schema, iterable, ctx) => YAMLSet.from(schema, iterable, ctx),
|
|
2580
2592
|
resolve(map, onError) {
|
|
2581
|
-
if (identity.isMap(map))
|
|
2582
|
-
|
|
2583
|
-
|
|
2593
|
+
if (identity.isMap(map)) {
|
|
2594
|
+
if (map.hasAllNullValues(true)) return Object.assign(new YAMLSet(), map);
|
|
2595
|
+
else onError("Set items must all have null values");
|
|
2596
|
+
} else onError("Expected a mapping for this tag");
|
|
2584
2597
|
return map;
|
|
2585
2598
|
}
|
|
2586
2599
|
};
|
|
@@ -2772,10 +2785,12 @@ var require_tags = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
2772
2785
|
const schemaTags = schemas.get(schemaName);
|
|
2773
2786
|
if (schemaTags && !customTags) return addMergeTag && !schemaTags.includes(merge.merge) ? schemaTags.concat(merge.merge) : schemaTags.slice();
|
|
2774
2787
|
let tags = schemaTags;
|
|
2775
|
-
if (!tags)
|
|
2776
|
-
|
|
2777
|
-
|
|
2778
|
-
|
|
2788
|
+
if (!tags) {
|
|
2789
|
+
if (Array.isArray(customTags)) tags = [];
|
|
2790
|
+
else {
|
|
2791
|
+
const keys = Array.from(schemas.keys()).filter((key) => key !== "yaml11").map((key) => JSON.stringify(key)).join(", ");
|
|
2792
|
+
throw new Error(`Unknown schema "${schemaName}"; use one of ${keys} or define customTags array`);
|
|
2793
|
+
}
|
|
2779
2794
|
}
|
|
2780
2795
|
if (Array.isArray(customTags)) for (const tag of customTags) tags = tags.concat(tag);
|
|
2781
2796
|
else if (typeof customTags === "function") tags = customTags(tags.slice());
|
|
@@ -2864,14 +2879,15 @@ var require_stringifyDocument = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
2864
2879
|
if ((body[0] === "|" || body[0] === ">") && lines[lines.length - 1] === "---") lines[lines.length - 1] = `--- ${body}`;
|
|
2865
2880
|
else lines.push(body);
|
|
2866
2881
|
} else lines.push(stringify.stringify(doc.contents, ctx));
|
|
2867
|
-
if (doc.directives?.docEnd)
|
|
2868
|
-
|
|
2869
|
-
|
|
2870
|
-
|
|
2871
|
-
|
|
2872
|
-
|
|
2873
|
-
|
|
2874
|
-
|
|
2882
|
+
if (doc.directives?.docEnd) {
|
|
2883
|
+
if (doc.comment) {
|
|
2884
|
+
const cs = commentString(doc.comment);
|
|
2885
|
+
if (cs.includes("\n")) {
|
|
2886
|
+
lines.push("...");
|
|
2887
|
+
lines.push(stringifyComment.indentComment(cs, ""));
|
|
2888
|
+
} else lines.push(`... ${cs}`);
|
|
2889
|
+
} else lines.push("...");
|
|
2890
|
+
} else {
|
|
2875
2891
|
let dc = doc.comment;
|
|
2876
2892
|
if (dc && chompKeep) dc = dc.replace(/^\n+/, "");
|
|
2877
2893
|
if (dc) {
|
|
@@ -3410,8 +3426,10 @@ var require_resolve_block_map = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
3410
3426
|
}
|
|
3411
3427
|
if (!keyProps.anchor && !keyProps.tag && !sep) {
|
|
3412
3428
|
commentEnd = keyProps.end;
|
|
3413
|
-
if (keyProps.comment)
|
|
3414
|
-
|
|
3429
|
+
if (keyProps.comment) {
|
|
3430
|
+
if (map.comment) map.comment += "\n" + keyProps.comment;
|
|
3431
|
+
else map.comment = keyProps.comment;
|
|
3432
|
+
}
|
|
3415
3433
|
continue;
|
|
3416
3434
|
}
|
|
3417
3435
|
if (keyProps.newlineAfterProp || utilContainsNewline.containsNewline(key)) onError(key ?? start[start.length - 1], "MULTILINE_IMPLICIT_KEY", "Implicit keys need to be on a single line");
|
|
@@ -3444,8 +3462,10 @@ var require_resolve_block_map = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
3444
3462
|
map.items.push(pair);
|
|
3445
3463
|
} else {
|
|
3446
3464
|
if (implicitKey) onError(keyNode.range, "MISSING_CHAR", "Implicit map keys need to be followed by map values");
|
|
3447
|
-
if (valueProps.comment)
|
|
3448
|
-
|
|
3465
|
+
if (valueProps.comment) {
|
|
3466
|
+
if (keyNode.comment) keyNode.comment += "\n" + valueProps.comment;
|
|
3467
|
+
else keyNode.comment = valueProps.comment;
|
|
3468
|
+
}
|
|
3449
3469
|
const pair = new Pair.Pair(keyNode);
|
|
3450
3470
|
if (ctx.options.keepSourceTokens) pair.srcToken = collItem;
|
|
3451
3471
|
map.items.push(pair);
|
|
@@ -3482,12 +3502,15 @@ var require_resolve_block_seq = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
3482
3502
|
parentIndent: bs.indent,
|
|
3483
3503
|
startOnNewline: true
|
|
3484
3504
|
});
|
|
3485
|
-
if (!props.found)
|
|
3486
|
-
|
|
3487
|
-
|
|
3488
|
-
|
|
3489
|
-
|
|
3490
|
-
|
|
3505
|
+
if (!props.found) {
|
|
3506
|
+
if (props.anchor || props.tag || value) {
|
|
3507
|
+
if (value?.type === "block-seq") onError(props.end, "BAD_INDENT", "All sequence items must start at the same column");
|
|
3508
|
+
else onError(offset, "MISSING_CHAR", "Sequence item without - indicator");
|
|
3509
|
+
} else {
|
|
3510
|
+
commentEnd = props.end;
|
|
3511
|
+
if (props.comment) seq.comment = props.comment;
|
|
3512
|
+
continue;
|
|
3513
|
+
}
|
|
3491
3514
|
}
|
|
3492
3515
|
const node = value ? composeNode(ctx, value, props, onError) : composeEmptyNode(ctx, props.end, start, null, props, onError);
|
|
3493
3516
|
if (ctx.schema.compat) utilFlowIndentCheck.flowIndentCheck(bs.indent, value, onError);
|
|
@@ -3579,8 +3602,10 @@ var require_resolve_flow_collection = /* @__PURE__ */ __commonJSMin(((exports) =
|
|
|
3579
3602
|
if (!props.anchor && !props.tag && !sep && !value) {
|
|
3580
3603
|
if (i === 0 && props.comma) onError(props.comma, "UNEXPECTED_TOKEN", `Unexpected , in ${fcName}`);
|
|
3581
3604
|
else if (i < fc.items.length - 1) onError(props.start, "UNEXPECTED_TOKEN", `Unexpected empty item in ${fcName}`);
|
|
3582
|
-
if (props.comment)
|
|
3583
|
-
|
|
3605
|
+
if (props.comment) {
|
|
3606
|
+
if (coll.comment) coll.comment += "\n" + props.comment;
|
|
3607
|
+
else coll.comment = props.comment;
|
|
3608
|
+
}
|
|
3584
3609
|
offset = props.end;
|
|
3585
3610
|
continue;
|
|
3586
3611
|
}
|
|
@@ -3640,13 +3665,17 @@ var require_resolve_flow_collection = /* @__PURE__ */ __commonJSMin(((exports) =
|
|
|
3640
3665
|
}
|
|
3641
3666
|
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");
|
|
3642
3667
|
}
|
|
3643
|
-
} else if (value)
|
|
3644
|
-
|
|
3668
|
+
} else if (value) {
|
|
3669
|
+
if ("source" in value && value.source?.[0] === ":") onError(value, "MISSING_CHAR", `Missing space after : in ${fcName}`);
|
|
3670
|
+
else onError(valueProps.start, "MISSING_CHAR", `Missing , or : between ${fcName} items`);
|
|
3671
|
+
}
|
|
3645
3672
|
const valueNode = value ? composeNode(ctx, value, valueProps, onError) : valueProps.found ? composeEmptyNode(ctx, valueProps.end, sep, null, valueProps, onError) : null;
|
|
3646
3673
|
if (valueNode) {
|
|
3647
3674
|
if (isBlock(value)) onError(valueNode.range, "BLOCK_IN_FLOW", blockMsg);
|
|
3648
|
-
} else if (valueProps.comment)
|
|
3649
|
-
|
|
3675
|
+
} else if (valueProps.comment) {
|
|
3676
|
+
if (keyNode.comment) keyNode.comment += "\n" + valueProps.comment;
|
|
3677
|
+
else keyNode.comment = valueProps.comment;
|
|
3678
|
+
}
|
|
3650
3679
|
const pair = new Pair.Pair(keyNode, valueNode);
|
|
3651
3680
|
if (ctx.options.keepSourceTokens) pair.srcToken = collItem;
|
|
3652
3681
|
if (isMap) {
|
|
@@ -3680,8 +3709,10 @@ var require_resolve_flow_collection = /* @__PURE__ */ __commonJSMin(((exports) =
|
|
|
3680
3709
|
}
|
|
3681
3710
|
if (ee.length > 0) {
|
|
3682
3711
|
const end = resolveEnd.resolveEnd(ee, cePos, ctx.options.strict, onError);
|
|
3683
|
-
if (end.comment)
|
|
3684
|
-
|
|
3712
|
+
if (end.comment) {
|
|
3713
|
+
if (coll.comment) coll.comment += "\n" + end.comment;
|
|
3714
|
+
else coll.comment = end.comment;
|
|
3715
|
+
}
|
|
3685
3716
|
coll.range = [
|
|
3686
3717
|
fc.offset,
|
|
3687
3718
|
cePos,
|
|
@@ -3829,9 +3860,10 @@ var require_resolve_block_scalar = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
3829
3860
|
value += sep + indent.slice(trimIndent) + content;
|
|
3830
3861
|
sep = "\n";
|
|
3831
3862
|
prevMoreIndented = true;
|
|
3832
|
-
} else if (content === "")
|
|
3833
|
-
|
|
3834
|
-
|
|
3863
|
+
} else if (content === "") {
|
|
3864
|
+
if (sep === "\n") value += "\n";
|
|
3865
|
+
else sep = "\n";
|
|
3866
|
+
} else {
|
|
3835
3867
|
value += sep + content;
|
|
3836
3868
|
sep = " ";
|
|
3837
3869
|
prevMoreIndented = false;
|
|
@@ -4024,9 +4056,10 @@ var require_resolve_flow_scalar = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
4024
4056
|
let pos = first.lastIndex;
|
|
4025
4057
|
line.lastIndex = pos;
|
|
4026
4058
|
while (match = line.exec(source)) {
|
|
4027
|
-
if (match[1] === "")
|
|
4028
|
-
|
|
4029
|
-
|
|
4059
|
+
if (match[1] === "") {
|
|
4060
|
+
if (sep === "\n") res += sep;
|
|
4061
|
+
else sep = "\n";
|
|
4062
|
+
} else {
|
|
4030
4063
|
res += sep + match[1];
|
|
4031
4064
|
sep = " ";
|
|
4032
4065
|
}
|
|
@@ -4162,8 +4195,10 @@ var require_compose_scalar = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
4162
4195
|
function findScalarTagByName(schema, value, tagName, tagToken, onError) {
|
|
4163
4196
|
if (tagName === "!") return schema[identity.SCALAR];
|
|
4164
4197
|
const matchWithTest = [];
|
|
4165
|
-
for (const tag of schema.tags) if (!tag.collection && tag.tag === tagName)
|
|
4166
|
-
|
|
4198
|
+
for (const tag of schema.tags) if (!tag.collection && tag.tag === tagName) {
|
|
4199
|
+
if (tag.default && tag.test) matchWithTest.push(tag);
|
|
4200
|
+
else return tag;
|
|
4201
|
+
}
|
|
4167
4202
|
for (const tag of matchWithTest) if (tag.test?.test(value)) return tag;
|
|
4168
4203
|
const kt = schema.knownTags[tagName];
|
|
4169
4204
|
if (kt && !kt.collection) {
|
|
@@ -4261,8 +4296,10 @@ var require_compose_node = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
4261
4296
|
if (anchor && node.anchor === "") onError(anchor, "BAD_ALIAS", "Anchor cannot be an empty string");
|
|
4262
4297
|
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");
|
|
4263
4298
|
if (spaceBefore) node.spaceBefore = true;
|
|
4264
|
-
if (comment)
|
|
4265
|
-
|
|
4299
|
+
if (comment) {
|
|
4300
|
+
if (token.type === "scalar" && token.source === "") node.comment = comment;
|
|
4301
|
+
else node.commentBefore = comment;
|
|
4302
|
+
}
|
|
4266
4303
|
if (ctx.options.keepSourceTokens && isSrcToken) node.srcToken = token;
|
|
4267
4304
|
return node;
|
|
4268
4305
|
}
|
|
@@ -5451,11 +5488,13 @@ var require_lexer = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
5451
5488
|
end = i;
|
|
5452
5489
|
} else if (isEmpty(ch)) {
|
|
5453
5490
|
let next = this.buffer[i + 1];
|
|
5454
|
-
if (ch === "\r")
|
|
5455
|
-
|
|
5456
|
-
|
|
5457
|
-
|
|
5458
|
-
|
|
5491
|
+
if (ch === "\r") {
|
|
5492
|
+
if (next === "\n") {
|
|
5493
|
+
i += 1;
|
|
5494
|
+
ch = "\n";
|
|
5495
|
+
next = this.buffer[i + 1];
|
|
5496
|
+
} else end = i;
|
|
5497
|
+
}
|
|
5459
5498
|
if (next === "#" || inFlow && flowIndicatorChars.has(next)) break;
|
|
5460
5499
|
if (ch === "\n") {
|
|
5461
5500
|
const cs = this.continueScalar(i + 1);
|
|
@@ -5672,9 +5711,10 @@ var require_parser = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
5672
5711
|
for (const it of fc.items) if (it.sep && !it.value && !includesToken(it.start, "explicit-key-ind") && !includesToken(it.sep, "map-value-ind")) {
|
|
5673
5712
|
if (it.key) it.value = it.key;
|
|
5674
5713
|
delete it.key;
|
|
5675
|
-
if (isFlowToken(it.value))
|
|
5676
|
-
|
|
5677
|
-
|
|
5714
|
+
if (isFlowToken(it.value)) {
|
|
5715
|
+
if (it.value.end) arrayPushArray(it.value.end, it.sep);
|
|
5716
|
+
else it.value.end = it.sep;
|
|
5717
|
+
} else arrayPushArray(it.start, it.sep);
|
|
5678
5718
|
delete it.sep;
|
|
5679
5719
|
}
|
|
5680
5720
|
}
|
|
@@ -6109,58 +6149,60 @@ var require_parser = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
6109
6149
|
this.onKeyLine = true;
|
|
6110
6150
|
return;
|
|
6111
6151
|
case "map-value-ind":
|
|
6112
|
-
if (it.explicitKey)
|
|
6113
|
-
|
|
6114
|
-
|
|
6115
|
-
});
|
|
6116
|
-
else {
|
|
6117
|
-
const start = getFirstKeyStartProps(it.start);
|
|
6118
|
-
this.stack.push({
|
|
6119
|
-
type: "block-map",
|
|
6120
|
-
offset: this.offset,
|
|
6121
|
-
indent: this.indent,
|
|
6122
|
-
items: [{
|
|
6123
|
-
start,
|
|
6152
|
+
if (it.explicitKey) {
|
|
6153
|
+
if (!it.sep) {
|
|
6154
|
+
if (includesToken(it.start, "newline")) Object.assign(it, {
|
|
6124
6155
|
key: null,
|
|
6125
6156
|
sep: [this.sourceToken]
|
|
6126
|
-
}
|
|
6127
|
-
|
|
6128
|
-
|
|
6129
|
-
|
|
6130
|
-
|
|
6131
|
-
|
|
6132
|
-
|
|
6133
|
-
|
|
6134
|
-
|
|
6135
|
-
|
|
6136
|
-
|
|
6137
|
-
|
|
6138
|
-
|
|
6139
|
-
|
|
6157
|
+
});
|
|
6158
|
+
else {
|
|
6159
|
+
const start = getFirstKeyStartProps(it.start);
|
|
6160
|
+
this.stack.push({
|
|
6161
|
+
type: "block-map",
|
|
6162
|
+
offset: this.offset,
|
|
6163
|
+
indent: this.indent,
|
|
6164
|
+
items: [{
|
|
6165
|
+
start,
|
|
6166
|
+
key: null,
|
|
6167
|
+
sep: [this.sourceToken]
|
|
6168
|
+
}]
|
|
6169
|
+
});
|
|
6170
|
+
}
|
|
6171
|
+
} else if (it.value) map.items.push({
|
|
6172
|
+
start: [],
|
|
6140
6173
|
key: null,
|
|
6141
6174
|
sep: [this.sourceToken]
|
|
6142
|
-
}
|
|
6143
|
-
|
|
6144
|
-
else if (isFlowToken(it.key) && !includesToken(it.sep, "newline")) {
|
|
6145
|
-
const start = getFirstKeyStartProps(it.start);
|
|
6146
|
-
const key = it.key;
|
|
6147
|
-
const sep = it.sep;
|
|
6148
|
-
sep.push(this.sourceToken);
|
|
6149
|
-
delete it.key;
|
|
6150
|
-
delete it.sep;
|
|
6151
|
-
this.stack.push({
|
|
6175
|
+
});
|
|
6176
|
+
else if (includesToken(it.sep, "map-value-ind")) this.stack.push({
|
|
6152
6177
|
type: "block-map",
|
|
6153
6178
|
offset: this.offset,
|
|
6154
6179
|
indent: this.indent,
|
|
6155
6180
|
items: [{
|
|
6156
6181
|
start,
|
|
6157
|
-
key,
|
|
6158
|
-
sep
|
|
6182
|
+
key: null,
|
|
6183
|
+
sep: [this.sourceToken]
|
|
6159
6184
|
}]
|
|
6160
6185
|
});
|
|
6161
|
-
|
|
6162
|
-
|
|
6163
|
-
|
|
6186
|
+
else if (isFlowToken(it.key) && !includesToken(it.sep, "newline")) {
|
|
6187
|
+
const start = getFirstKeyStartProps(it.start);
|
|
6188
|
+
const key = it.key;
|
|
6189
|
+
const sep = it.sep;
|
|
6190
|
+
sep.push(this.sourceToken);
|
|
6191
|
+
delete it.key;
|
|
6192
|
+
delete it.sep;
|
|
6193
|
+
this.stack.push({
|
|
6194
|
+
type: "block-map",
|
|
6195
|
+
offset: this.offset,
|
|
6196
|
+
indent: this.indent,
|
|
6197
|
+
items: [{
|
|
6198
|
+
start,
|
|
6199
|
+
key,
|
|
6200
|
+
sep
|
|
6201
|
+
}]
|
|
6202
|
+
});
|
|
6203
|
+
} else if (start.length > 0) it.sep = it.sep.concat(start, this.sourceToken);
|
|
6204
|
+
else it.sep.push(this.sourceToken);
|
|
6205
|
+
} else if (!it.sep) Object.assign(it, {
|
|
6164
6206
|
key: null,
|
|
6165
6207
|
sep: [this.sourceToken]
|
|
6166
6208
|
});
|
|
@@ -6533,8 +6575,10 @@ var require_public_api = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
6533
6575
|
const doc = parseDocument(src, options);
|
|
6534
6576
|
if (!doc) return null;
|
|
6535
6577
|
doc.warnings.forEach((warning) => log.warn(doc.options.logLevel, warning));
|
|
6536
|
-
if (doc.errors.length > 0)
|
|
6537
|
-
|
|
6578
|
+
if (doc.errors.length > 0) {
|
|
6579
|
+
if (doc.options.logLevel !== "silent") throw doc.errors[0];
|
|
6580
|
+
else doc.errors = [];
|
|
6581
|
+
}
|
|
6538
6582
|
return doc.toJS(Object.assign({ reviver: _reviver }, options));
|
|
6539
6583
|
}
|
|
6540
6584
|
function stringify(value, replacer, options) {
|