@voidzero-dev/vite-plus-core 0.1.12-alpha.2 → 0.1.12
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-Bj4wFOdV.js → build-CGB4R_gC-Dyc6Tj-y.js} +2 -2
- package/dist/tsdown/{build-CpOl_krN-DrIRjiqJ.js → build-Dh89hfzV-CSN02Okj.js} +149 -108
- package/dist/tsdown/{debug-C4FmgzkJ-BcERCViE.js → debug-C4FmgzkJ-58KiZwv5.js} +2 -2
- package/dist/tsdown/{detect-J1_Vd1yf-BnOcNWHf.js → detect-DN3DXXYt-hqP1wKSG.js} +2 -8
- package/dist/tsdown/{dist-DceV6s_v.js → dist-BWGgEAtQ.js} +12 -12
- package/dist/tsdown/{dist-CtF_Stv5.js → dist-dJp148cE.js} +3 -3
- package/dist/tsdown/index-types.d.ts +6 -6
- package/dist/tsdown/index.js +4 -4
- package/dist/tsdown/{main-4fHWraTN.js → main-BR1iuPKy.js} +114 -133
- package/dist/tsdown/run.js +5 -5
- package/package.json +6 -6
- package/dist/tsdown/index-node-Bpsmc0eX-CRDsfhY9.js +0 -249
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import "./main-
|
|
1
|
+
import "./main-BR1iuPKy.js";
|
|
2
2
|
import "./node-B3Gdtau1.js";
|
|
3
|
-
import { t as build$1 } from "./build-
|
|
3
|
+
import { t as build$1 } from "./build-Dh89hfzV-CSN02Okj.js";
|
|
4
4
|
import "./filename-UU7z2A9Z.js";
|
|
5
5
|
export { build$1 as build };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { r as __toESM, t as __commonJSMin } from "./chunk-CSNpwdVU.js";
|
|
2
|
-
import { C as resolveComma, E as toArray, S as promiseWithResolvers, T as slash, _ as debounce, a as createLogger, b as noop, c as globalLogger, d as bold, f as dim, g as yellow, h as underline, i as LogLevels, l as prettyFormat, m as red, n as
|
|
2
|
+
import { C as resolveComma, E as toArray, S as promiseWithResolvers, T as slash, _ as debounce, a as createLogger, b as noop, c as globalLogger, d as bold, f as dim, g as yellow, h as underline, i as LogLevels, l as prettyFormat, m as red, n as z, o as generateColor, p as green, r as version, s as getNameLabel, t as R, u as blue, v as importWithError, w as resolveRegex, x as pkgExists, y as matchPattern } from "./main-BR1iuPKy.js";
|
|
3
3
|
import { t as createDebug } from "./node-B3Gdtau1.js";
|
|
4
4
|
import { i as RE_JS, n as RE_DTS, o as RE_NODE_MODULES$1, t as RE_CSS } from "./filename-UU7z2A9Z.js";
|
|
5
5
|
import module$1, { builtinModules, createRequire, isBuiltin } from "node:module";
|
|
@@ -7,21 +7,21 @@ import { pathToFileURL } from "node:url";
|
|
|
7
7
|
import process$1, { env } from "node:process";
|
|
8
8
|
import readline from "node:readline";
|
|
9
9
|
import { formatWithOptions, inspect, promisify } from "node:util";
|
|
10
|
-
import { createRequire as createRequire$1 } from "module";
|
|
11
10
|
import path, { dirname, isAbsolute, join, parse, resolve } from "node:path";
|
|
12
11
|
import { VERSION, build, watch } from "@voidzero-dev/vite-plus-core/rolldown";
|
|
13
|
-
import { access, chmod, cp, mkdir, mkdtemp, readFile, rm, stat, writeFile } from "node:fs/promises";
|
|
12
|
+
import { access, chmod, cp, mkdir, mkdtemp, readFile, readdir, rm, stat, writeFile } from "node:fs/promises";
|
|
14
13
|
import { and, id, importerId, include } from "@voidzero-dev/vite-plus-core/rolldown/filter";
|
|
15
14
|
import * as nativeFs$1 from "fs";
|
|
16
15
|
import nativeFs from "fs";
|
|
17
16
|
import path$1, { basename, dirname as dirname$1, normalize as normalize$1, posix, relative, resolve as resolve$1, sep } from "path";
|
|
18
17
|
import { fileURLToPath as fileURLToPath$1 } from "url";
|
|
18
|
+
import { createRequire as createRequire$1 } from "module";
|
|
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";
|
|
24
|
-
//#region ../../node_modules/.pnpm/tsdown@0.21.
|
|
24
|
+
//#region ../../node_modules/.pnpm/tsdown@0.21.3_@arethetypeswrong+core@0.18.2_@tsdown+css@0.21.3_@tsdown+exe@0.21.3_@type_38be87ebcd54001dc11621ca3e3d3fad/node_modules/tsdown/dist/fs-Dd6Htx2P.mjs
|
|
25
25
|
function fsExists(path) {
|
|
26
26
|
return access(path).then(() => true, () => false);
|
|
27
27
|
}
|
|
@@ -64,7 +64,7 @@ function stripExtname(filePath) {
|
|
|
64
64
|
return filePath.slice(0, -ext.length);
|
|
65
65
|
}
|
|
66
66
|
//#endregion
|
|
67
|
-
//#region ../../node_modules/.pnpm/tsdown@0.21.
|
|
67
|
+
//#region ../../node_modules/.pnpm/tsdown@0.21.3_@arethetypeswrong+core@0.18.2_@tsdown+css@0.21.3_@tsdown+exe@0.21.3_@type_38be87ebcd54001dc11621ca3e3d3fad/node_modules/tsdown/dist/format-DPVBd8E4.mjs
|
|
68
68
|
const shimFile = path.resolve(import.meta.dirname, "..", "esm-shims.js");
|
|
69
69
|
function getShimsInject(format, platform) {
|
|
70
70
|
if (format === "es" && platform === "node") return {
|
|
@@ -2917,87 +2917,87 @@ quansync$1({
|
|
|
2917
2917
|
*/
|
|
2918
2918
|
const quansync = quansync$1;
|
|
2919
2919
|
quansync$1({
|
|
2920
|
-
sync:
|
|
2921
|
-
async:
|
|
2920
|
+
sync: fs$1.readFileSync,
|
|
2921
|
+
async: fs$1.promises.readFile
|
|
2922
2922
|
});
|
|
2923
2923
|
quansync$1({
|
|
2924
|
-
sync:
|
|
2925
|
-
async:
|
|
2924
|
+
sync: fs$1.writeFileSync,
|
|
2925
|
+
async: fs$1.promises.writeFile
|
|
2926
2926
|
});
|
|
2927
2927
|
quansync$1({
|
|
2928
|
-
sync:
|
|
2929
|
-
async:
|
|
2928
|
+
sync: fs$1.unlinkSync,
|
|
2929
|
+
async: fs$1.promises.unlink
|
|
2930
2930
|
});
|
|
2931
2931
|
quansync$1({
|
|
2932
|
-
sync:
|
|
2933
|
-
async:
|
|
2932
|
+
sync: fs$1.accessSync,
|
|
2933
|
+
async: fs$1.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: fs$1.statSync,
|
|
2940
|
+
async: fs$1.promises.stat
|
|
2941
2941
|
});
|
|
2942
2942
|
const lstat = quansync$1({
|
|
2943
|
-
sync:
|
|
2944
|
-
async:
|
|
2943
|
+
sync: fs$1.lstatSync,
|
|
2944
|
+
async: fs$1.promises.lstat
|
|
2945
2945
|
});
|
|
2946
2946
|
quansync$1({
|
|
2947
|
-
sync:
|
|
2948
|
-
async:
|
|
2947
|
+
sync: fs$1.copyFileSync,
|
|
2948
|
+
async: fs$1.promises.copyFile
|
|
2949
2949
|
});
|
|
2950
2950
|
quansync$1({
|
|
2951
|
-
sync:
|
|
2952
|
-
async:
|
|
2951
|
+
sync: fs$1.rmSync,
|
|
2952
|
+
async: fs$1.promises.rm
|
|
2953
2953
|
});
|
|
2954
2954
|
quansync$1({
|
|
2955
|
-
sync:
|
|
2956
|
-
async:
|
|
2955
|
+
sync: fs$1.mkdirSync,
|
|
2956
|
+
async: fs$1.promises.mkdir
|
|
2957
2957
|
});
|
|
2958
2958
|
quansync$1({
|
|
2959
|
-
sync:
|
|
2960
|
-
async:
|
|
2959
|
+
sync: fs$1.renameSync,
|
|
2960
|
+
async: fs$1.promises.rename
|
|
2961
2961
|
});
|
|
2962
2962
|
quansync$1({
|
|
2963
|
-
sync:
|
|
2964
|
-
async:
|
|
2963
|
+
sync: fs$1.readdirSync,
|
|
2964
|
+
async: fs$1.promises.readdir
|
|
2965
2965
|
});
|
|
2966
2966
|
quansync$1({
|
|
2967
|
-
sync:
|
|
2968
|
-
async:
|
|
2967
|
+
sync: fs$1.realpathSync,
|
|
2968
|
+
async: fs$1.promises.realpath
|
|
2969
2969
|
});
|
|
2970
2970
|
quansync$1({
|
|
2971
|
-
sync:
|
|
2972
|
-
async:
|
|
2971
|
+
sync: fs$1.readlinkSync,
|
|
2972
|
+
async: fs$1.promises.readlink
|
|
2973
2973
|
});
|
|
2974
2974
|
quansync$1({
|
|
2975
|
-
sync:
|
|
2976
|
-
async:
|
|
2975
|
+
sync: fs$1.symlinkSync,
|
|
2976
|
+
async: fs$1.promises.symlink
|
|
2977
2977
|
});
|
|
2978
2978
|
quansync$1({
|
|
2979
|
-
sync:
|
|
2980
|
-
async:
|
|
2979
|
+
sync: fs$1.chownSync,
|
|
2980
|
+
async: fs$1.promises.chown
|
|
2981
2981
|
});
|
|
2982
2982
|
quansync$1({
|
|
2983
|
-
sync:
|
|
2984
|
-
async:
|
|
2983
|
+
sync: fs$1.lchownSync,
|
|
2984
|
+
async: fs$1.promises.lchown
|
|
2985
2985
|
});
|
|
2986
2986
|
quansync$1({
|
|
2987
|
-
sync:
|
|
2988
|
-
async:
|
|
2987
|
+
sync: fs$1.chmodSync,
|
|
2988
|
+
async: fs$1.promises.chmod
|
|
2989
2989
|
});
|
|
2990
2990
|
quansync$1({
|
|
2991
|
-
sync:
|
|
2992
|
-
async:
|
|
2991
|
+
sync: fs$1.utimesSync,
|
|
2992
|
+
async: fs$1.promises.utimes
|
|
2993
2993
|
});
|
|
2994
2994
|
quansync$1({
|
|
2995
|
-
sync:
|
|
2996
|
-
async:
|
|
2995
|
+
sync: fs$1.lutimesSync,
|
|
2996
|
+
async: fs$1.promises.lutimes
|
|
2997
2997
|
});
|
|
2998
2998
|
quansync$1({
|
|
2999
|
-
sync:
|
|
3000
|
-
async:
|
|
2999
|
+
sync: fs$1.mkdtempSync,
|
|
3000
|
+
async: fs$1.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
|
|
@@ -3076,7 +3076,7 @@ function createConfigCoreLoader(options) {
|
|
|
3076
3076
|
};
|
|
3077
3077
|
}
|
|
3078
3078
|
//#endregion
|
|
3079
|
-
//#region ../../node_modules/.pnpm/tsdown@0.21.
|
|
3079
|
+
//#region ../../node_modules/.pnpm/tsdown@0.21.3_@arethetypeswrong+core@0.18.2_@tsdown+css@0.21.3_@tsdown+exe@0.21.3_@type_38be87ebcd54001dc11621ca3e3d3fad/node_modules/tsdown/dist/options-CoPog4o1.mjs
|
|
3080
3080
|
const __cjs_require$1 = createRequire(import.meta.url);
|
|
3081
3081
|
const picomatch = __cjs_require$1("./npm_entry_picomatch.cjs");
|
|
3082
3082
|
const satisfies$1 = __cjs_require$1("./npm_entry_semver_functions_satisfies.cjs");
|
|
@@ -3148,7 +3148,7 @@ function isGlobEntry(entry) {
|
|
|
3148
3148
|
return Object.keys(entry).some((key) => key.includes("*"));
|
|
3149
3149
|
}
|
|
3150
3150
|
async function resolveObjectEntry(entries, cwd) {
|
|
3151
|
-
|
|
3151
|
+
const entry = Object.fromEntries((await Promise.all(Object.entries(entries).map(async ([key, value]) => {
|
|
3152
3152
|
if (!key.includes("*")) {
|
|
3153
3153
|
if (Array.isArray(value)) throw new TypeError(`Object entry "${key}" cannot have an array value when the key is not a glob pattern.`);
|
|
3154
3154
|
return [[key, value]];
|
|
@@ -3168,7 +3168,8 @@ async function resolveObjectEntry(entries, cwd) {
|
|
|
3168
3168
|
}
|
|
3169
3169
|
if (valueGlobBase === void 0) throw new Error(`Cannot determine base directory for value glob patterns of key "${key}".`);
|
|
3170
3170
|
return files.map((file) => [slash(key.replaceAll("*", stripExtname(path.relative(valueGlobBase, file)))), path.resolve(cwd, file)]);
|
|
3171
|
-
}))).flat())
|
|
3171
|
+
}))).flat());
|
|
3172
|
+
return [entry, lowestCommonAncestor(...Object.values(entry))];
|
|
3172
3173
|
}
|
|
3173
3174
|
async function resolveArrayEntry(entries, cwd, root) {
|
|
3174
3175
|
const stringEntries = [];
|
|
@@ -3249,7 +3250,7 @@ async function buildSingleExe(config, bundledFile, outputFile, executable, targe
|
|
|
3249
3250
|
await writeFile(seaConfigPath, JSON.stringify(seaConfig));
|
|
3250
3251
|
debug$3$2("Wrote sea-config.json: %O -> %s", seaConfig, seaConfigPath);
|
|
3251
3252
|
debug$3$2("Running: %s --build-sea %s", process$1.execPath, seaConfigPath);
|
|
3252
|
-
await
|
|
3253
|
+
await R(process$1.execPath, ["--build-sea", seaConfigPath], {
|
|
3253
3254
|
nodeOptions: { stdio: [
|
|
3254
3255
|
"ignore",
|
|
3255
3256
|
"ignore",
|
|
@@ -3262,7 +3263,7 @@ async function buildSingleExe(config, bundledFile, outputFile, executable, targe
|
|
|
3262
3263
|
else await fsRemove(tempDir);
|
|
3263
3264
|
}
|
|
3264
3265
|
if ((target?.platform || process$1.platform) === "darwin") try {
|
|
3265
|
-
await
|
|
3266
|
+
await R("codesign", [
|
|
3266
3267
|
"--sign",
|
|
3267
3268
|
"-",
|
|
3268
3269
|
outputPath
|
|
@@ -3638,7 +3639,7 @@ async function nativeImport(id) {
|
|
|
3638
3639
|
return mod.default || mod;
|
|
3639
3640
|
}
|
|
3640
3641
|
async function unrunImport(id) {
|
|
3641
|
-
const { unrun } = await import("./dist-
|
|
3642
|
+
const { unrun } = await import("./dist-BWGgEAtQ.js");
|
|
3642
3643
|
const { module } = await unrun({ path: pathToFileURL(id).href });
|
|
3643
3644
|
return module;
|
|
3644
3645
|
}
|
|
@@ -3831,7 +3832,51 @@ function filterConfig(filter, configCwd, name) {
|
|
|
3831
3832
|
return toArray(filter).some((value) => name && name === value || cwd === value);
|
|
3832
3833
|
}
|
|
3833
3834
|
//#endregion
|
|
3834
|
-
//#region ../../node_modules/.pnpm/tsdown@0.21.
|
|
3835
|
+
//#region ../../node_modules/.pnpm/tsdown@0.21.3_@arethetypeswrong+core@0.18.2_@tsdown+css@0.21.3_@tsdown+exe@0.21.3_@type_38be87ebcd54001dc11621ca3e3d3fad/node_modules/tsdown/dist/watch-CS1xCZMR.mjs
|
|
3836
|
+
async function copy(options) {
|
|
3837
|
+
if (!options.copy) return;
|
|
3838
|
+
const resolved = await resolveCopyEntries(options);
|
|
3839
|
+
await Promise.all(resolved.map(({ from, to, verbose }) => {
|
|
3840
|
+
if (verbose) options.logger.info(options.nameLabel, `Copying files from ${path.relative(options.cwd, from)} to ${path.relative(options.cwd, to)}`);
|
|
3841
|
+
return fsCopy(from, to);
|
|
3842
|
+
}));
|
|
3843
|
+
}
|
|
3844
|
+
async function resolveCopyEntries(options) {
|
|
3845
|
+
const copy = toArray(typeof options.copy === "function" ? await options.copy(options) : options.copy);
|
|
3846
|
+
if (!copy.length) return [];
|
|
3847
|
+
const resolved = (await Promise.all(copy.map(async (entry) => {
|
|
3848
|
+
if (typeof entry === "string") entry = { from: [entry] };
|
|
3849
|
+
let from = toArray(entry.from);
|
|
3850
|
+
if (from.some((f) => isDynamicPattern(f))) from = await glob(from, {
|
|
3851
|
+
cwd: options.cwd,
|
|
3852
|
+
onlyFiles: true,
|
|
3853
|
+
expandDirectories: false
|
|
3854
|
+
});
|
|
3855
|
+
return from.map((file) => resolveCopyEntry({
|
|
3856
|
+
...entry,
|
|
3857
|
+
from: file
|
|
3858
|
+
}, options.cwd, options.outDir));
|
|
3859
|
+
}))).flat();
|
|
3860
|
+
if (!resolved.length) options.logger.warn(options.nameLabel, `No files matched for copying.`);
|
|
3861
|
+
return resolved;
|
|
3862
|
+
}
|
|
3863
|
+
function resolveCopyEntry(entry, cwd, outDir) {
|
|
3864
|
+
const { flatten = true, rename } = entry;
|
|
3865
|
+
const from = path.resolve(cwd, entry.from);
|
|
3866
|
+
const to = entry.to ? path.resolve(cwd, entry.to) : outDir;
|
|
3867
|
+
const { base, dir } = path.parse(path.relative(cwd, from));
|
|
3868
|
+
const destFolder = flatten || !flatten && !dir ? to : dir.replace(dir.split(path.sep)[0], to);
|
|
3869
|
+
const dest = path.join(destFolder, rename ? renameTarget(base, rename, from) : base);
|
|
3870
|
+
return {
|
|
3871
|
+
...entry,
|
|
3872
|
+
from,
|
|
3873
|
+
to: dest
|
|
3874
|
+
};
|
|
3875
|
+
}
|
|
3876
|
+
function renameTarget(target, rename, src) {
|
|
3877
|
+
const parsedPath = path.parse(target);
|
|
3878
|
+
return typeof rename === "string" ? rename : rename(parsedPath.name, parsedPath.ext.replace(".", ""), src);
|
|
3879
|
+
}
|
|
3835
3880
|
/**
|
|
3836
3881
|
* The `node:` protocol was added in Node.js v14.18.0.
|
|
3837
3882
|
* @see https://nodejs.org/api/esm.html#node-imports
|
|
@@ -3977,11 +4022,15 @@ function WatchPlugin(configFiles, { config, chunks }) {
|
|
|
3977
4022
|
inputOptions.watch.exclude = toArray(inputOptions.watch.exclude);
|
|
3978
4023
|
inputOptions.watch.exclude.push(...config.ignoreWatch);
|
|
3979
4024
|
} : void 0,
|
|
3980
|
-
buildStart() {
|
|
4025
|
+
async buildStart() {
|
|
3981
4026
|
config.tsconfig && this.addWatchFile(config.tsconfig);
|
|
3982
4027
|
for (const file of configFiles) this.addWatchFile(file);
|
|
3983
4028
|
if (typeof config.watch !== "boolean") for (const file of resolveComma(toArray(config.watch))) this.addWatchFile(file);
|
|
3984
4029
|
if (config.pkg) this.addWatchFile(config.pkg.packageJsonPath);
|
|
4030
|
+
if (config.copy) {
|
|
4031
|
+
const resolvedEntries = await resolveCopyEntries(config);
|
|
4032
|
+
for (const entry of resolvedEntries) this.addWatchFile(entry.from);
|
|
4033
|
+
}
|
|
3985
4034
|
},
|
|
3986
4035
|
generateBundle: {
|
|
3987
4036
|
order: "post",
|
|
@@ -4160,7 +4209,7 @@ var Hookable = class {
|
|
|
4160
4209
|
}
|
|
4161
4210
|
};
|
|
4162
4211
|
//#endregion
|
|
4163
|
-
//#region ../../node_modules/.pnpm/tsdown@0.21.
|
|
4212
|
+
//#region ../../node_modules/.pnpm/tsdown@0.21.3_@arethetypeswrong+core@0.18.2_@tsdown+css@0.21.3_@tsdown+exe@0.21.3_@type_38be87ebcd54001dc11621ca3e3d3fad/node_modules/tsdown/dist/build-Dh89hfzV.mjs
|
|
4164
4213
|
const __cjs_require = createRequire(import.meta.url);
|
|
4165
4214
|
const satisfies = __cjs_require("./npm_entry_semver_functions_satisfies.cjs");
|
|
4166
4215
|
const coerce = __cjs_require("./npm_entry_semver_functions_coerce.cjs");
|
|
@@ -4251,49 +4300,6 @@ function warnLegacyCJS(config) {
|
|
|
4251
4300
|
return version && satisfies(version, "^20.19.0 || >=22.12.0");
|
|
4252
4301
|
})) config.logger.warnOnce("We recommend using the ESM format instead of CommonJS.\nThe ESM format is compatible with modern platforms and runtimes, and most new libraries are now distributed only in ESM format.\nLearn more at https://nodejs.org/en/learn/modules/publishing-a-package#how-did-we-get-here");
|
|
4253
4302
|
}
|
|
4254
|
-
async function copy(options) {
|
|
4255
|
-
if (!options.copy) return;
|
|
4256
|
-
const copy = toArray(typeof options.copy === "function" ? await options.copy(options) : options.copy);
|
|
4257
|
-
if (!copy.length) return;
|
|
4258
|
-
const resolved = (await Promise.all(copy.map(async (entry) => {
|
|
4259
|
-
if (typeof entry === "string") entry = { from: [entry] };
|
|
4260
|
-
let from = toArray(entry.from);
|
|
4261
|
-
if (from.some((f) => isDynamicPattern(f))) from = await glob(from, {
|
|
4262
|
-
cwd: options.cwd,
|
|
4263
|
-
onlyFiles: true,
|
|
4264
|
-
expandDirectories: false
|
|
4265
|
-
});
|
|
4266
|
-
return from.map((file) => resolveCopyEntry({
|
|
4267
|
-
...entry,
|
|
4268
|
-
from: file
|
|
4269
|
-
}));
|
|
4270
|
-
}))).flat();
|
|
4271
|
-
if (!resolved.length) {
|
|
4272
|
-
options.logger.warn(options.nameLabel, `No files matched for copying.`);
|
|
4273
|
-
return;
|
|
4274
|
-
}
|
|
4275
|
-
await Promise.all(resolved.map(({ from, to, verbose }) => {
|
|
4276
|
-
if (verbose) options.logger.info(options.nameLabel, `Copying files from ${path.relative(options.cwd, from)} to ${path.relative(options.cwd, to)}`);
|
|
4277
|
-
return fsCopy(from, to);
|
|
4278
|
-
}));
|
|
4279
|
-
function resolveCopyEntry(entry) {
|
|
4280
|
-
const { flatten = true, rename } = entry;
|
|
4281
|
-
const from = path.resolve(options.cwd, entry.from);
|
|
4282
|
-
const to = entry.to ? path.resolve(options.cwd, entry.to) : options.outDir;
|
|
4283
|
-
const { base, dir } = path.parse(path.relative(options.cwd, from));
|
|
4284
|
-
const destFolder = flatten || !flatten && !dir ? to : dir.replace(dir.split(path.sep)[0], to);
|
|
4285
|
-
const dest = path.join(destFolder, rename ? renameTarget(base, rename, from) : base);
|
|
4286
|
-
return {
|
|
4287
|
-
...entry,
|
|
4288
|
-
from,
|
|
4289
|
-
to: dest
|
|
4290
|
-
};
|
|
4291
|
-
}
|
|
4292
|
-
}
|
|
4293
|
-
function renameTarget(target, rename, src) {
|
|
4294
|
-
const parsedPath = path.parse(target);
|
|
4295
|
-
return typeof rename === "string" ? rename : rename(parsedPath.name, parsedPath.ext.replace(".", ""), src);
|
|
4296
|
-
}
|
|
4297
4303
|
async function startDevtoolsUI(config) {
|
|
4298
4304
|
const { start } = await importWithError("@vitejs/devtools/cli-commands");
|
|
4299
4305
|
await start({
|
|
@@ -4318,7 +4324,7 @@ function executeOnSuccess(config) {
|
|
|
4318
4324
|
if (!config.onSuccess) return;
|
|
4319
4325
|
const ab = new AbortController();
|
|
4320
4326
|
if (typeof config.onSuccess === "string") {
|
|
4321
|
-
const p =
|
|
4327
|
+
const p = z(config.onSuccess, [], { nodeOptions: {
|
|
4322
4328
|
shell: true,
|
|
4323
4329
|
stdio: "inherit",
|
|
4324
4330
|
cwd: config.cwd
|
|
@@ -4496,15 +4502,11 @@ async function bundleDone(bundleByPkg, bundle) {
|
|
|
4496
4502
|
async function packTarball(packageJsonPath) {
|
|
4497
4503
|
const pkgDir = path.dirname(packageJsonPath);
|
|
4498
4504
|
const destination = await mkdtemp(path.join(tmpdir(), "tsdown-pack-"));
|
|
4499
|
-
const
|
|
4505
|
+
const { detect } = await import("./detect-DN3DXXYt-hqP1wKSG.js");
|
|
4500
4506
|
try {
|
|
4501
4507
|
const detected = await detect({ cwd: pkgDir });
|
|
4502
4508
|
if (detected?.name === "deno") throw new Error(`Cannot pack tarball for Deno projects at ${pkgDir}`);
|
|
4503
|
-
return readFile(await pack(pkgDir,
|
|
4504
|
-
destination,
|
|
4505
|
-
packageManager: detected?.name,
|
|
4506
|
-
ignoreScripts: true
|
|
4507
|
-
}));
|
|
4509
|
+
return readFile(await pack(pkgDir, detected, destination, true));
|
|
4508
4510
|
} finally {
|
|
4509
4511
|
await fsRemove(destination);
|
|
4510
4512
|
}
|
|
@@ -4528,11 +4530,50 @@ function mergeInlinedDeps(bundles) {
|
|
|
4528
4530
|
if (!merged.has(pkgName)) merged.set(pkgName, /* @__PURE__ */ new Set());
|
|
4529
4531
|
for (const v of versions) merged.get(pkgName).add(v);
|
|
4530
4532
|
}
|
|
4531
|
-
if (!merged.size) return
|
|
4533
|
+
if (!merged.size) return;
|
|
4534
|
+
const sorted = [...merged.entries()].toSorted(([a], [b]) => a.localeCompare(b));
|
|
4532
4535
|
const result = {};
|
|
4533
|
-
for (const [pkgName, versions] of
|
|
4536
|
+
for (const [pkgName, versions] of sorted) result[pkgName] = versions.size === 1 ? [...versions][0] : [...versions].toSorted();
|
|
4534
4537
|
return result;
|
|
4535
4538
|
}
|
|
4539
|
+
async function pack(dir, pm, destination, ignoreScripts) {
|
|
4540
|
+
pm ||= {
|
|
4541
|
+
name: "npm",
|
|
4542
|
+
agent: "npm"
|
|
4543
|
+
};
|
|
4544
|
+
if (pm.name === "deno") throw new Error(`Cannot pack tarball for Deno projects at ${dir}`);
|
|
4545
|
+
const command = pm.name;
|
|
4546
|
+
const args = ["pack"];
|
|
4547
|
+
if (pm.name === "bun") args.unshift("pm");
|
|
4548
|
+
const outFile = path.join(destination, "package.tgz");
|
|
4549
|
+
if (destination) switch (pm.agent) {
|
|
4550
|
+
case "yarn":
|
|
4551
|
+
args.push("-f", outFile);
|
|
4552
|
+
break;
|
|
4553
|
+
case "yarn@berry":
|
|
4554
|
+
args.push("-o", outFile);
|
|
4555
|
+
break;
|
|
4556
|
+
case "bun":
|
|
4557
|
+
args.push("--destination", destination);
|
|
4558
|
+
break;
|
|
4559
|
+
default:
|
|
4560
|
+
args.push("--pack-destination", destination);
|
|
4561
|
+
break;
|
|
4562
|
+
}
|
|
4563
|
+
if (ignoreScripts) switch (pm.agent) {
|
|
4564
|
+
case "pnpm":
|
|
4565
|
+
args.push("--config.ignore-scripts=true");
|
|
4566
|
+
break;
|
|
4567
|
+
case "yarn@berry": break;
|
|
4568
|
+
default:
|
|
4569
|
+
args.push("--ignore-scripts");
|
|
4570
|
+
break;
|
|
4571
|
+
}
|
|
4572
|
+
const output = await R(command, args, { nodeOptions: { cwd: dir } });
|
|
4573
|
+
const tarballFile = await readdir(destination).then((files) => files.find((file) => file.endsWith(".tgz")));
|
|
4574
|
+
if (!tarballFile) throw new Error(`Failed to find packed tarball file in ${destination}. Command output:\n${JSON.stringify(output, null, 2)}`);
|
|
4575
|
+
return path.join(destination, tarballFile);
|
|
4576
|
+
}
|
|
4536
4577
|
function resolveJsOutputExtension(packageType, format, fixedExtension) {
|
|
4537
4578
|
switch (format) {
|
|
4538
4579
|
case "es": return !fixedExtension && packageType === "module" ? "js" : "mjs";
|
|
@@ -4597,7 +4638,7 @@ async function resolveInputOptions(config, format, configFiles, bundle, cjsDts,
|
|
|
4597
4638
|
if (nodeProtocol) plugins.push(NodeProtocolPlugin(nodeProtocol));
|
|
4598
4639
|
if (config.pkg || config.deps.skipNodeModulesBundle) plugins.push(DepPlugin(config, bundle));
|
|
4599
4640
|
if (dts) {
|
|
4600
|
-
const { dts: dtsPlugin } = await import("./dist-
|
|
4641
|
+
const { dts: dtsPlugin } = await import("./dist-dJp148cE.js");
|
|
4601
4642
|
const options = {
|
|
4602
4643
|
tsconfig,
|
|
4603
4644
|
...dts
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { C as resolveComma, E as toArray } from "./main-
|
|
1
|
+
import { C as resolveComma, E as toArray } from "./main-BR1iuPKy.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.3_@arethetypeswrong+core@0.18.2_@tsdown+css@0.21.3_@tsdown+exe@0.21.3_@type_38be87ebcd54001dc11621ca3e3d3fad/node_modules/tsdown/dist/debug-C4FmgzkJ.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.3_@arethetypeswrong+core@0.18.2_@tsdown+css@0.21.3_@tsdown+exe@0.21.3_@type_38be87ebcd54001dc11621ca3e3d3fad/node_modules/tsdown/dist/detect-DN3DXXYt.mjs
|
|
5
5
|
const AGENTS = [
|
|
6
6
|
"npm",
|
|
7
7
|
"yarn",
|
|
@@ -40,12 +40,6 @@ async function pathExists(path2, type) {
|
|
|
40
40
|
return false;
|
|
41
41
|
}
|
|
42
42
|
}
|
|
43
|
-
function getUserAgent() {
|
|
44
|
-
const userAgent = process.env.npm_config_user_agent;
|
|
45
|
-
if (!userAgent) return null;
|
|
46
|
-
const name = userAgent.split("/")[0];
|
|
47
|
-
return AGENTS.includes(name) ? name : null;
|
|
48
|
-
}
|
|
49
43
|
function* lookup(cwd = process.cwd()) {
|
|
50
44
|
let directory = path.resolve(cwd);
|
|
51
45
|
const { root } = path.parse(directory);
|
|
@@ -160,4 +154,4 @@ function isMetadataYarnClassic(metadataPath) {
|
|
|
160
154
|
return metadataPath.endsWith(".yarn_integrity");
|
|
161
155
|
}
|
|
162
156
|
//#endregion
|
|
163
|
-
export { detect
|
|
157
|
+
export { detect };
|
|
@@ -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 fs, { 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 (!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;
|
|
@@ -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 fs$1, { 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 = fs$1[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, fs$1, 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 (;;) {
|
|
@@ -2,7 +2,7 @@ import * as Rolldown from "@voidzero-dev/vite-plus-core/rolldown";
|
|
|
2
2
|
import { BuildOptions, ChecksOptions, ExternalOption, InputOptions, InternalModuleFormat, MinifyOptions, ModuleFormat, ModuleTypes, OutputAsset, OutputChunk, OutputOptions, TreeshakingOptions } from "@voidzero-dev/vite-plus-core/rolldown";
|
|
3
3
|
import { IsolatedDeclarationsOptions } from "@voidzero-dev/vite-plus-core/rolldown/experimental";
|
|
4
4
|
|
|
5
|
-
//#region ../../node_modules/.pnpm/tsdown@0.21.
|
|
5
|
+
//#region ../../node_modules/.pnpm/tsdown@0.21.3_@arethetypeswrong+core@0.18.2_@tsdown+css@0.21.3_@tsdown+exe@0.21.3_@type_38be87ebcd54001dc11621ca3e3d3fad/node_modules/tsdown/dist/logger-DtCm1ySP.d.mts
|
|
6
6
|
//#region src/utils/types.d.ts
|
|
7
7
|
type Overwrite<T, U> = Omit<T, keyof U> & U;
|
|
8
8
|
type Awaitable<T> = T | Promise<T>;
|
|
@@ -8473,7 +8473,7 @@ interface GlobDependency {
|
|
|
8473
8473
|
glob: string;
|
|
8474
8474
|
}
|
|
8475
8475
|
//#endregion
|
|
8476
|
-
//#region ../../node_modules/.pnpm/@tsdown+css@0.21.
|
|
8476
|
+
//#region ../../node_modules/.pnpm/@tsdown+css@0.21.3_jiti@2.6.1_postcss-import@16.1.1_postcss@8.5.8__postcss@8.5.8_sass-e_51db9ed59721905a0258cdc790ed7d6f/node_modules/@tsdown/css/dist/index.d.mts
|
|
8477
8477
|
//#region src/options.d.ts
|
|
8478
8478
|
type LightningCSSOptions = Omit<TransformOptions<any>, "filename" | "code">;
|
|
8479
8479
|
interface CssOptions {
|
|
@@ -9526,7 +9526,7 @@ interface StartOptions {
|
|
|
9526
9526
|
open?: boolean;
|
|
9527
9527
|
}
|
|
9528
9528
|
//#endregion
|
|
9529
|
-
//#region ../../node_modules/.pnpm/@tsdown+exe@0.21.
|
|
9529
|
+
//#region ../../node_modules/.pnpm/@tsdown+exe@0.21.3_tsdown@0.21.3/node_modules/@tsdown/exe/dist/index.d.mts
|
|
9530
9530
|
//#region src/platform.d.ts
|
|
9531
9531
|
type ExePlatform = "win" | "darwin" | "linux";
|
|
9532
9532
|
type ExeArch = "x64" | "arm64";
|
|
@@ -9667,7 +9667,7 @@ interface Options$1 {
|
|
|
9667
9667
|
depKinds?: Array<DepKind>;
|
|
9668
9668
|
}
|
|
9669
9669
|
//#endregion
|
|
9670
|
-
//#region ../../node_modules/.pnpm/tsdown@0.21.
|
|
9670
|
+
//#region ../../node_modules/.pnpm/tsdown@0.21.3_@arethetypeswrong+core@0.18.2_@tsdown+css@0.21.3_@tsdown+exe@0.21.3_@type_38be87ebcd54001dc11621ca3e3d3fad/node_modules/tsdown/dist/types-D2Jnze_i.d.mts
|
|
9671
9671
|
//#region src/features/copy.d.ts
|
|
9672
9672
|
interface CopyEntry {
|
|
9673
9673
|
/**
|
|
@@ -10791,7 +10791,7 @@ type ResolvedConfig = Overwrite<MarkPartial<Omit<UserConfig, "workspace" | "from
|
|
|
10791
10791
|
exe: false | ExeOptions;
|
|
10792
10792
|
}>; //#endregion
|
|
10793
10793
|
//#endregion
|
|
10794
|
-
//#region ../../node_modules/.pnpm/tsdown@0.21.
|
|
10794
|
+
//#region ../../node_modules/.pnpm/tsdown@0.21.3_@arethetypeswrong+core@0.18.2_@tsdown+css@0.21.3_@tsdown+exe@0.21.3_@type_38be87ebcd54001dc11621ca3e3d3fad/node_modules/tsdown/dist/config-D9p_BCF3.d.mts
|
|
10795
10795
|
//#region src/config/options.d.ts
|
|
10796
10796
|
/**
|
|
10797
10797
|
* Resolve user config into resolved configs
|
|
@@ -10811,7 +10811,7 @@ declare function defineConfig(options: UserConfig[]): UserConfig[];
|
|
|
10811
10811
|
declare function defineConfig(options: UserConfigFn): UserConfigFn;
|
|
10812
10812
|
declare function defineConfig(options: UserConfigExport): UserConfigExport; //#endregion
|
|
10813
10813
|
//#endregion
|
|
10814
|
-
//#region ../../node_modules/.pnpm/tsdown@0.21.
|
|
10814
|
+
//#region ../../node_modules/.pnpm/tsdown@0.21.3_@arethetypeswrong+core@0.18.2_@tsdown+css@0.21.3_@tsdown+exe@0.21.3_@type_38be87ebcd54001dc11621ca3e3d3fad/node_modules/tsdown/dist/index.d.mts
|
|
10815
10815
|
//#region src/build.d.ts
|
|
10816
10816
|
/**
|
|
10817
10817
|
* Build with tsdown.
|