@voidzero-dev/vite-plus-core 0.1.23 → 0.1.24
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/LICENSE +2 -2
- package/dist/rolldown/shared/binding-CXquf8ay.mjs +26 -26
- package/dist/rolldown/shared/bindingify-input-options-D2ORek5s.mjs +1 -1
- package/dist/tsdown/{build-5FURNVr0-CsM6vj3e.js → build-BZshaq8i-C7uS6x65.js} +142 -91
- package/dist/tsdown/{detect-DN3DXXYt-TsZBbdhI.js → detect-B97OSl92-CgjrIbmD.js} +1 -1
- package/dist/tsdown/{dist-wWM45aJq.js → dist-BHLOKn-2.js} +782 -1578
- package/dist/tsdown/index-types.d.ts +28 -12
- package/dist/tsdown/index.js +3 -3
- package/dist/tsdown/main-nVIFtu2j.js +938 -0
- package/dist/tsdown/{resolver-DkvdaW3s-Dz1U-gxd.js → resolver-DtsKFXi2-QB-x8j3e.js} +1 -1
- package/dist/tsdown/run.js +5 -5
- package/dist/tsdown/{tsc-Dp9emiKb.js → tsc-WMktM0FW.js} +3 -3
- package/dist/tsdown/{tsc-context-DXovbMXp.js → tsc-context-DKufFI_s.js} +2 -2
- package/dist/vite/node/chunks/logger.js +1 -1
- package/dist/vite/node/chunks/node.js +220 -114
- package/dist/vite/node/index.d.ts +2 -2
- package/package.json +8 -8
- package/dist/tsdown/chunk-DJK8HYOj.js +0 -34
- package/dist/tsdown/main-Cq8Is40L.js +0 -1173
|
@@ -1,18 +1,17 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { C as noop, D as resolveRegex, E as resolveComma, O as slash, S as matchPattern, T as promiseWithResolvers, _ as red, a as version, b as debounce, c as generateColor, d as prettyFormat, f as blue, h as green, i as createDebug, k as toArray, l as getNameLabel, m as dim, n as V, o as LogLevels, p as bold, s as createLogger, t as H, u as globalLogger, v as underline, w as pkgExists, x as importWithError, y as yellow } from "./main-Cq8Is40L.js";
|
|
1
|
+
import { A as __commonJSMin, C as noop, D as resolveRegex, E as resolveComma, M as __toESM, O as slash, S as matchPattern, T as promiseWithResolvers, _ as red, a as createDebug, b as debounce, c as generateColor, d as prettyFormat, f as blue, h as green, i as version, j as __exportAll$1, k as toArray, l as getNameLabel, m as dim, n as z$1, o as LogLevels, p as bold, s as createLogger, t as R$2, u as globalLogger, v as underline, w as pkgExists, x as importWithError, y as yellow } from "./main-nVIFtu2j.js";
|
|
3
2
|
import module$1, { builtinModules, createRequire, isBuiltin } from "node:module";
|
|
4
3
|
import process$1, { env } from "node:process";
|
|
5
4
|
import readline from "node:readline";
|
|
6
5
|
import { formatWithOptions, inspect, isDeepStrictEqual, promisify } from "node:util";
|
|
7
6
|
import path, { dirname, isAbsolute, join, parse, resolve } from "node:path";
|
|
7
|
+
import fs, { existsSync, readFileSync, writeFileSync } from "node:fs";
|
|
8
8
|
import { RUNTIME_MODULE_ID, VERSION, build, watch } from "@voidzero-dev/vite-plus-core/rolldown";
|
|
9
9
|
import { access, chmod, cp, mkdir, mkdtemp, readFile, readdir, rm, stat, writeFile } from "node:fs/promises";
|
|
10
10
|
import { and, exactRegex, id, importerId, include } from "@voidzero-dev/vite-plus-core/rolldown/filter";
|
|
11
|
-
import re, { existsSync, readFileSync, writeFileSync } from "node:fs";
|
|
12
11
|
import * as nativeFs from "fs";
|
|
13
|
-
import Ue, { readdir as readdir$1, readdirSync, realpath, realpathSync, stat as stat$1, statSync } from "fs";
|
|
12
|
+
import Ue, { readdir as readdir$1, readdirSync, realpath, realpathSync, stat as stat$1, statSync as statSync$1 } from "fs";
|
|
14
13
|
import Ie from "os";
|
|
15
|
-
import Se, { basename, dirname as dirname$1, isAbsolute as isAbsolute$1, normalize, posix, relative, resolve as resolve$1, sep } from "path";
|
|
14
|
+
import Se, { basename as basename$1, dirname as dirname$1, isAbsolute as isAbsolute$1, normalize as normalize$1, posix, relative, resolve as resolve$1, sep } from "path";
|
|
16
15
|
import { fileURLToPath } from "url";
|
|
17
16
|
import { createRequire as createRequire$1 } from "module";
|
|
18
17
|
import { tmpdir } from "node:os";
|
|
@@ -21,7 +20,7 @@ import { AsyncLocalStorage } from "node:async_hooks";
|
|
|
21
20
|
import { Buffer } from "node:buffer";
|
|
22
21
|
import { brotliCompress, gzip } from "node:zlib";
|
|
23
22
|
import { importGlobPlugin } from "@voidzero-dev/vite-plus-core/rolldown/experimental";
|
|
24
|
-
//#region ../../node_modules/.pnpm/tsdown@0.22.
|
|
23
|
+
//#region ../../node_modules/.pnpm/tsdown@0.22.1_@arethetypeswrong+core@0.18.2_@tsdown+css@0.22.1_@tsdown+exe@0.22.1_@type_b2f732f99208225f009f13478ba95350/node_modules/tsdown/dist/fs-qxJxxoCE.mjs
|
|
25
24
|
function fsExists(path) {
|
|
26
25
|
return access(path).then(() => true, () => false);
|
|
27
26
|
}
|
|
@@ -64,7 +63,7 @@ function stripExtname(filePath) {
|
|
|
64
63
|
return filePath.slice(0, -ext.length);
|
|
65
64
|
}
|
|
66
65
|
//#endregion
|
|
67
|
-
//#region ../../node_modules/.pnpm/rolldown-plugin-dts@0.25.
|
|
66
|
+
//#region ../../node_modules/.pnpm/rolldown-plugin-dts@0.25.2_@typescript+native-preview@7.0.0-dev.20260122.2_oxc-resolver_8152cf0e534aee518f40abeb59f8494a/node_modules/rolldown-plugin-dts/dist/filename-BR9JpwkC.mjs
|
|
68
67
|
const RE_JS = /\.([cm]?)jsx?$/;
|
|
69
68
|
const RE_TS = /\.([cm]?)tsx?$/;
|
|
70
69
|
const RE_DTS = /\.d\.([cm]?)ts$/;
|
|
@@ -151,13 +150,13 @@ i(x, "slash");
|
|
|
151
150
|
const _e = i((e, n) => {
|
|
152
151
|
const s = `readFileSync:${n}`;
|
|
153
152
|
let t = e?.get(s);
|
|
154
|
-
return t === void 0 && (t =
|
|
153
|
+
return t === void 0 && (t = fs.readFileSync(n, "utf8"), e?.set(s, t)), t;
|
|
155
154
|
}, "readFile"), F = i((e, n) => {
|
|
156
155
|
const s = `tryStat:${n}`;
|
|
157
156
|
let t = e?.get(s);
|
|
158
157
|
if (t === void 0) {
|
|
159
158
|
try {
|
|
160
|
-
t =
|
|
159
|
+
t = fs.statSync(n);
|
|
161
160
|
} catch {
|
|
162
161
|
t = null;
|
|
163
162
|
}
|
|
@@ -1095,8 +1094,22 @@ i((e, n) => {
|
|
|
1095
1094
|
return m.substitutions.map((u) => x(u.replace("*", w)));
|
|
1096
1095
|
}, "resolvePathAlias");
|
|
1097
1096
|
//#endregion
|
|
1098
|
-
//#region ../../node_modules/.pnpm/tsdown@0.22.
|
|
1097
|
+
//#region ../../node_modules/.pnpm/tsdown@0.22.1_@arethetypeswrong+core@0.18.2_@tsdown+css@0.22.1_@tsdown+exe@0.22.1_@type_b2f732f99208225f009f13478ba95350/node_modules/tsdown/dist/format-DMceewlS.mjs
|
|
1099
1098
|
const shimFile = path.resolve(import.meta.dirname, "..", "esm-shims.js");
|
|
1099
|
+
const shimsDefine = {
|
|
1100
|
+
__dirname: "__TSDOWN_SHIM_DIRNAME__",
|
|
1101
|
+
__filename: "__TSDOWN_SHIM_FILENAME__"
|
|
1102
|
+
};
|
|
1103
|
+
const shimsPlugin = {
|
|
1104
|
+
name: "tsdown:shims-banner",
|
|
1105
|
+
banner: `
|
|
1106
|
+
import __tsdown_shims_path from 'node:path'
|
|
1107
|
+
import __tsdown_shims_url from 'node:url'
|
|
1108
|
+
|
|
1109
|
+
const __TSDOWN_SHIM_FILENAME__ = /* @__PURE__ */ __tsdown_shims_url.fileURLToPath(import.meta.url)
|
|
1110
|
+
const __TSDOWN_SHIM_DIRNAME__ = /* @__PURE__ */ __tsdown_shims_path.dirname(__TSDOWN_SHIM_FILENAME__)
|
|
1111
|
+
`
|
|
1112
|
+
};
|
|
1100
1113
|
function getShimsInject(format, platform) {
|
|
1101
1114
|
if (format === "es" && platform === "node") return {
|
|
1102
1115
|
__dirname: [shimFile, "__dirname"],
|
|
@@ -1131,22 +1144,26 @@ function resolveDepsConfig(config, logger) {
|
|
|
1131
1144
|
logger?.warn("`skipNodeModulesBundle` is deprecated. Use `deps.skipNodeModulesBundle` instead.");
|
|
1132
1145
|
skipNodeModulesBundle = config.skipNodeModulesBundle;
|
|
1133
1146
|
}
|
|
1134
|
-
if (
|
|
1135
|
-
if (
|
|
1147
|
+
if (skipNodeModulesBundle && alwaysBundle != null) throw new TypeError("`deps.skipNodeModulesBundle` and `deps.alwaysBundle` are mutually exclusive options and cannot be used together.");
|
|
1148
|
+
if (onlyBundle != null && onlyBundle !== false) onlyBundle = toArray(onlyBundle);
|
|
1149
|
+
return {
|
|
1150
|
+
...normalizeDepsOptions(alwaysBundle, neverBundle),
|
|
1151
|
+
onlyBundle,
|
|
1152
|
+
skipNodeModulesBundle,
|
|
1153
|
+
dts: normalizeDepsOptions(config.deps?.dts?.alwaysBundle, config.deps?.dts?.neverBundle)
|
|
1154
|
+
};
|
|
1155
|
+
}
|
|
1156
|
+
function normalizeDepsOptions(alwaysBundle, neverBundle) {
|
|
1136
1157
|
if (alwaysBundle != null && typeof alwaysBundle !== "function") {
|
|
1137
1158
|
const alwaysBundlePatterns = toArray(alwaysBundle);
|
|
1138
1159
|
alwaysBundle = (id) => matchPattern(id, alwaysBundlePatterns);
|
|
1139
1160
|
}
|
|
1140
|
-
if (skipNodeModulesBundle && alwaysBundle != null) throw new TypeError("`deps.skipNodeModulesBundle` and `deps.alwaysBundle` are mutually exclusive options and cannot be used together.");
|
|
1141
|
-
if (onlyBundle != null && onlyBundle !== false) onlyBundle = toArray(onlyBundle);
|
|
1142
1161
|
return {
|
|
1143
|
-
neverBundle,
|
|
1144
1162
|
alwaysBundle,
|
|
1145
|
-
|
|
1146
|
-
skipNodeModulesBundle
|
|
1163
|
+
neverBundle: resolveRegex(neverBundle)
|
|
1147
1164
|
};
|
|
1148
1165
|
}
|
|
1149
|
-
function DepsPlugin({ pkg, deps: { alwaysBundle, onlyBundle, skipNodeModulesBundle }, logger, nameLabel }, tsdownBundle) {
|
|
1166
|
+
function DepsPlugin({ pkg, deps: { alwaysBundle: jsAlwaysBundle, onlyBundle, skipNodeModulesBundle, dts }, logger, nameLabel }, tsdownBundle) {
|
|
1150
1167
|
const deps = pkg && Array.from(getProductionDeps(pkg));
|
|
1151
1168
|
return {
|
|
1152
1169
|
name: "tsdown:deps",
|
|
@@ -1214,7 +1231,7 @@ function DepsPlugin({ pkg, deps: { alwaysBundle, onlyBundle, skipNodeModulesBund
|
|
|
1214
1231
|
*/
|
|
1215
1232
|
async function externalStrategy(id, importer, resolved) {
|
|
1216
1233
|
if (id === shimFile) return false;
|
|
1217
|
-
if (alwaysBundle?.(id, importer)) return "no-external";
|
|
1234
|
+
if (((importer ? RE_DTS.test(importer) : false) && dts?.alwaysBundle || jsAlwaysBundle)?.(id, importer)) return "no-external";
|
|
1218
1235
|
if (skipNodeModulesBundle && resolved && (resolved.external || RE_NODE_MODULES$1.test(resolved.id))) {
|
|
1219
1236
|
const resolvedDep = await resolveDepSubpath(id, resolved);
|
|
1220
1237
|
return resolvedDep ? [true, resolvedDep] : true;
|
|
@@ -1359,7 +1376,7 @@ function createDefu(merger) {
|
|
|
1359
1376
|
//#region ../../node_modules/.pnpm/fdir@6.5.0_picomatch@4.0.4/node_modules/fdir/dist/index.mjs
|
|
1360
1377
|
var __require$1 = /* @__PURE__ */ createRequire$1(import.meta.url);
|
|
1361
1378
|
function cleanPath(path) {
|
|
1362
|
-
let normalized = normalize(path);
|
|
1379
|
+
let normalized = normalize$1(path);
|
|
1363
1380
|
if (normalized.length > 1 && normalized[normalized.length - 1] === sep) normalized = normalized.substring(0, normalized.length - 1);
|
|
1364
1381
|
return normalized;
|
|
1365
1382
|
}
|
|
@@ -1695,7 +1712,7 @@ var Walker = class {
|
|
|
1695
1712
|
this.walkDirectory(this.state, resolvedPath, useRealPaths ? resolvedPath : path + pathSeparator, depth - 1, this.walk);
|
|
1696
1713
|
} else {
|
|
1697
1714
|
resolvedPath = useRealPaths ? resolvedPath : path;
|
|
1698
|
-
const filename = basename(resolvedPath);
|
|
1715
|
+
const filename = basename$1(resolvedPath);
|
|
1699
1716
|
const directoryPath$1 = normalizePath(dirname$1(resolvedPath), this.state.options);
|
|
1700
1717
|
resolvedPath = this.joinPath(filename, directoryPath$1);
|
|
1701
1718
|
this.pushFile(resolvedPath, files, this.state.counts, filters);
|
|
@@ -3723,7 +3740,7 @@ var require_picomatch$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
3723
3740
|
module.exports = picomatch;
|
|
3724
3741
|
}));
|
|
3725
3742
|
//#endregion
|
|
3726
|
-
//#region ../../node_modules/.pnpm/tinyglobby@0.2.
|
|
3743
|
+
//#region ../../node_modules/.pnpm/tinyglobby@0.2.17/node_modules/tinyglobby/dist/index.mjs
|
|
3727
3744
|
var import_picomatch = /* @__PURE__ */ __toESM((/* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
3728
3745
|
const pico = require_picomatch$1();
|
|
3729
3746
|
const utils = require_utils();
|
|
@@ -3739,6 +3756,7 @@ var import_picomatch = /* @__PURE__ */ __toESM((/* @__PURE__ */ __commonJSMin(((
|
|
|
3739
3756
|
})))(), 1);
|
|
3740
3757
|
const isReadonlyArray = Array.isArray;
|
|
3741
3758
|
const BACKSLASHES = /\\/g;
|
|
3759
|
+
const DRIVE_RELATIVE_PATH = /^[A-Za-z]:$/;
|
|
3742
3760
|
const isWin = process.platform === "win32";
|
|
3743
3761
|
const ONLY_PARENT_DIRECTORIES = /^(\/?\.\.)+$/;
|
|
3744
3762
|
function getPartialMatcher(patterns, options = {}) {
|
|
@@ -3805,6 +3823,9 @@ function buildRelative(cwd, root) {
|
|
|
3805
3823
|
return p[p.length - 1] === "/" && result !== "" ? `${result}/` : result || ".";
|
|
3806
3824
|
};
|
|
3807
3825
|
}
|
|
3826
|
+
function ensureNonDriveRelativePath(path) {
|
|
3827
|
+
return path.replace(DRIVE_RELATIVE_PATH, (match) => `${match}/`);
|
|
3828
|
+
}
|
|
3808
3829
|
const splitPatternOptions = { parts: true };
|
|
3809
3830
|
function splitPattern(path) {
|
|
3810
3831
|
var _result$parts;
|
|
@@ -3866,7 +3887,7 @@ function normalizePattern(pattern, opts, props, isIgnore) {
|
|
|
3866
3887
|
}
|
|
3867
3888
|
const potentialRoot = posix.join(cwd, parentDir.slice(i * 3));
|
|
3868
3889
|
if (potentialRoot[0] !== "." && props.root.length > potentialRoot.length) {
|
|
3869
|
-
props.root = potentialRoot;
|
|
3890
|
+
props.root = ensureNonDriveRelativePath(potentialRoot);
|
|
3870
3891
|
props.depthOffset = -n + i;
|
|
3871
3892
|
}
|
|
3872
3893
|
}
|
|
@@ -3886,7 +3907,7 @@ function normalizePattern(pattern, opts, props, isIgnore) {
|
|
|
3886
3907
|
}
|
|
3887
3908
|
props.depthOffset = newCommonPath.length;
|
|
3888
3909
|
props.commonPath = newCommonPath;
|
|
3889
|
-
props.root = newCommonPath.length > 0 ? posix.join(cwd, ...newCommonPath) : cwd;
|
|
3910
|
+
props.root = ensureNonDriveRelativePath(newCommonPath.length > 0 ? posix.join(cwd, ...newCommonPath) : cwd);
|
|
3890
3911
|
}
|
|
3891
3912
|
return result;
|
|
3892
3913
|
}
|
|
@@ -3975,18 +3996,15 @@ function formatPaths(paths, mapper) {
|
|
|
3975
3996
|
}
|
|
3976
3997
|
const defaultOptions$1 = {
|
|
3977
3998
|
caseSensitiveMatch: true,
|
|
3978
|
-
cwd: process.cwd(),
|
|
3979
3999
|
debug: !!process.env.TINYGLOBBY_DEBUG,
|
|
3980
4000
|
expandDirectories: true,
|
|
3981
4001
|
followSymbolicLinks: true,
|
|
3982
4002
|
onlyFiles: true
|
|
3983
4003
|
};
|
|
3984
4004
|
function getOptions(options) {
|
|
3985
|
-
const opts = {
|
|
3986
|
-
|
|
3987
|
-
|
|
3988
|
-
};
|
|
3989
|
-
opts.cwd = (opts.cwd instanceof URL ? fileURLToPath(opts.cwd) : resolve$1(opts.cwd)).replace(BACKSLASHES, "/");
|
|
4005
|
+
const opts = Object.assign({}, options);
|
|
4006
|
+
for (const key in defaultOptions$1) if (opts[key] === void 0) Object.assign(opts, { [key]: defaultOptions$1[key] });
|
|
4007
|
+
opts.cwd = (opts.cwd instanceof URL ? fileURLToPath(opts.cwd) : resolve$1(opts.cwd || process.cwd())).replace(BACKSLASHES, "/");
|
|
3990
4008
|
opts.ignore = ensureStringArray(opts.ignore);
|
|
3991
4009
|
opts.fs && (opts.fs = {
|
|
3992
4010
|
readdir: opts.fs.readdir || readdir$1,
|
|
@@ -3994,7 +4012,7 @@ function getOptions(options) {
|
|
|
3994
4012
|
realpath: opts.fs.realpath || realpath,
|
|
3995
4013
|
realpathSync: opts.fs.realpathSync || realpathSync,
|
|
3996
4014
|
stat: opts.fs.stat || stat$1,
|
|
3997
|
-
statSync: opts.fs.statSync || statSync
|
|
4015
|
+
statSync: opts.fs.statSync || statSync$1
|
|
3998
4016
|
});
|
|
3999
4017
|
if (opts.debug) log("globbing with options:", opts);
|
|
4000
4018
|
return opts;
|
|
@@ -4012,7 +4030,7 @@ async function glob(globInput, options) {
|
|
|
4012
4030
|
return crawler ? formatPaths(await crawler.withPromise(), relative) : [];
|
|
4013
4031
|
}
|
|
4014
4032
|
//#endregion
|
|
4015
|
-
//#region ../../node_modules/.pnpm/empathic@2.0.
|
|
4033
|
+
//#region ../../node_modules/.pnpm/empathic@2.0.1/node_modules/empathic/resolve.mjs
|
|
4016
4034
|
/**
|
|
4017
4035
|
* Resolve an absolute path from {@link root}, but only
|
|
4018
4036
|
* if {@link input} isn't already absolute.
|
|
@@ -4025,7 +4043,7 @@ function absolute(input, root) {
|
|
|
4025
4043
|
return isAbsolute(input) ? input : resolve(root || ".", input);
|
|
4026
4044
|
}
|
|
4027
4045
|
//#endregion
|
|
4028
|
-
//#region ../../node_modules/.pnpm/empathic@2.0.
|
|
4046
|
+
//#region ../../node_modules/.pnpm/empathic@2.0.1/node_modules/empathic/walk.mjs
|
|
4029
4047
|
/**
|
|
4030
4048
|
* Get all parent directories of {@link base}.
|
|
4031
4049
|
* Stops after {@link Options['last']} is processed.
|
|
@@ -4045,7 +4063,7 @@ function up$2(base, options) {
|
|
|
4045
4063
|
return arr;
|
|
4046
4064
|
}
|
|
4047
4065
|
//#endregion
|
|
4048
|
-
//#region ../../node_modules/.pnpm/empathic@2.0.
|
|
4066
|
+
//#region ../../node_modules/.pnpm/empathic@2.0.1/node_modules/empathic/find.mjs
|
|
4049
4067
|
/**
|
|
4050
4068
|
* Find an item by name, walking parent directories until found.
|
|
4051
4069
|
*
|
|
@@ -4060,7 +4078,7 @@ function up$1(name, options) {
|
|
|
4060
4078
|
}
|
|
4061
4079
|
}
|
|
4062
4080
|
//#endregion
|
|
4063
|
-
//#region ../../node_modules/.pnpm/empathic@2.0.
|
|
4081
|
+
//#region ../../node_modules/.pnpm/empathic@2.0.1/node_modules/empathic/package.mjs
|
|
4064
4082
|
/**
|
|
4065
4083
|
* Find the closest "package.json" file while walking parent directories.
|
|
4066
4084
|
* @returns The absolute path to a "package.json", if found.
|
|
@@ -4224,87 +4242,87 @@ quansync$1({
|
|
|
4224
4242
|
*/
|
|
4225
4243
|
const quansync = quansync$1;
|
|
4226
4244
|
quansync$1({
|
|
4227
|
-
sync:
|
|
4228
|
-
async:
|
|
4245
|
+
sync: fs.readFileSync,
|
|
4246
|
+
async: fs.promises.readFile
|
|
4229
4247
|
});
|
|
4230
4248
|
quansync$1({
|
|
4231
|
-
sync:
|
|
4232
|
-
async:
|
|
4249
|
+
sync: fs.writeFileSync,
|
|
4250
|
+
async: fs.promises.writeFile
|
|
4233
4251
|
});
|
|
4234
4252
|
quansync$1({
|
|
4235
|
-
sync:
|
|
4236
|
-
async:
|
|
4253
|
+
sync: fs.unlinkSync,
|
|
4254
|
+
async: fs.promises.unlink
|
|
4237
4255
|
});
|
|
4238
4256
|
quansync$1({
|
|
4239
|
-
sync:
|
|
4240
|
-
async:
|
|
4257
|
+
sync: fs.accessSync,
|
|
4258
|
+
async: fs.promises.access
|
|
4241
4259
|
});
|
|
4242
4260
|
/**
|
|
4243
4261
|
* @link https://nodejs.org/api/fs.html#fspromisesstatpath-options
|
|
4244
4262
|
*/
|
|
4245
4263
|
const stat$2 = quansync$1({
|
|
4246
|
-
sync:
|
|
4247
|
-
async:
|
|
4264
|
+
sync: fs.statSync,
|
|
4265
|
+
async: fs.promises.stat
|
|
4248
4266
|
});
|
|
4249
4267
|
const lstat = quansync$1({
|
|
4250
|
-
sync:
|
|
4251
|
-
async:
|
|
4268
|
+
sync: fs.lstatSync,
|
|
4269
|
+
async: fs.promises.lstat
|
|
4252
4270
|
});
|
|
4253
4271
|
quansync$1({
|
|
4254
|
-
sync:
|
|
4255
|
-
async:
|
|
4272
|
+
sync: fs.copyFileSync,
|
|
4273
|
+
async: fs.promises.copyFile
|
|
4256
4274
|
});
|
|
4257
4275
|
quansync$1({
|
|
4258
|
-
sync:
|
|
4259
|
-
async:
|
|
4276
|
+
sync: fs.rmSync,
|
|
4277
|
+
async: fs.promises.rm
|
|
4260
4278
|
});
|
|
4261
4279
|
quansync$1({
|
|
4262
|
-
sync:
|
|
4263
|
-
async:
|
|
4280
|
+
sync: fs.mkdirSync,
|
|
4281
|
+
async: fs.promises.mkdir
|
|
4264
4282
|
});
|
|
4265
4283
|
quansync$1({
|
|
4266
|
-
sync:
|
|
4267
|
-
async:
|
|
4284
|
+
sync: fs.renameSync,
|
|
4285
|
+
async: fs.promises.rename
|
|
4268
4286
|
});
|
|
4269
4287
|
quansync$1({
|
|
4270
|
-
sync:
|
|
4271
|
-
async:
|
|
4288
|
+
sync: fs.readdirSync,
|
|
4289
|
+
async: fs.promises.readdir
|
|
4272
4290
|
});
|
|
4273
4291
|
quansync$1({
|
|
4274
|
-
sync:
|
|
4275
|
-
async:
|
|
4292
|
+
sync: fs.realpathSync,
|
|
4293
|
+
async: fs.promises.realpath
|
|
4276
4294
|
});
|
|
4277
4295
|
quansync$1({
|
|
4278
|
-
sync:
|
|
4279
|
-
async:
|
|
4296
|
+
sync: fs.readlinkSync,
|
|
4297
|
+
async: fs.promises.readlink
|
|
4280
4298
|
});
|
|
4281
4299
|
quansync$1({
|
|
4282
|
-
sync:
|
|
4283
|
-
async:
|
|
4300
|
+
sync: fs.symlinkSync,
|
|
4301
|
+
async: fs.promises.symlink
|
|
4284
4302
|
});
|
|
4285
4303
|
quansync$1({
|
|
4286
|
-
sync:
|
|
4287
|
-
async:
|
|
4304
|
+
sync: fs.chownSync,
|
|
4305
|
+
async: fs.promises.chown
|
|
4288
4306
|
});
|
|
4289
4307
|
quansync$1({
|
|
4290
|
-
sync:
|
|
4291
|
-
async:
|
|
4308
|
+
sync: fs.lchownSync,
|
|
4309
|
+
async: fs.promises.lchown
|
|
4292
4310
|
});
|
|
4293
4311
|
quansync$1({
|
|
4294
|
-
sync:
|
|
4295
|
-
async:
|
|
4312
|
+
sync: fs.chmodSync,
|
|
4313
|
+
async: fs.promises.chmod
|
|
4296
4314
|
});
|
|
4297
4315
|
quansync$1({
|
|
4298
|
-
sync:
|
|
4299
|
-
async:
|
|
4316
|
+
sync: fs.utimesSync,
|
|
4317
|
+
async: fs.promises.utimes
|
|
4300
4318
|
});
|
|
4301
4319
|
quansync$1({
|
|
4302
|
-
sync:
|
|
4303
|
-
async:
|
|
4320
|
+
sync: fs.lutimesSync,
|
|
4321
|
+
async: fs.promises.lutimes
|
|
4304
4322
|
});
|
|
4305
4323
|
quansync$1({
|
|
4306
|
-
sync:
|
|
4307
|
-
async:
|
|
4324
|
+
sync: fs.mkdtempSync,
|
|
4325
|
+
async: fs.promises.mkdtemp
|
|
4308
4326
|
});
|
|
4309
4327
|
//#endregion
|
|
4310
4328
|
//#region ../../node_modules/.pnpm/unconfig-core@7.5.0/node_modules/unconfig-core/dist/index.mjs
|
|
@@ -4383,7 +4401,7 @@ function createConfigCoreLoader(options) {
|
|
|
4383
4401
|
};
|
|
4384
4402
|
}
|
|
4385
4403
|
//#endregion
|
|
4386
|
-
//#region ../../node_modules/.pnpm/tsdown@0.22.
|
|
4404
|
+
//#region ../../node_modules/.pnpm/tsdown@0.22.1_@arethetypeswrong+core@0.18.2_@tsdown+css@0.22.1_@tsdown+exe@0.22.1_@type_b2f732f99208225f009f13478ba95350/node_modules/tsdown/dist/options-DWGUHu4D.mjs
|
|
4387
4405
|
const __cjs_require$1 = createRequire(import.meta.url);
|
|
4388
4406
|
const picomatch = __cjs_require$1("./npm_entry_picomatch.cjs");
|
|
4389
4407
|
const satisfies$1 = __cjs_require$1("./npm_entry_semver_functions_satisfies.cjs");
|
|
@@ -4556,7 +4574,7 @@ async function buildSingleExe(config, bundledFile, outputFile, executable, targe
|
|
|
4556
4574
|
await writeFile(seaConfigPath, JSON.stringify(seaConfig));
|
|
4557
4575
|
debug$3$2("Wrote sea-config.json: %O -> %s", seaConfig, seaConfigPath);
|
|
4558
4576
|
debug$3$2("Running: %s --build-sea %s", process$1.execPath, seaConfigPath);
|
|
4559
|
-
await
|
|
4577
|
+
await R$2(process$1.execPath, ["--build-sea", seaConfigPath], {
|
|
4560
4578
|
nodeOptions: { stdio: [
|
|
4561
4579
|
"ignore",
|
|
4562
4580
|
"ignore",
|
|
@@ -4569,7 +4587,7 @@ async function buildSingleExe(config, bundledFile, outputFile, executable, targe
|
|
|
4569
4587
|
else await fsRemove(tempDir);
|
|
4570
4588
|
}
|
|
4571
4589
|
if ((target?.platform || process$1.platform) === "darwin") try {
|
|
4572
|
-
await
|
|
4590
|
+
await R$2("codesign", [
|
|
4573
4591
|
"--sign",
|
|
4574
4592
|
"-",
|
|
4575
4593
|
outputPath
|
|
@@ -5025,6 +5043,7 @@ async function nativeImport(id) {
|
|
|
5025
5043
|
} else if (!isBun) url.searchParams.set("no-cache", crypto.randomUUID());
|
|
5026
5044
|
const mod = await depsStore.run(deps, () => import(url.href, { with: importAttributes }).catch((error) => {
|
|
5027
5045
|
if (error?.message?.includes?.("Cannot find module")) throw new Error(`Failed to load the config file. Try setting the --config-loader CLI flag to \`tsx\` or \`unrun\`.\n\n${error.message}`, { cause: error });
|
|
5046
|
+
if (String(error).includes("not supported in strip-only mode")) throw new Error(`Failed to load the config file because it contains TypeScript-specific syntax that Node.js cannot execute directly. Please set the --config-loader CLI flag to \`tsx\` or \`unrun\`.\n\n${error.message}`, { cause: error });
|
|
5028
5047
|
if (typeof error?.stack === "string" && error.stack.includes("node:internal/modules/esm/translators")) throw new Error(`Failed to load the config file due to a known Node.js bug. Try setting the --config-loader CLI flag to \`tsx\` or \`unrun\`, or upgrading Node.js to v24.11.1 or later.\n\n${error.message}`, { cause: error });
|
|
5029
5048
|
throw error;
|
|
5030
5049
|
}));
|
|
@@ -5056,7 +5075,7 @@ async function resolveUserConfig(userConfig, inlineConfig, configDeps) {
|
|
|
5056
5075
|
if (result) userConfig = mergeConfig(userConfig, result);
|
|
5057
5076
|
}
|
|
5058
5077
|
}
|
|
5059
|
-
let { entry, format, plugins = [], clean = true, logLevel = "info", failOnWarn = false, customLogger, treeshake = true, platform = "node", outDir = "dist", sourcemap = false, dts, unused = false, watch = false, ignoreWatch, shims = false, publint = false, attw = false, fromVite, alias, tsconfig, report = true, target, env = {}, envFile, envPrefix = "TSDOWN_", copy, publicDir, hash = true, cwd = process$1.cwd(), name, workspace, exports = false, bundle, unbundle = typeof bundle === "boolean" ? !bundle : false, root, removeNodeProtocol, nodeProtocol, cjsDefault = true, globImport = true, css, injectStyle, fixedExtension = platform === "node", devtools = false, write = true, exe = false } = userConfig;
|
|
5078
|
+
let { entry, format, plugins = [], clean = true, logLevel = "info", failOnWarn = false, customLogger, treeshake = true, platform = "node", outDir = "dist", sourcemap = false, dts, unused = false, watch = false, ignoreWatch, shims = false, publint = false, attw = false, fromVite, alias, tsconfig, report = true, target, env = {}, envFile, envPrefix = "TSDOWN_", copy, publicDir, hash = true, cwd = process$1.cwd(), name, workspace, exports = false, bundle, unbundle = typeof bundle === "boolean" ? !bundle : false, root, removeNodeProtocol, nodeProtocol, cjsDefault = true, globImport = true, css, injectStyle, outExtension, outExtensions, fixedExtension = platform === "node", devtools = false, write = true, exe = false } = userConfig;
|
|
5060
5079
|
const pkg = await readPackageJson(cwd);
|
|
5061
5080
|
if (workspace) name ||= pkg?.name;
|
|
5062
5081
|
const color = generateColor(name);
|
|
@@ -5108,6 +5127,11 @@ async function resolveUserConfig(userConfig, inlineConfig, configDeps) {
|
|
|
5108
5127
|
} else throw new TypeError("`injectStyle` is deprecated. Cannot be used with `css.inject`");
|
|
5109
5128
|
if (publicDir) if (copy) throw new TypeError("`publicDir` is deprecated. Cannot be used with `copy`");
|
|
5110
5129
|
else logger.warn(`${blue`publicDir`} is deprecated. Use ${blue`copy`} instead.`);
|
|
5130
|
+
if (outExtension) {
|
|
5131
|
+
if (outExtensions) throw new TypeError("`outExtension` is deprecated. Cannot be used with `outExtensions`");
|
|
5132
|
+
logger.warn(`${blue`outExtension`} is deprecated. Use ${blue`outExtensions`} instead.`);
|
|
5133
|
+
outExtensions = outExtension;
|
|
5134
|
+
}
|
|
5111
5135
|
envPrefix = toArray(envPrefix);
|
|
5112
5136
|
if (envPrefix.includes("")) logger.warn("`envPrefix` includes an empty string; filtering is disabled. All environment variables from the env file and process.env will be injected into the build. Ensure this is intended to avoid accidental leakage of sensitive information.");
|
|
5113
5137
|
const envFromProcess = filterEnv(process$1.env, envPrefix);
|
|
@@ -5177,6 +5201,7 @@ async function resolveUserConfig(userConfig, inlineConfig, configDeps) {
|
|
|
5177
5201
|
nameLabel,
|
|
5178
5202
|
nodeProtocol,
|
|
5179
5203
|
outDir,
|
|
5204
|
+
outExtensions,
|
|
5180
5205
|
pkg,
|
|
5181
5206
|
platform,
|
|
5182
5207
|
plugins,
|
|
@@ -5250,7 +5275,7 @@ function filterConfig(filter, configCwd, name) {
|
|
|
5250
5275
|
return toArray(filter).some((value) => name && name === value || cwd === value);
|
|
5251
5276
|
}
|
|
5252
5277
|
//#endregion
|
|
5253
|
-
//#region ../../node_modules/.pnpm/tsdown@0.22.
|
|
5278
|
+
//#region ../../node_modules/.pnpm/tsdown@0.22.1_@arethetypeswrong+core@0.18.2_@tsdown+css@0.22.1_@tsdown+exe@0.22.1_@type_b2f732f99208225f009f13478ba95350/node_modules/tsdown/dist/watch-C3ocHLCt.mjs
|
|
5254
5279
|
async function copy(options) {
|
|
5255
5280
|
if (!options.copy) return;
|
|
5256
5281
|
const resolved = await resolveCopyEntries(options);
|
|
@@ -5630,8 +5655,8 @@ var Hookable = class {
|
|
|
5630
5655
|
}
|
|
5631
5656
|
};
|
|
5632
5657
|
//#endregion
|
|
5633
|
-
//#region ../../node_modules/.pnpm/tsdown@0.22.
|
|
5634
|
-
var
|
|
5658
|
+
//#region ../../node_modules/.pnpm/tsdown@0.22.1_@arethetypeswrong+core@0.18.2_@tsdown+css@0.22.1_@tsdown+exe@0.22.1_@type_b2f732f99208225f009f13478ba95350/node_modules/tsdown/dist/build-BZshaq8i.mjs
|
|
5659
|
+
var build_BZshaq8i_exports = /* @__PURE__ */ __exportAll$1({
|
|
5635
5660
|
n: () => buildWithConfigs,
|
|
5636
5661
|
r: () => build_exports,
|
|
5637
5662
|
t: () => build$1
|
|
@@ -5764,7 +5789,7 @@ function executeOnSuccess(config) {
|
|
|
5764
5789
|
if (!config.onSuccess) return;
|
|
5765
5790
|
const ab = new AbortController();
|
|
5766
5791
|
if (typeof config.onSuccess === "string") {
|
|
5767
|
-
const p =
|
|
5792
|
+
const p = z$1(config.onSuccess, [], { nodeOptions: {
|
|
5768
5793
|
shell: true,
|
|
5769
5794
|
stdio: "inherit",
|
|
5770
5795
|
cwd: config.cwd
|
|
@@ -5938,13 +5963,14 @@ async function bundleDone(bundleByPkg, bundle) {
|
|
|
5938
5963
|
}
|
|
5939
5964
|
} catch (error) {
|
|
5940
5965
|
configs[0].logger.error("Pack failed:", error);
|
|
5966
|
+
debug$1("Pack failed for %s: %O", pkg.packageJsonPath, error);
|
|
5941
5967
|
}
|
|
5942
5968
|
ctx.resolve();
|
|
5943
5969
|
}
|
|
5944
5970
|
async function packTarball(packageJsonPath) {
|
|
5945
5971
|
const pkgDir = path.dirname(packageJsonPath);
|
|
5946
5972
|
const destination = await mkdtemp(path.join(tmpdir(), "tsdown-pack-"));
|
|
5947
|
-
const { detect } = await import("./detect-
|
|
5973
|
+
const { detect } = await import("./detect-B97OSl92-CgjrIbmD.js");
|
|
5948
5974
|
try {
|
|
5949
5975
|
const detected = await detect({ cwd: pkgDir });
|
|
5950
5976
|
debug$1("Detected package manager: %o", detected);
|
|
@@ -6015,7 +6041,7 @@ async function pack(dir, pm, destination, ignoreScripts) {
|
|
|
6015
6041
|
args.push("--ignore-scripts");
|
|
6016
6042
|
break;
|
|
6017
6043
|
}
|
|
6018
|
-
const output = await
|
|
6044
|
+
const output = await R$2(command, args, { nodeOptions: { cwd: dir } });
|
|
6019
6045
|
const tarballFile = await readdir(destination).then((files) => files.find((file) => file.endsWith(".tgz")));
|
|
6020
6046
|
if (!tarballFile) throw new Error(`Failed to find packed tarball file in ${destination}. Command output:\n${JSON.stringify(output, null, 2)}`);
|
|
6021
6047
|
return path.join(destination, tarballFile);
|
|
@@ -6079,12 +6105,12 @@ async function getBuildOptions(config, format, configDeps, bundle, cjsDts = fals
|
|
|
6079
6105
|
return rolldownConfig;
|
|
6080
6106
|
}
|
|
6081
6107
|
async function resolveInputOptions(config, format, configDeps, bundle, cjsDts, isDualFormat) {
|
|
6082
|
-
const { alias, checks: { legacyCjs, ...checks } = {}, cjsDefault, cwd, deps
|
|
6108
|
+
const { alias, checks: { legacyCjs, ...checks } = {}, cjsDefault, cwd, deps, devtools, dts, entry, env, globImport, loader, logger, nameLabel, nodeProtocol, platform, plugins: userPlugins, report, shims, target, treeshake, tsconfig, unbundle, unused, watch } = config;
|
|
6083
6109
|
const plugins = [];
|
|
6084
6110
|
if (nodeProtocol) plugins.push(NodeProtocolPlugin(nodeProtocol));
|
|
6085
6111
|
if (config.pkg || config.deps.skipNodeModulesBundle) plugins.push(DepsPlugin(config, bundle));
|
|
6086
6112
|
if (dts) {
|
|
6087
|
-
const { dts: dtsPlugin } = await import("./dist-
|
|
6113
|
+
const { dts: dtsPlugin } = await import("./dist-BHLOKn-2.js");
|
|
6088
6114
|
const { cjsReexport: _, ...dtsPluginOptions } = dts;
|
|
6089
6115
|
const options = {
|
|
6090
6116
|
tsconfig,
|
|
@@ -6120,7 +6146,7 @@ async function resolveInputOptions(config, format, configDeps, bundle, cjsDts, i
|
|
|
6120
6146
|
if (watch) plugins.push(WatchPlugin(configDeps, bundle));
|
|
6121
6147
|
if (!cjsDts) plugins.push(userPlugins);
|
|
6122
6148
|
if (cssPostPlugins) plugins.push(...cssPostPlugins);
|
|
6123
|
-
|
|
6149
|
+
let define = {
|
|
6124
6150
|
...config.define,
|
|
6125
6151
|
...Object.keys(env).reduce((acc, key) => {
|
|
6126
6152
|
const value = JSON.stringify(env[key]);
|
|
@@ -6129,11 +6155,29 @@ async function resolveInputOptions(config, format, configDeps, bundle, cjsDts, i
|
|
|
6129
6155
|
return acc;
|
|
6130
6156
|
}, Object.create(null))
|
|
6131
6157
|
};
|
|
6132
|
-
|
|
6158
|
+
let inject;
|
|
6159
|
+
if (shims && !cjsDts) if (unbundle) {
|
|
6160
|
+
define = {
|
|
6161
|
+
...define,
|
|
6162
|
+
...shimsDefine
|
|
6163
|
+
};
|
|
6164
|
+
plugins.push(shimsPlugin);
|
|
6165
|
+
} else inject = getShimsInject(format, platform);
|
|
6166
|
+
const dtsExternal = deps.dts.neverBundle ? functionifyExternal(deps.dts.neverBundle) : void 0;
|
|
6167
|
+
let external;
|
|
6168
|
+
if (deps.neverBundle && dtsExternal) {
|
|
6169
|
+
const jsExternal = functionifyExternal(deps.neverBundle);
|
|
6170
|
+
external = (id, importer, ...args) => {
|
|
6171
|
+
return ((importer ? RE_DTS.test(importer) : false) ? dtsExternal : jsExternal)(id, importer, ...args);
|
|
6172
|
+
};
|
|
6173
|
+
} else if (dtsExternal) external = (id, importer, ...args) => {
|
|
6174
|
+
return (importer ? RE_DTS.test(importer) : false) ? dtsExternal(id, importer, ...args) : void 0;
|
|
6175
|
+
};
|
|
6176
|
+
else external = deps.neverBundle;
|
|
6133
6177
|
return await mergeUserOptions({
|
|
6134
6178
|
input: entry,
|
|
6135
6179
|
cwd,
|
|
6136
|
-
external
|
|
6180
|
+
external,
|
|
6137
6181
|
resolve: { alias },
|
|
6138
6182
|
tsconfig: tsconfig || void 0,
|
|
6139
6183
|
treeshake,
|
|
@@ -6220,6 +6264,13 @@ function CssGuardPlugin() {
|
|
|
6220
6264
|
}
|
|
6221
6265
|
};
|
|
6222
6266
|
}
|
|
6267
|
+
function functionifyExternal(external) {
|
|
6268
|
+
if (typeof external === "function") return external;
|
|
6269
|
+
external = toArray(external);
|
|
6270
|
+
return (id) => {
|
|
6271
|
+
return external.some((item) => item instanceof RegExp ? item.test(id) : item === id);
|
|
6272
|
+
};
|
|
6273
|
+
}
|
|
6223
6274
|
function shortcuts(restart) {
|
|
6224
6275
|
let actionRunning = false;
|
|
6225
6276
|
async function onInput(input) {
|
|
@@ -6436,4 +6487,4 @@ async function buildSingle(config, configDeps, isDualFormat, clean, restart, don
|
|
|
6436
6487
|
}
|
|
6437
6488
|
}
|
|
6438
6489
|
//#endregion
|
|
6439
|
-
export { filename_dts_to as _, resolveUserConfig as a, replaceTemplateName as b, RE_CSS as c, RE_JS as d, RE_JSON as f, RE_VUE as g, RE_TS as h, mergeConfig as i, RE_DTS as l, RE_ROLLDOWN_RUNTIME as m, buildWithConfigs as n, at as o, RE_NODE_MODULES$1 as p,
|
|
6490
|
+
export { filename_dts_to as _, resolveUserConfig as a, replaceTemplateName as b, RE_CSS as c, RE_JS as d, RE_JSON as f, RE_VUE as g, RE_TS as h, mergeConfig as i, RE_DTS as l, RE_ROLLDOWN_RUNTIME as m, buildWithConfigs as n, at as o, RE_NODE_MODULES$1 as p, build_BZshaq8i_exports as r, ee as s, build$1 as t, RE_DTS_MAP as u, filename_js_to_dts as v, resolveTemplateFn as x, filename_to_dts as y };
|
|
@@ -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.22.
|
|
4
|
+
//#region ../../node_modules/.pnpm/tsdown@0.22.1_@arethetypeswrong+core@0.18.2_@tsdown+css@0.22.1_@tsdown+exe@0.22.1_@type_b2f732f99208225f009f13478ba95350/node_modules/tsdown/dist/detect-B97OSl92.mjs
|
|
5
5
|
const AGENTS = [
|
|
6
6
|
"npm",
|
|
7
7
|
"yarn",
|