Skip to content

Commit 439f1e0

Browse files
committed
feat: deprecate Node.js versions below 22.18.0
Add a runtime warning when running on Node.js < 22.18.0, indicating support will be removed in the next minor release. Update docs (EN/ZH) with deprecation notice.
1 parent dbe3cc9 commit 439f1e0

File tree

3 files changed

+17
-0
lines changed

3 files changed

+17
-0
lines changed

docs/guide/getting-started.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,10 @@ bun add -D typescript
6262
`tsdown` requires Node.js version 20.19 or higher. Please ensure your development environment meets this requirement before installing. While `tsdown` is primarily tested with Node.js, support for Deno and Bun is experimental and may not work as expected.
6363
:::
6464

65+
:::warning Node.js Deprecation
66+
Node.js versions below 22.18.0 are deprecated and support will be removed in the next minor release. Please upgrade to Node.js 22.18.0 or later.
67+
:::
68+
6569
### Starter Templates {#starter-templates}
6670

6771
To get started even faster, you can use the [create-tsdown](https://github.com/rolldown/tsdown/tree/main/packages/create-tsdown) CLI, which provides a set of starter templates for building pure TypeScript libraries, as well as frontend libraries like React and Vue.

docs/zh-CN/guide/getting-started.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,10 @@ bun add -D typescript
6262
`tsdown` 需要 Node.js 20.19 或更高版本。请确保您的开发环境满足此要求后再进行安装。虽然 `tsdown` 主要在 Node.js 下测试,但对 Deno 和 Bun 的支持仍为实验性,可能无法正常工作。
6363
:::
6464

65+
:::warning Node.js 弃用警告
66+
低于 22.18.0 的 Node.js 版本已被弃用,将在下一个 minor 版本中移除支持。请升级到 Node.js 22.18.0 或更高版本。
67+
:::
68+
6569
### 起步模板 {#starter-templates}
6670

6771
为了更快速地开始,您可以使用 [create-tsdown](https://github.com/rolldown/tsdown/tree/main/packages/create-tsdown) CLI,它提供了一系列起步模板,适用于构建纯 TypeScript 库以及如 React、Vue 等前端库。

src/run.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,16 @@
11
#!/usr/bin/env node
22
import module from 'node:module'
3+
import process from 'node:process'
4+
import { yellow } from 'ansis'
5+
import lt from 'semver/functions/lt.js'
36
import { runCLI } from './cli.ts'
47

8+
if (lt(process.version, '22.18.0')) {
9+
console.warn(
10+
yellow`[tsdown] Node.js ${process.version} is deprecated. Support will be removed in the next minor release. Please upgrade to Node.js 22.18.0 or later.`,
11+
)
12+
}
13+
514
try {
615
module.enableCompileCache?.()
716
} catch {}

0 commit comments

Comments
 (0)