建议官方支持 Bun 作为 Node.js 替代方案,提升开发体验
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 17.3k
- Forks
- 1.4k
- Avg merge
- 2d 4h
- Merged PRs (30d)
- 105
Description
背景
目前 larksuite/cli 运行环境依赖 Node.js(engines.node),实际核心 CLI 是 Go 预编译二进制,通过 JS 脚本(如 install.js、run.js)进行管理。
Bun 是一个新兴的 JavaScript 运行时,兼容 Node.js 大部分 API,具备以下显著优势:
- 启动速度更快,依赖安装与执行体验远优于 Node.js
- 不需 nvm 等版本隔离工具,减少环境冲突
- 自带包管理器(等价于 npm/yarn/pnpm)
- 更低的内存和 CPU 占用
- 更适合 CLI 场景与现代云/AI 环境
目前个人和许多开发者因为多项目需要频繁切换不同 Node 版本、维护 nvm,自从迁移到 Bun 后感到大大减负。而像本项目这样主要用 JS 脚本起 GO 二进制的模式,用 Bun 兼容性极好,且用 bun run/bunx 启动 CLI 体验非常流畅。
建议
- 在
package.json里添加engines.bun字段:"engines": { "node": ">=16", "bun": ">=1.0" }, "packageManager": "bun@latest" - 脚本部分支持
bun和node两种运行方式(如 postinstall 可试bun ... || node ...),官方 Readme 说明支持 Bun - 将 Bun 作为推荐的 CLI 运行方式之一,面向现代开发者和 AI 场景
期望效果
- 降低对特定 Node 版本的依赖,减少 nvm 疲劳
- CLI 启动速度及依赖安装更快
- 吸引更多 Bun 用户与下一代 JavaScript 社区
感谢官方团队的付出!很期待能看到官方 Bun 支持或意见!
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with package.json and the mentioned install.js and run.js scripts to check how the current Node.js requirement and postinstall flow work. Review the README guidance for CLI execution, then verify that Bun and Node.js both work without breaking the existing Go binary workflow; done means the supported runtime requirements and usage are documented.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- bun, go, node.js
- Domain
- cli, developer-experience
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100