tsdown 0.22.0-beta.1 → 0.22.0-beta.2

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,12 +1,12 @@
1
1
  import { createRequire as __cjs_createRequire } from "node:module";
2
2
  const __cjs_require = __cjs_createRequire(import.meta.url);
3
- import { a as getPackageType, c as isGlobEntry, d as cleanOutDir, i as loadConfigFile, l as toObjectEntry, n as mergeUserOptions, o as writeExports, r as resolveUserConfig, s as buildExe, t as mergeConfig, u as cleanChunks } from "./options-DLofT9Im.mjs";
3
+ import { a as getPackageType, c as isGlobEntry, d as cleanOutDir, i as loadConfigFile, l as toObjectEntry, n as mergeUserOptions, o as writeExports, r as resolveUserConfig, s as buildExe, t as mergeConfig, u as cleanChunks } from "./options-DUthngzZ.mjs";
4
4
  import { r as fsRemove } from "./fs-Dd6Htx2P.mjs";
5
5
  import { a as pkgExists, l as slash, n as importWithError, o as promiseWithResolvers, t as debounce } from "./general-D3muxt2f.mjs";
6
6
  import { a as globalLogger, t as LogLevels } from "./logger-uV8l1UFa.mjs";
7
7
  import { i as getShimsInject, n as DepsPlugin } from "./format-CajNSstg.mjs";
8
8
  import { a as ReportPlugin, i as ShebangPlugin, n as endsWithConfig, o as NodeProtocolPlugin, r as addOutDirToChunks, s as copy, t as WatchPlugin } from "./watch-B659_4oi.mjs";
9
- import { t as version } from "./package-YlYsw3G3.mjs";
9
+ import { t as version } from "./package-CeuhhDjU.mjs";
10
10
  import { mkdtemp, readFile, readdir, writeFile } from "node:fs/promises";
11
11
  import path from "node:path";
12
12
  import process from "node:process";
@@ -1,4 +1,4 @@
1
- import { d as UserConfig, f as UserConfigExport, i as InlineConfig, o as ResolvedConfig, p as UserConfigFn } from "./types-Da8mQtCf.mjs";
1
+ import { d as UserConfig, f as UserConfigExport, i as InlineConfig, o as ResolvedConfig, p as UserConfigFn } from "./types-CQaSBA5U.mjs";
2
2
 
3
3
  //#region src/config/options.d.ts
4
4
  /**
package/dist/config.d.mts CHANGED
@@ -1,3 +1,3 @@
1
- import { d as UserConfig, f as UserConfigExport, p as UserConfigFn } from "./types-Da8mQtCf.mjs";
2
- import { n as mergeConfig, t as defineConfig } from "./config-CoZ57pPv.mjs";
1
+ import { d as UserConfig, f as UserConfigExport, p as UserConfigFn } from "./types-CQaSBA5U.mjs";
2
+ import { n as mergeConfig, t as defineConfig } from "./config-BWeUm0f3.mjs";
3
3
  export { UserConfig, UserConfigExport, UserConfigFn, defineConfig, mergeConfig };
package/dist/config.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { t as mergeConfig } from "./options-DLofT9Im.mjs";
1
+ import { t as mergeConfig } from "./options-DUthngzZ.mjs";
2
2
  //#region src/config.ts
3
3
  function defineConfig(options) {
4
4
  return options;
@@ -27,7 +27,9 @@ interface Logger {
27
27
  }
28
28
  declare const globalLogger: Logger;
29
29
  //#endregion
30
- //#region node_modules/.pnpm/pkg-types@2.3.0/node_modules/pkg-types/dist/index.d.mts
30
+ //#region node_modules/.pnpm/pkg-types@2.3.1/node_modules/pkg-types/dist/index.d.mts
31
+ //#endregion
32
+ //#region src/packagejson/types.d.ts
31
33
  interface PackageJson {
32
34
  /**
33
35
  * The name is what your thing is called.
@@ -321,7 +323,8 @@ type PackageJsonFunding = string | {
321
323
  };
322
324
  type PackageJsonExportKey = "." | "import" | "require" | "types" | "node" | "browser" | "default" | (string & {});
323
325
  type PackageJsonExportsObject = { [P in PackageJsonExportKey]?: string | PackageJsonExportsObject | Array<string | PackageJsonExportsObject> };
324
- type PackageJsonExports = string | PackageJsonExportsObject | Array<string | PackageJsonExportsObject>;
326
+ type PackageJsonExports = string | PackageJsonExportsObject | Array<string | PackageJsonExportsObject>; //#endregion
327
+ //#region src/packagejson/utils.d.ts
325
328
  /**
326
329
  * Defines a PackageJson structure.
327
330
  * @param pkg - The `package.json` content as an object. See {@link PackageJson}.
package/dist/index.d.mts CHANGED
@@ -1,6 +1,6 @@
1
- import { a as Arrayable, i as globalLogger, r as Logger } from "./index-DraNj4FA.mjs";
2
- import { A as PackageType, B as ResolvedDepsConfig, C as ChunkAddon, D as OutExtensionFactory, E as OutExtensionContext, F as SeaConfig, G as CopyOptionsFn, H as TsdownBundle, I as DevtoolsOptions, L as DepsConfig, M as RolldownContext, N as TsdownHooks, O as OutExtensionObject, P as ExeOptions, S as AttwOptions, T as ChunkAddonObject, U as CopyEntry, V as RolldownChunk, W as CopyOptions, a as NormalizedFormat, b as PublintOptions, c as TreeshakingOptions, d as UserConfig, f as UserConfigExport, g as ReportOptions, h as Workspace, i as InlineConfig, j as BuildContext, k as PackageJsonWithPath, l as TsdownInputOption, m as WithEnabled, n as DtsOptions, o as ResolvedConfig, p as UserConfigFn, r as Format, s as Sourcemap, t as CIOption, u as UnusedOptions, v as TsdownPlugin, w as ChunkAddonFunction, x as ExportsOptions, y as TsdownPluginOption, z as NoExternalFn } from "./types-Da8mQtCf.mjs";
3
- import { n as mergeConfig, r as resolveUserConfig, t as defineConfig } from "./config-CoZ57pPv.mjs";
1
+ import { a as Arrayable, i as globalLogger, r as Logger } from "./index-CTZ4qxd_.mjs";
2
+ import { A as PackageType, B as ResolvedDepsConfig, C as ChunkAddon, D as OutExtensionFactory, E as OutExtensionContext, F as SeaConfig, G as CopyOptionsFn, H as TsdownBundle, I as DevtoolsOptions, L as DepsConfig, M as RolldownContext, N as TsdownHooks, O as OutExtensionObject, P as ExeOptions, S as AttwOptions, T as ChunkAddonObject, U as CopyEntry, V as RolldownChunk, W as CopyOptions, a as NormalizedFormat, b as PublintOptions, c as TreeshakingOptions, d as UserConfig, f as UserConfigExport, g as ReportOptions, h as Workspace, i as InlineConfig, j as BuildContext, k as PackageJsonWithPath, l as TsdownInputOption, m as WithEnabled, n as DtsOptions, o as ResolvedConfig, p as UserConfigFn, r as Format, s as Sourcemap, t as CIOption, u as UnusedOptions, v as TsdownPlugin, w as ChunkAddonFunction, x as ExportsOptions, y as TsdownPluginOption, z as NoExternalFn } from "./types-CQaSBA5U.mjs";
3
+ import { n as mergeConfig, r as resolveUserConfig, t as defineConfig } from "./config-BWeUm0f3.mjs";
4
4
  import * as Rolldown from "rolldown";
5
5
 
6
6
  //#region src/build.d.ts
package/dist/index.mjs CHANGED
@@ -1,5 +1,5 @@
1
- import { n as buildWithConfigs, t as build } from "./build-CABwL9HG.mjs";
2
- import { r as resolveUserConfig, t as mergeConfig } from "./options-DLofT9Im.mjs";
1
+ import { n as buildWithConfigs, t as build } from "./build-CLGhOCqV.mjs";
2
+ import { r as resolveUserConfig, t as mergeConfig } from "./options-DUthngzZ.mjs";
3
3
  import { a as globalLogger } from "./logger-uV8l1UFa.mjs";
4
4
  import { defineConfig } from "./config.mjs";
5
5
  import { t as enableDebug } from "./debug-CLlnG64L.mjs";
@@ -1,4 +1,4 @@
1
- import { c as Overwrite, r as Logger, s as MarkPartial } from "./index-DraNj4FA.mjs";
1
+ import { c as Overwrite, r as Logger, s as MarkPartial } from "./index-CTZ4qxd_.mjs";
2
2
 
3
3
  //#region src/features/target.d.ts
4
4
  declare function expandBaselineTarget(targets: string[]): string[];
@@ -11,7 +11,7 @@ import process, { env } from "node:process";
11
11
  import { blue, bold, dim, red, underline } from "ansis";
12
12
  import { createDefu } from "defu";
13
13
  import { createDebug } from "obug";
14
- import { RE_CSS, RE_DTS, RE_NODE_MODULES, parseTsconfig } from "rolldown-plugin-dts/internal";
14
+ import { RE_CSS, RE_DTS, RE_NODE_MODULES, readTsconfig } from "rolldown-plugin-dts/internal";
15
15
  import { glob, isDynamicPattern } from "tinyglobby";
16
16
  const picomatch = __cjs_require("picomatch");
17
17
  import { tmpdir } from "node:os";
@@ -747,8 +747,10 @@ async function resolveUserConfig(userConfig, inlineConfig, configDeps) {
747
747
  exe = resolveFeatureOption(exe, {});
748
748
  if (dts == null) if (exe) dts = false;
749
749
  else if (pkg?.types || pkg?.typings || hasExportsTypes(pkg?.exports)) dts = true;
750
- else if (tsconfig) dts = !!parseTsconfig(tsconfig).compilerOptions?.declaration;
751
- else dts = false;
750
+ else if (tsconfig) {
751
+ const { config } = readTsconfig(tsconfig);
752
+ dts = !!config.compilerOptions?.declaration;
753
+ } else dts = false;
752
754
  dts = resolveFeatureOption(dts, {});
753
755
  if (!pkg) {
754
756
  if (exports) throw new Error("`package.json` not found, cannot write exports");
@@ -1,4 +1,4 @@
1
1
  //#region package.json
2
- var version = "0.22.0-beta.1";
2
+ var version = "0.22.0-beta.2";
3
3
  //#endregion
4
4
  export { version as t };
@@ -1,5 +1,5 @@
1
- import { r as Logger } from "./index-DraNj4FA.mjs";
2
- import { H as TsdownBundle, R as DepsPlugin, _ as ReportPlugin } from "./types-Da8mQtCf.mjs";
1
+ import { r as Logger } from "./index-CTZ4qxd_.mjs";
2
+ import { H as TsdownBundle, R as DepsPlugin, _ as ReportPlugin } from "./types-CQaSBA5U.mjs";
3
3
  import { Plugin } from "rolldown";
4
4
 
5
5
  //#region src/features/node-protocol.d.ts
package/dist/run.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  import { a as globalLogger } from "./logger-uV8l1UFa.mjs";
3
- import { t as version } from "./package-YlYsw3G3.mjs";
3
+ import { t as version } from "./package-CeuhhDjU.mjs";
4
4
  import { t as enableDebug } from "./debug-CLlnG64L.mjs";
5
5
  import module from "node:module";
6
6
  import process from "node:process";
@@ -17,7 +17,7 @@ cli.command("[...files]", "Bundle files", {
17
17
  }).option("-c, --config <filename>", "Use a custom config file").option("--config-loader <loader>", "Config loader to use: auto, native, tsx, unrun", { default: "auto" }).option("--no-config", "Disable config file").option("-f, --format <format>", "Bundle format: esm, cjs, iife, umd", { default: "esm" }).option("--clean", "Clean output directory, --no-clean to disable").option("--deps.never-bundle <module>", "Mark dependencies as external").option("--minify", "Minify output").option("--devtools", "Enable devtools integration").option("--debug [feat]", "Show debug logs").option("--target <target>", "Bundle target, e.g \"es2015\", \"esnext\"").option("-l, --logLevel <level>", "Set log level: info, warn, error, silent").option("--fail-on-warn", "Fail on warnings", { default: true }).option("--no-write", "Disable writing files to disk, incompatible with watch mode").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("--env-file <file>", "Load environment variables from a file, when used together with --env, variables in --env take precedence").option("--env-prefix <prefix>", "Prefix for env variables to inject into the bundle", { default: "TSDOWN_" }).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("--root <dir>", "Root directory of input files").option("--exe", "Bundle as executable").option("-W, --workspace [dir]", "Enable workspace mode").option("-F, --filter <pattern>", "Filter configs (cwd or name), e.g. /pkg-name$/ or pkg-name").option("--exports", "Generate export-related metadata for package.json (experimental)").action(async (input, flags) => {
18
18
  globalLogger.level = flags.logLevel || "info";
19
19
  globalLogger.info(`${blue`tsdown v${version}`} powered by ${hex("#ff7e17")`rolldown v${VERSION}`}`);
20
- const { build } = await import("./build-CABwL9HG.mjs").then((n) => n.r);
20
+ const { build } = await import("./build-CLGhOCqV.mjs").then((n) => n.r);
21
21
  if (input.length > 0) flags.entry = input;
22
22
  await build(flags);
23
23
  });
@@ -1,4 +1,4 @@
1
- import { a as Arrayable, c as Overwrite, n as LogLevel, o as Awaitable, r as Logger, s as MarkPartial, t as PackageJson } from "./index-DraNj4FA.mjs";
1
+ import { a as Arrayable, c as Overwrite, n as LogLevel, o as Awaitable, r as Logger, s as MarkPartial, t as PackageJson } from "./index-CTZ4qxd_.mjs";
2
2
  import { BuildOptions, ChecksOptions, ExternalOption, InputOptions, InternalModuleFormat, MinifyOptions, ModuleFormat, ModuleTypes, OutputAsset, OutputChunk, OutputOptions, Plugin, RolldownPlugin, TreeshakingOptions } from "rolldown";
3
3
  import { Hookable } from "hookable";
4
4
  import { Buffer } from "node:buffer";
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "tsdown",
3
3
  "type": "module",
4
- "version": "0.22.0-beta.1",
4
+ "version": "0.22.0-beta.2",
5
5
  "description": "The Elegant Bundler for Libraries",
6
6
  "author": "Kevin Deng <sxzz@sxzz.moe>",
7
7
  "license": "MIT",
@@ -54,8 +54,8 @@
54
54
  "typescript": "^5.0.0 || ^6.0.0",
55
55
  "unplugin-unused": "^0.5.0",
56
56
  "unrun": "*",
57
- "@tsdown/css": "0.22.0-beta.1",
58
- "@tsdown/exe": "0.22.0-beta.1"
57
+ "@tsdown/css": "0.22.0-beta.2",
58
+ "@tsdown/exe": "0.22.0-beta.2"
59
59
  },
60
60
  "peerDependenciesMeta": {
61
61
  "@arethetypeswrong/core": {
@@ -95,10 +95,10 @@
95
95
  "import-without-cache": "^0.3.3",
96
96
  "obug": "^2.1.1",
97
97
  "picomatch": "^4.0.4",
98
- "rolldown": "1.0.0-rc.17",
99
- "rolldown-plugin-dts": "^0.23.2",
98
+ "rolldown": "1.0.0-rc.18",
99
+ "rolldown-plugin-dts": "^0.24.0-beta.1",
100
100
  "semver": "^7.7.4",
101
- "tinyexec": "^1.1.1",
101
+ "tinyexec": "^1.1.2",
102
102
  "tinyglobby": "^0.2.16",
103
103
  "tree-kill": "^1.2.2",
104
104
  "unconfig-core": "^7.5.0"
@@ -106,50 +106,50 @@
106
106
  "inlinedDependencies": {
107
107
  "is-in-ci": "2.0.0",
108
108
  "package-manager-detector": "1.6.0",
109
- "pkg-types": "2.3.0"
109
+ "pkg-types": "2.3.1"
110
110
  },
111
111
  "devDependencies": {
112
112
  "@arethetypeswrong/core": "^0.18.2",
113
- "@sxzz/eslint-config": "^7.8.4",
113
+ "@sxzz/eslint-config": "^8.0.0",
114
114
  "@sxzz/prettier-config": "^2.3.1",
115
115
  "@sxzz/test-utils": "^0.5.18",
116
116
  "@types/node": "^25.6.0",
117
117
  "@types/picomatch": "^4.0.3",
118
118
  "@types/semver": "^7.7.1",
119
- "@typescript/native-preview": "7.0.0-dev.20260425.1",
119
+ "@typescript/native-preview": "7.0.0-dev.20260429.1",
120
120
  "@unocss/eslint-plugin": "^66.6.8",
121
121
  "@vitejs/devtools": "^0.1.15",
122
122
  "@vitest/coverage-v8": "^4.1.5",
123
123
  "@vitest/ui": "^4.1.5",
124
124
  "@vueuse/core": "^14.2.1",
125
- "baseline-browser-mapping": "^2.10.22",
125
+ "baseline-browser-mapping": "^2.10.24",
126
126
  "bumpp": "^11.0.1",
127
127
  "dedent": "^1.7.2",
128
128
  "eslint": "^10.2.1",
129
129
  "is-in-ci": "^2.0.0",
130
130
  "memfs": "^4.57.2",
131
131
  "package-manager-detector": "^1.6.0",
132
- "pkg-types": "^2.3.0",
133
- "postcss": "^8.5.10",
132
+ "pkg-types": "^2.3.1",
133
+ "postcss": "^8.5.12",
134
134
  "postcss-import": "^16.1.1",
135
135
  "prettier": "^3.8.3",
136
136
  "publint": "^0.3.18",
137
137
  "rolldown-plugin-require-cjs": "^0.4.0",
138
138
  "sass": "^1.99.0",
139
139
  "tsnapi": "^0.3.2",
140
- "tsx": "^4.20.3",
140
+ "tsx": "^4.21.0",
141
141
  "typescript": "~6.0.3",
142
142
  "unocss": "^66.6.8",
143
143
  "unplugin-ast": "^0.16.0",
144
144
  "unplugin-raw": "^0.7.0",
145
145
  "unplugin-unused": "^0.5.7",
146
- "unplugin-vue": "^7.1.1",
146
+ "unplugin-vue": "^7.2.0",
147
147
  "unrun": "^0.2.37",
148
148
  "vite": "^8.0.10",
149
149
  "vitest": "^4.1.5",
150
150
  "vue": "^3.5.33",
151
- "@tsdown/css": "0.22.0-beta.1",
152
- "@tsdown/exe": "0.22.0-beta.1"
151
+ "@tsdown/css": "0.22.0-beta.2",
152
+ "@tsdown/exe": "0.22.0-beta.2"
153
153
  },
154
154
  "prettier": "@sxzz/prettier-config",
155
155
  "scripts": {