@voidzero-dev/vite-plus-core 0.1.12-alpha.1 → 0.1.12-alpha.2
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-B1oBkI4C-Dh08ogRE.js → build-B1oBkI4C-Bj4wFOdV.js} +1 -1
- package/dist/tsdown/{build-CpOl_krN-CHw39ynq.js → build-CpOl_krN-DrIRjiqJ.js} +43 -43
- package/dist/tsdown/{dist-dJp148cE.js → dist-CtF_Stv5.js} +3 -3
- package/dist/tsdown/{dist-BTs7u0nu.js → dist-DceV6s_v.js} +12 -12
- package/dist/tsdown/index.js +1 -1
- package/dist/tsdown/run.js +1 -1
- package/package.json +2 -2
|
@@ -17,7 +17,7 @@ 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";
|
|
18
18
|
import { fileURLToPath as fileURLToPath$1 } from "url";
|
|
19
19
|
import { tmpdir } from "node:os";
|
|
20
|
-
import
|
|
20
|
+
import re, { existsSync, readFileSync, writeFileSync } from "node:fs";
|
|
21
21
|
import { Buffer } from "node:buffer";
|
|
22
22
|
import { brotliCompress, gzip } from "node:zlib";
|
|
23
23
|
import { importGlobPlugin } from "@voidzero-dev/vite-plus-core/rolldown/experimental";
|
|
@@ -2917,87 +2917,87 @@ quansync$1({
|
|
|
2917
2917
|
*/
|
|
2918
2918
|
const quansync = quansync$1;
|
|
2919
2919
|
quansync$1({
|
|
2920
|
-
sync:
|
|
2921
|
-
async:
|
|
2920
|
+
sync: re.readFileSync,
|
|
2921
|
+
async: re.promises.readFile
|
|
2922
2922
|
});
|
|
2923
2923
|
quansync$1({
|
|
2924
|
-
sync:
|
|
2925
|
-
async:
|
|
2924
|
+
sync: re.writeFileSync,
|
|
2925
|
+
async: re.promises.writeFile
|
|
2926
2926
|
});
|
|
2927
2927
|
quansync$1({
|
|
2928
|
-
sync:
|
|
2929
|
-
async:
|
|
2928
|
+
sync: re.unlinkSync,
|
|
2929
|
+
async: re.promises.unlink
|
|
2930
2930
|
});
|
|
2931
2931
|
quansync$1({
|
|
2932
|
-
sync:
|
|
2933
|
-
async:
|
|
2932
|
+
sync: re.accessSync,
|
|
2933
|
+
async: re.promises.access
|
|
2934
2934
|
});
|
|
2935
2935
|
/**
|
|
2936
2936
|
* @link https://nodejs.org/api/fs.html#fspromisesstatpath-options
|
|
2937
2937
|
*/
|
|
2938
2938
|
const stat$1 = quansync$1({
|
|
2939
|
-
sync:
|
|
2940
|
-
async:
|
|
2939
|
+
sync: re.statSync,
|
|
2940
|
+
async: re.promises.stat
|
|
2941
2941
|
});
|
|
2942
2942
|
const lstat = quansync$1({
|
|
2943
|
-
sync:
|
|
2944
|
-
async:
|
|
2943
|
+
sync: re.lstatSync,
|
|
2944
|
+
async: re.promises.lstat
|
|
2945
2945
|
});
|
|
2946
2946
|
quansync$1({
|
|
2947
|
-
sync:
|
|
2948
|
-
async:
|
|
2947
|
+
sync: re.copyFileSync,
|
|
2948
|
+
async: re.promises.copyFile
|
|
2949
2949
|
});
|
|
2950
2950
|
quansync$1({
|
|
2951
|
-
sync:
|
|
2952
|
-
async:
|
|
2951
|
+
sync: re.rmSync,
|
|
2952
|
+
async: re.promises.rm
|
|
2953
2953
|
});
|
|
2954
2954
|
quansync$1({
|
|
2955
|
-
sync:
|
|
2956
|
-
async:
|
|
2955
|
+
sync: re.mkdirSync,
|
|
2956
|
+
async: re.promises.mkdir
|
|
2957
2957
|
});
|
|
2958
2958
|
quansync$1({
|
|
2959
|
-
sync:
|
|
2960
|
-
async:
|
|
2959
|
+
sync: re.renameSync,
|
|
2960
|
+
async: re.promises.rename
|
|
2961
2961
|
});
|
|
2962
2962
|
quansync$1({
|
|
2963
|
-
sync:
|
|
2964
|
-
async:
|
|
2963
|
+
sync: re.readdirSync,
|
|
2964
|
+
async: re.promises.readdir
|
|
2965
2965
|
});
|
|
2966
2966
|
quansync$1({
|
|
2967
|
-
sync:
|
|
2968
|
-
async:
|
|
2967
|
+
sync: re.realpathSync,
|
|
2968
|
+
async: re.promises.realpath
|
|
2969
2969
|
});
|
|
2970
2970
|
quansync$1({
|
|
2971
|
-
sync:
|
|
2972
|
-
async:
|
|
2971
|
+
sync: re.readlinkSync,
|
|
2972
|
+
async: re.promises.readlink
|
|
2973
2973
|
});
|
|
2974
2974
|
quansync$1({
|
|
2975
|
-
sync:
|
|
2976
|
-
async:
|
|
2975
|
+
sync: re.symlinkSync,
|
|
2976
|
+
async: re.promises.symlink
|
|
2977
2977
|
});
|
|
2978
2978
|
quansync$1({
|
|
2979
|
-
sync:
|
|
2980
|
-
async:
|
|
2979
|
+
sync: re.chownSync,
|
|
2980
|
+
async: re.promises.chown
|
|
2981
2981
|
});
|
|
2982
2982
|
quansync$1({
|
|
2983
|
-
sync:
|
|
2984
|
-
async:
|
|
2983
|
+
sync: re.lchownSync,
|
|
2984
|
+
async: re.promises.lchown
|
|
2985
2985
|
});
|
|
2986
2986
|
quansync$1({
|
|
2987
|
-
sync:
|
|
2988
|
-
async:
|
|
2987
|
+
sync: re.chmodSync,
|
|
2988
|
+
async: re.promises.chmod
|
|
2989
2989
|
});
|
|
2990
2990
|
quansync$1({
|
|
2991
|
-
sync:
|
|
2992
|
-
async:
|
|
2991
|
+
sync: re.utimesSync,
|
|
2992
|
+
async: re.promises.utimes
|
|
2993
2993
|
});
|
|
2994
2994
|
quansync$1({
|
|
2995
|
-
sync:
|
|
2996
|
-
async:
|
|
2995
|
+
sync: re.lutimesSync,
|
|
2996
|
+
async: re.promises.lutimes
|
|
2997
2997
|
});
|
|
2998
2998
|
quansync$1({
|
|
2999
|
-
sync:
|
|
3000
|
-
async:
|
|
2999
|
+
sync: re.mkdtempSync,
|
|
3000
|
+
async: re.promises.mkdtemp
|
|
3001
3001
|
});
|
|
3002
3002
|
//#endregion
|
|
3003
3003
|
//#region ../../node_modules/.pnpm/unconfig-core@7.5.0/node_modules/unconfig-core/dist/index.mjs
|
|
@@ -3638,7 +3638,7 @@ async function nativeImport(id) {
|
|
|
3638
3638
|
return mod.default || mod;
|
|
3639
3639
|
}
|
|
3640
3640
|
async function unrunImport(id) {
|
|
3641
|
-
const { unrun } = await import("./dist-
|
|
3641
|
+
const { unrun } = await import("./dist-DceV6s_v.js");
|
|
3642
3642
|
const { module } = await unrun({ path: pathToFileURL(id).href });
|
|
3643
3643
|
return module;
|
|
3644
3644
|
}
|
|
@@ -4597,7 +4597,7 @@ async function resolveInputOptions(config, format, configFiles, bundle, cjsDts,
|
|
|
4597
4597
|
if (nodeProtocol) plugins.push(NodeProtocolPlugin(nodeProtocol));
|
|
4598
4598
|
if (config.pkg || config.deps.skipNodeModulesBundle) plugins.push(DepPlugin(config, bundle));
|
|
4599
4599
|
if (dts) {
|
|
4600
|
-
const { dts: dtsPlugin } = await import("./dist-
|
|
4600
|
+
const { dts: dtsPlugin } = await import("./dist-CtF_Stv5.js");
|
|
4601
4601
|
const options = {
|
|
4602
4602
|
tsconfig,
|
|
4603
4603
|
...dts
|
|
@@ -11,7 +11,7 @@ import { importerId, include } from "@voidzero-dev/vite-plus-core/rolldown/filte
|
|
|
11
11
|
import nativeFs from "fs";
|
|
12
12
|
import path$1 from "path";
|
|
13
13
|
import { tmpdir } from "node:os";
|
|
14
|
-
import
|
|
14
|
+
import re, { existsSync } from "node:fs";
|
|
15
15
|
import { ResolverFactory, isolatedDeclarationSync } from "@voidzero-dev/vite-plus-core/rolldown/experimental";
|
|
16
16
|
import Be from "os";
|
|
17
17
|
//#region ../../node_modules/.pnpm/@jridgewell+sourcemap-codec@1.5.5/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.mjs
|
|
@@ -30356,11 +30356,11 @@ function h(e) {
|
|
|
30356
30356
|
}
|
|
30357
30357
|
i(h, "slash");
|
|
30358
30358
|
const Z = i((e) => {
|
|
30359
|
-
const t =
|
|
30359
|
+
const t = re[e];
|
|
30360
30360
|
return (s, ...n) => {
|
|
30361
30361
|
const o = `${e}:${n.join(":")}`;
|
|
30362
30362
|
let l = s == null ? void 0 : s.get(o);
|
|
30363
|
-
return l === void 0 && (l = Reflect.apply(t,
|
|
30363
|
+
return l === void 0 && (l = Reflect.apply(t, re, n), s?.set(o, l)), l;
|
|
30364
30364
|
};
|
|
30365
30365
|
}, "cacheFs"), E = Z("existsSync"), $e = Z("readFileSync"), G = Z("statSync"), fe = i((e, t, s) => {
|
|
30366
30366
|
for (;;) {
|
|
@@ -5,7 +5,7 @@ import "node:child_process";
|
|
|
5
5
|
import path from "node:path";
|
|
6
6
|
import { rolldown } from "@voidzero-dev/vite-plus-core/rolldown";
|
|
7
7
|
import { tmpdir } from "node:os";
|
|
8
|
-
import
|
|
8
|
+
import re, { existsSync } from "node:fs";
|
|
9
9
|
import { Buffer } from "node:buffer";
|
|
10
10
|
import crypto from "node:crypto";
|
|
11
11
|
//#region ../../node_modules/.pnpm/unrun@0.2.32/node_modules/unrun/dist/src-GU5PtktT.mjs
|
|
@@ -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;
|
package/dist/tsdown/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { c as globalLogger } from "./main-4fHWraTN.js";
|
|
2
2
|
import "./node-B3Gdtau1.js";
|
|
3
3
|
import { t as enableDebug } from "./debug-C4FmgzkJ-BcERCViE.js";
|
|
4
|
-
import { i as resolveUserConfig, n as buildWithConfigs, r as mergeConfig, t as build$1 } from "./build-CpOl_krN-
|
|
4
|
+
import { i as resolveUserConfig, n as buildWithConfigs, r as mergeConfig, t as build$1 } from "./build-CpOl_krN-DrIRjiqJ.js";
|
|
5
5
|
import "./filename-UU7z2A9Z.js";
|
|
6
6
|
import * as Rolldown from "@voidzero-dev/vite-plus-core/rolldown";
|
|
7
7
|
//#region ../../node_modules/.pnpm/tsdown@0.21.2_@arethetypeswrong+core@0.18.2_@tsdown+css@0.21.2_@tsdown+exe@0.21.2_@type_059aa640a91d945cefc9d8c8db7a9cd0/node_modules/tsdown/dist/config.mjs
|
package/dist/tsdown/run.js
CHANGED
|
@@ -631,7 +631,7 @@ 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, 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) => {
|
|
632
632
|
globalLogger.level = flags.logLevel || "info";
|
|
633
633
|
globalLogger.info(`tsdown ${dim`v${version}`} powered by rolldown ${dim`v${VERSION}`}`);
|
|
634
|
-
const { build } = await import("./build-B1oBkI4C-
|
|
634
|
+
const { build } = await import("./build-B1oBkI4C-Bj4wFOdV.js");
|
|
635
635
|
if (input.length > 0) flags.entry = input;
|
|
636
636
|
await build(flags);
|
|
637
637
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@voidzero-dev/vite-plus-core",
|
|
3
|
-
"version": "0.1.12-alpha.
|
|
3
|
+
"version": "0.1.12-alpha.2",
|
|
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.2",
|
|
131
131
|
"rolldown": "1.0.0-rc.9",
|
|
132
|
-
"vite": "npm:@voidzero-dev/vite-plus-core@0.1.12-alpha.
|
|
132
|
+
"vite": "npm:@voidzero-dev/vite-plus-core@0.1.12-alpha.2"
|
|
133
133
|
},
|
|
134
134
|
"peerDependencies": {
|
|
135
135
|
"@arethetypeswrong/core": "^0.18.1",
|