@voidzero-dev/vite-plus-core 0.1.1 → 0.1.3
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/dist/rolldown/cli.mjs +11 -22
- package/dist/rolldown/config.d.mts +1 -2
- package/dist/rolldown/config.mjs +10 -11
- package/dist/rolldown/experimental-index.d.mts +20 -6
- package/dist/rolldown/experimental-index.mjs +24 -22
- package/dist/rolldown/filter-index.d.mts +1 -2
- package/dist/rolldown/filter-index.mjs +2 -8
- package/dist/rolldown/get-log-filter.mjs +1 -2
- package/dist/rolldown/index.d.mts +3 -3
- package/dist/rolldown/index.mjs +10 -13
- package/dist/rolldown/parallel-plugin-worker.mjs +7 -9
- package/dist/rolldown/parallel-plugin.d.mts +1 -2
- package/dist/rolldown/parallel-plugin.mjs +1 -2
- package/dist/rolldown/parse-ast-index.d.mts +1 -1
- package/dist/rolldown/parse-ast-index.mjs +4 -6
- package/dist/rolldown/plugins-index.d.mts +3 -3
- package/dist/rolldown/plugins-index.mjs +4 -6
- package/dist/rolldown/shared/{binding-C4ZlFAt6.d.mts → binding-BohGL_65.d.mts} +10 -5
- package/dist/rolldown/shared/{binding-Bd04_f8P.mjs → binding-COZdHtee.mjs} +7 -16
- package/dist/rolldown/shared/{bindingify-input-options-ffqkmT9z.mjs → bindingify-input-options-DdW_FOGG.mjs} +33 -56
- package/dist/rolldown/shared/{constructors-C5a55nbY.mjs → constructors-CQlws1EK.mjs} +2 -4
- package/dist/rolldown/shared/{constructors-cPsD1J5w.d.mts → constructors-ColrbLxz.d.mts} +2 -2
- package/dist/rolldown/shared/{define-config-DX_4SBzo.d.mts → define-config-BqZZMLjO.d.mts} +66 -30
- package/dist/rolldown/shared/{define-config-BMj_QknW.mjs → define-config-DJOr6Iwt.mjs} +1 -2
- package/dist/rolldown/shared/{error-BYPsvVEN.mjs → error-FTNambir.mjs} +3 -8
- package/dist/rolldown/shared/{load-config-Oj1-3DPg.mjs → load-config-DBRCgd9m.mjs} +2 -4
- package/dist/rolldown/shared/{logs-CCc_0vhs.mjs → logs-D80CXhvg.mjs} +5 -8
- package/dist/rolldown/shared/{misc-Xty885dB.mjs → misc-DJYbNKZX.mjs} +1 -2
- package/dist/rolldown/shared/{normalize-string-or-regex-DoNa0azR.mjs → normalize-string-or-regex-CJTjKt5t.mjs} +3 -6
- package/dist/rolldown/shared/{parse-Wj8OTS4w.mjs → parse-q7gzDQmi.mjs} +2 -5
- package/dist/rolldown/shared/{prompt-CmNr0AI-.mjs → prompt-DZIXsnf9.mjs} +1 -3
- package/dist/rolldown/shared/{rolldown-y9H0nYAD.mjs → rolldown-BJMdRJb1.mjs} +2 -4
- package/dist/rolldown/shared/{rolldown-build-DkOWV5Vu.mjs → rolldown-build-DKv2K096.mjs} +424 -473
- package/dist/rolldown/shared/{transform-DoG7c5_r.d.mts → transform-BoJxrM-e.d.mts} +1 -1
- package/dist/rolldown/shared/{transform-D55YcCvB.mjs → transform-CQppMqL8.mjs} +3 -6
- package/dist/rolldown/shared/{watch-Cn-znpX_.mjs → watch-BeMWbIuq.mjs} +71 -77
- package/dist/rolldown/utils-index.d.mts +2 -2
- package/dist/rolldown/utils-index.mjs +9 -18
- package/dist/tsdown/{build-BjQ7Rt90-tMPZTflz.js → build-TmLngPCw-CBoVPzkZ.js} +312 -324
- package/dist/tsdown/build-gOkJM1H9-D9ngUBpk.js +5 -0
- package/dist/tsdown/{chunk-CdeBBKNj.js → chunk-CSNpwdVU.js} +13 -23
- package/dist/tsdown/{debug-BUVkFfEZ-D3UMJnif.js → debug-tOJ_PtrM-C-Do1Twv.js} +4 -6
- package/dist/tsdown/{detect-CCATtVj7-DhvBg5EF.js → detect-DK-FDZQ9-CHuRhyUG.js} +2 -4
- package/dist/tsdown/{dist-CFTDWtv2.js → dist-Ba2DZx1w.js} +7 -7
- package/dist/tsdown/{dist-DNcnO8LL.js → dist-DCol2bGA.js} +503 -568
- package/dist/tsdown/{dist-kuoe97DJ.js → dist-_l70jCqI.js} +1 -2
- package/dist/tsdown/{filename-CPj0AKvV.js → filename-BDcjeHGl.js} +3 -5
- package/dist/tsdown/{index-node-ShM0x2b6-Bt7Chc0I.js → index-node-Djp92Gzb-B-AUHI4t.js} +2 -4
- package/dist/tsdown/index-types.d.ts +180 -29
- package/dist/tsdown/index.js +7 -9
- package/dist/tsdown/{main-B3qcLRNf.js → main-DYgM-9Cb.js} +71 -83
- package/dist/tsdown/{node-Ba_UB_xO.js → node-B3Gdtau1.js} +1 -4
- package/dist/tsdown/npm_cjs_chunk_chunk.cjs +6 -8
- package/dist/tsdown/npm_cjs_chunk_lt.cjs +28 -0
- package/dist/tsdown/npm_cjs_chunk_range.cjs +22 -49
- package/dist/tsdown/npm_cjs_chunk_semver.cjs +54 -66
- package/dist/tsdown/npm_entry_picomatch.cjs +18 -30
- package/dist/tsdown/npm_entry_semver_functions_coerce.cjs +3 -7
- package/dist/tsdown/npm_entry_semver_functions_lt.cjs +5 -0
- package/dist/tsdown/npm_entry_semver_functions_satisfies.cjs +5 -7
- package/dist/tsdown/npm_entry_semver_ranges_min-version.cjs +5 -7
- package/dist/tsdown/npm_entry_tree-kill.cjs +2 -6
- package/dist/tsdown/{resolver-j7HY1N36-DHVsN9q6.js → resolver-CdD-yT15-3eaymYLw.js} +3 -5
- package/dist/tsdown/run.js +209 -74
- package/dist/tsdown/{tsc-CBjlgM2A.js → tsc-CberiTDq.js} +64 -71
- package/dist/tsdown/{tsc-context-D1h5oZB8.js → tsc-context-DiIjfXAG.js} +3 -5
- package/dist/vite/client/client.mjs +4 -19
- package/dist/vite/client/env.mjs +1 -2
- package/dist/vite/node/chunks/build.js +2 -3
- package/dist/vite/node/chunks/build2.js +91 -243
- package/dist/vite/node/chunks/chunk.js +7 -13
- package/dist/vite/node/chunks/config.js +2 -3
- package/dist/vite/node/chunks/dist.js +27 -61
- package/dist/vite/node/chunks/dist2.js +11 -95
- package/dist/vite/node/chunks/lib.js +1 -7
- package/dist/vite/node/chunks/logger.js +3 -8
- package/dist/vite/node/chunks/node.js +137 -428
- package/dist/vite/node/chunks/optimizer.js +2 -3
- package/dist/vite/node/chunks/postcss-import.js +1 -13
- package/dist/vite/node/chunks/preview.js +2 -3
- package/dist/vite/node/chunks/server.js +2 -3
- package/dist/vite/node/cli.js +1 -4
- package/dist/vite/node/index.d.ts +2 -2
- package/dist/vite/node/index.js +1 -2
- package/dist/vite/node/internal.js +1 -2
- package/dist/vite/node/module-runner.js +44 -3
- package/package.json +15 -11
- package/dist/rolldown/cli-setup.d.mts +0 -1
- package/dist/rolldown/cli-setup.mjs +0 -17
- package/dist/tsdown/build-2oRq4mfQ-YC_gzK3u.js +0 -6
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { a as RolldownLog } from "./logging-C6h4g8dA.mjs";
|
|
2
|
-
import { I as ParseResult$1, L as ParserOptions$1, N as MinifyOptions$1, P as MinifyResult$1, U as TsconfigCache, V as SourceMap, a as BindingEnhancedTransformOptions, o as BindingEnhancedTransformResult } from "./binding-
|
|
2
|
+
import { I as ParseResult$1, L as ParserOptions$1, N as MinifyOptions$1, P as MinifyResult$1, U as TsconfigCache, V as SourceMap, a as BindingEnhancedTransformOptions, o as BindingEnhancedTransformResult } from "./binding-BohGL_65.mjs";
|
|
3
3
|
|
|
4
4
|
//#region src/utils/parse.d.ts
|
|
5
5
|
/**
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { n as __toESM, t as require_binding } from "./binding-
|
|
2
|
-
import { a as bindingifySourcemap, n as normalizeBindingError } from "./error-
|
|
3
|
-
|
|
1
|
+
import { n as __toESM, t as require_binding } from "./binding-COZdHtee.mjs";
|
|
2
|
+
import { a as bindingifySourcemap, n as normalizeBindingError } from "./error-FTNambir.mjs";
|
|
4
3
|
//#region src/utils/minify.ts
|
|
5
4
|
var import_binding = /* @__PURE__ */ __toESM(require_binding(), 1);
|
|
6
5
|
/**
|
|
@@ -35,7 +34,6 @@ function minifySync(filename, sourceText, options) {
|
|
|
35
34
|
};
|
|
36
35
|
return result;
|
|
37
36
|
}
|
|
38
|
-
|
|
39
37
|
//#endregion
|
|
40
38
|
//#region src/utils/transform.ts
|
|
41
39
|
/**
|
|
@@ -88,6 +86,5 @@ function transformSync(filename, sourceText, options, cache) {
|
|
|
88
86
|
warnings: result.warnings.map((w) => w.field0)
|
|
89
87
|
};
|
|
90
88
|
}
|
|
91
|
-
|
|
92
89
|
//#endregion
|
|
93
|
-
export { minifySync as a, minify as i, transform as n, transformSync as r, import_binding as t };
|
|
90
|
+
export { minifySync as a, minify as i, transform as n, transformSync as r, import_binding as t };
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import { n as __toESM, t as require_binding } from "./binding-
|
|
2
|
-
import { o as
|
|
3
|
-
import { _ as LOG_LEVEL_WARN } from "./bindingify-input-options-
|
|
4
|
-
import { t as arraify } from "./misc-
|
|
5
|
-
import { n as createBundlerOptions, u as PluginDriver } from "./rolldown-build-
|
|
6
|
-
import { t as aggregateBindingErrorsIntoJsError } from "./error-
|
|
7
|
-
|
|
1
|
+
import { n as __toESM, t as require_binding } from "./binding-COZdHtee.mjs";
|
|
2
|
+
import { o as logMultipleWatcherOption } from "./logs-D80CXhvg.mjs";
|
|
3
|
+
import { _ as LOG_LEVEL_WARN } from "./bindingify-input-options-DdW_FOGG.mjs";
|
|
4
|
+
import { t as arraify } from "./misc-DJYbNKZX.mjs";
|
|
5
|
+
import { n as createBundlerOptions, u as PluginDriver } from "./rolldown-build-DKv2K096.mjs";
|
|
6
|
+
import { t as aggregateBindingErrorsIntoJsError } from "./error-FTNambir.mjs";
|
|
8
7
|
//#region ../../../node_modules/.pnpm/signal-exit@4.1.0/node_modules/signal-exit/dist/mjs/signals.js
|
|
9
8
|
/**
|
|
10
9
|
* This is not the set of all possible signals.
|
|
@@ -36,7 +35,6 @@ const signals = [];
|
|
|
36
35
|
signals.push("SIGHUP", "SIGINT", "SIGTERM");
|
|
37
36
|
if (process.platform !== "win32") signals.push("SIGALRM", "SIGABRT", "SIGVTALRM", "SIGXCPU", "SIGXFSZ", "SIGUSR2", "SIGTRAP", "SIGSYS", "SIGQUIT", "SIGIOT");
|
|
38
37
|
if (process.platform === "linux") signals.push("SIGIO", "SIGPOLL", "SIGPWR", "SIGSTKFLT");
|
|
39
|
-
|
|
40
38
|
//#endregion
|
|
41
39
|
//#region ../../../node_modules/.pnpm/signal-exit@4.1.0/node_modules/signal-exit/dist/mjs/index.js
|
|
42
40
|
const processOk = (process) => !!process && typeof process === "object" && typeof process.removeListener === "function" && typeof process.emit === "function" && typeof process.reallyExit === "function" && typeof process.listeners === "function" && typeof process.kill === "function" && typeof process.pid === "number" && typeof process.on === "function";
|
|
@@ -204,7 +202,6 @@ var SignalExit = class extends SignalExitBase {
|
|
|
204
202
|
};
|
|
205
203
|
const process$1 = globalThis.process;
|
|
206
204
|
const { onExit: onExit$1, load, unload } = signalExitWrap(processOk(process$1) ? new SignalExit(process$1) : new SignalExitFallback());
|
|
207
|
-
|
|
208
205
|
//#endregion
|
|
209
206
|
//#region src/utils/signal-exit.ts
|
|
210
207
|
function onExit(...args) {
|
|
@@ -216,16 +213,10 @@ function onExit(...args) {
|
|
|
216
213
|
}
|
|
217
214
|
onExit$1(...args);
|
|
218
215
|
}
|
|
219
|
-
|
|
220
216
|
//#endregion
|
|
221
217
|
//#region src/api/watch/watch-emitter.ts
|
|
222
|
-
var import_binding = /* @__PURE__ */ __toESM(require_binding());
|
|
223
218
|
var WatcherEmitter = class {
|
|
224
219
|
listeners = /* @__PURE__ */ new Map();
|
|
225
|
-
timer;
|
|
226
|
-
constructor() {
|
|
227
|
-
this.timer = setInterval(() => {}, 1e9);
|
|
228
|
-
}
|
|
229
220
|
on(event, listener) {
|
|
230
221
|
const listeners = this.listeners.get(event);
|
|
231
222
|
if (listeners) listeners.push(listener);
|
|
@@ -241,58 +232,56 @@ var WatcherEmitter = class {
|
|
|
241
232
|
return this;
|
|
242
233
|
}
|
|
243
234
|
clear(event) {
|
|
244
|
-
|
|
245
|
-
}
|
|
246
|
-
async onEvent(event) {
|
|
247
|
-
const listeners = this.listeners.get(event.eventKind());
|
|
248
|
-
if (listeners) switch (event.eventKind()) {
|
|
249
|
-
case "close":
|
|
250
|
-
case "restart":
|
|
251
|
-
for (const listener of listeners) await listener();
|
|
252
|
-
break;
|
|
253
|
-
case "event":
|
|
254
|
-
for (const listener of listeners) {
|
|
255
|
-
const code = event.bundleEventKind();
|
|
256
|
-
switch (code) {
|
|
257
|
-
case "BUNDLE_END":
|
|
258
|
-
const { duration, output, result } = event.bundleEndData();
|
|
259
|
-
await listener({
|
|
260
|
-
code: "BUNDLE_END",
|
|
261
|
-
duration,
|
|
262
|
-
output: [output],
|
|
263
|
-
result
|
|
264
|
-
});
|
|
265
|
-
break;
|
|
266
|
-
case "ERROR":
|
|
267
|
-
const data = event.bundleErrorData();
|
|
268
|
-
await listener({
|
|
269
|
-
code: "ERROR",
|
|
270
|
-
error: aggregateBindingErrorsIntoJsError(data.error),
|
|
271
|
-
result: data.result
|
|
272
|
-
});
|
|
273
|
-
break;
|
|
274
|
-
default:
|
|
275
|
-
await listener({ code });
|
|
276
|
-
break;
|
|
277
|
-
}
|
|
278
|
-
}
|
|
279
|
-
break;
|
|
280
|
-
case "change":
|
|
281
|
-
for (const listener of listeners) {
|
|
282
|
-
const { path, kind } = event.watchChangeData();
|
|
283
|
-
await listener(path, { event: kind });
|
|
284
|
-
}
|
|
285
|
-
break;
|
|
286
|
-
default: throw new Error(`Unknown event: ${event}`);
|
|
287
|
-
}
|
|
235
|
+
this.listeners.delete(event);
|
|
288
236
|
}
|
|
289
|
-
|
|
290
|
-
|
|
237
|
+
/** Async emit — sequential dispatch so side effects from earlier handlers
|
|
238
|
+
* (e.g. `event.result.close()` triggering `closeBundle`) are visible to later handlers. */
|
|
239
|
+
async emit(event, ...args) {
|
|
240
|
+
const handlers = this.listeners.get(event);
|
|
241
|
+
if (handlers?.length) for (const h of handlers) await h(...args);
|
|
291
242
|
}
|
|
243
|
+
async close() {}
|
|
292
244
|
};
|
|
293
|
-
|
|
294
245
|
//#endregion
|
|
295
246
|
//#region src/api/watch/watcher.ts
|
|
247
|
+
var import_binding = /* @__PURE__ */ __toESM(require_binding(), 1);
|
|
248
|
+
function createEventCallback(emitter) {
|
|
249
|
+
return async (event) => {
|
|
250
|
+
switch (event.eventKind()) {
|
|
251
|
+
case "event": {
|
|
252
|
+
const code = event.bundleEventKind();
|
|
253
|
+
if (code === "BUNDLE_END") {
|
|
254
|
+
const { duration, output, result } = event.bundleEndData();
|
|
255
|
+
await emitter.emit("event", {
|
|
256
|
+
code: "BUNDLE_END",
|
|
257
|
+
duration,
|
|
258
|
+
output: [output],
|
|
259
|
+
result
|
|
260
|
+
});
|
|
261
|
+
} else if (code === "ERROR") {
|
|
262
|
+
const data = event.bundleErrorData();
|
|
263
|
+
await emitter.emit("event", {
|
|
264
|
+
code: "ERROR",
|
|
265
|
+
error: aggregateBindingErrorsIntoJsError(data.error),
|
|
266
|
+
result: data.result
|
|
267
|
+
});
|
|
268
|
+
} else await emitter.emit("event", { code });
|
|
269
|
+
break;
|
|
270
|
+
}
|
|
271
|
+
case "change": {
|
|
272
|
+
const { path, kind } = event.watchChangeData();
|
|
273
|
+
await emitter.emit("change", path, { event: kind });
|
|
274
|
+
break;
|
|
275
|
+
}
|
|
276
|
+
case "restart":
|
|
277
|
+
await emitter.emit("restart");
|
|
278
|
+
break;
|
|
279
|
+
case "close":
|
|
280
|
+
await emitter.emit("close");
|
|
281
|
+
break;
|
|
282
|
+
}
|
|
283
|
+
};
|
|
284
|
+
}
|
|
296
285
|
var Watcher = class {
|
|
297
286
|
closed;
|
|
298
287
|
inner;
|
|
@@ -308,6 +297,7 @@ var Watcher = class {
|
|
|
308
297
|
originClose();
|
|
309
298
|
};
|
|
310
299
|
this.stopWorkers = stopWorkers;
|
|
300
|
+
process.nextTick(() => this.run());
|
|
311
301
|
}
|
|
312
302
|
async close() {
|
|
313
303
|
if (this.closed) return;
|
|
@@ -316,8 +306,9 @@ var Watcher = class {
|
|
|
316
306
|
await this.inner.close();
|
|
317
307
|
(0, import_binding.shutdownAsyncRuntime)();
|
|
318
308
|
}
|
|
319
|
-
|
|
320
|
-
|
|
309
|
+
async run() {
|
|
310
|
+
await this.inner.run();
|
|
311
|
+
this.inner.waitForClose();
|
|
321
312
|
}
|
|
322
313
|
};
|
|
323
314
|
async function createWatcher(emitter, input) {
|
|
@@ -325,20 +316,24 @@ async function createWatcher(emitter, input) {
|
|
|
325
316
|
const bundlerOptions = await Promise.all(options.map((option) => arraify(option.output || {}).map(async (output) => {
|
|
326
317
|
return createBundlerOptions(await PluginDriver.callOptionsHook(option, true), output, true);
|
|
327
318
|
})).flat());
|
|
328
|
-
|
|
329
|
-
|
|
319
|
+
warnMultiplePollingOptions(bundlerOptions);
|
|
320
|
+
const callback = createEventCallback(emitter);
|
|
321
|
+
new Watcher(emitter, new import_binding.BindingWatcher(bundlerOptions.map((option) => option.bundlerOptions), callback), bundlerOptions.map((option) => option.stopWorkers));
|
|
330
322
|
}
|
|
331
|
-
function
|
|
332
|
-
let
|
|
333
|
-
for (const option of bundlerOptions)
|
|
334
|
-
const
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
323
|
+
function warnMultiplePollingOptions(bundlerOptions) {
|
|
324
|
+
let found = false;
|
|
325
|
+
for (const option of bundlerOptions) {
|
|
326
|
+
const watch = option.inputOptions.watch;
|
|
327
|
+
const watcher = watch && typeof watch === "object" ? watch.watcher ?? watch.notify : void 0;
|
|
328
|
+
if (watcher && (watcher.usePolling != null || watcher.pollInterval != null)) {
|
|
329
|
+
if (found) {
|
|
330
|
+
option.onLog(LOG_LEVEL_WARN, logMultipleWatcherOption());
|
|
331
|
+
return;
|
|
332
|
+
}
|
|
333
|
+
found = true;
|
|
334
|
+
}
|
|
339
335
|
}
|
|
340
336
|
}
|
|
341
|
-
|
|
342
337
|
//#endregion
|
|
343
338
|
//#region src/api/watch/index.ts
|
|
344
339
|
/**
|
|
@@ -375,6 +370,5 @@ function watch(input) {
|
|
|
375
370
|
createWatcher(emitter, input);
|
|
376
371
|
return emitter;
|
|
377
372
|
}
|
|
378
|
-
|
|
379
373
|
//#endregion
|
|
380
|
-
export { onExit as n, watch as t };
|
|
374
|
+
export { onExit as n, watch as t };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { U as TsconfigCache, _ as BindingTsconfigRawOptions, g as BindingTsconfigCompilerOptions } from "./shared/binding-
|
|
2
|
-
import { a as MinifyOptions, c as minifySync, d as parse, f as parseSync, i as transformSync, l as ParseResult, n as TransformResult, o as MinifyResult, r as transform, s as minify, t as TransformOptions, u as ParserOptions } from "./shared/transform-
|
|
1
|
+
import { U as TsconfigCache, _ as BindingTsconfigRawOptions, g as BindingTsconfigCompilerOptions } from "./shared/binding-BohGL_65.mjs";
|
|
2
|
+
import { a as MinifyOptions, c as minifySync, d as parse, f as parseSync, i as transformSync, l as ParseResult, n as TransformResult, o as MinifyResult, r as transform, s as minify, t as TransformOptions, u as ParserOptions } from "./shared/transform-BoJxrM-e.mjs";
|
|
3
3
|
import * as ESTree from "@oxc-project/types";
|
|
4
4
|
import { Program } from "@oxc-project/types";
|
|
5
5
|
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import "./shared/binding-
|
|
2
|
-
import "./shared/error-
|
|
3
|
-
import { n as parseSync, t as parse } from "./shared/parse-
|
|
4
|
-
import { a as minifySync, i as minify, n as transform, r as transformSync, t as import_binding } from "./shared/transform-
|
|
5
|
-
|
|
1
|
+
import "./shared/binding-COZdHtee.mjs";
|
|
2
|
+
import "./shared/error-FTNambir.mjs";
|
|
3
|
+
import { n as parseSync, t as parse } from "./shared/parse-q7gzDQmi.mjs";
|
|
4
|
+
import { a as minifySync, i as minify, n as transform, r as transformSync, t as import_binding } from "./shared/transform-CQppMqL8.mjs";
|
|
6
5
|
//#region ../../../node_modules/.pnpm/oxc-parser@0.115.0/node_modules/oxc-parser/src-js/generated/visit/walk.js
|
|
7
6
|
function walkNode(node, visitors) {
|
|
8
7
|
if (node == null) return;
|
|
@@ -2012,7 +2011,6 @@ function walkTSUnionType(node, visitors) {
|
|
|
2012
2011
|
walkNode(node.types, visitors);
|
|
2013
2012
|
exit !== null && exit(node);
|
|
2014
2013
|
}
|
|
2015
|
-
|
|
2016
2014
|
//#endregion
|
|
2017
2015
|
//#region ../../../node_modules/.pnpm/oxc-parser@0.115.0/node_modules/oxc-parser/src-js/generated/visit/type_ids.js
|
|
2018
2016
|
/** Mapping from node type name to node type ID */
|
|
@@ -2183,22 +2181,17 @@ const NODE_TYPE_IDS_MAP = new Map([
|
|
|
2183
2181
|
["TSTypeReference", 163],
|
|
2184
2182
|
["TSUnionType", 164]
|
|
2185
2183
|
]);
|
|
2186
|
-
/** Count of all node types (both leaf and non-leaf nodes) */
|
|
2187
|
-
const NODE_TYPES_COUNT = 165;
|
|
2188
|
-
/** Count of leaf node types */
|
|
2189
|
-
const LEAF_NODE_TYPES_COUNT = 27;
|
|
2190
|
-
|
|
2191
2184
|
//#endregion
|
|
2192
2185
|
//#region ../../../node_modules/.pnpm/oxc-parser@0.115.0/node_modules/oxc-parser/src-js/visit/visitor.js
|
|
2193
2186
|
let compiledVisitor;
|
|
2194
2187
|
function createCompiledVisitor() {
|
|
2195
2188
|
compiledVisitor = [];
|
|
2196
|
-
for (let i =
|
|
2189
|
+
for (let i = 165; i !== 0; i--) compiledVisitor.push(null);
|
|
2197
2190
|
return compiledVisitor;
|
|
2198
2191
|
}
|
|
2199
2192
|
const mergedLeafVisitorTypeIds = [], mergedEnterVisitorTypeIds = [], mergedExitVisitorTypeIds = [];
|
|
2200
|
-
for (let i =
|
|
2201
|
-
for (let i =
|
|
2193
|
+
for (let i = 27; i !== 0; i--) mergedLeafVisitorTypeIds.push(0);
|
|
2194
|
+
for (let i = 138; i !== 0; i--) {
|
|
2202
2195
|
mergedEnterVisitorTypeIds.push(0);
|
|
2203
2196
|
mergedExitVisitorTypeIds.push(0);
|
|
2204
2197
|
}
|
|
@@ -2250,7 +2243,7 @@ function addVisitorToCompiled(visitor) {
|
|
|
2250
2243
|
const typeId = NODE_TYPE_IDS_MAP.get(name);
|
|
2251
2244
|
if (typeId === void 0) throw new Error(`Unknown node type '${name}' in visitor object`);
|
|
2252
2245
|
const existing = compiledVisitor[typeId];
|
|
2253
|
-
if (typeId <
|
|
2246
|
+
if (typeId < 27) if (existing === null) compiledVisitor[typeId] = visitFn;
|
|
2254
2247
|
else if (Array.isArray(existing)) if (isExit) existing.push(visitFn);
|
|
2255
2248
|
else existing.splice(existing.length - 1, 0, visitFn);
|
|
2256
2249
|
else {
|
|
@@ -2382,7 +2375,6 @@ const mergers = [
|
|
|
2382
2375
|
visit5(node);
|
|
2383
2376
|
}
|
|
2384
2377
|
];
|
|
2385
|
-
|
|
2386
2378
|
//#endregion
|
|
2387
2379
|
//#region src/utils/visitor.ts
|
|
2388
2380
|
/**
|
|
@@ -2420,7 +2412,6 @@ var Visitor = class {
|
|
|
2420
2412
|
if (compiledVisitor !== null) walkProgram(program, compiledVisitor);
|
|
2421
2413
|
}
|
|
2422
2414
|
};
|
|
2423
|
-
|
|
2424
2415
|
//#endregion
|
|
2425
2416
|
var TsconfigCache = import_binding.TsconfigCache;
|
|
2426
|
-
export { TsconfigCache, Visitor, minify, minifySync, parse, parseSync, transform, transformSync };
|
|
2417
|
+
export { TsconfigCache, Visitor, minify, minifySync, parse, parseSync, transform, transformSync };
|