tsdown 0.13.0-beta.2 → 0.13.0

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.
@@ -2,9 +2,9 @@ import "ansis";
2
2
  import { BuildOptions, ExternalOption, InputOption, InputOptions, InternalModuleFormat, MinifyOptions, ModuleFormat, OutputAsset, OutputChunk, OutputOptions, Plugin } from "rolldown";
3
3
  import { Hookable } from "hookable";
4
4
  import { CheckPackageOptions } from "@arethetypeswrong/core";
5
- import { Options } from "publint";
6
- import { Options as Options$1 } from "rolldown-plugin-dts";
7
- import { Options as Options$2 } from "unplugin-unused";
5
+ import { Options as PublintOptions } from "publint";
6
+ import { Options as DtsOptions } from "rolldown-plugin-dts";
7
+ import { Options as UnusedOptions } from "unplugin-unused";
8
8
  import { PackageJson } from "pkg-types";
9
9
 
10
10
  //#region src/utils/types.d.ts
@@ -93,7 +93,7 @@ interface TsdownHooks {
93
93
  /**
94
94
  * Build with tsdown.
95
95
  */
96
- declare function build$1(userOptions?: Options$3): Promise<void>;
96
+ declare function build$1(userOptions?: Options): Promise<void>;
97
97
  declare const shimFile: string;
98
98
  type TsdownChunks = Partial<Record<NormalizedFormat, Array<OutputChunk | OutputAsset>>>;
99
99
  /**
@@ -193,7 +193,7 @@ interface Workspace {
193
193
  /**
194
194
  * Options for tsdown.
195
195
  */
196
- interface Options$3 {
196
+ interface Options {
197
197
  /**
198
198
  * Defaults to `'src/index.ts'` if it exists.
199
199
  */
@@ -272,7 +272,8 @@ interface Options$3 {
272
272
  shims?: boolean;
273
273
  /**
274
274
  * The name to show in CLI output. This is useful for monorepos or workspaces.
275
- * Defaults to the package name from `package.json`.
275
+ * When using workspace mode, this option defaults to the package name from package.json.
276
+ * In non-workspace mode, this option must be set explicitly for the name to show in the CLI output.
276
277
  */
277
278
  name?: string;
278
279
  /**
@@ -333,19 +334,19 @@ interface Options$3 {
333
334
  * - If the `types` field is present in `package.json`, declaration file emission is enabled.
334
335
  * - If the `types` field is absent, declaration file emission is disabled by default.
335
336
  */
336
- dts?: boolean | Options$1;
337
+ dts?: boolean | DtsOptions;
337
338
  /**
338
339
  * Enable unused dependencies check with `unplugin-unused`
339
340
  * Requires `unplugin-unused` to be installed.
340
341
  * @default false
341
342
  */
342
- unused?: boolean | Options$2;
343
+ unused?: boolean | UnusedOptions;
343
344
  /**
344
345
  * Run publint after bundling.
345
346
  * Requires `publint` to be installed.
346
347
  * @default false
347
348
  */
348
- publint?: boolean | Options;
349
+ publint?: boolean | PublintOptions;
349
350
  /**
350
351
  * Run `arethetypeswrong` after bundling.
351
352
  * Requires `@arethetypeswrong/core` to be installed.
@@ -447,13 +448,14 @@ interface Options$3 {
447
448
  /**
448
449
  * Options without specifying config file path.
449
450
  */
450
- type UserConfig = Arrayable<Omit<Options$3, "config" | "filter">>;
451
- type UserConfigFn = (cliOptions: Options$3) => Awaitable<UserConfig>;
452
- type ResolvedOptions = Omit<Overwrite<MarkPartial<Omit<Options$3, "publicDir" | "workspace" | "filter">, "globalName" | "inputOptions" | "outputOptions" | "minify" | "define" | "alias" | "external" | "noExternal" | "onSuccess" | "fixedExtension" | "outExtensions" | "hooks" | "removeNodeProtocol" | "copy" | "loader" | "name" | "bundle" | "banner" | "footer">, {
451
+ type UserConfig = Arrayable<Omit<Options, "config" | "filter">>;
452
+ type UserConfigFn = (cliOptions: Options) => Awaitable<UserConfig>;
453
+ type NormalizedUserConfig = Exclude<UserConfig, any[]>;
454
+ type ResolvedOptions = Omit<Overwrite<MarkPartial<Omit<Options, "publicDir" | "workspace" | "filter">, "globalName" | "inputOptions" | "outputOptions" | "minify" | "define" | "alias" | "external" | "noExternal" | "onSuccess" | "fixedExtension" | "outExtensions" | "hooks" | "removeNodeProtocol" | "copy" | "loader" | "name" | "bundle" | "banner" | "footer">, {
453
455
  format: NormalizedFormat[];
454
456
  target?: string[];
455
457
  clean: string[];
456
- dts: false | Options$1;
458
+ dts: false | DtsOptions;
457
459
  report: false | ReportOptions;
458
460
  tsconfig: string | false;
459
461
  pkg?: PackageJson;
@@ -467,4 +469,4 @@ type ResolvedOptions = Omit<Overwrite<MarkPartial<Omit<Options$3, "publicDir" |
467
469
  */
468
470
  declare function defineConfig<const T extends UserConfig | UserConfigFn>(options: T): T;
469
471
  //#endregion
470
- export { type BuildContext, type Options$3 as Options, ReportPlugin, type ResolvedOptions, TsdownChunks, type TsdownHooks, type UserConfig, type UserConfigFn, build$1 as build, buildSingle, defineConfig, logger, shimFile };
472
+ export { type AttwOptions, type BuildContext, type ChunkAddon, type CopyOptions, type DtsOptions, type ExportsOptions, Format, ModuleTypes, NormalizedFormat, NormalizedUserConfig, type Options, type PublintOptions, type ReportOptions, ReportPlugin, type ResolvedOptions, type RolldownContext, Sourcemap, TsdownChunks, type TsdownHooks, type UnusedOptions, type UserConfig, type UserConfigFn, Workspace, build$1 as build, buildSingle, defineConfig, logger, shimFile };
package/dist/config.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- import { UserConfig, UserConfigFn, defineConfig } from "./config--Vetp6NA.mjs";
1
+ import { UserConfig, UserConfigFn, defineConfig } from "./config-9hj-APNF.mjs";
2
2
  export { UserConfig, UserConfigFn, defineConfig };
package/dist/index.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- import { BuildContext, Options, ResolvedOptions, TsdownChunks, TsdownHooks, UserConfig, UserConfigFn, build, buildSingle, defineConfig, logger, shimFile } from "./config--Vetp6NA.mjs";
2
- export { BuildContext, Options, ResolvedOptions, TsdownChunks, TsdownHooks, UserConfig, UserConfigFn, build, buildSingle, defineConfig, logger, shimFile };
1
+ import { AttwOptions, BuildContext, ChunkAddon, CopyOptions, DtsOptions, ExportsOptions, Format, ModuleTypes, NormalizedFormat, NormalizedUserConfig, Options, PublintOptions, ReportOptions, ResolvedOptions, RolldownContext, Sourcemap, TsdownChunks, TsdownHooks, UnusedOptions, UserConfig, UserConfigFn, Workspace, build, buildSingle, defineConfig, logger, shimFile } from "./config-9hj-APNF.mjs";
2
+ export { AttwOptions, BuildContext, ChunkAddon, CopyOptions, DtsOptions, ExportsOptions, Format, ModuleTypes, NormalizedFormat, NormalizedUserConfig, Options, PublintOptions, ReportOptions, ResolvedOptions, RolldownContext, Sourcemap, TsdownChunks, TsdownHooks, UnusedOptions, UserConfig, UserConfigFn, Workspace, build, buildSingle, defineConfig, logger, shimFile };
@@ -1,5 +1,5 @@
1
1
  import { logger } from "./logger-6IV2T7t1.mjs";
2
- import { version } from "./package-BCFwezi2.mjs";
2
+ import { version } from "./package-CtrYqHTS.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.0";
3
+
4
+ //#endregion
5
+ export { version };
@@ -1,4 +1,4 @@
1
- import { ReportPlugin, ResolvedOptions } from "./config--Vetp6NA.mjs";
1
+ import { ReportPlugin, ResolvedOptions } from "./config-9hj-APNF.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 { logger, resolveComma, toArray } from "./logger-6IV2T7t1.mjs";
3
- import { version } from "./package-BCFwezi2.mjs";
3
+ import { version } from "./package-CtrYqHTS.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-DHdrktiR.mjs");
25
+ const { migrate } = await import("./migrate-B4LQBP_A.mjs");
26
26
  await migrate(args);
27
27
  });
28
28
  async function runCLI() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tsdown",
3
- "version": "0.13.0-beta.2",
3
+ "version": "0.13.0",
4
4
  "description": "The Elegant Bundler for Libraries",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -1,5 +0,0 @@
1
- //#region package.json
2
- var version = "0.13.0-beta.2";
3
-
4
- //#endregion
5
- export { version };