@voidzero-dev/vite-plus-core 0.1.17-alpha.3 → 0.1.17-alpha.5
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/tsdown/build-y6nUUkVJ-CXW65uEP.js +2 -0
- package/dist/tsdown/{build-DU-BFLB1-C3nlWMI9.js → build-y6nUUkVJ-DChPSMiT.js} +233 -227
- package/dist/tsdown/{debug-BmAPbhgA-x0WPncIH.js → debug-CLlnG64L-CvIUyX2c.js} +2 -2
- package/dist/tsdown/{detect-h8ZFBH96-CQo7h2I_.js → detect-DN3DXXYt-DDr6LAmT.js} +1 -1
- package/dist/tsdown/{dist-CtsD24R6.js → dist-C4l5avio.js} +1 -1
- package/dist/tsdown/{dist-CxeZzY9B.js → dist-CbhZqEsp.js} +7 -7
- package/dist/tsdown/{dist-Cqme3mtE.js → dist-_IXstuie.js} +12 -12
- package/dist/tsdown/index-types.d.ts +1628 -1616
- package/dist/tsdown/index.js +4 -4
- package/dist/tsdown/{main-CSVR9Fv3.js → main-Ccx2FDJq.js} +95 -94
- package/dist/tsdown/run.js +5 -5
- package/dist/vite/node/chunks/node.js +127 -135
- package/package.json +8 -8
- package/dist/tsdown/build-DU-BFLB1-B93ygiSG.js +0 -2
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { D as toArray, w as resolveComma } from "./main-
|
|
1
|
+
import { D as toArray, w as resolveComma } from "./main-Ccx2FDJq.js";
|
|
2
2
|
import { n as enable, r as namespaces, t as createDebug } from "./node-B3Gdtau1.js";
|
|
3
|
-
//#region ../../node_modules/.pnpm/tsdown@0.21.
|
|
3
|
+
//#region ../../node_modules/.pnpm/tsdown@0.21.8_@arethetypeswrong+core@0.18.2_@tsdown+css@0.21.8_@tsdown+exe@0.21.8_@type_bf863151738d83584e36df49913526fa/node_modules/tsdown/dist/debug-CLlnG64L.mjs
|
|
4
4
|
const debugLog = createDebug("tsdown:debug");
|
|
5
5
|
function enableDebug(debug) {
|
|
6
6
|
if (!debug) return;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import process from "node:process";
|
|
2
2
|
import path from "node:path";
|
|
3
3
|
import fs from "node:fs/promises";
|
|
4
|
-
//#region ../../node_modules/.pnpm/tsdown@0.21.
|
|
4
|
+
//#region ../../node_modules/.pnpm/tsdown@0.21.8_@arethetypeswrong+core@0.18.2_@tsdown+css@0.21.8_@tsdown+exe@0.21.8_@type_bf863151738d83584e36df49913526fa/node_modules/tsdown/dist/detect-DN3DXXYt.mjs
|
|
5
5
|
const AGENTS = [
|
|
6
6
|
"npm",
|
|
7
7
|
"yarn",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { n as __exportAll, r as __toESM, t as __commonJSMin } from "./chunk-CSNpwdVU.js";
|
|
2
2
|
import { t as createDebug } from "./node-B3Gdtau1.js";
|
|
3
3
|
import { a as RE_JSON, c as RE_TS, d as filename_js_to_dts, f as filename_to_dts, i as RE_JS, l as RE_VUE, m as resolveTemplateFn, n as RE_DTS, o as RE_NODE_MODULES, p as replaceTemplateName, r as RE_DTS_MAP, s as RE_ROLLDOWN_RUNTIME, t as RE_CSS, u as filename_dts_to } from "./filename-DQnUJlio-DHPB7cQg.js";
|
|
4
|
-
import { n as pe, t as Ge } from "./dist-
|
|
4
|
+
import { n as pe, t as Ge } from "./dist-CbhZqEsp.js";
|
|
5
5
|
import { n as globalContext, r as invalidateContextFile, t as createContext } from "./tsc-context-C2cC1Bhi.js";
|
|
6
6
|
import { createRequire } from "node:module";
|
|
7
7
|
import process from "node:process";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import module from "node:module";
|
|
2
2
|
import path from "node:path";
|
|
3
|
-
import
|
|
4
|
-
import
|
|
3
|
+
import fs from "node:fs";
|
|
4
|
+
import xe from "fs";
|
|
5
5
|
import Be from "os";
|
|
6
|
-
import
|
|
6
|
+
import Ie from "path";
|
|
7
7
|
//#region ../../node_modules/.pnpm/resolve-pkg-maps@1.0.0/node_modules/resolve-pkg-maps/dist/index.mjs
|
|
8
8
|
const A = (r) => r !== null && typeof r == "object", a = (r, t) => Object.assign(/* @__PURE__ */ new Error(`[${r}]: ${t}`), { code: r }), _ = "ERR_INVALID_PACKAGE_CONFIG", E$1 = "ERR_INVALID_PACKAGE_TARGET", I$1 = "ERR_PACKAGE_PATH_NOT_EXPORTED", R = /^\d+$/, O$1 = /^(\.{1,2}|node_modules)$/i, w = /\/|\\/;
|
|
9
9
|
var h$1 = ((r) => (r.Export = "exports", r.Import = "imports", r))(h$1 || {});
|
|
@@ -63,11 +63,11 @@ function h(e) {
|
|
|
63
63
|
}
|
|
64
64
|
i(h, "slash");
|
|
65
65
|
const Z = i((e) => {
|
|
66
|
-
const t =
|
|
66
|
+
const t = fs[e];
|
|
67
67
|
return (s, ...n) => {
|
|
68
68
|
const o = `${e}:${n.join(":")}`;
|
|
69
69
|
let l = s == null ? void 0 : s.get(o);
|
|
70
|
-
return l === void 0 && (l = Reflect.apply(t,
|
|
70
|
+
return l === void 0 && (l = Reflect.apply(t, fs, n), s?.set(o, l)), l;
|
|
71
71
|
};
|
|
72
72
|
}, "cacheFs"), E = Z("existsSync"), $e = Z("readFileSync"), G = Z("statSync"), fe = i((e, t, s) => {
|
|
73
73
|
for (;;) {
|
|
@@ -773,7 +773,7 @@ const Ae = X((e) => {
|
|
|
773
773
|
}
|
|
774
774
|
return t;
|
|
775
775
|
}, "invertCase"), le = /* @__PURE__ */ new Map(), _e = X((e, t) => {
|
|
776
|
-
const s =
|
|
776
|
+
const s = Ie.join(e, `.is-fs-case-sensitive-test-${process.pid}`);
|
|
777
777
|
try {
|
|
778
778
|
return t.writeFileSync(s, ""), !t.existsSync(Ae(s));
|
|
779
779
|
} finally {
|
|
@@ -788,7 +788,7 @@ const Ae = X((e) => {
|
|
|
788
788
|
if (t === void 0) return _e(Be.tmpdir(), s);
|
|
789
789
|
throw n;
|
|
790
790
|
}
|
|
791
|
-
}, "checkDirectoryCaseWithFallback"), Oe = X((e, t =
|
|
791
|
+
}, "checkDirectoryCaseWithFallback"), Oe = X((e, t = xe, s = !0) => {
|
|
792
792
|
const n = e != null ? e : process.cwd();
|
|
793
793
|
if (s && le.has(n)) return le.get(n);
|
|
794
794
|
let o;
|
|
@@ -3,7 +3,7 @@ import process from "node:process";
|
|
|
3
3
|
import "node:child_process";
|
|
4
4
|
import path from "node:path";
|
|
5
5
|
import { rolldown } from "@voidzero-dev/vite-plus-core/rolldown";
|
|
6
|
-
import
|
|
6
|
+
import fs, { existsSync } from "node:fs";
|
|
7
7
|
import { tmpdir } from "node:os";
|
|
8
8
|
import { fileURLToPath, pathToFileURL } from "node:url";
|
|
9
9
|
import { Buffer } from "node:buffer";
|
|
@@ -54,7 +54,7 @@ function resolveOptions(options = {}) {
|
|
|
54
54
|
inputOptions: options.inputOptions,
|
|
55
55
|
outputOptions: options.outputOptions
|
|
56
56
|
};
|
|
57
|
-
if (!
|
|
57
|
+
if (!fs.existsSync(resolvedOptions.path)) throw new Error(`[unrun] File not found: ${resolvedOptions.path}`);
|
|
58
58
|
if (!new Set([
|
|
59
59
|
"none",
|
|
60
60
|
"jiti",
|
|
@@ -268,7 +268,7 @@ function createJsonLoader() {
|
|
|
268
268
|
let isRequire = false;
|
|
269
269
|
try {
|
|
270
270
|
if (importer) {
|
|
271
|
-
const src =
|
|
271
|
+
const src = fs.readFileSync(importer, "utf8");
|
|
272
272
|
const escaped = source.replaceAll(/[.*+?^${}()|[\]\\]/g, (m) => `\\${m}`);
|
|
273
273
|
const pattern = String.raw`\brequire\s*\(\s*['"]${escaped}['"]\s*\)`;
|
|
274
274
|
isRequire = new RegExp(pattern).test(src);
|
|
@@ -281,7 +281,7 @@ function createJsonLoader() {
|
|
|
281
281
|
handler(id) {
|
|
282
282
|
try {
|
|
283
283
|
const realId = id.replace(/\?unrun-json\.(?:mjs|cjs)$/, "");
|
|
284
|
-
const src =
|
|
284
|
+
const src = fs.readFileSync(realId, "utf8");
|
|
285
285
|
const data = JSON.parse(src);
|
|
286
286
|
const jsonLiteral = JSON.stringify(data);
|
|
287
287
|
if (id.endsWith("?unrun-json.cjs")) return { code: `const __data = ${jsonLiteral}\ntry { Object.defineProperty(__data, 'default', { value: __data, enumerable: false, configurable: true }) } catch {}\nmodule.exports = __data\n` };
|
|
@@ -375,7 +375,7 @@ function createRequireResolveFix(options) {
|
|
|
375
375
|
".cjs"
|
|
376
376
|
]) {
|
|
377
377
|
const testPath = path.resolve(baseDir, id + ext);
|
|
378
|
-
if (
|
|
378
|
+
if (fs.existsSync(testPath)) return JSON.stringify(testPath);
|
|
379
379
|
}
|
|
380
380
|
const resolvedPath = path.resolve(baseDir, id);
|
|
381
381
|
return JSON.stringify(resolvedPath);
|
|
@@ -416,7 +416,7 @@ function createSourceContextShimsPlugin() {
|
|
|
416
416
|
const normalizedPhysicalId = path.normalize(physicalId);
|
|
417
417
|
let code;
|
|
418
418
|
try {
|
|
419
|
-
code =
|
|
419
|
+
code = fs.readFileSync(normalizedPhysicalId, "utf8");
|
|
420
420
|
} catch {
|
|
421
421
|
return null;
|
|
422
422
|
}
|
|
@@ -658,7 +658,7 @@ function cleanModule(moduleUrl, options) {
|
|
|
658
658
|
try {
|
|
659
659
|
if (moduleUrl.startsWith("file://")) {
|
|
660
660
|
const filePath = new URL(moduleUrl);
|
|
661
|
-
|
|
661
|
+
fs.unlinkSync(filePath);
|
|
662
662
|
}
|
|
663
663
|
} catch (error) {
|
|
664
664
|
if (error.code !== "ENOENT") throw error;
|
|
@@ -682,14 +682,14 @@ function writeModule(code, options) {
|
|
|
682
682
|
const projectNodeModules = path.join(process.cwd(), "node_modules");
|
|
683
683
|
const outDir = path.join(projectNodeModules, ".unrun");
|
|
684
684
|
const outFile = path.join(outDir, fname);
|
|
685
|
-
if (!
|
|
686
|
-
|
|
687
|
-
|
|
685
|
+
if (!fs.existsSync(outFile)) try {
|
|
686
|
+
fs.mkdirSync(outDir, { recursive: true });
|
|
687
|
+
fs.writeFileSync(outFile, code, "utf8");
|
|
688
688
|
} catch {
|
|
689
689
|
const fallbackDir = path.join(tmpdir(), "unrun-cache");
|
|
690
690
|
const fallbackFile = path.join(fallbackDir, fname);
|
|
691
|
-
|
|
692
|
-
|
|
691
|
+
fs.mkdirSync(fallbackDir, { recursive: true });
|
|
692
|
+
fs.writeFileSync(fallbackFile, code, "utf8");
|
|
693
693
|
moduleUrl = pathToFileURL(fallbackFile).href;
|
|
694
694
|
}
|
|
695
695
|
moduleUrl = moduleUrl || pathToFileURL(outFile).href;
|