@icebreakers/monorepo-templates 1.3.5 → 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/package.json +4 -44
- package/assets/pnpm-workspace.yaml +1 -1
- package/assets-data.mjs +2 -0
- package/dist/cli.mjs +1 -1
- package/dist/index.mjs +1 -1
- package/dist/{prepare-DlR-vvls.mjs → prepare-zIcRa4-K.mjs} +27 -6
- package/package.json +5 -3
- package/templates/cli/dev/index.ts +4 -2
- package/templates/cli/package.json +4 -1
- package/templates/client/package.json +10 -5
- package/templates/server/package.json +6 -3
- package/templates/server/src/node-entry.ts +2 -2
- package/templates/server/tsconfig.json +2 -1
- 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/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/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
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: repoctl
|
|
3
|
+
description: Create and maintain pnpm/Turborepo workspaces with repoctl. Use when the user says 使用 repoctl 创建项目, create a monorepo, pnpm create repoctl, scaffold Vue/Hono/tsdown/vitepress, or run repo init/doctor/new/check.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# repoctl
|
|
7
|
+
|
|
8
|
+
The package name is `repoctl`. The command is `repo`.
|
|
9
|
+
|
|
10
|
+
## Empty directory
|
|
11
|
+
|
|
12
|
+
Do not prompt. Map the request to template keys, then:
|
|
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` and `pnpm create` need the extra `--` before flags. `npx create-repoctl <dir> --yes --templates <keys>` does not.
|
|
23
|
+
|
|
24
|
+
| User intent | `--templates` key |
|
|
25
|
+
| ------------------------ | ------------------ |
|
|
26
|
+
| Vue / full-stack web app | `vue-hono` |
|
|
27
|
+
| API / Hono service | `hono-server` |
|
|
28
|
+
| TypeScript library / SDK | `tsdown` |
|
|
29
|
+
| Vue component library | `vue-lib` |
|
|
30
|
+
| Documentation site | `vitepress` |
|
|
31
|
+
| CLI | `cli` |
|
|
32
|
+
| Unspecified | omit `--templates` |
|
|
33
|
+
|
|
34
|
+
Then implement the requested feature in the generated workspace.
|
|
35
|
+
|
|
36
|
+
## Existing repoctl workspace
|
|
37
|
+
|
|
38
|
+
Look for `pnpm-workspace.yaml` and a `repoctl` / `repo` dependency.
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
pnpm exec repo templates
|
|
42
|
+
pnpm exec repo new <name> --template <key>
|
|
43
|
+
pnpm exec repo check
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
## Verify
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
pnpm exec repo doctor
|
|
50
|
+
pnpm exec repo check
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
## Do not
|
|
54
|
+
|
|
55
|
+
- Do not add packages by copying folders.
|
|
56
|
+
- Do not hang on create prompts; pass `--yes`.
|
|
57
|
+
- Do not create business apps inside the `sonofmagic/repoctl` source repository.
|
|
58
|
+
|
|
59
|
+
## References
|
|
60
|
+
|
|
61
|
+
- `references/templates.md` for template keys and `repo new` flags.
|
|
62
|
+
- `references/commands.md` for other CLI commands.
|
|
63
|
+
- `references/config.md` for `repoctl.config.ts`.
|
|
@@ -0,0 +1,243 @@
|
|
|
1
|
+
# Commands
|
|
2
|
+
|
|
3
|
+
## init
|
|
4
|
+
|
|
5
|
+
Purpose: bootstrap workspace metadata plus recommended tooling defaults.
|
|
6
|
+
Usage:
|
|
7
|
+
|
|
8
|
+
- pnpm exec repo init
|
|
9
|
+
Options:
|
|
10
|
+
- --preset <minimal|standard>: choose a lighter or fuller setup
|
|
11
|
+
- --force: overwrite existing tooling config files
|
|
12
|
+
Notes:
|
|
13
|
+
- `standard` is the default preset
|
|
14
|
+
- `minimal` currently focuses on the base TypeScript setup
|
|
15
|
+
|
|
16
|
+
## new
|
|
17
|
+
|
|
18
|
+
Purpose: create a new package or app through an intent-driven flow.
|
|
19
|
+
Usage:
|
|
20
|
+
|
|
21
|
+
- npx repoctl new
|
|
22
|
+
- npx repoctl new my-lib
|
|
23
|
+
Notes:
|
|
24
|
+
- Prompts for what you want to create first, then maps to a template
|
|
25
|
+
- `library` defaults to `packages/<name>`
|
|
26
|
+
- `web-app`, `api-service`, `docs-site`, and `cli-tool` default to `apps/<name>`
|
|
27
|
+
- Advanced users can still use `repoctl package create` or `repoctl pkg new`
|
|
28
|
+
|
|
29
|
+
## check
|
|
30
|
+
|
|
31
|
+
Purpose: run recommended local checks.
|
|
32
|
+
Usage:
|
|
33
|
+
|
|
34
|
+
- npx repoctl check
|
|
35
|
+
- npx repoctl check --staged
|
|
36
|
+
- npx repoctl check --full
|
|
37
|
+
- npx repoctl check --dry-run
|
|
38
|
+
- npx repoctl check --json --out reports/check-plan.json
|
|
39
|
+
Notes:
|
|
40
|
+
- default mode runs the lightweight local verification flow
|
|
41
|
+
- `--staged` adds staged typecheck routing
|
|
42
|
+
- `--full` maps to the heavier pre-push verification flow
|
|
43
|
+
- `--dry-run` previews the verification route without running checks
|
|
44
|
+
- `--json` and `--out <file>` emit the same plan for automation and imply dry-run
|
|
45
|
+
|
|
46
|
+
## doctor
|
|
47
|
+
|
|
48
|
+
Purpose: diagnose whether the current workspace is ready to use.
|
|
49
|
+
Usage:
|
|
50
|
+
|
|
51
|
+
- npx repoctl doctor
|
|
52
|
+
- npx repoctl doctor --json
|
|
53
|
+
- npx repoctl doctor --json --out reports/doctor.json
|
|
54
|
+
Notes:
|
|
55
|
+
- default output is human-readable
|
|
56
|
+
- `--json` emits the structured report only and still exits non-zero when blocking failures exist
|
|
57
|
+
- `--out <file>` persists the text or JSON report and still exits non-zero when blocking failures exist
|
|
58
|
+
|
|
59
|
+
## upgrade
|
|
60
|
+
|
|
61
|
+
Purpose: sync repo assets and scripts into the workspace.
|
|
62
|
+
Usage:
|
|
63
|
+
|
|
64
|
+
- npx repoctl upgrade
|
|
65
|
+
- npx repoctl workspace upgrade
|
|
66
|
+
- npx repoctl ws up
|
|
67
|
+
Options:
|
|
68
|
+
- --interactive: prompt for overwrites
|
|
69
|
+
- --core: sync core config only (skip GitHub assets)
|
|
70
|
+
- --outDir <dir>: write to another directory
|
|
71
|
+
- --skip-overwrite: never overwrite existing files
|
|
72
|
+
- --overwrite-release: explicitly replace an unmarked custom release workflow
|
|
73
|
+
|
|
74
|
+
For the first migration of an existing project, bootstrap with
|
|
75
|
+
`pnpm dlx repoctl@latest upgrade --yes`. Managed and official legacy release
|
|
76
|
+
workflows are migrated automatically; unmarked custom workflows are preserved
|
|
77
|
+
unless `--overwrite-release` is supplied.
|
|
78
|
+
|
|
79
|
+
## release ci
|
|
80
|
+
|
|
81
|
+
Purpose: provide the single GitHub Actions entrypoint for stable and prerelease orchestration.
|
|
82
|
+
Usage:
|
|
83
|
+
|
|
84
|
+
- `pnpm exec repo release ci`
|
|
85
|
+
- `pnpm exec repo release ci --mode prepare`
|
|
86
|
+
- `pnpm exec repo release ci --mode publish`
|
|
87
|
+
- `pnpm exec repo release ci --mode publish-unpublished --package <name> --version <version>`
|
|
88
|
+
|
|
89
|
+
The command uses `GITHUB_TOKEN`, `GITHUB_REPOSITORY`, `GITHUB_API_URL`, and
|
|
90
|
+
`GITHUB_SHA` to upsert the Release PR, package tags, and GitHub Releases. It
|
|
91
|
+
consumes `pnpm-publish-summary.json` and is safe to retry.
|
|
92
|
+
|
|
93
|
+
## workspace upgrade (alias: ws up)
|
|
94
|
+
|
|
95
|
+
Purpose: sync monorepo assets and scripts into the workspace.
|
|
96
|
+
Usage:
|
|
97
|
+
|
|
98
|
+
- npx repoctl workspace upgrade
|
|
99
|
+
- npx repoctl ws up
|
|
100
|
+
Options:
|
|
101
|
+
- --interactive: prompt for overwrites
|
|
102
|
+
- --core: sync core config only (skip GitHub assets)
|
|
103
|
+
- --outDir <dir>: write to another directory
|
|
104
|
+
- --skip-overwrite: never overwrite existing files
|
|
105
|
+
|
|
106
|
+
## workspace init (alias: ws init)
|
|
107
|
+
|
|
108
|
+
Purpose: initialize workspace metadata such as README, package.json, pnpm change intent support, and issue template.
|
|
109
|
+
Usage:
|
|
110
|
+
|
|
111
|
+
- pnpm exec repo init
|
|
112
|
+
- npx repoctl workspace init
|
|
113
|
+
- npx repoctl ws init
|
|
114
|
+
|
|
115
|
+
## workspace list (alias: ws ls)
|
|
116
|
+
|
|
117
|
+
Purpose: list workspace packages for inspection or automation.
|
|
118
|
+
Usage:
|
|
119
|
+
|
|
120
|
+
- npx repoctl workspace list
|
|
121
|
+
- npx repoctl ws ls --json
|
|
122
|
+
- npx repoctl ws ls --json --out reports/workspaces.json
|
|
123
|
+
Options:
|
|
124
|
+
- --json: emit structured workspace summary data
|
|
125
|
+
- --out <file>: persist the current text or JSON output
|
|
126
|
+
- --include-private: include private packages
|
|
127
|
+
- --include-root: include the workspace root package
|
|
128
|
+
- --pattern <glob>: add custom workspace globs; repeatable
|
|
129
|
+
|
|
130
|
+
## tooling init (alias: tg init)
|
|
131
|
+
|
|
132
|
+
Purpose: generate tooling config files plus matching devDependencies.
|
|
133
|
+
Usage:
|
|
134
|
+
|
|
135
|
+
- npx repoctl tooling init
|
|
136
|
+
- npx repoctl tooling init eslint tsconfig vitest
|
|
137
|
+
- npx repoctl tg init --all
|
|
138
|
+
Options:
|
|
139
|
+
- --all: generate every built-in tooling config
|
|
140
|
+
- --force: overwrite existing tooling config files
|
|
141
|
+
Notes:
|
|
142
|
+
- Built-in tooling targets: commitlint, eslint, stylelint, lint-staged, tsconfig, vitest
|
|
143
|
+
- Generated files also update root package.json devDependencies
|
|
144
|
+
|
|
145
|
+
## workspace clean (alias: ws clean)
|
|
146
|
+
|
|
147
|
+
Purpose: remove selected packages and update the repo helper package version.
|
|
148
|
+
Usage:
|
|
149
|
+
|
|
150
|
+
- npx repoctl workspace clean
|
|
151
|
+
- npx repoctl ws clean
|
|
152
|
+
Options:
|
|
153
|
+
- --yes: auto confirm
|
|
154
|
+
- --include-private
|
|
155
|
+
- --pinned-version <version>
|
|
156
|
+
|
|
157
|
+
## env info (alias: e i)
|
|
158
|
+
|
|
159
|
+
Purpose: print environment details for debugging and automation.
|
|
160
|
+
Usage:
|
|
161
|
+
|
|
162
|
+
- npx repoctl env info
|
|
163
|
+
- npx repoctl e i --json
|
|
164
|
+
- npx repoctl env info --json --out reports/env.json
|
|
165
|
+
Options:
|
|
166
|
+
- --json: emit structured environment info
|
|
167
|
+
- --out <file>: persist the current text or JSON output
|
|
168
|
+
Notes:
|
|
169
|
+
- Includes cwd, workspace root, package manager, Node version, pnpm version,
|
|
170
|
+
platform, arch, and workspace package count.
|
|
171
|
+
|
|
172
|
+
## env snapshot (alias: e s)
|
|
173
|
+
|
|
174
|
+
Purpose: collect a combined debugging snapshot for issues, CI artifacts, or editor integrations.
|
|
175
|
+
Usage:
|
|
176
|
+
|
|
177
|
+
- npx repoctl env snapshot
|
|
178
|
+
- npx repoctl e s --json
|
|
179
|
+
- npx repoctl env snapshot --json --out reports/snapshot.json
|
|
180
|
+
Options:
|
|
181
|
+
- --json: emit structured snapshot data
|
|
182
|
+
- --out <file>: persist the current text or JSON output
|
|
183
|
+
Notes:
|
|
184
|
+
- Includes `env info`, `doctor` report data, and the default `check` plan.
|
|
185
|
+
|
|
186
|
+
## env mirror (alias: e m)
|
|
187
|
+
|
|
188
|
+
Purpose: set VSCode binary mirror env.
|
|
189
|
+
Usage:
|
|
190
|
+
|
|
191
|
+
- npx repoctl env mirror
|
|
192
|
+
- npx repoctl e m
|
|
193
|
+
|
|
194
|
+
## skills sync
|
|
195
|
+
|
|
196
|
+
Purpose: sync the `repoctl` skill into global agent skill directories.
|
|
197
|
+
Usage:
|
|
198
|
+
|
|
199
|
+
- pnpm exec repo skills sync
|
|
200
|
+
- pnpm exec repo skills sync --codex
|
|
201
|
+
- pnpm exec repo skills sync --claude
|
|
202
|
+
- pnpm exec repo skills sync --cursor
|
|
203
|
+
- pnpm exec repo skills sync --agents
|
|
204
|
+
- pnpm exec repo skills sync --grok
|
|
205
|
+
- pnpm exec repo skills sync --all
|
|
206
|
+
|
|
207
|
+
## ai prompt create (aliases: ai p create, ai p new)
|
|
208
|
+
|
|
209
|
+
Purpose: generate agentic prompt templates.
|
|
210
|
+
Usage:
|
|
211
|
+
|
|
212
|
+
- npx repoctl ai prompt create
|
|
213
|
+
- npx repoctl ai p new --name checkout
|
|
214
|
+
- npx repoctl ai prompt create --tasks agentic/tasks.json --format md -f
|
|
215
|
+
Options:
|
|
216
|
+
- --output <path>
|
|
217
|
+
- --force
|
|
218
|
+
- --format <md|json>
|
|
219
|
+
- --dir <path>
|
|
220
|
+
- --name <name>
|
|
221
|
+
- --tasks <file>
|
|
222
|
+
Notes:
|
|
223
|
+
- If no --output or --name is set, it prompts for a folder and writes to
|
|
224
|
+
agentic/prompts/<timestamp>/prompt.md.
|
|
225
|
+
- If --tasks is used, it expects a JSON array of strings or objects.
|
|
226
|
+
|
|
227
|
+
## package create (alias: pkg new)
|
|
228
|
+
|
|
229
|
+
Purpose: create a new package from a template.
|
|
230
|
+
Usage:
|
|
231
|
+
|
|
232
|
+
- npx repoctl new
|
|
233
|
+
- npx repoctl package create [path]
|
|
234
|
+
- npx repoctl pkg new [path]
|
|
235
|
+
Notes:
|
|
236
|
+
- Prefer `repoctl new` for the lower-cost guided flow.
|
|
237
|
+
- Prompts for a template choice unless defaults are set in repoctl.config.ts or monorepo.config.ts.
|
|
238
|
+
- Explicit `--template` values are validated before writing files. Unknown keys
|
|
239
|
+
fail with the closest suggestion instead of silently falling back.
|
|
240
|
+
- Use `--json` to print the resolved create plan for automation. It implies
|
|
241
|
+
`--dry-run` and does not write files.
|
|
242
|
+
- Add `--out <file>` to write the preview or JSON plan to disk. It also implies
|
|
243
|
+
`--dry-run`.
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
# repoctl.config.ts
|
|
2
|
+
|
|
3
|
+
Preferred filename: `repoctl.config.ts`
|
|
4
|
+
|
|
5
|
+
Compatible legacy filename: `monorepo.config.ts`
|
|
6
|
+
|
|
7
|
+
Rule:
|
|
8
|
+
|
|
9
|
+
- `repoctl.config.*` has higher priority
|
|
10
|
+
- `monorepo.config.*` remains supported
|
|
11
|
+
- if both exist at the same time, CLI loading fails fast with an error
|
|
12
|
+
|
|
13
|
+
Use `defineMonorepoConfig` to set default options for CLI commands.
|
|
14
|
+
Only include the fields you need.
|
|
15
|
+
|
|
16
|
+
Example:
|
|
17
|
+
|
|
18
|
+
```ts
|
|
19
|
+
import { defineMonorepoConfig } from 'repoctl'
|
|
20
|
+
|
|
21
|
+
export default defineMonorepoConfig({
|
|
22
|
+
commands: {
|
|
23
|
+
ai: {
|
|
24
|
+
baseDir: 'agentic/prompts',
|
|
25
|
+
format: 'md',
|
|
26
|
+
force: false,
|
|
27
|
+
tasksFile: 'agentic/tasks.json',
|
|
28
|
+
},
|
|
29
|
+
create: {
|
|
30
|
+
defaultTemplate: 'tsdown',
|
|
31
|
+
renameJson: false,
|
|
32
|
+
templatesDir: 'packages/monorepo/templates',
|
|
33
|
+
},
|
|
34
|
+
clean: {
|
|
35
|
+
autoConfirm: false,
|
|
36
|
+
ignorePackages: ['docs'],
|
|
37
|
+
includePrivate: true,
|
|
38
|
+
pinnedVersion: 'latest',
|
|
39
|
+
},
|
|
40
|
+
upgrade: {
|
|
41
|
+
skipOverwrite: false,
|
|
42
|
+
targets: ['.github', 'repoctl.config.ts'],
|
|
43
|
+
mergeTargets: true,
|
|
44
|
+
},
|
|
45
|
+
init: {
|
|
46
|
+
skipReadme: false,
|
|
47
|
+
skipPkgJson: false,
|
|
48
|
+
skipChangeset: false,
|
|
49
|
+
skipIssueTemplateConfig: false,
|
|
50
|
+
},
|
|
51
|
+
mirror: {
|
|
52
|
+
env: {
|
|
53
|
+
VSCode_CLI_MIRROR: 'https://example.invalid',
|
|
54
|
+
},
|
|
55
|
+
},
|
|
56
|
+
},
|
|
57
|
+
})
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
Key areas:
|
|
61
|
+
|
|
62
|
+
- ai: default output, format, batch tasks
|
|
63
|
+
- create: default template and template directory
|
|
64
|
+
- clean: auto confirm and pinned version control
|
|
65
|
+
- upgrade: overwrite behavior and extra targets
|
|
66
|
+
- init: skip steps for README/package.json/pnpm change intent setup
|
|
67
|
+
- mirror: add or override env mirrors
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# Templates
|
|
2
|
+
|
|
3
|
+
Prefer `repo new [name]` for the guided flow. For agents, pass `--template`
|
|
4
|
+
explicitly so the command does not prompt.
|
|
5
|
+
|
|
6
|
+
Intent defaults:
|
|
7
|
+
|
|
8
|
+
- library -> `tsdown` -> `packages/<name>`
|
|
9
|
+
- web-app -> `vue-hono` -> `apps/<name>`
|
|
10
|
+
- api-service -> `hono-server` -> `apps/<name>`
|
|
11
|
+
- docs-site -> `vitepress` -> `apps/<name>`
|
|
12
|
+
- cli-tool -> `cli` -> `apps/<name>`
|
|
13
|
+
|
|
14
|
+
Run `repo templates` to discover template keys, categories, default targets, and
|
|
15
|
+
descriptions. Use `repo templates <key>` for a single template detail page, and
|
|
16
|
+
`repo templates --json` when scripting. Use `repo templates --check` to verify
|
|
17
|
+
template metadata, directories, package.json files, duplicate targets, and
|
|
18
|
+
temporary files; combine it with `--json` for CI. Use `repo templates --markdown`
|
|
19
|
+
or `repo templates <key> --markdown` when generating documentation snippets.
|
|
20
|
+
Add `--out <file>` to write the selected output to disk.
|
|
21
|
+
|
|
22
|
+
Use `repo new <name> --template <key> --dry-run` to preview the target directory
|
|
23
|
+
and package metadata without writing files. Use `repo new <name> --template <key>
|
|
24
|
+
--json` when a script needs the same create plan as structured data; `--json`
|
|
25
|
+
implies `--dry-run`. Add `--out <file>` to write either preview format to disk.
|
|
26
|
+
|
|
27
|
+
Explicit template keys are validated before any files are written. If a key is
|
|
28
|
+
misspelled, the CLI fails and prints the closest known key when one is available.
|
|
29
|
+
|
|
30
|
+
Advanced users can still use `repo package create [path]` or `repo pkg new [path]`
|
|
31
|
+
to select templates directly.
|
|
32
|
+
|
|
33
|
+
Built-in template map:
|
|
34
|
+
|
|
35
|
+
- tsdown -> templates/tsdown => packages/tsdown
|
|
36
|
+
- vue-lib -> templates/vue-lib => packages/vue-lib
|
|
37
|
+
- hono-server -> templates/server => apps/server
|
|
38
|
+
- vue-hono -> templates/client => apps/client
|
|
39
|
+
- vitepress -> templates/vitepress => apps/website
|
|
40
|
+
- cli -> templates/cli => apps/cli
|
|
41
|
+
|
|
42
|
+
Notes:
|
|
43
|
+
|
|
44
|
+
- The command prompts for template selection unless defaults are set in
|
|
45
|
+
repoctl.config.ts or monorepo.config.ts.
|
|
46
|
+
- Override mappings with `commands.create.templateMap` and `commands.create.templatesDir`.
|
package/assets/AGENTS.md
CHANGED
|
@@ -1,53 +1,42 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Agent instructions
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
This workspace is managed by **repoctl**. The recommended command is `repo`.
|
|
4
|
+
Use `repoctl` only when a longer executable name is clearer. Do not treat this
|
|
5
|
+
repository as the repoctl source project.
|
|
4
6
|
|
|
5
|
-
|
|
7
|
+
## Create packages and apps
|
|
6
8
|
|
|
7
|
-
|
|
9
|
+
```bash
|
|
10
|
+
pnpm exec repo templates
|
|
11
|
+
pnpm exec repo new <name> --template <key>
|
|
12
|
+
```
|
|
8
13
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
| Intent | Template key |
|
|
15
|
+
| ------------------------ | ------------- |
|
|
16
|
+
| Vue / full-stack web app | `vue-hono` |
|
|
17
|
+
| API / Hono service | `hono-server` |
|
|
18
|
+
| TypeScript library / SDK | `tsdown` |
|
|
19
|
+
| Vue component library | `vue-lib` |
|
|
20
|
+
| Documentation site | `vitepress` |
|
|
21
|
+
| CLI | `cli` |
|
|
16
22
|
|
|
17
|
-
|
|
23
|
+
Preview without writing files: `pnpm exec repo new <name> --template <key> --dry-run`.
|
|
18
24
|
|
|
19
|
-
|
|
25
|
+
## Verify
|
|
20
26
|
|
|
21
|
-
|
|
27
|
+
```bash
|
|
28
|
+
pnpm exec repo doctor
|
|
29
|
+
pnpm exec repo check
|
|
30
|
+
```
|
|
22
31
|
|
|
23
|
-
|
|
32
|
+
## Do not
|
|
24
33
|
|
|
25
|
-
|
|
34
|
+
- Do not add packages by copying folders. Use `repo new`.
|
|
35
|
+
- Do not hand-edit managed root configs that `repo init` / `repo upgrade` own.
|
|
36
|
+
- Do not invent publish versions by hand. Use `pnpm change` for publishable packages.
|
|
26
37
|
|
|
27
|
-
|
|
28
|
-
Generated Vue files or other SFC files that include style blocks are also required to pass Stylelint checks.
|
|
38
|
+
## Requirements
|
|
29
39
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
Before running tests, build the packages first and run tests against build artifacts instead of source-only execution to better match real delivery behavior.
|
|
35
|
-
|
|
36
|
-
TypeScript issues must be fixed before commit. Do not commit with unresolved TypeScript compile or type-check errors.
|
|
37
|
-
|
|
38
|
-
TypeScript code must be validated with the relevant workspace `typecheck` script and must not contain type errors. Pure TypeScript workspaces are expected to validate with `tsc` (`pnpm typecheck` or `tsc -p tsconfig.json`). Vue workspaces are expected to validate with `vue-tsc` (typically `vue-tsc -b`).
|
|
39
|
-
|
|
40
|
-
When building TypeScript libraries (type-focused APIs or public type definitions), add and maintain `tsd` type tests to verify exported type behavior.
|
|
41
|
-
|
|
42
|
-
## Commit & Pull Request Guidelines
|
|
43
|
-
|
|
44
|
-
Commits must conform to Conventional Commit syntax; recent history uses prefixes like `feat`, `fix`, and `chore`. Example: `feat(server): add auth router`. Use `pnpm commit` (commitlint prompt) or ensure your manual message passes `pnpm commitlint --edit`. Before opening a PR, make sure `pnpm lint` and `pnpm test` succeed, link related issues, and provide screenshots or logs for user-facing changes. Touching publishable packages requires a pnpm change intent (`pnpm change`) so releases stay traceable.
|
|
45
|
-
|
|
46
|
-
For AI-generated or AI-assisted changes, use this verification order before commit or PR:
|
|
47
|
-
|
|
48
|
-
1. Run build first (`pnpm build` or the relevant workspace build command).
|
|
49
|
-
2. Run lint checks, ensuring all changed JavaScript, TypeScript, and Vue code passes ESLint and all style-related code passes Stylelint.
|
|
50
|
-
3. Run TypeScript checks and fix all type errors before proceeding. Vue workspaces must pass `vue-tsc`; TypeScript workspaces must pass `tsc`.
|
|
51
|
-
4. For TypeScript libraries, run `tsd` type tests and fix all failures before proceeding.
|
|
52
|
-
5. Run tests against built artifacts, including unit, integration, and E2E suites (when available in the affected workspace).
|
|
53
|
-
6. Before commit, review whether the touched files need splitting or refactoring; do not commit avoidable large-file growth when a clearer module boundary is apparent.
|
|
40
|
+
- Node.js 22.13 or newer
|
|
41
|
+
- pnpm
|
|
42
|
+
- CLI output is English by default; `--lang zh-CN` or `REPOCTL_LANG=zh-CN` selects Simplified Chinese
|
package/assets/CLAUDE.md
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# Agent instructions
|
|
2
|
+
|
|
3
|
+
This workspace is managed by **repoctl**. The recommended command is `repo`.
|
|
4
|
+
|
|
5
|
+
Follow `AGENTS.md` in the workspace root. Create packages with
|
|
6
|
+
`pnpm exec repo new <name> --template <key>`. Verify with
|
|
7
|
+
`pnpm exec repo doctor` and `pnpm exec repo check`.
|
|
8
|
+
|
|
9
|
+
If you were asked to create a new business project, do not add it inside an
|
|
10
|
+
existing unrelated repository. Use:
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
pnpm create repoctl <dir> -- --yes --templates <keys>
|
|
14
|
+
```
|
package/assets/package.json
CHANGED
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
"packageManager": "pnpm@12.3.4",
|
|
7
7
|
"description": "Source workspace for repoctl and Icebreaker's shared development packages",
|
|
8
8
|
"author": "ice breaker <hi@sonofmagic.top>",
|
|
9
|
+
"license": "MIT",
|
|
9
10
|
"homepage": "https://repoctl.icebreaker.top",
|
|
10
11
|
"repository": {
|
|
11
12
|
"type": "git",
|
|
@@ -71,66 +72,25 @@
|
|
|
71
72
|
},
|
|
72
73
|
"devDependencies": {
|
|
73
74
|
"@commitlint/cli": "^21.2.2",
|
|
74
|
-
"@eslint/config-inspector": "^3.4.
|
|
75
|
-
"@eslint/eslintrc": "^3.3.7",
|
|
75
|
+
"@eslint/config-inspector": "^3.4.1",
|
|
76
76
|
"@icebreakers/commitlint-config": "workspace:*",
|
|
77
77
|
"@icebreakers/eslint-config": "workspace:*",
|
|
78
78
|
"@icebreakers/monorepo": "workspace:*",
|
|
79
79
|
"@icebreakers/stylelint-config": "workspace:*",
|
|
80
|
-
"@
|
|
81
|
-
"@prettier/plugin-xml": "^3.4.2",
|
|
82
|
-
"@tanstack/eslint-plugin-query": "^5.102.8",
|
|
83
|
-
"@types/eslint-plugin-tailwindcss": "^3.17.0",
|
|
84
|
-
"@types/fs-extra": "^11.0.4",
|
|
85
|
-
"@types/lodash": "^4.17.25",
|
|
86
|
-
"@types/lodash-es": "^4.17.12",
|
|
87
|
-
"@types/micromatch": "^4.0.10",
|
|
88
|
-
"@types/node": "^26.5.0",
|
|
89
|
-
"@types/semver": "^7.8.0",
|
|
90
|
-
"@types/set-value": "^4.0.3",
|
|
91
|
-
"@typescript-eslint/types": "^8.70.0",
|
|
92
|
-
"@unocss/eslint-plugin": "66.10.0",
|
|
80
|
+
"@types/node": "^26.5.1",
|
|
93
81
|
"@vitest/coverage-v8": "~5.0.0",
|
|
94
|
-
"astro-eslint-parser": "^3.1.0",
|
|
95
|
-
"ci-info": "^4.4.0",
|
|
96
|
-
"cross-env": "^10.1.0",
|
|
97
|
-
"defu": "^6.1.7",
|
|
98
|
-
"es-toolkit": "^1.52.0",
|
|
99
82
|
"eslint": "^10.10.0",
|
|
100
|
-
"eslint-plugin-astro": "^3.1.0",
|
|
101
|
-
"eslint-plugin-mdx": "3.8.1",
|
|
102
|
-
"eslint-plugin-svelte": "^3.23.0",
|
|
103
83
|
"execa": "^10.0.1",
|
|
104
|
-
"fast-glob": "^3.3.3",
|
|
105
|
-
"fs-extra": "^11.4.0",
|
|
106
|
-
"get-value": "^4.1.0",
|
|
107
84
|
"husky": "^9.1.7",
|
|
108
|
-
"
|
|
109
|
-
"lint-staged": "^17.5.0",
|
|
110
|
-
"lodash": "^4.18.1",
|
|
111
|
-
"lodash-es": "^4.18.1",
|
|
112
|
-
"micromatch": "^4.0.8",
|
|
85
|
+
"lint-staged": "^17.5.1",
|
|
113
86
|
"only-allow": "^1.2.2",
|
|
114
|
-
"pathe": "^2.0.3",
|
|
115
|
-
"pkg-types": "^2.3.3",
|
|
116
|
-
"prettier": "^3.9.6",
|
|
117
|
-
"prettier-plugin-astro": "^0.14.1",
|
|
118
87
|
"repoctl": "workspace:*",
|
|
119
|
-
"rimraf": "^6.1.3",
|
|
120
|
-
"set-value": "^4.1.0",
|
|
121
88
|
"stylelint": "^17.15.0",
|
|
122
|
-
"svelte": "^5.57.0",
|
|
123
|
-
"svelte-eslint-parser": "^1.8.1",
|
|
124
89
|
"tailwindcss": "^4.3.3",
|
|
125
90
|
"tsd": "^0.33.0",
|
|
126
91
|
"tsdown": "0.23.0",
|
|
127
|
-
"tslib": "^2.8.1",
|
|
128
|
-
"tsup": "^8.5.1",
|
|
129
|
-
"tsx": "^4.23.13",
|
|
130
92
|
"turbo": "^2.10.12",
|
|
131
|
-
"type-fest": "^5.9.0",
|
|
132
93
|
"typescript": "^6.0.3",
|
|
133
|
-
"unbuild": "^3.6.1",
|
|
134
94
|
"vitest": "~5.0.0",
|
|
135
95
|
"yaml": "^2.9.0"
|
|
136
96
|
},
|
package/assets-data.mjs
CHANGED
package/dist/cli.mjs
CHANGED
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-
|
|
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-zIcRa4-K.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";
|
|
@@ -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",
|
|
@@ -204,11 +206,23 @@ function removeSourceRepoReleaseToolingBuildStepContent(content) {
|
|
|
204
206
|
}
|
|
205
207
|
function sanitizePublishedWorkspaceContent(content) {
|
|
206
208
|
const workspace = YAML.parse(content);
|
|
207
|
-
if (!workspace
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
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;
|
|
212
226
|
}
|
|
213
227
|
async function pathExists(targetPath) {
|
|
214
228
|
try {
|
|
@@ -272,12 +286,13 @@ async function copyEntry(from, to, overwriteExisting, filter) {
|
|
|
272
286
|
throw error;
|
|
273
287
|
}
|
|
274
288
|
}
|
|
289
|
+
const publishedAgentSourceFiles = /* @__PURE__ */ new Set(["AGENTS.md", "CLAUDE.md"]);
|
|
275
290
|
async function copyAssets(repoRoot, overwriteExisting) {
|
|
276
291
|
const monorepoAssetRoot = path$1.resolve(repoRoot, "packages/monorepo/assets");
|
|
277
292
|
for (const target of assetTargets) {
|
|
278
293
|
const packageAsset = path$1.join(monorepoAssetRoot, toPublishGitignorePath(target));
|
|
279
294
|
const repoAsset = path$1.join(repoRoot, target);
|
|
280
|
-
const from = await pathExists(repoAsset) ?
|
|
295
|
+
const from = publishedAgentSourceFiles.has(target) || !await pathExists(repoAsset) ? packageAsset : repoAsset;
|
|
281
296
|
if (!await pathExists(from)) continue;
|
|
282
297
|
const to = path$1.join(assetsDir, toPublishGitignorePath(target));
|
|
283
298
|
const stats = await fs.stat(from);
|
|
@@ -295,6 +310,11 @@ async function writePublishedToolingConfigs() {
|
|
|
295
310
|
if (await pathExists(targetPath)) await fs.writeFile(targetPath, content);
|
|
296
311
|
}));
|
|
297
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
|
+
}
|
|
298
318
|
async function sanitizePublishedWorkspace() {
|
|
299
319
|
const workspacePath = path$1.join(assetsDir, "pnpm-workspace.yaml");
|
|
300
320
|
if (!await pathExists(workspacePath)) return;
|
|
@@ -344,6 +364,7 @@ async function prepareAssets(options = {}) {
|
|
|
344
364
|
await sanitizePublishedWorkspace();
|
|
345
365
|
await removePublishedReleaseState();
|
|
346
366
|
await writePublishedToolingConfigs();
|
|
367
|
+
await writePublishedAgentSkill(repoRoot, overwriteExisting);
|
|
347
368
|
await removeSourceRepoReleaseToolingBuildStep();
|
|
348
369
|
await removeSourceRepoWorkerTypeChecks();
|
|
349
370
|
await copyTemplates(repoRoot, overwriteExisting);
|
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,6 +21,9 @@
|
|
|
19
21
|
"cloudflare",
|
|
20
22
|
"template"
|
|
21
23
|
],
|
|
24
|
+
"engines": {
|
|
25
|
+
"node": ">=22.13.0"
|
|
26
|
+
},
|
|
22
27
|
"scripts": {
|
|
23
28
|
"dev": "pnpm cf-typegen && vite --host",
|
|
24
29
|
"build": "pnpm cf-typegen && vue-tsc -b && vite build",
|
|
@@ -35,7 +40,7 @@
|
|
|
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
37
|
"dev": "pnpm cf-typegen && wrangler dev",
|
|
35
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",
|
|
@@ -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
|
}
|
|
@@ -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 工具里怎么用
|
|
@@ -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: [
|