@icebreakers/monorepo-templates 1.0.4 → 1.0.6
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.
- package/assets/package.json +11 -21
- package/package.json +4 -4
- package/templates/cli/package.json +1 -1
- package/templates/client/package.json +7 -7
- package/templates/client/worker-configuration.d.ts +8 -17
- package/templates/server/package.json +3 -3
- package/templates/server/worker-configuration.d.ts +8 -17
- package/templates/vitepress/.vitepress/config.ts +42 -5
- package/templates/vitepress/ai/index.md +33 -0
- package/templates/vitepress/ai/llms-txt.md +42 -0
- package/templates/vitepress/en/index.md +7 -7
- package/templates/vitepress/en/knowledge/monorepo.md +1 -1
- package/templates/vitepress/en/repoctl/adopt-existing.md +13 -11
- package/templates/vitepress/en/repoctl/aliases.md +3 -4
- package/templates/vitepress/en/repoctl/commands.md +12 -12
- package/templates/vitepress/en/repoctl/config.md +1 -1
- package/templates/vitepress/en/repoctl/getting-started.md +19 -19
- package/templates/vitepress/en/repoctl/index.md +10 -10
- package/templates/vitepress/en/repoctl/scenarios.md +6 -6
- package/templates/vitepress/en/repoctl/troubleshooting.md +2 -2
- package/templates/vitepress/en/repoctl/workflows.md +12 -12
- package/templates/vitepress/getting-started.md +3 -3
- package/templates/vitepress/index.md +11 -8
- package/templates/vitepress/knowledge/index.md +50 -0
- package/templates/vitepress/monorepo/commands.md +5 -5
- package/templates/vitepress/monorepo/index.md +14 -14
- package/templates/vitepress/monorepo/manage.md +21 -21
- package/templates/vitepress/monorepo/troubleshooting.md +1 -1
- package/templates/vitepress/package.json +2 -2
- package/templates/vitepress/repoctl/adopt-existing.md +22 -22
- package/templates/vitepress/repoctl/aliases.md +4 -5
- package/templates/vitepress/repoctl/checks.md +86 -0
- package/templates/vitepress/repoctl/commands.md +28 -14
- package/templates/vitepress/repoctl/config.md +10 -1
- package/templates/vitepress/repoctl/doctor.md +86 -0
- package/templates/vitepress/repoctl/execution-model.md +81 -0
- package/templates/vitepress/repoctl/getting-started.md +16 -16
- package/templates/vitepress/repoctl/index.md +40 -12
- package/templates/vitepress/repoctl/reports.md +94 -0
- package/templates/vitepress/repoctl/scenarios.md +6 -6
- package/templates/vitepress/repoctl/template-assets.md +116 -0
- package/templates/vitepress/repoctl/templates.md +3 -0
- package/templates/vitepress/repoctl/troubleshooting.md +15 -3
- package/templates/vitepress/repoctl/workflows.md +26 -13
- package/templates/vitepress/tools/index.md +38 -0
- package/templates/vitepress/tools/llms-txt.md +4 -24
package/assets/package.json
CHANGED
|
@@ -37,34 +37,24 @@
|
|
|
37
37
|
"commit": "commit",
|
|
38
38
|
"commitlint": "commitlint --edit",
|
|
39
39
|
"-------": "---------------",
|
|
40
|
-
"
|
|
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
|
-
"@commitlint/cli": "^
|
|
54
|
+
"@commitlint/cli": "^21.0.0",
|
|
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
|
-
"@
|
|
67
|
-
"@types/node": "^25.6.0",
|
|
57
|
+
"@types/node": "^25.6.2",
|
|
68
58
|
"@types/semver": "^7.7.1",
|
|
69
59
|
"@vitest/coverage-v8": "~4.1.5",
|
|
70
60
|
"ci-info": "^4.4.0",
|
|
@@ -73,18 +63,18 @@
|
|
|
73
63
|
"es-toolkit": "^1.46.1",
|
|
74
64
|
"eslint": "^10.3.0",
|
|
75
65
|
"husky": "^9.1.7",
|
|
76
|
-
"lint-staged": "^17.0.
|
|
66
|
+
"lint-staged": "^17.0.4",
|
|
77
67
|
"only-allow": "^1.2.2",
|
|
78
68
|
"pathe": "^2.0.3",
|
|
79
69
|
"pkg-types": "^2.3.1",
|
|
80
70
|
"repoctl": "workspace:*",
|
|
81
71
|
"stylelint": "^17.11.0",
|
|
82
|
-
"tailwindcss": "^4.
|
|
72
|
+
"tailwindcss": "^4.3.0",
|
|
83
73
|
"tsd": "^0.33.0",
|
|
84
|
-
"tsdown": "0.
|
|
74
|
+
"tsdown": "0.22.0",
|
|
85
75
|
"tslib": "^2.8.1",
|
|
86
76
|
"tsx": "^4.21.0",
|
|
87
|
-
"turbo": "^2.9.
|
|
77
|
+
"turbo": "^2.9.12",
|
|
88
78
|
"type-fest": "^5.6.0",
|
|
89
79
|
"typescript": "^6.0.3",
|
|
90
80
|
"vitest": "~4.1.5",
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@icebreakers/monorepo-templates",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.6",
|
|
5
5
|
"description": "Template assets for icebreaker monorepo scaffolding",
|
|
6
6
|
"author": "ice breaker <hi@sonofmagic.top>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -43,9 +43,9 @@
|
|
|
43
43
|
"node": ">=18.0.0"
|
|
44
44
|
},
|
|
45
45
|
"dependencies": {
|
|
46
|
-
"@inquirer/checkbox": "^5.1.
|
|
47
|
-
"@inquirer/input": "^5.0.
|
|
48
|
-
"@inquirer/select": "^5.1.
|
|
46
|
+
"@inquirer/checkbox": "^5.1.5",
|
|
47
|
+
"@inquirer/input": "^5.0.13",
|
|
48
|
+
"@inquirer/select": "^5.1.5",
|
|
49
49
|
"commander": "^14.0.3",
|
|
50
50
|
"nanoexec": "^1.1.0"
|
|
51
51
|
},
|
|
@@ -23,30 +23,30 @@
|
|
|
23
23
|
"@trpc/client": "^11.17.0",
|
|
24
24
|
"clsx": "^2.1.1",
|
|
25
25
|
"pinia": "^3.0.4",
|
|
26
|
-
"tailwind-merge": "^3.
|
|
26
|
+
"tailwind-merge": "^3.6.0",
|
|
27
27
|
"tailwind-variants": "^3.2.2",
|
|
28
28
|
"vue": "^3.5.34",
|
|
29
29
|
"vue-i18n": "^11.4.2",
|
|
30
30
|
"vue-router": "^5.0.6"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
|
-
"@cloudflare/vite-plugin": "^1.36.
|
|
34
|
-
"@hono/node-server": "^2.0.
|
|
33
|
+
"@cloudflare/vite-plugin": "^1.36.3",
|
|
34
|
+
"@hono/node-server": "^2.0.2",
|
|
35
35
|
"@hono/trpc-server": "^0.4.2",
|
|
36
|
-
"@tailwindcss/vite": "^4.
|
|
36
|
+
"@tailwindcss/vite": "^4.3.0",
|
|
37
37
|
"@trpc/server": "^11.17.0",
|
|
38
38
|
"@vitejs/plugin-vue": "^6.0.6",
|
|
39
39
|
"@vitejs/plugin-vue-jsx": "^5.1.5",
|
|
40
40
|
"@vue/tsconfig": "^0.9.1",
|
|
41
41
|
"consola": "^3.4.2",
|
|
42
42
|
"hono": "^4.12.18",
|
|
43
|
-
"tailwindcss": "^4.
|
|
43
|
+
"tailwindcss": "^4.3.0",
|
|
44
44
|
"typescript": "~6.0.3",
|
|
45
45
|
"vite": "^8.0.11",
|
|
46
|
-
"vite-plugin-vue-devtools": "^8.1.
|
|
46
|
+
"vite-plugin-vue-devtools": "^8.1.2",
|
|
47
47
|
"vite-tsconfig-paths": "^6.1.1",
|
|
48
48
|
"vue-tsc": "3.2.8",
|
|
49
|
-
"wrangler": "^4.
|
|
49
|
+
"wrangler": "^4.90.0",
|
|
50
50
|
"zod": "^4.4.3"
|
|
51
51
|
}
|
|
52
52
|
}
|
|
@@ -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.
|
|
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(
|
|
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<
|
|
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
|
-
|
|
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>):
|
|
12164
|
-
do<T extends Rpc.Serializable<T>>(name: string, config: WorkflowStepConfig, callback: (ctx: WorkflowStepContext) => Promise<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
|
-
}):
|
|
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 {
|
|
@@ -54,11 +54,11 @@
|
|
|
54
54
|
"types": "./dist/index.d.ts"
|
|
55
55
|
},
|
|
56
56
|
"devDependencies": {
|
|
57
|
-
"@hono/node-server": "^2.0.
|
|
57
|
+
"@hono/node-server": "^2.0.2",
|
|
58
58
|
"consola": "^3.4.2",
|
|
59
59
|
"hono": "^4.12.18",
|
|
60
|
-
"tsdown": "0.
|
|
61
|
-
"wrangler": "^4.
|
|
60
|
+
"tsdown": "0.22.0",
|
|
61
|
+
"wrangler": "^4.90.0",
|
|
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.
|
|
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(
|
|
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<
|
|
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
|
-
|
|
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>):
|
|
12164
|
-
do<T extends Rpc.Serializable<T>>(name: string, config: WorkflowStepConfig, callback: (ctx: WorkflowStepContext) => Promise<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
|
-
}):
|
|
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 {
|
|
@@ -11,37 +11,68 @@ const repoctlSidebar = [
|
|
|
11
11
|
{ text: '快速开始', link: '/repoctl/getting-started' },
|
|
12
12
|
{ text: '接入已有仓库', link: '/repoctl/adopt-existing' },
|
|
13
13
|
{ text: '按场景选命令', link: '/repoctl/scenarios' },
|
|
14
|
+
{ text: '执行模型', link: '/repoctl/execution-model' },
|
|
14
15
|
{ text: '命令速查', link: '/repoctl/commands' },
|
|
16
|
+
{ text: '校验链路', link: '/repoctl/checks' },
|
|
17
|
+
{ text: 'doctor 诊断', link: '/repoctl/doctor' },
|
|
15
18
|
{ text: '配置文件', link: '/repoctl/config' },
|
|
16
19
|
{ text: '模板与创建', link: '/repoctl/templates' },
|
|
20
|
+
{ text: '模板资产治理', link: '/repoctl/template-assets' },
|
|
17
21
|
{ text: '工作流与 CI', link: '/repoctl/workflows' },
|
|
22
|
+
{ text: '报告与自动化输出', link: '/repoctl/reports' },
|
|
18
23
|
{ text: '排障与报告', link: '/repoctl/troubleshooting' },
|
|
19
24
|
{ text: '命令别名', link: '/repoctl/aliases' },
|
|
20
25
|
],
|
|
21
26
|
},
|
|
27
|
+
]
|
|
28
|
+
|
|
29
|
+
const knowledgeSidebar = [
|
|
22
30
|
{
|
|
23
31
|
text: '知识库',
|
|
24
32
|
items: [
|
|
33
|
+
{ text: '知识库首页', link: '/knowledge/' },
|
|
25
34
|
{ text: '为什么往 monorepo 方向演进', link: '/monorepo/' },
|
|
26
35
|
{ text: '如何管理 monorepo', link: '/monorepo/manage' },
|
|
27
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: [
|
|
28
45
|
{ text: '如何复用 js 代码', link: '/why/how-to-reuse-js-code' },
|
|
29
46
|
{ text: 'JS 文件的各种后缀', link: '/why/js-cjs-mjs' },
|
|
30
47
|
{ text: 'CJS 和 ESM 关键字/全局变量对比', link: '/why/js-keywords' },
|
|
31
48
|
{ text: '什么是 npm 包', link: '/why/what-is-npm-package' },
|
|
32
49
|
{ text: '如何发布 npm 包', link: '/why/publish-basic-npm-package' },
|
|
33
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' },
|
|
34
57
|
],
|
|
35
58
|
},
|
|
59
|
+
]
|
|
60
|
+
|
|
61
|
+
const aiSidebar = [
|
|
36
62
|
{
|
|
37
63
|
text: 'AI',
|
|
38
64
|
items: [
|
|
39
|
-
{ text: 'AI
|
|
65
|
+
{ text: 'AI 文档首页', link: '/ai/' },
|
|
66
|
+
{ text: 'llms.txt', link: '/ai/llms-txt' },
|
|
40
67
|
],
|
|
41
68
|
},
|
|
69
|
+
]
|
|
70
|
+
|
|
71
|
+
const toolsSidebar = [
|
|
42
72
|
{
|
|
43
73
|
text: '工具专题',
|
|
44
74
|
items: [
|
|
75
|
+
{ text: '工具专题首页', link: '/tools/' },
|
|
45
76
|
{ text: 'pnpm', link: '/tools/pnpm' },
|
|
46
77
|
{ text: 'turborepo', link: '/tools/turborepo' },
|
|
47
78
|
{ text: 'changeset', link: '/tools/changeset' },
|
|
@@ -105,15 +136,21 @@ export default withMermaid(defineConfig({
|
|
|
105
136
|
{ text: 'repoctl', link: '/repoctl/' },
|
|
106
137
|
{ text: '快速开始', link: '/repoctl/getting-started' },
|
|
107
138
|
{ text: '命令', link: '/repoctl/commands' },
|
|
108
|
-
{ text: '知识库', link: '/
|
|
109
|
-
{ text: 'AI 文档', link: '/
|
|
110
|
-
{ text: '工具专题', link: '/tools/
|
|
139
|
+
{ text: '知识库', link: '/knowledge/' },
|
|
140
|
+
{ text: 'AI 文档', link: '/ai/' },
|
|
141
|
+
{ text: '工具专题', link: '/tools/' },
|
|
111
142
|
],
|
|
112
143
|
outline: {
|
|
113
144
|
label: '目录',
|
|
114
145
|
level: [2, 3],
|
|
115
146
|
},
|
|
116
147
|
sidebar: {
|
|
148
|
+
'/repoctl/': repoctlSidebar,
|
|
149
|
+
'/knowledge/': knowledgeSidebar,
|
|
150
|
+
'/monorepo/': knowledgeSidebar,
|
|
151
|
+
'/why/': knowledgeSidebar,
|
|
152
|
+
'/ai/': aiSidebar,
|
|
153
|
+
'/tools/': toolsSidebar,
|
|
117
154
|
'/': repoctlSidebar,
|
|
118
155
|
},
|
|
119
156
|
editLink: {
|
|
@@ -140,7 +177,7 @@ export default withMermaid(defineConfig({
|
|
|
140
177
|
{ text: 'Getting Started', link: '/en/repoctl/getting-started' },
|
|
141
178
|
{ text: 'Commands', link: '/en/repoctl/commands' },
|
|
142
179
|
{ text: 'Knowledge Base', link: '/en/knowledge/monorepo' },
|
|
143
|
-
{ text: 'AI Docs', link: '/
|
|
180
|
+
{ text: 'AI Docs', link: '/ai/' },
|
|
144
181
|
],
|
|
145
182
|
outline: {
|
|
146
183
|
label: 'On This Page',
|
|
@@ -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/` |
|
|
@@ -17,7 +17,7 @@ hero:
|
|
|
17
17
|
link: /en/repoctl/commands
|
|
18
18
|
- theme: alt
|
|
19
19
|
text: AI Docs
|
|
20
|
-
link: /
|
|
20
|
+
link: /ai/
|
|
21
21
|
|
|
22
22
|
features:
|
|
23
23
|
- title: Adopt existing workspaces
|
|
@@ -34,7 +34,7 @@ features:
|
|
|
34
34
|
|
|
35
35
|
```bash
|
|
36
36
|
pnpm add -D repoctl
|
|
37
|
-
pnpm exec repo
|
|
37
|
+
pnpm exec repo init
|
|
38
38
|
pnpm exec repo doctor
|
|
39
39
|
pnpm exec repo new
|
|
40
40
|
pnpm exec repo check
|
|
@@ -43,10 +43,10 @@ pnpm exec repo check
|
|
|
43
43
|
Generated repositories expose the same workflow as shorter root scripts:
|
|
44
44
|
|
|
45
45
|
```bash
|
|
46
|
-
pnpm
|
|
47
|
-
pnpm doctor
|
|
48
|
-
pnpm new
|
|
49
|
-
pnpm check
|
|
46
|
+
pnpm run repo:init
|
|
47
|
+
pnpm run repo:doctor
|
|
48
|
+
pnpm run repo:new
|
|
49
|
+
pnpm run repo:check
|
|
50
50
|
```
|
|
51
51
|
|
|
52
52
|
## Keep Reading
|
|
@@ -59,5 +59,5 @@ pnpm check
|
|
|
59
59
|
- [Configuration](./repoctl/config.md)
|
|
60
60
|
- [Templates](./repoctl/templates.md)
|
|
61
61
|
- [Workflows and CI](./repoctl/workflows.md)
|
|
62
|
-
- [AI Docs: llms.txt](../
|
|
62
|
+
- [AI Docs: llms.txt](../ai/llms-txt.md)
|
|
63
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
|
|
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 `
|
|
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
|
|
26
|
+
pnpm exec repo init --yes
|
|
27
27
|
```
|
|
28
28
|
|
|
29
|
-
`
|
|
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` | `
|
|
49
|
-
| `config-file` |
|
|
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 `
|
|
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
|
|
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
|
|
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
|
-
|
|
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
|
|
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.
|