@agile-team/robot-cli 1.1.12 → 2.1.0
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.
- package/CHANGELOG.md +77 -0
- package/README.md +355 -438
- package/bin/robot.js +3 -0
- package/dist/index.js +1720 -0
- package/package.json +77 -81
- package/bin/index.js +0 -405
- package/lib/create.js +0 -1201
- package/lib/download.js +0 -205
- package/lib/templates.js +0 -353
- package/lib/utils.js +0 -334
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/),
|
|
6
|
+
and this project adheres to [Semantic Versioning](https://semver.org/).
|
|
7
|
+
|
|
8
|
+
## [2.0.0] - 2026-03-28
|
|
9
|
+
|
|
10
|
+
### ⚠️ BREAKING CHANGES
|
|
11
|
+
|
|
12
|
+
- 完全迁移至 TypeScript,输出从 `lib/` 变更为 `dist/`
|
|
13
|
+
- CLI 入口变更为 `bin/robot.js`
|
|
14
|
+
- 最低要求 Node.js >= 20
|
|
15
|
+
|
|
16
|
+
### Added
|
|
17
|
+
|
|
18
|
+
- **TypeScript 重写**:全量迁移至 TypeScript 5.7+,严格模式,完整类型覆盖
|
|
19
|
+
- **tsup 构建**:使用 tsup 8 构建,单文件 ESM 输出,目标 Node 20+
|
|
20
|
+
- **Vitest 测试**:使用 Vitest 3 单元测试(验证名称校验、模板搜索、下载 URL 构建等)
|
|
21
|
+
- **GitHub Actions CI**:PR 自动运行 lint + typecheck + build + test(Node 20/22 矩阵)
|
|
22
|
+
- **GitHub Actions Release**:tag 推送自动发布 npm + 创建 GitHub Release
|
|
23
|
+
- **离线缓存**:首次下载的模板缓存至 `~/.robot-cli/cache/`,网络异常时自动回退到缓存
|
|
24
|
+
- **`robot doctor` 命令**:诊断 Node.js、Git、包管理器、网络连接、缓存状态
|
|
25
|
+
- **`robot doctor --clear-cache`**:清理模板缓存
|
|
26
|
+
- **`robot create --from <url>`**:从自定义 Git 仓库 / zip URL 创建项目
|
|
27
|
+
- **`robot create --no-cache`**:跳过缓存,强制下载最新模板
|
|
28
|
+
- **远程模板注册表**:支持从远程 JSON 加载额外模板,与内置模板合并
|
|
29
|
+
- **`getCategoryForTemplate()`**:根据模板 key 查找所属分类
|
|
30
|
+
- **`getCacheStats()` / `clearCache()`**:缓存管理 API
|
|
31
|
+
|
|
32
|
+
### Changed
|
|
33
|
+
|
|
34
|
+
- 项目结构迁移:`lib/*.js` → `src/*.ts` → `dist/index.js`
|
|
35
|
+
- 构建工具:无 → tsup 8 (ESM bundle)
|
|
36
|
+
- 测试框架:手动测试 → Vitest 3
|
|
37
|
+
- 代码检查:oxlint (保留)
|
|
38
|
+
- 类型系统:无 → TypeScript strict
|
|
39
|
+
|
|
40
|
+
---
|
|
41
|
+
|
|
42
|
+
## [1.2.0] - 2026-03-28
|
|
43
|
+
|
|
44
|
+
### Added
|
|
45
|
+
|
|
46
|
+
- `--dry-run` 模式:预览项目创建过程,不实际执行任何操作
|
|
47
|
+
- CLI 版本更新检查:在主菜单显示时自动检查最新版本
|
|
48
|
+
- `getGitUser()` 工具函数:自动读取 Git 用户名作为默认作者
|
|
49
|
+
- `checkForUpdates()` 工具函数:轻量级 npm 版本检查
|
|
50
|
+
- oxlint 代码检查配置
|
|
51
|
+
- CHANGELOG.md 变更日志
|
|
52
|
+
|
|
53
|
+
### Fixed
|
|
54
|
+
|
|
55
|
+
- **`process.chdir()` 反模式**:`installDependencies()` 和 `initializeGitRepository()` 不再使用 `process.chdir()`,改用 `execSync(cmd, { cwd })` 选项,消除全局状态污染风险
|
|
56
|
+
- **`response.buffer()` 废弃 API**:替换为 `Buffer.from(await response.arrayBuffer())`,兼容 Node 20+ 内置 `fetch`
|
|
57
|
+
- **`tarao` 拼写错误**:修正为 `taro`(京东 Taro 跨端框架)
|
|
58
|
+
- **默认作者硬编码**:改为自动读取 `git config user.name`
|
|
59
|
+
- **`selectFromAll()` 硬编码分类**:改为基于 `TEMPLATE_CATEGORIES` 动态构建,新增模板无需修改展示逻辑
|
|
60
|
+
- **`fetch` timeout 用法**:从 `node-fetch` 的 `{ timeout }` 迁移到原生 `AbortSignal.timeout()`
|
|
61
|
+
|
|
62
|
+
### Changed
|
|
63
|
+
|
|
64
|
+
- 移除 `node-fetch` 依赖,使用 Node 20+ 内置 `fetch`(减少运行时依赖)
|
|
65
|
+
- 简化 `bin/index.js` 中的 `resolveLibPath()`,从 7 个候选路径精简为 2 个
|
|
66
|
+
- 移除 `bin/index.js` 中未使用的 `resolve` 导入
|
|
67
|
+
|
|
68
|
+
## [1.1.12] - Previous
|
|
69
|
+
|
|
70
|
+
### Features
|
|
71
|
+
|
|
72
|
+
- 多技术栈模板支持(Vue/React/uni-app/NestJS/Koa/Electron/Tauri)
|
|
73
|
+
- 智能包管理器检测,优先推荐 bun
|
|
74
|
+
- 四种模板选择方式:推荐/分类/搜索/全部
|
|
75
|
+
- 多级返回导航
|
|
76
|
+
- GitHub 镜像回退下载
|
|
77
|
+
- 文件复制进度展示
|