@voidzero-dev/vite-plus-core 0.1.0 → 0.1.1-alpha.0
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-2oRq4mfQ-BsBFNe6R.js → build-2oRq4mfQ-YC_gzK3u.js} +1 -1
- package/dist/tsdown/{build-BjQ7Rt90-BvhrB9y7.js → build-BjQ7Rt90-tMPZTflz.js} +43 -43
- package/dist/tsdown/{dist-CsV9BHty.js → dist-CFTDWtv2.js} +12 -12
- package/dist/tsdown/{dist-ahreeiwc.js → dist-DNcnO8LL.js} +3 -3
- package/dist/tsdown/index.js +1 -1
- package/dist/tsdown/run.js +1 -1
- package/package.json +3 -3
|
@@ -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 fs$1, { 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";
|
|
@@ -2928,138 +2928,138 @@ const quansync = quansync$1;
|
|
|
2928
2928
|
* @link https://nodejs.org/api/fs.html#fspromisesreadfilepath-options
|
|
2929
2929
|
*/
|
|
2930
2930
|
const readFile$1 = quansync$1({
|
|
2931
|
-
sync:
|
|
2932
|
-
async:
|
|
2931
|
+
sync: fs$1.readFileSync,
|
|
2932
|
+
async: fs$1.promises.readFile
|
|
2933
2933
|
});
|
|
2934
2934
|
/**
|
|
2935
2935
|
* @link https://nodejs.org/api/fs.html#fspromiseswritefilefile-data-options
|
|
2936
2936
|
*/
|
|
2937
2937
|
const writeFile$1 = quansync$1({
|
|
2938
|
-
sync:
|
|
2939
|
-
async:
|
|
2938
|
+
sync: fs$1.writeFileSync,
|
|
2939
|
+
async: fs$1.promises.writeFile
|
|
2940
2940
|
});
|
|
2941
2941
|
/**
|
|
2942
2942
|
* @link https://nodejs.org/api/fs.html#fspromisesunlinkpath
|
|
2943
2943
|
*/
|
|
2944
2944
|
const unlink = quansync$1({
|
|
2945
|
-
sync:
|
|
2946
|
-
async:
|
|
2945
|
+
sync: fs$1.unlinkSync,
|
|
2946
|
+
async: fs$1.promises.unlink
|
|
2947
2947
|
});
|
|
2948
2948
|
/**
|
|
2949
2949
|
* @link https://nodejs.org/api/fs.html#fspromisesaccesspath-mode
|
|
2950
2950
|
*/
|
|
2951
2951
|
const access$1 = quansync$1({
|
|
2952
|
-
sync:
|
|
2953
|
-
async:
|
|
2952
|
+
sync: fs$1.accessSync,
|
|
2953
|
+
async: fs$1.promises.access
|
|
2954
2954
|
});
|
|
2955
2955
|
/**
|
|
2956
2956
|
* @link https://nodejs.org/api/fs.html#fspromisesstatpath-options
|
|
2957
2957
|
*/
|
|
2958
2958
|
const stat$1 = quansync$1({
|
|
2959
|
-
sync:
|
|
2960
|
-
async:
|
|
2959
|
+
sync: fs$1.statSync,
|
|
2960
|
+
async: fs$1.promises.stat
|
|
2961
2961
|
});
|
|
2962
2962
|
const lstat = quansync$1({
|
|
2963
|
-
sync:
|
|
2964
|
-
async:
|
|
2963
|
+
sync: fs$1.lstatSync,
|
|
2964
|
+
async: fs$1.promises.lstat
|
|
2965
2965
|
});
|
|
2966
2966
|
/**
|
|
2967
2967
|
* @link https://nodejs.org/api/fs.html#fspromisescpsrc-dest-options
|
|
2968
2968
|
*/
|
|
2969
2969
|
const cp$1 = quansync$1({
|
|
2970
|
-
sync:
|
|
2971
|
-
async:
|
|
2970
|
+
sync: fs$1.copyFileSync,
|
|
2971
|
+
async: fs$1.promises.copyFile
|
|
2972
2972
|
});
|
|
2973
2973
|
/**
|
|
2974
2974
|
* @link https://nodejs.org/api/fs.html#fspromisesrmpath-options
|
|
2975
2975
|
*/
|
|
2976
2976
|
const rm$1 = quansync$1({
|
|
2977
|
-
sync:
|
|
2978
|
-
async:
|
|
2977
|
+
sync: fs$1.rmSync,
|
|
2978
|
+
async: fs$1.promises.rm
|
|
2979
2979
|
});
|
|
2980
2980
|
/**
|
|
2981
2981
|
* @link https://nodejs.org/api/fs.html#fspromisesmkdirpath-options
|
|
2982
2982
|
*/
|
|
2983
2983
|
const mkdir = quansync$1({
|
|
2984
|
-
sync:
|
|
2985
|
-
async:
|
|
2984
|
+
sync: fs$1.mkdirSync,
|
|
2985
|
+
async: fs$1.promises.mkdir
|
|
2986
2986
|
});
|
|
2987
2987
|
/**
|
|
2988
2988
|
* @link https://nodejs.org/api/fs.html#fspromisesrenameoldpath-newpath
|
|
2989
2989
|
*/
|
|
2990
2990
|
const rename = quansync$1({
|
|
2991
|
-
sync:
|
|
2992
|
-
async:
|
|
2991
|
+
sync: fs$1.renameSync,
|
|
2992
|
+
async: fs$1.promises.rename
|
|
2993
2993
|
});
|
|
2994
2994
|
/**
|
|
2995
2995
|
* @link https://nodejs.org/api/fs.html#fspromisesreaddirpath-options
|
|
2996
2996
|
*/
|
|
2997
2997
|
const readdir = quansync$1({
|
|
2998
|
-
sync:
|
|
2999
|
-
async:
|
|
2998
|
+
sync: fs$1.readdirSync,
|
|
2999
|
+
async: fs$1.promises.readdir
|
|
3000
3000
|
});
|
|
3001
3001
|
/**
|
|
3002
3002
|
* @link https://nodejs.org/api/fs.html#fspromisesrealpathpath-options
|
|
3003
3003
|
*/
|
|
3004
3004
|
const realpath = quansync$1({
|
|
3005
|
-
sync:
|
|
3006
|
-
async:
|
|
3005
|
+
sync: fs$1.realpathSync,
|
|
3006
|
+
async: fs$1.promises.realpath
|
|
3007
3007
|
});
|
|
3008
3008
|
/**
|
|
3009
3009
|
* @link https://nodejs.org/api/fs.html#fspromisesreadlinkpath-options
|
|
3010
3010
|
*/
|
|
3011
3011
|
const readlink = quansync$1({
|
|
3012
|
-
sync:
|
|
3013
|
-
async:
|
|
3012
|
+
sync: fs$1.readlinkSync,
|
|
3013
|
+
async: fs$1.promises.readlink
|
|
3014
3014
|
});
|
|
3015
3015
|
/**
|
|
3016
3016
|
* @link https://nodejs.org/api/fs.html#fspromisessymlinktarget-path-type
|
|
3017
3017
|
*/
|
|
3018
3018
|
const symlink = quansync$1({
|
|
3019
|
-
sync:
|
|
3020
|
-
async:
|
|
3019
|
+
sync: fs$1.symlinkSync,
|
|
3020
|
+
async: fs$1.promises.symlink
|
|
3021
3021
|
});
|
|
3022
3022
|
/**
|
|
3023
3023
|
* @link https://nodejs.org/api/fs.html#fspromiseschownpath-uid-gid
|
|
3024
3024
|
*/
|
|
3025
3025
|
const chown = quansync$1({
|
|
3026
|
-
sync:
|
|
3027
|
-
async:
|
|
3026
|
+
sync: fs$1.chownSync,
|
|
3027
|
+
async: fs$1.promises.chown
|
|
3028
3028
|
});
|
|
3029
3029
|
/**
|
|
3030
3030
|
* @link https://nodejs.org/api/fs.html#fspromiseslchownpath-uid-gid
|
|
3031
3031
|
*/
|
|
3032
3032
|
const lchown = quansync$1({
|
|
3033
|
-
sync:
|
|
3034
|
-
async:
|
|
3033
|
+
sync: fs$1.lchownSync,
|
|
3034
|
+
async: fs$1.promises.lchown
|
|
3035
3035
|
});
|
|
3036
3036
|
/**
|
|
3037
3037
|
* @link https://nodejs.org/api/fs.html#fspromiseschmodpath-mode
|
|
3038
3038
|
*/
|
|
3039
3039
|
const chmod$1 = quansync$1({
|
|
3040
|
-
sync:
|
|
3041
|
-
async:
|
|
3040
|
+
sync: fs$1.chmodSync,
|
|
3041
|
+
async: fs$1.promises.chmod
|
|
3042
3042
|
});
|
|
3043
3043
|
/**
|
|
3044
3044
|
* @link https://nodejs.org/api/fs.html#fspromisesutimespath-atime-mtime
|
|
3045
3045
|
*/
|
|
3046
3046
|
const utimes = quansync$1({
|
|
3047
|
-
sync:
|
|
3048
|
-
async:
|
|
3047
|
+
sync: fs$1.utimesSync,
|
|
3048
|
+
async: fs$1.promises.utimes
|
|
3049
3049
|
});
|
|
3050
3050
|
/**
|
|
3051
3051
|
* @link https://nodejs.org/api/fs.html#fspromiseslutimespath-atime-mtime
|
|
3052
3052
|
*/
|
|
3053
3053
|
const lutimes = quansync$1({
|
|
3054
|
-
sync:
|
|
3055
|
-
async:
|
|
3054
|
+
sync: fs$1.lutimesSync,
|
|
3055
|
+
async: fs$1.promises.lutimes
|
|
3056
3056
|
});
|
|
3057
3057
|
/**
|
|
3058
3058
|
* @link https://nodejs.org/api/fs.html#fspromisesmkdtempprefix-options
|
|
3059
3059
|
*/
|
|
3060
3060
|
const mkdtemp$1 = quansync$1({
|
|
3061
|
-
sync:
|
|
3062
|
-
async:
|
|
3061
|
+
sync: fs$1.mkdtempSync,
|
|
3062
|
+
async: fs$1.promises.mkdtemp
|
|
3063
3063
|
});
|
|
3064
3064
|
|
|
3065
3065
|
//#endregion
|
|
@@ -3663,7 +3663,7 @@ async function nativeImport(id) {
|
|
|
3663
3663
|
return mod.default || mod;
|
|
3664
3664
|
}
|
|
3665
3665
|
async function unrunImport(id) {
|
|
3666
|
-
const { unrun } = await import("./dist-
|
|
3666
|
+
const { unrun } = await import("./dist-CFTDWtv2.js");
|
|
3667
3667
|
const { module } = await unrun({ path: pathToFileURL(id).href });
|
|
3668
3668
|
return module;
|
|
3669
3669
|
}
|
|
@@ -4727,7 +4727,7 @@ async function resolveInputOptions(config, format, configFiles, bundle, cjsDts,
|
|
|
4727
4727
|
if (nodeProtocol) plugins.push(NodeProtocolPlugin(nodeProtocol));
|
|
4728
4728
|
if (config.pkg || config.deps.skipNodeModulesBundle) plugins.push(DepPlugin(config));
|
|
4729
4729
|
if (dts) {
|
|
4730
|
-
const { dts: dtsPlugin } = await import("./dist-
|
|
4730
|
+
const { dts: dtsPlugin } = await import("./dist-DNcnO8LL.js");
|
|
4731
4731
|
const options = {
|
|
4732
4732
|
tsconfig,
|
|
4733
4733
|
...dts
|
|
@@ -5,7 +5,7 @@ import { spawn } from "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 fs, { existsSync } from "node:fs";
|
|
9
9
|
import { Buffer } from "node:buffer";
|
|
10
10
|
import crypto from "node:crypto";
|
|
11
11
|
|
|
@@ -55,7 +55,7 @@ function resolveOptions(options = {}) {
|
|
|
55
55
|
inputOptions: options.inputOptions,
|
|
56
56
|
outputOptions: options.outputOptions
|
|
57
57
|
};
|
|
58
|
-
if (!
|
|
58
|
+
if (!fs.existsSync(resolvedOptions.path)) throw new Error(`[unrun] File not found: ${resolvedOptions.path}`);
|
|
59
59
|
if (!new Set([
|
|
60
60
|
"none",
|
|
61
61
|
"jiti",
|
|
@@ -269,7 +269,7 @@ function createJsonLoader() {
|
|
|
269
269
|
let isRequire = false;
|
|
270
270
|
try {
|
|
271
271
|
if (importer) {
|
|
272
|
-
const src =
|
|
272
|
+
const src = fs.readFileSync(importer, "utf8");
|
|
273
273
|
const escaped = source.replaceAll(/[.*+?^${}()|[\]\\]/g, (m) => `\\${m}`);
|
|
274
274
|
const pattern = String.raw`\brequire\s*\(\s*['"]${escaped}['"]\s*\)`;
|
|
275
275
|
isRequire = new RegExp(pattern).test(src);
|
|
@@ -282,7 +282,7 @@ function createJsonLoader() {
|
|
|
282
282
|
handler(id) {
|
|
283
283
|
try {
|
|
284
284
|
const realId = id.replace(/\?unrun-json\.(?:mjs|cjs)$/, "");
|
|
285
|
-
const src =
|
|
285
|
+
const src = fs.readFileSync(realId, "utf8");
|
|
286
286
|
const data = JSON.parse(src);
|
|
287
287
|
const jsonLiteral = JSON.stringify(data);
|
|
288
288
|
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` };
|
|
@@ -376,7 +376,7 @@ function createRequireResolveFix(options) {
|
|
|
376
376
|
".cjs"
|
|
377
377
|
]) {
|
|
378
378
|
const testPath = path.resolve(baseDir, id + ext);
|
|
379
|
-
if (
|
|
379
|
+
if (fs.existsSync(testPath)) return JSON.stringify(testPath);
|
|
380
380
|
}
|
|
381
381
|
const resolvedPath = path.resolve(baseDir, id);
|
|
382
382
|
return JSON.stringify(resolvedPath);
|
|
@@ -417,7 +417,7 @@ function createSourceContextShimsPlugin() {
|
|
|
417
417
|
const normalizedPhysicalId = path.normalize(physicalId);
|
|
418
418
|
let code;
|
|
419
419
|
try {
|
|
420
|
-
code =
|
|
420
|
+
code = fs.readFileSync(normalizedPhysicalId, "utf8");
|
|
421
421
|
} catch {
|
|
422
422
|
return null;
|
|
423
423
|
}
|
|
@@ -659,7 +659,7 @@ function cleanModule(moduleUrl, options) {
|
|
|
659
659
|
try {
|
|
660
660
|
if (moduleUrl.startsWith("file://")) {
|
|
661
661
|
const filePath = new URL(moduleUrl);
|
|
662
|
-
|
|
662
|
+
fs.unlinkSync(filePath);
|
|
663
663
|
}
|
|
664
664
|
} catch (error) {
|
|
665
665
|
if (error.code !== "ENOENT") throw error;
|
|
@@ -683,14 +683,14 @@ function writeModule(code, options) {
|
|
|
683
683
|
const projectNodeModules = path.join(process.cwd(), "node_modules");
|
|
684
684
|
const outDir = path.join(projectNodeModules, ".unrun");
|
|
685
685
|
const outFile = path.join(outDir, fname);
|
|
686
|
-
if (!
|
|
687
|
-
|
|
688
|
-
|
|
686
|
+
if (!fs.existsSync(outFile)) try {
|
|
687
|
+
fs.mkdirSync(outDir, { recursive: true });
|
|
688
|
+
fs.writeFileSync(outFile, code, "utf8");
|
|
689
689
|
} catch {
|
|
690
690
|
const fallbackDir = path.join(tmpdir(), "unrun-cache");
|
|
691
691
|
const fallbackFile = path.join(fallbackDir, fname);
|
|
692
|
-
|
|
693
|
-
|
|
692
|
+
fs.mkdirSync(fallbackDir, { recursive: true });
|
|
693
|
+
fs.writeFileSync(fallbackFile, code, "utf8");
|
|
694
694
|
moduleUrl = pathToFileURL(fallbackFile).href;
|
|
695
695
|
}
|
|
696
696
|
moduleUrl = moduleUrl || pathToFileURL(outFile).href;
|
|
@@ -8,7 +8,7 @@ import path, { dirname, extname } from "node:path";
|
|
|
8
8
|
import { importerId, include } from "@voidzero-dev/vite-plus-core/rolldown/filter";
|
|
9
9
|
import nativeFs from "fs";
|
|
10
10
|
import path$1 from "path";
|
|
11
|
-
import
|
|
11
|
+
import fs from "node:fs";
|
|
12
12
|
import { ResolverFactory, isolatedDeclarationSync } from "@voidzero-dev/vite-plus-core/rolldown/experimental";
|
|
13
13
|
import he from "os";
|
|
14
14
|
|
|
@@ -30426,11 +30426,11 @@ function h(e) {
|
|
|
30426
30426
|
}
|
|
30427
30427
|
o(h, "slash");
|
|
30428
30428
|
const z = o((e) => {
|
|
30429
|
-
const t =
|
|
30429
|
+
const t = fs[e];
|
|
30430
30430
|
return (s, ...n) => {
|
|
30431
30431
|
const l = `${e}:${n.join(":")}`;
|
|
30432
30432
|
let i = s == null ? void 0 : s.get(l);
|
|
30433
|
-
return i === void 0 && (i = Reflect.apply(t,
|
|
30433
|
+
return i === void 0 && (i = Reflect.apply(t, fs, n), s?.set(l, i)), i;
|
|
30434
30434
|
};
|
|
30435
30435
|
}, "cacheFs"), I = z("existsSync"), Be = z("readFileSync"), R = z("statSync"), ie = o((e, t, s) => {
|
|
30436
30436
|
for (;;) {
|
package/dist/tsdown/index.js
CHANGED
|
@@ -2,7 +2,7 @@ import { l as globalLogger } from "./main-B3qcLRNf.js";
|
|
|
2
2
|
import "./node-Ba_UB_xO.js";
|
|
3
3
|
import { t as enableDebug } from "./debug-BUVkFfEZ-D3UMJnif.js";
|
|
4
4
|
import "./filename-CPj0AKvV.js";
|
|
5
|
-
import { i as resolveUserConfig, n as buildWithConfigs, r as mergeConfig, t as build$1 } from "./build-BjQ7Rt90-
|
|
5
|
+
import { i as resolveUserConfig, n as buildWithConfigs, r as mergeConfig, t as build$1 } from "./build-BjQ7Rt90-tMPZTflz.js";
|
|
6
6
|
import * as Rolldown from "@voidzero-dev/vite-plus-core/rolldown";
|
|
7
7
|
|
|
8
8
|
//#region ../../node_modules/.pnpm/tsdown@0.21.0-beta.2_@arethetypeswrong+core@0.18.2_@typescript+native-preview@7.0.0-dev_d0d0ed2124937ee9dd401a280008a3bf/node_modules/tsdown/dist/config.mjs
|
package/dist/tsdown/run.js
CHANGED
|
@@ -496,7 +496,7 @@ cli.command("[...files]", "Bundle files", {
|
|
|
496
496
|
}).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("--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) => {
|
|
497
497
|
globalLogger.level = flags.logLevel || "info";
|
|
498
498
|
globalLogger.info(`tsdown ${dim`v${version}`} powered by rolldown ${dim`v${VERSION}`}`);
|
|
499
|
-
const { build } = await import("./build-2oRq4mfQ-
|
|
499
|
+
const { build } = await import("./build-2oRq4mfQ-YC_gzK3u.js");
|
|
500
500
|
if (input.length > 0) flags.entry = input;
|
|
501
501
|
await build(flags);
|
|
502
502
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@voidzero-dev/vite-plus-core",
|
|
3
|
-
"version": "0.1.0",
|
|
3
|
+
"version": "0.1.1-alpha.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist"
|
|
@@ -117,8 +117,8 @@
|
|
|
117
117
|
"tinyglobby": "^0.2.15",
|
|
118
118
|
"tree-kill": "^1.2.2",
|
|
119
119
|
"tsdown": "^0.21.0-beta.2",
|
|
120
|
-
"
|
|
121
|
-
"
|
|
120
|
+
"rolldown": "1.0.0-rc.6",
|
|
121
|
+
"vite": "npm:@voidzero-dev/vite-plus-core@0.1.1-alpha.0"
|
|
122
122
|
},
|
|
123
123
|
"peerDependencies": {
|
|
124
124
|
"@arethetypeswrong/core": "^0.18.1",
|