@icebreakers/monorepo-templates 1.0.3 → 1.0.5

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 (51) hide show
  1. package/assets/package.json +6 -16
  2. package/package.json +1 -1
  3. package/templates/cli/package.json +1 -1
  4. package/templates/client/package.json +3 -3
  5. package/templates/client/vite.config.ts +27 -21
  6. package/templates/client/worker-configuration.d.ts +8 -17
  7. package/templates/server/package.json +2 -2
  8. package/templates/server/worker-configuration.d.ts +8 -17
  9. package/templates/vitepress/.vitepress/config.ts +49 -2
  10. package/templates/vitepress/ai/index.md +33 -0
  11. package/templates/vitepress/ai/llms-txt.md +42 -0
  12. package/templates/vitepress/en/index.md +11 -5
  13. package/templates/vitepress/en/knowledge/monorepo.md +1 -1
  14. package/templates/vitepress/en/repoctl/adopt-existing.md +13 -11
  15. package/templates/vitepress/en/repoctl/aliases.md +3 -4
  16. package/templates/vitepress/en/repoctl/commands.md +12 -12
  17. package/templates/vitepress/en/repoctl/config.md +1 -1
  18. package/templates/vitepress/en/repoctl/getting-started.md +19 -19
  19. package/templates/vitepress/en/repoctl/index.md +10 -10
  20. package/templates/vitepress/en/repoctl/scenarios.md +6 -6
  21. package/templates/vitepress/en/repoctl/troubleshooting.md +2 -2
  22. package/templates/vitepress/en/repoctl/workflows.md +12 -12
  23. package/templates/vitepress/getting-started.md +3 -3
  24. package/templates/vitepress/index.md +15 -6
  25. package/templates/vitepress/knowledge/index.md +50 -0
  26. package/templates/vitepress/monorepo/commands.md +5 -5
  27. package/templates/vitepress/monorepo/index.md +14 -14
  28. package/templates/vitepress/monorepo/manage.md +21 -21
  29. package/templates/vitepress/monorepo/troubleshooting.md +1 -1
  30. package/templates/vitepress/package.json +3 -2
  31. package/templates/vitepress/repoctl/adopt-existing.md +22 -22
  32. package/templates/vitepress/repoctl/aliases.md +4 -5
  33. package/templates/vitepress/repoctl/checks.md +86 -0
  34. package/templates/vitepress/repoctl/commands.md +28 -14
  35. package/templates/vitepress/repoctl/config.md +10 -1
  36. package/templates/vitepress/repoctl/doctor.md +86 -0
  37. package/templates/vitepress/repoctl/execution-model.md +81 -0
  38. package/templates/vitepress/repoctl/getting-started.md +16 -16
  39. package/templates/vitepress/repoctl/index.md +40 -12
  40. package/templates/vitepress/repoctl/reports.md +94 -0
  41. package/templates/vitepress/repoctl/scenarios.md +6 -6
  42. package/templates/vitepress/repoctl/template-assets.md +116 -0
  43. package/templates/vitepress/repoctl/templates.md +3 -0
  44. package/templates/vitepress/repoctl/troubleshooting.md +15 -3
  45. package/templates/vitepress/repoctl/workflows.md +26 -13
  46. package/templates/vitepress/tools/index.md +38 -0
  47. package/templates/vitepress/tools/llms-txt.md +9 -0
  48. package/templates/vitepress/why/examples/2.npm-basic-package/README.md +1 -1
  49. package/templates/vitepress/why/examples/3.npm-basic-package/README.md +1 -1
  50. package/templates/vitepress/wrangler.jsonc +5 -0
  51. package/templates/vue-lib/package.json +1 -1
@@ -37,33 +37,23 @@
37
37
  "commit": "commit",
38
38
  "commitlint": "commitlint --edit",
39
39
  "-------": "---------------",
40
- "setup": "repo setup",
41
- "new": "repo new",
42
- "check": "repo check",
43
- "doctor": "repo doctor",
44
- "sync": "repo sync",
45
- "clean:repo": "repo clean",
46
- "mirror": "repo mirror",
40
+ "repo:init": "repo init",
41
+ "repo:new": "repo new",
42
+ "repo:check": "repo check",
43
+ "repo:doctor": "repo doctor",
47
44
  "------simple": "--------------",
48
45
  "pr:alpha": "repo release pre enter alpha",
49
46
  "pr:beta": "repo release pre enter beta",
50
47
  "pr:rc": "repo release pre enter rc",
51
48
  "pr:next": "repo release pre enter next",
52
49
  "pr:exit": "repo release pre exit",
53
- "--------": "----------------",
54
- "script:init": "repo init",
55
- "script:sync": "repo sync",
56
- "script:clean": "repo clean",
57
- "script:mirror": "repo mirror"
50
+ "--------": "----------------"
58
51
  },
59
52
  "devDependencies": {
60
53
  "@changesets/cli": "^2.31.0",
61
54
  "@commitlint/cli": "^20.5.3",
62
55
  "@icebreakers/changelog-github": "^1.0.2",
63
- "@icebreakers/commitlint-config": "^2.0.0",
64
- "@icebreakers/eslint-config": "^4.0.10",
65
56
  "@icebreakers/monorepo": "workspace:*",
66
- "@icebreakers/stylelint-config": "^3.0.6",
67
57
  "@types/node": "^25.6.0",
68
58
  "@types/semver": "^7.7.1",
69
59
  "@vitest/coverage-v8": "~4.1.5",
@@ -81,7 +71,7 @@
81
71
  "stylelint": "^17.11.0",
82
72
  "tailwindcss": "^4.2.4",
83
73
  "tsd": "^0.33.0",
84
- "tsdown": "0.21.10",
74
+ "tsdown": "0.22.0",
85
75
  "tslib": "^2.8.1",
86
76
  "tsx": "^4.21.0",
87
77
  "turbo": "^2.9.9",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@icebreakers/monorepo-templates",
3
3
  "type": "module",
4
- "version": "1.0.3",
4
+ "version": "1.0.5",
5
5
  "description": "Template assets for icebreaker monorepo scaffolding",
6
6
  "author": "ice breaker <hi@sonofmagic.top>",
7
7
  "license": "MIT",
@@ -29,7 +29,7 @@
29
29
  "consola": "^3.4.2"
30
30
  },
31
31
  "devDependencies": {
32
- "tsdown": "0.21.10"
32
+ "tsdown": "0.22.0"
33
33
  },
34
34
  "publishConfig": {
35
35
  "bin": {
@@ -30,7 +30,7 @@
30
30
  "vue-router": "^5.0.6"
31
31
  },
32
32
  "devDependencies": {
33
- "@cloudflare/vite-plugin": "^1.36.0",
33
+ "@cloudflare/vite-plugin": "^1.36.2",
34
34
  "@hono/node-server": "^2.0.1",
35
35
  "@hono/trpc-server": "^0.4.2",
36
36
  "@tailwindcss/vite": "^4.2.4",
@@ -42,11 +42,11 @@
42
42
  "hono": "^4.12.18",
43
43
  "tailwindcss": "^4.2.4",
44
44
  "typescript": "~6.0.3",
45
- "vite": "^8.0.10",
45
+ "vite": "^8.0.11",
46
46
  "vite-plugin-vue-devtools": "^8.1.1",
47
47
  "vite-tsconfig-paths": "^6.1.1",
48
48
  "vue-tsc": "3.2.8",
49
- "wrangler": "^4.88.0",
49
+ "wrangler": "^4.89.1",
50
50
  "zod": "^4.4.3"
51
51
  }
52
52
  }
@@ -1,3 +1,4 @@
1
+ import type { PluginOption, UserConfig } from 'vite'
1
2
  import path from 'node:path'
2
3
  import { cloudflare } from '@cloudflare/vite-plugin'
3
4
  import Tailwindcss from '@tailwindcss/vite'
@@ -8,27 +9,32 @@ import VueDevTools from 'vite-plugin-vue-devtools'
8
9
  import VueRouter from 'vue-router/vite'
9
10
 
10
11
  // https://vite.dev/config/
11
- export default defineConfig(({ command }) => ({
12
- build: {
13
- target: 'baseline-widely-available',
14
- },
15
- resolve: {
16
- alias: {
17
- '@': path.resolve(import.meta.dirname, 'src'),
18
- '~': import.meta.dirname,
19
- },
20
- },
21
- plugins: [
22
- VueRouter(
23
- {
24
- dts: path.resolve(import.meta.dirname, 'src/route-map.d.ts'),
25
- watch: command === 'serve',
26
- },
27
- ),
12
+ export default defineConfig(({ command }): UserConfig => {
13
+ const plugins: PluginOption[] = [
14
+ VueRouter({
15
+ dts: path.resolve(import.meta.dirname, 'src/route-map.d.ts'),
16
+ watch: command === 'serve',
17
+ }) as PluginOption,
28
18
  Vue(),
29
19
  VueJsx(),
30
20
  Tailwindcss(),
31
- cloudflare(),
32
- command === 'serve' ? VueDevTools() : null,
33
- ],
34
- }))
21
+ cloudflare() as unknown as PluginOption,
22
+ ]
23
+
24
+ if (command === 'serve') {
25
+ plugins.push(VueDevTools() as unknown as PluginOption)
26
+ }
27
+
28
+ return {
29
+ build: {
30
+ target: 'baseline-widely-available',
31
+ },
32
+ resolve: {
33
+ alias: {
34
+ '@': path.resolve(import.meta.dirname, 'src'),
35
+ '~': import.meta.dirname,
36
+ },
37
+ },
38
+ plugins,
39
+ }
40
+ })
@@ -1,6 +1,6 @@
1
1
  /* eslint-disable */
2
2
  // Generated by Wrangler by running `wrangler types` (hash: fa12f52f057b37f671438ff56acffa6e)
3
- // Runtime types generated with workerd@1.20260504.1 2025-10-16 nodejs_compat
3
+ // Runtime types generated with workerd@1.20260507.1 2025-10-16 nodejs_compat
4
4
  declare namespace Cloudflare {
5
5
  interface GlobalProps {
6
6
  mainModule: typeof import("./worker/fetch-entry");
@@ -913,7 +913,7 @@ interface CustomEventCustomEventInit {
913
913
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob)
914
914
  */
915
915
  declare class Blob {
916
- constructor(type?: ((ArrayBuffer | ArrayBufferView) | string | Blob)[], options?: BlobOptions);
916
+ constructor(bits?: ((ArrayBuffer | ArrayBufferView) | string | Blob)[], options?: BlobOptions);
917
917
  /**
918
918
  * The **`size`** read-only property of the Blob interface returns the size of the Blob or File in bytes.
919
919
  *
@@ -12073,13 +12073,13 @@ declare namespace Cloudflare {
12073
12073
  type GlobalProp<K extends string, Default> = K extends keyof GlobalProps ? GlobalProps[K] : Default;
12074
12074
  // The type of the program's main module exports, if known. Requires `GlobalProps` to declare the
12075
12075
  // `mainModule` property.
12076
- type MainModule = GlobalProp<'mainModule', {}>;
12076
+ type MainModule = GlobalProp<"mainModule", {}>;
12077
12077
  // The type of ctx.exports, which contains loopback bindings for all top-level exports.
12078
12078
  type Exports = {
12079
- [K in keyof MainModule]: LoopbackForExport<MainModule[K]> &
12079
+ [K in keyof MainModule]: LoopbackForExport<MainModule[K]>
12080
12080
  // If the export is listed in `durableNamespaces`, then it is also a
12081
12081
  // DurableObjectNamespace.
12082
- (K extends GlobalProp<'durableNamespaces', never> ? MainModule[K] extends new (...args: any[]) => infer DoInstance ? DoInstance extends Rpc.DurableObjectBranded ? DurableObjectNamespace<DoInstance> : DurableObjectNamespace<undefined> : DurableObjectNamespace<undefined> : {});
12082
+ & (K extends GlobalProp<"durableNamespaces", never> ? MainModule[K] extends new (...args: any[]) => infer DoInstance ? DoInstance extends Rpc.DurableObjectBranded ? DurableObjectNamespace<DoInstance> : DurableObjectNamespace<undefined> : DurableObjectNamespace<undefined> : {});
12083
12083
  };
12084
12084
  }
12085
12085
  declare namespace CloudflareWorkersModule {
@@ -12150,24 +12150,15 @@ declare namespace CloudflareWorkersModule {
12150
12150
  attempt: number;
12151
12151
  config: WorkflowStepConfig;
12152
12152
  };
12153
- export interface RollbackContext<T> {
12154
- error: Error;
12155
- output: NonNullable<T> | undefined;
12156
- stepName: string;
12157
- }
12158
- export interface StepPromise<T> extends Promise<T> {
12159
- rollback(fn: (ctx: RollbackContext<T>) => Promise<void>): StepPromise<T>;
12160
- rollback(config: WorkflowStepConfig, fn: (ctx: RollbackContext<T>) => Promise<void>): StepPromise<T>;
12161
- }
12162
12153
  export abstract class WorkflowStep {
12163
- do<T extends Rpc.Serializable<T>>(name: string, callback: (ctx: WorkflowStepContext) => Promise<T>): StepPromise<T>;
12164
- do<T extends Rpc.Serializable<T>>(name: string, config: WorkflowStepConfig, callback: (ctx: WorkflowStepContext) => Promise<T>): StepPromise<T>;
12154
+ do<T extends Rpc.Serializable<T>>(name: string, callback: (ctx: WorkflowStepContext) => Promise<T>): Promise<T>;
12155
+ do<T extends Rpc.Serializable<T>>(name: string, config: WorkflowStepConfig, callback: (ctx: WorkflowStepContext) => Promise<T>): Promise<T>;
12165
12156
  sleep: (name: string, duration: WorkflowSleepDuration) => Promise<void>;
12166
12157
  sleepUntil: (name: string, timestamp: Date | number) => Promise<void>;
12167
12158
  waitForEvent<T extends Rpc.Serializable<T>>(name: string, options: {
12168
12159
  type: string;
12169
12160
  timeout?: WorkflowTimeoutDuration | number;
12170
- }): StepPromise<WorkflowStepEvent<T>>;
12161
+ }): Promise<WorkflowStepEvent<T>>;
12171
12162
  }
12172
12163
  export type WorkflowInstanceStatus = 'queued' | 'running' | 'paused' | 'errored' | 'terminated' | 'complete' | 'waiting' | 'waitingForPause' | 'unknown';
12173
12164
  export abstract class WorkflowEntrypoint<Env = unknown, T extends Rpc.Serializable<T> | unknown = unknown> implements Rpc.WorkflowEntrypointBranded {
@@ -57,8 +57,8 @@
57
57
  "@hono/node-server": "^2.0.1",
58
58
  "consola": "^3.4.2",
59
59
  "hono": "^4.12.18",
60
- "tsdown": "0.21.10",
61
- "wrangler": "^4.88.0",
60
+ "tsdown": "0.22.0",
61
+ "wrangler": "^4.89.1",
62
62
  "zod": "^4.4.3"
63
63
  }
64
64
  }
@@ -1,6 +1,6 @@
1
1
  /* eslint-disable */
2
2
  // Generated by Wrangler by running `wrangler types` (hash: fd577b1f4edd34e8f40cee5b4eab2eb5)
3
- // Runtime types generated with workerd@1.20260504.1 2025-10-16 nodejs_compat
3
+ // Runtime types generated with workerd@1.20260507.1 2025-10-16 nodejs_compat
4
4
  declare namespace Cloudflare {
5
5
  interface GlobalProps {
6
6
  mainModule: typeof import("./src/fetch-entry");
@@ -913,7 +913,7 @@ interface CustomEventCustomEventInit {
913
913
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob)
914
914
  */
915
915
  declare class Blob {
916
- constructor(type?: ((ArrayBuffer | ArrayBufferView) | string | Blob)[], options?: BlobOptions);
916
+ constructor(bits?: ((ArrayBuffer | ArrayBufferView) | string | Blob)[], options?: BlobOptions);
917
917
  /**
918
918
  * The **`size`** read-only property of the Blob interface returns the size of the Blob or File in bytes.
919
919
  *
@@ -12073,13 +12073,13 @@ declare namespace Cloudflare {
12073
12073
  type GlobalProp<K extends string, Default> = K extends keyof GlobalProps ? GlobalProps[K] : Default;
12074
12074
  // The type of the program's main module exports, if known. Requires `GlobalProps` to declare the
12075
12075
  // `mainModule` property.
12076
- type MainModule = GlobalProp<'mainModule', {}>;
12076
+ type MainModule = GlobalProp<"mainModule", {}>;
12077
12077
  // The type of ctx.exports, which contains loopback bindings for all top-level exports.
12078
12078
  type Exports = {
12079
- [K in keyof MainModule]: LoopbackForExport<MainModule[K]> &
12079
+ [K in keyof MainModule]: LoopbackForExport<MainModule[K]>
12080
12080
  // If the export is listed in `durableNamespaces`, then it is also a
12081
12081
  // DurableObjectNamespace.
12082
- (K extends GlobalProp<'durableNamespaces', never> ? MainModule[K] extends new (...args: any[]) => infer DoInstance ? DoInstance extends Rpc.DurableObjectBranded ? DurableObjectNamespace<DoInstance> : DurableObjectNamespace<undefined> : DurableObjectNamespace<undefined> : {});
12082
+ & (K extends GlobalProp<"durableNamespaces", never> ? MainModule[K] extends new (...args: any[]) => infer DoInstance ? DoInstance extends Rpc.DurableObjectBranded ? DurableObjectNamespace<DoInstance> : DurableObjectNamespace<undefined> : DurableObjectNamespace<undefined> : {});
12083
12083
  };
12084
12084
  }
12085
12085
  declare namespace CloudflareWorkersModule {
@@ -12150,24 +12150,15 @@ declare namespace CloudflareWorkersModule {
12150
12150
  attempt: number;
12151
12151
  config: WorkflowStepConfig;
12152
12152
  };
12153
- export interface RollbackContext<T> {
12154
- error: Error;
12155
- output: NonNullable<T> | undefined;
12156
- stepName: string;
12157
- }
12158
- export interface StepPromise<T> extends Promise<T> {
12159
- rollback(fn: (ctx: RollbackContext<T>) => Promise<void>): StepPromise<T>;
12160
- rollback(config: WorkflowStepConfig, fn: (ctx: RollbackContext<T>) => Promise<void>): StepPromise<T>;
12161
- }
12162
12153
  export abstract class WorkflowStep {
12163
- do<T extends Rpc.Serializable<T>>(name: string, callback: (ctx: WorkflowStepContext) => Promise<T>): StepPromise<T>;
12164
- do<T extends Rpc.Serializable<T>>(name: string, config: WorkflowStepConfig, callback: (ctx: WorkflowStepContext) => Promise<T>): StepPromise<T>;
12154
+ do<T extends Rpc.Serializable<T>>(name: string, callback: (ctx: WorkflowStepContext) => Promise<T>): Promise<T>;
12155
+ do<T extends Rpc.Serializable<T>>(name: string, config: WorkflowStepConfig, callback: (ctx: WorkflowStepContext) => Promise<T>): Promise<T>;
12165
12156
  sleep: (name: string, duration: WorkflowSleepDuration) => Promise<void>;
12166
12157
  sleepUntil: (name: string, timestamp: Date | number) => Promise<void>;
12167
12158
  waitForEvent<T extends Rpc.Serializable<T>>(name: string, options: {
12168
12159
  type: string;
12169
12160
  timeout?: WorkflowTimeoutDuration | number;
12170
- }): StepPromise<WorkflowStepEvent<T>>;
12161
+ }): Promise<WorkflowStepEvent<T>>;
12171
12162
  }
12172
12163
  export type WorkflowInstanceStatus = 'queued' | 'running' | 'paused' | 'errored' | 'terminated' | 'complete' | 'waiting' | 'waitingForPause' | 'unknown';
12173
12164
  export abstract class WorkflowEntrypoint<Env = unknown, T extends Rpc.Serializable<T> | unknown = unknown> implements Rpc.WorkflowEntrypointBranded {
@@ -1,5 +1,6 @@
1
1
  import Tailwindcss from '@tailwindcss/vite'
2
2
  import { defineConfig } from 'vitepress'
3
+ import llmstxt from 'vitepress-plugin-llms'
3
4
  import { withMermaid } from 'vitepress-plugin-mermaid'
4
5
 
5
6
  const repoctlSidebar = [
@@ -10,31 +11,68 @@ const repoctlSidebar = [
10
11
  { text: '快速开始', link: '/repoctl/getting-started' },
11
12
  { text: '接入已有仓库', link: '/repoctl/adopt-existing' },
12
13
  { text: '按场景选命令', link: '/repoctl/scenarios' },
14
+ { text: '执行模型', link: '/repoctl/execution-model' },
13
15
  { text: '命令速查', link: '/repoctl/commands' },
16
+ { text: '校验链路', link: '/repoctl/checks' },
17
+ { text: 'doctor 诊断', link: '/repoctl/doctor' },
14
18
  { text: '配置文件', link: '/repoctl/config' },
15
19
  { text: '模板与创建', link: '/repoctl/templates' },
20
+ { text: '模板资产治理', link: '/repoctl/template-assets' },
16
21
  { text: '工作流与 CI', link: '/repoctl/workflows' },
22
+ { text: '报告与自动化输出', link: '/repoctl/reports' },
17
23
  { text: '排障与报告', link: '/repoctl/troubleshooting' },
18
24
  { text: '命令别名', link: '/repoctl/aliases' },
19
25
  ],
20
26
  },
27
+ ]
28
+
29
+ const knowledgeSidebar = [
21
30
  {
22
31
  text: '知识库',
23
32
  items: [
33
+ { text: '知识库首页', link: '/knowledge/' },
24
34
  { text: '为什么往 monorepo 方向演进', link: '/monorepo/' },
25
35
  { text: '如何管理 monorepo', link: '/monorepo/manage' },
26
36
  { text: '发包与变更日志', link: '/monorepo/publish' },
37
+ { text: 'monorepo 命令参考', link: '/monorepo/commands' },
38
+ { text: 'monorepo 模板体系', link: '/monorepo/templates' },
39
+ { text: 'monorepo 排障', link: '/monorepo/troubleshooting' },
40
+ ],
41
+ },
42
+ {
43
+ text: '现代 npm 包',
44
+ items: [
27
45
  { text: '如何复用 js 代码', link: '/why/how-to-reuse-js-code' },
28
46
  { text: 'JS 文件的各种后缀', link: '/why/js-cjs-mjs' },
29
47
  { text: 'CJS 和 ESM 关键字/全局变量对比', link: '/why/js-keywords' },
30
48
  { text: '什么是 npm 包', link: '/why/what-is-npm-package' },
31
49
  { text: '如何发布 npm 包', link: '/why/publish-basic-npm-package' },
32
50
  { text: '改进并发布现代 npm 包', link: '/why/index' },
51
+ { text: '现代包指南', link: '/why/modern/' },
52
+ { text: 'ESM 与 CJS', link: '/why/modern/esm-vs-cjs' },
53
+ { text: '类型声明', link: '/why/modern/dts' },
54
+ { text: '包入口', link: '/why/modern/package-entry-points' },
55
+ { text: '构建工具', link: '/why/modern/bundlers' },
56
+ { text: 'TypeScript', link: '/why/modern/typescript' },
57
+ ],
58
+ },
59
+ ]
60
+
61
+ const aiSidebar = [
62
+ {
63
+ text: 'AI',
64
+ items: [
65
+ { text: 'AI 文档首页', link: '/ai/' },
66
+ { text: 'llms.txt', link: '/ai/llms-txt' },
33
67
  ],
34
68
  },
69
+ ]
70
+
71
+ const toolsSidebar = [
35
72
  {
36
73
  text: '工具专题',
37
74
  items: [
75
+ { text: '工具专题首页', link: '/tools/' },
38
76
  { text: 'pnpm', link: '/tools/pnpm' },
39
77
  { text: 'turborepo', link: '/tools/turborepo' },
40
78
  { text: 'changeset', link: '/tools/changeset' },
@@ -98,14 +136,21 @@ export default withMermaid(defineConfig({
98
136
  { text: 'repoctl', link: '/repoctl/' },
99
137
  { text: '快速开始', link: '/repoctl/getting-started' },
100
138
  { text: '命令', link: '/repoctl/commands' },
101
- { text: '知识库', link: '/monorepo/' },
102
- { text: '工具专题', link: '/tools/turborepo' },
139
+ { text: '知识库', link: '/knowledge/' },
140
+ { text: 'AI 文档', link: '/ai/' },
141
+ { text: '工具专题', link: '/tools/' },
103
142
  ],
104
143
  outline: {
105
144
  label: '目录',
106
145
  level: [2, 3],
107
146
  },
108
147
  sidebar: {
148
+ '/repoctl/': repoctlSidebar,
149
+ '/knowledge/': knowledgeSidebar,
150
+ '/monorepo/': knowledgeSidebar,
151
+ '/why/': knowledgeSidebar,
152
+ '/ai/': aiSidebar,
153
+ '/tools/': toolsSidebar,
109
154
  '/': repoctlSidebar,
110
155
  },
111
156
  editLink: {
@@ -132,6 +177,7 @@ export default withMermaid(defineConfig({
132
177
  { text: 'Getting Started', link: '/en/repoctl/getting-started' },
133
178
  { text: 'Commands', link: '/en/repoctl/commands' },
134
179
  { text: 'Knowledge Base', link: '/en/knowledge/monorepo' },
180
+ { text: 'AI Docs', link: '/ai/' },
135
181
  ],
136
182
  outline: {
137
183
  label: 'On This Page',
@@ -158,6 +204,7 @@ export default withMermaid(defineConfig({
158
204
  plugins: [
159
205
  // @ts-ignore
160
206
  Tailwindcss(),
207
+ llmstxt(),
161
208
  ],
162
209
  },
163
210
  mermaid: {},
@@ -0,0 +1,33 @@
1
+ ---
2
+ description: repoctl 文档站的 AI 文档入口,说明如何为 AI 编程工具提供 llms.txt 和页面 Markdown。
3
+ ---
4
+
5
+ # AI 文档
6
+
7
+ AI 文档入口用于给 Cursor、Claude Code、Codex 和其他 AI 编程工具提供更容易读取的上下文。它和工具专题分开维护,避免 llms.txt 被埋在普通工具列表里。
8
+
9
+ ## 1. 推荐入口
10
+
11
+ | 入口 | 用途 |
12
+ | ------------------------------ | ------------------------------------------------ |
13
+ | `/llms.txt` | 轻量文档索引,适合先交给 AI 工具判断要读哪些页面 |
14
+ | `/llms-full.txt` | 合并后的完整文档,适合需要一次性提供上下文的场景 |
15
+ | [llms.txt 说明](./llms-txt.md) | 维护约定、访问方式和页面 frontmatter 要求 |
16
+
17
+ ## 2. 在 AI 工具里怎么用
18
+
19
+ 优先把 `https://repo.icebreaker.top/llms.txt` 作为入口提供给 AI 工具。只有当工具不能继续抓取链接,或者你需要离线提供完整上下文时,再使用 `https://repo.icebreaker.top/llms-full.txt`。
20
+
21
+ ```txt
22
+ 先给 llms.txt
23
+ -> AI 选择相关页面
24
+ -> 必要时补充 llms-full.txt
25
+ ```
26
+
27
+ ## 3. 维护原则
28
+
29
+ | 维护动作 | 原因 |
30
+ | --------------------------------- | ---------------------------------------- |
31
+ | 新增重要页面时写 `description` | 让 llms 索引更容易被模型理解 |
32
+ | 页面标题保持具体 | 避免 AI 只看到泛化标题,无法判断页面用途 |
33
+ | repoctl、知识库、工具专题分开组织 | 让 AI 工具能按任务类型检索上下文 |
@@ -0,0 +1,42 @@
1
+ ---
2
+ description: 使用 llms.txt 为大语言模型提供更易读取的 repoctl 文档入口。
3
+ ---
4
+
5
+ # AI 文档入口:llms.txt
6
+
7
+ `llms.txt` 是面向大语言模型的文档入口文件。它把站点中的关键页面整理成更适合模型读取的 Markdown 索引,便于 AI 工具在回答 repoctl、pnpm workspace、Turborepo 和模板用法相关问题时快速定位上下文。
8
+
9
+ 本站通过 `vitepress-plugin-llms` 在构建阶段自动生成这些文件:
10
+
11
+ | 文件 | 用途 |
12
+ | ---------------- | -------------------------------- |
13
+ | `/llms.txt` | 文档索引,列出可供模型读取的页面 |
14
+ | `/llms-full.txt` | 把站点文档合并成单个文本文件 |
15
+ | 页面 `.md` 文件 | 保留每个页面内容的 Markdown 版本 |
16
+
17
+ ## 1. 使用方式
18
+
19
+ 访问 `https://repo.icebreaker.top/llms.txt` 可以获取当前文档的 LLM 索引。如果需要一次性提供完整上下文,可以使用 `https://repo.icebreaker.top/llms-full.txt`。
20
+
21
+ 当你在 Cursor、Claude Code、Codex 或其他 AI 编程工具里引用 repoctl 文档时,优先提供 `llms.txt`,再按需要补充具体页面链接。
22
+
23
+ ## 2. 维护约定
24
+
25
+ 新增重要文档页面时,在 frontmatter 中补充 `description`。构建插件会把描述写入 `llms.txt` 的链接说明中,让模型更容易判断每个页面的用途。
26
+
27
+ ```md
28
+ ---
29
+ description: 说明这个页面解决的问题和适用场景。
30
+ ---
31
+ ```
32
+
33
+ ## 3. 页面组织建议
34
+
35
+ AI 入口应该保持显眼,但不要替代正常文档结构:
36
+
37
+ | 页面类型 | 推荐位置 |
38
+ | ------------------------------------- | ------------------------------------ |
39
+ | repoctl 命令、校验、诊断、报告 | `/repoctl/` |
40
+ | monorepo 和 npm 包基础知识 | `/knowledge/`、`/monorepo/`、`/why/` |
41
+ | pnpm、Turborepo、changeset 等工具专题 | `/tools/` |
42
+ | llms.txt 和 AI 工具读取约定 | `/ai/` |
@@ -15,6 +15,9 @@ hero:
15
15
  - theme: alt
16
16
  text: Commands
17
17
  link: /en/repoctl/commands
18
+ - theme: alt
19
+ text: AI Docs
20
+ link: /ai/
18
21
 
19
22
  features:
20
23
  - title: Adopt existing workspaces
@@ -23,13 +26,15 @@ features:
23
26
  details: Scaffold libraries, apps, services, docs, and CLIs with interactive prompts or explicit template keys.
24
27
  - title: Make checks repeatable
25
28
  details: Preview and run local verification plans that match your lint, typecheck, build, test, and tsd workflow.
29
+ - title: AI-readable documentation
30
+ details: Generate llms.txt, llms-full.txt, and Markdown page output so AI coding tools can read the repoctl docs directly.
26
31
  ---
27
32
 
28
33
  ## Fast Path
29
34
 
30
35
  ```bash
31
36
  pnpm add -D repoctl
32
- pnpm exec repo setup
37
+ pnpm exec repo init
33
38
  pnpm exec repo doctor
34
39
  pnpm exec repo new
35
40
  pnpm exec repo check
@@ -38,10 +43,10 @@ pnpm exec repo check
38
43
  Generated repositories expose the same workflow as shorter root scripts:
39
44
 
40
45
  ```bash
41
- pnpm setup
42
- pnpm doctor
43
- pnpm new
44
- pnpm check
46
+ pnpm run repo:init
47
+ pnpm run repo:doctor
48
+ pnpm run repo:new
49
+ pnpm run repo:check
45
50
  ```
46
51
 
47
52
  ## Keep Reading
@@ -54,4 +59,5 @@ pnpm check
54
59
  - [Configuration](./repoctl/config.md)
55
60
  - [Templates](./repoctl/templates.md)
56
61
  - [Workflows and CI](./repoctl/workflows.md)
62
+ - [AI Docs: llms.txt](../ai/llms-txt.md)
57
63
  - [Knowledge Base: Why Monorepo](./knowledge/monorepo.md)
@@ -24,7 +24,7 @@ pnpm handles workspace dependencies. Turborepo coordinates tasks and caching. To
24
24
 
25
25
  repoctl adds the missing workflow layer:
26
26
 
27
- - `repo setup` aligns root scripts and standard files.
27
+ - `repo init` aligns root scripts and standard files.
28
28
  - `repo doctor` checks whether the workspace is ready.
29
29
  - `repo new` creates packages and apps from known templates.
30
30
  - `repo check` previews and runs local verification.
@@ -9,7 +9,7 @@ A repository is a good fit when:
9
9
  - It already uses pnpm, or is ready to move to pnpm.
10
10
  - It has a root `package.json`.
11
11
  - It can use workspace folders such as `apps/*`, `packages/*`, or `examples/*`.
12
- - The team wants stable daily entries such as `setup`, `doctor`, `new`, and `check`.
12
+ - The team wants stable daily entries such as `repo:init`, `repo:doctor`, `repo:new`, and `repo:check`.
13
13
 
14
14
  If the repository is not yet a pnpm workspace, start with a minimal `pnpm-workspace.yaml`:
15
15
 
@@ -23,10 +23,10 @@ packages:
23
23
 
24
24
  ```bash
25
25
  pnpm add -D repoctl
26
- pnpm exec repo setup --yes
26
+ pnpm exec repo init --yes
27
27
  ```
28
28
 
29
- `setup --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.
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
 
@@ -45,8 +45,8 @@ Watch these checks:
45
45
  | `workspace-manifest` | `pnpm-workspace.yaml` is missing |
46
46
  | `node-version` | Root package has no `engines.node`, or the version does not match |
47
47
  | `tool-package` | `repoctl` is not installed |
48
- | `root-scripts` | `setup/new/check/doctor` scripts are missing |
49
- | `config-file` | `repoctl.config.ts` and `monorepo.config.ts` coexist |
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
50
  | `commit-hooks` | Husky and lint-staged are only partially configured |
51
51
  | `workspace-package-coverage` | Some package.json files are not covered by workspace patterns |
52
52
 
@@ -71,12 +71,12 @@ Review the plan before wiring hooks or CI.
71
71
 
72
72
  ## Step 5: Use Root Scripts
73
73
 
74
- After `setup`, team docs can use:
74
+ After `repo init`, team docs can use:
75
75
 
76
76
  ```bash
77
- pnpm doctor
78
- pnpm new
79
- pnpm check
77
+ pnpm run repo:doctor
78
+ pnpm run repo:new -- sdk
79
+ pnpm run repo:check
80
80
  ```
81
81
 
82
82
  CI and automation should still prefer explicit commands:
@@ -96,7 +96,7 @@ Keep only:
96
96
  repoctl.config.ts
97
97
  ```
98
98
 
99
- `monorepo.config.ts` is for compatibility with older projects.
99
+ `monorepo.config.ts` is no longer loaded at runtime; rename it to `repoctl.config.ts`.
100
100
 
101
101
  ### Local Tooling Loader
102
102
 
@@ -106,12 +106,14 @@ If `doctor` reports local source tooling loaders, migrate with:
106
106
  pnpm exec repo upgrade --yes
107
107
  ```
108
108
 
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
+
109
111
  ### Workspace Pattern Gaps
110
112
 
111
113
  Run:
112
114
 
113
115
  ```bash
114
- pnpm exec repo setup --yes
116
+ pnpm exec repo init --yes
115
117
  ```
116
118
 
117
119
  or manually extend `pnpm-workspace.yaml`.
@@ -16,7 +16,7 @@ mo
16
16
 
17
17
  The docs recommend `repo`.
18
18
 
19
- Compatibility entry points remain available:
19
+ These bins all enter the same command implementation:
20
20
 
21
21
  ```bash
22
22
  repoctl doctor
@@ -29,8 +29,7 @@ mo doctor
29
29
 
30
30
  | Recommended | Alias | Purpose |
31
31
  | ---------------- | ----------- | ----------------------------- |
32
- | `repo setup` | `repo init` | Initialize workspace defaults |
33
- | `repo upgrade` | `repo sync` | Sync standard template assets |
32
+ | `repo init` | `repo init` | Initialize workspace defaults |
34
33
  | `repo templates` | `repo tpl` | Inspect or check templates |
35
34
 
36
35
  ## Group Aliases
@@ -66,6 +65,6 @@ mo doctor
66
65
  ## Recommendation
67
66
 
68
67
  - Use full commands in onboarding docs.
69
- - Use root scripts in project README files.
68
+ - Use `repo:*` root scripts in project README files, for example `pnpm run repo:doctor`.
70
69
  - Use short aliases in maintainer scripts only when the surrounding docs explain them.
71
70
  - Prefer full commands in CI logs.