Skip to content

Commit 339f58a

Browse files
authored
feat: switch unconfig-core & mark unrun stable (#585)
1 parent 844c9db commit 339f58a

12 files changed

Lines changed: 165 additions & 112 deletions

File tree

docs/options/config-file.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,13 +66,12 @@ This is useful if you want to rely solely on command-line options or default set
6666

6767
`tsdown` supports multiple config loaders to accommodate various file formats. You can select a config loader using the `--config-loader` option. The available loaders are:
6868

69-
- `auto` (default): Utilizes native runtime loading for TypeScript if supported; otherwise, defaults to `unconfig`.
69+
- `auto` (default): Utilizes native runtime loading for TypeScript if supported; otherwise, defaults to `unrun`.
7070
- `native`: Loads TypeScript configuration files using native runtime support. Requires a compatible environment, such as the latest Node.js, Deno, or Bun.
71-
- `unconfig`: Loads configuration files with the `unconfig` library, ensuring broad compatibility across different runtimes.
72-
- `unrun` _(experimental)_: Loads configuration files using the [`unrun`](https://gugustinette.github.io/unrun/) library, which provides similar compatibility as `unconfig` but with more performances. Install the `unrun` package to use this loader.
71+
- `unrun`: Loads configuration files using the [`unrun`](https://gugustinette.github.io/unrun/) library. Install the `unrun` package to use this loader.
7372

7473
> [!TIP]
75-
> Node.js does not natively support importing TypeScript files without specifying the file extension. If you are using Node.js and want to load a TypeScript config file without including the `.ts` extension, consider using the `unconfig` or `unrun` loader for seamless compatibility.
74+
> Node.js does not natively support importing TypeScript files without specifying the file extension. If you are using Node.js and want to load a TypeScript config file without including the `.ts` extension, consider using the `unrun` loader for seamless compatibility.
7675
7776
## Extending Vite or Vitest Config (Experimental)
7877

docs/zh-CN/options/config-file.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,13 +66,12 @@ tsdown --no-config
6666

6767
`tsdown` 支持多种配置加载器,以适配不同的文件格式。您可以通过 `--config-loader` 选项选择配置加载器。可用的加载器包括:
6868

69-
- `auto`(默认):如果运行时支持,则使用原生方式加载 TypeScript,否则回退到 `unconfig`
69+
- `auto`(默认):如果运行时支持,则使用原生方式加载 TypeScript,否则回退到 `unrun`
7070
- `native`:通过原生运行时支持加载 TypeScript 配置文件。需要兼容的环境,如最新版 Node.js、Deno 或 Bun。
71-
- `unconfig`:使用 `unconfig` 库加载配置文件,确保在不同运行时下具有广泛兼容性。
72-
- `unrun` _(实验性)_: 使用 [`unrun`](https://gugustinette.github.io/unrun/) 库加载配置文件,兼容性与 `unconfig` 类似,但性能更高。要使用此加载器,请先安装 `unrun` 包。
71+
- `unrun`: 使用 [`unrun`](https://gugustinette.github.io/unrun/) 库加载配置文件。要使用此加载器,请先安装 `unrun` 包。
7372

7473
> [!TIP]
75-
> Node.js 原生不支持在不指定文件扩展名的情况下导入 TypeScript 文件。如果您在 Node.js 环境下希望加载不带 `.ts` 扩展名的 TypeScript 配置文件,建议使用 `unconfig``unrun` 加载器以获得更好的兼容性。
74+
> Node.js 原生不支持在不指定文件扩展名的情况下导入 TypeScript 文件。如果您在 Node.js 环境下希望加载不带 `.ts` 扩展名的 TypeScript 配置文件,建议使用 `unrun` 加载器以获得更好的兼容性。
7675
7776
## 扩展 Vite 或 Vitest 配置(实验性功能){#extending-vite-or-vitest-config-experimental}
7877

package.json

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,7 @@
6666
"publint": "^0.3.0",
6767
"typescript": "^5.0.0",
6868
"unplugin-lightningcss": "^0.4.0",
69-
"unplugin-unused": "^0.5.0",
70-
"unrun": "^0.2.1"
69+
"unplugin-unused": "^0.5.0"
7170
},
7271
"peerDependenciesMeta": {
7372
"@arethetypeswrong/core": {
@@ -87,9 +86,6 @@
8786
},
8887
"unplugin-unused": {
8988
"optional": true
90-
},
91-
"unrun": {
92-
"optional": true
9389
}
9490
},
9591
"dependencies": {
@@ -106,7 +102,8 @@
106102
"tinyexec": "catalog:prod",
107103
"tinyglobby": "catalog:prod",
108104
"tree-kill": "catalog:prod",
109-
"unconfig": "catalog:prod"
105+
"unconfig-core": "catalog:prod",
106+
"unrun": "catalog:prod"
110107
},
111108
"devDependencies": {
112109
"@arethetypeswrong/core": "catalog:peer",
@@ -130,7 +127,6 @@
130127
"unocss": "catalog:docs",
131128
"unplugin-lightningcss": "catalog:peer",
132129
"unplugin-unused": "catalog:peer",
133-
"unrun": "catalog:peer",
134130
"vite": "catalog:docs",
135131
"vitest": "catalog:dev"
136132
},

pnpm-lock.yaml

Lines changed: 35 additions & 15 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pnpm-workspace.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ catalogs:
4545
publint: ^0.3.15
4646
unplugin-lightningcss: ^0.4.3
4747
unplugin-unused: ^0.5.5
48-
unrun: ^0.2.2
4948

5049
prod:
5150
'@clack/prompts': ^0.11.0
@@ -64,7 +63,8 @@ catalogs:
6463
tinyexec: ^1.0.1
6564
tinyglobby: ^0.2.15
6665
tree-kill: ^1.2.2
67-
unconfig: ^7.3.3
66+
unconfig-core: ^7.4.0
67+
unrun: ^0.2.5
6868

6969
ignoredBuiltDependencies:
7070
- rolldown

src/cli.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ cli
1818
.option('-c, --config <filename>', 'Use a custom config file')
1919
.option(
2020
'--config-loader <loader>',
21-
'Config loader to use: auto, native, unconfig',
21+
'Config loader to use: auto, native, unrun',
2222
{ default: 'auto' },
2323
)
2424
.option('--no-config', 'Disable config file')

0 commit comments

Comments
 (0)