tsdown 0.12.6 → 0.12.7

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,9 +1,9 @@
1
1
  import "ansis";
2
2
  import { BuildOptions, ExternalOption, InputOption, InputOptions, InternalModuleFormat, MinifyOptions, ModuleFormat, OutputAsset, OutputChunk, OutputOptions, Plugin } from "rolldown";
3
- import { Options } from "rolldown-plugin-dts";
4
3
  import { Hookable } from "hookable";
5
4
  import { CheckPackageOptions } from "@arethetypeswrong/core";
6
- import { Options as Options$1 } from "publint";
5
+ import { Options } from "publint";
6
+ import { Options as Options$1 } from "rolldown-plugin-dts";
7
7
  import { Options as Options$2 } from "unplugin-unused";
8
8
  import { PackageJson } from "pkg-types";
9
9
 
@@ -290,7 +290,7 @@ interface Options$3 {
290
290
  * - If the `types` field is present in `package.json`, declaration file emission is enabled.
291
291
  * - If the `types` field is absent, declaration file emission is disabled by default.
292
292
  */
293
- dts?: boolean | Options;
293
+ dts?: boolean | Options$1;
294
294
  /**
295
295
  * Enable unused dependencies check with `unplugin-unused`
296
296
  * Requires `unplugin-unused` to be installed.
@@ -302,7 +302,7 @@ interface Options$3 {
302
302
  * Requires `publint` to be installed.
303
303
  * @default false
304
304
  */
305
- publint?: boolean | Options$1;
305
+ publint?: boolean | Options;
306
306
  /**
307
307
  * Run `arethetypeswrong` after bundling.
308
308
  * Requires `@arethetypeswrong/core` to be installed.
@@ -390,7 +390,7 @@ type ResolvedOptions = Omit<Overwrite<MarkPartial<Omit<Options$3, "publicDir" |
390
390
  format: NormalizedFormat[];
391
391
  target?: string[];
392
392
  clean: string[];
393
- dts: false | Options;
393
+ dts: false | Options$1;
394
394
  report: false | ReportOptions;
395
395
  tsconfig: string | false;
396
396
  pkg?: PackageJson;
@@ -0,0 +1,2 @@
1
+ import { UserConfig, UserConfigFn, defineConfig } from "./config-BJDUww56.mjs";
2
+ export { UserConfig, UserConfigFn, defineConfig };
@@ -0,0 +1,3 @@
1
+ import { defineConfig } from "./config-CzjtjH-U.mjs";
2
+
3
+ export { defineConfig };
@@ -1,2 +1,2 @@
1
- import { BuildContext, Options, TsdownChunks, TsdownHooks, UserConfig, UserConfigFn, build, buildSingle, defineConfig, logger, pkgRoot } from "./config-CzJapb1X.js";
1
+ import { BuildContext, Options, TsdownChunks, TsdownHooks, UserConfig, UserConfigFn, build, buildSingle, defineConfig, logger, pkgRoot } from "./config-BJDUww56.mjs";
2
2
  export { BuildContext, Options, TsdownChunks, TsdownHooks, UserConfig, UserConfigFn, build, buildSingle, defineConfig, logger, pkgRoot };
@@ -1,6 +1,6 @@
1
- import { defineConfig } from "./config-yiJy1jd0.js";
2
- import { ExternalPlugin, NodeProtocolPlugin, ReportPlugin, ShebangPlugin, fsCopy, fsExists, fsRemove, fsStat, lowestCommonAncestor } from "./plugins-BxGX3AUF.js";
3
- import { debounce, generateColor, logger, prettyName, resolveComma, resolveRegex, slash, toArray } from "./logger-BMB8Jggq.js";
1
+ import { defineConfig } from "./config-CzjtjH-U.mjs";
2
+ import { ExternalPlugin, NodeProtocolPlugin, ReportPlugin, ShebangPlugin, fsCopy, fsExists, fsRemove, fsStat, lowestCommonAncestor } from "./plugins-BmNEEFYs.mjs";
3
+ import { debounce, generateColor, logger, prettyName, resolveComma, resolveRegex, slash, toArray } from "./logger-CdK2zFTY.mjs";
4
4
  import path from "node:path";
5
5
  import process from "node:process";
6
6
  import { fileURLToPath, pathToFileURL } from "node:url";
@@ -13,7 +13,7 @@ import { tmpdir } from "node:os";
13
13
  import { promisify } from "node:util";
14
14
  import debug from "debug";
15
15
  import { glob } from "tinyglobby";
16
- import { RE_DTS } from "rolldown-plugin-dts";
16
+ import { RE_DTS } from "rolldown-plugin-dts/filename";
17
17
  import { createHooks } from "hookable";
18
18
  import { up } from "empathic/package";
19
19
  import readline from "node:readline";
@@ -1,5 +1,5 @@
1
- import { logger } from "./logger-BMB8Jggq.js";
2
- import { version } from "./package-BWIL_dgZ.js";
1
+ import { logger } from "./logger-CdK2zFTY.mjs";
2
+ import { version } from "./package-ZDuXNobF.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.12.7";
3
+
4
+ //#endregion
5
+ export { version };
@@ -1,11 +1,11 @@
1
- import { logger, noop, prettyFormat, prettyName, toArray } from "./logger-BMB8Jggq.js";
1
+ import { logger, noop, prettyFormat, prettyName, toArray } from "./logger-CdK2zFTY.mjs";
2
2
  import { isBuiltin } from "node:module";
3
3
  import path, { dirname, normalize, sep } from "node:path";
4
4
  import { bold, dim, green, underline } from "ansis";
5
5
  import { access, chmod, cp, rm, stat } from "node:fs/promises";
6
6
  import { promisify } from "node:util";
7
7
  import debug from "debug";
8
- import { RE_DTS } from "rolldown-plugin-dts";
8
+ import { RE_DTS } from "rolldown-plugin-dts/filename";
9
9
  import { Buffer } from "node:buffer";
10
10
  import { brotliCompress, gzip } from "node:zlib";
11
11
 
@@ -113,11 +113,7 @@ function NodeProtocolPlugin() {
113
113
  //#region src/utils/format.ts
114
114
  function formatBytes(bytes) {
115
115
  if (bytes === Infinity) return void 0;
116
- const numberFormatter = new Intl.NumberFormat("en", {
117
- maximumFractionDigits: 2,
118
- minimumFractionDigits: 2
119
- });
120
- return `${numberFormatter.format(bytes / 1e3)} kB`;
116
+ return `${(bytes / 1e3).toFixed(2)} kB`;
121
117
  }
122
118
 
123
119
  //#endregion
@@ -1,4 +1,4 @@
1
- import { ReportPlugin, ResolvedOptions } from "./config-CzJapb1X.js";
1
+ import { ReportPlugin, ResolvedOptions } from "./config-BJDUww56.mjs";
2
2
  import { Plugin } from "rolldown";
3
3
  import { PackageJson } from "pkg-types";
4
4
 
@@ -1,4 +1,4 @@
1
- import { ExternalPlugin, NodeProtocolPlugin, ReportPlugin, ShebangPlugin } from "./plugins-BxGX3AUF.js";
2
- import "./logger-BMB8Jggq.js";
1
+ import { ExternalPlugin, NodeProtocolPlugin, ReportPlugin, ShebangPlugin } from "./plugins-BmNEEFYs.mjs";
2
+ import "./logger-CdK2zFTY.mjs";
3
3
 
4
4
  export { ExternalPlugin, NodeProtocolPlugin, ReportPlugin, ShebangPlugin };
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
- import { logger, resolveComma, toArray } from "./logger-BMB8Jggq.js";
3
- import { version } from "./package-BWIL_dgZ.js";
2
+ import { logger, resolveComma, toArray } from "./logger-CdK2zFTY.mjs";
3
+ import { version } from "./package-ZDuXNobF.mjs";
4
4
  import module from "node:module";
5
5
  import process from "node:process";
6
6
  import { dim } from "ansis";
@@ -17,12 +17,12 @@ cli.command("[...files]", "Bundle files", {
17
17
  }).option("-c, --config <filename>", "Use a custom config file").option("--no-config", "Disable config file").option("-f, --format <format>", "Bundle format: esm, cjs, iife", { default: "esm" }).option("--clean", "Clean output directory, --no-clean to disable").option("--external <module>", "Mark dependencies as external").option("--minify", "Minify output").option("--debug [feat]", "Show debug logs").option("--target <target>", "Bundle target, e.g \"es2015\", \"esnext\"").option("--silent", "Suppress non-error logs").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("--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 workspace packages, e.g. /regex/ or substring").option("--exports", "Generate export-related metadata for package.json (experimental)").action(async (input, flags) => {
18
18
  logger.setSilent(!!flags.silent);
19
19
  logger.info(`tsdown ${dim`v${version}`} powered by rolldown ${dim`v${VERSION}`}`);
20
- const { build: build$1 } = await import("./index.js");
20
+ const { build: build$1 } = await import("./index.mjs");
21
21
  if (input.length > 0) flags.entry = input;
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-BcMqjqIs.js");
25
+ const { migrate } = await import("./migrate-CMJIC73T.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.12.6",
3
+ "version": "0.12.7",
4
4
  "description": "The Elegant Bundler for Libraries",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -18,14 +18,14 @@
18
18
  "dist",
19
19
  "esm-shims.js"
20
20
  ],
21
- "main": "./dist/index.js",
22
- "module": "./dist/index.js",
23
- "types": "./dist/index.d.ts",
21
+ "main": "./dist/index.mjs",
22
+ "module": "./dist/index.mjs",
23
+ "types": "./dist/index.d.mts",
24
24
  "exports": {
25
- ".": "./dist/index.js",
26
- "./config": "./dist/config.js",
27
- "./plugins": "./dist/plugins.js",
28
- "./run": "./dist/run.js",
25
+ ".": "./dist/index.mjs",
26
+ "./config": "./dist/config.mjs",
27
+ "./plugins": "./dist/plugins.mjs",
28
+ "./run": "./dist/run.mjs",
29
29
  "./package.json": "./package.json"
30
30
  },
31
31
  "typesVersions": {
@@ -37,7 +37,7 @@
37
37
  }
38
38
  },
39
39
  "bin": {
40
- "tsdown": "./dist/run.js"
40
+ "tsdown": "./dist/run.mjs"
41
41
  },
42
42
  "publishConfig": {
43
43
  "access": "public"
@@ -74,8 +74,8 @@
74
74
  "diff": "^8.0.2",
75
75
  "empathic": "^1.1.0",
76
76
  "hookable": "^5.5.3",
77
- "rolldown": "1.0.0-beta.10-commit.87188ed",
78
- "rolldown-plugin-dts": "^0.13.6",
77
+ "rolldown": "1.0.0-beta.11-commit.f051675",
78
+ "rolldown-plugin-dts": "^0.13.8",
79
79
  "semver": "^7.7.2",
80
80
  "tinyexec": "^1.0.1",
81
81
  "tinyglobby": "^0.2.14",
@@ -84,31 +84,31 @@
84
84
  "devDependencies": {
85
85
  "@arethetypeswrong/core": "^0.18.1",
86
86
  "@oxc-node/core": "^0.0.27",
87
- "@sxzz/eslint-config": "^7.0.1",
87
+ "@sxzz/eslint-config": "^7.0.2",
88
88
  "@sxzz/prettier-config": "^2.2.1",
89
89
  "@sxzz/test-utils": "^0.5.6",
90
90
  "@types/debug": "^4.1.12",
91
- "@types/node": "^22.15.27",
91
+ "@types/node": "^22.15.29",
92
92
  "@types/semver": "^7.7.0",
93
- "@unocss/eslint-plugin": "^66.1.2",
93
+ "@unocss/eslint-plugin": "^66.1.3",
94
94
  "@vueuse/core": "^13.3.0",
95
95
  "bumpp": "^10.1.1",
96
- "eslint": "^9.27.0",
96
+ "eslint": "^9.28.0",
97
97
  "lightningcss": "^1.30.1",
98
98
  "pkg-types": "^2.1.0",
99
99
  "prettier": "^3.5.3",
100
100
  "publint": "^0.3.12",
101
101
  "typedoc": "^0.28.5",
102
- "typedoc-plugin-markdown": "^4.6.3",
102
+ "typedoc-plugin-markdown": "^4.6.4",
103
103
  "typescript": "~5.8.3",
104
- "unocss": "^66.1.2",
104
+ "unocss": "^66.1.3",
105
105
  "unplugin-lightningcss": "^0.4.1",
106
106
  "unplugin-unused": "^0.5.0",
107
107
  "vite": "npm:rolldown-vite@latest",
108
108
  "vitepress": "^1.6.3",
109
- "vitepress-plugin-group-icons": "^1.5.5",
109
+ "vitepress-plugin-group-icons": "^1.6.0",
110
110
  "vitepress-plugin-llms": "^1.3.4",
111
- "vitest": "^3.1.4",
111
+ "vitest": "^3.2.1",
112
112
  "vue": "^3.5.16"
113
113
  },
114
114
  "engines": {
package/dist/config.d.ts DELETED
@@ -1,2 +0,0 @@
1
- import { UserConfig, UserConfigFn, defineConfig } from "./config-CzJapb1X.js";
2
- export { UserConfig, UserConfigFn, defineConfig };
package/dist/config.js DELETED
@@ -1,3 +0,0 @@
1
- import { defineConfig } from "./config-yiJy1jd0.js";
2
-
3
- export { defineConfig };
@@ -1,5 +0,0 @@
1
- //#region package.json
2
- var version = "0.12.6";
3
-
4
- //#endregion
5
- export { version };
File without changes