vite-plus 0.2.7 → 0.2.9

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.
Files changed (89) hide show
  1. package/AGENTS.md +7 -0
  2. package/LICENSE +5 -1
  3. package/README.md +9 -3
  4. package/bin/vpr +3 -2
  5. package/binding/index.cjs +193 -80
  6. package/binding/index.d.cts +106 -11
  7. package/dist/agent-DQU8uS6P.js +416 -0
  8. package/dist/bin.js +1388 -23
  9. package/dist/{cli-truncate-BVOlIIPy.js → cli-truncate-Bg3RDXpi.js} +0 -2
  10. package/dist/client/bundledDevClient.mjs +1 -0
  11. package/dist/config/bin.js +32 -133
  12. package/dist/{constants-BsuzPowC.js → constants-CG513DRa.js} +10 -2
  13. package/dist/create/bin.js +255 -268
  14. package/dist/{define-config-C2KfLHpC.js → define-config-CV4bQG_8.js} +3 -3
  15. package/dist/{define-config-eLQH9us2.d.ts → define-config-DWoAkNdp.d.ts} +16 -0
  16. package/dist/{define-config-DLh9fE95.cjs → define-config-DyNLA_f0.cjs} +1 -1
  17. package/dist/define-config.cjs +1 -1
  18. package/dist/define-config.d.ts +1 -1
  19. package/dist/define-config.js +1 -1
  20. package/dist/{dist-CKz3vcoG.js → dist-BDYZP12R.js} +196 -157
  21. package/dist/dist-Dqv1-Clg.js +3 -0
  22. package/dist/{agent-CPwWJ4qf.js → editor-g4PosU99.js} +819 -628
  23. package/dist/hooks/bin.d.ts +1 -0
  24. package/dist/hooks/bin.js +130 -0
  25. package/dist/hooks-pNCBWtFT.js +570 -0
  26. package/dist/index.cjs +1 -1
  27. package/dist/index.d.ts +1 -1
  28. package/dist/index.js +1 -1
  29. package/dist/{json-DiRs8ceZ.js → json-qlK6UH0r.js} +40 -38
  30. package/dist/migration/bin.js +65 -58
  31. package/dist/{oxlint-plugin-config-Bxgc4cwF.js → oxlint-plugin-config-BEZ9IUf7.js} +1 -1
  32. package/dist/oxlint-plugin.js +1 -1
  33. package/dist/pack-bin.js +1 -1
  34. package/dist/{package-Ds3uThLb.js → package-B4T8RGMG.js} +2 -2
  35. package/dist/{tsconfig-Jia2vgMG.js → prompts-CHz_98bJ.js} +169 -219
  36. package/dist/{resolve-vite-config-BiuLZnn8.js → resolve-vite-config-Dmeyeyj-.js} +2 -9
  37. package/dist/{rolldown-runtime-C7HZzL1F.js → rolldown-runtime-CMFfr-1z.js} +1 -1
  38. package/dist/staged/bin.js +241 -226
  39. package/dist/terminal-Bz-ps6rJ.js +128 -0
  40. package/dist/test/browser/providers/playwright/context.d.ts +1 -1
  41. package/dist/test/browser/providers/playwright.d.ts +6 -6
  42. package/dist/test/browser/providers/preview/context.d.ts +1 -1
  43. package/dist/test/browser/providers/preview.d.ts +4 -4
  44. package/dist/test/browser/providers/webdriverio/context.d.ts +1 -1
  45. package/dist/test/browser/providers/webdriverio.d.ts +6 -6
  46. package/dist/test/browser-playwright/context.d.ts +1 -1
  47. package/dist/test/browser-playwright.d.ts +6 -6
  48. package/dist/test/browser-preview/context.d.ts +1 -1
  49. package/dist/test/browser-preview.d.ts +4 -4
  50. package/dist/test/browser-webdriverio/context.d.ts +1 -1
  51. package/dist/test/browser-webdriverio.d.ts +6 -6
  52. package/dist/test/context.d.ts +3 -3
  53. package/dist/test/locators.d.ts +1 -1
  54. package/dist/toolchain.d.ts +25 -0
  55. package/dist/toolchain.js +194 -0
  56. package/dist/toolchain.json +193 -0
  57. package/dist/tsconfig-7v_BHagU.js +151 -0
  58. package/dist/{tsgolint-path-B-yOos8p.js → tsgolint-path-CbDReEOx.js} +5 -3
  59. package/dist/tsgolint-path.js +1 -1
  60. package/dist/version.js +6 -6
  61. package/dist/versions.d.ts +3 -3
  62. package/dist/versions.js +6 -6
  63. package/docs/config/index.md +13 -0
  64. package/docs/config/staged.md +2 -1
  65. package/docs/guide/ci.md +37 -4
  66. package/docs/guide/commit-hooks.md +112 -21
  67. package/docs/guide/create.md +7 -4
  68. package/docs/guide/env.md +8 -4
  69. package/docs/guide/fmt.md +2 -2
  70. package/docs/guide/github-actions-cache.md +5 -1
  71. package/docs/guide/ide-integration.md +61 -2
  72. package/docs/guide/index.md +4 -2
  73. package/docs/guide/install.md +27 -0
  74. package/docs/guide/installer-env-vars.md +14 -3
  75. package/docs/guide/lint.md +3 -1
  76. package/docs/guide/migrate.md +49 -4
  77. package/docs/guide/monorepo.md +98 -10
  78. package/docs/guide/troubleshooting.md +12 -3
  79. package/docs/guide/upgrade.md +27 -4
  80. package/docs/package.json +1 -1
  81. package/docs/pnpm-workspace.yaml +7 -0
  82. package/docs/vite.config.ts +3 -0
  83. package/package.json +21 -23
  84. package/rules/vite-tools.yml +0 -7
  85. package/dist/dist-CtM2JRbM.js +0 -3
  86. package/dist/editor-BbT1lTNc.js +0 -675
  87. package/dist/help-YP84FSEz.js +0 -61
  88. package/dist/terminal-uTv0ZaMr.js +0 -33
  89. package/dist/{log-update-DHZRyJ2m.js → log-update-CoW8Z4Dl.js} +1 -1
@@ -1,10 +1,10 @@
1
- import { o as VITEST_VERSION, r as CONFIG_METADATA_ENV } from "./constants-BsuzPowC.js";
1
+ import { o as VITEST_VERSION, r as CONFIG_METADATA_ENV } from "./constants-CG513DRa.js";
2
2
  import { createRequire } from "node:module";
3
3
  import path from "node:path";
4
- import { readFileSync } from "node:fs";
5
4
  import { fileURLToPath } from "node:url";
5
+ import { readFileSync } from "node:fs";
6
6
  import { defineConfig, defineProject } from "vitest/config";
7
- //#region ../../node_modules/.pnpm/tsdown@0.22.14_@arethetypeswrong+core@0.18.2_@tsdown+css@0.22.14_@tsdown+exe@0.22.14_@t_ce23af2d06b6e55ae551016827d08ee4/node_modules/tsdown/esm-shims.js
7
+ //#region ../../node_modules/.pnpm/tsdown@0.22.14_@arethetypeswrong+core@0.18.2_@tsdown+css@0.22.14_@tsdown+exe@0.22.14_@t_8361ec2a4d03114085b1954a2fc42e35/node_modules/tsdown/esm-shims.js
8
8
  const getFilename = () => fileURLToPath(import.meta.url);
9
9
  const getDirname = () => path.dirname(getFilename());
10
10
  const __dirname = /* @__PURE__ */ getDirname();
@@ -195,6 +195,22 @@ declare module '@voidzero-dev/vite-plus-core' {
195
195
  lint?: boolean;
196
196
  };
197
197
  pack?: PackUserConfig | PackUserConfig[];
198
+ /**
199
+ * Default target directory for `vp dev` / `build` / `preview` / `pack`
200
+ * when invoked bare in the directory containing this config (an implicit
201
+ * `vp -C <dir>`). A string targets all four commands; an object maps
202
+ * commands individually, and a command absent from the object falls
203
+ * through to the normal picker/listing resolution. Paths are relative to
204
+ * the config file's directory. vp reads them without executing the
205
+ * config, so this also works at roots with no vite-plus dependency; the
206
+ * static read is why the values must stay plain string literals.
207
+ */
208
+ defaultPackage?: string | {
209
+ dev?: string;
210
+ build?: string;
211
+ preview?: string;
212
+ pack?: string;
213
+ };
198
214
  run?: RunConfig;
199
215
  staged?: StagedConfig;
200
216
  /**
@@ -37,7 +37,7 @@ let node_module = require("node:module");
37
37
  let node_url = require("node:url");
38
38
  let vitest_config = require("vitest/config");
39
39
  //#region package.json
40
- var version = "0.2.7", VITE_PLUS_VERSION, VITEST_VERSION, CONFIG_METADATA_ENV;
40
+ var version = "0.2.9", VITE_PLUS_VERSION, VITEST_VERSION, CONFIG_METADATA_ENV;
41
41
  var init_constants = __esmMin((() => {
42
42
  VITE_PLUS_VERSION = process.env.VP_VERSION || version;
43
43
  VITEST_VERSION = "4.1.10";
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_define_config = require("./define-config-DLh9fE95.cjs");
2
+ const require_define_config = require("./define-config-DyNLA_f0.cjs");
3
3
  require_define_config.init_define_config();
4
4
  exports.AUTO_INLINE_DEPS = require_define_config.AUTO_INLINE_DEPS;
5
5
  exports.assertCoverageProviderVersionMatch = require_define_config.assertCoverageProviderVersionMatch;
@@ -1,2 +1,2 @@
1
- import { a as defineConfig, c as lazyPlugins, i as computeAutoInlineList, l as resolveCoverageProviderToCheck, n as assertCoverageProviderVersionMatch, o as defineProject, r as checkCoverageProviderVersion, s as isVitestFamilySpecifier, t as AUTO_INLINE_DEPS, u as withConfigMetadataResolution } from "./define-config-eLQH9us2.js";
1
+ import { a as defineConfig, c as lazyPlugins, i as computeAutoInlineList, l as resolveCoverageProviderToCheck, n as assertCoverageProviderVersionMatch, o as defineProject, r as checkCoverageProviderVersion, s as isVitestFamilySpecifier, t as AUTO_INLINE_DEPS, u as withConfigMetadataResolution } from "./define-config-DWoAkNdp.js";
2
2
  export { AUTO_INLINE_DEPS, assertCoverageProviderVersionMatch, checkCoverageProviderVersion, computeAutoInlineList, defineConfig, defineProject, isVitestFamilySpecifier, lazyPlugins, resolveCoverageProviderToCheck, withConfigMetadataResolution };
@@ -1,2 +1,2 @@
1
- import { a as defineConfig, c as lazyPlugins, i as computeAutoInlineList, l as resolveCoverageProviderToCheck, n as assertCoverageProviderVersionMatch, o as defineProject, r as checkCoverageProviderVersion, s as isVitestFamilySpecifier, t as AUTO_INLINE_DEPS, u as withConfigMetadataResolution } from "./define-config-C2KfLHpC.js";
1
+ import { a as defineConfig, c as lazyPlugins, i as computeAutoInlineList, l as resolveCoverageProviderToCheck, n as assertCoverageProviderVersionMatch, o as defineProject, r as checkCoverageProviderVersion, s as isVitestFamilySpecifier, t as AUTO_INLINE_DEPS, u as withConfigMetadataResolution } from "./define-config-CV4bQG_8.js";
2
2
  export { AUTO_INLINE_DEPS, assertCoverageProviderVersionMatch, checkCoverageProviderVersion, computeAutoInlineList, defineConfig, defineProject, isVitestFamilySpecifier, lazyPlugins, resolveCoverageProviderToCheck, withConfigMetadataResolution };
@@ -1,4 +1,4 @@
1
- import { n as __require, t as __commonJSMin } from "./rolldown-runtime-C7HZzL1F.js";
1
+ import { n as __require, t as __commonJSMin } from "./rolldown-runtime-CMFfr-1z.js";
2
2
  //#region ../../node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/nodes/identity.js
3
3
  var require_identity = /* @__PURE__ */ __commonJSMin(((exports) => {
4
4
  const ALIAS = Symbol.for("yaml.alias");
@@ -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)) if (key === "key") parent.key = node;
231
- else parent.value = node;
232
- else if (identity.isDocument(parent)) parent.contents = node;
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`);
@@ -286,7 +287,6 @@ var require_directives = /* @__PURE__ */ __commonJSMin(((exports) => {
286
287
  version: "1.2"
287
288
  };
288
289
  this.tags = Object.assign({}, Directives.defaultTags);
289
- break;
290
290
  }
291
291
  return res;
292
292
  }
@@ -481,30 +481,32 @@ var require_applyReviver = /* @__PURE__ */ __commonJSMin(((exports) => {
481
481
  * Includes extensions for handling Map and Set objects.
482
482
  */
483
483
  function applyReviver(reviver, obj, key, val) {
484
- if (val && typeof val === "object") if (Array.isArray(val)) for (let i = 0, len = val.length; i < len; ++i) {
485
- const v0 = val[i];
486
- const v1 = applyReviver(reviver, val, String(i), v0);
487
- if (v1 === void 0) delete val[i];
488
- else if (v1 !== v0) val[i] = v1;
489
- }
490
- else if (val instanceof Map) for (const k of Array.from(val.keys())) {
491
- const v0 = val.get(k);
492
- const v1 = applyReviver(reviver, val, k, v0);
493
- if (v1 === void 0) val.delete(k);
494
- else if (v1 !== v0) val.set(k, v1);
495
- }
496
- else if (val instanceof Set) for (const v0 of Array.from(val)) {
497
- const v1 = applyReviver(reviver, val, v0, v0);
498
- if (v1 === void 0) val.delete(v0);
499
- else if (v1 !== v0) {
500
- val.delete(v0);
501
- val.add(v1);
502
- }
503
- }
504
- else for (const [k, v0] of Object.entries(val)) {
505
- const v1 = applyReviver(reviver, val, k, v0);
506
- if (v1 === void 0) delete val[k];
507
- else if (v1 !== v0) val[k] = v1;
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
+ }
508
510
  }
509
511
  return reviver.call(obj, key, val);
510
512
  }
@@ -925,8 +927,10 @@ var require_foldFlowLines = /* @__PURE__ */ __commonJSMin(((exports) => {
925
927
  const folds = [];
926
928
  const escapedFolds = {};
927
929
  let end = lineWidth - indent.length;
928
- if (typeof indentAtStart === "number") if (indentAtStart > lineWidth - Math.max(2, minContentWidth)) folds.push(0);
929
- else end = lineWidth - indentAtStart;
930
+ if (typeof indentAtStart === "number") {
931
+ if (indentAtStart > lineWidth - Math.max(2, minContentWidth)) folds.push(0);
932
+ else end = lineWidth - indentAtStart;
933
+ }
930
934
  let split = void 0;
931
935
  let prev = void 0;
932
936
  let overflow = false;
@@ -963,23 +967,25 @@ var require_foldFlowLines = /* @__PURE__ */ __commonJSMin(((exports) => {
963
967
  const next = text[i + 1];
964
968
  if (next && next !== " " && next !== "\n" && next !== " ") split = i;
965
969
  }
966
- if (i >= end) if (split) {
967
- folds.push(split);
968
- end = split + endStep;
969
- split = void 0;
970
- } else if (mode === FOLD_QUOTED) {
971
- while (prev === " " || prev === " ") {
972
- prev = ch;
973
- ch = text[i += 1];
974
- overflow = true;
975
- }
976
- const j = i > escEnd + 1 ? i - 2 : escStart - 1;
977
- if (escapedFolds[j]) return text;
978
- folds.push(j);
979
- escapedFolds[j] = true;
980
- end = j + endStep;
981
- split = void 0;
982
- } else overflow = true;
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
+ }
983
989
  }
984
990
  prev = ch;
985
991
  }
@@ -1459,8 +1465,10 @@ var require_log = /* @__PURE__ */ __commonJSMin(((exports) => {
1459
1465
  if (logLevel === "debug") console.log(...messages);
1460
1466
  }
1461
1467
  function warn(logLevel, warning) {
1462
- if (logLevel === "debug" || logLevel === "warn") if (typeof node_process$2.emitWarning === "function") node_process$2.emitWarning(warning);
1463
- else console.warn(warning);
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
+ }
1464
1472
  }
1465
1473
  exports.debug = debug;
1466
1474
  exports.warn = warn;
@@ -2287,11 +2295,12 @@ var require_pairs = /* @__PURE__ */ __commonJSMin(((exports) => {
2287
2295
  if (iterable && Symbol.iterator in Object(iterable)) for (let it of iterable) {
2288
2296
  if (typeof replacer === "function") it = replacer.call(iterable, String(i++), it);
2289
2297
  let key, value;
2290
- if (Array.isArray(it)) if (it.length === 2) {
2291
- key = it[0];
2292
- value = it[1];
2293
- } else throw new TypeError(`Expected [key, value] tuple: ${it}`);
2294
- else if (it && it instanceof Object) {
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) {
2295
2304
  const keys = Object.keys(it);
2296
2305
  if (keys.length === 1) {
2297
2306
  key = keys[0];
@@ -2367,8 +2376,10 @@ var require_omap = /* @__PURE__ */ __commonJSMin(((exports) => {
2367
2376
  resolve(seq, onError) {
2368
2377
  const pairs$1 = pairs.resolvePairs(seq, onError);
2369
2378
  const seenKeys = [];
2370
- for (const { key } of pairs$1.items) if (identity.isScalar(key)) if (seenKeys.includes(key.value)) onError(`Ordered maps must not include duplicate keys: ${key.value}`);
2371
- else seenKeys.push(key.value);
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
+ }
2372
2383
  return Object.assign(new YAMLOMap(), pairs$1);
2373
2384
  },
2374
2385
  createNode: (schema, iterable, ctx) => YAMLOMap.from(schema, iterable, ctx)
@@ -2464,9 +2475,7 @@ var require_int = /* @__PURE__ */ __commonJSMin(((exports) => {
2464
2475
  case 8:
2465
2476
  str = `0o${str}`;
2466
2477
  break;
2467
- case 16:
2468
- str = `0x${str}`;
2469
- break;
2478
+ case 16: str = `0x${str}`;
2470
2479
  }
2471
2480
  const n = BigInt(str);
2472
2481
  return sign === "-" ? BigInt(-1) * n : n;
@@ -2581,9 +2590,10 @@ var require_set = /* @__PURE__ */ __commonJSMin(((exports) => {
2581
2590
  tag: "tag:yaml.org,2002:set",
2582
2591
  createNode: (schema, iterable, ctx) => YAMLSet.from(schema, iterable, ctx),
2583
2592
  resolve(map, onError) {
2584
- if (identity.isMap(map)) if (map.hasAllNullValues(true)) return Object.assign(new YAMLSet(), map);
2585
- else onError("Set items must all have null values");
2586
- else onError("Expected a mapping for this tag");
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");
2587
2597
  return map;
2588
2598
  }
2589
2599
  };
@@ -2775,10 +2785,12 @@ var require_tags = /* @__PURE__ */ __commonJSMin(((exports) => {
2775
2785
  const schemaTags = schemas.get(schemaName);
2776
2786
  if (schemaTags && !customTags) return addMergeTag && !schemaTags.includes(merge.merge) ? schemaTags.concat(merge.merge) : schemaTags.slice();
2777
2787
  let tags = schemaTags;
2778
- if (!tags) if (Array.isArray(customTags)) tags = [];
2779
- else {
2780
- const keys = Array.from(schemas.keys()).filter((key) => key !== "yaml11").map((key) => JSON.stringify(key)).join(", ");
2781
- throw new Error(`Unknown schema "${schemaName}"; use one of ${keys} or define customTags array`);
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
+ }
2782
2794
  }
2783
2795
  if (Array.isArray(customTags)) for (const tag of customTags) tags = tags.concat(tag);
2784
2796
  else if (typeof customTags === "function") tags = customTags(tags.slice());
@@ -2867,14 +2879,15 @@ var require_stringifyDocument = /* @__PURE__ */ __commonJSMin(((exports) => {
2867
2879
  if ((body[0] === "|" || body[0] === ">") && lines[lines.length - 1] === "---") lines[lines.length - 1] = `--- ${body}`;
2868
2880
  else lines.push(body);
2869
2881
  } else lines.push(stringify.stringify(doc.contents, ctx));
2870
- if (doc.directives?.docEnd) if (doc.comment) {
2871
- const cs = commentString(doc.comment);
2872
- if (cs.includes("\n")) {
2873
- lines.push("...");
2874
- lines.push(stringifyComment.indentComment(cs, ""));
2875
- } else lines.push(`... ${cs}`);
2876
- } else lines.push("...");
2877
- else {
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 {
2878
2891
  let dc = doc.comment;
2879
2892
  if (dc && chompKeep) dc = dc.replace(/^\n+/, "");
2880
2893
  if (dc) {
@@ -3413,8 +3426,10 @@ var require_resolve_block_map = /* @__PURE__ */ __commonJSMin(((exports) => {
3413
3426
  }
3414
3427
  if (!keyProps.anchor && !keyProps.tag && !sep) {
3415
3428
  commentEnd = keyProps.end;
3416
- if (keyProps.comment) if (map.comment) map.comment += "\n" + keyProps.comment;
3417
- else map.comment = keyProps.comment;
3429
+ if (keyProps.comment) {
3430
+ if (map.comment) map.comment += "\n" + keyProps.comment;
3431
+ else map.comment = keyProps.comment;
3432
+ }
3418
3433
  continue;
3419
3434
  }
3420
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");
@@ -3447,8 +3462,10 @@ var require_resolve_block_map = /* @__PURE__ */ __commonJSMin(((exports) => {
3447
3462
  map.items.push(pair);
3448
3463
  } else {
3449
3464
  if (implicitKey) onError(keyNode.range, "MISSING_CHAR", "Implicit map keys need to be followed by map values");
3450
- if (valueProps.comment) if (keyNode.comment) keyNode.comment += "\n" + valueProps.comment;
3451
- else keyNode.comment = valueProps.comment;
3465
+ if (valueProps.comment) {
3466
+ if (keyNode.comment) keyNode.comment += "\n" + valueProps.comment;
3467
+ else keyNode.comment = valueProps.comment;
3468
+ }
3452
3469
  const pair = new Pair.Pair(keyNode);
3453
3470
  if (ctx.options.keepSourceTokens) pair.srcToken = collItem;
3454
3471
  map.items.push(pair);
@@ -3485,12 +3502,15 @@ var require_resolve_block_seq = /* @__PURE__ */ __commonJSMin(((exports) => {
3485
3502
  parentIndent: bs.indent,
3486
3503
  startOnNewline: true
3487
3504
  });
3488
- if (!props.found) if (props.anchor || props.tag || value) if (value?.type === "block-seq") onError(props.end, "BAD_INDENT", "All sequence items must start at the same column");
3489
- else onError(offset, "MISSING_CHAR", "Sequence item without - indicator");
3490
- else {
3491
- commentEnd = props.end;
3492
- if (props.comment) seq.comment = props.comment;
3493
- continue;
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
+ }
3494
3514
  }
3495
3515
  const node = value ? composeNode(ctx, value, props, onError) : composeEmptyNode(ctx, props.end, start, null, props, onError);
3496
3516
  if (ctx.schema.compat) utilFlowIndentCheck.flowIndentCheck(bs.indent, value, onError);
@@ -3582,8 +3602,10 @@ var require_resolve_flow_collection = /* @__PURE__ */ __commonJSMin(((exports) =
3582
3602
  if (!props.anchor && !props.tag && !sep && !value) {
3583
3603
  if (i === 0 && props.comma) onError(props.comma, "UNEXPECTED_TOKEN", `Unexpected , in ${fcName}`);
3584
3604
  else if (i < fc.items.length - 1) onError(props.start, "UNEXPECTED_TOKEN", `Unexpected empty item in ${fcName}`);
3585
- if (props.comment) if (coll.comment) coll.comment += "\n" + props.comment;
3586
- else coll.comment = props.comment;
3605
+ if (props.comment) {
3606
+ if (coll.comment) coll.comment += "\n" + props.comment;
3607
+ else coll.comment = props.comment;
3608
+ }
3587
3609
  offset = props.end;
3588
3610
  continue;
3589
3611
  }
@@ -3643,13 +3665,17 @@ var require_resolve_flow_collection = /* @__PURE__ */ __commonJSMin(((exports) =
3643
3665
  }
3644
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");
3645
3667
  }
3646
- } else if (value) if ("source" in value && value.source?.[0] === ":") onError(value, "MISSING_CHAR", `Missing space after : in ${fcName}`);
3647
- else onError(valueProps.start, "MISSING_CHAR", `Missing , or : between ${fcName} items`);
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
+ }
3648
3672
  const valueNode = value ? composeNode(ctx, value, valueProps, onError) : valueProps.found ? composeEmptyNode(ctx, valueProps.end, sep, null, valueProps, onError) : null;
3649
3673
  if (valueNode) {
3650
3674
  if (isBlock(value)) onError(valueNode.range, "BLOCK_IN_FLOW", blockMsg);
3651
- } else if (valueProps.comment) if (keyNode.comment) keyNode.comment += "\n" + valueProps.comment;
3652
- else keyNode.comment = valueProps.comment;
3675
+ } else if (valueProps.comment) {
3676
+ if (keyNode.comment) keyNode.comment += "\n" + valueProps.comment;
3677
+ else keyNode.comment = valueProps.comment;
3678
+ }
3653
3679
  const pair = new Pair.Pair(keyNode, valueNode);
3654
3680
  if (ctx.options.keepSourceTokens) pair.srcToken = collItem;
3655
3681
  if (isMap) {
@@ -3683,8 +3709,10 @@ var require_resolve_flow_collection = /* @__PURE__ */ __commonJSMin(((exports) =
3683
3709
  }
3684
3710
  if (ee.length > 0) {
3685
3711
  const end = resolveEnd.resolveEnd(ee, cePos, ctx.options.strict, onError);
3686
- if (end.comment) if (coll.comment) coll.comment += "\n" + end.comment;
3687
- else coll.comment = end.comment;
3712
+ if (end.comment) {
3713
+ if (coll.comment) coll.comment += "\n" + end.comment;
3714
+ else coll.comment = end.comment;
3715
+ }
3688
3716
  coll.range = [
3689
3717
  fc.offset,
3690
3718
  cePos,
@@ -3832,9 +3860,10 @@ var require_resolve_block_scalar = /* @__PURE__ */ __commonJSMin(((exports) => {
3832
3860
  value += sep + indent.slice(trimIndent) + content;
3833
3861
  sep = "\n";
3834
3862
  prevMoreIndented = true;
3835
- } else if (content === "") if (sep === "\n") value += "\n";
3836
- else sep = "\n";
3837
- else {
3863
+ } else if (content === "") {
3864
+ if (sep === "\n") value += "\n";
3865
+ else sep = "\n";
3866
+ } else {
3838
3867
  value += sep + content;
3839
3868
  sep = " ";
3840
3869
  prevMoreIndented = false;
@@ -3995,9 +4024,7 @@ var require_resolve_flow_scalar = /* @__PURE__ */ __commonJSMin(((exports) => {
3995
4024
  badChar = `block scalar indicator ${source[0]}`;
3996
4025
  break;
3997
4026
  case "@":
3998
- case "`":
3999
- badChar = `reserved character ${source[0]}`;
4000
- break;
4027
+ case "`": badChar = `reserved character ${source[0]}`;
4001
4028
  }
4002
4029
  if (badChar) onError(0, "BAD_SCALAR_START", `Plain value cannot start with ${badChar}`);
4003
4030
  return foldLines(source);
@@ -4029,9 +4056,10 @@ var require_resolve_flow_scalar = /* @__PURE__ */ __commonJSMin(((exports) => {
4029
4056
  let pos = first.lastIndex;
4030
4057
  line.lastIndex = pos;
4031
4058
  while (match = line.exec(source)) {
4032
- if (match[1] === "") if (sep === "\n") res += sep;
4033
- else sep = "\n";
4034
- else {
4059
+ if (match[1] === "") {
4060
+ if (sep === "\n") res += sep;
4061
+ else sep = "\n";
4062
+ } else {
4035
4063
  res += sep + match[1];
4036
4064
  sep = " ";
4037
4065
  }
@@ -4167,8 +4195,10 @@ var require_compose_scalar = /* @__PURE__ */ __commonJSMin(((exports) => {
4167
4195
  function findScalarTagByName(schema, value, tagName, tagToken, onError) {
4168
4196
  if (tagName === "!") return schema[identity.SCALAR];
4169
4197
  const matchWithTest = [];
4170
- for (const tag of schema.tags) if (!tag.collection && tag.tag === tagName) if (tag.default && tag.test) matchWithTest.push(tag);
4171
- else return tag;
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
+ }
4172
4202
  for (const tag of matchWithTest) if (tag.test?.test(value)) return tag;
4173
4203
  const kt = schema.knownTags[tagName];
4174
4204
  if (kt && !kt.collection) {
@@ -4266,8 +4296,10 @@ var require_compose_node = /* @__PURE__ */ __commonJSMin(((exports) => {
4266
4296
  if (anchor && node.anchor === "") onError(anchor, "BAD_ALIAS", "Anchor cannot be an empty string");
4267
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");
4268
4298
  if (spaceBefore) node.spaceBefore = true;
4269
- if (comment) if (token.type === "scalar" && token.source === "") node.comment = comment;
4270
- else node.commentBefore = comment;
4299
+ if (comment) {
4300
+ if (token.type === "scalar" && token.source === "") node.comment = comment;
4301
+ else node.commentBefore = comment;
4302
+ }
4271
4303
  if (ctx.options.keepSourceTokens && isSrcToken) node.srcToken = token;
4272
4304
  return node;
4273
4305
  }
@@ -5456,11 +5488,13 @@ var require_lexer = /* @__PURE__ */ __commonJSMin(((exports) => {
5456
5488
  end = i;
5457
5489
  } else if (isEmpty(ch)) {
5458
5490
  let next = this.buffer[i + 1];
5459
- if (ch === "\r") if (next === "\n") {
5460
- i += 1;
5461
- ch = "\n";
5462
- next = this.buffer[i + 1];
5463
- } else end = i;
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
+ }
5464
5498
  if (next === "#" || inFlow && flowIndicatorChars.has(next)) break;
5465
5499
  if (ch === "\n") {
5466
5500
  const cs = this.continueScalar(i + 1);
@@ -5677,9 +5711,10 @@ var require_parser = /* @__PURE__ */ __commonJSMin(((exports) => {
5677
5711
  for (const it of fc.items) if (it.sep && !it.value && !includesToken(it.start, "explicit-key-ind") && !includesToken(it.sep, "map-value-ind")) {
5678
5712
  if (it.key) it.value = it.key;
5679
5713
  delete it.key;
5680
- if (isFlowToken(it.value)) if (it.value.end) arrayPushArray(it.value.end, it.sep);
5681
- else it.value.end = it.sep;
5682
- else arrayPushArray(it.start, it.sep);
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);
5683
5718
  delete it.sep;
5684
5719
  }
5685
5720
  }
@@ -6114,58 +6149,60 @@ var require_parser = /* @__PURE__ */ __commonJSMin(((exports) => {
6114
6149
  this.onKeyLine = true;
6115
6150
  return;
6116
6151
  case "map-value-ind":
6117
- if (it.explicitKey) if (!it.sep) if (includesToken(it.start, "newline")) Object.assign(it, {
6118
- key: null,
6119
- sep: [this.sourceToken]
6120
- });
6121
- else {
6122
- const start = getFirstKeyStartProps(it.start);
6123
- this.stack.push({
6124
- type: "block-map",
6125
- offset: this.offset,
6126
- indent: this.indent,
6127
- items: [{
6128
- start,
6152
+ if (it.explicitKey) {
6153
+ if (!it.sep) {
6154
+ if (includesToken(it.start, "newline")) Object.assign(it, {
6129
6155
  key: null,
6130
6156
  sep: [this.sourceToken]
6131
- }]
6132
- });
6133
- }
6134
- else if (it.value) map.items.push({
6135
- start: [],
6136
- key: null,
6137
- sep: [this.sourceToken]
6138
- });
6139
- else if (includesToken(it.sep, "map-value-ind")) this.stack.push({
6140
- type: "block-map",
6141
- offset: this.offset,
6142
- indent: this.indent,
6143
- items: [{
6144
- start,
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: [],
6145
6173
  key: null,
6146
6174
  sep: [this.sourceToken]
6147
- }]
6148
- });
6149
- else if (isFlowToken(it.key) && !includesToken(it.sep, "newline")) {
6150
- const start = getFirstKeyStartProps(it.start);
6151
- const key = it.key;
6152
- const sep = it.sep;
6153
- sep.push(this.sourceToken);
6154
- delete it.key;
6155
- delete it.sep;
6156
- this.stack.push({
6175
+ });
6176
+ else if (includesToken(it.sep, "map-value-ind")) this.stack.push({
6157
6177
  type: "block-map",
6158
6178
  offset: this.offset,
6159
6179
  indent: this.indent,
6160
6180
  items: [{
6161
6181
  start,
6162
- key,
6163
- sep
6182
+ key: null,
6183
+ sep: [this.sourceToken]
6164
6184
  }]
6165
6185
  });
6166
- } else if (start.length > 0) it.sep = it.sep.concat(start, this.sourceToken);
6167
- else it.sep.push(this.sourceToken);
6168
- else if (!it.sep) Object.assign(it, {
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, {
6169
6206
  key: null,
6170
6207
  sep: [this.sourceToken]
6171
6208
  });
@@ -6538,8 +6575,10 @@ var require_public_api = /* @__PURE__ */ __commonJSMin(((exports) => {
6538
6575
  const doc = parseDocument(src, options);
6539
6576
  if (!doc) return null;
6540
6577
  doc.warnings.forEach((warning) => log.warn(doc.options.logLevel, warning));
6541
- if (doc.errors.length > 0) if (doc.options.logLevel !== "silent") throw doc.errors[0];
6542
- else doc.errors = [];
6578
+ if (doc.errors.length > 0) {
6579
+ if (doc.options.logLevel !== "silent") throw doc.errors[0];
6580
+ else doc.errors = [];
6581
+ }
6543
6582
  return doc.toJS(Object.assign({ reviver: _reviver }, options));
6544
6583
  }
6545
6584
  function stringify(value, replacer, options) {
@@ -0,0 +1,3 @@
1
+ import { t as require_dist } from "./dist-BDYZP12R.js";
2
+ export default require_dist();
3
+ export {};