Skip to content

v0.3.2: CI 一致性守护改为可选设施#3

Merged
imrui merged 1 commit into
masterfrom
feat/optional-ci
Jul 3, 2026
Merged

v0.3.2: CI 一致性守护改为可选设施#3
imrui merged 1 commit into
masterfrom
feat/optional-ci

Conversation

@imrui

@imrui imrui commented Jul 3, 2026

Copy link
Copy Markdown
Owner

主题

Optional CI —— `.github/workflows/` 从默认拷贝改为按需加装。

背景

用户反馈:不是所有派生仓都用 GitHub Actions(GitLab CI / Jenkins / self-hosted / 或干脆不用 CI)。之前 `init` 默认拷贝 `.github/workflows/rules-consistency.yml` 到派生仓,对上述场景形成隐性侵入——即便文件已技术中立,"未经我同意就配好 CI" 本身就是一种侵入。

延续 v0.3.1 减法哲学:init 只装干净的骨架,功能设施按需加装

Added

  • `lingshu ci install` 新命令:从内置模板拷贝 `.github/workflows/rules-consistency.yml` 到当前项目
    • 幂等:文件已存在时跳过;`--force` 强制覆盖
    • 与 `lingshu hooks install` 对称——都是可选装的项目级基础设施

Changed

  • `lingshu init` 默认不再拷贝 `.github/`:"下一步"提示加 `ci install` 一行
  • `lingshu doctor` 扩为 4 步:新增 `[4/4] 可选设施` 检查(不装 CI 用 dim 灰字信息提示,不是错误也不是 warning)
  • `copyTemplate` 加 `exclude` 参数:调用方可控制排除项
  • 模板 README:`.github/workflows/` 从常规目录树移到脚注"可选设施"

Migration

存量派生仓完全不受影响——已装的 workflow 保留,`upgrade` 不主动删。

新 init 项目默认无 CI;如需守护:`lingshu ci install`。

Test plan

  • smoke 25/25 全绿(原 22 + 3 新 ci install 用例)
  • 本地跑 `lingshu init demo && cd demo && lingshu doctor`:无 `.github/`、doctor [4/4] 灰字提示未装
  • `lingshu ci install` 后 doctor [4/4] 打勾
  • CI publish 走通 npm@0.3.2

- 新增 lingshu ci install:从内置模板拷贝 .github/workflows/rules-consistency.yml
  幂等(已存在跳过);--force 覆盖
- init 默认不再拷贝 .github/(copyTemplate 加 exclude 参数)
- init 完成提示加 lingshu ci install 一行
- doctor 扩为 4 步:[4/4] 可选设施检查(不装 CI 也不算错误)
- 模板 README 目录树 .github/workflows/ 移出常规树、脚注为"可选设施"
- CLI 仓 README 加 lingshu ci install 段
- smoke 22 → 25:init 断言 .github/ 从"应存在"改为"禁止存在"(零侵入契约)
  + 3 用例(ci install 生成 / 幂等+--force / 非灵枢项目报错)
@imrui imrui merged commit 37b5976 into master Jul 3, 2026
2 checks passed
@imrui imrui deleted the feat/optional-ci branch July 3, 2026 14:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant