@voidzero-dev/vite-plus-core 0.1.21-alpha.2 → 0.1.21-alpha.4
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 +0 -29
- package/dist/rolldown/cli.mjs +6 -6
- package/dist/rolldown/config.mjs +2 -2
- package/dist/rolldown/experimental-index.mjs +8 -8
- package/dist/rolldown/index.mjs +4 -4
- package/dist/rolldown/parallel-plugin-worker.mjs +2 -2
- package/dist/rolldown/parse-ast-index.mjs +1 -1
- package/dist/rolldown/plugins-index.mjs +2 -2
- package/dist/rolldown/shared/{bindingify-input-options-BFomq0CL.mjs → bindingify-input-options-wZdDRbfo.mjs} +27 -5
- package/dist/rolldown/shared/{constructors-CqLClvFc.mjs → constructors-D6i2Tbyl.mjs} +1 -1
- package/dist/rolldown/shared/define-config-5HJ1b9vG.d.mts +2 -2
- package/dist/rolldown/shared/{error-D4ASW9r2.mjs → error-BrnLyQ-g.mjs} +1 -1
- package/dist/rolldown/shared/{load-config-nKXo7Yxg.mjs → load-config-BZFgt8GH.mjs} +1 -1
- package/dist/rolldown/shared/{normalize-string-or-regex-WerlQkgD.mjs → normalize-string-or-regex-dAjLOSbp.mjs} +3 -1
- package/dist/rolldown/shared/{parse-C-X7ajBy.mjs → parse-DFts7Hyl.mjs} +1 -1
- package/dist/rolldown/shared/{resolve-tsconfig-CxJB93yb.mjs → resolve-tsconfig-DCdBlPeK.mjs} +2 -2
- package/dist/rolldown/shared/{rolldown-DNviFDiu.mjs → rolldown-Cs2eRf4R.mjs} +1 -1
- package/dist/rolldown/shared/{rolldown-build-DdPwBoAu.mjs → rolldown-build-CNhzgsn2.mjs} +6 -4
- package/dist/rolldown/shared/{watch-BWGrirtv.mjs → watch-De_8Tgeq.mjs} +4 -4
- package/dist/rolldown/utils-index.mjs +2 -2
- package/dist/tsdown/{build-CgGnBlCD-CmgnJdWt.js → build-5FURNVr0-BYnPlyxS.js} +88 -71
- package/dist/tsdown/{debug-CLlnG64L-Bga2f95T.js → debug-CLlnG64L-DgUic6dq.js} +2 -2
- package/dist/tsdown/{detect-DN3DXXYt-CQvReX03.js → detect-DN3DXXYt-C8fBJ-Pz.js} +1 -1
- package/dist/tsdown/dist-Cv2Z0Bi_.js +1012 -0
- package/dist/tsdown/{dist-dEREUhS4.js → dist-DTzJRoOQ.js} +4898 -4741
- package/dist/tsdown/{filename-DQnUJlio-CkHYanGh.js → filename-DQnUJlio-D7-CzKqs.js} +1 -1
- package/dist/tsdown/index-types.d.ts +259 -92
- package/dist/tsdown/index.js +4 -4
- package/dist/tsdown/{main-BQC8aVfq.js → main-D7FQqhAT.js} +4 -4
- package/dist/tsdown/npm_cjs_chunk_range.cjs +20 -7
- package/dist/tsdown/npm_cjs_chunk_semver.cjs +15 -15
- package/dist/tsdown/npm_entry_semver_ranges_min-version.cjs +1 -1
- package/dist/tsdown/run.js +7 -7
- package/dist/tsdown/{tsc-ILrjzsA_.js → tsc-Dr9kCkDm.js} +2 -2
- package/dist/tsdown/{tsc-context-BBIdwth6.js → tsc-context-CANQEB9U.js} +1 -1
- package/dist/vite/client/client.mjs +7 -7
- package/dist/vite/node/chunks/build.js +19 -19
- package/dist/vite/node/chunks/logger.js +1 -1
- package/dist/vite/node/chunks/node.js +75 -49
- package/dist/vite/node/chunks/postcss-import.js +10 -10
- package/dist/vite/node/index.d.ts +2 -2
- package/dist/vite/node/module-runner.js +14 -3
- package/package.json +19 -15
- package/dist/tsdown/dist-DJhmrSLH.js +0 -739
- package/dist/tsdown/dist-D_AJtdxQ.js +0 -848
- package/dist/tsdown/npm_cjs_chunk_lt.cjs +0 -28
- package/dist/tsdown/npm_entry_semver_functions_lt.cjs +0 -4
- /package/dist/rolldown/shared/{binding-Cf9ARhL0.mjs → binding-ESkOU1xr.mjs} +0 -0
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { n as __exportAll$1, r as __toESM, t as __commonJSMin } from "./chunk-N93fKeF6.js";
|
|
2
|
-
import { C as promiseWithResolvers, D as toArray, E as slash, S as pkgExists, T as resolveRegex, _ as yellow, a as createLogger, b as matchPattern, c as globalLogger, d as bold, f as dim, g as underline, h as red, i as LogLevels, l as prettyFormat, n as V, o as generateColor, p as green, r as version, s as getNameLabel, t as H, u as blue, v as debounce, w as resolveComma, x as noop, y as importWithError } from "./main-
|
|
2
|
+
import { C as promiseWithResolvers, D as toArray, E as slash, S as pkgExists, T as resolveRegex, _ as yellow, a as createLogger, b as matchPattern, c as globalLogger, d as bold, f as dim, g as underline, h as red, i as LogLevels, l as prettyFormat, n as V, o as generateColor, p as green, r as version, s as getNameLabel, t as H, u as blue, v as debounce, w as resolveComma, x as noop, y as importWithError } from "./main-D7FQqhAT.js";
|
|
3
3
|
import { t as createDebug } from "./node-B3Gdtau1.js";
|
|
4
|
-
import { d as filename_js_to_dts, i as RE_JS, n as RE_DTS, o as RE_NODE_MODULES$1, t as RE_CSS } from "./filename-DQnUJlio-
|
|
5
|
-
import "./dist-
|
|
4
|
+
import { d as filename_js_to_dts, i as RE_JS, n as RE_DTS, o as RE_NODE_MODULES$1, t as RE_CSS } from "./filename-DQnUJlio-D7-CzKqs.js";
|
|
5
|
+
import { n as ee } from "./dist-Cv2Z0Bi_.js";
|
|
6
6
|
import module$1, { builtinModules, createRequire, isBuiltin } from "node:module";
|
|
7
7
|
import process$1, { env } from "node:process";
|
|
8
8
|
import readline from "node:readline";
|
|
@@ -23,7 +23,7 @@ import { AsyncLocalStorage } from "node:async_hooks";
|
|
|
23
23
|
import { Buffer } from "node:buffer";
|
|
24
24
|
import { brotliCompress, gzip } from "node:zlib";
|
|
25
25
|
import { importGlobPlugin } from "@voidzero-dev/vite-plus-core/rolldown/experimental";
|
|
26
|
-
//#region ../../node_modules/.pnpm/tsdown@0.
|
|
26
|
+
//#region ../../node_modules/.pnpm/tsdown@0.22.0_@arethetypeswrong+core@0.18.2_@tsdown+css@0.22.0_@tsdown+exe@0.22.0_@type_65ddfddc5f00cd757c3739c1cdd4e920/node_modules/tsdown/dist/fs-Dd6Htx2P.mjs
|
|
27
27
|
function fsExists(path) {
|
|
28
28
|
return access(path).then(() => true, () => false);
|
|
29
29
|
}
|
|
@@ -66,7 +66,7 @@ function stripExtname(filePath) {
|
|
|
66
66
|
return filePath.slice(0, -ext.length);
|
|
67
67
|
}
|
|
68
68
|
//#endregion
|
|
69
|
-
//#region ../../node_modules/.pnpm/tsdown@0.
|
|
69
|
+
//#region ../../node_modules/.pnpm/tsdown@0.22.0_@arethetypeswrong+core@0.18.2_@tsdown+css@0.22.0_@tsdown+exe@0.22.0_@type_65ddfddc5f00cd757c3739c1cdd4e920/node_modules/tsdown/dist/format-CajNSstg.mjs
|
|
70
70
|
const shimFile = path.resolve(import.meta.dirname, "..", "esm-shims.js");
|
|
71
71
|
function getShimsInject(format, platform) {
|
|
72
72
|
if (format === "es" && platform === "node") return {
|
|
@@ -74,7 +74,7 @@ function getShimsInject(format, platform) {
|
|
|
74
74
|
__filename: [shimFile, "__filename"]
|
|
75
75
|
};
|
|
76
76
|
}
|
|
77
|
-
const debug$
|
|
77
|
+
const debug$7 = createDebug("tsdown:deps");
|
|
78
78
|
function resolveDepsConfig(config, logger) {
|
|
79
79
|
let { neverBundle, alwaysBundle, onlyBundle, skipNodeModulesBundle = false } = config.deps || {};
|
|
80
80
|
if (config.external != null) {
|
|
@@ -131,12 +131,12 @@ function DepsPlugin({ pkg, deps: { alwaysBundle, onlyBundle, skipNodeModulesBund
|
|
|
131
131
|
});
|
|
132
132
|
let shouldExternal = await externalStrategy(id, importer, resolved);
|
|
133
133
|
if (Array.isArray(shouldExternal)) {
|
|
134
|
-
debug$
|
|
134
|
+
debug$7("custom resolved id for %o -> %o", id, shouldExternal[1]);
|
|
135
135
|
id = shouldExternal[1];
|
|
136
136
|
shouldExternal = shouldExternal[0];
|
|
137
137
|
}
|
|
138
138
|
const moduleSideEffects = isBuiltin(id) ? false : void 0;
|
|
139
|
-
debug$
|
|
139
|
+
debug$7("shouldExternal: %o = %o", id, shouldExternal);
|
|
140
140
|
if (shouldExternal === true || shouldExternal === "absolute") return {
|
|
141
141
|
id,
|
|
142
142
|
external: shouldExternal,
|
|
@@ -166,7 +166,7 @@ function DepsPlugin({ pkg, deps: { alwaysBundle, onlyBundle, skipNodeModulesBund
|
|
|
166
166
|
if (module) importers.set(parsed.name, new Set([...module.importers, ...importers.get(parsed.name) || []]));
|
|
167
167
|
}
|
|
168
168
|
}
|
|
169
|
-
debug$
|
|
169
|
+
debug$7("found deps in bundle: %o", deps);
|
|
170
170
|
if (onlyBundle) {
|
|
171
171
|
const errors = Array.from(deps).filter((dep) => !matchPattern(dep, onlyBundle)).map((dep) => `${yellow(dep)} is located in ${blue`node_modules`} but is not included in ${blue`deps.onlyBundle`} option.\nTo fix this, either add it to ${blue`deps.onlyBundle`}, declare it as a production or peer dependency in your package.json, or externalize it manually.\nImported by\n${[...importers.get(dep) || []].map((s) => `- ${underline(s)}`).join("\n")}`);
|
|
172
172
|
if (errors.length) this.error(errors.join("\n\n"));
|
|
@@ -3040,7 +3040,7 @@ function up(options) {
|
|
|
3040
3040
|
return up$1("package.json", options);
|
|
3041
3041
|
}
|
|
3042
3042
|
//#endregion
|
|
3043
|
-
//#region ../../node_modules/.pnpm/import-without-cache@0.
|
|
3043
|
+
//#region ../../node_modules/.pnpm/import-without-cache@0.4.0/node_modules/import-without-cache/dist/index.mjs
|
|
3044
3044
|
var __require = /* @__PURE__ */ createRequire(import.meta.url);
|
|
3045
3045
|
const namespace = "no-cache://";
|
|
3046
3046
|
const namespaceLength = 11;
|
|
@@ -3354,7 +3354,7 @@ function createConfigCoreLoader(options) {
|
|
|
3354
3354
|
};
|
|
3355
3355
|
}
|
|
3356
3356
|
//#endregion
|
|
3357
|
-
//#region ../../node_modules/.pnpm/tsdown@0.
|
|
3357
|
+
//#region ../../node_modules/.pnpm/tsdown@0.22.0_@arethetypeswrong+core@0.18.2_@tsdown+css@0.22.0_@tsdown+exe@0.22.0_@type_65ddfddc5f00cd757c3739c1cdd4e920/node_modules/tsdown/dist/options-DUthngzZ.mjs
|
|
3358
3358
|
const __cjs_require$1 = createRequire(import.meta.url);
|
|
3359
3359
|
const picomatch = __cjs_require$1("./npm_entry_picomatch.cjs");
|
|
3360
3360
|
const satisfies$1 = __cjs_require$1("./npm_entry_semver_functions_satisfies.cjs");
|
|
@@ -3722,25 +3722,19 @@ function exportCss(exports, chunks, css, pkgRoot) {
|
|
|
3722
3722
|
return;
|
|
3723
3723
|
}
|
|
3724
3724
|
}
|
|
3725
|
-
function hasExportsTypes(
|
|
3726
|
-
|
|
3727
|
-
if (
|
|
3728
|
-
if (
|
|
3729
|
-
|
|
3730
|
-
if ("." in exports) {
|
|
3731
|
-
const mainExport = exports["."];
|
|
3732
|
-
if (typeof mainExport === "object" && mainExport !== null && "types" in mainExport) return true;
|
|
3733
|
-
}
|
|
3734
|
-
}
|
|
3735
|
-
return false;
|
|
3725
|
+
function hasExportsTypes(value) {
|
|
3726
|
+
if (value == null || typeof value !== "object") return false;
|
|
3727
|
+
if (Array.isArray(value)) return value.some(hasExportsTypes);
|
|
3728
|
+
if ("types" in value) return true;
|
|
3729
|
+
return Object.values(value).some(hasExportsTypes);
|
|
3736
3730
|
}
|
|
3737
3731
|
const RE_SHEBANG$1 = /^#!.*/;
|
|
3738
3732
|
function generateBin(bin, devExports, pkg, chunks, pkgRoot, logger, cwd) {
|
|
3739
|
-
if (
|
|
3740
|
-
if (bin === true || typeof bin === "string") {
|
|
3733
|
+
if (bin === false) return;
|
|
3734
|
+
if (bin === true || bin === void 0 || typeof bin === "string") {
|
|
3741
3735
|
if (!pkg.name) throw new Error("Package name is required when using string form for `bin`");
|
|
3742
3736
|
const binName = pkg.name[0] === "@" ? pkg.name.split("/", 2)[1] : pkg.name;
|
|
3743
|
-
if (bin === true) {
|
|
3737
|
+
if (bin === true || bin === void 0) {
|
|
3744
3738
|
let detected;
|
|
3745
3739
|
const seen = /* @__PURE__ */ new Set();
|
|
3746
3740
|
for (const format of ["es", "cjs"]) {
|
|
@@ -3751,12 +3745,16 @@ function generateBin(bin, devExports, pkg, chunks, pkgRoot, logger, cwd) {
|
|
|
3751
3745
|
if (!RE_SHEBANG$1.test(chunk.code)) continue;
|
|
3752
3746
|
if (seen.has(chunk.facadeModuleId)) continue;
|
|
3753
3747
|
seen.add(chunk.facadeModuleId);
|
|
3754
|
-
if (detected)
|
|
3748
|
+
if (detected) {
|
|
3749
|
+
if (bin === true) throw new Error("Multiple entry chunks with shebangs found. Use `exports.bin: { command: \"./src/file.ts\" }` to specify which one to use.");
|
|
3750
|
+
logger.warn("Multiple entry chunks with shebangs found. Use `exports.bin: true` or `exports.bin: { command: \"./src/file.ts\" }` to configure explicitly.");
|
|
3751
|
+
return;
|
|
3752
|
+
}
|
|
3755
3753
|
detected = devExports ? `./${slash(path.relative(pkgRoot, chunk.facadeModuleId))}` : join$1(pkgRoot, chunk.outDir, slash(chunk.fileName));
|
|
3756
3754
|
}
|
|
3757
3755
|
}
|
|
3758
3756
|
if (detected == null) {
|
|
3759
|
-
logger.warn("`exports.bin` is true but no entry chunks with shebangs were found");
|
|
3757
|
+
if (bin === true) logger.warn("`exports.bin` is true but no entry chunks with shebangs were found");
|
|
3760
3758
|
return;
|
|
3761
3759
|
}
|
|
3762
3760
|
return { [binName]: detected };
|
|
@@ -3865,10 +3863,10 @@ function normalizeFormat(format) {
|
|
|
3865
3863
|
default: return format;
|
|
3866
3864
|
}
|
|
3867
3865
|
}
|
|
3868
|
-
const debug$1$
|
|
3866
|
+
const debug$1$7 = createDebug("tsdown:config:file");
|
|
3869
3867
|
async function loadViteConfig(prefix, cwd, configLoader) {
|
|
3870
3868
|
const loader = resolveConfigLoader(configLoader);
|
|
3871
|
-
debug$1$
|
|
3869
|
+
debug$1$7("Loading Vite config via loader: ", loader);
|
|
3872
3870
|
const parser = createParser(loader);
|
|
3873
3871
|
const [result] = await createConfigCoreLoader({
|
|
3874
3872
|
sources: [{
|
|
@@ -3916,7 +3914,7 @@ async function loadConfigFile(inlineConfig, workspace, rootConfig) {
|
|
|
3916
3914
|
}
|
|
3917
3915
|
}
|
|
3918
3916
|
const loader = resolveConfigLoader(inlineConfig.configLoader);
|
|
3919
|
-
debug$1$
|
|
3917
|
+
debug$1$7("Using config loader:", loader);
|
|
3920
3918
|
const parser = createParser(loader);
|
|
3921
3919
|
const [result] = await createConfigCoreLoader({
|
|
3922
3920
|
sources: overrideConfig ? [{
|
|
@@ -3969,8 +3967,7 @@ const isBun = !!process$1.versions.bun;
|
|
|
3969
3967
|
const nativeTS = process$1.features.typescript || process$1.versions.deno;
|
|
3970
3968
|
const autoLoader = isBun || nativeTS && isSupported ? "native" : "unrun";
|
|
3971
3969
|
function resolveConfigLoader(configLoader = "auto") {
|
|
3972
|
-
|
|
3973
|
-
else return configLoader === "native" ? "native" : "unrun";
|
|
3970
|
+
return configLoader === "auto" ? autoLoader : configLoader;
|
|
3974
3971
|
}
|
|
3975
3972
|
function createParser(loader) {
|
|
3976
3973
|
return async (filepath) => {
|
|
@@ -3981,7 +3978,12 @@ function createParser(loader) {
|
|
|
3981
3978
|
const parsed = JSON.parse(contents);
|
|
3982
3979
|
return [isPkgJson ? parsed?.tsdown : parsed, new Set([filepath])];
|
|
3983
3980
|
}
|
|
3984
|
-
|
|
3981
|
+
switch (loader) {
|
|
3982
|
+
case "native": return nativeImport(filepath);
|
|
3983
|
+
case "tsx": return tsxImport(filepath);
|
|
3984
|
+
case "unrun": return unrunImport(filepath);
|
|
3985
|
+
default: throw new Error(`Unknown config loader: ${loader}`);
|
|
3986
|
+
}
|
|
3985
3987
|
};
|
|
3986
3988
|
}
|
|
3987
3989
|
async function nativeImport(id) {
|
|
@@ -3993,18 +3995,23 @@ async function nativeImport(id) {
|
|
|
3993
3995
|
init({ skipNodeModules: true });
|
|
3994
3996
|
} else if (!isBun) url.searchParams.set("no-cache", crypto.randomUUID());
|
|
3995
3997
|
const mod = await depsStore.run(deps, () => import(url.href, { with: importAttributes }).catch((error) => {
|
|
3996
|
-
if (error?.message?.includes?.("Cannot find module")) throw new Error(`Failed to load the config file. Try setting the --config-loader CLI flag to \`unrun\`.\n\n${error.message}`, { cause: error });
|
|
3997
|
-
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 \`
|
|
3998
|
+
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 });
|
|
3999
|
+
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 });
|
|
3998
4000
|
throw error;
|
|
3999
4001
|
}));
|
|
4000
|
-
return [mod
|
|
4002
|
+
return [mod?.default || mod, deps];
|
|
4003
|
+
}
|
|
4004
|
+
async function tsxImport(id) {
|
|
4005
|
+
const { tsImport } = await importWithError("tsx/esm/api");
|
|
4006
|
+
const module = await tsImport(pathToFileURL(id).href, import.meta.url);
|
|
4007
|
+
return [module?.default || module, new Set([id])];
|
|
4001
4008
|
}
|
|
4002
4009
|
async function unrunImport(id) {
|
|
4003
|
-
const { unrun } = await
|
|
4010
|
+
const { unrun } = await importWithError("unrun");
|
|
4004
4011
|
const { module, dependencies } = await unrun({ path: pathToFileURL(id).href });
|
|
4005
4012
|
return [module, new Set(dependencies)];
|
|
4006
4013
|
}
|
|
4007
|
-
const debug$
|
|
4014
|
+
const debug$8 = createDebug("tsdown:config:options");
|
|
4008
4015
|
const parseEnv = process$1.getBuiltinModule("node:util").parseEnv;
|
|
4009
4016
|
/**
|
|
4010
4017
|
* Resolve user config into resolved configs
|
|
@@ -4026,7 +4033,7 @@ async function resolveUserConfig(userConfig, inlineConfig, configDeps) {
|
|
|
4026
4033
|
const color = generateColor(name);
|
|
4027
4034
|
const nameLabel = getNameLabel(color, name);
|
|
4028
4035
|
if (!filterConfig(inlineConfig.filter, cwd, name)) {
|
|
4029
|
-
debug$
|
|
4036
|
+
debug$8("[filter] skipping config %s", cwd);
|
|
4030
4037
|
return [];
|
|
4031
4038
|
}
|
|
4032
4039
|
const logger = createLogger(logLevel, {
|
|
@@ -4051,7 +4058,12 @@ async function resolveUserConfig(userConfig, inlineConfig, configDeps) {
|
|
|
4051
4058
|
unused = resolveFeatureOption(unused, {});
|
|
4052
4059
|
report = resolveFeatureOption(report, {});
|
|
4053
4060
|
exe = resolveFeatureOption(exe, {});
|
|
4054
|
-
if (dts == null) dts =
|
|
4061
|
+
if (dts == null) if (exe) dts = false;
|
|
4062
|
+
else if (pkg?.types || pkg?.typings || hasExportsTypes(pkg?.exports)) dts = true;
|
|
4063
|
+
else if (tsconfig) {
|
|
4064
|
+
const { config } = ee(tsconfig);
|
|
4065
|
+
dts = !!config.compilerOptions?.declaration;
|
|
4066
|
+
} else dts = false;
|
|
4055
4067
|
dts = resolveFeatureOption(dts, {});
|
|
4056
4068
|
if (!pkg) {
|
|
4057
4069
|
if (exports) throw new Error("`package.json` not found, cannot write exports");
|
|
@@ -4083,7 +4095,7 @@ async function resolveUserConfig(userConfig, inlineConfig, configDeps) {
|
|
|
4083
4095
|
...envFromProcess,
|
|
4084
4096
|
...env
|
|
4085
4097
|
};
|
|
4086
|
-
debug$
|
|
4098
|
+
debug$8(`Environment variables: %O`, env);
|
|
4087
4099
|
configDeps = new Set(configDeps);
|
|
4088
4100
|
if (fromVite) {
|
|
4089
4101
|
const viteUserConfig = await loadViteConfig(fromVite === true ? "vite" : fromVite, cwd, inlineConfig.configLoader);
|
|
@@ -4209,7 +4221,7 @@ function filterConfig(filter, configCwd, name) {
|
|
|
4209
4221
|
return toArray(filter).some((value) => name && name === value || cwd === value);
|
|
4210
4222
|
}
|
|
4211
4223
|
//#endregion
|
|
4212
|
-
//#region ../../node_modules/.pnpm/tsdown@0.
|
|
4224
|
+
//#region ../../node_modules/.pnpm/tsdown@0.22.0_@arethetypeswrong+core@0.18.2_@tsdown+css@0.22.0_@tsdown+exe@0.22.0_@type_65ddfddc5f00cd757c3739c1cdd4e920/node_modules/tsdown/dist/watch-B659_4oi.mjs
|
|
4213
4225
|
async function copy(options) {
|
|
4214
4226
|
if (!options.copy) return;
|
|
4215
4227
|
const resolved = await resolveCopyEntries(options);
|
|
@@ -4284,7 +4296,7 @@ function NodeProtocolPlugin(nodeProtocolOption) {
|
|
|
4284
4296
|
}
|
|
4285
4297
|
};
|
|
4286
4298
|
}
|
|
4287
|
-
const debug$
|
|
4299
|
+
const debug$6 = createDebug("tsdown:report");
|
|
4288
4300
|
const brotliCompressAsync = promisify(brotliCompress);
|
|
4289
4301
|
const gzipAsync = promisify(gzip);
|
|
4290
4302
|
const defaultOptions = {
|
|
@@ -4338,21 +4350,21 @@ async function outputReport(config, chunks, outDir, cjsDts, isDualFormat) {
|
|
|
4338
4350
|
config.logger.info(config.nameLabel, formatLabel, `${sizes.length} files, total: ${totalSizeText}`);
|
|
4339
4351
|
}
|
|
4340
4352
|
async function calcSize(options, chunk) {
|
|
4341
|
-
debug$
|
|
4353
|
+
debug$6(`Calculating size for`, chunk.fileName);
|
|
4342
4354
|
const content = chunk.type === "chunk" ? chunk.code : chunk.source;
|
|
4343
4355
|
const raw = Buffer.byteLength(content, "utf8");
|
|
4344
|
-
debug$
|
|
4356
|
+
debug$6("[size]", chunk.fileName, raw);
|
|
4345
4357
|
let gzip = Infinity;
|
|
4346
4358
|
let brotli = Infinity;
|
|
4347
|
-
if (raw > options.maxCompressSize) debug$
|
|
4359
|
+
if (raw > options.maxCompressSize) debug$6(chunk.fileName, "file size exceeds limit, skip gzip/brotli");
|
|
4348
4360
|
else {
|
|
4349
4361
|
if (options.gzip) {
|
|
4350
4362
|
gzip = (await gzipAsync(content)).length;
|
|
4351
|
-
debug$
|
|
4363
|
+
debug$6("[gzip]", chunk.fileName, gzip);
|
|
4352
4364
|
}
|
|
4353
4365
|
if (options.brotli) {
|
|
4354
4366
|
brotli = (await brotliCompressAsync(content)).length;
|
|
4355
|
-
debug$
|
|
4367
|
+
debug$6("[brotli]", chunk.fileName, brotli);
|
|
4356
4368
|
}
|
|
4357
4369
|
}
|
|
4358
4370
|
return {
|
|
@@ -4589,8 +4601,8 @@ var Hookable = class {
|
|
|
4589
4601
|
}
|
|
4590
4602
|
};
|
|
4591
4603
|
//#endregion
|
|
4592
|
-
//#region ../../node_modules/.pnpm/tsdown@0.
|
|
4593
|
-
var
|
|
4604
|
+
//#region ../../node_modules/.pnpm/tsdown@0.22.0_@arethetypeswrong+core@0.18.2_@tsdown+css@0.22.0_@tsdown+exe@0.22.0_@type_65ddfddc5f00cd757c3739c1cdd4e920/node_modules/tsdown/dist/build-5FURNVr0.mjs
|
|
4605
|
+
var build_5FURNVr0_exports = /* @__PURE__ */ __exportAll$1({
|
|
4594
4606
|
n: () => buildWithConfigs,
|
|
4595
4607
|
r: () => build_exports,
|
|
4596
4608
|
t: () => build$1
|
|
@@ -4609,7 +4621,7 @@ var __exportAll = (all, no_symbols) => {
|
|
|
4609
4621
|
if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
|
|
4610
4622
|
return target;
|
|
4611
4623
|
};
|
|
4612
|
-
const debug$
|
|
4624
|
+
const debug$5 = createDebug("tsdown:config:workspace");
|
|
4613
4625
|
const DEFAULT_EXCLUDE_WORKSPACE = [
|
|
4614
4626
|
"**/node_modules/**",
|
|
4615
4627
|
"**/dist/**",
|
|
@@ -4643,7 +4655,7 @@ async function resolveWorkspace(config, inlineConfig, rootDeps) {
|
|
|
4643
4655
|
if (packages.length === 0) throw new Error("No workspace packages found, please check your config");
|
|
4644
4656
|
return {
|
|
4645
4657
|
configs: (await Promise.all(packages.map(async (cwd) => {
|
|
4646
|
-
debug$
|
|
4658
|
+
debug$5("loading workspace config %s", cwd);
|
|
4647
4659
|
const { configs, deps: workspaceDeps } = await loadConfigFile({
|
|
4648
4660
|
...inlineConfig,
|
|
4649
4661
|
config: workspaceConfig,
|
|
@@ -4655,20 +4667,20 @@ async function resolveWorkspace(config, inlineConfig, rootDeps) {
|
|
|
4655
4667
|
deps
|
|
4656
4668
|
};
|
|
4657
4669
|
}
|
|
4658
|
-
const debug$
|
|
4670
|
+
const debug$4 = createDebug("tsdown:config");
|
|
4659
4671
|
async function resolveConfig(inlineConfig) {
|
|
4660
|
-
debug$
|
|
4672
|
+
debug$4("inline config %O", inlineConfig);
|
|
4661
4673
|
if (inlineConfig.cwd) inlineConfig.cwd = path.resolve(inlineConfig.cwd);
|
|
4662
4674
|
const { configs: rootConfigs, deps: rootDeps } = await loadConfigFile(inlineConfig);
|
|
4663
4675
|
const globalDeps = new Set(rootDeps);
|
|
4664
4676
|
const configs = (await Promise.all(rootConfigs.map(async (rootConfig) => {
|
|
4665
4677
|
const { configs: workspaceConfigs, deps: workspaceDeps } = await resolveWorkspace(rootConfig, inlineConfig, rootDeps);
|
|
4666
|
-
debug$
|
|
4678
|
+
debug$4("workspace configs %O", workspaceConfigs);
|
|
4667
4679
|
const configs = (await Promise.all(workspaceConfigs.filter((config) => !config.workspace || config.entry).map((config) => resolveUserConfig(config, inlineConfig, workspaceDeps)))).flat().filter((config) => !!config);
|
|
4668
4680
|
workspaceDeps.forEach((dep) => globalDeps.add(dep));
|
|
4669
4681
|
return configs;
|
|
4670
4682
|
}))).flat();
|
|
4671
|
-
debug$
|
|
4683
|
+
debug$4("resolved configs %O", configs);
|
|
4672
4684
|
if (configs.length === 0) throw new Error("No valid configuration found.");
|
|
4673
4685
|
return {
|
|
4674
4686
|
configs,
|
|
@@ -4737,7 +4749,7 @@ function executeOnSuccess(config) {
|
|
|
4737
4749
|
} else config.onSuccess(config, ab.signal);
|
|
4738
4750
|
return ab;
|
|
4739
4751
|
}
|
|
4740
|
-
const debug$
|
|
4752
|
+
const debug$3 = createDebug("tsdown:attw");
|
|
4741
4753
|
const label$1 = dim`[attw]`;
|
|
4742
4754
|
const problemFlags = {
|
|
4743
4755
|
NoResolution: "no-resolution",
|
|
@@ -4774,7 +4786,7 @@ async function attw(options, tarball) {
|
|
|
4774
4786
|
const invalidRules = ignoreRules.filter((rule) => !Object.values(problemFlags).includes(rule));
|
|
4775
4787
|
if (invalidRules.length) options.logger.warn(`attw config option 'ignoreRules' contains invalid value '${invalidRules.join(", ")}'.`);
|
|
4776
4788
|
const t = performance.now();
|
|
4777
|
-
debug$
|
|
4789
|
+
debug$3("Running attw check");
|
|
4778
4790
|
const attwCore = options.attw.module || await importWithError("@arethetypeswrong/core");
|
|
4779
4791
|
const pkg = attwCore.createPackageFromTarballData(tarball);
|
|
4780
4792
|
const checkResult = await attwCore.checkPackage(pkg, attwOptions);
|
|
@@ -4815,7 +4827,7 @@ function formatProblem(packageName, problem) {
|
|
|
4815
4827
|
default: return ` ❓ Unknown problem: ${JSON.stringify(problem)}`;
|
|
4816
4828
|
}
|
|
4817
4829
|
}
|
|
4818
|
-
const debug$
|
|
4830
|
+
const debug$2 = createDebug("tsdown:publint");
|
|
4819
4831
|
const label = dim`[publint]`;
|
|
4820
4832
|
async function publint(options, tarball) {
|
|
4821
4833
|
if (!options.publint) return;
|
|
@@ -4824,20 +4836,20 @@ async function publint(options, tarball) {
|
|
|
4824
4836
|
return;
|
|
4825
4837
|
}
|
|
4826
4838
|
const t = performance.now();
|
|
4827
|
-
debug$
|
|
4839
|
+
debug$2("Running publint");
|
|
4828
4840
|
const { publint } = options.publint.module?.[0] || await importWithError("publint");
|
|
4829
4841
|
const { formatMessage } = options.publint.module?.[1] || await importWithError("publint/utils");
|
|
4830
|
-
const { messages } = await publint({
|
|
4842
|
+
const { messages, pkg } = await publint({
|
|
4831
4843
|
...options.publint,
|
|
4832
4844
|
pack: { tarball: tarball.buffer }
|
|
4833
4845
|
});
|
|
4834
|
-
debug$
|
|
4846
|
+
debug$2("Found %d issues", messages.length);
|
|
4835
4847
|
if (!messages.length) {
|
|
4836
4848
|
options.logger.success(options.nameLabel, label, "No issues found", dim`(${Math.round(performance.now() - t)}ms)`);
|
|
4837
4849
|
return;
|
|
4838
4850
|
}
|
|
4839
4851
|
for (const message of messages) {
|
|
4840
|
-
const formattedMessage = formatMessage(message,
|
|
4852
|
+
const formattedMessage = formatMessage(message, pkg);
|
|
4841
4853
|
const logType = {
|
|
4842
4854
|
error: "error",
|
|
4843
4855
|
warning: "warn",
|
|
@@ -4846,6 +4858,7 @@ async function publint(options, tarball) {
|
|
|
4846
4858
|
options.logger[logType](options.nameLabel, label, formattedMessage);
|
|
4847
4859
|
}
|
|
4848
4860
|
}
|
|
4861
|
+
const debug$1 = createDebug("tsdown:pkg");
|
|
4849
4862
|
function initBundleByPkg(configs) {
|
|
4850
4863
|
const map = {};
|
|
4851
4864
|
for (const config of configs) {
|
|
@@ -4887,7 +4900,8 @@ async function bundleDone(bundleByPkg, bundle) {
|
|
|
4887
4900
|
}
|
|
4888
4901
|
const publintConfigs = dedupeConfigs(configs, "publint");
|
|
4889
4902
|
const attwConfigs = dedupeConfigs(configs, "attw");
|
|
4890
|
-
|
|
4903
|
+
const duplicate = publintConfigs[1] || attwConfigs[1];
|
|
4904
|
+
if (duplicate) duplicate.logger.warn(`Multiple publint or attw configurations found for package at ${pkg.packageJsonPath}. Consider merging them for better consistency and performance.`);
|
|
4891
4905
|
try {
|
|
4892
4906
|
if (publintConfigs.length || attwConfigs.length) {
|
|
4893
4907
|
const tarball = await packTarball(pkg.packageJsonPath);
|
|
@@ -4901,13 +4915,17 @@ async function bundleDone(bundleByPkg, bundle) {
|
|
|
4901
4915
|
async function packTarball(packageJsonPath) {
|
|
4902
4916
|
const pkgDir = path.dirname(packageJsonPath);
|
|
4903
4917
|
const destination = await mkdtemp(path.join(tmpdir(), "tsdown-pack-"));
|
|
4904
|
-
const { detect } = await import("./detect-DN3DXXYt-
|
|
4918
|
+
const { detect } = await import("./detect-DN3DXXYt-C8fBJ-Pz.js");
|
|
4905
4919
|
try {
|
|
4906
4920
|
const detected = await detect({ cwd: pkgDir });
|
|
4921
|
+
debug$1("Detected package manager: %o", detected);
|
|
4907
4922
|
if (detected?.name === "deno") throw new Error(`Cannot pack tarball for Deno projects at ${pkgDir}`);
|
|
4908
|
-
|
|
4923
|
+
const tarballPath = await pack(pkgDir, detected, destination, true);
|
|
4924
|
+
debug$1("Packed tarball at %s", tarballPath);
|
|
4925
|
+
return readFile(tarballPath);
|
|
4909
4926
|
} finally {
|
|
4910
|
-
|
|
4927
|
+
if (debug$1.enabled) debug$1("Preserving pack directory for debugging: %s", destination);
|
|
4928
|
+
else await fsRemove(destination);
|
|
4911
4929
|
}
|
|
4912
4930
|
}
|
|
4913
4931
|
function dedupeConfigs(configs, key) {
|
|
@@ -5037,7 +5055,7 @@ async function resolveInputOptions(config, format, configDeps, bundle, cjsDts, i
|
|
|
5037
5055
|
if (nodeProtocol) plugins.push(NodeProtocolPlugin(nodeProtocol));
|
|
5038
5056
|
if (config.pkg || config.deps.skipNodeModulesBundle) plugins.push(DepsPlugin(config, bundle));
|
|
5039
5057
|
if (dts) {
|
|
5040
|
-
const { dts: dtsPlugin } = await import("./dist-
|
|
5058
|
+
const { dts: dtsPlugin } = await import("./dist-DTzJRoOQ.js");
|
|
5041
5059
|
const { cjsReexport: _, ...dtsPluginOptions } = dts;
|
|
5042
5060
|
const options = {
|
|
5043
5061
|
tsconfig,
|
|
@@ -5131,8 +5149,7 @@ async function resolveOutputOptions(inputOptions, config, format, cjsDts) {
|
|
|
5131
5149
|
}, config.outputOptions, [format, { cjsDts }]);
|
|
5132
5150
|
}
|
|
5133
5151
|
async function getDebugRolldownDir() {
|
|
5134
|
-
if (
|
|
5135
|
-
return await mkdtemp(path.join(tmpdir(), "tsdown-config-"));
|
|
5152
|
+
if (debug.enabled) return await mkdtemp(path.join(tmpdir(), "tsdown-config-"));
|
|
5136
5153
|
}
|
|
5137
5154
|
async function debugBuildOptions(dir, name, format, buildOptions) {
|
|
5138
5155
|
const outFile = path.join(dir, `rolldown.config.${format}.js`);
|
|
@@ -5390,4 +5407,4 @@ async function buildSingle(config, configDeps, isDualFormat, clean, restart, don
|
|
|
5390
5407
|
}
|
|
5391
5408
|
}
|
|
5392
5409
|
//#endregion
|
|
5393
|
-
export { resolveUserConfig as a, mergeConfig as i, buildWithConfigs as n,
|
|
5410
|
+
export { resolveUserConfig as a, mergeConfig as i, buildWithConfigs as n, build_5FURNVr0_exports as r, build$1 as t };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { D as toArray, w as resolveComma } from "./main-
|
|
1
|
+
import { D as toArray, w as resolveComma } from "./main-D7FQqhAT.js";
|
|
2
2
|
import { n as enable, r as namespaces, t as createDebug } from "./node-B3Gdtau1.js";
|
|
3
|
-
//#region ../../node_modules/.pnpm/tsdown@0.
|
|
3
|
+
//#region ../../node_modules/.pnpm/tsdown@0.22.0_@arethetypeswrong+core@0.18.2_@tsdown+css@0.22.0_@tsdown+exe@0.22.0_@type_65ddfddc5f00cd757c3739c1cdd4e920/node_modules/tsdown/dist/debug-CLlnG64L.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.
|
|
4
|
+
//#region ../../node_modules/.pnpm/tsdown@0.22.0_@arethetypeswrong+core@0.18.2_@tsdown+css@0.22.0_@tsdown+exe@0.22.0_@type_65ddfddc5f00cd757c3739c1cdd4e920/node_modules/tsdown/dist/detect-DN3DXXYt.mjs
|
|
5
5
|
const AGENTS = [
|
|
6
6
|
"npm",
|
|
7
7
|
"yarn",
|