tsdown 0.13.3 → 0.13.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/README.md +1 -1
- package/dist/{config-aSq_QiwF.d.mts → config-CEEvti7D.d.mts} +1 -1
- package/dist/config.d.mts +2 -2
- package/dist/index.d.mts +2 -2
- package/dist/index.mjs +2 -2
- package/dist/{logger-DScmoUke.mjs → logger-CGMSjTLn.mjs} +3 -1
- package/dist/{migrate-DSSpr3yy.mjs → migrate-BghKfLMP.mjs} +2 -2
- package/dist/package-C-PL6-Mh.mjs +5 -0
- package/dist/plugins.d.mts +1 -1
- package/dist/plugins.mjs +2 -2
- package/dist/run.mjs +4 -4
- package/dist/{src-BaOLpcFF.mjs → src-D6AiyRka.mjs} +590 -567
- package/dist/{types-DahUJE7h.d.mts → types-QuuoDTDl.d.mts} +12 -3
- package/package.json +5 -5
- package/dist/package-Celz_JJW.mjs +0 -5
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<img src="./docs/public/og-image.svg" alt="tsdown" width="100%" /><br>
|
|
2
2
|
|
|
3
|
-
# tsdown [](https://npmjs.com/package/tsdown) [](https://github.com/rolldown/tsdown/actions/workflows/tests.yml) [](https://npmjs.com/package/tsdown) [](https://github.com/rolldown/tsdown/actions/workflows/tests.yml) [](https://stackblitz.com/github/rolldown/tsdown-starter-stackblitz)
|
|
4
4
|
|
|
5
5
|
✨ The elegant bundler for libraries powered by [Rolldown](https://github.com/rolldown/rolldown).
|
|
6
6
|
|
package/dist/config.d.mts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { UserConfig, UserConfigFn } from "./types-
|
|
2
|
-
import { defineConfig } from "./config-
|
|
1
|
+
import { UserConfig, UserConfigFn } from "./types-QuuoDTDl.mjs";
|
|
2
|
+
import { defineConfig } from "./config-CEEvti7D.mjs";
|
|
3
3
|
export { UserConfig, UserConfigFn, defineConfig };
|
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { AttwOptions, BuildContext, ChunkAddon, ChunkAddonFunction, ChunkAddonObject, CopyEntry, CopyOptions, CopyOptionsFn, DtsOptions, ExportsOptions, Format, Logger, ModuleTypes, NormalizedFormat, NormalizedUserConfig, Options, OutExtensionContext, OutExtensionFactory, OutExtensionObject, PackageType, PublintOptions, ReportOptions, ResolvedOptions, RolldownContext, Sourcemap, TsdownChunks, TsdownHooks, UnusedOptions, UserConfig, UserConfigFn, Workspace, globalLogger } from "./types-
|
|
2
|
-
import { defineConfig } from "./config-
|
|
1
|
+
import { AttwOptions, BuildContext, ChunkAddon, ChunkAddonFunction, ChunkAddonObject, CopyEntry, CopyOptions, CopyOptionsFn, DtsOptions, ExportsOptions, Format, Logger, ModuleTypes, NormalizedFormat, NormalizedUserConfig, Options, OutExtensionContext, OutExtensionFactory, OutExtensionObject, PackageType, PublintOptions, ReportOptions, ResolvedOptions, RolldownContext, Sourcemap, TsdownChunks, TsdownHooks, UnusedOptions, UserConfig, UserConfigFn, Workspace, globalLogger } from "./types-QuuoDTDl.mjs";
|
|
2
|
+
import { defineConfig } from "./config-CEEvti7D.mjs";
|
|
3
3
|
|
|
4
4
|
//#region src/index.d.ts
|
|
5
5
|
|
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineConfig } from "./config-CCGWF4al.mjs";
|
|
2
|
-
import { build, buildSingle, shimFile } from "./src-
|
|
3
|
-
import { globalLogger } from "./logger-
|
|
2
|
+
import { build, buildSingle, shimFile } from "./src-D6AiyRka.mjs";
|
|
3
|
+
import { globalLogger } from "./logger-CGMSjTLn.mjs";
|
|
4
4
|
|
|
5
5
|
export { build, buildSingle, defineConfig, globalLogger, shimFile };
|
|
@@ -42,7 +42,7 @@ function format(msgs) {
|
|
|
42
42
|
return msgs.filter((arg) => arg !== void 0 && arg !== false).join(" ");
|
|
43
43
|
}
|
|
44
44
|
const warnedMessages = /* @__PURE__ */ new Set();
|
|
45
|
-
function createLogger(level = "info", { customLogger, console = globalThis.console } = {}) {
|
|
45
|
+
function createLogger(level = "info", { customLogger, console = globalThis.console, failOnWarn = false } = {}) {
|
|
46
46
|
if (customLogger) return customLogger;
|
|
47
47
|
function output(type, msg) {
|
|
48
48
|
const thresh = LogLevels[logger.level];
|
|
@@ -57,12 +57,14 @@ function createLogger(level = "info", { customLogger, console = globalThis.conso
|
|
|
57
57
|
},
|
|
58
58
|
warn(...msgs) {
|
|
59
59
|
const message = format(msgs);
|
|
60
|
+
if (failOnWarn) throw new Error(message);
|
|
60
61
|
warnedMessages.add(message);
|
|
61
62
|
output("warn", `\n${bgYellow` WARN `} ${message}\n`);
|
|
62
63
|
},
|
|
63
64
|
warnOnce(...msgs) {
|
|
64
65
|
const message = format(msgs);
|
|
65
66
|
if (warnedMessages.has(message)) return;
|
|
67
|
+
if (failOnWarn) throw new Error(message);
|
|
66
68
|
warnedMessages.add(message);
|
|
67
69
|
output("warn", `\n${bgYellow` WARN `} ${message}\n`);
|
|
68
70
|
},
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { globalLogger } from "./logger-
|
|
2
|
-
import { version } from "./package-
|
|
1
|
+
import { globalLogger } from "./logger-CGMSjTLn.mjs";
|
|
2
|
+
import { version } from "./package-C-PL6-Mh.mjs";
|
|
3
3
|
import process from "node:process";
|
|
4
4
|
import { bold, green, underline } from "ansis";
|
|
5
5
|
import { readFile, unlink, writeFile } from "node:fs/promises";
|
package/dist/plugins.d.mts
CHANGED
package/dist/plugins.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "./config-CCGWF4al.mjs";
|
|
2
|
-
import { ExternalPlugin, NodeProtocolPlugin, ReportPlugin, ShebangPlugin } from "./src-
|
|
3
|
-
import "./logger-
|
|
2
|
+
import { ExternalPlugin, NodeProtocolPlugin, ReportPlugin, ShebangPlugin } from "./src-D6AiyRka.mjs";
|
|
3
|
+
import "./logger-CGMSjTLn.mjs";
|
|
4
4
|
|
|
5
5
|
export { ExternalPlugin, NodeProtocolPlugin, ReportPlugin, ShebangPlugin };
|
package/dist/run.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { globalLogger, resolveComma, toArray } from "./logger-
|
|
3
|
-
import { version } from "./package-
|
|
2
|
+
import { globalLogger, resolveComma, toArray } from "./logger-CGMSjTLn.mjs";
|
|
3
|
+
import { version } from "./package-C-PL6-Mh.mjs";
|
|
4
4
|
import module from "node:module";
|
|
5
5
|
import process from "node:process";
|
|
6
6
|
import { dim } from "ansis";
|
|
@@ -14,7 +14,7 @@ cli.help().version(version);
|
|
|
14
14
|
cli.command("[...files]", "Bundle files", {
|
|
15
15
|
ignoreOptionDefaultValue: true,
|
|
16
16
|
allowUnknownOptions: true
|
|
17
|
-
}).option("-c, --config <filename>", "Use a custom config file").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("--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("-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("--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 workspace packages, e.g. /regex/ or substring").option("--exports", "Generate export-related metadata for package.json (experimental)").action(async (input, flags) => {
|
|
17
|
+
}).option("-c, --config <filename>", "Use a custom config file").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("--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("-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("--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 workspace packages, e.g. /regex/ or substring").option("--exports", "Generate export-related metadata for package.json (experimental)").action(async (input, flags) => {
|
|
18
18
|
globalLogger.level = flags.logLevel || (flags.silent ? "silent" : "info");
|
|
19
19
|
globalLogger.info(`tsdown ${dim`v${version}`} powered by rolldown ${dim`v${VERSION}`}`);
|
|
20
20
|
const { build: build$1 } = await import("./index.mjs");
|
|
@@ -22,7 +22,7 @@ cli.command("[...files]", "Bundle files", {
|
|
|
22
22
|
await build$1(flags);
|
|
23
23
|
});
|
|
24
24
|
cli.command("migrate", "Migrate from tsup to tsdown").option("-c, --cwd <dir>", "Working directory").option("-d, --dry-run", "Dry run").action(async (args) => {
|
|
25
|
-
const { migrate } = await import("./migrate-
|
|
25
|
+
const { migrate } = await import("./migrate-BghKfLMP.mjs");
|
|
26
26
|
await migrate(args);
|
|
27
27
|
});
|
|
28
28
|
async function runCLI() {
|