@icebreakers/monorepo-templates 1.3.0 → 1.3.2

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 (213) hide show
  1. package/README.md +6 -0
  2. package/README.zh-CN.md +6 -0
  3. package/assets/.github/workflows/ci.yml +11 -0
  4. package/assets/.github/workflows/release-intent-check.yml +57 -0
  5. package/assets/CONTRIBUTING.md +3 -1
  6. package/assets/package.json +57 -14
  7. package/assets/pnpm-workspace.yaml +13 -0
  8. package/assets/repoctl.config.ts +6 -1
  9. package/assets/turbo.json +16 -0
  10. package/package.json +4 -4
  11. package/templates/client/eslint.config.js +1 -1
  12. package/templates/client/package.json +13 -13
  13. package/templates/client/worker-configuration.d.ts +763 -217
  14. package/templates/server/package.json +3 -3
  15. package/templates/server/worker-configuration.d.ts +763 -217
  16. package/templates/vitepress/.vitepress/config.ts +17 -7
  17. package/templates/vitepress/.vitepress/home/content.ts +64 -156
  18. package/templates/vitepress/.vitepress/home/types.ts +18 -34
  19. package/templates/vitepress/.vitepress/navigation/routes.ts +89 -81
  20. package/templates/vitepress/.vitepress/seo.ts +16 -2
  21. package/templates/vitepress/.vitepress/theme/Layout.vue +27 -0
  22. package/templates/vitepress/.vitepress/theme/components/HomePage.vue +66 -88
  23. package/templates/vitepress/.vitepress/theme/home/foundation.css +161 -104
  24. package/templates/vitepress/.vitepress/theme/home/responsive.css +113 -20
  25. package/templates/vitepress/.vitepress/theme/home/sections.css +179 -100
  26. package/templates/vitepress/.vitepress/theme/index.ts +2 -0
  27. package/templates/vitepress/learn/index.md +18 -0
  28. package/templates/vitepress/{monorepo → learn/monorepo}/commands.md +1 -1
  29. package/templates/vitepress/{monorepo → learn/monorepo}/index.md +3 -3
  30. package/templates/vitepress/{monorepo → learn/monorepo}/templates.md +1 -1
  31. package/templates/vitepress/{why/what-is-npm-package.md → learn/packages/index.md} +1 -1
  32. package/templates/vitepress/{why → learn/packages}/modern/index.md +2 -2
  33. package/templates/vitepress/{why → learn/packages}/modern/typescript.md +1 -1
  34. package/templates/vitepress/{why/index.md → learn/packages/modern-overview.md} +1 -1
  35. package/templates/vitepress/{why/publish-basic-npm-package.md → learn/packages/publish.md} +1 -1
  36. package/templates/vitepress/{why/how-to-reuse-js-code.md → learn/packages/reuse-javascript.md} +2 -2
  37. package/templates/vitepress/{why/js-keywords.md → learn/packages/runtime-globals.md} +2 -2
  38. package/templates/vitepress/{repoctl/index.md → learn/repoctl-model.md} +8 -8
  39. package/templates/vitepress/{tools → learn/tools}/changeset.md +3 -3
  40. package/templates/vitepress/{tools → learn/tools}/husky.md +2 -2
  41. package/templates/vitepress/{tools → learn/tools}/lint-staged.md +2 -2
  42. package/templates/vitepress/{tools → learn/tools}/llms-txt.md +1 -1
  43. package/templates/vitepress/{tools → learn/tools}/pnpm.md +2 -2
  44. package/templates/vitepress/{tools → learn/tools}/renovate.md +2 -2
  45. package/templates/vitepress/{tools → learn/tools}/turborepo.md +2 -2
  46. package/templates/vitepress/package.json +7 -7
  47. package/templates/vitepress/public/brand/apple-touch-icon.png +0 -0
  48. package/templates/vitepress/public/brand/favicon.ico +0 -0
  49. package/templates/vitepress/public/brand/repoctl-lockup-dark.svg +6 -0
  50. package/templates/vitepress/public/brand/repoctl-lockup.svg +20 -0
  51. package/templates/vitepress/public/brand/repoctl-mark-192.png +0 -0
  52. package/templates/vitepress/public/brand/repoctl-mark-dark.svg +13 -0
  53. package/templates/vitepress/public/brand/repoctl-mark.svg +13 -0
  54. package/templates/vitepress/public/brand/repoctl-social-en.png +0 -0
  55. package/templates/vitepress/public/brand/repoctl-social-en.webp +0 -0
  56. package/templates/vitepress/public/brand/repoctl-social-zh.png +0 -0
  57. package/templates/vitepress/public/brand/repoctl-social-zh.webp +0 -0
  58. package/templates/vitepress/public/favicon.ico +0 -0
  59. package/templates/vitepress/public/logo.jpg +0 -0
  60. package/templates/vitepress/{repoctl → reference}/commands.md +2 -2
  61. package/templates/vitepress/reference/index.md +15 -0
  62. package/templates/vitepress/reference/output.md +37 -0
  63. package/templates/vitepress/{repoctl → reference}/templates.md +2 -2
  64. package/templates/vitepress/scripts/check-locales.ts +35 -1
  65. package/templates/vitepress/start/choose-next.md +14 -0
  66. package/templates/vitepress/start/first-run.md +39 -0
  67. package/templates/vitepress/start/index.md +26 -0
  68. package/templates/vitepress/{repoctl/getting-started.md → start/install.md} +5 -5
  69. package/templates/vitepress/{repoctl → tasks}/adopt-existing.md +30 -4
  70. package/templates/vitepress/{repoctl → tasks}/checks.md +27 -1
  71. package/templates/vitepress/{repoctl/workflows.md → tasks/ci.md} +30 -4
  72. package/templates/vitepress/tasks/create-project.md +37 -0
  73. package/templates/vitepress/{repoctl/scenarios.md → tasks/index.md} +8 -8
  74. package/templates/vitepress/tasks/release.md +31 -0
  75. package/templates/vitepress/{repoctl → tasks}/reports.md +25 -0
  76. package/templates/vitepress/{repoctl → tasks}/troubleshooting.md +30 -4
  77. package/templates/vitepress/zh/ai/llms-txt.md +6 -6
  78. package/templates/vitepress/zh/learn/index.md +18 -0
  79. package/templates/vitepress/zh/{monorepo → learn/monorepo}/commands.md +3 -3
  80. package/templates/vitepress/zh/{monorepo → learn/monorepo}/manage.md +4 -4
  81. package/templates/vitepress/zh/{monorepo → learn/monorepo}/templates.md +2 -2
  82. package/templates/vitepress/zh/{monorepo → learn/monorepo}/troubleshooting.md +2 -2
  83. package/templates/vitepress/zh/{why → learn/packages}/modern/index.md +1 -1
  84. package/templates/vitepress/zh/{why/index.md → learn/packages/modern-overview.md} +2 -2
  85. package/templates/vitepress/zh/{repoctl/index.md → learn/repoctl-model.md} +19 -19
  86. package/templates/vitepress/zh/{tools → learn/tools}/husky.md +1 -1
  87. package/templates/vitepress/zh/{tools → learn/tools}/lint-staged.md +1 -1
  88. package/templates/vitepress/zh/{tools → learn/tools}/llms-txt.md +1 -1
  89. package/templates/vitepress/zh/{tools → learn/tools}/pnpm.md +1 -1
  90. package/templates/vitepress/zh/{tools → learn/tools}/turborepo.md +11 -11
  91. package/templates/vitepress/zh/{repoctl → reference}/commands.md +4 -4
  92. package/templates/vitepress/zh/{repoctl → reference}/config.md +1 -1
  93. package/templates/vitepress/zh/reference/index.md +15 -0
  94. package/templates/vitepress/zh/reference/output.md +37 -0
  95. package/templates/vitepress/zh/{repoctl → reference}/templates.md +4 -4
  96. package/templates/vitepress/zh/start/choose-next.md +14 -0
  97. package/templates/vitepress/zh/{repoctl/doctor.md → start/diagnose.md} +1 -1
  98. package/templates/vitepress/zh/start/first-run.md +39 -0
  99. package/templates/vitepress/zh/start/index.md +26 -0
  100. package/templates/vitepress/zh/{repoctl/getting-started.md → start/install.md} +5 -5
  101. package/templates/vitepress/zh/{repoctl → tasks}/adopt-existing.md +30 -4
  102. package/templates/vitepress/zh/{repoctl → tasks}/checks.md +27 -1
  103. package/templates/vitepress/zh/{repoctl/workflows.md → tasks/ci.md} +38 -12
  104. package/templates/vitepress/zh/tasks/create-project.md +37 -0
  105. package/templates/vitepress/zh/{repoctl/scenarios.md → tasks/index.md} +8 -8
  106. package/templates/vitepress/zh/tasks/release.md +31 -0
  107. package/templates/vitepress/zh/{repoctl → tasks}/reports.md +25 -0
  108. package/templates/vitepress/zh/{repoctl → tasks}/troubleshooting.md +39 -13
  109. package/templates/vue-lib/package.json +5 -5
  110. package/templates/vitepress/getting-started.md +0 -11
  111. package/templates/vitepress/knowledge/index.md +0 -26
  112. package/templates/vitepress/thinking.md +0 -22
  113. package/templates/vitepress/zh/getting-started.md +0 -40
  114. package/templates/vitepress/zh/knowledge/index.md +0 -50
  115. package/templates/vitepress/zh/thinking.md +0 -91
  116. /package/templates/vitepress/{monorepo → learn/monorepo}/manage.md +0 -0
  117. /package/templates/vitepress/{monorepo → learn/monorepo}/publish.md +0 -0
  118. /package/templates/vitepress/{monorepo → learn/monorepo}/troubleshooting.md +0 -0
  119. /package/templates/vitepress/{why → learn/packages}/assets/npm-dt.svg +0 -0
  120. /package/templates/vitepress/{why → learn/packages}/assets/npm-ts.svg +0 -0
  121. /package/templates/vitepress/{why → learn/packages}/examples/0.npm-basic-package/index.js +0 -0
  122. /package/templates/vitepress/{why → learn/packages}/examples/0.npm-basic-package/package.json +0 -0
  123. /package/templates/vitepress/{why → learn/packages}/examples/1.npm-basic-package/index.cjs +0 -0
  124. /package/templates/vitepress/{why → learn/packages}/examples/1.npm-basic-package/index.d.ts +0 -0
  125. /package/templates/vitepress/{why → learn/packages}/examples/1.npm-basic-package/index.js +0 -0
  126. /package/templates/vitepress/{why → learn/packages}/examples/1.npm-basic-package/package.json +0 -0
  127. /package/templates/vitepress/{why → learn/packages}/examples/2.npm-basic-package/README.md +0 -0
  128. /package/templates/vitepress/{why → learn/packages}/examples/2.npm-basic-package/package-lock.json +0 -0
  129. /package/templates/vitepress/{why → learn/packages}/examples/2.npm-basic-package/package.json +0 -0
  130. /package/templates/vitepress/{why → learn/packages}/examples/2.npm-basic-package/rename-ext.js +0 -0
  131. /package/templates/vitepress/{why → learn/packages}/examples/2.npm-basic-package/src/index.ts +0 -0
  132. /package/templates/vitepress/{why → learn/packages}/examples/2.npm-basic-package/tsconfig.cjs.json +0 -0
  133. /package/templates/vitepress/{why → learn/packages}/examples/2.npm-basic-package/tsconfig.esm.json +0 -0
  134. /package/templates/vitepress/{why → learn/packages}/examples/2.npm-basic-package/tsconfig.json +0 -0
  135. /package/templates/vitepress/{why → learn/packages}/examples/3.npm-basic-package/README.md +0 -0
  136. /package/templates/vitepress/{why → learn/packages}/examples/3.npm-basic-package/package-lock.json +0 -0
  137. /package/templates/vitepress/{why → learn/packages}/examples/3.npm-basic-package/package.json +0 -0
  138. /package/templates/vitepress/{why → learn/packages}/examples/3.npm-basic-package/src/index.ts +0 -0
  139. /package/templates/vitepress/{why → learn/packages}/examples/3.npm-basic-package/tsconfig.json +0 -0
  140. /package/templates/vitepress/{why → learn/packages}/examples/3.npm-basic-package/tsdown.config.ts +0 -0
  141. /package/templates/vitepress/{why → learn/packages}/examples/usage-cjs/cjs.cjs +0 -0
  142. /package/templates/vitepress/{why → learn/packages}/examples/usage-cjs/esm.mjs +0 -0
  143. /package/templates/vitepress/{why → learn/packages}/examples/usage-cjs/index.js +0 -0
  144. /package/templates/vitepress/{why → learn/packages}/examples/usage-cjs/package-lock.json +0 -0
  145. /package/templates/vitepress/{why → learn/packages}/examples/usage-cjs/package.json +0 -0
  146. /package/templates/vitepress/{why → learn/packages}/examples/usage-esm/cjs.cjs +0 -0
  147. /package/templates/vitepress/{why → learn/packages}/examples/usage-esm/createRequire.js +0 -0
  148. /package/templates/vitepress/{why → learn/packages}/examples/usage-esm/esm.mjs +0 -0
  149. /package/templates/vitepress/{why → learn/packages}/examples/usage-esm/index.js +0 -0
  150. /package/templates/vitepress/{why → learn/packages}/examples/usage-esm/package-lock.json +0 -0
  151. /package/templates/vitepress/{why → learn/packages}/examples/usage-esm/package.json +0 -0
  152. /package/templates/vitepress/{why → learn/packages}/modern/bundlers.md +0 -0
  153. /package/templates/vitepress/{why → learn/packages}/modern/dts.md +0 -0
  154. /package/templates/vitepress/{why → learn/packages}/modern/esm-vs-cjs.md +0 -0
  155. /package/templates/vitepress/{why → learn/packages}/modern/package-entry-points.md +0 -0
  156. /package/templates/vitepress/{why/js-cjs-mjs.md → learn/packages/module-extensions.md} +0 -0
  157. /package/templates/vitepress/{tools → learn/tools}/index.md +0 -0
  158. /package/templates/vitepress/{repoctl → reference}/aliases.md +0 -0
  159. /package/templates/vitepress/{repoctl → reference}/config.md +0 -0
  160. /package/templates/vitepress/{repoctl → reference}/execution-model.md +0 -0
  161. /package/templates/vitepress/{repoctl → reference}/template-assets.md +0 -0
  162. /package/templates/vitepress/{repoctl/doctor.md → start/diagnose.md} +0 -0
  163. /package/templates/vitepress/zh/{monorepo → learn/monorepo}/index.md +0 -0
  164. /package/templates/vitepress/zh/{monorepo → learn/monorepo}/publish.md +0 -0
  165. /package/templates/vitepress/zh/{why → learn/packages}/assets/npm-dt.svg +0 -0
  166. /package/templates/vitepress/zh/{why → learn/packages}/assets/npm-ts.svg +0 -0
  167. /package/templates/vitepress/zh/{why → learn/packages}/examples/0.npm-basic-package/index.js +0 -0
  168. /package/templates/vitepress/zh/{why → learn/packages}/examples/0.npm-basic-package/package.json +0 -0
  169. /package/templates/vitepress/zh/{why → learn/packages}/examples/1.npm-basic-package/index.cjs +0 -0
  170. /package/templates/vitepress/zh/{why → learn/packages}/examples/1.npm-basic-package/index.d.ts +0 -0
  171. /package/templates/vitepress/zh/{why → learn/packages}/examples/1.npm-basic-package/index.js +0 -0
  172. /package/templates/vitepress/zh/{why → learn/packages}/examples/1.npm-basic-package/package.json +0 -0
  173. /package/templates/vitepress/zh/{why → learn/packages}/examples/2.npm-basic-package/README.md +0 -0
  174. /package/templates/vitepress/zh/{why → learn/packages}/examples/2.npm-basic-package/package-lock.json +0 -0
  175. /package/templates/vitepress/zh/{why → learn/packages}/examples/2.npm-basic-package/package.json +0 -0
  176. /package/templates/vitepress/zh/{why → learn/packages}/examples/2.npm-basic-package/rename-ext.js +0 -0
  177. /package/templates/vitepress/zh/{why → learn/packages}/examples/2.npm-basic-package/src/index.ts +0 -0
  178. /package/templates/vitepress/zh/{why → learn/packages}/examples/2.npm-basic-package/tsconfig.cjs.json +0 -0
  179. /package/templates/vitepress/zh/{why → learn/packages}/examples/2.npm-basic-package/tsconfig.esm.json +0 -0
  180. /package/templates/vitepress/zh/{why → learn/packages}/examples/2.npm-basic-package/tsconfig.json +0 -0
  181. /package/templates/vitepress/zh/{why → learn/packages}/examples/3.npm-basic-package/README.md +0 -0
  182. /package/templates/vitepress/zh/{why → learn/packages}/examples/3.npm-basic-package/package-lock.json +0 -0
  183. /package/templates/vitepress/zh/{why → learn/packages}/examples/3.npm-basic-package/package.json +0 -0
  184. /package/templates/vitepress/zh/{why → learn/packages}/examples/3.npm-basic-package/src/index.ts +0 -0
  185. /package/templates/vitepress/zh/{why → learn/packages}/examples/3.npm-basic-package/tsconfig.json +0 -0
  186. /package/templates/vitepress/zh/{why → learn/packages}/examples/3.npm-basic-package/tsdown.config.ts +0 -0
  187. /package/templates/vitepress/zh/{why → learn/packages}/examples/usage-cjs/cjs.cjs +0 -0
  188. /package/templates/vitepress/zh/{why → learn/packages}/examples/usage-cjs/esm.mjs +0 -0
  189. /package/templates/vitepress/zh/{why → learn/packages}/examples/usage-cjs/index.js +0 -0
  190. /package/templates/vitepress/zh/{why → learn/packages}/examples/usage-cjs/package-lock.json +0 -0
  191. /package/templates/vitepress/zh/{why → learn/packages}/examples/usage-cjs/package.json +0 -0
  192. /package/templates/vitepress/zh/{why → learn/packages}/examples/usage-esm/cjs.cjs +0 -0
  193. /package/templates/vitepress/zh/{why → learn/packages}/examples/usage-esm/createRequire.js +0 -0
  194. /package/templates/vitepress/zh/{why → learn/packages}/examples/usage-esm/esm.mjs +0 -0
  195. /package/templates/vitepress/zh/{why → learn/packages}/examples/usage-esm/index.js +0 -0
  196. /package/templates/vitepress/zh/{why → learn/packages}/examples/usage-esm/package-lock.json +0 -0
  197. /package/templates/vitepress/zh/{why → learn/packages}/examples/usage-esm/package.json +0 -0
  198. /package/templates/vitepress/zh/{why/what-is-npm-package.md → learn/packages/index.md} +0 -0
  199. /package/templates/vitepress/zh/{why → learn/packages}/modern/bundlers.md +0 -0
  200. /package/templates/vitepress/zh/{why → learn/packages}/modern/dts.md +0 -0
  201. /package/templates/vitepress/zh/{why → learn/packages}/modern/esm-vs-cjs.md +0 -0
  202. /package/templates/vitepress/zh/{why → learn/packages}/modern/package-entry-points.md +0 -0
  203. /package/templates/vitepress/zh/{why → learn/packages}/modern/typescript.md +0 -0
  204. /package/templates/vitepress/zh/{why/js-cjs-mjs.md → learn/packages/module-extensions.md} +0 -0
  205. /package/templates/vitepress/zh/{why/publish-basic-npm-package.md → learn/packages/publish.md} +0 -0
  206. /package/templates/vitepress/zh/{why/how-to-reuse-js-code.md → learn/packages/reuse-javascript.md} +0 -0
  207. /package/templates/vitepress/zh/{why/js-keywords.md → learn/packages/runtime-globals.md} +0 -0
  208. /package/templates/vitepress/zh/{tools → learn/tools}/changeset.md +0 -0
  209. /package/templates/vitepress/zh/{tools → learn/tools}/index.md +0 -0
  210. /package/templates/vitepress/zh/{tools → learn/tools}/renovate.md +0 -0
  211. /package/templates/vitepress/zh/{repoctl → reference}/aliases.md +0 -0
  212. /package/templates/vitepress/zh/{repoctl → reference}/execution-model.md +0 -0
  213. /package/templates/vitepress/zh/{repoctl → reference}/template-assets.md +0 -0
@@ -7,15 +7,25 @@ import { createPageHead, siteOrigin } from './seo'
7
7
 
8
8
  export default withMermaid(defineConfig({
9
9
  outDir: '.vitepress/dist',
10
+ srcExclude: ['CHANGELOG.md', 'learn/packages/examples/**', 'zh/learn/packages/examples/**'],
10
11
  title: 'repoctl',
11
- description: 'Task-first CLI for initializing, maintaining, validating, and releasing pnpm and Turborepo monorepos.',
12
+ description: 'A practical CLI guide for setting up, checking, and maintaining pnpm and Turborepo monorepos.',
12
13
  lastUpdated: true,
13
14
  cleanUrls: true,
14
15
  sitemap: { hostname: siteOrigin },
15
16
  transformHead: createPageHead,
16
- head: [['link', { rel: 'icon', href: '/logo.jpg' }]],
17
+ head: [
18
+ ['link', { rel: 'icon', type: 'image/svg+xml', href: '/brand/repoctl-mark.svg' }],
19
+ ['link', { rel: 'icon', type: 'image/svg+xml', href: '/brand/repoctl-mark-dark.svg', media: '(prefers-color-scheme: dark)' }],
20
+ ['link', { rel: 'alternate icon', type: 'image/x-icon', href: '/brand/favicon.ico' }],
21
+ ['link', { rel: 'apple-touch-icon', sizes: '180x180', href: '/brand/apple-touch-icon.png' }],
22
+ ],
17
23
  themeConfig: {
18
- logo: '/logo.jpg',
24
+ logo: {
25
+ light: '/brand/repoctl-mark.svg',
26
+ dark: '/brand/repoctl-mark-dark.svg',
27
+ alt: 'repoctl',
28
+ },
19
29
  search: { provider: 'local' },
20
30
  socialLinks: [{ icon: 'github', link: 'https://github.com/sonofmagic/repoctl' }],
21
31
  },
@@ -24,7 +34,7 @@ export default withMermaid(defineConfig({
24
34
  label: 'English',
25
35
  lang: 'en-US',
26
36
  title: 'repoctl',
27
- description: 'Task-first CLI for practical pnpm and Turborepo monorepos.',
37
+ description: 'A practical CLI guide for setting up, checking, and maintaining pnpm and Turborepo monorepos.',
28
38
  themeConfig: {
29
39
  nav: createNav('en'),
30
40
  outline: { label: 'On This Page', level: [2, 3] },
@@ -42,7 +52,7 @@ export default withMermaid(defineConfig({
42
52
  lang: 'zh-CN',
43
53
  link: '/zh/',
44
54
  title: 'repoctl',
45
- description: '面向 pnpm 与 Turborepo monorepo 的任务型 CLI。',
55
+ description: '面向 pnpm 与 Turborepo monorepo 的实用 CLI 文档。',
46
56
  themeConfig: {
47
57
  nav: createNav('zh'),
48
58
  outline: { label: '目录', level: [2, 3] },
@@ -62,14 +72,14 @@ export default withMermaid(defineConfig({
62
72
  Tailwindcss(),
63
73
  llmstxt({
64
74
  title: 'repoctl',
65
- description: 'Task-first CLI for pnpm and Turborepo monorepos. Simplified Chinese documentation is available under /zh/.',
75
+ description: 'Practical documentation for setting up, checking, and maintaining pnpm and Turborepo monorepos. Chinese documentation is available under /zh/.',
66
76
  domain: siteOrigin,
67
77
  ignoreFiles: [
68
78
  'zh/**',
69
79
  'en/**',
70
80
  'CHANGELOG.md',
71
81
  'thinking.md',
72
- 'why/examples/**',
82
+ 'learn/packages/examples/**',
73
83
  '.vitepress/**',
74
84
  '**/node_modules/**',
75
85
  '**/internal/**',
@@ -3,182 +3,90 @@ import type { HomeContent } from './types'
3
3
 
4
4
  const english = {
5
5
  hero: {
6
- label: 'Task-first monorepo operations',
7
- title: 'Run monorepo work.',
8
- description: 'One CLI for setup, diagnosis, scaffolding, verification, and release work in pnpm monorepos.',
9
- primary: { label: 'Get Started', href: '/repoctl/getting-started' },
10
- secondary: { label: 'Explore Commands', href: '/repoctl/commands' },
11
- imageAlt: 'A real repoctl doctor report for this workspace',
12
- },
13
- proof: ['pnpm-native', 'Turborepo-aware', 'Dry-run first', 'JSON and Markdown reports', 'Built for CI'],
14
- lifecycle: {
15
- title: 'A stable task lifecycle',
16
- description: 'Each command answers one repository question and leaves a reportable result.',
17
- steps: [
18
- { title: 'Initialize', body: 'Install managed root assets and the standard repo scripts.', command: 'repo init' },
19
- { title: 'Diagnose', body: 'Inspect workspace structure, tool versions, hooks, and release configuration.', command: 'repo doctor' },
20
- { title: 'Create', body: 'Choose a known template and preview every planned file before writing.', command: 'repo new' },
21
- { title: 'Verify', body: 'Route lint, typecheck, build, test, and tsd through one repeatable plan.', command: 'repo check' },
22
- { title: 'Release', body: 'Record change intent, version fixed groups, publish, and complete hooks.', command: 'repo release' },
23
- ],
24
- },
25
- paths: {
26
- title: 'Start where your repository is',
27
- description: 'repoctl supports greenfield workspaces and careful adoption without forcing the same migration path.',
28
- items: [
29
- {
30
- title: 'Create a new workspace',
31
- body: 'Bootstrap the managed conventions, then scaffold only the packages and applications you need.',
32
- commands: ['pnpm create repoctl', 'pnpm run repo:new'],
33
- href: '/repoctl/getting-started',
34
- linkLabel: 'Create a repository',
35
- },
36
- {
37
- title: 'Adopt an existing workspace',
38
- body: 'Capture a redacted baseline, preview asset drift, and opt into changes in reviewable steps.',
39
- commands: ['repo doctor --markdown --redact', 'repo upgrade --no-overwrite'],
40
- href: '/repoctl/adopt-existing',
41
- linkLabel: 'Plan an adoption',
42
- },
43
- ],
44
- },
45
- capabilities: {
46
- title: 'Repository work with explicit boundaries',
47
- description: 'The CLI keeps templates, managed assets, checks, and reports separate so automation stays understandable.',
6
+ label: 'repoctl documentation',
7
+ title: 'What does your repository need next?',
8
+ description: 'Initialize, diagnose, create, check, and release pnpm or Turborepo workspaces from one task-first CLI.',
9
+ primaryAction: { label: 'Get started', href: '/start/' },
10
+ secondaryAction: { label: 'Browse commands', href: '/reference/commands' },
11
+ imageAlt: 'A real repoctl doctor report showing repository checks and findings',
12
+ },
13
+ tasks: {
14
+ title: 'Choose a task',
15
+ description: 'Pick the result you need. Each path begins with the smallest safe command.',
48
16
  items: [
49
- { title: 'Managed assets', body: 'Compare standard root files before replacing local decisions.' },
50
- { title: 'Template catalog', body: 'Create libraries, CLIs, services, clients, and docs from named templates.' },
51
- { title: 'Verification planner', body: 'See the exact task graph in dry-run, JSON, or Markdown before execution.' },
52
- { title: 'Environment reports', body: 'Share redacted support context without leaking repository paths or tokens.' },
17
+ { title: 'Start a new repository', body: 'Set up the shared conventions before you add projects.', command: 'repo init', link: { label: 'Start here', href: '/start/' } },
18
+ { title: 'Adopt an existing repository', body: 'Inspect current choices and preview changes before writing.', command: 'repo doctor', link: { label: 'Plan adoption', href: '/tasks/adopt-existing' } },
19
+ { title: 'Create a package or app', body: 'Use a known template so names, scripts, and boundaries stay consistent.', command: 'repo new', link: { label: 'Create a project', href: '/tasks/create-project' } },
20
+ { title: 'Run a repository check', body: 'Plan lint, types, builds, and tests before a commit or CI run.', command: 'repo check', link: { label: 'Run checks', href: '/tasks/checks' } },
53
21
  ],
54
22
  },
55
- commands: {
56
- title: 'A command map you can remember',
57
- description: 'Daily commands stay short. Explicit modes are available when scripts need stable output.',
58
- items: [
59
- { command: 'repo init', purpose: 'Set up conventions' },
60
- { command: 'repo doctor', purpose: 'Diagnose repository health' },
61
- { command: 'repo templates', purpose: 'Inspect available templates' },
62
- { command: 'repo new', purpose: 'Create a workspace project' },
63
- { command: 'repo check', purpose: 'Plan or run verification' },
64
- { command: 'repo env', purpose: 'Report runtime context' },
65
- { command: 'repo upgrade', purpose: 'Reconcile managed assets' },
66
- { command: 'repo release', purpose: 'Version and publish packages' },
23
+ firstRun: {
24
+ title: 'Three commands to a useful baseline',
25
+ description: 'Install repoctl, initialize its managed defaults, then diagnose the workspace.',
26
+ steps: [
27
+ { title: 'Install', command: 'pnpm add -D repoctl', body: 'Keep repoctl with the repository so teammates and CI use the same version.' },
28
+ { title: 'Initialize', command: 'pnpm exec repo init', body: 'Review the file plan before adding managed scripts and configuration.' },
29
+ { title: 'Diagnose', command: 'pnpm exec repo doctor', body: 'Use the first blocker as your next task. Run the diagnosis again after each fix.' },
67
30
  ],
68
31
  },
69
- automation: {
70
- title: 'Readable by people and automation',
71
- description: 'Preview destructive work, write stable artifacts, and redact support output at the command boundary.',
72
- formats: ['Terminal', 'JSON', 'Markdown', 'File output'],
73
- code: 'repo check --full --dry-run --json --out reports/check-plan.json\nrepo env support --markdown --redact --out reports/support.md',
74
- },
75
- quickstart: {
76
- title: 'Get to a useful diagnosis first',
77
- description: 'Install repoctl locally, inspect the repository, then choose the next task from evidence.',
78
- code: 'pnpm add -D repoctl\npnpm exec repo init\npnpm exec repo doctor\npnpm exec repo check --dry-run',
79
- link: { label: 'Read the full setup guide', href: '/repoctl/getting-started' },
32
+ evidence: {
33
+ title: 'See the plan before the repository changes',
34
+ description: 'Preview work, redact local paths, and keep the exact command sequence with the report.',
35
+ code: 'pnpm exec repo new docs --template vitepress --dry-run\npnpm exec repo check --dry-run\npnpm exec repo doctor --markdown --redact',
36
+ link: { label: 'See how diagnosis works', href: '/start/diagnose' },
80
37
  },
81
- docs: {
82
- title: 'Continue with the task in front of you',
83
- description: 'The documentation is organized by repository outcome, with deeper references when you need implementation details.',
38
+ layers: {
39
+ title: 'Continue with the decision in front of you',
40
+ description: 'Move from the current task to the level of detail you need.',
84
41
  items: [
85
- { label: 'Choose by scenario', href: '/repoctl/scenarios', body: 'Map a repository goal to the smallest command sequence.' },
86
- { label: 'Execution model', href: '/repoctl/execution-model', body: 'Understand planning, writes, subprocesses, and output.' },
87
- { label: 'Configuration', href: '/repoctl/config', body: 'Set defaults without hiding command-line overrides.' },
88
- { label: 'Workflows and CI', href: '/repoctl/workflows', body: 'Build local and automated verification paths.' },
89
- { label: 'Troubleshooting', href: '/repoctl/troubleshooting', body: 'Diagnose common setup, template, and release failures.' },
90
- { label: 'AI documentation', href: '/ai/', body: 'Give coding tools concise or full Markdown context.' },
42
+ { title: 'Daily tasks', body: 'Adoption, project creation, checks, CI, reports, releases, and troubleshooting.', link: { label: 'Open tasks', href: '/tasks/' } },
43
+ { title: 'Understand the system', body: 'Monorepo boundaries, modern npm packages, templates, and the tools underneath.', link: { label: 'Open Learn', href: '/learn/' } },
44
+ { title: 'Look up exact behavior', body: 'Commands, configuration, output formats, aliases, and execution details.', link: { label: 'Open Reference', href: '/reference/' } },
91
45
  ],
92
46
  },
93
47
  } satisfies HomeContent
94
48
 
95
49
  const chinese = {
96
50
  hero: {
97
- label: '面向任务的 monorepo 操作入口',
98
- title: '运行 monorepo 工作。',
99
- description: '用一套 CLI 完成 pnpm monorepo 的初始化、诊断、创建、校验与发布。',
100
- primary: { label: '快速开始', href: '/zh/repoctl/getting-started' },
101
- secondary: { label: '查看命令', href: '/zh/repoctl/commands' },
102
- imageAlt: 'repoctl 对当前仓库生成的真实 doctor 报告',
103
- },
104
- proof: ['原生支持 pnpm', '理解 Turborepo', '优先 dry-run', 'JSON 与 Markdown 报告', '适用于 CI'],
105
- lifecycle: {
106
- title: '稳定的任务生命周期',
107
- description: '每条命令回答一个仓库问题,并留下可以复查和保存的结果。',
108
- steps: [
109
- { title: '初始化', body: '安装受管根目录资产和标准 repo 脚本。', command: 'repo init' },
110
- { title: '诊断', body: '检查 workspace 结构、工具版本、hooks 与发布配置。', command: 'repo doctor' },
111
- { title: '创建', body: '选择已知模板,在写入前预览完整文件计划。', command: 'repo new' },
112
- { title: '校验', body: '用一份可复现计划串联 lint、typecheck、build、test 与 tsd。', command: 'repo check' },
113
- { title: '发布', body: '记录变更意图、更新固定版本组、发布并执行收尾 hook。', command: 'repo release' },
114
- ],
115
- },
116
- paths: {
117
- title: '从仓库当前状态开始',
118
- description: 'repoctl 同时支持新建项目和渐进接入,不强迫两类仓库走同一条迁移路线。',
119
- items: [
120
- {
121
- title: '创建新 workspace',
122
- body: '先生成受管约定,再按需创建具体的包和应用。',
123
- commands: ['pnpm create repoctl', 'pnpm run repo:new'],
124
- href: '/zh/repoctl/getting-started',
125
- linkLabel: '创建仓库',
126
- },
127
- {
128
- title: '接入已有 workspace',
129
- body: '保存脱敏基线,预览资产差异,再用可审查的小步骤逐项接入。',
130
- commands: ['repo doctor --markdown --redact', 'repo upgrade --no-overwrite'],
131
- href: '/zh/repoctl/adopt-existing',
132
- linkLabel: '制定接入计划',
133
- },
134
- ],
135
- },
136
- capabilities: {
137
- title: '边界清楚的仓库任务',
138
- description: '模板、受管资产、校验与报告相互独立,让自动化保持透明。',
51
+ label: 'repoctl 文档',
52
+ title: '仓库下一步,该做什么?',
53
+ description: '用一个任务型 CLI 初始化、诊断、创建、校验与发布 pnpm 和 Turborepo 工作区。',
54
+ primaryAction: { label: '开始使用', href: '/zh/start/' },
55
+ secondaryAction: { label: '查看命令', href: '/zh/reference/commands' },
56
+ imageAlt: '真实的 repoctl doctor 报告,展示仓库检查结果与发现项',
57
+ },
58
+ tasks: {
59
+ title: '选择一项任务',
60
+ description: '选择你要得到的结果,每条路径都从最小的安全命令开始。',
139
61
  items: [
140
- { title: '受管资产', body: '覆盖本地决策前,先比较标准根目录文件。' },
141
- { title: '模板目录', body: '按名称创建类库、CLI、服务、客户端与文档站。' },
142
- { title: '校验计划', body: '执行前通过 dry-run、JSON 或 Markdown 查看完整任务图。' },
143
- { title: '环境报告', body: '隐藏仓库路径和 token 后再共享排障上下文。' },
62
+ { title: '新建仓库', body: '先建立共享约定,再开始添加项目。', command: 'repo init', link: { label: '从这里开始', href: '/zh/start/' } },
63
+ { title: '接入已有仓库', body: '先检查当前决策,预览变化后再写入。', command: 'repo doctor', link: { label: '制定接入计划', href: '/zh/tasks/adopt-existing' } },
64
+ { title: '创建包或应用', body: '使用已知模板,让名称、脚本和边界保持一致。', command: 'repo new', link: { label: '创建项目', href: '/zh/tasks/create-project' } },
65
+ { title: '运行仓库校验', body: '提交或运行 CI 前,先规划 lint、类型、构建和测试。', command: 'repo check', link: { label: '运行校验', href: '/zh/tasks/checks' } },
144
66
  ],
145
67
  },
146
- commands: {
147
- title: '记得住的命令地图',
148
- description: '日常入口保持简短,脚本需要稳定输出时再使用显式模式。',
149
- items: [
150
- { command: 'repo init', purpose: '建立仓库约定' },
151
- { command: 'repo doctor', purpose: '诊断仓库健康状态' },
152
- { command: 'repo templates', purpose: '查看可用模板' },
153
- { command: 'repo new', purpose: '创建 workspace 项目' },
154
- { command: 'repo check', purpose: '规划或执行校验' },
155
- { command: 'repo env', purpose: '输出运行环境' },
156
- { command: 'repo upgrade', purpose: '同步受管资产' },
157
- { command: 'repo release', purpose: '更新版本并发布' },
68
+ firstRun: {
69
+ title: '三条命令,建立可用基线',
70
+ description: '安装 repoctl,初始化受管默认值,再诊断当前工作区。',
71
+ steps: [
72
+ { title: '安装', command: 'pnpm add -D repoctl', body: '把 repoctl 保存在仓库中,让成员和 CI 使用相同版本。' },
73
+ { title: '初始化', command: 'pnpm exec repo init', body: '写入受管脚本和配置前,先检查文件计划。' },
74
+ { title: '诊断', command: 'pnpm exec repo doctor', body: '把第一个阻塞项作为下一项任务,修复后再次运行诊断。' },
158
75
  ],
159
76
  },
160
- automation: {
161
- title: '同时服务人和自动化',
162
- description: '在命令边界预览写入、保存稳定产物,并对支持信息执行脱敏。',
163
- formats: ['终端', 'JSON', 'Markdown', '文件输出'],
164
- code: 'repo check --full --dry-run --json --out reports/check-plan.json\nrepo env support --markdown --redact --out reports/support.md',
165
- },
166
- quickstart: {
167
- title: '先得到一份有效诊断',
168
- description: '本地安装 repoctl,检查仓库,再根据证据选择下一项任务。',
169
- code: 'pnpm add -D repoctl\npnpm exec repo init\npnpm exec repo doctor\npnpm exec repo check --dry-run',
170
- link: { label: '阅读完整安装指南', href: '/zh/repoctl/getting-started' },
77
+ evidence: {
78
+ title: '仓库变化前,先看清执行计划',
79
+ description: '预览操作、脱敏本地路径,并让报告保留准确的命令顺序。',
80
+ code: 'pnpm exec repo new docs --template vitepress --dry-run\npnpm exec repo check --dry-run\npnpm exec repo doctor --markdown --redact',
81
+ link: { label: '了解诊断流程', href: '/zh/start/diagnose' },
171
82
  },
172
- docs: {
173
- title: '继续处理眼前的任务',
174
- description: '文档按仓库目标组织,需要实现细节时再进入对应参考页。',
83
+ layers: {
84
+ title: '沿着当前决策继续深入',
85
+ description: '从手头任务出发,只进入你现在需要的细节层级。',
175
86
  items: [
176
- { label: '按场景选命令', href: '/zh/repoctl/scenarios', body: '把仓库目标映射为最短命令链路。' },
177
- { label: '执行模型', href: '/zh/repoctl/execution-model', body: '理解计划、写入、子进程和输出。' },
178
- { label: '配置文件', href: '/zh/repoctl/config', body: '设置默认值,同时保留命令行覆盖。' },
179
- { label: '工作流与 CI', href: '/zh/repoctl/workflows', body: '建立本地和自动化校验路径。' },
180
- { label: '排障', href: '/zh/repoctl/troubleshooting', body: '诊断常见的安装、模板与发布问题。' },
181
- { label: 'AI 文档', href: '/zh/ai/', body: '为编程工具提供精简或完整 Markdown 上下文。' },
87
+ { title: '日常任务', body: '接入、创建项目、校验、CI、报告、发布和排障。', link: { label: '打开任务', href: '/zh/tasks/' } },
88
+ { title: '理解系统', body: 'Monorepo 边界、现代 npm 包、模板和底层工具。', link: { label: '打开理解', href: '/zh/learn/' } },
89
+ { title: '查找准确行为', body: '命令、配置、输出格式、别名和执行细节。', link: { label: '打开参考', href: '/zh/reference/' } },
182
90
  ],
183
91
  },
184
92
  } satisfies HomeContent
@@ -3,63 +3,47 @@ export interface HomeLink {
3
3
  href: string
4
4
  }
5
5
 
6
- export interface HomeStep {
7
- title: string
8
- body: string
9
- command: string
10
- }
11
-
12
6
  export interface HomeContent {
13
7
  hero: {
14
8
  label: string
15
9
  title: string
16
10
  description: string
17
- primary: HomeLink
18
- secondary: HomeLink
11
+ primaryAction: HomeLink
12
+ secondaryAction: HomeLink
19
13
  imageAlt: string
20
14
  }
21
- proof: string[]
22
- lifecycle: {
23
- title: string
24
- description: string
25
- steps: HomeStep[]
26
- }
27
- paths: {
15
+ tasks: {
28
16
  title: string
29
17
  description: string
30
18
  items: Array<{
31
19
  title: string
32
20
  body: string
33
- commands: string[]
34
- href: string
35
- linkLabel: string
21
+ command: string
22
+ link: HomeLink
36
23
  }>
37
24
  }
38
- capabilities: {
25
+ firstRun: {
39
26
  title: string
40
27
  description: string
41
- items: Array<{ title: string, body: string }>
42
- }
43
- commands: {
44
- title: string
45
- description: string
46
- items: Array<{ command: string, purpose: string }>
47
- }
48
- automation: {
49
- title: string
50
- description: string
51
- formats: string[]
52
- code: string
28
+ steps: Array<{
29
+ title: string
30
+ command: string
31
+ body: string
32
+ }>
53
33
  }
54
- quickstart: {
34
+ evidence: {
55
35
  title: string
56
36
  description: string
57
37
  code: string
58
38
  link: HomeLink
59
39
  }
60
- docs: {
40
+ layers: {
61
41
  title: string
62
42
  description: string
63
- items: Array<HomeLink & { body: string }>
43
+ items: Array<{
44
+ title: string
45
+ body: string
46
+ link: HomeLink
47
+ }>
64
48
  }
65
49
  }
@@ -7,132 +7,140 @@ interface LocalizedText {
7
7
  zh: string
8
8
  }
9
9
 
10
- interface RouteItem {
10
+ export interface RouteItem {
11
11
  slug: string
12
12
  label: LocalizedText
13
13
  }
14
14
 
15
- interface RouteSection {
16
- id: 'repoctl' | 'monorepo' | 'why' | 'ai' | 'tools'
15
+ export interface RouteSection {
16
+ id: 'start' | 'tasks' | 'reference' | 'learn' | 'ai'
17
17
  label: LocalizedText
18
- items: RouteItem[]
18
+ items: readonly RouteItem[]
19
19
  }
20
20
 
21
21
  const item = (slug: string, en: string, zh: string): RouteItem => ({ slug, label: { en, zh } })
22
22
 
23
23
  export const routeSections = [
24
24
  {
25
- id: 'repoctl',
26
- label: { en: 'repoctl', zh: 'repoctl' },
25
+ id: 'start',
26
+ label: { en: 'Start', zh: '开始' },
27
27
  items: [
28
- item('', 'Overview', '概览'),
29
- item('getting-started', 'Getting Started', '快速开始'),
30
- item('adopt-existing', 'Adopt Existing Repos', '接入已有仓库'),
31
- item('scenarios', 'Choose By Scenario', '按场景选命令'),
32
- item('execution-model', 'Execution Model', '执行模型'),
33
- item('commands', 'Command Reference', '命令速查'),
34
- item('checks', 'Verification', '校验链路'),
35
- item('doctor', 'Doctor', 'Doctor 诊断'),
36
- item('config', 'Configuration', '配置文件'),
37
- item('templates', 'Templates', '模板与创建'),
38
- item('template-assets', 'Template Assets', '模板资产治理'),
39
- item('workflows', 'Workflows and CI', '工作流与 CI'),
40
- item('reports', 'Reports', '报告与自动化输出'),
41
- item('troubleshooting', 'Troubleshooting', '排障'),
42
- item('aliases', 'Command Aliases', '命令别名'),
28
+ item('', 'Start here', '从这里开始'),
29
+ item('install', 'Install and initialize', '安装并初始化'),
30
+ item('first-run', 'Your first run', '第一次运行'),
31
+ item('diagnose', 'Run a diagnosis', '运行诊断'),
32
+ item('choose-next', 'Choose the next task', '选择下一项任务'),
43
33
  ],
44
34
  },
45
35
  {
46
- id: 'monorepo',
47
- label: { en: 'Knowledge Base', zh: '知识库' },
36
+ id: 'tasks',
37
+ label: { en: 'Tasks', zh: '任务' },
48
38
  items: [
49
- item('', 'Why Monorepo', '为什么使用 Monorepo'),
50
- item('manage', 'Managing A Monorepo', '管理 Monorepo'),
51
- item('publish', 'Publishing and Changelogs', '发包与变更日志'),
52
- item('commands', 'Monorepo Commands', 'Monorepo 命令'),
53
- item('templates', 'Template Systems', '模板体系'),
54
- item('troubleshooting', 'Troubleshooting', '常见问题排障'),
39
+ item('', 'Task index', '任务索引'),
40
+ item('adopt-existing', 'Adopt an existing workspace', '接入已有 workspace'),
41
+ item('create-project', 'Create a package or app', '创建包或应用'),
42
+ item('checks', 'Run checks', '运行校验'),
43
+ item('reports', 'Reports and output', '报告与输出'),
44
+ item('ci', 'Add checks to CI', '把校验加入 CI'),
45
+ item('release', 'Release packages', '发布包'),
46
+ item('troubleshooting', 'Troubleshoot', '排障'),
55
47
  ],
56
48
  },
57
49
  {
58
- id: 'why',
59
- label: { en: 'Modern Packages', zh: '现代 npm 包' },
50
+ id: 'reference',
51
+ label: { en: 'Reference', zh: '参考' },
60
52
  items: [
61
- item('how-to-reuse-js-code', 'Reusing JavaScript', '复用 JavaScript'),
62
- item('js-cjs-mjs', 'Module Extensions', '模块文件后缀'),
63
- item('js-keywords', 'Runtime Globals', '运行时关键字'),
64
- item('what-is-npm-package', 'What Is An npm Package?', '什么是 npm 包'),
65
- item('publish-basic-npm-package', 'Publishing A Package', '发布 npm 包'),
66
- item('', 'Package Evolution', '包的演进'),
67
- item('modern/', 'Modern Package Guide', '现代包指南'),
68
- item('modern/esm-vs-cjs', 'ESM vs CommonJS', 'ESM 与 CommonJS'),
69
- item('modern/dts', 'Type Declarations', '类型声明'),
70
- item('modern/package-entry-points', 'Package Entry Points', '包入口'),
71
- item('modern/bundlers', 'Bundlers', '构建工具'),
72
- item('modern/typescript', 'TypeScript', 'TypeScript'),
53
+ item('', 'Reference overview', '参考总览'),
54
+ item('commands', 'Command reference', '命令参考'),
55
+ item('config', 'Configuration', '配置文件'),
56
+ item('execution-model', 'Execution model', '执行模型'),
57
+ item('output', 'Output formats', '输出格式'),
58
+ item('aliases', 'Command aliases', '命令别名'),
59
+ item('templates', 'Templates', '模板'),
60
+ item('template-assets', 'Managed template assets', '受管模板资产'),
73
61
  ],
74
62
  },
75
63
  {
76
- id: 'ai',
77
- label: { en: 'AI', zh: 'AI' },
78
- items: [item('', 'AI Documentation', 'AI 文档'), item('llms-txt', 'llms.txt', 'llms.txt')],
64
+ id: 'learn',
65
+ label: { en: 'Learn', zh: '理解' },
66
+ items: [
67
+ item('', 'Learn overview', '理解总览'),
68
+ item('repoctl-model', 'How repoctl fits in', 'repoctl 如何融入仓库'),
69
+ item('monorepo/', 'Monorepo foundations', 'Monorepo 基础'),
70
+ item('monorepo/manage', 'Manage a monorepo', '管理 Monorepo'),
71
+ item('monorepo/publish', 'Publishing and changelogs', '发包与变更日志'),
72
+ item('monorepo/commands', 'Monorepo commands', 'Monorepo 命令'),
73
+ item('monorepo/templates', 'Template systems', '模板体系'),
74
+ item('monorepo/troubleshooting', 'Monorepo troubleshooting', 'Monorepo 排障'),
75
+ item('packages/', 'Modern npm packages', '现代 npm 包'),
76
+ item('packages/modern-overview', 'Modern package guide', '现代包指南'),
77
+ item('packages/reuse-javascript', 'Reuse JavaScript', '复用 JavaScript'),
78
+ item('packages/module-extensions', 'Module extensions', '模块文件后缀'),
79
+ item('packages/runtime-globals', 'Runtime globals', '运行时关键字'),
80
+ item('packages/publish', 'Publish a package', '发布 npm 包'),
81
+ item('packages/modern/', 'Package details', '现代包细节'),
82
+ item('packages/modern/esm-vs-cjs', 'ESM and CommonJS', 'ESM 与 CommonJS'),
83
+ item('packages/modern/dts', 'Type declarations', '类型声明'),
84
+ item('packages/modern/package-entry-points', 'Package entry points', '包入口'),
85
+ item('packages/modern/bundlers', 'Bundlers', '构建工具'),
86
+ item('packages/modern/typescript', 'TypeScript', 'TypeScript'),
87
+ item('tools/', 'Tool guides', '工具专题'),
88
+ item('tools/pnpm', 'pnpm', 'pnpm'),
89
+ item('tools/turborepo', 'Turborepo', 'Turborepo'),
90
+ item('tools/changeset', 'Versioning', '版本管理'),
91
+ item('tools/husky', 'Husky', 'Husky'),
92
+ item('tools/lint-staged', 'lint-staged', 'lint-staged'),
93
+ item('tools/renovate', 'Renovate', 'Renovate'),
94
+ item('tools/llms-txt', 'llms.txt', 'llms.txt'),
95
+ ],
79
96
  },
80
97
  {
81
- id: 'tools',
82
- label: { en: 'Tool Guides', zh: '工具专题' },
98
+ id: 'ai',
99
+ label: { en: 'AI', zh: 'AI' },
83
100
  items: [
84
- item('', 'Overview', '概览'),
85
- item('pnpm', 'pnpm', 'pnpm'),
86
- item('turborepo', 'Turborepo', 'Turborepo'),
87
- item('changeset', 'pnpm Versioning', 'pnpm Versioning'),
88
- item('husky', 'Husky', 'Husky'),
89
- item('lint-staged', 'lint-staged', 'lint-staged'),
90
- item('renovate', 'Renovate', 'Renovate'),
101
+ item('', 'AI documentation', 'AI 文档'),
91
102
  item('llms-txt', 'llms.txt', 'llms.txt'),
92
103
  ],
93
104
  },
94
105
  ] as const satisfies readonly RouteSection[]
95
106
 
107
+ export type RouteSectionId = (typeof routeSections)[number]['id']
108
+
96
109
  function prefixFor(locale: DocsLocale) {
97
110
  return locale === 'zh' ? '/zh' : ''
98
111
  }
99
112
 
100
- function sectionItems(section: RouteSection, locale: DocsLocale): DefaultTheme.SidebarItem[] {
113
+ export function routePath(section: RouteSectionId, slug: string, locale: DocsLocale) {
101
114
  const prefix = prefixFor(locale)
115
+ return `${prefix}/${section}/${slug}`.replace(/\/+/g, '/')
116
+ }
117
+
118
+ function sectionItems(section: RouteSection, locale: DocsLocale): DefaultTheme.SidebarItem[] {
102
119
  return section.items.map(route => ({
103
120
  text: route.label[locale],
104
- link: `${prefix}/${section.id}/${route.slug}`.replace(/\/+/g, '/'),
121
+ link: routePath(section.id, route.slug, locale),
105
122
  }))
106
123
  }
107
124
 
108
125
  export function createSidebars(locale: DocsLocale): DefaultTheme.SidebarMulti {
109
126
  const prefix = prefixFor(locale)
110
- const groups = Object.fromEntries(routeSections.map(section => [
111
- section.id,
112
- { text: section.label[locale], items: sectionItems(section, locale) },
113
- ])) as Record<RouteSection['id'], DefaultTheme.SidebarItem>
114
- const knowledge = [groups.monorepo, groups.why]
115
-
116
- return {
117
- [`${prefix}/repoctl/`]: [groups.repoctl],
118
- [`${prefix}/knowledge/`]: knowledge,
119
- [`${prefix}/monorepo/`]: knowledge,
120
- [`${prefix}/why/`]: knowledge,
121
- [`${prefix}/ai/`]: [groups.ai],
122
- [`${prefix}/tools/`]: [groups.tools],
123
- [`${prefix || ''}/`]: [groups.repoctl],
124
- }
127
+ return Object.fromEntries(routeSections.map(section => [
128
+ `${prefix}/${section.id}/`,
129
+ [{ text: section.label[locale], items: sectionItems(section, locale) }],
130
+ ]))
125
131
  }
126
132
 
127
133
  export function createNav(locale: DocsLocale): DefaultTheme.NavItem[] {
128
- const zh = locale === 'zh'
129
134
  const prefix = prefixFor(locale)
130
- return [
131
- { text: 'repoctl', link: `${prefix}/repoctl/` },
132
- { text: zh ? '快速开始' : 'Getting Started', link: `${prefix}/repoctl/getting-started` },
133
- { text: zh ? '命令' : 'Commands', link: `${prefix}/repoctl/commands` },
134
- { text: zh ? '知识库' : 'Knowledge Base', link: `${prefix}/knowledge/` },
135
- { text: zh ? 'AI 文档' : 'AI Docs', link: `${prefix}/ai/` },
136
- { text: zh ? '工具专题' : 'Tool Guides', link: `${prefix}/tools/` },
137
- ]
135
+ const text = locale === 'zh'
136
+ ? { start: '开始', tasks: '任务', reference: '参考', learn: '理解', ai: 'AI 文档' }
137
+ : { start: 'Start', tasks: 'Tasks', reference: 'Reference', learn: 'Learn', ai: 'AI Docs' }
138
+ return (Object.keys(text) as RouteSectionId[]).map(section => ({
139
+ text: text[section],
140
+ link: `${prefix}/${section}/`.replace(/\/+/g, '/'),
141
+ }))
142
+ }
143
+
144
+ export function allDocumentRoutes(locale: DocsLocale) {
145
+ return routeSections.flatMap(section => section.items.map(item => routePath(section.id, item.slug, locale)))
138
146
  }