tsdown 0.10.0 → 0.10.1

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,4 +1,4 @@
1
- import { UserConfig, UserConfigFn } from "./options.d-C1wrHXGf.js";
1
+ import { UserConfig, UserConfigFn } from "./options.d--a1aWVL6.js";
2
2
 
3
3
  //#region src/config.d.ts
4
4
  /**
package/dist/config.d.ts CHANGED
@@ -1,3 +1,3 @@
1
- import { UserConfig, UserConfigFn } from "./options.d-C1wrHXGf.js";
2
- import { defineConfig$1 as defineConfig } from "./config.d-DpTGFaWV.js";
1
+ import { UserConfig, UserConfigFn } from "./options.d--a1aWVL6.js";
2
+ import { defineConfig$1 as defineConfig } from "./config.d-D3EdptPL.js";
3
3
  export { UserConfig, UserConfigFn, defineConfig };
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { BuildContext, Options, ResolvedOptions, TsdownHooks, UserConfig } from "./options.d-C1wrHXGf.js";
2
- import { defineConfig$1 as defineConfig } from "./config.d-DpTGFaWV.js";
1
+ import { BuildContext, Options, ResolvedOptions, TsdownHooks, UserConfig } from "./options.d--a1aWVL6.js";
2
+ import { defineConfig$1 as defineConfig } from "./config.d-D3EdptPL.js";
3
3
  import { ConsolaInstance } from "consola";
4
4
 
5
5
  //#region src/utils/logger.d.ts
package/dist/index.js CHANGED
@@ -127,12 +127,13 @@ function resolveChunkFilename({ outExtensions, fixedExtension, pkg }, inputOptio
127
127
  options: inputOptions,
128
128
  format,
129
129
  pkgType: packageType
130
- });
130
+ }) || {};
131
131
  jsExtension = js;
132
132
  dtsExtension = dts;
133
133
  }
134
134
  jsExtension ||= `.${resolveJsOutputExtension(packageType, format, fixedExtension)}`;
135
- return [createChunkFilename("[name]", jsExtension, dtsExtension), createChunkFilename(`[name]-[hash]`, jsExtension, dtsExtension)];
135
+ const suffix = format === "iife" || format === "umd" ? `.${format}` : "";
136
+ return [createChunkFilename(`[name]${suffix}`, jsExtension, dtsExtension), createChunkFilename(`[name]${suffix}-[hash]`, jsExtension, dtsExtension)];
136
137
  }
137
138
  function createChunkFilename(basename, jsExtension, dtsExtension) {
138
139
  if (!dtsExtension) return `${basename}${jsExtension}`;
@@ -144,11 +145,11 @@ function createChunkFilename(basename, jsExtension, dtsExtension) {
144
145
  //#endregion
145
146
  //#region src/features/publint.ts
146
147
  const debug$2 = Debug("tsdown:publint");
147
- async function publint(pkg) {
148
+ async function publint(pkg, options) {
148
149
  debug$2("Running publint");
149
150
  const { publint: publint$1 } = await import("publint");
150
151
  const { formatMessage } = await import("publint/utils");
151
- const { messages } = await publint$1();
152
+ const { messages } = await publint$1(options);
152
153
  debug$2("Found %d issues", messages.length);
153
154
  if (!messages.length) logger.success("No publint issues found");
154
155
  let hasError = false;
@@ -546,7 +547,7 @@ async function buildSingle(config, clean) {
546
547
  }));
547
548
  if (hasErrors) return;
548
549
  await hooks.callHook("build:done", context);
549
- if (config.publint) if (config.pkg) await publint(config.pkg);
550
+ if (config.publint) if (config.pkg) await publint(config.pkg, config.publint === true ? {} : config.publint);
550
551
  else logger.warn("publint is enabled but package.json is not found");
551
552
  logger.success(`${first ? "Build" : "Rebuild"} complete in ${green(`${Math.round(performance.now() - startTime)}ms`)}`);
552
553
  if (typeof onSuccess === "string") {
@@ -1,4 +1,4 @@
1
- import { version } from "./package-D9H_HrcE.js";
1
+ import { version } from "./package-DfgxaSyP.js";
2
2
  import process from "node:process";
3
3
  import { green, underline } from "ansis";
4
4
  import { readFile, unlink, writeFile } from "node:fs/promises";
@@ -1,4 +1,4 @@
1
- import { BuildOptions, ExternalOption, InputOption, InputOptions, InternalModuleFormat, ModuleFormat, OutputOptions, Plugin } from "rolldown";
1
+ import { BuildOptions, ExternalOption, InputOption, InputOptions, InternalModuleFormat, MinifyOptions, ModuleFormat, OutputOptions, Plugin } from "rolldown";
2
2
  import { Hookable } from "hookable";
3
3
  import { Options } from "publint";
4
4
  import { Options as Options$1 } from "rolldown-plugin-dts";
@@ -51,7 +51,7 @@ interface OutExtensionObject {
51
51
  js?: string;
52
52
  dts?: string;
53
53
  }
54
- type OutExtensionFactory = (ctx: OutExtensionContext) => OutExtensionObject;
54
+ type OutExtensionFactory = (context: OutExtensionContext) => OutExtensionObject | undefined;
55
55
 
56
56
  //#endregion
57
57
  //#region src/features/report.d.ts
@@ -83,11 +83,6 @@ type Arrayable<T> = T | T[];
83
83
  type Sourcemap = boolean | "inline" | "hidden";
84
84
  type Format = Exclude<ModuleFormat, "experimental-app">;
85
85
  type NormalizedFormat = Exclude<InternalModuleFormat, "app">;
86
- interface MinifyOptions {
87
- mangle?: boolean;
88
- compress?: boolean;
89
- removeWhitespace?: boolean;
90
- }
91
86
 
92
87
  /**
93
88
  * Options for tsdown.
@@ -180,7 +175,7 @@ interface Options$3 {
180
175
  /**
181
176
  * Compile-time env variables.
182
177
  * @example
183
- * ```ts
178
+ * ```json
184
179
  * {
185
180
  * "DEBUG": true,
186
181
  * "NODE_ENV": "production"
@@ -0,0 +1,5 @@
1
+ //#region package.json
2
+ var version = "0.10.1";
3
+
4
+ //#endregion
5
+ export { version };
package/dist/plugins.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { ReportPlugin$1 as ReportPlugin, ResolvedOptions } from "./options.d-C1wrHXGf.js";
1
+ import { ReportPlugin$1 as ReportPlugin, ResolvedOptions } from "./options.d--a1aWVL6.js";
2
2
  import { Plugin } from "rolldown";
3
3
  import { PackageJson } from "pkg-types";
4
4
 
package/dist/run.js CHANGED
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  import { logger, resolveComma, setSilent, toArray } from "./general-C06aMSSY.js";
3
- import { version } from "./package-D9H_HrcE.js";
3
+ import { version } from "./package-DfgxaSyP.js";
4
4
  import process from "node:process";
5
5
  import { dim } from "ansis";
6
6
  import Debug from "debug";
@@ -19,7 +19,7 @@ cli.command("[...files]", "Bundle files", { ignoreOptionDefaultValue: true }).op
19
19
  await build$1(flags);
20
20
  });
21
21
  cli.command("migrate", "Migrate from tsup to tsdown").option("-c, --cwd <dir>", "Working directory").option("-d, --dry-run", "Dry run").action(async (args) => {
22
- const { migrate } = await import("./migrate-Cq1rvewL.js");
22
+ const { migrate } = await import("./migrate-CowIU0R_.js");
23
23
  await migrate(args);
24
24
  });
25
25
  async function runCLI() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tsdown",
3
- "version": "0.10.0",
3
+ "version": "0.10.1",
4
4
  "description": "The Elegant Bundler for Libraries",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -63,7 +63,7 @@
63
63
  "empathic": "^1.0.0",
64
64
  "hookable": "^5.5.3",
65
65
  "lightningcss": "^1.29.3",
66
- "rolldown": "1.0.0-beta.8-commit.151352b",
66
+ "rolldown": "1.0.0-beta.8-commit.852c603",
67
67
  "rolldown-plugin-dts": "^0.9.5",
68
68
  "tinyexec": "^1.0.1",
69
69
  "tinyglobby": "^0.2.13",
@@ -1,5 +0,0 @@
1
- //#region package.json
2
- var version = "0.10.0";
3
-
4
- //#endregion
5
- export { version };