tsdown 0.7.1 → 0.7.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.
@@ -0,0 +1,10 @@
1
+ import { UserConfig } from "./options.d-qCI8h4Ee.js";
2
+
3
+ //#region dist/.tsdown-types-es/config.d.ts
4
+ /**
5
+ * Defines the configuration for tsdown.
6
+ */
7
+ declare function defineConfig(options: UserConfig): UserConfig;
8
+
9
+ //#endregion
10
+ export { defineConfig };
package/dist/config.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import "./options.d-BGqD3zwd.js";
2
- import { defineConfig } from "./config.d-ByMb52kT.js";
1
+ import "./options.d-qCI8h4Ee.js";
2
+ import { defineConfig } from "./config.d-C4M__C8G.js";
3
3
 
4
4
  export { defineConfig };
package/dist/index.d.ts CHANGED
@@ -1,15 +1,31 @@
1
- import { Options, ResolvedOptions, UserConfig } from "./options.d-BGqD3zwd.js";
2
- import { defineConfig } from "./config.d-ByMb52kT.js";
1
+ import { Options, ResolvedOptions, UserConfig } from "./options.d-qCI8h4Ee.js";
2
+ import { defineConfig } from "./config.d-C4M__C8G.js";
3
3
  import { ConsolaInstance } from "consola";
4
4
  import "debug";
5
5
 
6
6
  //#region dist/.tsdown-types-es/utils/logger.d.ts
7
+ /**
8
+ * Logger instance
9
+ */
7
10
  declare const logger: ConsolaInstance;
8
11
 
9
12
  //#endregion
10
13
  //#region dist/.tsdown-types-es/index.d.ts
14
+ /**
15
+ * Build with tsdown.
16
+ */
11
17
  declare function build(userOptions?: Options): Promise<void>;
18
+ /**
19
+ * Build a single configuration, without watch and shortcuts features.
20
+ *
21
+ * @param config Resolved options
22
+ */
12
23
  declare const pkgRoot: string;
24
+ /**
25
+ * Build a single configuration, without watch and shortcuts features.
26
+ *
27
+ * @param config Resolved options
28
+ */
13
29
  declare function buildSingle(config: ResolvedOptions): Promise<(() => Promise<void>) | undefined>;
14
30
 
15
31
  //#endregion
package/dist/index.js CHANGED
@@ -387,6 +387,7 @@ async function buildSingle(config) {
387
387
  async function rebuild(first) {
388
388
  const startTime = performance.now();
389
389
  if (clean) await cleanOutDir(outDir, clean);
390
+ let hasErrors = false;
390
391
  await Promise.all(format.map(async (format$1) => {
391
392
  const inputOptions = await mergeUserOptions({
392
393
  input: entry,
@@ -417,12 +418,22 @@ async function buildSingle(config) {
417
418
  entryFileNames: `[name].${extension}`,
418
419
  chunkFileNames: `[name]-[hash].${extension}`
419
420
  }, config.outputOptions, [format$1]);
420
- await build$1({
421
- ...inputOptions,
422
- output: outputOptions
423
- });
424
- if (config.dts && config.bundleDts) await bundleDts(config, extension, format$1);
421
+ try {
422
+ await build$1({
423
+ ...inputOptions,
424
+ output: outputOptions
425
+ });
426
+ if (config.dts && config.bundleDts) await bundleDts(config, extension, format$1);
427
+ } catch (error) {
428
+ if (watch) {
429
+ logger.error(error);
430
+ hasErrors = true;
431
+ return;
432
+ }
433
+ throw error;
434
+ }
425
435
  }));
436
+ if (hasErrors) return;
426
437
  if (config.publint) if (pkg) await publint(pkg);
427
438
  else logger.warn("publint is enabled but package.json is not found");
428
439
  logger.success(`${first ? "Build" : "Rebuild"} complete in ${Math.round(performance.now() - startTime)}ms`);
@@ -1,4 +1,4 @@
1
- import { version } from "./package-BJ0L6v49.js";
1
+ import { version } from "./package-BCtntgcJ.js";
2
2
  import process from "node:process";
3
3
  import { readFile, unlink, writeFile } from "node:fs/promises";
4
4
  import consola from "consola";
@@ -18,12 +18,17 @@ type Arrayable<T> = T | T[];
18
18
 
19
19
  //#endregion
20
20
  //#region dist/.tsdown-types-es/options.d.ts
21
+ /** Resolve external types used in dts files from node_modules */
21
22
  type Sourcemap = boolean | "inline" | "hidden";
23
+ /** Resolve external types used in dts files from node_modules */
22
24
  interface BundleDtsOptions {
23
25
  /** Resolve external types used in dts files from node_modules */
24
26
  resolve?: boolean | (string | RegExp)[];
25
27
  compilerOptions?: CompilerOptions;
26
28
  }
29
+ /**
30
+ * Options for tsdown.
31
+ */
27
32
  interface Options$3 {
28
33
  entry?: InputOptions["input"];
29
34
  external?: ExternalOption;
@@ -86,6 +91,9 @@ interface Options$3 {
86
91
  */
87
92
  publint?: boolean | Options;
88
93
  }
94
+ /**
95
+ * Options without specifying config file path.
96
+ */
89
97
  type UserConfig = Arrayable<Omit<Options$3, "config">>;
90
98
  type NormalizedFormat = Exclude<InternalModuleFormat, "app"> | "experimental-app";
91
99
  type ResolvedOptions = Omit<Overwrite<MarkPartial<Options$3, "globalName" | "inputOptions" | "outputOptions" | "minify" | "target" | "define" | "alias" | "external" | "noExternal" | "onSuccess" | "dts" | "fixedExtension">, {
@@ -0,0 +1,6 @@
1
+
2
+ //#region package.json
3
+ var version = "0.7.3";
4
+
5
+ //#endregion
6
+ export { version };
package/dist/plugins.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { ResolvedOptions } from "./options.d-BGqD3zwd.js";
1
+ import { ResolvedOptions } from "./options.d-qCI8h4Ee.js";
2
2
  import { Plugin } from "rolldown";
3
3
  import { PackageJson } from "pkg-types";
4
4
 
package/dist/run.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { logger, setSilent } from "./logger-9p9U7Sx7.js";
2
- import { version } from "./package-BJ0L6v49.js";
2
+ import { version } from "./package-BCtntgcJ.js";
3
3
  import process from "node:process";
4
4
  import { VERSION } from "rolldown";
5
5
  import { dim } from "ansis";
@@ -16,7 +16,7 @@ cli.command("[...files]", "Bundle files", { ignoreOptionDefaultValue: true }).op
16
16
  await build$1(flags);
17
17
  });
18
18
  cli.command("migrate", "Migrate from tsup to tsdown").option("-c, --cwd <dir>", "Working directory").option("-d, --dry-run", "Dry run").action(async (args) => {
19
- const { migrate } = await import("./migrate-DSjN3NWz.js");
19
+ const { migrate } = await import("./migrate-DiNQaTDo.js");
20
20
  await migrate(args);
21
21
  });
22
22
  async function runCLI() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tsdown",
3
- "version": "0.7.1",
3
+ "version": "0.7.3",
4
4
  "description": "An even faster bundler powered by Rolldown.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -61,12 +61,12 @@
61
61
  "debug": "^4.4.0",
62
62
  "diff": "^7.0.0",
63
63
  "find-up-simple": "^1.0.1",
64
- "oxc-resolver": "^5.0.1",
64
+ "oxc-resolver": "^5.1.0",
65
65
  "rolldown": "^1.0.0-beta.7",
66
- "rolldown-plugin-dts": "https://pkg.pr.new/sxzz/rolldown-plugin-dts@7b446ed",
66
+ "rolldown-plugin-dts": "https://pkg.pr.new/sxzz/rolldown-plugin-dts@ad37673",
67
67
  "tinyglobby": "^0.2.12",
68
68
  "unconfig": "^7.3.1",
69
- "unplugin-isolated-decl": "^0.13.5"
69
+ "unplugin-isolated-decl": "^0.13.6"
70
70
  },
71
71
  "devDependencies": {
72
72
  "@sxzz/eslint-config": "^6.1.1",
@@ -74,20 +74,20 @@
74
74
  "@sxzz/test-utils": "^0.5.4",
75
75
  "@types/debug": "^4.1.12",
76
76
  "@types/diff": "^7.0.2",
77
- "@types/node": "^22.13.14",
77
+ "@types/node": "^22.14.0",
78
78
  "bumpp": "^10.1.0",
79
79
  "eslint": "^9.23.0",
80
- "oxc-transform": "^0.61.2",
80
+ "oxc-transform": "^0.62.0",
81
81
  "pkg-types": "^2.1.0",
82
82
  "prettier": "^3.5.3",
83
- "publint": "^0.3.9",
83
+ "publint": "^0.3.10",
84
84
  "tinyexec": "^1.0.1",
85
85
  "tsup": "^8.4.0",
86
86
  "tsx": "^4.19.3",
87
87
  "typescript": "~5.8.2",
88
88
  "unplugin-ast": "^0.14.4",
89
- "unplugin-unused": "^0.4.3",
90
- "vite": "^6.2.4",
89
+ "unplugin-unused": "^0.4.4",
90
+ "vite": "^6.2.5",
91
91
  "vitest": "^3.1.1"
92
92
  },
93
93
  "engines": {
@@ -1,7 +0,0 @@
1
- import { UserConfig } from "./options.d-BGqD3zwd.js";
2
-
3
- //#region dist/.tsdown-types-es/config.d.ts
4
- declare function defineConfig(options: UserConfig): UserConfig;
5
-
6
- //#endregion
7
- export { defineConfig };
@@ -1,6 +0,0 @@
1
-
2
- //#region package.json
3
- var version = "0.7.1";
4
-
5
- //#endregion
6
- export { version };