tsdown 0.13.4 → 0.13.5

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 "./types-QuuoDTDl.mjs";
1
+ import { UserConfig, UserConfigFn } from "./types-BMMC0pbr.mjs";
2
2
 
3
3
  //#region src/config.d.ts
4
4
 
package/dist/config.d.mts CHANGED
@@ -1,3 +1,3 @@
1
- import { UserConfig, UserConfigFn } from "./types-QuuoDTDl.mjs";
2
- import { defineConfig } from "./config-CEEvti7D.mjs";
1
+ import { UserConfig, UserConfigFn } from "./types-BMMC0pbr.mjs";
2
+ import { defineConfig } from "./config-77IY7Jdj.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-QuuoDTDl.mjs";
2
- import { defineConfig } from "./config-CEEvti7D.mjs";
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-BMMC0pbr.mjs";
2
+ import { defineConfig } from "./config-77IY7Jdj.mjs";
3
3
 
4
4
  //#region src/index.d.ts
5
5
 
@@ -1,5 +1,5 @@
1
1
  import { globalLogger } from "./logger-CGMSjTLn.mjs";
2
- import { version } from "./package-C-PL6-Mh.mjs";
2
+ import { version } from "./package-TDRl9aMv.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";
@@ -0,0 +1,5 @@
1
+ //#region package.json
2
+ var version = "0.13.5";
3
+
4
+ //#endregion
5
+ export { version };
@@ -1,4 +1,4 @@
1
- import { Logger, ReportPlugin, ResolvedOptions } from "./types-QuuoDTDl.mjs";
1
+ import { Logger, ReportPlugin, ResolvedOptions } from "./types-BMMC0pbr.mjs";
2
2
  import { Plugin } from "rolldown";
3
3
  import { PackageJson } from "pkg-types";
4
4
 
package/dist/run.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  import { globalLogger, resolveComma, toArray } from "./logger-CGMSjTLn.mjs";
3
- import { version } from "./package-C-PL6-Mh.mjs";
3
+ import { version } from "./package-TDRl9aMv.mjs";
4
4
  import module from "node:module";
5
5
  import process from "node:process";
6
6
  import { dim } from "ansis";
@@ -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-BghKfLMP.mjs");
25
+ const { migrate } = await import("./migrate-BCQUL2Gs.mjs");
26
26
  await migrate(args);
27
27
  });
28
28
  async function runCLI() {
@@ -185,6 +185,11 @@ interface Options {
185
185
  entry?: InputOption;
186
186
  external?: ExternalOption;
187
187
  noExternal?: Arrayable<string | RegExp> | ((id: string, importer: string | undefined) => boolean | null | undefined | void);
188
+ /**
189
+ * Skip bundling `node_modules`.
190
+ * @default false
191
+ */
192
+ skipNodeModulesBundle?: boolean;
188
193
  alias?: Record<string, string>;
189
194
  tsconfig?: string | boolean;
190
195
  /**
@@ -199,27 +204,6 @@ interface Options {
199
204
  * @see https://tsdown.dev/options/platform
200
205
  */
201
206
  platform?: "node" | "neutral" | "browser";
202
- inputOptions?: InputOptions | ((options: InputOptions, format: NormalizedFormat, context: {
203
- cjsDts: boolean;
204
- }) => Awaitable<InputOptions | void | null>);
205
- /** @default ['es'] */
206
- format?: Format | Format[];
207
- globalName?: string;
208
- /** @default 'dist' */
209
- outDir?: string;
210
- /** @default false */
211
- sourcemap?: Sourcemap;
212
- /**
213
- * Clean directories before build.
214
- *
215
- * Default to output directory.
216
- * @default true
217
- */
218
- clean?: boolean | string[];
219
- /** @default false */
220
- minify?: boolean | "dce-only" | MinifyOptions;
221
- footer?: ChunkAddon;
222
- banner?: ChunkAddon;
223
207
  /**
224
208
  * Specifies the compilation target environment(s).
225
209
  *
@@ -244,6 +228,86 @@ interface Options {
244
228
  */
245
229
  target?: string | string[] | false;
246
230
  /**
231
+ * Compile-time env variables.
232
+ * @example
233
+ * ```json
234
+ * {
235
+ * "DEBUG": true,
236
+ * "NODE_ENV": "production"
237
+ * }
238
+ * ```
239
+ */
240
+ env?: Record<string, any>;
241
+ define?: Record<string, string>;
242
+ /** @default false */
243
+ shims?: boolean;
244
+ /**
245
+ * @default true
246
+ */
247
+ treeshake?: boolean;
248
+ loader?: ModuleTypes;
249
+ /**
250
+ * If enabled, strips the `node:` protocol prefix from import source.
251
+ *
252
+ * @default false
253
+ * @deprecated Use `nodeProtocol: 'strip'` instead.
254
+ *
255
+ * @example
256
+ * // With removeNodeProtocol enabled:
257
+ * import('node:fs'); // becomes import('fs')
258
+ */
259
+ removeNodeProtocol?: boolean;
260
+ /**
261
+ * - If true, add `node:` prefix to built-in modules.
262
+ * - If 'strip', strips the `node:` protocol prefix from import source.
263
+ * - If false, does not modify the import source.
264
+ *
265
+ * @default false
266
+ *
267
+ * @example
268
+ * // With nodeProtocol enabled:
269
+ * import('fs'); // becomes import('node:fs')
270
+ * // With nodeProtocol set to 'strip':
271
+ * import('node:fs'); // becomes import('fs')
272
+ * // With nodeProtocol set to false:
273
+ * import('node:fs'); // remains import('node:fs')
274
+ *
275
+ */
276
+ nodeProtocol?: "strip" | boolean;
277
+ plugins?: InputOptions["plugins"];
278
+ /**
279
+ * Sets how input files are processed.
280
+ * For example, use 'js' to treat files as JavaScript or 'base64' for images.
281
+ * Lets you import or require files like images or fonts.
282
+ * @example
283
+ * ```json
284
+ * { '.jpg': 'asset', '.png': 'base64' }
285
+ * ```
286
+ */
287
+ inputOptions?: InputOptions | ((options: InputOptions, format: NormalizedFormat, context: {
288
+ cjsDts: boolean;
289
+ }) => Awaitable<InputOptions | void | null>);
290
+ /** @default ['es'] */
291
+ format?: Format | Format[];
292
+ globalName?: string;
293
+ /** @default 'dist' */
294
+ outDir?: string;
295
+ /** @default false */
296
+ sourcemap?: Sourcemap;
297
+ /**
298
+ * Clean directories before build.
299
+ *
300
+ * Default to output directory.
301
+ * @default true
302
+ */
303
+ clean?: boolean | string[];
304
+ /**
305
+ * @default false
306
+ */
307
+ minify?: boolean | "dce-only" | MinifyOptions;
308
+ footer?: ChunkAddon;
309
+ banner?: ChunkAddon;
310
+ /**
247
311
  * Determines whether unbundle mode is enabled.
248
312
  * When set to true, the output files will mirror the input file structure.
249
313
  * @default false
@@ -254,15 +318,6 @@ interface Options {
254
318
  * @default true
255
319
  */
256
320
  bundle?: boolean;
257
- define?: Record<string, string>;
258
- /** @default false */
259
- shims?: boolean;
260
- /**
261
- * The name to show in CLI output. This is useful for monorepos or workspaces.
262
- * When using workspace mode, this option defaults to the package name from package.json.
263
- * In non-workspace mode, this option must be set explicitly for the name to show in the CLI output.
264
- */
265
- name?: string;
266
321
  /**
267
322
  * Use a fixed extension for output files.
268
323
  * The extension will always be `.cjs` or `.mjs`.
@@ -276,25 +331,29 @@ interface Options {
276
331
  */
277
332
  outExtensions?: OutExtensionFactory;
278
333
  /**
334
+ * If enabled, appends hash to chunk filenames.
335
+ * @default true
336
+ */
337
+ hash?: boolean;
338
+ /**
279
339
  * @default true
280
340
  */
281
341
  cjsDefault?: boolean;
282
342
  outputOptions?: OutputOptions | ((options: OutputOptions, format: NormalizedFormat, context: {
283
343
  cjsDts: boolean;
284
344
  }) => Awaitable<OutputOptions | void | null>);
285
- /** @default true */
286
- treeshake?: boolean;
287
- plugins?: InputOptions["plugins"];
288
345
  /**
289
- * Sets how input files are processed.
290
- * For example, use 'js' to treat files as JavaScript or 'base64' for images.
291
- * Lets you import or require files like images or fonts.
292
- * @example
293
- * ```json
294
- * { '.jpg': 'asset', '.png': 'base64' }
295
- * ```
346
+ * The working directory of the config file.
347
+ * - Defaults to `process.cwd()` for root config.
348
+ * - Defaults to the package directory for workspace config.
296
349
  */
297
- loader?: ModuleTypes;
350
+ cwd?: string;
351
+ /**
352
+ * The name to show in CLI output. This is useful for monorepos or workspaces.
353
+ * When using workspace mode, this option defaults to the package name from package.json.
354
+ * In non-workspace mode, this option must be set explicitly for the name to show in the CLI output.
355
+ */
356
+ name?: string;
298
357
  /**
299
358
  * @default false
300
359
  * @deprecated Use `logLevel` instead.
@@ -318,23 +377,20 @@ interface Options {
318
377
  * Config file path
319
378
  */
320
379
  config?: boolean | string;
321
- /** @default false */
322
- watch?: boolean | Arrayable<string>;
323
- ignoreWatch?: Arrayable<string | RegExp>;
324
380
  /**
325
- * You can specify command to be executed after a successful build, specially useful for Watch mode
381
+ * Reuse config from Vite or Vitest (experimental)
382
+ * @default false
326
383
  */
327
- onSuccess?: string | ((config: ResolvedOptions, signal: AbortSignal) => void | Promise<void>);
384
+ fromVite?: boolean | "vitest";
328
385
  /**
329
- * Skip bundling `node_modules`.
330
386
  * @default false
331
387
  */
332
- skipNodeModulesBundle?: boolean;
388
+ watch?: boolean | Arrayable<string>;
389
+ ignoreWatch?: Arrayable<string | RegExp>;
333
390
  /**
334
- * Reuse config from Vite or Vitest (experimental)
335
- * @default false
391
+ * You can specify command to be executed after a successful build, specially useful for Watch mode
336
392
  */
337
- fromVite?: boolean | "vitest";
393
+ onSuccess?: string | ((config: ResolvedOptions, signal: AbortSignal) => void | Promise<void>);
338
394
  /**
339
395
  * Emit TypeScript declaration files (.d.ts).
340
396
  *
@@ -376,17 +432,6 @@ interface Options {
376
432
  */
377
433
  exports?: boolean | ExportsOptions;
378
434
  /**
379
- * Compile-time env variables.
380
- * @example
381
- * ```json
382
- * {
383
- * "DEBUG": true,
384
- * "NODE_ENV": "production"
385
- * }
386
- * ```
387
- */
388
- env?: Record<string, any>;
389
- /**
390
435
  * @deprecated Alias for `copy`, will be removed in the future.
391
436
  */
392
437
  publicDir?: CopyOptions | CopyOptionsFn;
@@ -403,45 +448,6 @@ interface Options {
403
448
  copy?: CopyOptions | CopyOptionsFn;
404
449
  hooks?: Partial<TsdownHooks> | ((hooks: Hookable<TsdownHooks>) => Awaitable<void>);
405
450
  /**
406
- * If enabled, strips the `node:` protocol prefix from import source.
407
- *
408
- * @default false
409
- * @deprecated Use `nodeProtocol: 'strip'` instead.
410
- *
411
- * @example
412
- * // With removeNodeProtocol enabled:
413
- * import('node:fs'); // becomes import('fs')
414
- */
415
- removeNodeProtocol?: boolean;
416
- /**
417
- * - If true, add `node:` prefix to built-in modules.
418
- * - If 'strip', strips the `node:` protocol prefix from import source.
419
- * - If false, does not modify the import source.
420
- *
421
- * @default false
422
- *
423
- * @example
424
- * // With nodeProtocol enabled:
425
- * import('fs'); // becomes import('node:fs')
426
- * // With nodeProtocol set to 'strip':
427
- * import('node:fs'); // becomes import('fs')
428
- * // With nodeProtocol set to false:
429
- * import('node:fs'); // remains import('node:fs')
430
- *
431
- */
432
- nodeProtocol?: "strip" | boolean;
433
- /**
434
- * If enabled, appends hash to chunk filenames.
435
- * @default true
436
- */
437
- hash?: boolean;
438
- /**
439
- * The working directory of the config file.
440
- * - Defaults to `process.cwd()` for root config.
441
- * - Defaults to the package directory for workspace config.
442
- */
443
- cwd?: string;
444
- /**
445
451
  * **[experimental]** Enable workspace mode.
446
452
  * This allows you to build multiple packages in a monorepo.
447
453
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tsdown",
3
- "version": "0.13.4",
3
+ "version": "0.13.5",
4
4
  "description": "The Elegant Bundler for Libraries",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -74,7 +74,7 @@
74
74
  "diff": "^8.0.2",
75
75
  "empathic": "^2.0.0",
76
76
  "hookable": "^5.5.3",
77
- "rolldown": "^1.0.0-beta.31",
77
+ "rolldown": "latest",
78
78
  "rolldown-plugin-dts": "^0.15.6",
79
79
  "semver": "^7.7.2",
80
80
  "tinyexec": "^1.0.1",
@@ -88,12 +88,12 @@
88
88
  "@sxzz/prettier-config": "^2.2.3",
89
89
  "@sxzz/test-utils": "^0.5.9",
90
90
  "@types/debug": "^4.1.12",
91
- "@types/node": "^24.2.0",
91
+ "@types/node": "^24.2.1",
92
92
  "@types/semver": "^7.7.0",
93
93
  "@unocss/eslint-plugin": "^66.4.2",
94
94
  "@vueuse/core": "^13.6.0",
95
95
  "bumpp": "^10.2.2",
96
- "eslint": "^9.32.0",
96
+ "eslint": "^9.33.0",
97
97
  "lightningcss": "^1.30.1",
98
98
  "oxc-minify": "^0.81.0",
99
99
  "pkg-types": "^2.2.0",
@@ -109,7 +109,7 @@
109
109
  "unplugin-unused": "^0.5.1",
110
110
  "vite": "npm:rolldown-vite@latest",
111
111
  "vitepress": "^2.0.0-alpha.7",
112
- "vitepress-plugin-group-icons": "^1.6.1",
112
+ "vitepress-plugin-group-icons": "^1.6.2",
113
113
  "vitepress-plugin-llms": "^1.7.2",
114
114
  "vitest": "^3.2.4",
115
115
  "vue": "^3.5.18"
@@ -1,5 +0,0 @@
1
- //#region package.json
2
- var version = "0.13.4";
3
-
4
- //#endregion
5
- export { version };