@voidzero-dev/vite-plus-core 1.0.0-rc.1 → 1.1.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.
Files changed (57) hide show
  1. package/LICENSE +29 -176
  2. package/dist/rolldown/cli.mjs +9 -8
  3. package/dist/rolldown/config.d.mts +1 -1
  4. package/dist/rolldown/config.mjs +2 -2
  5. package/dist/rolldown/experimental-index.d.mts +4 -4
  6. package/dist/rolldown/experimental-index.mjs +8 -8
  7. package/dist/rolldown/experimental-runtime-types.d.ts +25 -6
  8. package/dist/rolldown/experimental-runtime.d.ts +25 -6
  9. package/dist/rolldown/experimental-runtime.mjs +267 -255
  10. package/dist/rolldown/filter-index.d.mts +1 -1
  11. package/dist/rolldown/index.d.mts +3 -3
  12. package/dist/rolldown/index.mjs +4 -4
  13. package/dist/rolldown/parallel-plugin-worker.mjs +2 -2
  14. package/dist/rolldown/parallel-plugin.d.mts +1 -1
  15. package/dist/rolldown/parse-ast-index.d.mts +1 -1
  16. package/dist/rolldown/parse-ast-index.mjs +1 -1
  17. package/dist/rolldown/plugins-index.d.mts +3 -3
  18. package/dist/rolldown/plugins-index.mjs +2 -2
  19. package/dist/rolldown/shared/{binding-BY0qR5iS.mjs → binding-B4m_2rFW.mjs} +27 -28
  20. package/dist/rolldown/shared/{binding-BTa6BPQe.d.mts → binding-tzp6Hc_3.d.mts} +1 -1
  21. package/dist/rolldown/shared/{bindingify-input-options-B8JHmN6_.mjs → bindingify-input-options-YtcpaV3r.mjs} +196 -13
  22. package/dist/rolldown/shared/{constructors-DuOq7MqW.d.mts → constructors-CGQ9ItSV.d.mts} +2 -2
  23. package/dist/rolldown/shared/{constructors-xEvVj3lN.mjs → constructors-DDRbtWM1.mjs} +1 -1
  24. package/dist/rolldown/shared/{create-bundler-option-COco-7P6.mjs → create-bundler-option-CFtx335R.mjs} +17 -8
  25. package/dist/rolldown/shared/{define-config-C7HCoqY8.d.mts → define-config-kIZKjX8Q.d.mts} +72 -2
  26. package/dist/rolldown/shared/{error-C7pxws0W.mjs → error-Bj1xBdEY.mjs} +2 -1
  27. package/dist/rolldown/shared/{load-config-DkUBnDsI.mjs → load-config-CiFPv7UH.mjs} +2 -2
  28. package/dist/rolldown/shared/{normalize-string-or-regex-F14uvr6D.mjs → normalize-string-or-regex-xyy0kCQR.mjs} +1 -1
  29. package/dist/rolldown/shared/{parse-BWeE7Vr9.mjs → parse-Zii6QoPp.mjs} +2 -2
  30. package/dist/rolldown/shared/{resolve-tsconfig-DHwpIs5e.mjs → resolve-tsconfig-DRWFAQ3v.mjs} +2 -2
  31. package/dist/rolldown/shared/{rolldown-Bue0gNT5.mjs → rolldown-BCQsxZbq.mjs} +4 -4
  32. package/dist/rolldown/shared/{transform-DK_nCt9j.d.mts → transform-D4RDjIPI.d.mts} +1 -1
  33. package/dist/rolldown/shared/{watch-RXhXN1aG.mjs → watch-CXhrnblH.mjs} +4 -4
  34. package/dist/rolldown/utils-index.d.mts +3 -3
  35. package/dist/rolldown/utils-index.mjs +5 -5
  36. package/dist/tsdown/{build-JVmLFaZt-DRlLhpV3.js → build-JVmLFaZt-k6Y-YuG9.js} +8 -8
  37. package/dist/tsdown/{debug-CpC4hV25-C-OYr2iI.js → debug-CpC4hV25-D_60QWpz.js} +2 -2
  38. package/dist/tsdown/{detect-Bg-d8iUV-Du8LljhG.js → detect-Bg-d8iUV--_V5C4Db.js} +1 -1
  39. package/dist/tsdown/{dist-VDcV1Qyy.js → dist-DquISSoY.js} +8 -8
  40. package/dist/tsdown/index-types.d.ts +5 -5
  41. package/dist/tsdown/index.js +4 -4
  42. package/dist/tsdown/{require-BbBF8Ii0-BDaWJgzA.js → require-BbBF8Ii0-S6Y65RhW.js} +1 -1
  43. package/dist/tsdown/{resolver-DE0_sy8o-Bi3xbRxi.js → resolver-DE0_sy8o-Pz8aksn9.js} +2 -2
  44. package/dist/tsdown/run.js +3 -3
  45. package/dist/tsdown/{target-DgdLrXba-DpO9JXxB.js → target-DgdLrXba-BygiKCU8.js} +3 -3
  46. package/dist/tsdown/{tsc-BLb4pSBY.js → tsc-2xhsE0Bf.js} +4 -4
  47. package/dist/tsdown/tsdown-css.js +1 -1
  48. package/dist/tsdown/tsdown-exe.js +3 -3
  49. package/dist/tsdown/{version-CQ98ZBpL-D6GAHapk.js → version-CQ98ZBpL-CKvh-HCu.js} +1 -1
  50. package/dist/vite/client/bundledDevClient.mjs +75 -329
  51. package/dist/vite/client/client.mjs +74 -23
  52. package/dist/vite/node/chunks/node.js +883 -666
  53. package/dist/vite/node/index.d.ts +3 -1
  54. package/dist/vite/node/module-runner.js +16 -2
  55. package/package.json +38 -21
  56. package/dist/rolldown/experimental-default-runtime.mjs +0 -116
  57. package/dist/rolldown/experimental-runtime-base.mjs +0 -95
@@ -1,6 +1,6 @@
1
1
  import { RUNTIME_MODULE_ID } from "@voidzero-dev/vite-plus-core/rolldown";
2
2
  import { exactRegex } from "@voidzero-dev/vite-plus-core/rolldown/filter";
3
- //#region ../../node_modules/.pnpm/rolldown-plugin-dts@0.28.6_@typescript+native-preview@7.0.0-dev.20260605.1_oxc-resolver_d7b1f0f9db662f38e672c8f14bf9ba00/node_modules/rolldown-plugin-dts/dist/filename-BFg1q_t3.mjs
3
+ //#region ../../node_modules/.pnpm/rolldown-plugin-dts@0.28.6_@typescript+native-preview@7.0.0-dev.20260605.1_@volar+types_969a2c93bc9b761d4191bb0e75b7732a/node_modules/rolldown-plugin-dts/dist/filename-BFg1q_t3.mjs
4
4
  const RE_JS = /\.([cm]?)jsx?$/;
5
5
  const RE_TS = /\.([cm]?)tsx?$/;
6
6
  const RE_DTS = /\.d\.([cm]?)ts$/;
@@ -1,3 +1,4 @@
1
+ import { DevRuntime } from "rolldown/experimental/runtime";
1
2
  import "@vite/env";
2
3
  //#region ../../node_modules/.pnpm/nanoid@5.1.16/node_modules/nanoid/non-secure/index.js
3
4
  let urlAlphabet = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";
@@ -8,40 +9,7 @@ let nanoid = (size = 21) => {
8
9
  return id;
9
10
  };
10
11
  //#endregion
11
- //#region ../../rolldown/packages/rolldown/dist/experimental-runtime-base.mjs
12
- var __create = Object.create;
13
- var __defProp = Object.defineProperty;
14
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
15
- var __getOwnPropNames = Object.getOwnPropertyNames;
16
- var __getProtoOf = Object.getPrototypeOf;
17
- var __hasOwnProp = Object.prototype.hasOwnProperty;
18
- var __exportAll = (all, no_symbols) => {
19
- let target = {};
20
- for (var name in all) __defProp(target, name, {
21
- get: all[name],
22
- enumerable: true
23
- });
24
- if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
25
- return target;
26
- };
27
- var __copyProps = (to, from, except, desc) => {
28
- if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
29
- key = keys[i];
30
- if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
31
- get: ((k) => from[k]).bind(null, key),
32
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
33
- });
34
- }
35
- return to;
36
- };
37
- var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
38
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule || !__hasOwnProp.call(mod, "default") ? __defProp(target, "default", {
39
- value: mod,
40
- enumerable: true
41
- }) : target, mod));
42
- var __toCommonJS = (mod) => __hasOwnProp.call(mod, "module.exports") ? mod["module.exports"] : __copyProps(__defProp({}, "__esModule", { value: true }), mod);
43
- //#endregion
44
- //#region \0@oxc-project+runtime@0.151.0/helpers/esm/typeof.js
12
+ //#region \0@oxc-project+runtime@0.152.0/helpers/esm/typeof.js
45
13
  function _typeof(o) {
46
14
  "@babel/helpers - typeof";
47
15
  return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
@@ -51,7 +19,7 @@ function _typeof(o) {
51
19
  }, _typeof(o);
52
20
  }
53
21
  //#endregion
54
- //#region \0@oxc-project+runtime@0.151.0/helpers/esm/toPrimitive.js
22
+ //#region \0@oxc-project+runtime@0.152.0/helpers/esm/toPrimitive.js
55
23
  function toPrimitive(t, r) {
56
24
  if ("object" != _typeof(t) || !t) return t;
57
25
  var e = t[Symbol.toPrimitive];
@@ -63,13 +31,13 @@ function toPrimitive(t, r) {
63
31
  return ("string" === r ? String : Number)(t);
64
32
  }
65
33
  //#endregion
66
- //#region \0@oxc-project+runtime@0.151.0/helpers/esm/toPropertyKey.js
34
+ //#region \0@oxc-project+runtime@0.152.0/helpers/esm/toPropertyKey.js
67
35
  function toPropertyKey(t) {
68
36
  var i = toPrimitive(t, "string");
69
37
  return "symbol" == _typeof(i) ? i : i + "";
70
38
  }
71
39
  //#endregion
72
- //#region \0@oxc-project+runtime@0.151.0/helpers/esm/defineProperty.js
40
+ //#region \0@oxc-project+runtime@0.152.0/helpers/esm/defineProperty.js
73
41
  function _defineProperty(e, r, t) {
74
42
  return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
75
43
  value: t,
@@ -79,279 +47,6 @@ function _defineProperty(e, r, t) {
79
47
  }) : e[r] = t, e;
80
48
  }
81
49
  //#endregion
82
- //#region ../../rolldown/packages/rolldown/dist/experimental-runtime.mjs
83
- var Module = class {
84
- /**
85
- * @param {string} id
86
- */
87
- constructor(id) {
88
- _defineProperty(
89
- this,
90
- /**
91
- * @type {{ exports: any }}
92
- */
93
- "exportsHolder",
94
- { exports: null }
95
- );
96
- _defineProperty(
97
- this,
98
- /**
99
- * @type {string}
100
- */
101
- "id",
102
- void 0
103
- );
104
- this.id = id;
105
- }
106
- get exports() {
107
- return this.exportsHolder.exports;
108
- }
109
- };
110
- /**
111
- * Compiler-emitted module-graph delta — pure topology (static + dynamic edges).
112
- * `ids[0, localCount)` are the modules this payload carries; `ids[localCount, …)` are foreign edge targets.
113
- * `edges[i]` / `dynamicEdges[i]` are the static / dynamic-`import()` out-edges of `ids[i]`.
114
- * @typedef {{ ids: string[], localCount: number, edges: number[][], dynamicEdges?: number[][] }} ModuleGraphDelta
115
- * @typedef {{ createModuleHotContext(moduleId: string): any, onModuleCacheRemoval(moduleId: string): void }} DevRuntimeHooks
116
- */
117
- var MissingFactoryError = class extends Error {
118
- /**
119
- * @param {string} id
120
- */
121
- constructor(id) {
122
- super(`No factory registered for module ${id}`);
123
- this.id = id;
124
- }
125
- };
126
- var DevRuntime = class {
127
- /**
128
- * @param {string} clientId
129
- */
130
- constructor(clientId) {
131
- _defineProperty(
132
- this,
133
- /**
134
- * Client ID generated at runtime initialization, used for lazy compilation requests.
135
- * @type {string}
136
- */
137
- "clientId",
138
- void 0
139
- );
140
- _defineProperty(
141
- this,
142
- /**
143
- * Static import edges from `registerGraph` — entries persist across `removeModuleCache`
144
- * and change only by replacement from a newer payload (last write wins).
145
- * @type {Map<string, { edges: string[] }>}
146
- */
147
- "staticImports",
148
- /* @__PURE__ */ new Map()
149
- );
150
- _defineProperty(
151
- this,
152
- /**
153
- * Reverse index over the static imports.
154
- * @type {Map<string, Set<string>>}
155
- */
156
- "importers",
157
- /* @__PURE__ */ new Map()
158
- );
159
- _defineProperty(
160
- this,
161
- /**
162
- * Dynamic `import()` edges from `registerGraph`, keyed by importer — mirror of
163
- * `staticImports` for the dynamic reverse index.
164
- * @type {Map<string, { edges: string[] }>}
165
- */
166
- "dynamicImports",
167
- /* @__PURE__ */ new Map()
168
- );
169
- _defineProperty(
170
- this,
171
- /**
172
- * Reverse index over the dynamic imports.
173
- * @type {Map<string, Set<string>>}
174
- */
175
- "dynamicImporters",
176
- /* @__PURE__ */ new Map()
177
- );
178
- _defineProperty(
179
- this,
180
- /**
181
- * The module cache. Membership means "this module's side effects ran in this tab" —
182
- * registration is emitted ahead of every module body, and nothing un-registers on
183
- * unwind, so a factory that throws mid-body stays registered. A `Map` rather than a
184
- * plain object: HMR eviction deletes entries, and a `delete` on an object drops V8
185
- * into dictionary mode, taxing every later lookup on the hottest read path.
186
- * @type {Map<string, Module>}
187
- */
188
- "moduleCache",
189
- /* @__PURE__ */ new Map()
190
- );
191
- _defineProperty(
192
- this,
193
- /**
194
- * Re-runnable factories from HMR patches and lazy chunks. The initial bundle stays
195
- * scope-hoisted and contributes none.
196
- * @type {Map<string, (id: string) => void>}
197
- */
198
- "factories",
199
- /* @__PURE__ */ new Map()
200
- );
201
- _defineProperty(
202
- this,
203
- /**
204
- * Installed by the dev client at boot. The runtime is a store + executor and makes
205
- * no HMR decisions; accepting, disposing, and reloading live behind these hooks.
206
- * @type {DevRuntimeHooks | null}
207
- */
208
- "hooks",
209
- null
210
- );
211
- _defineProperty(
212
- this,
213
- /** @internal */
214
- "__toESM",
215
- __toESM
216
- );
217
- _defineProperty(
218
- this,
219
- /** @internal */
220
- "__toCommonJS",
221
- __toCommonJS
222
- );
223
- _defineProperty(
224
- this,
225
- /** @internal */
226
- "__exportAll",
227
- __exportAll
228
- );
229
- _defineProperty(
230
- this,
231
- /**
232
- * @param {boolean} [isNodeMode]
233
- * @returns {(mod: any) => any}
234
- * @internal
235
- */
236
- "__toDynamicImportESM",
237
- (isNodeMode) => (mod) => __toESM(mod.default, isNodeMode)
238
- );
239
- _defineProperty(
240
- this,
241
- /** @internal */
242
- "__reExport",
243
- __reExport
244
- );
245
- this.clientId = clientId;
246
- }
247
- /**
248
- * @param {ModuleGraphDelta} delta
249
- */
250
- registerGraph(delta) {
251
- for (let i = 0; i < delta.localCount; i++) {
252
- const id = delta.ids[i];
253
- const edges = delta.edges[i].map((j) => delta.ids[j]);
254
- for (const target of this.staticImports.get(id)?.edges ?? []) this.importers.get(target)?.delete(id);
255
- for (const target of edges) {
256
- let importerSet = this.importers.get(target);
257
- if (!importerSet) {
258
- importerSet = /* @__PURE__ */ new Set();
259
- this.importers.set(target, importerSet);
260
- }
261
- importerSet.add(id);
262
- }
263
- this.staticImports.set(id, { edges });
264
- const dynamicEdges = (delta.dynamicEdges?.[i] ?? []).map((j) => delta.ids[j]);
265
- for (const target of this.dynamicImports.get(id)?.edges ?? []) this.dynamicImporters.get(target)?.delete(id);
266
- for (const target of dynamicEdges) {
267
- let importerSet = this.dynamicImporters.get(target);
268
- if (!importerSet) {
269
- importerSet = /* @__PURE__ */ new Set();
270
- this.dynamicImporters.set(target, importerSet);
271
- }
272
- importerSet.add(id);
273
- }
274
- this.dynamicImports.set(id, { edges: dynamicEdges });
275
- }
276
- }
277
- /**
278
- * @param {string} id
279
- * @param {(id: string) => void} fn
280
- */
281
- registerFactory(id, fn) {
282
- this.factories.set(id, fn);
283
- }
284
- /**
285
- * @param {string} id
286
- * @param {{ exports: any }} [exportsHolder]
287
- */
288
- registerModule(id, exportsHolder = { exports: {} }) {
289
- const module = new Module(id);
290
- module.exportsHolder = exportsHolder;
291
- this.moduleCache.set(id, module);
292
- }
293
- /**
294
- * @param {string} id
295
- * @returns {string[]}
296
- */
297
- getImporters(id) {
298
- const dynamic = this.dynamicImporters.get(id);
299
- if (!dynamic || dynamic.size === 0) return [...this.importers.get(id) ?? []];
300
- return [.../* @__PURE__ */ new Set([...this.importers.get(id) ?? [], ...dynamic])];
301
- }
302
- /**
303
- * @param {string} id
304
- */
305
- isExecuted(id) {
306
- return this.moduleCache.has(id);
307
- }
308
- /**
309
- * @param {string} id
310
- */
311
- hasFactory(id) {
312
- return this.factories.has(id);
313
- }
314
- /**
315
- * Module-cache delete only — static imports and factories persist. Removal is what
316
- * re-arms a cache-gated factory for `initModule`.
317
- * @param {string} id
318
- */
319
- removeModuleCache(id) {
320
- this.moduleCache.delete(id);
321
- this.hooks?.onModuleCacheRemoval(id);
322
- }
323
- /**
324
- * The one re-execution gate: registered → return the live exports; otherwise run the
325
- * mapped factory (which registers itself first, then runs the body).
326
- * @param {string} id
327
- */
328
- initModule(id) {
329
- if (this.moduleCache.has(id)) return this.loadExports(id);
330
- const factory = this.factories.get(id);
331
- if (!factory) throw new MissingFactoryError(id);
332
- factory(id);
333
- return this.loadExports(id);
334
- }
335
- /**
336
- * @param {string} id
337
- */
338
- loadExports(id) {
339
- const module = this.moduleCache.get(id);
340
- if (module) return module.exportsHolder.exports;
341
- else {
342
- console.warn(`Module ${id} not found`);
343
- return {};
344
- }
345
- }
346
- /**
347
- * @param {string} moduleId
348
- */
349
- createModuleHotContext(moduleId) {
350
- if (this.hooks) return this.hooks.createModuleHotContext(moduleId);
351
- throw new Error("createModuleHotContext requires installed hooks or an override");
352
- }
353
- };
354
- //#endregion
355
50
  //#region ../../vite/packages/vite/src/shared/hmr.ts
356
51
  var HMRContext = class {
357
52
  constructor(hmrClient, ownerPath) {
@@ -1022,6 +717,64 @@ const createWebSocketModuleRunnerTransport = (options) => {
1022
717
  };
1023
718
  };
1024
719
  //#endregion
720
+ //#region ../../vite/packages/vite/src/shared/pretty-format.ts
721
+ const DEFAULT_OPTIONS = {
722
+ maxDepth: 3,
723
+ maxWidth: 100
724
+ };
725
+ const objectToString = Object.prototype.toString;
726
+ const errorToString = Error.prototype.toString;
727
+ const identifierRE = /^[a-z_$][\w$]*$/i;
728
+ function prettyFormat(value, options = {}) {
729
+ return printer(value, {
730
+ ...DEFAULT_OPTIONS,
731
+ ...options
732
+ }, 0, []);
733
+ }
734
+ function printer(value, config, depth, refs) {
735
+ return printBasicValue(value) ?? printComplexValue(value, config, depth, refs);
736
+ }
737
+ function printBasicValue(value) {
738
+ if (value == null) return String(value);
739
+ if (typeof value === "string") return JSON.stringify(value);
740
+ if (typeof value === "number") return Object.is(value, -0) ? "-0" : String(value);
741
+ if (typeof value === "bigint") return `${value}n`;
742
+ if (typeof value === "boolean" || typeof value === "symbol") return String(value);
743
+ if (typeof value === "function") return value.name ? `[Function: ${value.name}]` : "[Function]";
744
+ const type = objectToString.call(value);
745
+ if (type === "[object Date]") return Number.isNaN(+value) ? "Date { NaN }" : value.toISOString();
746
+ if (type === "[object Error]" || value instanceof Error) return `[${errorToString.call(value)}]`;
747
+ }
748
+ function printComplexValue(value, config, depth, refs) {
749
+ if (refs.includes(value)) return "[Circular]";
750
+ refs = [...refs, value];
751
+ const hitMaxDepth = ++depth > config.maxDepth;
752
+ if (Array.isArray(value)) return hitMaxDepth ? "[Array]" : `[${printListItems(value, config, depth, refs)}]`;
753
+ return hitMaxDepth ? "[Object]" : `{${printObjectProperties(value, config, depth, refs)}}`;
754
+ }
755
+ function printListItems(value, config, depth, refs) {
756
+ const width = Math.min(value.length, config.maxWidth);
757
+ const result = [];
758
+ for (let i = 0; i < width; i++) result.push(i in value ? printer(value[i], config, depth, refs) : "");
759
+ if (width < value.length) result.push(`…(${value.length - width})`);
760
+ return withSpacing(result);
761
+ }
762
+ function printObjectProperties(value, config, depth, refs) {
763
+ const keys = Object.keys(value);
764
+ const width = Math.min(keys.length, config.maxWidth);
765
+ const result = [];
766
+ for (let i = 0; i < width; i++) {
767
+ const key = keys[i];
768
+ const name = key !== "__proto__" && identifierRE.test(key) ? key : JSON.stringify(key);
769
+ result.push(`${name}: ${printer(value[key], config, depth, refs)}`);
770
+ }
771
+ if (width < keys.length) result.push(`…(${keys.length - width})`);
772
+ return withSpacing(result);
773
+ }
774
+ function withSpacing(values) {
775
+ return values.length === 0 ? "" : ` ${values.join(", ")} `;
776
+ }
777
+ //#endregion
1025
778
  //#region ../../vite/packages/vite/src/shared/forwardConsole.ts
1026
779
  function setupForwardConsoleHandler(transport, options, console = globalThis.console) {
1027
780
  if (!options.enabled) return;
@@ -1048,7 +801,7 @@ function setupForwardConsoleHandler(transport, options, console = globalThis.con
1048
801
  type: "log",
1049
802
  data: {
1050
803
  level,
1051
- message: formatConsoleArgs(args)
804
+ message: truncateConsoleMessage(formatConsoleArgs(args))
1052
805
  }
1053
806
  }
1054
807
  });
@@ -1125,30 +878,23 @@ function formatConsoleArgs(args) {
1125
878
  }
1126
879
  function stringifyConsoleArg(value) {
1127
880
  if (typeof value === "string") return value;
1128
- if (typeof value === "number" || typeof value === "boolean" || typeof value === "undefined") return String(value);
1129
- if (typeof value === "symbol") return value.toString();
1130
- if (typeof value === "function") return value.name ? `[Function: ${value.name}]` : "[Function]";
1131
881
  if (value instanceof Error) return value.stack || `${value.name}: ${value.message}`;
1132
- if (typeof value === "bigint") return `${value}n`;
1133
- const seen = /* @__PURE__ */ new WeakSet();
1134
882
  try {
1135
- return JSON.stringify(value, (_, nested) => {
1136
- if (typeof nested === "bigint") return `${nested}n`;
1137
- if (nested instanceof Error) return {
1138
- name: nested.name,
1139
- message: nested.message,
1140
- stack: nested.stack
1141
- };
1142
- if (nested && typeof nested === "object") {
1143
- if (seen.has(nested)) return "[Circular]";
1144
- seen.add(nested);
1145
- }
1146
- return nested;
1147
- }) ?? String(value);
883
+ return prettyFormat(value);
1148
884
  } catch {
1149
885
  return String(value);
1150
886
  }
1151
887
  }
888
+ const MAX_CONSOLE_MESSAGE_LENGTH = 1e4;
889
+ function truncateConsoleMessage(message) {
890
+ if (message.length <= MAX_CONSOLE_MESSAGE_LENGTH) return message;
891
+ let end = 9999;
892
+ if (isHighSurrogate(message[end - 1])) end--;
893
+ return `${message.slice(0, end)}…`;
894
+ }
895
+ function isHighSurrogate(value) {
896
+ return value >= "\ud800" && value <= "\udbff";
897
+ }
1152
898
  //#endregion
1153
899
  //#region ../../vite/packages/vite/src/shared/hmrHandler.ts
1154
900
  function createHMRHandler(handler) {
@@ -253,6 +253,64 @@ const createWebSocketModuleRunnerTransport = (options) => {
253
253
  };
254
254
  };
255
255
  //#endregion
256
+ //#region ../../vite/packages/vite/src/shared/pretty-format.ts
257
+ const DEFAULT_OPTIONS = {
258
+ maxDepth: 3,
259
+ maxWidth: 100
260
+ };
261
+ const objectToString = Object.prototype.toString;
262
+ const errorToString = Error.prototype.toString;
263
+ const identifierRE = /^[a-z_$][\w$]*$/i;
264
+ function prettyFormat(value, options = {}) {
265
+ return printer(value, {
266
+ ...DEFAULT_OPTIONS,
267
+ ...options
268
+ }, 0, []);
269
+ }
270
+ function printer(value, config, depth, refs) {
271
+ return printBasicValue(value) ?? printComplexValue(value, config, depth, refs);
272
+ }
273
+ function printBasicValue(value) {
274
+ if (value == null) return String(value);
275
+ if (typeof value === "string") return JSON.stringify(value);
276
+ if (typeof value === "number") return Object.is(value, -0) ? "-0" : String(value);
277
+ if (typeof value === "bigint") return `${value}n`;
278
+ if (typeof value === "boolean" || typeof value === "symbol") return String(value);
279
+ if (typeof value === "function") return value.name ? `[Function: ${value.name}]` : "[Function]";
280
+ const type = objectToString.call(value);
281
+ if (type === "[object Date]") return Number.isNaN(+value) ? "Date { NaN }" : value.toISOString();
282
+ if (type === "[object Error]" || value instanceof Error) return `[${errorToString.call(value)}]`;
283
+ }
284
+ function printComplexValue(value, config, depth, refs) {
285
+ if (refs.includes(value)) return "[Circular]";
286
+ refs = [...refs, value];
287
+ const hitMaxDepth = ++depth > config.maxDepth;
288
+ if (Array.isArray(value)) return hitMaxDepth ? "[Array]" : `[${printListItems(value, config, depth, refs)}]`;
289
+ return hitMaxDepth ? "[Object]" : `{${printObjectProperties(value, config, depth, refs)}}`;
290
+ }
291
+ function printListItems(value, config, depth, refs) {
292
+ const width = Math.min(value.length, config.maxWidth);
293
+ const result = [];
294
+ for (let i = 0; i < width; i++) result.push(i in value ? printer(value[i], config, depth, refs) : "");
295
+ if (width < value.length) result.push(`…(${value.length - width})`);
296
+ return withSpacing(result);
297
+ }
298
+ function printObjectProperties(value, config, depth, refs) {
299
+ const keys = Object.keys(value);
300
+ const width = Math.min(keys.length, config.maxWidth);
301
+ const result = [];
302
+ for (let i = 0; i < width; i++) {
303
+ const key = keys[i];
304
+ const name = key !== "__proto__" && identifierRE.test(key) ? key : JSON.stringify(key);
305
+ result.push(`${name}: ${printer(value[key], config, depth, refs)}`);
306
+ }
307
+ if (width < keys.length) result.push(`…(${keys.length - width})`);
308
+ return withSpacing(result);
309
+ }
310
+ function withSpacing(values) {
311
+ return values.length === 0 ? "" : ` ${values.join(", ")} `;
312
+ }
313
+ //#endregion
256
314
  //#region ../../vite/packages/vite/src/shared/forwardConsole.ts
257
315
  function setupForwardConsoleHandler(transport, options, console = globalThis.console) {
258
316
  if (!options.enabled) return;
@@ -279,7 +337,7 @@ function setupForwardConsoleHandler(transport, options, console = globalThis.con
279
337
  type: "log",
280
338
  data: {
281
339
  level,
282
- message: formatConsoleArgs(args)
340
+ message: truncateConsoleMessage(formatConsoleArgs(args))
283
341
  }
284
342
  }
285
343
  });
@@ -356,32 +414,25 @@ function formatConsoleArgs(args) {
356
414
  }
357
415
  function stringifyConsoleArg(value) {
358
416
  if (typeof value === "string") return value;
359
- if (typeof value === "number" || typeof value === "boolean" || typeof value === "undefined") return String(value);
360
- if (typeof value === "symbol") return value.toString();
361
- if (typeof value === "function") return value.name ? `[Function: ${value.name}]` : "[Function]";
362
417
  if (value instanceof Error) return value.stack || `${value.name}: ${value.message}`;
363
- if (typeof value === "bigint") return `${value}n`;
364
- const seen = /* @__PURE__ */ new WeakSet();
365
418
  try {
366
- return JSON.stringify(value, (_, nested) => {
367
- if (typeof nested === "bigint") return `${nested}n`;
368
- if (nested instanceof Error) return {
369
- name: nested.name,
370
- message: nested.message,
371
- stack: nested.stack
372
- };
373
- if (nested && typeof nested === "object") {
374
- if (seen.has(nested)) return "[Circular]";
375
- seen.add(nested);
376
- }
377
- return nested;
378
- }) ?? String(value);
419
+ return prettyFormat(value);
379
420
  } catch {
380
421
  return String(value);
381
422
  }
382
423
  }
424
+ const MAX_CONSOLE_MESSAGE_LENGTH = 1e4;
425
+ function truncateConsoleMessage(message) {
426
+ if (message.length <= MAX_CONSOLE_MESSAGE_LENGTH) return message;
427
+ let end = 9999;
428
+ if (isHighSurrogate(message[end - 1])) end--;
429
+ return `${message.slice(0, end)}…`;
430
+ }
431
+ function isHighSurrogate(value) {
432
+ return value >= "\ud800" && value <= "\udbff";
433
+ }
383
434
  //#endregion
384
- //#region \0@oxc-project+runtime@0.151.0/helpers/esm/typeof.js
435
+ //#region \0@oxc-project+runtime@0.152.0/helpers/esm/typeof.js
385
436
  function _typeof(o) {
386
437
  "@babel/helpers - typeof";
387
438
  return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
@@ -391,7 +442,7 @@ function _typeof(o) {
391
442
  }, _typeof(o);
392
443
  }
393
444
  //#endregion
394
- //#region \0@oxc-project+runtime@0.151.0/helpers/esm/toPrimitive.js
445
+ //#region \0@oxc-project+runtime@0.152.0/helpers/esm/toPrimitive.js
395
446
  function toPrimitive(t, r) {
396
447
  if ("object" != _typeof(t) || !t) return t;
397
448
  var e = t[Symbol.toPrimitive];
@@ -403,13 +454,13 @@ function toPrimitive(t, r) {
403
454
  return ("string" === r ? String : Number)(t);
404
455
  }
405
456
  //#endregion
406
- //#region \0@oxc-project+runtime@0.151.0/helpers/esm/toPropertyKey.js
457
+ //#region \0@oxc-project+runtime@0.152.0/helpers/esm/toPropertyKey.js
407
458
  function toPropertyKey(t) {
408
459
  var i = toPrimitive(t, "string");
409
460
  return "symbol" == _typeof(i) ? i : i + "";
410
461
  }
411
462
  //#endregion
412
- //#region \0@oxc-project+runtime@0.151.0/helpers/esm/defineProperty.js
463
+ //#region \0@oxc-project+runtime@0.152.0/helpers/esm/defineProperty.js
413
464
  function _defineProperty(e, r, t) {
414
465
  return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
415
466
  value: t,