@voidzero-dev/vite-plus-core 0.1.16-alpha.3 → 0.1.16
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-DU-BFLB1-B3WPwpFM.js → build-DU-BFLB1-BZ80XpcX.js} +52 -52
- package/dist/tsdown/build-DU-BFLB1-Dm3Ve-Np.js +2 -0
- package/dist/tsdown/{debug-BmAPbhgA-ClibQzj1.js → debug-BmAPbhgA-CHpocWMm.js} +2 -2
- package/dist/tsdown/{detect-h8ZFBH96-CQBPtOHi.js → detect-h8ZFBH96-DbLjA61J.js} +1 -1
- package/dist/tsdown/{dist-SqMQ6Q2q.js → dist-CY3M22aR.js} +4 -4
- package/dist/tsdown/{dist-CxeZzY9B.js → dist-D7qIxBaV.js} +3 -3
- package/dist/tsdown/{dist-Cqme3mtE.js → dist-_IXstuie.js} +12 -12
- package/dist/tsdown/{filename-DQnUJlio-smVMy5Ot.js → filename-DQnUJlio-D58wGDtS.js} +1 -1
- package/dist/tsdown/index-types.d.ts +190 -190
- package/dist/tsdown/index.js +4 -4
- package/dist/tsdown/{main-CC95VQtR.js → main-wrcIC7dd.js} +3 -3
- package/dist/tsdown/run.js +3 -3
- package/dist/tsdown/{tsc-Bq9H2v3f.js → tsc-DzHkiQui.js} +2 -2
- package/dist/tsdown/{tsc-context-BEcA6aUv.js → tsc-context-Dban9z4Z.js} +1 -1
- package/dist/vite/client.d.ts +3 -0
- package/dist/vite/node/chunks/logger.js +1 -1
- package/dist/vite/node/chunks/moduleRunnerTransport.d.ts +11 -11
- package/dist/vite/node/chunks/node.js +370 -279
- package/dist/vite/node/index.d.ts +13 -3
- package/dist/vite/node/index.js +1 -1
- package/package.json +4 -4
- package/dist/tsdown/build-DU-BFLB1-DhRv5Umu.js +0 -2
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { r as __toESM, t as __commonJSMin } from "./chunk-CSNpwdVU.js";
|
|
2
|
-
import { C as promiseWithResolvers, D as toArray, E as slash, S as pkgExists, T as resolveRegex, _ as yellow, a as createLogger, b as matchPattern, c as globalLogger, d as bold, f as dim, g as underline, h as red, i as LogLevels, l as prettyFormat, n as z, o as generateColor, p as green, r as version, s as getNameLabel, t as R, u as blue, v as debounce, w as resolveComma, x as noop, y as importWithError } from "./main-
|
|
2
|
+
import { C as promiseWithResolvers, D as toArray, E as slash, S as pkgExists, T as resolveRegex, _ as yellow, a as createLogger, b as matchPattern, c as globalLogger, d as bold, f as dim, g as underline, h as red, i as LogLevels, l as prettyFormat, n as z, o as generateColor, p as green, r as version, s as getNameLabel, t as R, u as blue, v as debounce, w as resolveComma, x as noop, y as importWithError } from "./main-wrcIC7dd.js";
|
|
3
3
|
import { t as createDebug } from "./node-B3Gdtau1.js";
|
|
4
|
-
import { d as filename_js_to_dts, i as RE_JS, n as RE_DTS, o as RE_NODE_MODULES$1, t as RE_CSS } from "./filename-DQnUJlio-
|
|
5
|
-
import "./dist-
|
|
4
|
+
import { d as filename_js_to_dts, i as RE_JS, n as RE_DTS, o as RE_NODE_MODULES$1, t as RE_CSS } from "./filename-DQnUJlio-D58wGDtS.js";
|
|
5
|
+
import "./dist-D7qIxBaV.js";
|
|
6
6
|
import module$1, { builtinModules, createRequire, isBuiltin } from "node:module";
|
|
7
7
|
import process$1, { env } from "node:process";
|
|
8
8
|
import readline from "node:readline";
|
|
@@ -11,7 +11,7 @@ import path, { dirname, isAbsolute, join, parse, resolve } from "node:path";
|
|
|
11
11
|
import { VERSION, build, watch } from "@voidzero-dev/vite-plus-core/rolldown";
|
|
12
12
|
import { access, chmod, cp, mkdir, mkdtemp, readFile, readdir, rm, stat, writeFile } from "node:fs/promises";
|
|
13
13
|
import { and, id, importerId, include } from "@voidzero-dev/vite-plus-core/rolldown/filter";
|
|
14
|
-
import
|
|
14
|
+
import fs$1, { existsSync, readFileSync, writeFileSync } from "node:fs";
|
|
15
15
|
import * as nativeFs$1 from "fs";
|
|
16
16
|
import nativeFs from "fs";
|
|
17
17
|
import path$1, { basename, dirname as dirname$1, normalize as normalize$1, posix, relative, resolve as resolve$1, sep } from "path";
|
|
@@ -22,7 +22,7 @@ import { pathToFileURL } from "node:url";
|
|
|
22
22
|
import { Buffer } from "node:buffer";
|
|
23
23
|
import { brotliCompress, gzip } from "node:zlib";
|
|
24
24
|
import { importGlobPlugin } from "@voidzero-dev/vite-plus-core/rolldown/experimental";
|
|
25
|
-
//#region ../../node_modules/.pnpm/tsdown@0.21.7_@arethetypeswrong+core@0.18.2_@tsdown+css@0.21.7_@tsdown+exe@0.21.7_@
|
|
25
|
+
//#region ../../node_modules/.pnpm/tsdown@0.21.7_@arethetypeswrong+core@0.18.2_@tsdown+css@0.21.7_@tsdown+exe@0.21.7_@type_8e1769edffc9fa38659393584fb9975c/node_modules/tsdown/dist/fs-Dd6Htx2P.mjs
|
|
26
26
|
function fsExists(path) {
|
|
27
27
|
return access(path).then(() => true, () => false);
|
|
28
28
|
}
|
|
@@ -65,7 +65,7 @@ function stripExtname(filePath) {
|
|
|
65
65
|
return filePath.slice(0, -ext.length);
|
|
66
66
|
}
|
|
67
67
|
//#endregion
|
|
68
|
-
//#region ../../node_modules/.pnpm/tsdown@0.21.7_@arethetypeswrong+core@0.18.2_@tsdown+css@0.21.7_@tsdown+exe@0.21.7_@
|
|
68
|
+
//#region ../../node_modules/.pnpm/tsdown@0.21.7_@arethetypeswrong+core@0.18.2_@tsdown+css@0.21.7_@tsdown+exe@0.21.7_@type_8e1769edffc9fa38659393584fb9975c/node_modules/tsdown/dist/format-_3CEX8E7.mjs
|
|
69
69
|
const shimFile = path.resolve(import.meta.dirname, "..", "esm-shims.js");
|
|
70
70
|
function getShimsInject(format, platform) {
|
|
71
71
|
if (format === "es" && platform === "node") return {
|
|
@@ -3182,87 +3182,87 @@ quansync$1({
|
|
|
3182
3182
|
*/
|
|
3183
3183
|
const quansync = quansync$1;
|
|
3184
3184
|
quansync$1({
|
|
3185
|
-
sync:
|
|
3186
|
-
async:
|
|
3185
|
+
sync: fs$1.readFileSync,
|
|
3186
|
+
async: fs$1.promises.readFile
|
|
3187
3187
|
});
|
|
3188
3188
|
quansync$1({
|
|
3189
|
-
sync:
|
|
3190
|
-
async:
|
|
3189
|
+
sync: fs$1.writeFileSync,
|
|
3190
|
+
async: fs$1.promises.writeFile
|
|
3191
3191
|
});
|
|
3192
3192
|
quansync$1({
|
|
3193
|
-
sync:
|
|
3194
|
-
async:
|
|
3193
|
+
sync: fs$1.unlinkSync,
|
|
3194
|
+
async: fs$1.promises.unlink
|
|
3195
3195
|
});
|
|
3196
3196
|
quansync$1({
|
|
3197
|
-
sync:
|
|
3198
|
-
async:
|
|
3197
|
+
sync: fs$1.accessSync,
|
|
3198
|
+
async: fs$1.promises.access
|
|
3199
3199
|
});
|
|
3200
3200
|
/**
|
|
3201
3201
|
* @link https://nodejs.org/api/fs.html#fspromisesstatpath-options
|
|
3202
3202
|
*/
|
|
3203
3203
|
const stat$1 = quansync$1({
|
|
3204
|
-
sync:
|
|
3205
|
-
async:
|
|
3204
|
+
sync: fs$1.statSync,
|
|
3205
|
+
async: fs$1.promises.stat
|
|
3206
3206
|
});
|
|
3207
3207
|
const lstat = quansync$1({
|
|
3208
|
-
sync:
|
|
3209
|
-
async:
|
|
3208
|
+
sync: fs$1.lstatSync,
|
|
3209
|
+
async: fs$1.promises.lstat
|
|
3210
3210
|
});
|
|
3211
3211
|
quansync$1({
|
|
3212
|
-
sync:
|
|
3213
|
-
async:
|
|
3212
|
+
sync: fs$1.copyFileSync,
|
|
3213
|
+
async: fs$1.promises.copyFile
|
|
3214
3214
|
});
|
|
3215
3215
|
quansync$1({
|
|
3216
|
-
sync:
|
|
3217
|
-
async:
|
|
3216
|
+
sync: fs$1.rmSync,
|
|
3217
|
+
async: fs$1.promises.rm
|
|
3218
3218
|
});
|
|
3219
3219
|
quansync$1({
|
|
3220
|
-
sync:
|
|
3221
|
-
async:
|
|
3220
|
+
sync: fs$1.mkdirSync,
|
|
3221
|
+
async: fs$1.promises.mkdir
|
|
3222
3222
|
});
|
|
3223
3223
|
quansync$1({
|
|
3224
|
-
sync:
|
|
3225
|
-
async:
|
|
3224
|
+
sync: fs$1.renameSync,
|
|
3225
|
+
async: fs$1.promises.rename
|
|
3226
3226
|
});
|
|
3227
3227
|
quansync$1({
|
|
3228
|
-
sync:
|
|
3229
|
-
async:
|
|
3228
|
+
sync: fs$1.readdirSync,
|
|
3229
|
+
async: fs$1.promises.readdir
|
|
3230
3230
|
});
|
|
3231
3231
|
quansync$1({
|
|
3232
|
-
sync:
|
|
3233
|
-
async:
|
|
3232
|
+
sync: fs$1.realpathSync,
|
|
3233
|
+
async: fs$1.promises.realpath
|
|
3234
3234
|
});
|
|
3235
3235
|
quansync$1({
|
|
3236
|
-
sync:
|
|
3237
|
-
async:
|
|
3236
|
+
sync: fs$1.readlinkSync,
|
|
3237
|
+
async: fs$1.promises.readlink
|
|
3238
3238
|
});
|
|
3239
3239
|
quansync$1({
|
|
3240
|
-
sync:
|
|
3241
|
-
async:
|
|
3240
|
+
sync: fs$1.symlinkSync,
|
|
3241
|
+
async: fs$1.promises.symlink
|
|
3242
3242
|
});
|
|
3243
3243
|
quansync$1({
|
|
3244
|
-
sync:
|
|
3245
|
-
async:
|
|
3244
|
+
sync: fs$1.chownSync,
|
|
3245
|
+
async: fs$1.promises.chown
|
|
3246
3246
|
});
|
|
3247
3247
|
quansync$1({
|
|
3248
|
-
sync:
|
|
3249
|
-
async:
|
|
3248
|
+
sync: fs$1.lchownSync,
|
|
3249
|
+
async: fs$1.promises.lchown
|
|
3250
3250
|
});
|
|
3251
3251
|
quansync$1({
|
|
3252
|
-
sync:
|
|
3253
|
-
async:
|
|
3252
|
+
sync: fs$1.chmodSync,
|
|
3253
|
+
async: fs$1.promises.chmod
|
|
3254
3254
|
});
|
|
3255
3255
|
quansync$1({
|
|
3256
|
-
sync:
|
|
3257
|
-
async:
|
|
3256
|
+
sync: fs$1.utimesSync,
|
|
3257
|
+
async: fs$1.promises.utimes
|
|
3258
3258
|
});
|
|
3259
3259
|
quansync$1({
|
|
3260
|
-
sync:
|
|
3261
|
-
async:
|
|
3260
|
+
sync: fs$1.lutimesSync,
|
|
3261
|
+
async: fs$1.promises.lutimes
|
|
3262
3262
|
});
|
|
3263
3263
|
quansync$1({
|
|
3264
|
-
sync:
|
|
3265
|
-
async:
|
|
3264
|
+
sync: fs$1.mkdtempSync,
|
|
3265
|
+
async: fs$1.promises.mkdtemp
|
|
3266
3266
|
});
|
|
3267
3267
|
//#endregion
|
|
3268
3268
|
//#region ../../node_modules/.pnpm/unconfig-core@7.5.0/node_modules/unconfig-core/dist/index.mjs
|
|
@@ -3341,7 +3341,7 @@ function createConfigCoreLoader(options) {
|
|
|
3341
3341
|
};
|
|
3342
3342
|
}
|
|
3343
3343
|
//#endregion
|
|
3344
|
-
//#region ../../node_modules/.pnpm/tsdown@0.21.7_@arethetypeswrong+core@0.18.2_@tsdown+css@0.21.7_@tsdown+exe@0.21.7_@
|
|
3344
|
+
//#region ../../node_modules/.pnpm/tsdown@0.21.7_@arethetypeswrong+core@0.18.2_@tsdown+css@0.21.7_@tsdown+exe@0.21.7_@type_8e1769edffc9fa38659393584fb9975c/node_modules/tsdown/dist/options-j2tUAf6W.mjs
|
|
3345
3345
|
const __cjs_require$1 = createRequire(import.meta.url);
|
|
3346
3346
|
const picomatch = __cjs_require$1("./npm_entry_picomatch.cjs");
|
|
3347
3347
|
const satisfies$1 = __cjs_require$1("./npm_entry_semver_functions_satisfies.cjs");
|
|
@@ -3964,7 +3964,7 @@ async function nativeImport(id) {
|
|
|
3964
3964
|
return mod.default || mod;
|
|
3965
3965
|
}
|
|
3966
3966
|
async function unrunImport(id) {
|
|
3967
|
-
const { unrun } = await import("./dist-
|
|
3967
|
+
const { unrun } = await import("./dist-_IXstuie.js");
|
|
3968
3968
|
const { module } = await unrun({ path: pathToFileURL(id).href });
|
|
3969
3969
|
return module;
|
|
3970
3970
|
}
|
|
@@ -4157,7 +4157,7 @@ function filterConfig(filter, configCwd, name) {
|
|
|
4157
4157
|
return toArray(filter).some((value) => name && name === value || cwd === value);
|
|
4158
4158
|
}
|
|
4159
4159
|
//#endregion
|
|
4160
|
-
//#region ../../node_modules/.pnpm/tsdown@0.21.7_@arethetypeswrong+core@0.18.2_@tsdown+css@0.21.7_@tsdown+exe@0.21.7_@
|
|
4160
|
+
//#region ../../node_modules/.pnpm/tsdown@0.21.7_@arethetypeswrong+core@0.18.2_@tsdown+css@0.21.7_@tsdown+exe@0.21.7_@type_8e1769edffc9fa38659393584fb9975c/node_modules/tsdown/dist/watch-ZJbRq-K8.mjs
|
|
4161
4161
|
async function copy(options) {
|
|
4162
4162
|
if (!options.copy) return;
|
|
4163
4163
|
const resolved = await resolveCopyEntries(options);
|
|
@@ -4537,7 +4537,7 @@ var Hookable = class {
|
|
|
4537
4537
|
}
|
|
4538
4538
|
};
|
|
4539
4539
|
//#endregion
|
|
4540
|
-
//#region ../../node_modules/.pnpm/tsdown@0.21.7_@arethetypeswrong+core@0.18.2_@tsdown+css@0.21.7_@tsdown+exe@0.21.7_@
|
|
4540
|
+
//#region ../../node_modules/.pnpm/tsdown@0.21.7_@arethetypeswrong+core@0.18.2_@tsdown+css@0.21.7_@tsdown+exe@0.21.7_@type_8e1769edffc9fa38659393584fb9975c/node_modules/tsdown/dist/build-DU-BFLB1.mjs
|
|
4541
4541
|
const __cjs_require = createRequire(import.meta.url);
|
|
4542
4542
|
const satisfies = __cjs_require("./npm_entry_semver_functions_satisfies.cjs");
|
|
4543
4543
|
const coerce = __cjs_require("./npm_entry_semver_functions_coerce.cjs");
|
|
@@ -4834,7 +4834,7 @@ async function bundleDone(bundleByPkg, bundle) {
|
|
|
4834
4834
|
async function packTarball(packageJsonPath) {
|
|
4835
4835
|
const pkgDir = path.dirname(packageJsonPath);
|
|
4836
4836
|
const destination = await mkdtemp(path.join(tmpdir(), "tsdown-pack-"));
|
|
4837
|
-
const { detect } = await import("./detect-h8ZFBH96-
|
|
4837
|
+
const { detect } = await import("./detect-h8ZFBH96-DbLjA61J.js");
|
|
4838
4838
|
try {
|
|
4839
4839
|
const detected = await detect({ cwd: pkgDir });
|
|
4840
4840
|
if (detected?.name === "deno") throw new Error(`Cannot pack tarball for Deno projects at ${pkgDir}`);
|
|
@@ -4970,7 +4970,7 @@ async function resolveInputOptions(config, format, configFiles, bundle, cjsDts,
|
|
|
4970
4970
|
if (nodeProtocol) plugins.push(NodeProtocolPlugin(nodeProtocol));
|
|
4971
4971
|
if (config.pkg || config.deps.skipNodeModulesBundle) plugins.push(DepsPlugin(config, bundle));
|
|
4972
4972
|
if (dts) {
|
|
4973
|
-
const { dts: dtsPlugin } = await import("./dist-
|
|
4973
|
+
const { dts: dtsPlugin } = await import("./dist-CY3M22aR.js");
|
|
4974
4974
|
const { cjsReexport: _, ...dtsPluginOptions } = dts;
|
|
4975
4975
|
const options = {
|
|
4976
4976
|
tsconfig,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { D as toArray, w as resolveComma } from "./main-
|
|
1
|
+
import { D as toArray, w as resolveComma } from "./main-wrcIC7dd.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.7_@arethetypeswrong+core@0.18.2_@tsdown+css@0.21.7_@tsdown+exe@0.21.7_@
|
|
3
|
+
//#region ../../node_modules/.pnpm/tsdown@0.21.7_@arethetypeswrong+core@0.18.2_@tsdown+css@0.21.7_@tsdown+exe@0.21.7_@type_8e1769edffc9fa38659393584fb9975c/node_modules/tsdown/dist/debug-BmAPbhgA.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.7_@arethetypeswrong+core@0.18.2_@tsdown+css@0.21.7_@tsdown+exe@0.21.7_@
|
|
4
|
+
//#region ../../node_modules/.pnpm/tsdown@0.21.7_@arethetypeswrong+core@0.18.2_@tsdown+css@0.21.7_@tsdown+exe@0.21.7_@type_8e1769edffc9fa38659393584fb9975c/node_modules/tsdown/dist/detect-h8ZFBH96.mjs
|
|
5
5
|
const AGENTS = [
|
|
6
6
|
"npm",
|
|
7
7
|
"yarn",
|
|
@@ -1,8 +1,8 @@
|
|
|
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
|
-
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-
|
|
4
|
-
import { n as pe, t as Ge } from "./dist-
|
|
5
|
-
import { n as globalContext, r as invalidateContextFile, t as createContext } from "./tsc-context-
|
|
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-D58wGDtS.js";
|
|
4
|
+
import { n as pe, t as Ge } from "./dist-D7qIxBaV.js";
|
|
5
|
+
import { n as globalContext, r as invalidateContextFile, t as createContext } from "./tsc-context-Dban9z4Z.js";
|
|
6
6
|
import { createRequire } from "node:module";
|
|
7
7
|
import process from "node:process";
|
|
8
8
|
import { fork, spawn } from "node:child_process";
|
|
@@ -31216,7 +31216,7 @@ function createGeneratePlugin({ entry, tsconfig, tsconfigRaw, build, incremental
|
|
|
31216
31216
|
on: (fn) => childProcess.on("message", fn)
|
|
31217
31217
|
});
|
|
31218
31218
|
} else {
|
|
31219
|
-
tscModule = await import("./tsc-
|
|
31219
|
+
tscModule = await import("./tsc-DzHkiQui.js");
|
|
31220
31220
|
if (newContext) tscContext = createContext();
|
|
31221
31221
|
}
|
|
31222
31222
|
if (!Array.isArray(options.input)) for (const [name, id] of Object.entries(options.input)) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import module from "node:module";
|
|
2
2
|
import path from "node:path";
|
|
3
|
-
import
|
|
3
|
+
import fs from "node:fs";
|
|
4
4
|
import nativeFs from "fs";
|
|
5
5
|
import Be from "os";
|
|
6
6
|
import path$1 from "path";
|
|
@@ -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 (;;) {
|
|
@@ -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;
|
|
@@ -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.23.2_@typescript+native-preview@7.0.0-dev.20260122.2_oxc-
|
|
3
|
+
//#region ../../node_modules/.pnpm/rolldown-plugin-dts@0.23.2_@typescript+native-preview@7.0.0-dev.20260122.2_oxc-resolver_a1b917fb2cc1517960b8c67ff7a07c16/node_modules/rolldown-plugin-dts/dist/filename-DQnUJlio.mjs
|
|
4
4
|
const RE_JS = /\.([cm]?)jsx?$/;
|
|
5
5
|
const RE_TS = /\.([cm]?)tsx?$/;
|
|
6
6
|
const RE_DTS = /\.d\.([cm]?)ts$/;
|