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.
@@ -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-scxPimHj.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-BUM1iPoj.mjs";
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-Coy28bEr.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-HGpZB4EX.mjs";
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$1 = typeof options.copy === "function" ? await options.copy(options) : options.copy;
126
- const resolved = (await Promise.all(toArray(copy$1).map(async (entry) => {
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: publint$1 } = await importWithError("publint", options.publint.resolvePaths);
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$1({
323
+ const { messages } = await publint({
324
324
  ...options.publint,
325
325
  pkgDir: path.dirname(options.pkg.packageJsonPath)
326
326
  });
@@ -0,0 +1,3 @@
1
+ import { n as buildWithConfigs, t as build } from "./build-CsyxFAJD.mjs";
2
+
3
+ export { build };
@@ -1,7 +1,6 @@
1
- import { f as UserConfig, i as InlineConfig, m as UserConfigFn, p as UserConfigExport, s as ResolvedConfig } from "./types-Dzu__V1_.mjs";
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-Dzu__V1_.mjs";
2
- import { n as mergeConfig, t as defineConfig } from "./config-DG-M_Jhl.mjs";
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
@@ -1,4 +1,4 @@
1
- import { t as mergeConfig } from "./options-BUM1iPoj.mjs";
1
+ import { t as mergeConfig } from "./options-DYw0UV2k.mjs";
2
2
 
3
3
  //#region src/config.ts
4
4
  function defineConfig(options) {
@@ -1,4 +1,4 @@
1
- import { f as resolveComma, h as toArray } from "./logger-scxPimHj.mjs";
1
+ import { f as resolveComma, h as toArray } from "./logger-DL-SZKAr.mjs";
2
2
  import { createDebug, enable, namespaces } from "obug";
3
3
 
4
4
  //#region src/features/debug.ts
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-Dzu__V1_.mjs";
2
- import { n as mergeConfig, r as resolveUserConfig, t as defineConfig } from "./config-DG-M_Jhl.mjs";
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-scxPimHj.mjs";
2
- import { r as resolveUserConfig, t as mergeConfig } from "./options-BUM1iPoj.mjs";
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-D6KBDCuU.mjs";
5
- import { t as enableDebug } from "./debug-BkS9sORj.mjs";
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: console$1 = globalThis.console, failOnWarn = false, allowClearScreen = true } = {}) {
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$1[type === "info" ? "log" : type](msg);
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$1) {
131
- const formatColor = format$1 === "es" ? blue : format$1 === "cjs" ? yellow : noop;
130
+ function prettyFormat(format) {
131
+ const formatColor = format === "es" ? blue : format === "cjs" ? yellow : noop;
132
132
  let formatText;
133
- switch (format$1) {
133
+ switch (format) {
134
134
  case "es":
135
135
  formatText = "ESM";
136
136
  break;
137
137
  default:
138
- formatText = format$1.toUpperCase();
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-scxPimHj.mjs";
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";
@@ -0,0 +1,5 @@
1
+ //#region package.json
2
+ var version = "0.20.0-beta.3";
3
+
4
+ //#endregion
5
+ export { version as t };
@@ -1,4 +1,4 @@
1
- import { s as ResolvedConfig, v as ReportPlugin, w as TsdownBundle, y as Logger } from "./types-Dzu__V1_.mjs";
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-HGpZB4EX.mjs";
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-scxPimHj.mjs";
3
- import { t as version } from "./package-Coy28bEr.mjs";
4
- import { t as enableDebug } from "./debug-BkS9sORj.mjs";
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-CXZGeZ37.mjs");
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
  });