@icebreakers/monorepo-templates 1.0.15 → 1.2.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.
Files changed (161) hide show
  1. package/README.md +12 -8
  2. package/README.zh-CN.md +16 -0
  3. package/assets/.changeset/ledger.yaml +51 -0
  4. package/assets/.github/ISSUE_TEMPLATE/config.yml +1 -1
  5. package/assets/.github/workflows/release.yml +22 -97
  6. package/assets/AGENTS.md +5 -4
  7. package/assets/CONTRIBUTING.md +27 -2
  8. package/assets/SECURITY.md +12 -14
  9. package/assets/package.json +18 -10
  10. package/assets/pnpm-workspace.yaml +8 -0
  11. package/package.json +6 -4
  12. package/templates/cli/package.json +11 -4
  13. package/templates/client/package.json +22 -6
  14. package/templates/server/package.json +14 -7
  15. package/templates/server/vitest.config.ts +1 -4
  16. package/templates/tsdown/package.json +11 -4
  17. package/templates/tsdown/vitest.config.ts +1 -4
  18. package/templates/vitepress/.vitepress/config.ts +146 -165
  19. package/templates/vitepress/ai/index.md +12 -23
  20. package/templates/vitepress/ai/llms-txt.md +13 -31
  21. package/templates/vitepress/getting-started.md +3 -32
  22. package/templates/vitepress/index.md +27 -30
  23. package/templates/vitepress/knowledge/index.md +17 -41
  24. package/templates/vitepress/monorepo/commands.md +13 -18
  25. package/templates/vitepress/monorepo/index.md +22 -100
  26. package/templates/vitepress/monorepo/manage.md +15 -227
  27. package/templates/vitepress/monorepo/publish.md +17 -245
  28. package/templates/vitepress/monorepo/templates.md +10 -17
  29. package/templates/vitepress/monorepo/troubleshooting.md +13 -16
  30. package/templates/vitepress/package.json +11 -5
  31. package/templates/vitepress/public/_redirects +3 -0
  32. package/templates/vitepress/repoctl/adopt-existing.md +51 -53
  33. package/templates/vitepress/repoctl/aliases.md +18 -18
  34. package/templates/vitepress/repoctl/checks.md +21 -68
  35. package/templates/vitepress/repoctl/commands.md +16 -64
  36. package/templates/vitepress/repoctl/config.md +14 -35
  37. package/templates/vitepress/repoctl/doctor.md +20 -60
  38. package/templates/vitepress/repoctl/execution-model.md +16 -69
  39. package/templates/vitepress/repoctl/getting-started.md +34 -40
  40. package/templates/vitepress/repoctl/index.md +33 -61
  41. package/templates/vitepress/repoctl/reports.md +20 -74
  42. package/templates/vitepress/repoctl/scenarios.md +26 -28
  43. package/templates/vitepress/repoctl/template-assets.md +19 -88
  44. package/templates/vitepress/repoctl/templates.md +50 -81
  45. package/templates/vitepress/repoctl/troubleshooting.md +32 -46
  46. package/templates/vitepress/repoctl/workflows.md +38 -67
  47. package/templates/vitepress/thinking.md +4 -85
  48. package/templates/vitepress/tools/changeset.md +12 -85
  49. package/templates/vitepress/tools/husky.md +6 -124
  50. package/templates/vitepress/tools/index.md +13 -32
  51. package/templates/vitepress/tools/lint-staged.md +5 -96
  52. package/templates/vitepress/tools/llms-txt.md +4 -6
  53. package/templates/vitepress/tools/pnpm.md +7 -119
  54. package/templates/vitepress/tools/renovate.md +3 -87
  55. package/templates/vitepress/tools/turborepo.md +5 -157
  56. package/templates/vitepress/why/how-to-reuse-js-code.md +6 -247
  57. package/templates/vitepress/why/index.md +14 -1
  58. package/templates/vitepress/why/js-cjs-mjs.md +9 -96
  59. package/templates/vitepress/why/js-keywords.md +4 -129
  60. package/templates/vitepress/why/modern/bundlers.md +3 -50
  61. package/templates/vitepress/why/modern/dts.md +4 -90
  62. package/templates/vitepress/why/modern/esm-vs-cjs.md +4 -81
  63. package/templates/vitepress/why/modern/index.md +10 -51
  64. package/templates/vitepress/why/modern/package-entry-points.md +6 -117
  65. package/templates/vitepress/why/modern/typescript.md +4 -152
  66. package/templates/vitepress/why/publish-basic-npm-package.md +17 -144
  67. package/templates/vitepress/why/what-is-npm-package.md +4 -159
  68. package/templates/vitepress/zh/ai/index.md +33 -0
  69. package/templates/vitepress/zh/ai/llms-txt.md +42 -0
  70. package/templates/vitepress/zh/getting-started.md +40 -0
  71. package/templates/vitepress/zh/index.md +66 -0
  72. package/templates/vitepress/zh/knowledge/index.md +50 -0
  73. package/templates/vitepress/zh/monorepo/commands.md +21 -0
  74. package/templates/vitepress/zh/monorepo/index.md +115 -0
  75. package/templates/vitepress/zh/monorepo/manage.md +243 -0
  76. package/templates/vitepress/zh/monorepo/publish.md +87 -0
  77. package/templates/vitepress/zh/monorepo/templates.md +21 -0
  78. package/templates/vitepress/zh/monorepo/troubleshooting.md +20 -0
  79. package/templates/vitepress/zh/repoctl/adopt-existing.md +135 -0
  80. package/templates/vitepress/{en → zh}/repoctl/aliases.md +18 -18
  81. package/templates/vitepress/zh/repoctl/checks.md +86 -0
  82. package/templates/vitepress/zh/repoctl/commands.md +168 -0
  83. package/templates/vitepress/zh/repoctl/config.md +90 -0
  84. package/templates/vitepress/zh/repoctl/doctor.md +86 -0
  85. package/templates/vitepress/zh/repoctl/execution-model.md +81 -0
  86. package/templates/vitepress/zh/repoctl/getting-started.md +122 -0
  87. package/templates/vitepress/zh/repoctl/index.md +102 -0
  88. package/templates/vitepress/zh/repoctl/reports.md +94 -0
  89. package/templates/vitepress/{en → zh}/repoctl/scenarios.md +28 -26
  90. package/templates/vitepress/zh/repoctl/template-assets.md +116 -0
  91. package/templates/vitepress/zh/repoctl/templates.md +159 -0
  92. package/templates/vitepress/zh/repoctl/troubleshooting.md +110 -0
  93. package/templates/vitepress/zh/repoctl/workflows.md +118 -0
  94. package/templates/vitepress/zh/thinking.md +88 -0
  95. package/templates/vitepress/zh/tools/changeset.md +75 -0
  96. package/templates/vitepress/zh/tools/husky.md +130 -0
  97. package/templates/vitepress/zh/tools/index.md +38 -0
  98. package/templates/vitepress/zh/tools/lint-staged.md +103 -0
  99. package/templates/vitepress/zh/tools/llms-txt.md +9 -0
  100. package/templates/vitepress/zh/tools/pnpm.md +127 -0
  101. package/templates/vitepress/zh/tools/renovate.md +91 -0
  102. package/templates/vitepress/zh/tools/turborepo.md +166 -0
  103. package/templates/vitepress/zh/why/assets/npm-dt.svg +15 -0
  104. package/templates/vitepress/zh/why/assets/npm-ts.svg +19 -0
  105. package/templates/vitepress/zh/why/examples/0.npm-basic-package/index.js +10 -0
  106. package/templates/vitepress/zh/why/examples/0.npm-basic-package/package.json +11 -0
  107. package/templates/vitepress/zh/why/examples/1.npm-basic-package/index.cjs +12 -0
  108. package/templates/vitepress/zh/why/examples/1.npm-basic-package/index.d.ts +1 -0
  109. package/templates/vitepress/zh/why/examples/1.npm-basic-package/index.js +8 -0
  110. package/templates/vitepress/zh/why/examples/1.npm-basic-package/package.json +19 -0
  111. package/templates/vitepress/zh/why/examples/2.npm-basic-package/README.md +1 -0
  112. package/templates/vitepress/zh/why/examples/2.npm-basic-package/package-lock.json +30 -0
  113. package/templates/vitepress/zh/why/examples/2.npm-basic-package/package.json +35 -0
  114. package/templates/vitepress/zh/why/examples/2.npm-basic-package/rename-ext.js +24 -0
  115. package/templates/vitepress/zh/why/examples/2.npm-basic-package/src/index.ts +8 -0
  116. package/templates/vitepress/zh/why/examples/2.npm-basic-package/tsconfig.cjs.json +8 -0
  117. package/templates/vitepress/zh/why/examples/2.npm-basic-package/tsconfig.esm.json +7 -0
  118. package/templates/vitepress/zh/why/examples/2.npm-basic-package/tsconfig.json +18 -0
  119. package/templates/vitepress/zh/why/examples/3.npm-basic-package/README.md +1 -0
  120. package/templates/vitepress/zh/why/examples/3.npm-basic-package/package-lock.json +1496 -0
  121. package/templates/vitepress/zh/why/examples/3.npm-basic-package/package.json +31 -0
  122. package/templates/vitepress/zh/why/examples/3.npm-basic-package/src/index.ts +8 -0
  123. package/templates/vitepress/zh/why/examples/3.npm-basic-package/tsconfig.json +16 -0
  124. package/templates/vitepress/zh/why/examples/3.npm-basic-package/tsdown.config.ts +16 -0
  125. package/templates/vitepress/zh/why/examples/usage-cjs/cjs.cjs +4 -0
  126. package/templates/vitepress/zh/why/examples/usage-cjs/esm.mjs +4 -0
  127. package/templates/vitepress/zh/why/examples/usage-cjs/index.js +8 -0
  128. package/templates/vitepress/zh/why/examples/usage-cjs/package-lock.json +36 -0
  129. package/templates/vitepress/zh/why/examples/usage-cjs/package.json +20 -0
  130. package/templates/vitepress/zh/why/examples/usage-esm/cjs.cjs +4 -0
  131. package/templates/vitepress/zh/why/examples/usage-esm/createRequire.js +7 -0
  132. package/templates/vitepress/zh/why/examples/usage-esm/esm.mjs +4 -0
  133. package/templates/vitepress/zh/why/examples/usage-esm/index.js +8 -0
  134. package/templates/vitepress/zh/why/examples/usage-esm/package-lock.json +36 -0
  135. package/templates/vitepress/zh/why/examples/usage-esm/package.json +21 -0
  136. package/templates/vitepress/zh/why/how-to-reuse-js-code.md +250 -0
  137. package/templates/vitepress/zh/why/index.md +1 -0
  138. package/templates/vitepress/zh/why/js-cjs-mjs.md +99 -0
  139. package/templates/vitepress/zh/why/js-keywords.md +132 -0
  140. package/templates/vitepress/zh/why/modern/bundlers.md +52 -0
  141. package/templates/vitepress/zh/why/modern/dts.md +93 -0
  142. package/templates/vitepress/zh/why/modern/esm-vs-cjs.md +84 -0
  143. package/templates/vitepress/zh/why/modern/index.md +55 -0
  144. package/templates/vitepress/zh/why/modern/package-entry-points.md +128 -0
  145. package/templates/vitepress/zh/why/modern/typescript.md +155 -0
  146. package/templates/vitepress/zh/why/publish-basic-npm-package.md +146 -0
  147. package/templates/vitepress/zh/why/what-is-npm-package.md +162 -0
  148. package/templates/vue-lib/package.json +12 -5
  149. package/templates/vue-lib/vitest.config.ts +1 -1
  150. package/assets/.changeset/config.json +0 -21
  151. package/assets/.changeset/publish-versioned-packages.md +0 -5
  152. package/templates/vitepress/en/index.md +0 -63
  153. package/templates/vitepress/en/knowledge/monorepo.md +0 -37
  154. package/templates/vitepress/en/repoctl/adopt-existing.md +0 -133
  155. package/templates/vitepress/en/repoctl/commands.md +0 -120
  156. package/templates/vitepress/en/repoctl/config.md +0 -69
  157. package/templates/vitepress/en/repoctl/getting-started.md +0 -116
  158. package/templates/vitepress/en/repoctl/index.md +0 -74
  159. package/templates/vitepress/en/repoctl/templates.md +0 -128
  160. package/templates/vitepress/en/repoctl/troubleshooting.md +0 -96
  161. package/templates/vitepress/en/repoctl/workflows.md +0 -89
@@ -1,260 +1,32 @@
1
- # monorepo 发包与变更日志
1
+ # Publishing and Changelogs
2
2
 
3
- 这套模板默认推荐用 `changesets` 管理版本和 changelog。原因不是“它很流行”,而是它对 monorepo 的工作方式最顺手:
3
+ repoctl coordinates release tasks with pnpm versioning. It does not replace the registry, GitHub Actions, or package build scripts.
4
4
 
5
- - 变更是按包记录的
6
- - 版本升级能自动联动内部依赖
7
- - changelog 可以稳定产出
8
- - 很容易接到 CI 里
9
-
10
- repoctl 在发布流程里的位置很明确:它不替代 `changesets` 发布版本,而是在发布前帮你确认仓库状态、模板资产和校验计划。
11
-
12
- ## repoctl 在发布前做什么
13
-
14
- ```bash
15
- pnpm exec repo doctor --strict
16
- pnpm exec repo check --full
17
- pnpm exec repo env support --markdown --redact --out reports/support.md
18
- ```
19
-
20
- | 命令 | 发布前价值 |
21
- | ---------------------- | -------------------------------------------------------- |
22
- | `repo doctor --strict` | 确认仓库结构、Node、脚本、配置和提交链路没有漂移 |
23
- | `repo check --full` | 跑根脚本里的 lint/typecheck/test/build 计划 |
24
- | `repo env support` | 保存环境、配置、doctor 和 check plan,方便发布失败后回溯 |
25
-
26
- 发布本身仍交给 `changesets`:
5
+ ## Development Flow
27
6
 
28
7
  ```bash
29
- pnpm changeset
30
- pnpm exec repo release stable
8
+ pnpm change
9
+ pnpm change status
10
+ repo release stable prepare
11
+ repo release stable publish
31
12
  ```
32
13
 
33
- 正式发布只走 `main`;`alpha`、`beta`、`rc`、`next` 只做 Changesets 的 prerelease,并发布对应 tag 包。
34
-
35
- ## 一条务实的发布流程
14
+ Change intents record the affected package and release level. The release preparation step updates versions and repository changelogs; publish sends built packages to the configured registry.
36
15
 
37
- 先把顺序记住:
16
+ ## Versioning Configuration
38
17
 
39
- 1. 写代码
40
- 2. 跑校验
41
- 3. 生成 changeset
42
- 4. 合并后 version / publish
18
+ Fixed groups and repository changelog storage live in `pnpm-workspace.yaml`. `repo doctor` reports missing or legacy release configuration.
43
19
 
44
- 对应到命令,一般是:
20
+ ## Prerelease Lanes
45
21
 
46
22
  ```bash
47
- pnpm build
48
- pnpm lint
49
- pnpm typecheck
50
- pnpm tsd
51
- pnpm test
52
- pnpm changeset
23
+ repo release pre enter beta
24
+ repo release pre publish
25
+ repo release pre exit
53
26
  ```
54
27
 
55
- 如果你改的是公开类型或类库 API,`tsd` 不要省。
56
-
57
- ## 为什么推荐 `changesets`
58
-
59
- | 需求 | `changesets` 的做法 |
60
- | -------------- | ----------------------------------------- |
61
- | 记录哪些包变了 | 每次变更生成单独的 `.changeset/*.md` 文件 |
62
- | 控制版本类型 | 明确选择 `patch` / `minor` / `major` |
63
- | 自动生成日志 | `changeset version` 统一产出 changelog |
64
- | 联动内部包版本 | 自动改内部依赖引用 |
65
- | CI 自动发布 | 可接 `changesets/action` |
66
-
67
- ## 日常开发阶段怎么做
68
-
69
- ### 1. 本地先把质量门过掉
70
-
71
- ```bash
72
- pnpm build
73
- pnpm lint
74
- pnpm typecheck
75
- pnpm tsd
76
- pnpm test
77
- ```
78
-
79
- 这一点和仓库的提交要求是一致的。
80
-
81
- ### 2. 记录 changeset
82
-
83
- ```bash
84
- pnpm changeset
85
- ```
86
-
87
- 按提示选择:
88
-
89
- 1. 哪些包受影响
90
- 2. 这些包分别是 `patch` / `minor` / `major`
91
- 3. 这次改动怎么写进 changelog
92
-
93
- 示例:
94
-
95
- ```md
96
- ---
97
- "@my/utils": minor
98
- "@my/ui": patch
99
- ---
100
-
101
- - feat(utils): 新增时间格式化工具
102
- - fix(ui): 修复按钮禁用态样式
103
- ```
104
-
105
- ### 3. 合并前看一眼影响面
106
-
107
- changeset 文件本身就是最便宜的“发布预告”。代码评审时顺手看一下,通常就能避免:
108
-
109
- - 漏记某个包
110
- - 版本类型选错
111
- - changelog 写得太含糊
112
-
113
- ## 发布阶段怎么做
114
-
115
- ### 手动流程
116
-
117
- ```bash
118
- pnpm exec repo release stable
119
- ```
120
-
121
- `repo release stable` 会先执行构建、lint 和测试,再调用 `changeset version` 与 `changeset publish`。其中 `changeset version` 会做这些事:
122
-
123
- - 更新受影响包的版本号
124
- - 调整内部依赖版本
125
- - 生成或更新每个包的 `CHANGELOG.md`
126
-
127
- ### CI 自动流程
128
-
129
- 模板推荐结合 `changesets/action`。
130
-
131
- 一个常见的工作流结构如下:
132
-
133
- ```yaml
134
- name: Release
135
-
136
- on:
137
- push:
138
- branches:
139
- - main
140
- - alpha
141
- - beta
142
- - rc
143
- - next
144
- workflow_dispatch:
145
-
146
- permissions:
147
- contents: write
148
- pull-requests: write
149
- issues: write
150
- id-token: write
151
-
152
- env:
153
- HUSKY: 0
154
-
155
- jobs:
156
- release:
157
- if: github.ref_name == 'main'
158
- runs-on: ubuntu-latest
159
- steps:
160
- - uses: actions/checkout@v7
161
- - uses: pnpm/action-setup@v6
162
- - uses: actions/setup-node@v7
163
- with:
164
- node-version: 24
165
- cache: pnpm
166
- registry-url: https://registry.npmjs.org
167
- - run: pnpm install
168
- - name: Create Release Pull Request or Publish to npm
169
- uses: changesets/action@v2.0.0
170
- with:
171
- github-token: ${{ secrets.GITHUB_TOKEN }}
172
- publish-script: pnpm exec repo release stable
173
- env:
174
- NPM_CONFIG_PROVENANCE: true
175
-
176
- prerelease:
177
- if: github.ref_name != 'main'
178
- runs-on: ubuntu-latest
179
- steps:
180
- - uses: actions/checkout@v7
181
- - uses: pnpm/action-setup@v6
182
- - uses: actions/setup-node@v7
183
- with:
184
- node-version: 24
185
- cache: pnpm
186
- - run: pnpm install
187
- - run: git config user.name "github-actions[bot]"
188
- - run: git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
189
- - name: Publish Prerelease
190
- run: pnpm exec repo release pre publish
191
- ```
192
-
193
- ## 关于 npm 鉴权
194
-
195
- 现在更推荐在 CI 里使用 OIDC,而不是长期保存一个会过期的 `NPM_TOKEN`。
196
-
197
- 原因很现实:
198
-
199
- - token 会过期
200
- - token 泄漏风险更高
201
- - OIDC 更适合自动化发布
202
-
203
- 所以工作流里建议保留:
204
-
205
- ```yaml
206
- permissions:
207
- id-token: write
208
- ```
209
-
210
- ## 常见发布约束
211
-
212
- ### 私有包不会被发布
213
-
214
- 如果一个包是:
215
-
216
- ```json
217
- {
218
- "private": true
219
- }
220
- ```
221
-
222
- 那么它通常不会进入 npm 发布流程。
223
-
224
- ### 没有 changeset 就不会有版本 PR
225
-
226
- 如果你改了公开包,却没有提交 `.changeset/*.md`,那么后续版本流转通常会断掉。
227
-
228
- ### 先 build 再发
229
-
230
- 这个仓库的约定很明确:先 build,再 lint / typecheck / tsd / test,再谈发布。不要跳步。
231
-
232
- ## 常见问题
233
-
234
- ### 为什么没有生成 changelog?
235
-
236
- 通常是下面几种原因:
237
-
238
- - 没有执行 `pnpm changeset version`
239
- - `.changeset/*.md` 没有提交
240
- - 受影响包实际没有进入版本计算
241
-
242
- ### 如何跳过某个包的发布?
243
-
244
- - 在 changeset 里不要勾选它
245
- - 或者把它标记为 `private: true`
246
-
247
- ### 为什么要在 PR 阶段就看 changeset?
248
-
249
- 因为它本质上是在回答一个非常具体的问题:
250
-
251
- “这次改动准备怎么影响发布面?”
252
-
253
- 这个问题越早看,越不容易在合并后补救。
28
+ Supported lane names include `alpha`, `beta`, `rc`, and `next`.
254
29
 
255
- ## 继续阅读
30
+ ## Recovery
256
31
 
257
- - [如何管理 monorepo](./manage.md)
258
- - [repoctl 工作流与 CI](../repoctl/workflows.md)
259
- - [repoctl 排障与报告](../repoctl/troubleshooting.md)
260
- - [命令别名](../repoctl/aliases.md)
32
+ Use the publish-unpublished release mode to recover versions that were prepared but not published. Inspect the generated report before retrying a partial release.
@@ -1,21 +1,14 @@
1
- # 模板速查
1
+ # Template Systems
2
2
 
3
- 模板创建已经收敛到 repoctl 文档:
3
+ Templates make repository conventions executable. repoctl ships internal source workspaces for libraries, Vue components, apps, services, documentation sites, and CLIs.
4
4
 
5
- - [repoctl 模板与创建](../repoctl/templates.md)
6
- - [repoctl 快速开始](../repoctl/getting-started.md)
5
+ ```bash
6
+ repo templates
7
+ repo templates --category library
8
+ repo new sdk --template tsdown --dry-run
9
+ repo templates --check
10
+ ```
7
11
 
8
- ## monorepo 知识点:模板为什么重要
12
+ The publishable `@icebreakers/monorepo-templates` package owns the registry and packaged assets. Individual `templates/*` workspaces are private and are not release units.
9
13
 
10
- 当仓库里存在多种产物时,模板能把重复选择前置成稳定默认值:
11
-
12
- | 产物 | 常见目录 | 关注点 |
13
- | ------------- | ------------------------ | ------------------------------ |
14
- | TypeScript 库 | `packages/*` | exports、types、构建和 tsd |
15
- | Vue 组件库 | `packages/*` | SFC、样式校验、类型声明 |
16
- | 应用 | `apps/*` | dev、build、部署资产 |
17
- | 服务 | `apps/*` | API 入口、运行时类型、环境变量 |
18
- | 文档站 | `apps/*` | VitePress 配置、导航、内容结构 |
19
- | CLI | `apps/*` 或 `packages/*` | bin 入口、参数解析、发布 |
20
-
21
- repoctl 的 `repo templates` 和 `repo new` 负责把这些约定落实到文件系统。
14
+ See [Templates](../repoctl/templates.md) and [Template Asset Management](../repoctl/template-assets.md).
@@ -1,20 +1,17 @@
1
- # 常见问题排障
1
+ # Monorepo Troubleshooting
2
2
 
3
- repoctl 排障文档已经集中到:
3
+ Start by identifying the problem class: workspace discovery, dependency installation, task orchestration, repository policy, or release state.
4
4
 
5
- - [repoctl 排障与报告](../repoctl/troubleshooting.md)
6
- - [repoctl 命令速查](../repoctl/commands.md)
5
+ ```bash
6
+ repo doctor
7
+ repo env support --markdown --redact --out reports/support.md
8
+ repo check --full --dry-run
9
+ pnpm change status
10
+ ```
7
11
 
8
- ## monorepo 知识点:先区分问题类型
12
+ - Workspace discovery failures usually point to `pnpm-workspace.yaml` patterns.
13
+ - Missing task output or cache behavior belongs to Turbo task configuration.
14
+ - Tooling drift belongs to managed config and `repo upgrade`.
15
+ - Release failures require checking both versioning state and registry publication.
9
16
 
10
- 排障前先判断问题属于哪一类:
11
-
12
- | 类型 | 先看什么 | 常用命令 |
13
- | -------------- | ------------------------------------- | --------------------------------------- |
14
- | 仓库结构问题 | 根目录、workspace 文件、Node 版本 | `repo doctor` |
15
- | 模板创建问题 | 模板 key、目标目录、创建计划 | `repo templates` / `repo new --dry-run` |
16
- | 提交前校验问题 | staged 文件、workspace 归属、任务路由 | `repo check --dry-run` |
17
- | 环境差异问题 | Node、pnpm、Git、CI、路径 | `repo env support --markdown --redact` |
18
- | 遗留配置问题 | `repoctl.config.ts` 与旧配置文件 | `repo config inspect` |
19
-
20
- 旧页面继续保留为知识点索引,具体排查步骤以后优先维护在 repoctl 分区。
17
+ Do not overwrite custom files until the diagnostic report and planned changes are understood.
@@ -2,18 +2,24 @@
2
2
  "name": "@icebreakers/website",
3
3
  "type": "module",
4
4
  "version": "0.0.1",
5
- "description": "https://repo.icebreaker.top source code",
5
+ "private": true,
6
+ "description": "Documentation website for repoctl",
6
7
  "author": "ice breaker <hi@sonofmagic.top>",
7
8
  "homepage": "https://repo.icebreaker.top",
8
9
  "repository": {
9
10
  "type": "git",
10
- "url": "git+https://github.com/sonofmagic/monorepo-template.git",
11
+ "url": "git+https://github.com/sonofmagic/repoctl.git",
11
12
  "directory": "templates/vitepress"
12
13
  },
13
14
  "bugs": {
14
- "url": "https://github.com/sonofmagic/monorepo-template/issues"
15
+ "url": "https://github.com/sonofmagic/repoctl/issues"
15
16
  },
16
- "keywords": [],
17
+ "keywords": [
18
+ "repoctl",
19
+ "documentation",
20
+ "vitepress",
21
+ "monorepo"
22
+ ],
17
23
  "scripts": {
18
24
  "dev": "vitepress dev",
19
25
  "build": "vitepress build",
@@ -35,7 +41,7 @@
35
41
  "mermaid": "^11.16.1",
36
42
  "tailwindcss": "^4.3.3",
37
43
  "vitepress": "^1.6.4",
38
- "vitepress-plugin-llms": "^1.13.4",
44
+ "vitepress-plugin-llms": "^1.13.5",
39
45
  "vitepress-plugin-mermaid": "^2.0.17"
40
46
  }
41
47
  }
@@ -0,0 +1,3 @@
1
+ /en / 301
2
+ /en/ / 301
3
+ /en/* /:splat 301
@@ -1,17 +1,17 @@
1
- # 接入已有仓库
1
+ # Adopt Existing Repositories
2
2
 
3
- repoctl 不只适合新模板仓库。它也可以渐进接入已有 pnpm workspace,用诊断报告和非覆盖同步把风险降下来。
3
+ repoctl is not only for newly generated repositories. It can be adopted gradually in existing pnpm workspaces by using diagnostics and conservative asset syncs.
4
4
 
5
- ## 适合接入的仓库
5
+ ## Good Candidates
6
6
 
7
- 优先满足这些条件:
7
+ A repository is a good fit when:
8
8
 
9
- - 已经使用 pnpm 或准备迁移到 pnpm。
10
- - 有根 `package.json`。
11
- - 能接受 `apps/*`、`packages/*`、`examples/*` 这类 workspace 目录约定。
12
- - 希望统一 `repo:init`、`repo:doctor`、`repo:new`、`repo:check` 这类日常入口。
9
+ - It already uses pnpm, or is ready to move to pnpm.
10
+ - It has a root `package.json`.
11
+ - It can use workspace folders such as `apps/*`, `packages/*`, or `examples/*`.
12
+ - The team wants stable daily entries such as `repo:init`, `repo:doctor`, `repo:new`, and `repo:check`.
13
13
 
14
- 如果仓库还不是 pnpm workspace,先补最小 `pnpm-workspace.yaml`:
14
+ If the repository is not yet a pnpm workspace, start with a minimal `pnpm-workspace.yaml`:
15
15
 
16
16
  ```yaml
17
17
  packages:
@@ -19,47 +19,47 @@ packages:
19
19
  - packages/*
20
20
  ```
21
21
 
22
- ## 第一步:安装并初始化
22
+ ## Step 1: Install And Setup
23
23
 
24
24
  ```bash
25
25
  pnpm add -D repoctl
26
26
  pnpm exec repo init --yes
27
27
  ```
28
28
 
29
- `repo init --yes` 会使用安全默认值。它会补齐推荐脚本和 workspace patterns,但不会无条件覆盖已有 README、package.json、pnpm-workspace.yaml 或 tooling 配置。
29
+ `repo init --yes` uses safe defaults. It adds recommended scripts and workspace patterns, but it does not blindly overwrite existing README, package.json, pnpm-workspace.yaml, or tooling files.
30
30
 
31
- ## 第二步:保存第一次诊断
31
+ ## Step 2: Save The First Diagnostic Report
32
32
 
33
33
  ```bash
34
34
  pnpm exec repo doctor --markdown --redact --out reports/doctor-before.md
35
35
  pnpm exec repo doctor --json --out reports/doctor-before.json
36
36
  ```
37
37
 
38
- 建议把第一次报告提交到 PR 评论或 artifact,而不是只看终端输出。
38
+ Prefer saving the first report as a PR comment or CI artifact instead of relying only on terminal output.
39
39
 
40
- 重点看这些项:
40
+ Watch these checks:
41
41
 
42
- | 检查项 | 常见问题 |
43
- | ---------------------------- | ------------------------------------------------ |
44
- | `package-json` | 当前目录不是仓库根目录 |
45
- | `workspace-manifest` | 缺少 `pnpm-workspace.yaml` |
46
- | `node-version` | 根 package 没声明 `engines.node` 或版本不匹配 |
47
- | `tool-package` | 没安装 `repoctl` |
48
- | `root-scripts` | 缺少 `repo:init/repo:new/repo:check/repo:doctor` |
49
- | `config-file` | 残留已废弃的 `monorepo.config.ts` |
50
- | `commit-hooks` | Husky 和 lint-staged 只接了一半 |
51
- | `workspace-package-coverage` | package.json 没被 workspace patterns 覆盖 |
42
+ | Check | Common Issue |
43
+ | ---------------------------- | ----------------------------------------------------------------- |
44
+ | `package-json` | Current directory is not the repository root |
45
+ | `workspace-manifest` | `pnpm-workspace.yaml` is missing |
46
+ | `node-version` | Root package has no `engines.node`, or the version does not match |
47
+ | `tool-package` | `repoctl` is not installed |
48
+ | `root-scripts` | `repo:init/repo:new/repo:check/repo:doctor` scripts are missing |
49
+ | `config-file` | A stale `monorepo.config.ts` file is still present |
50
+ | `commit-hooks` | Husky and lint-staged are only partially configured |
51
+ | `workspace-package-coverage` | Some package.json files are not covered by workspace patterns |
52
52
 
53
- ## 第三步:保守同步标准资产
53
+ ## Step 3: Sync Conservatively
54
54
 
55
55
  ```bash
56
56
  pnpm exec repo upgrade --no-overwrite
57
57
  pnpm exec repo doctor --markdown --redact --out reports/doctor-after.md
58
58
  ```
59
59
 
60
- `--no-overwrite` 适合第一次接入:它同步缺失资产,但保留已有 drifted 文件。你可以在 PR diff 里逐项看哪些配置要进一步迁移。
60
+ Use `--no-overwrite` for the first adoption pass. It syncs missing assets while preserving changed managed files.
61
61
 
62
- ## 第四步:预览校验计划
62
+ ## Step 4: Preview Verification
63
63
 
64
64
  ```bash
65
65
  pnpm exec repo check --dry-run
@@ -67,11 +67,11 @@ pnpm exec repo check --json --out reports/check-plan.json
67
67
  pnpm exec repo check --markdown --redact --out reports/check-plan.md
68
68
  ```
69
69
 
70
- 先看 plan,再决定要不要接入 hook 或 CI。
70
+ Review the plan before wiring hooks or CI.
71
71
 
72
- ## 第五步:接入根脚本
72
+ ## Step 5: Use Root Scripts
73
73
 
74
- 如果 `repo init` 已补齐根脚本,团队日常文档优先改成:
74
+ After `repo init`, team docs can use:
75
75
 
76
76
  ```bash
77
77
  pnpm run repo:doctor
@@ -79,57 +79,55 @@ pnpm run repo:new -- sdk
79
79
  pnpm run repo:check
80
80
  ```
81
81
 
82
- CI 和自动化脚本仍建议写完整 CLI:
82
+ CI and automation should still prefer explicit commands:
83
83
 
84
84
  ```bash
85
85
  pnpm exec repo doctor --strict
86
86
  pnpm exec repo check --full
87
87
  ```
88
88
 
89
- ## 第六步:处理遗留配置
89
+ ## Step 6: Resolve Legacy Config
90
90
 
91
- ### 遗留配置文件
91
+ ### Config Conflicts
92
92
 
93
- 只保留:
93
+ Keep only:
94
94
 
95
95
  ```txt
96
96
  repoctl.config.ts
97
97
  ```
98
98
 
99
- `monorepo.config.ts` 已不再加载;请改名为 `repoctl.config.ts`。
99
+ `monorepo.config.ts` is no longer loaded at runtime; rename it to `repoctl.config.ts`.
100
100
 
101
- ### 本地 tooling loader
101
+ ### Local Tooling Loader
102
102
 
103
- 如果 `doctor` 提示 tooling 配置引用了本地源码 loader,使用:
103
+ If `doctor` reports local source tooling loaders, migrate with:
104
104
 
105
105
  ```bash
106
106
  pnpm exec repo upgrade --yes
107
107
  ```
108
108
 
109
- 这个命令会迁移到 `repoctl/tooling` 入口。简单的 `@icebreakers/commitlint-config`、`@icebreakers/eslint-config`、`@icebreakers/stylelint-config` wrapper 也会被保守转换为 `repoctl/tooling`,复杂 ESLint 配置会保留原有 rules、ignores、overrides 和额外 flat config 语义。
109
+ The same migration also converts simple wrappers from `@icebreakers/commitlint-config`, `@icebreakers/eslint-config`, and `@icebreakers/stylelint-config` to `repoctl/tooling`. Complex ESLint configs keep their rules, ignores, overrides, and extra flat config semantics.
110
110
 
111
- ### workspace patterns 不覆盖包
111
+ ### Workspace Pattern Gaps
112
112
 
113
- 运行:
113
+ Run:
114
114
 
115
115
  ```bash
116
116
  pnpm exec repo init --yes
117
117
  ```
118
118
 
119
- 或手动扩展 `pnpm-workspace.yaml`。
119
+ or manually extend `pnpm-workspace.yaml`.
120
120
 
121
- ## 推荐 PR 结构
121
+ ## Recommended PR Shape
122
122
 
123
- 存量仓库接入建议拆成小 PR:
123
+ 1. Install `repoctl` and add root scripts.
124
+ 2. Attach `doctor-before` and `doctor-after` reports.
125
+ 3. Sync or migrate tooling config.
126
+ 4. Wire hooks and CI.
127
+ 5. Verify scaffolding paths with `repo new --dry-run`.
124
128
 
125
- 1. 安装 `repoctl`,补 `init/doctor/new/check` 根脚本。
126
- 2. 提交 `doctor-before` 和 `doctor-after` 报告。
127
- 3. 同步或迁移 tooling 配置。
128
- 4. 接入 hook 和 CI。
129
- 5. 用 `repo new --dry-run` 验证模板创建路径。
129
+ ## Keep Reading
130
130
 
131
- ## 下一步
132
-
133
- - [工作流与 CI](./workflows.md)
134
- - [排障与报告](./troubleshooting.md)
135
- - [配置文件](./config.md)
131
+ - [Workflows and CI](./workflows.md)
132
+ - [Troubleshooting](./troubleshooting.md)
133
+ - [Configuration](./config.md)
@@ -1,10 +1,10 @@
1
- # 命令别名
1
+ # Command Aliases
2
2
 
3
- repoctl 保留了一组短别名,方便熟悉后在终端里少打字。团队文档仍建议优先写完整命令,减少新人理解成本。
3
+ repoctl keeps several aliases for terminal convenience. Team docs should still prefer full commands because they are easier for new users to read.
4
4
 
5
- ## 包入口别名
5
+ ## Binary Aliases
6
6
 
7
- `repoctl` 包提供多个 bin:
7
+ The `repoctl` package exposes these bins:
8
8
 
9
9
  ```bash
10
10
  repo
@@ -14,9 +14,9 @@ rc
14
14
  mo
15
15
  ```
16
16
 
17
- 文档统一推荐 `repo`。
17
+ The docs recommend `repo`.
18
18
 
19
- 这些 bin 都进入同一套命令实现:
19
+ These bins all enter the same command implementation:
20
20
 
21
21
  ```bash
22
22
  repoctl doctor
@@ -25,16 +25,16 @@ rc doctor
25
25
  mo doctor
26
26
  ```
27
27
 
28
- ## 顶层命令别名
28
+ ## Top-Level Aliases
29
29
 
30
- | 推荐写法 | 短写 | 说明 |
31
- | ---------------- | ----------- | ---------------- |
32
- | `repo init` | `repo init` | 初始化仓库默认值 |
33
- | `repo templates` | `repo tpl` | 查看或检查模板 |
30
+ | Recommended | Alias | Purpose |
31
+ | ---------------- | ----------- | ----------------------------- |
32
+ | `repo init` | `repo init` | Initialize workspace defaults |
33
+ | `repo templates` | `repo tpl` | Inspect or check templates |
34
34
 
35
- ## 分组命令别名
35
+ ## Group Aliases
36
36
 
37
- | 完整命令 | 短写 |
37
+ | Full Command | Alias |
38
38
  | ------------------------------ | --------------- |
39
39
  | `repo workspace` | `repo ws` |
40
40
  | `repo workspace upgrade` | `repo ws up` |
@@ -62,9 +62,9 @@ mo doctor
62
62
  | `repo ai prompt` | `repo ai p` |
63
63
  | `repo ai prompt create` | `repo ai p new` |
64
64
 
65
- ## 推荐使用原则
65
+ ## Recommendation
66
66
 
67
- - 新手教程写完整命令,例如 `pnpm exec repo doctor`。
68
- - 团队 README 写根脚本,例如 `pnpm run repo:doctor`。
69
- - 维护者脚本可以写短别名,但要在注释或文档里说明用途。
70
- - CI 里优先写完整命令,方便日志搜索。
67
+ - Use full commands in onboarding docs.
68
+ - Use `repo:*` root scripts in project README files, for example `pnpm run repo:doctor`.
69
+ - Use short aliases in maintainer scripts only when the surrounding docs explain them.
70
+ - Prefer full commands in CI logs.