@voidzero-dev/vite-plus-core 0.1.17 → 0.1.18
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-B9JhNMeu.js +2 -0
- package/dist/tsdown/{build-y6nUUkVJ-DChPSMiT.js → build-y6nUUkVJ-BUtpLkpw.js} +44 -44
- package/dist/tsdown/{dist-_IXstuie.js → dist-Cqme3mtE.js} +12 -12
- package/dist/tsdown/{dist-CbhZqEsp.js → dist-D_AJtdxQ.js} +3 -3
- package/dist/tsdown/{dist-C4l5avio.js → dist-PpqQ55q2.js} +1 -1
- package/dist/tsdown/index.js +1 -1
- package/dist/tsdown/run.js +1 -1
- package/package.json +2 -2
- package/dist/tsdown/build-y6nUUkVJ-CXW65uEP.js +0 -2
|
@@ -2,7 +2,7 @@ import { r as __toESM, t as __commonJSMin } from "./chunk-CSNpwdVU.js";
|
|
|
2
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 W, o as generateColor, p as green, r as version, s as getNameLabel, t as U, u as blue, v as debounce, w as resolveComma, x as noop, y as importWithError } from "./main-Ccx2FDJq.js";
|
|
3
3
|
import { t as createDebug } from "./node-B3Gdtau1.js";
|
|
4
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-DHPB7cQg.js";
|
|
5
|
-
import "./dist-
|
|
5
|
+
import "./dist-D_AJtdxQ.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 re, { existsSync, readFileSync, writeFileSync } from "node:fs";
|
|
15
15
|
import * as nativeFs from "fs";
|
|
16
16
|
import { readdir as readdir$1, readdirSync, realpath, realpathSync, stat as stat$1, statSync } from "fs";
|
|
17
17
|
import { basename, dirname as dirname$1, isAbsolute as isAbsolute$1, normalize as normalize$1, posix, relative, resolve as resolve$1, sep } from "path";
|
|
@@ -3208,87 +3208,87 @@ quansync$1({
|
|
|
3208
3208
|
*/
|
|
3209
3209
|
const quansync = quansync$1;
|
|
3210
3210
|
quansync$1({
|
|
3211
|
-
sync:
|
|
3212
|
-
async:
|
|
3211
|
+
sync: re.readFileSync,
|
|
3212
|
+
async: re.promises.readFile
|
|
3213
3213
|
});
|
|
3214
3214
|
quansync$1({
|
|
3215
|
-
sync:
|
|
3216
|
-
async:
|
|
3215
|
+
sync: re.writeFileSync,
|
|
3216
|
+
async: re.promises.writeFile
|
|
3217
3217
|
});
|
|
3218
3218
|
quansync$1({
|
|
3219
|
-
sync:
|
|
3220
|
-
async:
|
|
3219
|
+
sync: re.unlinkSync,
|
|
3220
|
+
async: re.promises.unlink
|
|
3221
3221
|
});
|
|
3222
3222
|
quansync$1({
|
|
3223
|
-
sync:
|
|
3224
|
-
async:
|
|
3223
|
+
sync: re.accessSync,
|
|
3224
|
+
async: re.promises.access
|
|
3225
3225
|
});
|
|
3226
3226
|
/**
|
|
3227
3227
|
* @link https://nodejs.org/api/fs.html#fspromisesstatpath-options
|
|
3228
3228
|
*/
|
|
3229
3229
|
const stat$2 = quansync$1({
|
|
3230
|
-
sync:
|
|
3231
|
-
async:
|
|
3230
|
+
sync: re.statSync,
|
|
3231
|
+
async: re.promises.stat
|
|
3232
3232
|
});
|
|
3233
3233
|
const lstat = quansync$1({
|
|
3234
|
-
sync:
|
|
3235
|
-
async:
|
|
3234
|
+
sync: re.lstatSync,
|
|
3235
|
+
async: re.promises.lstat
|
|
3236
3236
|
});
|
|
3237
3237
|
quansync$1({
|
|
3238
|
-
sync:
|
|
3239
|
-
async:
|
|
3238
|
+
sync: re.copyFileSync,
|
|
3239
|
+
async: re.promises.copyFile
|
|
3240
3240
|
});
|
|
3241
3241
|
quansync$1({
|
|
3242
|
-
sync:
|
|
3243
|
-
async:
|
|
3242
|
+
sync: re.rmSync,
|
|
3243
|
+
async: re.promises.rm
|
|
3244
3244
|
});
|
|
3245
3245
|
quansync$1({
|
|
3246
|
-
sync:
|
|
3247
|
-
async:
|
|
3246
|
+
sync: re.mkdirSync,
|
|
3247
|
+
async: re.promises.mkdir
|
|
3248
3248
|
});
|
|
3249
3249
|
quansync$1({
|
|
3250
|
-
sync:
|
|
3251
|
-
async:
|
|
3250
|
+
sync: re.renameSync,
|
|
3251
|
+
async: re.promises.rename
|
|
3252
3252
|
});
|
|
3253
3253
|
quansync$1({
|
|
3254
|
-
sync:
|
|
3255
|
-
async:
|
|
3254
|
+
sync: re.readdirSync,
|
|
3255
|
+
async: re.promises.readdir
|
|
3256
3256
|
});
|
|
3257
3257
|
quansync$1({
|
|
3258
|
-
sync:
|
|
3259
|
-
async:
|
|
3258
|
+
sync: re.realpathSync,
|
|
3259
|
+
async: re.promises.realpath
|
|
3260
3260
|
});
|
|
3261
3261
|
quansync$1({
|
|
3262
|
-
sync:
|
|
3263
|
-
async:
|
|
3262
|
+
sync: re.readlinkSync,
|
|
3263
|
+
async: re.promises.readlink
|
|
3264
3264
|
});
|
|
3265
3265
|
quansync$1({
|
|
3266
|
-
sync:
|
|
3267
|
-
async:
|
|
3266
|
+
sync: re.symlinkSync,
|
|
3267
|
+
async: re.promises.symlink
|
|
3268
3268
|
});
|
|
3269
3269
|
quansync$1({
|
|
3270
|
-
sync:
|
|
3271
|
-
async:
|
|
3270
|
+
sync: re.chownSync,
|
|
3271
|
+
async: re.promises.chown
|
|
3272
3272
|
});
|
|
3273
3273
|
quansync$1({
|
|
3274
|
-
sync:
|
|
3275
|
-
async:
|
|
3274
|
+
sync: re.lchownSync,
|
|
3275
|
+
async: re.promises.lchown
|
|
3276
3276
|
});
|
|
3277
3277
|
quansync$1({
|
|
3278
|
-
sync:
|
|
3279
|
-
async:
|
|
3278
|
+
sync: re.chmodSync,
|
|
3279
|
+
async: re.promises.chmod
|
|
3280
3280
|
});
|
|
3281
3281
|
quansync$1({
|
|
3282
|
-
sync:
|
|
3283
|
-
async:
|
|
3282
|
+
sync: re.utimesSync,
|
|
3283
|
+
async: re.promises.utimes
|
|
3284
3284
|
});
|
|
3285
3285
|
quansync$1({
|
|
3286
|
-
sync:
|
|
3287
|
-
async:
|
|
3286
|
+
sync: re.lutimesSync,
|
|
3287
|
+
async: re.promises.lutimes
|
|
3288
3288
|
});
|
|
3289
3289
|
quansync$1({
|
|
3290
|
-
sync:
|
|
3291
|
-
async:
|
|
3290
|
+
sync: re.mkdtempSync,
|
|
3291
|
+
async: re.promises.mkdtemp
|
|
3292
3292
|
});
|
|
3293
3293
|
//#endregion
|
|
3294
3294
|
//#region ../../node_modules/.pnpm/unconfig-core@7.5.0/node_modules/unconfig-core/dist/index.mjs
|
|
@@ -3970,7 +3970,7 @@ async function nativeImport(id) {
|
|
|
3970
3970
|
return mod.default || mod;
|
|
3971
3971
|
}
|
|
3972
3972
|
async function unrunImport(id) {
|
|
3973
|
-
const { unrun } = await import("./dist-
|
|
3973
|
+
const { unrun } = await import("./dist-Cqme3mtE.js");
|
|
3974
3974
|
const { module } = await unrun({ path: pathToFileURL(id).href });
|
|
3975
3975
|
return module;
|
|
3976
3976
|
}
|
|
@@ -4993,7 +4993,7 @@ async function resolveInputOptions(config, format, configFiles, bundle, cjsDts,
|
|
|
4993
4993
|
if (nodeProtocol) plugins.push(NodeProtocolPlugin(nodeProtocol));
|
|
4994
4994
|
if (config.pkg || config.deps.skipNodeModulesBundle) plugins.push(DepsPlugin(config, bundle));
|
|
4995
4995
|
if (dts) {
|
|
4996
|
-
const { dts: dtsPlugin } = await import("./dist-
|
|
4996
|
+
const { dts: dtsPlugin } = await import("./dist-PpqQ55q2.js");
|
|
4997
4997
|
const { cjsReexport: _, ...dtsPluginOptions } = dts;
|
|
4998
4998
|
const options = {
|
|
4999
4999
|
tsconfig,
|
|
@@ -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 re, { 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 (!re.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 = re.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 = re.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 (re.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 = re.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
|
+
re.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 (!re.existsSync(outFile)) try {
|
|
686
|
+
re.mkdirSync(outDir, { recursive: true });
|
|
687
|
+
re.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
|
+
re.mkdirSync(fallbackDir, { recursive: true });
|
|
692
|
+
re.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 module from "node:module";
|
|
2
2
|
import path from "node:path";
|
|
3
|
-
import
|
|
3
|
+
import re from "node:fs";
|
|
4
4
|
import xe from "fs";
|
|
5
5
|
import Be from "os";
|
|
6
6
|
import Ie 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 = re[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, re, 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 (;;) {
|
|
@@ -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-D_AJtdxQ.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";
|
package/dist/tsdown/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { c as globalLogger } from "./main-Ccx2FDJq.js";
|
|
2
2
|
import { t as enableDebug } from "./debug-CLlnG64L-CvIUyX2c.js";
|
|
3
|
-
import { a as resolveUserConfig, i as mergeConfig, n as buildWithConfigs, t as build$1 } from "./build-y6nUUkVJ-
|
|
3
|
+
import { a as resolveUserConfig, i as mergeConfig, n as buildWithConfigs, t as build$1 } from "./build-y6nUUkVJ-BUtpLkpw.js";
|
|
4
4
|
import * as Rolldown from "@voidzero-dev/vite-plus-core/rolldown";
|
|
5
5
|
//#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/config.mjs
|
|
6
6
|
function defineConfig(options) {
|
package/dist/tsdown/run.js
CHANGED
|
@@ -630,7 +630,7 @@ cli.command("[...files]", "Bundle files", {
|
|
|
630
630
|
}).option("-c, --config <filename>", "Use a custom config file").option("--config-loader <loader>", "Config loader to use: auto, native, 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("-F, --filter <pattern>", "Filter configs (cwd or name), e.g. /pkg-name$/ or pkg-name").option("--exports", "Generate export-related metadata for package.json (experimental)").action(async (input, flags) => {
|
|
631
631
|
globalLogger.level = flags.logLevel || "info";
|
|
632
632
|
globalLogger.info(`${blue`tsdown v${version}`} powered by ${hex("#ff7e17")`rolldown v${VERSION}`}`);
|
|
633
|
-
const { build } = await import("./build-y6nUUkVJ-
|
|
633
|
+
const { build } = await import("./build-y6nUUkVJ-B9JhNMeu.js").then((n) => n.r);
|
|
634
634
|
if (input.length > 0) flags.entry = input;
|
|
635
635
|
await build(flags);
|
|
636
636
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@voidzero-dev/vite-plus-core",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.18",
|
|
4
4
|
"description": "The Unified Toolchain for the Web",
|
|
5
5
|
"homepage": "https://viteplus.dev/guide",
|
|
6
6
|
"bugs": {
|
|
@@ -129,7 +129,7 @@
|
|
|
129
129
|
"tree-kill": "^1.2.2",
|
|
130
130
|
"tsdown": "^0.21.8",
|
|
131
131
|
"rolldown": "1.0.0-rc.15",
|
|
132
|
-
"vite": "npm:@voidzero-dev/vite-plus-core@0.1.
|
|
132
|
+
"vite": "npm:@voidzero-dev/vite-plus-core@0.1.18"
|
|
133
133
|
},
|
|
134
134
|
"peerDependencies": {
|
|
135
135
|
"@arethetypeswrong/core": "^0.18.1",
|