@icebreakers/monorepo-templates 1.3.4 → 2.0.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.
- package/assets/.agents/skills/repoctl/SKILL.md +63 -0
- package/assets/.agents/skills/repoctl/references/commands.md +243 -0
- package/assets/.agents/skills/repoctl/references/config.md +67 -0
- package/assets/.agents/skills/repoctl/references/templates.md +46 -0
- package/assets/AGENTS.md +31 -42
- package/assets/CLAUDE.md +14 -0
- package/assets/gitignore +3 -0
- package/assets/package.json +5 -45
- package/assets/pnpm-workspace.yaml +1 -1
- package/assets/turbo.json +11 -0
- package/assets-data.mjs +2 -0
- package/dist/cli.mjs +1 -1
- package/dist/index.mjs +1 -1
- package/dist/{prepare-D7eJqEqy.mjs → prepare-zIcRa4-K.mjs} +43 -7
- package/package.json +5 -3
- package/templates/cli/dev/index.ts +4 -2
- package/templates/cli/package.json +4 -1
- package/templates/client/gitignore +1 -0
- package/templates/client/package.json +13 -8
- package/templates/client/turbo.json +11 -0
- package/templates/server/gitignore +1 -0
- package/templates/server/package.json +9 -6
- package/templates/server/src/node-entry.ts +2 -2
- package/templates/server/tsconfig.json +2 -1
- package/templates/server/turbo.json +11 -0
- package/templates/tsdown/package.json +5 -2
- package/templates/vitepress/ai/create.md +45 -0
- package/templates/vitepress/ai/index.md +1 -0
- package/templates/vitepress/package.json +8 -5
- package/templates/vitepress/reference/templates.md +8 -0
- package/templates/vitepress/scripts/check-locales.ts +2 -2
- package/templates/vitepress/start/index.md +1 -1
- package/templates/vitepress/start/install.md +1 -1
- package/templates/vitepress/tasks/adopt-existing.md +1 -1
- package/templates/vitepress/tsconfig.json +1 -0
- package/templates/vitepress/zh/ai/create.md +45 -0
- package/templates/vitepress/zh/ai/index.md +1 -0
- package/templates/vitepress/zh/reference/templates.md +8 -0
- package/templates/vitepress/zh/start/index.md +1 -1
- package/templates/vitepress/zh/start/install.md +1 -1
- package/templates/vitepress/zh/tasks/adopt-existing.md +1 -1
- package/templates/vue-lib/package.json +5 -2
- package/templates/vue-lib/tsconfig.node.json +1 -1
- package/templates/vue-lib/vite.config.ts +2 -2
- package/templates/vue-lib/vite.shared.config.ts +2 -2
- package/templates/client/worker-configuration.d.ts +0 -15358
- package/templates/server/worker-configuration.d.ts +0 -15358
|
@@ -19,6 +19,8 @@ const coreAssetTargets = [
|
|
|
19
19
|
"repoctl.config.ts",
|
|
20
20
|
"package.json",
|
|
21
21
|
"AGENTS.md",
|
|
22
|
+
"CLAUDE.md",
|
|
23
|
+
".agents",
|
|
22
24
|
"pnpm-workspace.yaml",
|
|
23
25
|
"tsconfig.json",
|
|
24
26
|
"turbo.json",
|
|
@@ -144,7 +146,8 @@ const skipDirs = /* @__PURE__ */ new Set([
|
|
|
144
146
|
const skipFiles = /* @__PURE__ */ new Set([
|
|
145
147
|
".DS_Store",
|
|
146
148
|
"CHANGELOG.md",
|
|
147
|
-
"route-map.d.ts"
|
|
149
|
+
"route-map.d.ts",
|
|
150
|
+
"worker-configuration.d.ts"
|
|
148
151
|
]);
|
|
149
152
|
function shouldSkipTemplatePath(rootDir, targetPath) {
|
|
150
153
|
const basename = path.basename(targetPath);
|
|
@@ -203,11 +206,23 @@ function removeSourceRepoReleaseToolingBuildStepContent(content) {
|
|
|
203
206
|
}
|
|
204
207
|
function sanitizePublishedWorkspaceContent(content) {
|
|
205
208
|
const workspace = YAML.parse(content);
|
|
206
|
-
if (!workspace
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
209
|
+
if (!workspace || typeof workspace !== "object") return content;
|
|
210
|
+
let changed = false;
|
|
211
|
+
if (workspace.versioning && typeof workspace.versioning === "object") {
|
|
212
|
+
delete workspace.versioning["fixed"];
|
|
213
|
+
delete workspace.versioning["ignore"];
|
|
214
|
+
delete workspace.versioning["lanes"];
|
|
215
|
+
changed = true;
|
|
216
|
+
}
|
|
217
|
+
if ("catalog" in workspace) {
|
|
218
|
+
delete workspace.catalog;
|
|
219
|
+
changed = true;
|
|
220
|
+
}
|
|
221
|
+
if ("catalogs" in workspace) {
|
|
222
|
+
delete workspace.catalogs;
|
|
223
|
+
changed = true;
|
|
224
|
+
}
|
|
225
|
+
return changed ? YAML.stringify(workspace) : content;
|
|
211
226
|
}
|
|
212
227
|
async function pathExists(targetPath) {
|
|
213
228
|
try {
|
|
@@ -271,12 +286,13 @@ async function copyEntry(from, to, overwriteExisting, filter) {
|
|
|
271
286
|
throw error;
|
|
272
287
|
}
|
|
273
288
|
}
|
|
289
|
+
const publishedAgentSourceFiles = /* @__PURE__ */ new Set(["AGENTS.md", "CLAUDE.md"]);
|
|
274
290
|
async function copyAssets(repoRoot, overwriteExisting) {
|
|
275
291
|
const monorepoAssetRoot = path$1.resolve(repoRoot, "packages/monorepo/assets");
|
|
276
292
|
for (const target of assetTargets) {
|
|
277
293
|
const packageAsset = path$1.join(monorepoAssetRoot, toPublishGitignorePath(target));
|
|
278
294
|
const repoAsset = path$1.join(repoRoot, target);
|
|
279
|
-
const from = await pathExists(repoAsset) ?
|
|
295
|
+
const from = publishedAgentSourceFiles.has(target) || !await pathExists(repoAsset) ? packageAsset : repoAsset;
|
|
280
296
|
if (!await pathExists(from)) continue;
|
|
281
297
|
const to = path$1.join(assetsDir, toPublishGitignorePath(target));
|
|
282
298
|
const stats = await fs.stat(from);
|
|
@@ -294,6 +310,11 @@ async function writePublishedToolingConfigs() {
|
|
|
294
310
|
if (await pathExists(targetPath)) await fs.writeFile(targetPath, content);
|
|
295
311
|
}));
|
|
296
312
|
}
|
|
313
|
+
async function writePublishedAgentSkill(repoRoot, overwriteExisting) {
|
|
314
|
+
const skillFrom = path$1.join(repoRoot, "packages/monorepo/resources/skills/repoctl");
|
|
315
|
+
if (!await pathExists(skillFrom)) return;
|
|
316
|
+
await copyEntry(skillFrom, path$1.join(assetsDir, ".agents", "skills", "repoctl"), overwriteExisting);
|
|
317
|
+
}
|
|
297
318
|
async function sanitizePublishedWorkspace() {
|
|
298
319
|
const workspacePath = path$1.join(assetsDir, "pnpm-workspace.yaml");
|
|
299
320
|
if (!await pathExists(workspacePath)) return;
|
|
@@ -310,6 +331,19 @@ async function removeSourceRepoReleaseToolingBuildStep() {
|
|
|
310
331
|
const nextContent = removeSourceRepoReleaseToolingBuildStepContent(content);
|
|
311
332
|
if (nextContent !== content) await fs.writeFile(releaseWorkflowPath, nextContent, "utf8");
|
|
312
333
|
}
|
|
334
|
+
async function removeSourceRepoWorkerTypeChecks() {
|
|
335
|
+
const workflowPath = path$1.join(assetsDir, ".github/workflows/ci.yml");
|
|
336
|
+
if (await pathExists(workflowPath)) {
|
|
337
|
+
const workflow = await fs.readFile(workflowPath, "utf8");
|
|
338
|
+
await fs.writeFile(workflowPath, workflow.replace(/\r?\n\s+- name: Check Worker type generation from packaged templates\r?\n\s+run: pnpm test:worker-types\r?\n/g, "\n"));
|
|
339
|
+
}
|
|
340
|
+
const manifestPath = path$1.join(assetsDir, "package.json");
|
|
341
|
+
if (await pathExists(manifestPath)) {
|
|
342
|
+
const manifest = JSON.parse(await fs.readFile(manifestPath, "utf8"));
|
|
343
|
+
delete manifest.scripts?.["test:worker-types"];
|
|
344
|
+
await fs.writeFile(manifestPath, `${JSON.stringify(manifest, null, 2)}\n`);
|
|
345
|
+
}
|
|
346
|
+
}
|
|
313
347
|
async function copyTemplates(repoRoot, overwriteExisting) {
|
|
314
348
|
for (const template of templateChoices) {
|
|
315
349
|
const from = path$1.join(repoRoot, "templates", template.source);
|
|
@@ -330,7 +364,9 @@ async function prepareAssets(options = {}) {
|
|
|
330
364
|
await sanitizePublishedWorkspace();
|
|
331
365
|
await removePublishedReleaseState();
|
|
332
366
|
await writePublishedToolingConfigs();
|
|
367
|
+
await writePublishedAgentSkill(repoRoot, overwriteExisting);
|
|
333
368
|
await removeSourceRepoReleaseToolingBuildStep();
|
|
369
|
+
await removeSourceRepoWorkerTypeChecks();
|
|
334
370
|
await copyTemplates(repoRoot, overwriteExisting);
|
|
335
371
|
}
|
|
336
372
|
//#endregion
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@icebreakers/monorepo-templates",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "2.0.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",
|
|
@@ -35,6 +35,7 @@
|
|
|
35
35
|
"main": "./dist/index.mjs",
|
|
36
36
|
"types": "./dist/index.d.mts",
|
|
37
37
|
"files": [
|
|
38
|
+
"README.md",
|
|
38
39
|
"assets",
|
|
39
40
|
"assets-data.mjs",
|
|
40
41
|
"dist",
|
|
@@ -42,7 +43,7 @@
|
|
|
42
43
|
"templates"
|
|
43
44
|
],
|
|
44
45
|
"engines": {
|
|
45
|
-
"node": ">=
|
|
46
|
+
"node": ">=22.13.0"
|
|
46
47
|
},
|
|
47
48
|
"dependencies": {
|
|
48
49
|
"@inquirer/checkbox": "^5.2.5",
|
|
@@ -53,7 +54,8 @@
|
|
|
53
54
|
"yaml": "^2.9.0"
|
|
54
55
|
},
|
|
55
56
|
"publishConfig": {
|
|
56
|
-
"access": "public"
|
|
57
|
+
"access": "public",
|
|
58
|
+
"registry": "https://registry.npmjs.org"
|
|
57
59
|
},
|
|
58
60
|
"scripts": {
|
|
59
61
|
"dev": "tsdown --watch --sourcemap",
|
|
@@ -24,8 +24,11 @@
|
|
|
24
24
|
"bin": {
|
|
25
25
|
"ice": "./dev/index.ts"
|
|
26
26
|
},
|
|
27
|
+
"engines": {
|
|
28
|
+
"node": ">=22.13.0"
|
|
29
|
+
},
|
|
27
30
|
"scripts": {
|
|
28
|
-
"start": "
|
|
31
|
+
"start": "node --experimental-strip-types src/index.ts",
|
|
29
32
|
"dev": "tsdown --watch --sourcemap",
|
|
30
33
|
"build": "tsdown",
|
|
31
34
|
"lint": "eslint .",
|
|
@@ -4,6 +4,8 @@
|
|
|
4
4
|
"version": "0.0.1",
|
|
5
5
|
"private": true,
|
|
6
6
|
"description": "Internal Vue and Cloudflare application template shipped with repoctl",
|
|
7
|
+
"author": "ice breaker <hi@sonofmagic.top>",
|
|
8
|
+
"license": "MIT",
|
|
7
9
|
"homepage": "https://repoctl.icebreaker.top",
|
|
8
10
|
"repository": {
|
|
9
11
|
"type": "git",
|
|
@@ -19,23 +21,26 @@
|
|
|
19
21
|
"cloudflare",
|
|
20
22
|
"template"
|
|
21
23
|
],
|
|
24
|
+
"engines": {
|
|
25
|
+
"node": ">=22.13.0"
|
|
26
|
+
},
|
|
22
27
|
"scripts": {
|
|
23
|
-
"dev": "vite --host",
|
|
24
|
-
"build": "vue-tsc -b && vite build",
|
|
28
|
+
"dev": "pnpm cf-typegen && vite --host",
|
|
29
|
+
"build": "pnpm cf-typegen && vue-tsc -b && vite build",
|
|
25
30
|
"lint": "eslint .",
|
|
26
31
|
"lint:fix": "eslint . --fix",
|
|
27
32
|
"preview": "vite preview",
|
|
28
33
|
"deploy": "wrangler deploy",
|
|
29
34
|
"cf-typegen": "wrangler types",
|
|
30
35
|
"cf-typegen:check": "wrangler types --check",
|
|
31
|
-
"typecheck": "pnpm cf-typegen
|
|
36
|
+
"typecheck": "pnpm cf-typegen && vue-tsc -b"
|
|
32
37
|
},
|
|
33
38
|
"dependencies": {
|
|
34
39
|
"@faker-js/faker": "^10.6.0",
|
|
35
40
|
"@tanstack/vue-query": "^5.102.8",
|
|
36
41
|
"@tanstack/vue-query-devtools": "^6.1.48",
|
|
37
42
|
"@tanstack/vue-table": "^9.2.4",
|
|
38
|
-
"@tanstack/vue-virtual": "^3.13.
|
|
43
|
+
"@tanstack/vue-virtual": "^3.13.38",
|
|
39
44
|
"@trpc/client": "^11.18.0",
|
|
40
45
|
"clsx": "^2.1.1",
|
|
41
46
|
"pinia": "^4.0.3",
|
|
@@ -46,7 +51,7 @@
|
|
|
46
51
|
"vue-router": "^5.3.1"
|
|
47
52
|
},
|
|
48
53
|
"devDependencies": {
|
|
49
|
-
"@cloudflare/vite-plugin": "^1.54.
|
|
54
|
+
"@cloudflare/vite-plugin": "^1.54.8",
|
|
50
55
|
"@hono/node-server": "^2.1.1",
|
|
51
56
|
"@hono/trpc-server": "^0.4.2",
|
|
52
57
|
"@tailwindcss/vite": "^4.3.3",
|
|
@@ -58,11 +63,11 @@
|
|
|
58
63
|
"hono": "^4.13.7",
|
|
59
64
|
"tailwindcss": "^4.3.3",
|
|
60
65
|
"typescript": "~6.0.3",
|
|
61
|
-
"vite": "^8.
|
|
66
|
+
"vite": "^8.3.0",
|
|
62
67
|
"vite-plugin-vue-devtools": "^8.2.1",
|
|
63
68
|
"vite-tsconfig-paths": "^6.1.1",
|
|
64
69
|
"vue-tsc": "3.3.11",
|
|
65
|
-
"wrangler": "^4.
|
|
66
|
-
"zod": "^4.
|
|
70
|
+
"wrangler": "^4.131.1",
|
|
71
|
+
"zod": "^4.6.2"
|
|
67
72
|
}
|
|
68
73
|
}
|
|
@@ -30,13 +30,16 @@
|
|
|
30
30
|
"files": [
|
|
31
31
|
"dist"
|
|
32
32
|
],
|
|
33
|
+
"engines": {
|
|
34
|
+
"node": ">=22.13.0"
|
|
35
|
+
},
|
|
33
36
|
"scripts": {
|
|
34
|
-
"dev": "wrangler dev",
|
|
35
|
-
"build": "tsdown",
|
|
37
|
+
"dev": "pnpm cf-typegen && wrangler dev",
|
|
38
|
+
"build": "pnpm cf-typegen && tsdown",
|
|
36
39
|
"build:watch": "tsdown --watch --sourcemap",
|
|
37
40
|
"node:build:watch": "pnpm build:watch",
|
|
38
41
|
"node:build": "pnpm build",
|
|
39
|
-
"node:dev": "
|
|
42
|
+
"node:dev": "node --watch --experimental-strip-types src/node-entry.ts",
|
|
40
43
|
"node:start": "node dist/node-entry.mjs",
|
|
41
44
|
"test": "vitest run",
|
|
42
45
|
"test:dev": "vitest",
|
|
@@ -46,7 +49,7 @@
|
|
|
46
49
|
"deploy": "wrangler deploy",
|
|
47
50
|
"cf-typegen": "wrangler types",
|
|
48
51
|
"cf-typegen:check": "wrangler types --check",
|
|
49
|
-
"typecheck": "pnpm cf-typegen
|
|
52
|
+
"typecheck": "pnpm cf-typegen && tsc -p tsconfig.json && tsc -p tsconfig.worker.json"
|
|
50
53
|
},
|
|
51
54
|
"publishConfig": {
|
|
52
55
|
"exports": {
|
|
@@ -65,7 +68,7 @@
|
|
|
65
68
|
"consola": "^3.4.2",
|
|
66
69
|
"hono": "^4.13.7",
|
|
67
70
|
"tsdown": "0.23.0",
|
|
68
|
-
"wrangler": "^4.
|
|
69
|
-
"zod": "^4.
|
|
71
|
+
"wrangler": "^4.131.1",
|
|
72
|
+
"zod": "^4.6.2"
|
|
70
73
|
}
|
|
71
74
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { serve } from '@hono/node-server'
|
|
2
2
|
import { consola } from 'consola'
|
|
3
3
|
import { logger } from 'hono/logger'
|
|
4
|
-
import { app } from './app'
|
|
5
|
-
import { port } from './config'
|
|
4
|
+
import { app } from './app.ts'
|
|
5
|
+
import { port } from './config.ts'
|
|
6
6
|
|
|
7
7
|
app.use(logger())
|
|
8
8
|
serve({
|
|
@@ -41,6 +41,10 @@
|
|
|
41
41
|
"files": [
|
|
42
42
|
"dist"
|
|
43
43
|
],
|
|
44
|
+
"publishConfig": {},
|
|
45
|
+
"engines": {
|
|
46
|
+
"node": ">=22.13.0"
|
|
47
|
+
},
|
|
44
48
|
"scripts": {
|
|
45
49
|
"dev": "tsdown -w",
|
|
46
50
|
"build": "tsdown",
|
|
@@ -51,6 +55,5 @@
|
|
|
51
55
|
"lint:fix": "eslint . --fix",
|
|
52
56
|
"typecheck": "tsc -p tsconfig.json",
|
|
53
57
|
"tsd": "pnpm build && tsd --files test-d/**/*.test-d.ts"
|
|
54
|
-
}
|
|
55
|
-
"publishConfig": {}
|
|
58
|
+
}
|
|
56
59
|
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Non-interactive recipe for AI agents to create a repoctl workspace with pnpm create repoctl --yes.
|
|
3
|
+
outline: deep
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Create a project with repoctl (AI)
|
|
7
|
+
|
|
8
|
+
Use this page when an agent is asked to create a new project with repoctl.
|
|
9
|
+
|
|
10
|
+
## Empty directory
|
|
11
|
+
|
|
12
|
+
Do not prompt. Run:
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
pnpm create repoctl <dir> -- --yes --templates <keys>
|
|
16
|
+
cd <dir>
|
|
17
|
+
pnpm install
|
|
18
|
+
pnpm exec repo init
|
|
19
|
+
pnpm exec repo doctor
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
`npm create repoctl@latest <dir> -- --yes --templates <keys>` and
|
|
23
|
+
`npx create-repoctl <dir> --yes --templates <keys>` are equivalent.
|
|
24
|
+
`pnpm create` and `npm create` need the extra `--` before flags.
|
|
25
|
+
|
|
26
|
+
## Template keys
|
|
27
|
+
|
|
28
|
+
| User intent | `--templates` / `repo new --template` |
|
|
29
|
+
| ------------------------ | ------------------------------------- |
|
|
30
|
+
| Vue / full-stack web app | `vue-hono` |
|
|
31
|
+
| API / Hono service | `hono-server` |
|
|
32
|
+
| TypeScript library / SDK | `tsdown` |
|
|
33
|
+
| Vue component library | `vue-lib` |
|
|
34
|
+
| Documentation site | `vitepress` |
|
|
35
|
+
| CLI | `cli` |
|
|
36
|
+
|
|
37
|
+
Omit `--templates` when the intent is unclear. After init, create a package with:
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
pnpm exec repo new <name> --template <key>
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## Existing workspace
|
|
44
|
+
|
|
45
|
+
If `pnpm-workspace.yaml` and a `repoctl` dependency already exist, do not run create. Use `repo new` instead, then `pnpm exec repo check`.
|
|
@@ -11,6 +11,7 @@ repoctl publishes AI-readable documentation alongside the human site.
|
|
|
11
11
|
- `/llms.txt`: compact English index and product summary.
|
|
12
12
|
- `/llms-full.txt`: combined page content when a larger context is appropriate.
|
|
13
13
|
- `/zh/`: Simplified Chinese documentation.
|
|
14
|
+
- [Create a project](./create.md): non-interactive `pnpm create repoctl --yes` recipe.
|
|
14
15
|
- [llms.txt Guide](./llms-txt.md): usage and maintenance rules.
|
|
15
16
|
|
|
16
17
|
## Using It In AI Tools
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
"private": true,
|
|
6
6
|
"description": "Documentation website for repoctl",
|
|
7
7
|
"author": "ice breaker <hi@sonofmagic.top>",
|
|
8
|
+
"license": "MIT",
|
|
8
9
|
"homepage": "https://repoctl.icebreaker.top",
|
|
9
10
|
"repository": {
|
|
10
11
|
"type": "git",
|
|
@@ -20,9 +21,12 @@
|
|
|
20
21
|
"vitepress",
|
|
21
22
|
"monorepo"
|
|
22
23
|
],
|
|
24
|
+
"engines": {
|
|
25
|
+
"node": ">=22.13.0"
|
|
26
|
+
},
|
|
23
27
|
"scripts": {
|
|
24
28
|
"dev": "vitepress dev",
|
|
25
|
-
"check:locales": "
|
|
29
|
+
"check:locales": "node --experimental-strip-types scripts/check-locales.ts",
|
|
26
30
|
"build": "pnpm run check:locales && vitepress build",
|
|
27
31
|
"preview": "vitepress preview",
|
|
28
32
|
"deploy": "wrangler deploy",
|
|
@@ -42,13 +46,12 @@
|
|
|
42
46
|
"cytoscape-cose-bilkent": "^4.1.0",
|
|
43
47
|
"dayjs": "^1.11.23",
|
|
44
48
|
"debug": "^4.4.3",
|
|
45
|
-
"mermaid": "^
|
|
49
|
+
"mermaid": "^12.0.0",
|
|
46
50
|
"tailwindcss": "^4.3.3",
|
|
47
|
-
"tsx": "^4.23.13",
|
|
48
51
|
"vitepress": "^1.6.4",
|
|
49
|
-
"vitepress-plugin-llms": "^1.
|
|
52
|
+
"vitepress-plugin-llms": "^1.14.0",
|
|
50
53
|
"vitepress-plugin-mermaid": "^2.0.17",
|
|
51
54
|
"vue-tsc": "^3.3.11",
|
|
52
|
-
"wrangler": "^4.
|
|
55
|
+
"wrangler": "^4.131.1"
|
|
53
56
|
}
|
|
54
57
|
}
|
|
@@ -74,6 +74,14 @@ Check first:
|
|
|
74
74
|
- `dev`, `build`, and `typecheck` scripts are part of root tasks.
|
|
75
75
|
- CI needs integration or E2E tests.
|
|
76
76
|
|
|
77
|
+
### Cloudflare Worker types
|
|
78
|
+
|
|
79
|
+
The `vue-hono` and `hono-server` templates generate `worker-configuration.d.ts` from the installed Wrangler version and `wrangler.jsonc` before `dev`, `build`, and `typecheck`. This generated file is ignored by Git and excluded from published templates. Dependency updates do not require committing regenerated declarations.
|
|
80
|
+
|
|
81
|
+
Run `pnpm cf-typegen` in the app workspace to refresh editor types after changing bindings or compatibility settings. `pnpm cf-typegen:check` is a read-only diagnostic: it reports missing or outdated declarations. Build and typecheck regenerate them automatically and still fail on invalid configuration or TypeScript errors.
|
|
82
|
+
|
|
83
|
+
For existing projects, update these scripts and the Turbo inputs/outputs, then remove `worker-configuration.d.ts` from the Git index with `git rm --cached worker-configuration.d.ts` and add it to `.gitignore`.
|
|
84
|
+
|
|
77
85
|
### Create a docs site
|
|
78
86
|
|
|
79
87
|
```bash
|
|
@@ -2,8 +2,8 @@ import type { DocsLocale } from '../.vitepress/navigation/routes'
|
|
|
2
2
|
import { readdir, readFile, stat } from 'node:fs/promises'
|
|
3
3
|
import path from 'node:path'
|
|
4
4
|
import process from 'node:process'
|
|
5
|
-
import { homeContent } from '../.vitepress/home/content'
|
|
6
|
-
import { routePath, routeSections } from '../.vitepress/navigation/routes'
|
|
5
|
+
import { homeContent } from '../.vitepress/home/content.ts'
|
|
6
|
+
import { routePath, routeSections } from '../.vitepress/navigation/routes.ts'
|
|
7
7
|
|
|
8
8
|
const root = process.cwd()
|
|
9
9
|
const ignoredDirectories = new Set(['.vitepress', 'node_modules'])
|
|
@@ -23,4 +23,4 @@ The CLI works with pnpm workspaces and understands Turborepo task graphs. It doe
|
|
|
23
23
|
|
|
24
24
|
## Before you continue
|
|
25
25
|
|
|
26
|
-
You need Node.js 22.
|
|
26
|
+
You need Node.js 22.13 or newer and pnpm available on your path. Run commands from the repository root so repoctl can read the workspace configuration.
|
|
@@ -4,7 +4,7 @@ This guide follows the order you would use when adding repoctl to a workspace.
|
|
|
4
4
|
|
|
5
5
|
## Prerequisites
|
|
6
6
|
|
|
7
|
-
- Node.js
|
|
7
|
+
- Node.js 22.13 or newer.
|
|
8
8
|
- pnpm. Corepack is recommended: `corepack enable`.
|
|
9
9
|
- Git. `repo doctor` reads repository metadata and checks the commit workflow.
|
|
10
10
|
|
|
@@ -8,7 +8,7 @@ Use this task when a workspace already has scripts, hooks, or configuration that
|
|
|
8
8
|
|
|
9
9
|
- Run commands from the workspace root.
|
|
10
10
|
- Commit or stash unrelated local changes.
|
|
11
|
-
- Confirm that Node.js 22.
|
|
11
|
+
- Confirm that Node.js 22.13 or newer and pnpm are available.
|
|
12
12
|
|
|
13
13
|
## Smallest Command
|
|
14
14
|
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: 给 AI 代理用的非交互配方:pnpm create repoctl --yes 创建 repoctl 工作区。
|
|
3
|
+
outline: deep
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# 用 repoctl 创建项目(AI)
|
|
7
|
+
|
|
8
|
+
当代理被要求用 repoctl 创建新项目时,按本页执行。
|
|
9
|
+
|
|
10
|
+
## 空目录
|
|
11
|
+
|
|
12
|
+
不要提问。直接运行:
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
pnpm create repoctl <dir> -- --yes --templates <keys>
|
|
16
|
+
cd <dir>
|
|
17
|
+
pnpm install
|
|
18
|
+
pnpm exec repo init
|
|
19
|
+
pnpm exec repo doctor
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
等价命令:`npm create repoctl@latest <dir> -- --yes --templates <keys>` 与
|
|
23
|
+
`npx create-repoctl <dir> --yes --templates <keys>`。
|
|
24
|
+
`pnpm create` / `npm create` 的 flag 前必须加 `--`。
|
|
25
|
+
|
|
26
|
+
## 模板 key
|
|
27
|
+
|
|
28
|
+
| 用户意图 | `--templates` / `repo new --template` |
|
|
29
|
+
| ------------------- | ------------------------------------- |
|
|
30
|
+
| Vue / 全栈 Web | `vue-hono` |
|
|
31
|
+
| API / Hono 服务 | `hono-server` |
|
|
32
|
+
| TypeScript 库 / SDK | `tsdown` |
|
|
33
|
+
| Vue 组件库 | `vue-lib` |
|
|
34
|
+
| 文档站 | `vitepress` |
|
|
35
|
+
| CLI | `cli` |
|
|
36
|
+
|
|
37
|
+
意图不清时省略 `--templates`。初始化后再:
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
pnpm exec repo new <name> --template <key>
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## 已有工作区
|
|
44
|
+
|
|
45
|
+
若已有 `pnpm-workspace.yaml` 和 `repoctl` 依赖,不要再跑 create。改用 `repo new`,然后 `pnpm exec repo check`。
|
|
@@ -12,6 +12,7 @@ AI 文档入口用于给 Cursor、Claude Code、Codex 和其他 AI 编程工具
|
|
|
12
12
|
| ------------------------------ | ------------------------------------------------ |
|
|
13
13
|
| `/llms.txt` | 轻量文档索引,适合先交给 AI 工具判断要读哪些页面 |
|
|
14
14
|
| `/llms-full.txt` | 合并后的完整文档,适合需要一次性提供上下文的场景 |
|
|
15
|
+
| [创建项目](./create.md) | 非交互 `pnpm create repoctl --yes` 配方 |
|
|
15
16
|
| [llms.txt 说明](./llms-txt.md) | 维护约定、访问方式和页面 frontmatter 要求 |
|
|
16
17
|
|
|
17
18
|
## 2. 在 AI 工具里怎么用
|
|
@@ -76,6 +76,14 @@ repo new api --template hono-server
|
|
|
76
76
|
- `dev`、`build`、`typecheck` 脚本是否接入根任务。
|
|
77
77
|
- 是否需要在 CI 里加入 E2E 或集成测试。
|
|
78
78
|
|
|
79
|
+
### Cloudflare Worker 类型
|
|
80
|
+
|
|
81
|
+
`vue-hono` 和 `hono-server` 模板会在 `dev`、`build`、`typecheck` 前,根据已安装的 Wrangler 版本和 `wrangler.jsonc` 自动生成 `worker-configuration.d.ts`。该文件由 Git 忽略,也不会打入发布的模板包;依赖升级无需再提交重新生成的声明。
|
|
82
|
+
|
|
83
|
+
修改 binding 或兼容性配置后,可在应用工作区运行 `pnpm cf-typegen` 刷新编辑器类型。`pnpm cf-typegen:check` 保留为只读诊断命令,文件缺失或过期时会报错。构建和类型检查会自动重新生成,配置错误和真实 TypeScript 错误仍会阻止通过。
|
|
84
|
+
|
|
85
|
+
已有项目需同步这些脚本和 Turbo 的输入、输出配置,再执行 `git rm --cached worker-configuration.d.ts` 移除 Git 跟踪,并将文件加入 `.gitignore`。
|
|
86
|
+
|
|
79
87
|
### 要创建文档站
|
|
80
88
|
|
|
81
89
|
```bash
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"private": true,
|
|
6
6
|
"description": "Internal Vue library template shipped with repoctl",
|
|
7
7
|
"author": "ice breaker <hi@sonofmagic.top>",
|
|
8
|
-
"license": "
|
|
8
|
+
"license": "MIT",
|
|
9
9
|
"homepage": "https://repoctl.icebreaker.top",
|
|
10
10
|
"repository": {
|
|
11
11
|
"type": "git",
|
|
@@ -32,6 +32,9 @@
|
|
|
32
32
|
"files": [
|
|
33
33
|
"dist"
|
|
34
34
|
],
|
|
35
|
+
"engines": {
|
|
36
|
+
"node": ">=22.13.0"
|
|
37
|
+
},
|
|
35
38
|
"scripts": {
|
|
36
39
|
"build": "vue-tsc -b && vite build",
|
|
37
40
|
"test": "vitest run",
|
|
@@ -60,7 +63,7 @@
|
|
|
60
63
|
"@vue/test-utils": "^2.5.0",
|
|
61
64
|
"@vue/tsconfig": "^0.9.1",
|
|
62
65
|
"jsdom": "^30.0.1",
|
|
63
|
-
"vite": "^8.
|
|
66
|
+
"vite": "^8.3.0",
|
|
64
67
|
"vite-plugin-dts": "^5.1.0",
|
|
65
68
|
"vue": "^3.5.42",
|
|
66
69
|
"vue-tsc": "^3.3.11"
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
+
import path from 'node:path'
|
|
1
2
|
import Vue from '@vitejs/plugin-vue'
|
|
2
|
-
import path from 'pathe'
|
|
3
3
|
import { mergeConfig } from 'vite'
|
|
4
4
|
import DTS from 'vite-plugin-dts'
|
|
5
|
-
import { sharedConfig } from './vite.shared.config'
|
|
5
|
+
import { sharedConfig } from './vite.shared.config.ts'
|
|
6
6
|
|
|
7
7
|
export default mergeConfig(sharedConfig, {
|
|
8
8
|
plugins: [
|