tsdown 0.20.0-beta.2 → 0.20.0-beta.3
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/{build-D6KBDCuU.mjs → build-CsyxFAJD.mjs} +8 -8
- package/dist/build-tYZRHwxe.mjs +3 -0
- package/dist/{config-DG-M_Jhl.d.mts → config-hXKGhnVg.d.mts} +1 -2
- package/dist/config.d.mts +2 -2
- package/dist/config.mjs +1 -1
- package/dist/{debug-BkS9sORj.mjs → debug-sur-av42.mjs} +1 -1
- package/dist/index.d.mts +2 -2
- package/dist/index.mjs +4 -4
- package/dist/{logger-scxPimHj.mjs → logger-DL-SZKAr.mjs} +6 -6
- package/dist/{options-BUM1iPoj.mjs → options-DYw0UV2k.mjs} +1 -1
- package/dist/package-DcT-SiWb.mjs +5 -0
- package/dist/plugins.d.mts +1 -1
- package/dist/plugins.mjs +1 -1
- package/dist/run.mjs +4 -4
- package/dist/types-GGFWyR6f.d.mts +1031 -0
- package/dist/{watch-HGpZB4EX.mjs → watch-BsHVuqBb.mjs} +1 -1
- package/package.json +10 -10
- package/dist/build-CXZGeZ37.mjs +0 -3
- package/dist/package-Coy28bEr.mjs +0 -5
- package/dist/types-Dzu__V1_.d.mts +0 -1035
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { createRequire as __cjs_createRequire } from "node:module";
|
|
2
2
|
const __cjs_require = __cjs_createRequire(import.meta.url);
|
|
3
|
-
import { a as globalLogger, d as promiseWithResolvers, h as toArray, m as slash, s as importWithError, t as LogLevels } from "./logger-
|
|
4
|
-
import { a as getPackageType, c as cleanChunks, i as loadConfigFile, l as cleanOutDir, n as mergeUserOptions, o as writeExports, r as resolveUserConfig, s as defaultCssBundleName } from "./options-
|
|
3
|
+
import { a as globalLogger, d as promiseWithResolvers, h as toArray, m as slash, s as importWithError, t as LogLevels } from "./logger-DL-SZKAr.mjs";
|
|
4
|
+
import { a as getPackageType, c as cleanChunks, i as loadConfigFile, l as cleanOutDir, n as mergeUserOptions, o as writeExports, r as resolveUserConfig, s as defaultCssBundleName } from "./options-DYw0UV2k.mjs";
|
|
5
5
|
import { a as fsRemove, r as fsCopy, s as lowestCommonAncestor } from "./format-54qVrVD4.mjs";
|
|
6
|
-
import { t as version } from "./package-
|
|
7
|
-
import { a as ReportPlugin, c as getShimsInject, i as ShebangPlugin, n as endsWithConfig, o as NodeProtocolPlugin, r as addOutDirToChunks, s as ExternalPlugin, t as WatchPlugin } from "./watch-
|
|
6
|
+
import { t as version } from "./package-DcT-SiWb.mjs";
|
|
7
|
+
import { a as ReportPlugin, c as getShimsInject, i as ShebangPlugin, n as endsWithConfig, o as NodeProtocolPlugin, r as addOutDirToChunks, s as ExternalPlugin, t as WatchPlugin } from "./watch-BsHVuqBb.mjs";
|
|
8
8
|
import { mkdtemp, readFile, writeFile } from "node:fs/promises";
|
|
9
9
|
import path from "node:path";
|
|
10
10
|
import process from "node:process";
|
|
@@ -122,8 +122,8 @@ function warnLegacyCJS(config) {
|
|
|
122
122
|
//#region src/features/copy.ts
|
|
123
123
|
async function copy(options) {
|
|
124
124
|
if (!options.copy) return;
|
|
125
|
-
const copy
|
|
126
|
-
const resolved = (await Promise.all(toArray(copy
|
|
125
|
+
const copy = typeof options.copy === "function" ? await options.copy(options) : options.copy;
|
|
126
|
+
const resolved = (await Promise.all(toArray(copy).map(async (entry) => {
|
|
127
127
|
if (typeof entry === "string") entry = { from: [entry] };
|
|
128
128
|
let from = toArray(entry.from);
|
|
129
129
|
if (from.some((f) => isDynamicPattern(f))) from = await glob(from, {
|
|
@@ -318,9 +318,9 @@ async function publint(options) {
|
|
|
318
318
|
}
|
|
319
319
|
const t = performance.now();
|
|
320
320
|
debug$1("Running publint");
|
|
321
|
-
const { publint
|
|
321
|
+
const { publint } = await importWithError("publint", options.publint.resolvePaths);
|
|
322
322
|
const { formatMessage } = await importWithError("publint/utils", options.publint.resolvePaths);
|
|
323
|
-
const { messages } = await publint
|
|
323
|
+
const { messages } = await publint({
|
|
324
324
|
...options.publint,
|
|
325
325
|
pkgDir: path.dirname(options.pkg.packageJsonPath)
|
|
326
326
|
});
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { f as UserConfig, i as InlineConfig, m as UserConfigFn, p as UserConfigExport, s as ResolvedConfig } from "./types-
|
|
1
|
+
import { f as UserConfig, i as InlineConfig, m as UserConfigFn, p as UserConfigExport, s as ResolvedConfig } from "./types-GGFWyR6f.mjs";
|
|
2
2
|
|
|
3
3
|
//#region src/config/options.d.ts
|
|
4
|
-
|
|
5
4
|
/**
|
|
6
5
|
* Resolve user config into resolved configs
|
|
7
6
|
*
|
package/dist/config.d.mts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { f as UserConfig, m as UserConfigFn, p as UserConfigExport } from "./types-
|
|
2
|
-
import { n as mergeConfig, t as defineConfig } from "./config-
|
|
1
|
+
import { f as UserConfig, m as UserConfigFn, p as UserConfigExport } from "./types-GGFWyR6f.mjs";
|
|
2
|
+
import { n as mergeConfig, t as defineConfig } from "./config-hXKGhnVg.mjs";
|
|
3
3
|
export { UserConfig, UserConfigExport, UserConfigFn, defineConfig, mergeConfig };
|
package/dist/config.mjs
CHANGED
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { A as OutExtensionFactory, B as CopyOptions, C as RolldownChunk, D as ChunkAddonFunction, E as ChunkAddon, F as RolldownContext, H as Arrayable, I as TsdownHooks, L as DevtoolsOptions, M as PackageJsonWithPath, N as PackageType, O as ChunkAddonObject, P as BuildContext, R as CssOptions, S as ExportsOptions, T as AttwOptions, V as CopyOptionsFn, _ as ReportOptions, a as NoExternalFn, b as globalLogger, c as Sourcemap, d as UnusedOptions, f as UserConfig, g as Workspace, h as WithEnabled, i as InlineConfig, j as OutExtensionObject, k as OutExtensionContext, l as TreeshakingOptions, m as UserConfigFn, n as DtsOptions, o as NormalizedFormat, p as UserConfigExport, r as Format, s as ResolvedConfig, t as CIOption, u as TsdownInputOption, w as TsdownBundle, x as PublintOptions, y as Logger, z as CopyEntry } from "./types-
|
|
2
|
-
import { n as mergeConfig, r as resolveUserConfig, t as defineConfig } from "./config-
|
|
1
|
+
import { A as OutExtensionFactory, B as CopyOptions, C as RolldownChunk, D as ChunkAddonFunction, E as ChunkAddon, F as RolldownContext, H as Arrayable, I as TsdownHooks, L as DevtoolsOptions, M as PackageJsonWithPath, N as PackageType, O as ChunkAddonObject, P as BuildContext, R as CssOptions, S as ExportsOptions, T as AttwOptions, V as CopyOptionsFn, _ as ReportOptions, a as NoExternalFn, b as globalLogger, c as Sourcemap, d as UnusedOptions, f as UserConfig, g as Workspace, h as WithEnabled, i as InlineConfig, j as OutExtensionObject, k as OutExtensionContext, l as TreeshakingOptions, m as UserConfigFn, n as DtsOptions, o as NormalizedFormat, p as UserConfigExport, r as Format, s as ResolvedConfig, t as CIOption, u as TsdownInputOption, w as TsdownBundle, x as PublintOptions, y as Logger, z as CopyEntry } from "./types-GGFWyR6f.mjs";
|
|
2
|
+
import { n as mergeConfig, r as resolveUserConfig, t as defineConfig } from "./config-hXKGhnVg.mjs";
|
|
3
3
|
import * as Rolldown from "rolldown";
|
|
4
4
|
|
|
5
5
|
//#region src/build.d.ts
|
package/dist/index.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { a as globalLogger } from "./logger-
|
|
2
|
-
import { r as resolveUserConfig, t as mergeConfig } from "./options-
|
|
1
|
+
import { a as globalLogger } from "./logger-DL-SZKAr.mjs";
|
|
2
|
+
import { r as resolveUserConfig, t as mergeConfig } from "./options-DYw0UV2k.mjs";
|
|
3
3
|
import { defineConfig } from "./config.mjs";
|
|
4
|
-
import { n as buildWithConfigs, t as build } from "./build-
|
|
5
|
-
import { t as enableDebug } from "./debug-
|
|
4
|
+
import { n as buildWithConfigs, t as build } from "./build-CsyxFAJD.mjs";
|
|
5
|
+
import { t as enableDebug } from "./debug-sur-av42.mjs";
|
|
6
6
|
import * as Rolldown from "rolldown";
|
|
7
7
|
|
|
8
8
|
export { Rolldown, build, buildWithConfigs, defineConfig, enableDebug, globalLogger, mergeConfig, resolveUserConfig };
|
|
@@ -84,11 +84,11 @@ function clearScreen() {
|
|
|
84
84
|
readline.clearScreenDown(process.stdout);
|
|
85
85
|
}
|
|
86
86
|
const warnedMessages = /* @__PURE__ */ new Set();
|
|
87
|
-
function createLogger(level = "info", { customLogger, console
|
|
87
|
+
function createLogger(level = "info", { customLogger, console = globalThis.console, failOnWarn = false, allowClearScreen = true } = {}) {
|
|
88
88
|
if (customLogger) return customLogger;
|
|
89
89
|
function output(type, msg) {
|
|
90
90
|
if (LogLevels[logger.level] < LogLevels[type]) return;
|
|
91
|
-
console
|
|
91
|
+
console[type === "info" ? "log" : type](msg);
|
|
92
92
|
}
|
|
93
93
|
const clear = allowClearScreen && process.stdout.isTTY && !process.env.CI ? clearScreen : () => {};
|
|
94
94
|
const logger = {
|
|
@@ -127,15 +127,15 @@ function getNameLabel(ansis, name) {
|
|
|
127
127
|
if (!name) return void 0;
|
|
128
128
|
return ansis(`[${name}]`);
|
|
129
129
|
}
|
|
130
|
-
function prettyFormat(format
|
|
131
|
-
const formatColor = format
|
|
130
|
+
function prettyFormat(format) {
|
|
131
|
+
const formatColor = format === "es" ? blue : format === "cjs" ? yellow : noop;
|
|
132
132
|
let formatText;
|
|
133
|
-
switch (format
|
|
133
|
+
switch (format) {
|
|
134
134
|
case "es":
|
|
135
135
|
formatText = "ESM";
|
|
136
136
|
break;
|
|
137
137
|
default:
|
|
138
|
-
formatText = format
|
|
138
|
+
formatText = format.toUpperCase();
|
|
139
139
|
break;
|
|
140
140
|
}
|
|
141
141
|
return formatColor(`[${formatText}]`);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createRequire as __cjs_createRequire } from "node:module";
|
|
2
2
|
const __cjs_require = __cjs_createRequire(import.meta.url);
|
|
3
|
-
import { a as globalLogger, c as matchPattern, f as resolveComma, h as toArray, i as getNameLabel, m as slash, n as createLogger, p as resolveRegex, r as generateColor, u as pkgExists } from "./logger-
|
|
3
|
+
import { a as globalLogger, c as matchPattern, f as resolveComma, h as toArray, i as getNameLabel, m as slash, n as createLogger, p as resolveRegex, r as generateColor, u as pkgExists } from "./logger-DL-SZKAr.mjs";
|
|
4
4
|
import { a as fsRemove, c as stripExtname, i as fsExists, o as fsStat, s as lowestCommonAncestor, t as detectIndentation } from "./format-54qVrVD4.mjs";
|
|
5
5
|
import { readFile } from "node:fs/promises";
|
|
6
6
|
import path from "node:path";
|
package/dist/plugins.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { s as ResolvedConfig, v as ReportPlugin, w as TsdownBundle, y as Logger } from "./types-
|
|
1
|
+
import { s as ResolvedConfig, v as ReportPlugin, w as TsdownBundle, y as Logger } from "./types-GGFWyR6f.mjs";
|
|
2
2
|
import { Plugin } from "rolldown";
|
|
3
3
|
|
|
4
4
|
//#region src/features/external.d.ts
|
package/dist/plugins.mjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { a as ReportPlugin, i as ShebangPlugin, o as NodeProtocolPlugin, s as ExternalPlugin, t as WatchPlugin } from "./watch-
|
|
1
|
+
import { a as ReportPlugin, i as ShebangPlugin, o as NodeProtocolPlugin, s as ExternalPlugin, t as WatchPlugin } from "./watch-BsHVuqBb.mjs";
|
|
2
2
|
|
|
3
3
|
export { ExternalPlugin, NodeProtocolPlugin, ReportPlugin, ShebangPlugin, WatchPlugin };
|
package/dist/run.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { a as globalLogger } from "./logger-
|
|
3
|
-
import { t as version } from "./package-
|
|
4
|
-
import { t as enableDebug } from "./debug-
|
|
2
|
+
import { a as globalLogger } from "./logger-DL-SZKAr.mjs";
|
|
3
|
+
import { t as version } from "./package-DcT-SiWb.mjs";
|
|
4
|
+
import { t as enableDebug } from "./debug-sur-av42.mjs";
|
|
5
5
|
import module from "node:module";
|
|
6
6
|
import process from "node:process";
|
|
7
7
|
import { dim } from "ansis";
|
|
@@ -18,7 +18,7 @@ cli.command("[...files]", "Bundle files", {
|
|
|
18
18
|
}).option("-c, --config <filename>", "Use a custom config file").option("--config-loader <loader>", "Config loader to use: auto, native, unrun", { default: "auto" }).option("--no-config", "Disable config file").option("-f, --format <format>", "Bundle format: esm, cjs, iife, umd", { default: "esm" }).option("--clean", "Clean output directory, --no-clean to disable").option("--external <module>", "Mark dependencies as external").option("--minify", "Minify output").option("--devtools", "Enable devtools integration").option("--debug [feat]", "Show debug logs").option("--target <target>", "Bundle target, e.g \"es2015\", \"esnext\"").option("-l, --logLevel <level>", "Set log level: info, warn, error, silent").option("--fail-on-warn", "Fail on warnings", { default: true }).option("--no-write", "Disable writing files to disk, incompatible with watch mode").option("-d, --out-dir <dir>", "Output directory", { default: "dist" }).option("--treeshake", "Tree-shake bundle", { default: true }).option("--sourcemap", "Generate source map", { default: false }).option("--shims", "Enable cjs and esm shims ", { default: false }).option("--platform <platform>", "Target platform", { default: "node" }).option("--dts", "Generate dts files").option("--publint", "Enable publint", { default: false }).option("--attw", "Enable Are the types wrong integration", { default: false }).option("--unused", "Enable unused dependencies check", { default: false }).option("-w, --watch [path]", "Watch mode").option("--ignore-watch <path>", "Ignore custom paths in watch mode").option("--from-vite [vitest]", "Reuse config from Vite or Vitest").option("--report", "Size report", { default: true }).option("--env.* <value>", "Define compile-time env variables").option("--env-file <file>", "Load environment variables from a file, when used together with --env, variables in --env take precedence").option("--env-prefix <prefix>", "Prefix for env variables to inject into the bundle", { default: "TSDOWN_" }).option("--on-success <command>", "Command to run on success").option("--copy <dir>", "Copy files to output dir").option("--public-dir <dir>", "Alias for --copy, deprecated").option("--tsconfig <tsconfig>", "Set tsconfig path").option("--unbundle", "Unbundle mode").option("-W, --workspace [dir]", "Enable workspace mode").option("-F, --filter <pattern>", "Filter configs (cwd or name), e.g. /pkg-name$/ or pkg-name").option("--exports", "Generate export-related metadata for package.json (experimental)").action(async (input, flags) => {
|
|
19
19
|
globalLogger.level = flags.logLevel || "info";
|
|
20
20
|
globalLogger.info(`tsdown ${dim`v${version}`} powered by rolldown ${dim`v${VERSION}`}`);
|
|
21
|
-
const { build: build$1 } = await import("./build-
|
|
21
|
+
const { build: build$1 } = await import("./build-tYZRHwxe.mjs");
|
|
22
22
|
if (input.length > 0) flags.entry = input;
|
|
23
23
|
await build$1(flags);
|
|
24
24
|
});
|