@voidzero-dev/vite-plus-core 0.2.8 → 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.
- package/LICENSE +30 -1
- package/dist/rolldown/cli.mjs +14 -10
- package/dist/rolldown/config.d.mts +1 -1
- package/dist/rolldown/config.mjs +2 -2
- package/dist/rolldown/experimental-index.d.mts +2 -2
- package/dist/rolldown/experimental-index.mjs +8 -8
- package/dist/rolldown/filter-index.d.mts +1 -1
- package/dist/rolldown/index.d.mts +1 -1
- package/dist/rolldown/index.mjs +4 -4
- package/dist/rolldown/parallel-plugin-worker.mjs +2 -2
- package/dist/rolldown/parallel-plugin.d.mts +1 -1
- package/dist/rolldown/parse-ast-index.mjs +1 -1
- package/dist/rolldown/plugins-index.d.mts +2 -2
- package/dist/rolldown/plugins-index.mjs +2 -2
- package/dist/rolldown/shared/binding-CKyeQZen.mjs +673 -0
- package/dist/rolldown/shared/{bindingify-input-options-B03y7DfJ.mjs → bindingify-input-options-44iPAymO.mjs} +6 -10
- package/dist/rolldown/shared/{constructors-COwFYQna.mjs → constructors-6Zc-JFd7.mjs} +1 -1
- package/dist/rolldown/shared/{constructors-ALilxAii.d.mts → constructors-XaIbWpwJ.d.mts} +1 -1
- package/dist/rolldown/shared/{create-bundler-option-B-tSTZRt.mjs → create-bundler-option-e1FU0w0P.mjs} +3 -3
- package/dist/rolldown/shared/{define-config-DSMNXceb.d.mts → define-config-DVsXPNaU.d.mts} +0 -4
- package/dist/rolldown/shared/{error-nLggAzpQ.mjs → error-BzLGqhSQ.mjs} +1 -1
- package/dist/rolldown/shared/{load-config-O4G7NVNA.mjs → load-config-C6QXSnoS.mjs} +1 -1
- package/dist/rolldown/shared/{normalize-string-or-regex-Cj-DgIV1.mjs → normalize-string-or-regex-DYjJ67tj.mjs} +1 -1
- package/dist/rolldown/shared/{parse-CQfUbVuN.mjs → parse-uDDyc1el.mjs} +2 -2
- package/dist/rolldown/shared/{resolve-tsconfig-CE3HNSOK.mjs → resolve-tsconfig-Bcd82vVT.mjs} +2 -2
- package/dist/rolldown/shared/{rolldown-qV_fUwyM.mjs → rolldown-CCbQNGZt.mjs} +4 -4
- package/dist/rolldown/shared/{watch-BNIsji74.mjs → watch-vuOCmvFs.mjs} +5 -5
- package/dist/rolldown/utils-index.d.mts +1 -1
- package/dist/rolldown/utils-index.mjs +15 -13
- package/dist/tsdown/{build-D_enfyvD-X5SFXZZc.js → build-D_enfyvD-Dg1eKRD4.js} +20 -16
- package/dist/tsdown/{debug-CKcBYQLP-avlAPNcV.js → debug-CKcBYQLP-C3NhYhrk.js} +3 -3
- package/dist/tsdown/{detect-DGhJGEqb-CGd2brAW.js → detect-DGhJGEqb-6CTf16BW.js} +1 -1
- package/dist/tsdown/{dist-BZO8q3c0.js → dist-DyXLnzyh.js} +4 -4
- package/dist/tsdown/index-types.d.ts +3 -3
- package/dist/tsdown/index.js +4 -4
- package/dist/tsdown/internal-DKworeK4.js +3 -0
- package/dist/tsdown/{main-Jz_9T-KA.js → main-DiierkER.js} +210 -196
- package/dist/tsdown/npm_entry_picomatch.cjs +10 -6
- package/dist/tsdown/npm_entry_tree-kill.cjs +4 -2
- package/dist/tsdown/{resolver-cwLsPb2o-BqQjnCbF.js → resolver-cwLsPb2o-Dk4xdAGE.js} +2 -2
- package/dist/tsdown/run.js +6 -6
- package/dist/tsdown/{src-D5keKqGd.js → src-drVPfX63.js} +1 -1
- package/dist/tsdown/{target-Bab3CUeB-CERZYTwS.js → target-Bab3CUeB-DQ0pKhCv.js} +5 -5
- package/dist/tsdown/{tsc-DmzrnJwy.js → tsc-JnMl2z7d.js} +3 -3
- package/dist/tsdown/tsdown-css.js +4 -4
- package/dist/tsdown/tsdown-exe.js +4 -4
- package/dist/vite/client/bundledDevClient.mjs +330 -14
- package/dist/vite/client/client.mjs +20 -14
- package/dist/vite/node/chunks/build.js +51 -45
- package/dist/vite/node/chunks/dist.js +36 -29
- package/dist/vite/node/chunks/dist2.js +193 -149
- package/dist/vite/node/chunks/node.js +931 -793
- package/dist/vite/node/chunks/postcss-import.js +10 -9
- package/dist/vite/node/index.d.ts +7 -5
- package/dist/vite/node/module-runner.js +23 -17
- package/package.json +26 -20
- package/dist/rolldown/shared/binding-DwUQWZOo.mjs +0 -662
- package/dist/tsdown/internal-DyaNxVWW.js +0 -3
package/dist/tsdown/run.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { c as blue, f as hex,
|
|
3
|
-
import { c as globalLogger, n as version, t as enableDebug } from "./debug-CKcBYQLP-
|
|
2
|
+
import { c as blue, f as hex, n as x } from "./main-DiierkER.js";
|
|
3
|
+
import { c as globalLogger, n as version, t as enableDebug } from "./debug-CKcBYQLP-C3NhYhrk.js";
|
|
4
4
|
import module from "node:module";
|
|
5
5
|
import process$1 from "node:process";
|
|
6
6
|
import { VERSION } from "@voidzero-dev/vite-plus-core/rolldown";
|
|
@@ -622,7 +622,7 @@ var CAC = class extends EventTarget {
|
|
|
622
622
|
*/
|
|
623
623
|
const cac = (name = "") => new CAC(name);
|
|
624
624
|
//#endregion
|
|
625
|
-
//#region ../../node_modules/.pnpm/tsdown@0.22.14_@arethetypeswrong+core@0.18.2_@tsdown+css@0.22.14_@tsdown+exe@0.22.14_@
|
|
625
|
+
//#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/dist/run.mjs
|
|
626
626
|
const cli = cac("tsdown");
|
|
627
627
|
cli.help().version(version);
|
|
628
628
|
cli.command("[...files]", "Bundle files", {
|
|
@@ -631,13 +631,13 @@ cli.command("[...files]", "Bundle files", {
|
|
|
631
631
|
}).option("-c, --config <filename>", "Use a custom config file").option("--config-loader <loader>", "Config loader to use: auto, native, tsx, unrun", { default: "auto" }).option("--no-config", "Disable config file").option("-f, --format <format>", "Bundle format: esm, cjs, iife, umd", { default: "esm" }).option("--clean", "Clean output directory, --no-clean to disable").option("--deps.never-bundle <module>", "Mark dependencies as external").option("--minify", "Minify output").option("--devtools", "Enable devtools integration").option("--debug [feat]", "Show debug logs").option("--target <target>", "Bundle target, e.g \"es2015\", \"esnext\"").option("-l, --logLevel <level>", "Set log level: info, warn, error, silent").option("--fail-on-warn", "Fail on warnings", { default: true }).option("--no-write", "Disable writing files to disk, incompatible with watch mode").option("-d, --out-dir <dir>", "Output directory", { default: "dist" }).option("--treeshake", "Tree-shake bundle", { default: true }).option("--sourcemap", "Generate source map", { default: false }).option("--shims", "Enable cjs and esm shims ", { default: false }).option("--platform <platform>", "Target platform", { default: "node" }).option("--dts", "Generate dts files").option("--publint", "Enable publint", { default: false }).option("--attw", "Enable Are the types wrong integration", { default: false }).option("--unused", "Enable unused dependencies check", { default: false }).option("-w, --watch [path]", "Watch mode").option("--ignore-watch <path>", "Ignore custom paths in watch mode").option("--from-vite [vitest]", "Reuse config from Vite or Vitest").option("--report", "Size report", { default: true }).option("--env.* <value>", "Define compile-time env variables").option("--env-file <file>", "Load environment variables from a file, when used together with --env, variables in --env take precedence").option("--env-prefix <prefix>", "Prefix for env variables to inject into the bundle", { default: "TSDOWN_" }).option("--on-success <command>", "Command to run on success").option("--copy <dir>", "Copy files to output dir").option("--public-dir <dir>", "Alias for --copy, deprecated").option("--tsconfig <tsconfig>", "Set tsconfig path").option("--unbundle", "Unbundle mode").option("--root <dir>", "Root directory of input files").option("--exe", "Bundle as executable").option("-W, --workspace [dir]", "Enable workspace mode").option("--concurrency <count>", "Maximum number of Rolldown builds to run in parallel").option("-F, --filter <pattern>", "Filter configs (cwd or name), e.g. /pkg-name$/ or pkg-name").option("--exports", "Generate package exports for package.json").action(async (input, flags) => {
|
|
632
632
|
globalLogger.level = flags.logLevel || "info";
|
|
633
633
|
globalLogger.info(`${blue`tsdown v${version}`} powered by ${hex("#ff7e17")`rolldown v${VERSION}`}`);
|
|
634
|
-
const { build } = await import("./build-D_enfyvD-
|
|
634
|
+
const { build } = await import("./build-D_enfyvD-Dg1eKRD4.js").then((n) => n.r).then((n) => n.r);
|
|
635
635
|
if (input.length > 0) flags.entry = input;
|
|
636
636
|
await build(flags);
|
|
637
637
|
});
|
|
638
638
|
cli.command("create", "[deprecated] Create a tsdown project. Use \"npx create-tsdown\" instead.", { allowUnknownOptions: true }).action(async () => {
|
|
639
639
|
globalLogger.warn(`"tsdown create" is deprecated. Please use "npx create-tsdown" instead.`);
|
|
640
|
-
const { exitCode } = await
|
|
640
|
+
const { exitCode } = await x("npx", [
|
|
641
641
|
"-y",
|
|
642
642
|
"create-tsdown@latest",
|
|
643
643
|
...process$1.argv.slice(3)
|
|
@@ -646,7 +646,7 @@ cli.command("create", "[deprecated] Create a tsdown project. Use \"npx create-ts
|
|
|
646
646
|
});
|
|
647
647
|
cli.command("migrate", "[deprecated] Migrate from tsup to tsdown. Use \"npx tsdown-migrate\" instead.", { allowUnknownOptions: true }).action(async () => {
|
|
648
648
|
globalLogger.warn(`"tsdown migrate" is deprecated. Please use "npx tsdown-migrate" instead.`);
|
|
649
|
-
const { exitCode } = await
|
|
649
|
+
const { exitCode } = await x("npx", [
|
|
650
650
|
"-y",
|
|
651
651
|
"tsdown-migrate@latest",
|
|
652
652
|
...process$1.argv.slice(3)
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { D as __commonJSMin, k as __require } from "./main-
|
|
1
|
+
import { D as __commonJSMin, k as __require } from "./main-DiierkER.js";
|
|
2
2
|
//#region ../../node_modules/.pnpm/lilconfig@3.1.3/node_modules/lilconfig/src/index.js
|
|
3
3
|
var require_src$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
4
4
|
const path = __require("path");
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { C as resolveComma, E as toArray, l as bold,
|
|
1
|
+
import { C as resolveComma, E as toArray, l as bold, n as x, p as red, r as createDebug, u as dim, y as importWithError } from "./main-DiierkER.js";
|
|
2
2
|
import process from "node:process";
|
|
3
3
|
import path from "node:path";
|
|
4
4
|
import { RUNTIME_MODULE_ID } from "@voidzero-dev/vite-plus-core/rolldown";
|
|
5
5
|
import { access, cp, mkdir, mkdtemp, rm, stat, writeFile } from "node:fs/promises";
|
|
6
6
|
import { exactRegex } from "@voidzero-dev/vite-plus-core/rolldown/filter";
|
|
7
7
|
import { tmpdir } from "node:os";
|
|
8
|
-
//#region ../../node_modules/.pnpm/tsdown@0.22.14_@arethetypeswrong+core@0.18.2_@tsdown+css@0.22.14_@tsdown+exe@0.22.14_@
|
|
8
|
+
//#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/dist/format-DLxyxnif.mjs
|
|
9
9
|
function fsExists(path) {
|
|
10
10
|
return access(path).then(() => true, () => false);
|
|
11
11
|
}
|
|
@@ -453,7 +453,7 @@ function coerce(value, options = {}) {
|
|
|
453
453
|
return parsed ? formatFullVersion(parsed) : null;
|
|
454
454
|
}
|
|
455
455
|
//#endregion
|
|
456
|
-
//#region ../../node_modules/.pnpm/tsdown@0.22.14_@arethetypeswrong+core@0.18.2_@tsdown+css@0.22.14_@tsdown+exe@0.22.14_@
|
|
456
|
+
//#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/dist/target-Bab3CUeB.mjs
|
|
457
457
|
const NODE_SEA_MIN_VERSION = "25.7.0";
|
|
458
458
|
const NODE_SEA_MIN_VERSION_PARSED = {
|
|
459
459
|
major: 25,
|
|
@@ -515,7 +515,7 @@ async function buildSingleExe(config, bundledFile, outputFile, executable, targe
|
|
|
515
515
|
await writeFile(seaConfigPath, JSON.stringify(seaConfig));
|
|
516
516
|
debug("Wrote sea-config.json: %O -> %s", seaConfig, seaConfigPath);
|
|
517
517
|
debug("Running: %s --build-sea %s", process.execPath, seaConfigPath);
|
|
518
|
-
await
|
|
518
|
+
await x(process.execPath, ["--build-sea", seaConfigPath], {
|
|
519
519
|
nodeOptions: { stdio: [
|
|
520
520
|
"ignore",
|
|
521
521
|
"ignore",
|
|
@@ -529,7 +529,7 @@ async function buildSingleExe(config, bundledFile, outputFile, executable, targe
|
|
|
529
529
|
else await fsRemove(tempDir);
|
|
530
530
|
}
|
|
531
531
|
if ((target?.platform || process.platform) === "darwin") try {
|
|
532
|
-
await
|
|
532
|
+
await x("codesign", [
|
|
533
533
|
"--sign",
|
|
534
534
|
"-",
|
|
535
535
|
outputPath
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { r as createDebug } from "./main-
|
|
2
|
-
import { h as RE_DTS_MAP, m as RE_DTS } from "./target-Bab3CUeB-
|
|
3
|
-
import { n as globalContext, t as requireTS } from "./dist-
|
|
1
|
+
import { r as createDebug } from "./main-DiierkER.js";
|
|
2
|
+
import { h as RE_DTS_MAP, m as RE_DTS } from "./target-Bab3CUeB-DQ0pKhCv.js";
|
|
3
|
+
import { n as globalContext, t as requireTS } from "./dist-DyXLnzyh.js";
|
|
4
4
|
import path from "node:path";
|
|
5
5
|
import { pathToFileURL } from "node:url";
|
|
6
6
|
//#region ../../node_modules/.pnpm/rolldown-plugin-dts@0.27.13_@typescript+native-preview@7.0.0-dev.20260605.1_oxc-resolve_19173df252fb1b72b750fe1e656588b8/node_modules/rolldown-plugin-dts/dist/tsc-KtFHcISk.mjs
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { A as __toESM, C as resolveComma, E as toArray, y as importWithError } from "./main-
|
|
2
|
-
import { i as expandBaselineTarget } from "./target-Bab3CUeB-
|
|
3
|
-
import "./internal-
|
|
1
|
+
import { A as __toESM, C as resolveComma, E as toArray, y as importWithError } from "./main-DiierkER.js";
|
|
2
|
+
import { i as expandBaselineTarget } from "./target-Bab3CUeB-DQ0pKhCv.js";
|
|
3
|
+
import "./internal-DKworeK4.js";
|
|
4
4
|
import path from "node:path";
|
|
5
5
|
import { readFileSync } from "node:fs";
|
|
6
6
|
import { readFile } from "node:fs/promises";
|
|
@@ -604,7 +604,7 @@ async function loadFileConfig(searchPath) {
|
|
|
604
604
|
if (cached !== void 0) return cached;
|
|
605
605
|
const promise = (async () => {
|
|
606
606
|
try {
|
|
607
|
-
const postcssrc = (await import("./src-
|
|
607
|
+
const postcssrc = (await import("./src-drVPfX63.js").then((m) => /* @__PURE__ */ __toESM(m.default, 1))).default;
|
|
608
608
|
const result = await postcssrc({}, searchPath);
|
|
609
609
|
return {
|
|
610
610
|
options: result.options,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { O as fsExists, c as isGreaterOrEqual, f as tryParse, k as fsRemove, l as normalize$1, n as NODE_SEA_MIN_VERSION_PARSED, t as NODE_SEA_MIN_VERSION } from "./target-Bab3CUeB-
|
|
3
|
-
import "./internal-
|
|
1
|
+
import { n as x, r as createDebug } from "./main-DiierkER.js";
|
|
2
|
+
import { O as fsExists, c as isGreaterOrEqual, f as tryParse, k as fsRemove, l as normalize$1, n as NODE_SEA_MIN_VERSION_PARSED, t as NODE_SEA_MIN_VERSION } from "./target-Bab3CUeB-DQ0pKhCv.js";
|
|
3
|
+
import "./internal-DKworeK4.js";
|
|
4
4
|
import process from "node:process";
|
|
5
5
|
import path from "node:path";
|
|
6
6
|
import { pipeline } from "node:stream/promises";
|
|
@@ -149,7 +149,7 @@ async function extractBinary(archivePath, targetBinaryPath, target) {
|
|
|
149
149
|
debug("Extracting %s from archive to %s", binaryInArchive, outDir);
|
|
150
150
|
const { command, args } = getExtractCommand(archivePath, outDir, binaryInArchive, target);
|
|
151
151
|
try {
|
|
152
|
-
await
|
|
152
|
+
await x(command, args, {
|
|
153
153
|
nodeOptions: { stdio: "inherit" },
|
|
154
154
|
throwOnError: true,
|
|
155
155
|
nodePath: false
|
|
@@ -8,7 +8,40 @@ let nanoid = (size = 21) => {
|
|
|
8
8
|
return id;
|
|
9
9
|
};
|
|
10
10
|
//#endregion
|
|
11
|
-
//#region
|
|
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.143.0/helpers/esm/typeof.js
|
|
12
45
|
function _typeof(o) {
|
|
13
46
|
"@babel/helpers - typeof";
|
|
14
47
|
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
|
|
@@ -18,7 +51,7 @@ function _typeof(o) {
|
|
|
18
51
|
}, _typeof(o);
|
|
19
52
|
}
|
|
20
53
|
//#endregion
|
|
21
|
-
//#region \0@oxc-project+runtime@0.
|
|
54
|
+
//#region \0@oxc-project+runtime@0.143.0/helpers/esm/toPrimitive.js
|
|
22
55
|
function toPrimitive(t, r) {
|
|
23
56
|
if ("object" != _typeof(t) || !t) return t;
|
|
24
57
|
var e = t[Symbol.toPrimitive];
|
|
@@ -30,13 +63,13 @@ function toPrimitive(t, r) {
|
|
|
30
63
|
return ("string" === r ? String : Number)(t);
|
|
31
64
|
}
|
|
32
65
|
//#endregion
|
|
33
|
-
//#region \0@oxc-project+runtime@0.
|
|
66
|
+
//#region \0@oxc-project+runtime@0.143.0/helpers/esm/toPropertyKey.js
|
|
34
67
|
function toPropertyKey(t) {
|
|
35
68
|
var i = toPrimitive(t, "string");
|
|
36
69
|
return "symbol" == _typeof(i) ? i : i + "";
|
|
37
70
|
}
|
|
38
71
|
//#endregion
|
|
39
|
-
//#region \0@oxc-project+runtime@0.
|
|
72
|
+
//#region \0@oxc-project+runtime@0.143.0/helpers/esm/defineProperty.js
|
|
40
73
|
function _defineProperty(e, r, t) {
|
|
41
74
|
return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
42
75
|
value: t,
|
|
@@ -46,6 +79,283 @@ function _defineProperty(e, r, t) {
|
|
|
46
79
|
}) : e[r] = t, e;
|
|
47
80
|
}
|
|
48
81
|
//#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, { kind: 'esm' | 'cjs', fn: (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 {'esm' | 'cjs'} kind
|
|
280
|
+
* @param {(id: string) => void} fn
|
|
281
|
+
*/
|
|
282
|
+
registerFactory(id, kind, fn) {
|
|
283
|
+
this.factories.set(id, {
|
|
284
|
+
kind,
|
|
285
|
+
fn
|
|
286
|
+
});
|
|
287
|
+
}
|
|
288
|
+
/**
|
|
289
|
+
* @param {string} id
|
|
290
|
+
* @param {{ exports: any }} exportsHolder
|
|
291
|
+
*/
|
|
292
|
+
registerModule(id, exportsHolder) {
|
|
293
|
+
const module = new Module(id);
|
|
294
|
+
module.exportsHolder = exportsHolder;
|
|
295
|
+
this.moduleCache.set(id, module);
|
|
296
|
+
}
|
|
297
|
+
/**
|
|
298
|
+
* @param {string} id
|
|
299
|
+
* @returns {string[]}
|
|
300
|
+
*/
|
|
301
|
+
getImporters(id) {
|
|
302
|
+
const dynamic = this.dynamicImporters.get(id);
|
|
303
|
+
if (!dynamic || dynamic.size === 0) return [...this.importers.get(id) ?? []];
|
|
304
|
+
return [.../* @__PURE__ */ new Set([...this.importers.get(id) ?? [], ...dynamic])];
|
|
305
|
+
}
|
|
306
|
+
/**
|
|
307
|
+
* @param {string} id
|
|
308
|
+
*/
|
|
309
|
+
isExecuted(id) {
|
|
310
|
+
return this.moduleCache.has(id);
|
|
311
|
+
}
|
|
312
|
+
/**
|
|
313
|
+
* @param {string} id
|
|
314
|
+
*/
|
|
315
|
+
hasFactory(id) {
|
|
316
|
+
return this.factories.has(id);
|
|
317
|
+
}
|
|
318
|
+
/**
|
|
319
|
+
* Module-cache delete only — static imports and factories persist. Removal is what
|
|
320
|
+
* re-arms a cache-gated factory for `initModule`.
|
|
321
|
+
* @param {string} id
|
|
322
|
+
*/
|
|
323
|
+
removeModuleCache(id) {
|
|
324
|
+
this.moduleCache.delete(id);
|
|
325
|
+
this.hooks?.onModuleCacheRemoval(id);
|
|
326
|
+
}
|
|
327
|
+
/**
|
|
328
|
+
* The one re-execution gate: registered → return the live exports; otherwise run the
|
|
329
|
+
* mapped factory (which registers itself first, then runs the body).
|
|
330
|
+
* @param {string} id
|
|
331
|
+
*/
|
|
332
|
+
initModule(id) {
|
|
333
|
+
if (this.moduleCache.has(id)) return this.loadExports(id);
|
|
334
|
+
const factory = this.factories.get(id);
|
|
335
|
+
if (!factory) throw new MissingFactoryError(id);
|
|
336
|
+
factory.fn(id);
|
|
337
|
+
return this.loadExports(id);
|
|
338
|
+
}
|
|
339
|
+
/**
|
|
340
|
+
* @param {string} id
|
|
341
|
+
*/
|
|
342
|
+
loadExports(id) {
|
|
343
|
+
const module = this.moduleCache.get(id);
|
|
344
|
+
if (module) return module.exportsHolder.exports;
|
|
345
|
+
else {
|
|
346
|
+
console.warn(`Module ${id} not found`);
|
|
347
|
+
return {};
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
/**
|
|
351
|
+
* @param {string} moduleId
|
|
352
|
+
*/
|
|
353
|
+
createModuleHotContext(moduleId) {
|
|
354
|
+
if (this.hooks) return this.hooks.createModuleHotContext(moduleId);
|
|
355
|
+
throw new Error("createModuleHotContext requires installed hooks or an override");
|
|
356
|
+
}
|
|
357
|
+
};
|
|
358
|
+
//#endregion
|
|
49
359
|
//#region ../../vite/packages/vite/src/shared/hmr.ts
|
|
50
360
|
var HMRContext = class {
|
|
51
361
|
constructor(hmrClient, ownerPath) {
|
|
@@ -572,13 +882,17 @@ const normalizeModuleRunnerTransport = (transport) => {
|
|
|
572
882
|
} } : {},
|
|
573
883
|
async send(data) {
|
|
574
884
|
if (!invokeableTransport.send) return;
|
|
575
|
-
if (!isConnected)
|
|
576
|
-
|
|
885
|
+
if (!isConnected) {
|
|
886
|
+
if (connectingPromise) await connectingPromise;
|
|
887
|
+
else throw new SendBeforeConnectError("send was called before connect");
|
|
888
|
+
}
|
|
577
889
|
await invokeableTransport.send(data);
|
|
578
890
|
},
|
|
579
891
|
async invoke(name, data) {
|
|
580
|
-
if (!isConnected)
|
|
581
|
-
|
|
892
|
+
if (!isConnected) {
|
|
893
|
+
if (connectingPromise) await connectingPromise;
|
|
894
|
+
else throw new SendBeforeConnectError("invoke was called before connect");
|
|
895
|
+
}
|
|
582
896
|
return invokeableTransport.invoke(name, data);
|
|
583
897
|
}
|
|
584
898
|
};
|
|
@@ -1201,12 +1515,14 @@ async function handleMessage(payload) {
|
|
|
1201
1515
|
case "full-reload":
|
|
1202
1516
|
if (payload.ifFallback && !globalThis.__vite_is_fallback_page__) break;
|
|
1203
1517
|
await activeHmrClient.notifyListeners("vite:beforeFullReload", payload);
|
|
1204
|
-
if (hasDocument)
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1518
|
+
if (hasDocument) {
|
|
1519
|
+
if (payload.path && payload.path.endsWith(".html")) {
|
|
1520
|
+
const pagePath = decodeURI(location.pathname);
|
|
1521
|
+
const payloadPath = base + payload.path.slice(1);
|
|
1522
|
+
if (pagePath === payloadPath || payload.path === "/index.html" || pagePath.endsWith("/") && pagePath + "index.html" === payloadPath) pageReload();
|
|
1523
|
+
return;
|
|
1524
|
+
} else pageReload();
|
|
1525
|
+
}
|
|
1210
1526
|
break;
|
|
1211
1527
|
case "prune":
|
|
1212
1528
|
await activeHmrClient.notifyListeners("vite:beforePrune", payload);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "@vite/env";
|
|
2
|
-
//#region \0@oxc-project+runtime@0.
|
|
2
|
+
//#region \0@oxc-project+runtime@0.143.0/helpers/esm/typeof.js
|
|
3
3
|
function _typeof(o) {
|
|
4
4
|
"@babel/helpers - typeof";
|
|
5
5
|
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
|
|
@@ -9,7 +9,7 @@ function _typeof(o) {
|
|
|
9
9
|
}, _typeof(o);
|
|
10
10
|
}
|
|
11
11
|
//#endregion
|
|
12
|
-
//#region \0@oxc-project+runtime@0.
|
|
12
|
+
//#region \0@oxc-project+runtime@0.143.0/helpers/esm/toPrimitive.js
|
|
13
13
|
function toPrimitive(t, r) {
|
|
14
14
|
if ("object" != _typeof(t) || !t) return t;
|
|
15
15
|
var e = t[Symbol.toPrimitive];
|
|
@@ -21,13 +21,13 @@ function toPrimitive(t, r) {
|
|
|
21
21
|
return ("string" === r ? String : Number)(t);
|
|
22
22
|
}
|
|
23
23
|
//#endregion
|
|
24
|
-
//#region \0@oxc-project+runtime@0.
|
|
24
|
+
//#region \0@oxc-project+runtime@0.143.0/helpers/esm/toPropertyKey.js
|
|
25
25
|
function toPropertyKey(t) {
|
|
26
26
|
var i = toPrimitive(t, "string");
|
|
27
27
|
return "symbol" == _typeof(i) ? i : i + "";
|
|
28
28
|
}
|
|
29
29
|
//#endregion
|
|
30
|
-
//#region \0@oxc-project+runtime@0.
|
|
30
|
+
//#region \0@oxc-project+runtime@0.143.0/helpers/esm/defineProperty.js
|
|
31
31
|
function _defineProperty(e, r, t) {
|
|
32
32
|
return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
33
33
|
value: t,
|
|
@@ -384,13 +384,17 @@ const normalizeModuleRunnerTransport = (transport) => {
|
|
|
384
384
|
} } : {},
|
|
385
385
|
async send(data) {
|
|
386
386
|
if (!invokeableTransport.send) return;
|
|
387
|
-
if (!isConnected)
|
|
388
|
-
|
|
387
|
+
if (!isConnected) {
|
|
388
|
+
if (connectingPromise) await connectingPromise;
|
|
389
|
+
else throw new SendBeforeConnectError("send was called before connect");
|
|
390
|
+
}
|
|
389
391
|
await invokeableTransport.send(data);
|
|
390
392
|
},
|
|
391
393
|
async invoke(name, data) {
|
|
392
|
-
if (!isConnected)
|
|
393
|
-
|
|
394
|
+
if (!isConnected) {
|
|
395
|
+
if (connectingPromise) await connectingPromise;
|
|
396
|
+
else throw new SendBeforeConnectError("invoke was called before connect");
|
|
397
|
+
}
|
|
394
398
|
return invokeableTransport.invoke(name, data);
|
|
395
399
|
}
|
|
396
400
|
};
|
|
@@ -1010,12 +1014,14 @@ async function handleMessage(payload) {
|
|
|
1010
1014
|
case "full-reload":
|
|
1011
1015
|
if (payload.ifFallback && !globalThis.__vite_is_fallback_page__) break;
|
|
1012
1016
|
await activeHmrClient.notifyListeners("vite:beforeFullReload", payload);
|
|
1013
|
-
if (hasDocument)
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1017
|
+
if (hasDocument) {
|
|
1018
|
+
if (payload.path && payload.path.endsWith(".html")) {
|
|
1019
|
+
const pagePath = decodeURI(location.pathname);
|
|
1020
|
+
const payloadPath = base + payload.path.slice(1);
|
|
1021
|
+
if (pagePath === payloadPath || payload.path === "/index.html" || pagePath.endsWith("/") && pagePath + "index.html" === payloadPath) pageReload();
|
|
1022
|
+
return;
|
|
1023
|
+
} else pageReload();
|
|
1024
|
+
}
|
|
1019
1025
|
break;
|
|
1020
1026
|
case "prune":
|
|
1021
1027
|
await activeHmrClient.notifyListeners("vite:beforePrune", payload);
|