@icebreakers/monorepo-templates 1.2.1 → 1.3.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 (63) hide show
  1. package/assets/.github/workflows/ci.yml +4 -4
  2. package/assets/.github/workflows/release.yml +8 -7
  3. package/assets/package.json +2 -1
  4. package/assets/renovate.json +0 -1
  5. package/assets-data.mjs +0 -1
  6. package/dist/cli.mjs +1 -1
  7. package/dist/index.mjs +1 -1
  8. package/dist/{prepare--cxFop8c.mjs → prepare-D7eJqEqy.mjs} +1 -2
  9. package/package.json +2 -2
  10. package/templates/cli/package.json +1 -1
  11. package/templates/client/package.json +1 -1
  12. package/templates/server/package.json +1 -1
  13. package/templates/tsdown/package.json +1 -1
  14. package/templates/vitepress/.vitepress/config.ts +9 -119
  15. package/templates/vitepress/.vitepress/env.d.ts +1 -0
  16. package/templates/vitepress/.vitepress/home/content.ts +186 -0
  17. package/templates/vitepress/.vitepress/home/types.ts +65 -0
  18. package/templates/vitepress/.vitepress/navigation/routes.ts +138 -0
  19. package/templates/vitepress/.vitepress/seo.ts +40 -0
  20. package/templates/vitepress/.vitepress/theme/components/HomePage.vue +134 -0
  21. package/templates/vitepress/.vitepress/theme/home/foundation.css +180 -0
  22. package/templates/vitepress/.vitepress/theme/home/index.css +3 -0
  23. package/templates/vitepress/.vitepress/theme/home/responsive.css +49 -0
  24. package/templates/vitepress/.vitepress/theme/home/sections.css +153 -0
  25. package/templates/vitepress/.vitepress/theme/index.ts +9 -1
  26. package/templates/vitepress/ai/llms-txt.md +2 -2
  27. package/templates/vitepress/index.md +6 -60
  28. package/templates/vitepress/package.json +11 -4
  29. package/templates/vitepress/public/repoctl-doctor.png +0 -0
  30. package/templates/vitepress/repoctl/workflows.md +35 -0
  31. package/templates/vitepress/scripts/check-locales.ts +162 -0
  32. package/templates/vitepress/thinking.md +15 -0
  33. package/templates/vitepress/tools/changeset.md +17 -12
  34. package/templates/vitepress/tools/husky.md +41 -3
  35. package/templates/vitepress/tools/lint-staged.md +32 -5
  36. package/templates/vitepress/tools/pnpm.md +39 -7
  37. package/templates/vitepress/tools/renovate.md +27 -3
  38. package/templates/vitepress/tools/turborepo.md +33 -7
  39. package/templates/vitepress/tsconfig.json +7 -0
  40. package/templates/vitepress/why/examples/2.npm-basic-package/README.md +1 -1
  41. package/templates/vitepress/why/examples/3.npm-basic-package/README.md +1 -1
  42. package/templates/vitepress/why/how-to-reuse-js-code.md +36 -6
  43. package/templates/vitepress/why/js-cjs-mjs.md +31 -9
  44. package/templates/vitepress/why/js-keywords.md +33 -4
  45. package/templates/vitepress/why/modern/bundlers.md +37 -2
  46. package/templates/vitepress/why/modern/dts.md +44 -3
  47. package/templates/vitepress/why/modern/esm-vs-cjs.md +38 -3
  48. package/templates/vitepress/why/modern/index.md +33 -9
  49. package/templates/vitepress/why/modern/package-entry-points.md +33 -4
  50. package/templates/vitepress/why/modern/typescript.md +40 -4
  51. package/templates/vitepress/why/publish-basic-npm-package.md +37 -13
  52. package/templates/vitepress/why/what-is-npm-package.md +32 -3
  53. package/templates/vitepress/wrangler.jsonc +20 -3
  54. package/templates/vitepress/zh/ai/index.md +1 -1
  55. package/templates/vitepress/zh/ai/llms-txt.md +1 -1
  56. package/templates/vitepress/zh/index.md +6 -63
  57. package/templates/vitepress/zh/repoctl/workflows.md +35 -0
  58. package/templates/vitepress/zh/thinking.md +9 -6
  59. package/templates/vitepress/zh/why/examples/2.npm-basic-package/README.md +1 -1
  60. package/templates/vitepress/zh/why/examples/3.npm-basic-package/README.md +1 -1
  61. package/templates/vitepress/zh/why/index.md +38 -1
  62. package/templates/vue-lib/package.json +1 -1
  63. package/assets/netlify.toml +0 -14
@@ -27,14 +27,14 @@ jobs:
27
27
 
28
28
  steps:
29
29
  - name: Check out code
30
- uses: actions/checkout@v7
30
+ uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
31
31
  with:
32
32
  fetch-depth: 2
33
33
 
34
- - uses: pnpm/action-setup@v6
34
+ - uses: pnpm/action-setup@0977fd99725f1db4007ccb2928dbb4e90d06cc86 # v6.0.10
35
35
 
36
36
  - name: Setup Node.js environment
37
- uses: actions/setup-node@v7
37
+ uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
38
38
  with:
39
39
  node-version: ${{ matrix.node-version }}
40
40
  cache: pnpm
@@ -68,6 +68,6 @@ jobs:
68
68
  run: pnpm test
69
69
 
70
70
  - name: Upload coverage reports to Codecov
71
- uses: codecov/codecov-action@v7
71
+ uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0
72
72
  env:
73
73
  CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
@@ -30,8 +30,6 @@ on:
30
30
  required: false
31
31
  type: string
32
32
 
33
- concurrency: ${{ github.workflow }}-${{ github.ref }}
34
-
35
33
  env:
36
34
  HUSKY: 0
37
35
  NPM_CONFIG_PROVENANCE: true
@@ -42,21 +40,24 @@ permissions:
42
40
  pull-requests: write
43
41
  id-token: write
44
42
 
43
+ concurrency:
44
+ group: ${{ github.workflow }}-${{ github.ref }}
45
+ cancel-in-progress: false
46
+
45
47
  jobs:
46
48
  release:
47
- if: github.event_name == 'push' || github.event_name == 'workflow_dispatch'
48
49
  name: Release
49
50
  runs-on: ubuntu-latest
50
51
  steps:
51
52
  - name: Checkout Repo
52
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
53
+ uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
53
54
  with:
54
55
  fetch-depth: 0
55
56
 
56
- - uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4.1.0
57
+ - uses: pnpm/action-setup@0977fd99725f1db4007ccb2928dbb4e90d06cc86 # v6.0.10
57
58
 
58
59
  - name: Setup Node.js environment
59
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
60
+ uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
60
61
  with:
61
62
  node-version: 24
62
63
  cache: pnpm
@@ -67,7 +68,7 @@ jobs:
67
68
 
68
69
  - name: Run repo release CI
69
70
  env:
70
- GITHUB_TOKEN: ${{ github.token }}
71
+ GITHUB_TOKEN: ${{ secrets.REPOCTL_RELEASE_TOKEN || secrets.CHANGESETS_RELEASE_TOKEN || github.token }}
71
72
  REPO_RELEASE_MODE: ${{ inputs.mode || 'auto' }}
72
73
  REPO_RELEASE_PACKAGE: ${{ inputs.package }}
73
74
  REPO_RELEASE_VERSION: ${{ inputs.version }}
@@ -6,7 +6,7 @@
6
6
  "packageManager": "pnpm@11.22.0",
7
7
  "description": "Source workspace for repoctl, a task-first CLI for pnpm and Turborepo monorepos",
8
8
  "author": "ice breaker <hi@sonofmagic.top>",
9
- "homepage": "https://repo.icebreaker.top",
9
+ "homepage": "https://repoctl.icebreaker.top",
10
10
  "repository": {
11
11
  "type": "git",
12
12
  "url": "git+https://github.com/sonofmagic/repoctl.git"
@@ -29,6 +29,7 @@
29
29
  "tooling:build": "turbo run build --filter=@icebreakers/monorepo --filter=repoctl",
30
30
  "dev": "turbo run dev --parallel",
31
31
  "test": "vitest run",
32
+ "test:packaged-doctor": "node scripts/smoke-packaged-doctor.mjs",
32
33
  "test:dev": "vitest",
33
34
  "lint": "pnpm run tooling:build && turbo run lint",
34
35
  "tsd": "turbo run tsd",
@@ -5,7 +5,6 @@
5
5
  "group:allNonMajor",
6
6
  ":semanticCommitTypeAll(chore)"
7
7
  ],
8
- "commitBody": "[skip netlify]",
9
8
  "rangeStrategy": "bump",
10
9
  "npm": {
11
10
  "commitMessageTopic": "{{prettyDepType}} {{depName}}"
package/assets-data.mjs CHANGED
@@ -36,7 +36,6 @@ const extraAssetTargets = [
36
36
  'SECURITY.md',
37
37
  'CODE_OF_CONDUCT.md',
38
38
  'CONTRIBUTING.md',
39
- 'netlify.toml',
40
39
  ]
41
40
 
42
41
  export const assetTargets = [...coreAssetTargets, ...extraAssetTargets]
package/dist/cli.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { t as prepareAssets } from "./prepare--cxFop8c.mjs";
1
+ import { t as prepareAssets } from "./prepare-D7eJqEqy.mjs";
2
2
  import process from "node:process";
3
3
  //#region src/cli.ts
4
4
  async function main() {
package/dist/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { a as toPublishGitignorePath, c as assetsDir, d as templatesDir, f as assetTargets$1, i as isGitignoreFile, l as packageDir, n as createTemplateCopyFilter, o as toWorkspaceGitignorePath, p as getAssetTargets$1, r as shouldSkipTemplatePath, s as templateChoices$1, t as prepareAssets, u as skeletonDir } from "./prepare--cxFop8c.mjs";
1
+ import { a as toPublishGitignorePath, c as assetsDir, d as templatesDir, f as assetTargets$1, i as isGitignoreFile, l as packageDir, n as createTemplateCopyFilter, o as toWorkspaceGitignorePath, p as getAssetTargets$1, r as shouldSkipTemplatePath, s as templateChoices$1, t as prepareAssets, u as skeletonDir } from "./prepare-D7eJqEqy.mjs";
2
2
  import path from "node:path";
3
3
  import fs, { access, open, rm } from "node:fs/promises";
4
4
  import exec from "nanoexec";
@@ -32,8 +32,7 @@ const extraAssetTargets = [
32
32
  "renovate.json",
33
33
  "SECURITY.md",
34
34
  "CODE_OF_CONDUCT.md",
35
- "CONTRIBUTING.md",
36
- "netlify.toml"
35
+ "CONTRIBUTING.md"
37
36
  ];
38
37
  const assetTargets = [...coreAssetTargets, ...extraAssetTargets];
39
38
  function getAssetTargets(core = false) {
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "@icebreakers/monorepo-templates",
3
3
  "type": "module",
4
- "version": "1.2.1",
4
+ "version": "1.3.0",
5
5
  "description": "Built-in project templates and managed workspace assets for repoctl",
6
6
  "author": "ice breaker <hi@sonofmagic.top>",
7
7
  "license": "MIT",
8
- "homepage": "https://repo.icebreaker.top",
8
+ "homepage": "https://repoctl.icebreaker.top",
9
9
  "repository": {
10
10
  "type": "git",
11
11
  "url": "git+https://github.com/sonofmagic/repoctl.git",
@@ -6,7 +6,7 @@
6
6
  "description": "Internal CLI template shipped with repoctl",
7
7
  "author": "ice breaker <hi@sonofmagic.top>",
8
8
  "license": "MIT",
9
- "homepage": "https://repo.icebreaker.top",
9
+ "homepage": "https://repoctl.icebreaker.top",
10
10
  "repository": {
11
11
  "type": "git",
12
12
  "url": "git+https://github.com/sonofmagic/repoctl.git",
@@ -4,7 +4,7 @@
4
4
  "version": "0.0.1",
5
5
  "private": true,
6
6
  "description": "Internal Vue and Cloudflare application template shipped with repoctl",
7
- "homepage": "https://repo.icebreaker.top",
7
+ "homepage": "https://repoctl.icebreaker.top",
8
8
  "repository": {
9
9
  "type": "git",
10
10
  "url": "git+https://github.com/sonofmagic/repoctl.git",
@@ -6,7 +6,7 @@
6
6
  "description": "Internal server package template shipped with repoctl",
7
7
  "author": "ice breaker <hi@sonofmagic.top>",
8
8
  "license": "MIT",
9
- "homepage": "https://repo.icebreaker.top",
9
+ "homepage": "https://repoctl.icebreaker.top",
10
10
  "repository": {
11
11
  "type": "git",
12
12
  "url": "git+https://github.com/sonofmagic/repoctl.git",
@@ -6,7 +6,7 @@
6
6
  "description": "Internal TypeScript library template shipped with repoctl",
7
7
  "author": "ice breaker <hi@sonofmagic.top>",
8
8
  "license": "MIT",
9
- "homepage": "https://repo.icebreaker.top",
9
+ "homepage": "https://repoctl.icebreaker.top",
10
10
  "repository": {
11
11
  "type": "git",
12
12
  "url": "git+https://github.com/sonofmagic/repoctl.git",
@@ -2,106 +2,8 @@ import Tailwindcss from '@tailwindcss/vite'
2
2
  import { defineConfig } from 'vitepress'
3
3
  import llmstxt from 'vitepress-plugin-llms'
4
4
  import { withMermaid } from 'vitepress-plugin-mermaid'
5
-
6
- interface SidebarLabels {
7
- repoctl: string
8
- repoctlItems: string[]
9
- knowledge: string
10
- knowledgeItems: string[]
11
- packages: string
12
- packageItems: string[]
13
- ai: string
14
- aiItems: string[]
15
- tools: string
16
- toolItems: string[]
17
- }
18
-
19
- const repoctlPaths = [
20
- '',
21
- 'getting-started',
22
- 'adopt-existing',
23
- 'scenarios',
24
- 'execution-model',
25
- 'commands',
26
- 'checks',
27
- 'doctor',
28
- 'config',
29
- 'templates',
30
- 'template-assets',
31
- 'workflows',
32
- 'reports',
33
- 'troubleshooting',
34
- 'aliases',
35
- ]
36
- const knowledgePaths = ['', 'manage', 'publish', 'commands', 'templates', 'troubleshooting']
37
- const packagePaths = [
38
- 'how-to-reuse-js-code',
39
- 'js-cjs-mjs',
40
- 'js-keywords',
41
- 'what-is-npm-package',
42
- 'publish-basic-npm-package',
43
- 'index',
44
- 'modern/',
45
- 'modern/esm-vs-cjs',
46
- 'modern/dts',
47
- 'modern/package-entry-points',
48
- 'modern/bundlers',
49
- 'modern/typescript',
50
- ]
51
- const aiPaths = ['', 'llms-txt']
52
- const toolPaths = ['', 'pnpm', 'turborepo', 'changeset', 'husky', 'lint-staged', 'renovate', 'llms-txt']
53
-
54
- const englishLabels: SidebarLabels = {
55
- repoctl: 'repoctl',
56
- repoctlItems: ['Overview', 'Getting Started', 'Adopt Existing Repos', 'Choose By Scenario', 'Execution Model', 'Command Reference', 'Verification', 'Doctor', 'Configuration', 'Templates', 'Template Assets', 'Workflows and CI', 'Reports', 'Troubleshooting', 'Command Aliases'],
57
- knowledge: 'Knowledge Base',
58
- knowledgeItems: ['Why Monorepo', 'Managing A Monorepo', 'Publishing and Changelogs', 'Monorepo Commands', 'Template Systems', 'Troubleshooting'],
59
- packages: 'Modern Packages',
60
- packageItems: ['Reusing JavaScript', 'Module Extensions', 'Runtime Globals', 'What Is An npm Package?', 'Publishing A Package', 'Package Evolution', 'Modern Package Guide', 'ESM vs CommonJS', 'Type Declarations', 'Package Entry Points', 'Bundlers', 'TypeScript'],
61
- ai: 'AI',
62
- aiItems: ['AI Documentation', 'llms.txt'],
63
- tools: 'Tool Guides',
64
- toolItems: ['Overview', 'pnpm', 'Turborepo', 'pnpm Versioning', 'Husky', 'lint-staged', 'Renovate', 'llms.txt'],
65
- }
66
-
67
- const chineseLabels: SidebarLabels = {
68
- repoctl: 'repoctl',
69
- repoctlItems: ['概览', '快速开始', '接入已有仓库', '按场景选命令', '执行模型', '命令速查', '校验链路', 'Doctor 诊断', '配置文件', '模板与创建', '模板资产治理', '工作流与 CI', '报告与自动化输出', '排障', '命令别名'],
70
- knowledge: '知识库',
71
- knowledgeItems: ['为什么使用 Monorepo', '管理 Monorepo', '发包与变更日志', 'Monorepo 命令', '模板体系', '常见问题排障'],
72
- packages: '现代 npm 包',
73
- packageItems: ['复用 JavaScript', '模块文件后缀', '运行时关键字', '什么是 npm 包', '发布 npm 包', '包的演进', '现代包指南', 'ESM 与 CommonJS', '类型声明', '包入口', '构建工具', 'TypeScript'],
74
- ai: 'AI',
75
- aiItems: ['AI 文档', 'llms.txt'],
76
- tools: '工具专题',
77
- toolItems: ['概览', 'pnpm', 'Turborepo', 'pnpm Versioning', 'Husky', 'lint-staged', 'Renovate', 'llms.txt'],
78
- }
79
-
80
- function prefixed(prefix: string, section: string, paths: string[], labels: string[]) {
81
- return paths.map((path, index) => ({
82
- text: labels[index]!,
83
- link: `${prefix}/${section}/${path}`.replace(/\/+/g, '/'),
84
- }))
85
- }
86
-
87
- function createSidebars(prefix: '' | '/zh', labels: SidebarLabels) {
88
- const repoctl = [{ text: labels.repoctl, items: prefixed(prefix, 'repoctl', repoctlPaths, labels.repoctlItems) }]
89
- const knowledge = [
90
- { text: labels.knowledge, items: prefixed(prefix, 'monorepo', knowledgePaths, labels.knowledgeItems) },
91
- { text: labels.packages, items: prefixed(prefix, 'why', packagePaths, labels.packageItems) },
92
- ]
93
- const ai = [{ text: labels.ai, items: prefixed(prefix, 'ai', aiPaths, labels.aiItems) }]
94
- const tools = [{ text: labels.tools, items: prefixed(prefix, 'tools', toolPaths, labels.toolItems) }]
95
- return {
96
- [`${prefix}/repoctl/`]: repoctl,
97
- [`${prefix}/knowledge/`]: knowledge,
98
- [`${prefix}/monorepo/`]: knowledge,
99
- [`${prefix}/why/`]: knowledge,
100
- [`${prefix}/ai/`]: ai,
101
- [`${prefix}/tools/`]: tools,
102
- [`${prefix || ''}/`]: repoctl,
103
- }
104
- }
5
+ import { createNav, createSidebars } from './navigation/routes'
6
+ import { createPageHead, siteOrigin } from './seo'
105
7
 
106
8
  export default withMermaid(defineConfig({
107
9
  outDir: '.vitepress/dist',
@@ -109,6 +11,8 @@ export default withMermaid(defineConfig({
109
11
  description: 'Task-first CLI for initializing, maintaining, validating, and releasing pnpm and Turborepo monorepos.',
110
12
  lastUpdated: true,
111
13
  cleanUrls: true,
14
+ sitemap: { hostname: siteOrigin },
15
+ transformHead: createPageHead,
112
16
  head: [['link', { rel: 'icon', href: '/logo.jpg' }]],
113
17
  themeConfig: {
114
18
  logo: '/logo.jpg',
@@ -122,16 +26,9 @@ export default withMermaid(defineConfig({
122
26
  title: 'repoctl',
123
27
  description: 'Task-first CLI for practical pnpm and Turborepo monorepos.',
124
28
  themeConfig: {
125
- nav: [
126
- { text: 'repoctl', link: '/repoctl/' },
127
- { text: 'Getting Started', link: '/repoctl/getting-started' },
128
- { text: 'Commands', link: '/repoctl/commands' },
129
- { text: 'Knowledge Base', link: '/knowledge/' },
130
- { text: 'AI Docs', link: '/ai/' },
131
- { text: 'Tool Guides', link: '/tools/' },
132
- ],
29
+ nav: createNav('en'),
133
30
  outline: { label: 'On This Page', level: [2, 3] },
134
- sidebar: createSidebars('', englishLabels),
31
+ sidebar: createSidebars('en'),
135
32
  editLink: {
136
33
  pattern: 'https://github.com/sonofmagic/repoctl/edit/main/templates/vitepress/:path',
137
34
  text: 'Edit this page',
@@ -147,16 +44,9 @@ export default withMermaid(defineConfig({
147
44
  title: 'repoctl',
148
45
  description: '面向 pnpm 与 Turborepo monorepo 的任务型 CLI。',
149
46
  themeConfig: {
150
- nav: [
151
- { text: 'repoctl', link: '/zh/repoctl/' },
152
- { text: '快速开始', link: '/zh/repoctl/getting-started' },
153
- { text: '命令', link: '/zh/repoctl/commands' },
154
- { text: '知识库', link: '/zh/knowledge/' },
155
- { text: 'AI 文档', link: '/zh/ai/' },
156
- { text: '工具专题', link: '/zh/tools/' },
157
- ],
47
+ nav: createNav('zh'),
158
48
  outline: { label: '目录', level: [2, 3] },
159
- sidebar: createSidebars('/zh', chineseLabels),
49
+ sidebar: createSidebars('zh'),
160
50
  editLink: {
161
51
  pattern: 'https://github.com/sonofmagic/repoctl/edit/main/templates/vitepress/:path',
162
52
  text: '为此页提供修改建议',
@@ -173,7 +63,7 @@ export default withMermaid(defineConfig({
173
63
  llmstxt({
174
64
  title: 'repoctl',
175
65
  description: 'Task-first CLI for pnpm and Turborepo monorepos. Simplified Chinese documentation is available under /zh/.',
176
- domain: 'https://repo.icebreaker.top',
66
+ domain: siteOrigin,
177
67
  ignoreFiles: [
178
68
  'zh/**',
179
69
  'en/**',
@@ -0,0 +1 @@
1
+ declare module '*.css'
@@ -0,0 +1,186 @@
1
+ import type { DocsLocale } from '../navigation/routes'
2
+ import type { HomeContent } from './types'
3
+
4
+ const english = {
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.',
48
+ 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.' },
53
+ ],
54
+ },
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' },
67
+ ],
68
+ },
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' },
80
+ },
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.',
84
+ 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.' },
91
+ ],
92
+ },
93
+ } satisfies HomeContent
94
+
95
+ const chinese = {
96
+ 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: '模板、受管资产、校验与报告相互独立,让自动化保持透明。',
139
+ items: [
140
+ { title: '受管资产', body: '覆盖本地决策前,先比较标准根目录文件。' },
141
+ { title: '模板目录', body: '按名称创建类库、CLI、服务、客户端与文档站。' },
142
+ { title: '校验计划', body: '执行前通过 dry-run、JSON 或 Markdown 查看完整任务图。' },
143
+ { title: '环境报告', body: '隐藏仓库路径和 token 后再共享排障上下文。' },
144
+ ],
145
+ },
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: '更新版本并发布' },
158
+ ],
159
+ },
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' },
171
+ },
172
+ docs: {
173
+ title: '继续处理眼前的任务',
174
+ description: '文档按仓库目标组织,需要实现细节时再进入对应参考页。',
175
+ 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 上下文。' },
182
+ ],
183
+ },
184
+ } satisfies HomeContent
185
+
186
+ export const homeContent: Record<DocsLocale, HomeContent> = { en: english, zh: chinese }
@@ -0,0 +1,65 @@
1
+ export interface HomeLink {
2
+ label: string
3
+ href: string
4
+ }
5
+
6
+ export interface HomeStep {
7
+ title: string
8
+ body: string
9
+ command: string
10
+ }
11
+
12
+ export interface HomeContent {
13
+ hero: {
14
+ label: string
15
+ title: string
16
+ description: string
17
+ primary: HomeLink
18
+ secondary: HomeLink
19
+ imageAlt: string
20
+ }
21
+ proof: string[]
22
+ lifecycle: {
23
+ title: string
24
+ description: string
25
+ steps: HomeStep[]
26
+ }
27
+ paths: {
28
+ title: string
29
+ description: string
30
+ items: Array<{
31
+ title: string
32
+ body: string
33
+ commands: string[]
34
+ href: string
35
+ linkLabel: string
36
+ }>
37
+ }
38
+ capabilities: {
39
+ title: string
40
+ 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
53
+ }
54
+ quickstart: {
55
+ title: string
56
+ description: string
57
+ code: string
58
+ link: HomeLink
59
+ }
60
+ docs: {
61
+ title: string
62
+ description: string
63
+ items: Array<HomeLink & { body: string }>
64
+ }
65
+ }