@icebreakers/monorepo-templates 1.0.15 → 1.2.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/README.md +12 -8
- package/README.zh-CN.md +16 -0
- package/assets/.changeset/ledger.yaml +51 -0
- package/assets/.github/ISSUE_TEMPLATE/config.yml +1 -1
- package/assets/.github/workflows/release.yml +22 -97
- package/assets/AGENTS.md +5 -4
- package/assets/CONTRIBUTING.md +27 -2
- package/assets/SECURITY.md +12 -14
- package/assets/package.json +18 -10
- package/assets/pnpm-workspace.yaml +8 -0
- package/package.json +6 -4
- package/templates/cli/package.json +11 -4
- package/templates/client/package.json +22 -6
- package/templates/server/package.json +14 -7
- package/templates/server/vitest.config.ts +1 -4
- package/templates/tsdown/package.json +11 -4
- package/templates/tsdown/vitest.config.ts +1 -4
- package/templates/vitepress/.vitepress/config.ts +146 -165
- package/templates/vitepress/ai/index.md +12 -23
- package/templates/vitepress/ai/llms-txt.md +13 -31
- package/templates/vitepress/getting-started.md +3 -32
- package/templates/vitepress/index.md +27 -30
- package/templates/vitepress/knowledge/index.md +17 -41
- package/templates/vitepress/monorepo/commands.md +13 -18
- package/templates/vitepress/monorepo/index.md +22 -100
- package/templates/vitepress/monorepo/manage.md +15 -227
- package/templates/vitepress/monorepo/publish.md +17 -245
- package/templates/vitepress/monorepo/templates.md +10 -17
- package/templates/vitepress/monorepo/troubleshooting.md +13 -16
- package/templates/vitepress/package.json +11 -5
- package/templates/vitepress/public/_redirects +3 -0
- package/templates/vitepress/repoctl/adopt-existing.md +51 -53
- package/templates/vitepress/repoctl/aliases.md +18 -18
- package/templates/vitepress/repoctl/checks.md +21 -68
- package/templates/vitepress/repoctl/commands.md +16 -64
- package/templates/vitepress/repoctl/config.md +14 -35
- package/templates/vitepress/repoctl/doctor.md +20 -60
- package/templates/vitepress/repoctl/execution-model.md +16 -69
- package/templates/vitepress/repoctl/getting-started.md +34 -40
- package/templates/vitepress/repoctl/index.md +33 -61
- package/templates/vitepress/repoctl/reports.md +20 -74
- package/templates/vitepress/repoctl/scenarios.md +26 -28
- package/templates/vitepress/repoctl/template-assets.md +19 -88
- package/templates/vitepress/repoctl/templates.md +50 -81
- package/templates/vitepress/repoctl/troubleshooting.md +32 -46
- package/templates/vitepress/repoctl/workflows.md +38 -67
- package/templates/vitepress/thinking.md +4 -85
- package/templates/vitepress/tools/changeset.md +12 -85
- package/templates/vitepress/tools/husky.md +6 -124
- package/templates/vitepress/tools/index.md +13 -32
- package/templates/vitepress/tools/lint-staged.md +5 -96
- package/templates/vitepress/tools/llms-txt.md +4 -6
- package/templates/vitepress/tools/pnpm.md +7 -119
- package/templates/vitepress/tools/renovate.md +3 -87
- package/templates/vitepress/tools/turborepo.md +5 -157
- package/templates/vitepress/why/how-to-reuse-js-code.md +6 -247
- package/templates/vitepress/why/index.md +14 -1
- package/templates/vitepress/why/js-cjs-mjs.md +9 -96
- package/templates/vitepress/why/js-keywords.md +4 -129
- package/templates/vitepress/why/modern/bundlers.md +3 -50
- package/templates/vitepress/why/modern/dts.md +4 -90
- package/templates/vitepress/why/modern/esm-vs-cjs.md +4 -81
- package/templates/vitepress/why/modern/index.md +10 -51
- package/templates/vitepress/why/modern/package-entry-points.md +6 -117
- package/templates/vitepress/why/modern/typescript.md +4 -152
- package/templates/vitepress/why/publish-basic-npm-package.md +17 -144
- package/templates/vitepress/why/what-is-npm-package.md +4 -159
- package/templates/vitepress/zh/ai/index.md +33 -0
- package/templates/vitepress/zh/ai/llms-txt.md +42 -0
- package/templates/vitepress/zh/getting-started.md +40 -0
- package/templates/vitepress/zh/index.md +66 -0
- package/templates/vitepress/zh/knowledge/index.md +50 -0
- package/templates/vitepress/zh/monorepo/commands.md +21 -0
- package/templates/vitepress/zh/monorepo/index.md +115 -0
- package/templates/vitepress/zh/monorepo/manage.md +243 -0
- package/templates/vitepress/zh/monorepo/publish.md +87 -0
- package/templates/vitepress/zh/monorepo/templates.md +21 -0
- package/templates/vitepress/zh/monorepo/troubleshooting.md +20 -0
- package/templates/vitepress/zh/repoctl/adopt-existing.md +135 -0
- package/templates/vitepress/{en → zh}/repoctl/aliases.md +18 -18
- package/templates/vitepress/zh/repoctl/checks.md +86 -0
- package/templates/vitepress/zh/repoctl/commands.md +168 -0
- package/templates/vitepress/zh/repoctl/config.md +90 -0
- package/templates/vitepress/zh/repoctl/doctor.md +86 -0
- package/templates/vitepress/zh/repoctl/execution-model.md +81 -0
- package/templates/vitepress/zh/repoctl/getting-started.md +122 -0
- package/templates/vitepress/zh/repoctl/index.md +102 -0
- package/templates/vitepress/zh/repoctl/reports.md +94 -0
- package/templates/vitepress/{en → zh}/repoctl/scenarios.md +28 -26
- package/templates/vitepress/zh/repoctl/template-assets.md +116 -0
- package/templates/vitepress/zh/repoctl/templates.md +159 -0
- package/templates/vitepress/zh/repoctl/troubleshooting.md +110 -0
- package/templates/vitepress/zh/repoctl/workflows.md +118 -0
- package/templates/vitepress/zh/thinking.md +88 -0
- package/templates/vitepress/zh/tools/changeset.md +75 -0
- package/templates/vitepress/zh/tools/husky.md +130 -0
- package/templates/vitepress/zh/tools/index.md +38 -0
- package/templates/vitepress/zh/tools/lint-staged.md +103 -0
- package/templates/vitepress/zh/tools/llms-txt.md +9 -0
- package/templates/vitepress/zh/tools/pnpm.md +127 -0
- package/templates/vitepress/zh/tools/renovate.md +91 -0
- package/templates/vitepress/zh/tools/turborepo.md +166 -0
- package/templates/vitepress/zh/why/assets/npm-dt.svg +15 -0
- package/templates/vitepress/zh/why/assets/npm-ts.svg +19 -0
- package/templates/vitepress/zh/why/examples/0.npm-basic-package/index.js +10 -0
- package/templates/vitepress/zh/why/examples/0.npm-basic-package/package.json +11 -0
- package/templates/vitepress/zh/why/examples/1.npm-basic-package/index.cjs +12 -0
- package/templates/vitepress/zh/why/examples/1.npm-basic-package/index.d.ts +1 -0
- package/templates/vitepress/zh/why/examples/1.npm-basic-package/index.js +8 -0
- package/templates/vitepress/zh/why/examples/1.npm-basic-package/package.json +19 -0
- package/templates/vitepress/zh/why/examples/2.npm-basic-package/README.md +1 -0
- package/templates/vitepress/zh/why/examples/2.npm-basic-package/package-lock.json +30 -0
- package/templates/vitepress/zh/why/examples/2.npm-basic-package/package.json +35 -0
- package/templates/vitepress/zh/why/examples/2.npm-basic-package/rename-ext.js +24 -0
- package/templates/vitepress/zh/why/examples/2.npm-basic-package/src/index.ts +8 -0
- package/templates/vitepress/zh/why/examples/2.npm-basic-package/tsconfig.cjs.json +8 -0
- package/templates/vitepress/zh/why/examples/2.npm-basic-package/tsconfig.esm.json +7 -0
- package/templates/vitepress/zh/why/examples/2.npm-basic-package/tsconfig.json +18 -0
- package/templates/vitepress/zh/why/examples/3.npm-basic-package/README.md +1 -0
- package/templates/vitepress/zh/why/examples/3.npm-basic-package/package-lock.json +1496 -0
- package/templates/vitepress/zh/why/examples/3.npm-basic-package/package.json +31 -0
- package/templates/vitepress/zh/why/examples/3.npm-basic-package/src/index.ts +8 -0
- package/templates/vitepress/zh/why/examples/3.npm-basic-package/tsconfig.json +16 -0
- package/templates/vitepress/zh/why/examples/3.npm-basic-package/tsdown.config.ts +16 -0
- package/templates/vitepress/zh/why/examples/usage-cjs/cjs.cjs +4 -0
- package/templates/vitepress/zh/why/examples/usage-cjs/esm.mjs +4 -0
- package/templates/vitepress/zh/why/examples/usage-cjs/index.js +8 -0
- package/templates/vitepress/zh/why/examples/usage-cjs/package-lock.json +36 -0
- package/templates/vitepress/zh/why/examples/usage-cjs/package.json +20 -0
- package/templates/vitepress/zh/why/examples/usage-esm/cjs.cjs +4 -0
- package/templates/vitepress/zh/why/examples/usage-esm/createRequire.js +7 -0
- package/templates/vitepress/zh/why/examples/usage-esm/esm.mjs +4 -0
- package/templates/vitepress/zh/why/examples/usage-esm/index.js +8 -0
- package/templates/vitepress/zh/why/examples/usage-esm/package-lock.json +36 -0
- package/templates/vitepress/zh/why/examples/usage-esm/package.json +21 -0
- package/templates/vitepress/zh/why/how-to-reuse-js-code.md +250 -0
- package/templates/vitepress/zh/why/index.md +1 -0
- package/templates/vitepress/zh/why/js-cjs-mjs.md +99 -0
- package/templates/vitepress/zh/why/js-keywords.md +132 -0
- package/templates/vitepress/zh/why/modern/bundlers.md +52 -0
- package/templates/vitepress/zh/why/modern/dts.md +93 -0
- package/templates/vitepress/zh/why/modern/esm-vs-cjs.md +84 -0
- package/templates/vitepress/zh/why/modern/index.md +55 -0
- package/templates/vitepress/zh/why/modern/package-entry-points.md +128 -0
- package/templates/vitepress/zh/why/modern/typescript.md +155 -0
- package/templates/vitepress/zh/why/publish-basic-npm-package.md +146 -0
- package/templates/vitepress/zh/why/what-is-npm-package.md +162 -0
- package/templates/vue-lib/package.json +12 -5
- package/templates/vue-lib/vitest.config.ts +1 -1
- package/assets/.changeset/config.json +0 -21
- package/assets/.changeset/publish-versioned-packages.md +0 -5
- package/templates/vitepress/en/index.md +0 -63
- package/templates/vitepress/en/knowledge/monorepo.md +0 -37
- package/templates/vitepress/en/repoctl/adopt-existing.md +0 -133
- package/templates/vitepress/en/repoctl/commands.md +0 -120
- package/templates/vitepress/en/repoctl/config.md +0 -69
- package/templates/vitepress/en/repoctl/getting-started.md +0 -116
- package/templates/vitepress/en/repoctl/index.md +0 -74
- package/templates/vitepress/en/repoctl/templates.md +0 -128
- package/templates/vitepress/en/repoctl/troubleshooting.md +0 -96
- package/templates/vitepress/en/repoctl/workflows.md +0 -89
|
@@ -1,133 +0,0 @@
|
|
|
1
|
-
# Adopt Existing Repositories
|
|
2
|
-
|
|
3
|
-
repoctl is not only for newly generated repositories. It can be adopted gradually in existing pnpm workspaces by using diagnostics and conservative asset syncs.
|
|
4
|
-
|
|
5
|
-
## Good Candidates
|
|
6
|
-
|
|
7
|
-
A repository is a good fit when:
|
|
8
|
-
|
|
9
|
-
- It already uses pnpm, or is ready to move to pnpm.
|
|
10
|
-
- It has a root `package.json`.
|
|
11
|
-
- It can use workspace folders such as `apps/*`, `packages/*`, or `examples/*`.
|
|
12
|
-
- The team wants stable daily entries such as `repo:init`, `repo:doctor`, `repo:new`, and `repo:check`.
|
|
13
|
-
|
|
14
|
-
If the repository is not yet a pnpm workspace, start with a minimal `pnpm-workspace.yaml`:
|
|
15
|
-
|
|
16
|
-
```yaml
|
|
17
|
-
packages:
|
|
18
|
-
- apps/*
|
|
19
|
-
- packages/*
|
|
20
|
-
```
|
|
21
|
-
|
|
22
|
-
## Step 1: Install And Setup
|
|
23
|
-
|
|
24
|
-
```bash
|
|
25
|
-
pnpm add -D repoctl
|
|
26
|
-
pnpm exec repo init --yes
|
|
27
|
-
```
|
|
28
|
-
|
|
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
|
-
|
|
31
|
-
## Step 2: Save The First Diagnostic Report
|
|
32
|
-
|
|
33
|
-
```bash
|
|
34
|
-
pnpm exec repo doctor --markdown --redact --out reports/doctor-before.md
|
|
35
|
-
pnpm exec repo doctor --json --out reports/doctor-before.json
|
|
36
|
-
```
|
|
37
|
-
|
|
38
|
-
Prefer saving the first report as a PR comment or CI artifact instead of relying only on terminal output.
|
|
39
|
-
|
|
40
|
-
Watch these checks:
|
|
41
|
-
|
|
42
|
-
| Check | Common Issue |
|
|
43
|
-
| ---------------------------- | ----------------------------------------------------------------- |
|
|
44
|
-
| `package-json` | Current directory is not the repository root |
|
|
45
|
-
| `workspace-manifest` | `pnpm-workspace.yaml` is missing |
|
|
46
|
-
| `node-version` | Root package has no `engines.node`, or the version does not match |
|
|
47
|
-
| `tool-package` | `repoctl` is not installed |
|
|
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
|
-
| `commit-hooks` | Husky and lint-staged are only partially configured |
|
|
51
|
-
| `workspace-package-coverage` | Some package.json files are not covered by workspace patterns |
|
|
52
|
-
|
|
53
|
-
## Step 3: Sync Conservatively
|
|
54
|
-
|
|
55
|
-
```bash
|
|
56
|
-
pnpm exec repo upgrade --no-overwrite
|
|
57
|
-
pnpm exec repo doctor --markdown --redact --out reports/doctor-after.md
|
|
58
|
-
```
|
|
59
|
-
|
|
60
|
-
Use `--no-overwrite` for the first adoption pass. It syncs missing assets while preserving changed managed files.
|
|
61
|
-
|
|
62
|
-
## Step 4: Preview Verification
|
|
63
|
-
|
|
64
|
-
```bash
|
|
65
|
-
pnpm exec repo check --dry-run
|
|
66
|
-
pnpm exec repo check --json --out reports/check-plan.json
|
|
67
|
-
pnpm exec repo check --markdown --redact --out reports/check-plan.md
|
|
68
|
-
```
|
|
69
|
-
|
|
70
|
-
Review the plan before wiring hooks or CI.
|
|
71
|
-
|
|
72
|
-
## Step 5: Use Root Scripts
|
|
73
|
-
|
|
74
|
-
After `repo init`, team docs can use:
|
|
75
|
-
|
|
76
|
-
```bash
|
|
77
|
-
pnpm run repo:doctor
|
|
78
|
-
pnpm run repo:new -- sdk
|
|
79
|
-
pnpm run repo:check
|
|
80
|
-
```
|
|
81
|
-
|
|
82
|
-
CI and automation should still prefer explicit commands:
|
|
83
|
-
|
|
84
|
-
```bash
|
|
85
|
-
pnpm exec repo doctor --strict
|
|
86
|
-
pnpm exec repo check --full
|
|
87
|
-
```
|
|
88
|
-
|
|
89
|
-
## Step 6: Resolve Legacy Config
|
|
90
|
-
|
|
91
|
-
### Config Conflicts
|
|
92
|
-
|
|
93
|
-
Keep only:
|
|
94
|
-
|
|
95
|
-
```txt
|
|
96
|
-
repoctl.config.ts
|
|
97
|
-
```
|
|
98
|
-
|
|
99
|
-
`monorepo.config.ts` is no longer loaded at runtime; rename it to `repoctl.config.ts`.
|
|
100
|
-
|
|
101
|
-
### Local Tooling Loader
|
|
102
|
-
|
|
103
|
-
If `doctor` reports local source tooling loaders, migrate with:
|
|
104
|
-
|
|
105
|
-
```bash
|
|
106
|
-
pnpm exec repo upgrade --yes
|
|
107
|
-
```
|
|
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
|
-
|
|
111
|
-
### Workspace Pattern Gaps
|
|
112
|
-
|
|
113
|
-
Run:
|
|
114
|
-
|
|
115
|
-
```bash
|
|
116
|
-
pnpm exec repo init --yes
|
|
117
|
-
```
|
|
118
|
-
|
|
119
|
-
or manually extend `pnpm-workspace.yaml`.
|
|
120
|
-
|
|
121
|
-
## Recommended PR Shape
|
|
122
|
-
|
|
123
|
-
1. Install `repoctl` and add root scripts.
|
|
124
|
-
2. Attach `doctor-before` and `doctor-after` reports.
|
|
125
|
-
3. Sync or migrate tooling config.
|
|
126
|
-
4. Wire hooks and CI.
|
|
127
|
-
5. Verify scaffolding paths with `repo new --dry-run`.
|
|
128
|
-
|
|
129
|
-
## Keep Reading
|
|
130
|
-
|
|
131
|
-
- [Workflows and CI](./workflows.md)
|
|
132
|
-
- [Troubleshooting](./troubleshooting.md)
|
|
133
|
-
- [Configuration](./config.md)
|
|
@@ -1,120 +0,0 @@
|
|
|
1
|
-
# Command Reference
|
|
2
|
-
|
|
3
|
-
This page focuses on high-value repoctl commands and options.
|
|
4
|
-
|
|
5
|
-
## Main Entry
|
|
6
|
-
|
|
7
|
-
```bash
|
|
8
|
-
pnpm exec repo init
|
|
9
|
-
pnpm exec repo doctor
|
|
10
|
-
pnpm exec repo templates
|
|
11
|
-
pnpm exec repo new
|
|
12
|
-
pnpm exec repo check
|
|
13
|
-
```
|
|
14
|
-
|
|
15
|
-
Generated repositories also expose:
|
|
16
|
-
|
|
17
|
-
```bash
|
|
18
|
-
pnpm run repo:init
|
|
19
|
-
pnpm run repo:doctor
|
|
20
|
-
pnpm run repo:new
|
|
21
|
-
pnpm run repo:check
|
|
22
|
-
```
|
|
23
|
-
|
|
24
|
-
## `repo init`
|
|
25
|
-
|
|
26
|
-
```bash
|
|
27
|
-
repo init
|
|
28
|
-
repo init --yes
|
|
29
|
-
repo init --preset minimal
|
|
30
|
-
repo init --preset standard --force
|
|
31
|
-
repo init --overwrite
|
|
32
|
-
```
|
|
33
|
-
|
|
34
|
-
Use it to initialize recommended workspace defaults. It skips existing managed files by default, appends missing workspace patterns, and supports non-interactive CI usage with `--yes`.
|
|
35
|
-
|
|
36
|
-
## `repo doctor`
|
|
37
|
-
|
|
38
|
-
```bash
|
|
39
|
-
repo doctor
|
|
40
|
-
repo doctor --strict
|
|
41
|
-
repo doctor --json --out reports/doctor.json
|
|
42
|
-
repo doctor --markdown --redact --out reports/doctor.md
|
|
43
|
-
```
|
|
44
|
-
|
|
45
|
-
Use it to check root workspace files, Node compatibility, CLI dependency presence, `repo:*` root scripts, stale config files, and commit hooks.
|
|
46
|
-
|
|
47
|
-
`--strict` treats warnings as failures. `--redact` removes local absolute paths from shareable reports.
|
|
48
|
-
|
|
49
|
-
## `repo templates`
|
|
50
|
-
|
|
51
|
-
```bash
|
|
52
|
-
repo templates
|
|
53
|
-
repo templates tsdown
|
|
54
|
-
repo templates --category library
|
|
55
|
-
repo templates --check
|
|
56
|
-
repo templates --json
|
|
57
|
-
repo templates --markdown --out docs/templates.md
|
|
58
|
-
```
|
|
59
|
-
|
|
60
|
-
Use it to discover built-in template keys, inspect metadata, verify template health, or generate machine-readable output.
|
|
61
|
-
|
|
62
|
-
## `repo new`
|
|
63
|
-
|
|
64
|
-
```bash
|
|
65
|
-
repo new
|
|
66
|
-
repo new sdk --template tsdown
|
|
67
|
-
repo new docs --template vitepress
|
|
68
|
-
repo new docs --template vitepress --dry-run
|
|
69
|
-
repo new docs --template vitepress --json --out plans/docs.json
|
|
70
|
-
```
|
|
71
|
-
|
|
72
|
-
Use it to create packages and apps. Explicit template keys are validated first; invalid keys fail with suggestions instead of silently falling back.
|
|
73
|
-
|
|
74
|
-
## `repo check`
|
|
75
|
-
|
|
76
|
-
```bash
|
|
77
|
-
repo check
|
|
78
|
-
repo check --staged
|
|
79
|
-
repo check --full
|
|
80
|
-
repo check --edit-file .git/COMMIT_EDITMSG
|
|
81
|
-
repo check --dry-run
|
|
82
|
-
repo check --json --out reports/check-plan.json
|
|
83
|
-
repo check --markdown --redact --out reports/check-plan.md
|
|
84
|
-
```
|
|
85
|
-
|
|
86
|
-
Use it to preview or run the recommended local verification flow. `--staged` is closer to pre-commit; `--full` is closer to pre-push.
|
|
87
|
-
|
|
88
|
-
## `repo upgrade`
|
|
89
|
-
|
|
90
|
-
```bash
|
|
91
|
-
repo upgrade
|
|
92
|
-
repo upgrade --yes
|
|
93
|
-
repo upgrade --overwrite
|
|
94
|
-
repo upgrade --no-overwrite
|
|
95
|
-
repo upgrade --core
|
|
96
|
-
repo upgrade -i
|
|
97
|
-
repo upgrade -s
|
|
98
|
-
```
|
|
99
|
-
|
|
100
|
-
Use it to sync standard assets and scripts. `--core` skips GitHub-related assets. `--no-overwrite` preserves changed files.
|
|
101
|
-
|
|
102
|
-
## Grouped Commands
|
|
103
|
-
|
|
104
|
-
```bash
|
|
105
|
-
repo ws ls
|
|
106
|
-
repo ws ls --json --out reports/workspaces.json
|
|
107
|
-
repo ws up
|
|
108
|
-
repo tg init --all
|
|
109
|
-
repo verify pre-commit
|
|
110
|
-
repo verify pre-push
|
|
111
|
-
repo env support --markdown --redact --out reports/support.md
|
|
112
|
-
repo config inspect
|
|
113
|
-
repo skills sync --codex
|
|
114
|
-
```
|
|
115
|
-
|
|
116
|
-
## Keep Reading
|
|
117
|
-
|
|
118
|
-
- [Workflows and CI](./workflows.md)
|
|
119
|
-
- [Troubleshooting](./troubleshooting.md)
|
|
120
|
-
- [Command Aliases](./aliases.md)
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
# Configuration
|
|
2
|
-
|
|
3
|
-
repoctl recommends one root config file:
|
|
4
|
-
|
|
5
|
-
```txt
|
|
6
|
-
repoctl.config.ts
|
|
7
|
-
```
|
|
8
|
-
|
|
9
|
-
`monorepo.config.ts` is no longer loaded at runtime. Rename it to `repoctl.config.ts` before running repoctl.
|
|
10
|
-
|
|
11
|
-
## Minimal Config
|
|
12
|
-
|
|
13
|
-
```ts
|
|
14
|
-
import { defineMonorepoConfig } from 'repoctl'
|
|
15
|
-
|
|
16
|
-
export default defineMonorepoConfig({
|
|
17
|
-
commands: {
|
|
18
|
-
create: {
|
|
19
|
-
defaultTemplate: 'tsdown',
|
|
20
|
-
},
|
|
21
|
-
},
|
|
22
|
-
})
|
|
23
|
-
```
|
|
24
|
-
|
|
25
|
-
After setting `commands.create.defaultTemplate`, this command can create a package without asking for the template:
|
|
26
|
-
|
|
27
|
-
```bash
|
|
28
|
-
repo new utils
|
|
29
|
-
```
|
|
30
|
-
|
|
31
|
-
## Common Config
|
|
32
|
-
|
|
33
|
-
```ts
|
|
34
|
-
import { defineMonorepoConfig } from 'repoctl'
|
|
35
|
-
|
|
36
|
-
export default defineMonorepoConfig({
|
|
37
|
-
commands: {
|
|
38
|
-
init: {
|
|
39
|
-
preset: 'standard',
|
|
40
|
-
},
|
|
41
|
-
create: {
|
|
42
|
-
defaultTemplate: 'tsdown',
|
|
43
|
-
},
|
|
44
|
-
clean: {
|
|
45
|
-
autoConfirm: true,
|
|
46
|
-
},
|
|
47
|
-
upgrade: {
|
|
48
|
-
skipOverwrite: true,
|
|
49
|
-
},
|
|
50
|
-
},
|
|
51
|
-
})
|
|
52
|
-
```
|
|
53
|
-
|
|
54
|
-
| Option | Purpose |
|
|
55
|
-
| --------------------------------- | ----------------------------------------------- |
|
|
56
|
-
| `commands.init.preset` | Default setup preset |
|
|
57
|
-
| `commands.create.defaultTemplate` | Default template for `repo new <name>` |
|
|
58
|
-
| `commands.clean.autoConfirm` | Whether clean commands confirm by default |
|
|
59
|
-
| `commands.upgrade.skipOverwrite` | Whether upgrade preserves changed managed files |
|
|
60
|
-
|
|
61
|
-
## Inspect Config
|
|
62
|
-
|
|
63
|
-
```bash
|
|
64
|
-
repo config inspect
|
|
65
|
-
repo cfg i --json --out reports/config.json
|
|
66
|
-
repo cfg i --markdown --redact --out reports/config.md
|
|
67
|
-
```
|
|
68
|
-
|
|
69
|
-
Use `--redact` before sharing reports in issues, PRs, or external support channels.
|
|
@@ -1,116 +0,0 @@
|
|
|
1
|
-
# Getting Started
|
|
2
|
-
|
|
3
|
-
This guide follows the order you would use when adding repoctl to a workspace.
|
|
4
|
-
|
|
5
|
-
## Prerequisites
|
|
6
|
-
|
|
7
|
-
- Node.js 20 or newer.
|
|
8
|
-
- pnpm. Corepack is recommended: `corepack enable`.
|
|
9
|
-
- Git. `repo doctor` reads repository metadata and checks the commit workflow.
|
|
10
|
-
|
|
11
|
-
```bash
|
|
12
|
-
node -v
|
|
13
|
-
pnpm -v
|
|
14
|
-
git --version
|
|
15
|
-
```
|
|
16
|
-
|
|
17
|
-
## Install
|
|
18
|
-
|
|
19
|
-
```bash
|
|
20
|
-
pnpm add -D repoctl
|
|
21
|
-
```
|
|
22
|
-
|
|
23
|
-
If the repository was generated from this template, the dependency and root scripts may already be present.
|
|
24
|
-
|
|
25
|
-
## Initialize Defaults
|
|
26
|
-
|
|
27
|
-
```bash
|
|
28
|
-
pnpm install
|
|
29
|
-
pnpm exec repo init
|
|
30
|
-
pnpm exec repo doctor
|
|
31
|
-
```
|
|
32
|
-
|
|
33
|
-
| Command | Purpose |
|
|
34
|
-
| -------------- | ----------------------------------------------------------------------------- |
|
|
35
|
-
| `pnpm install` | Install workspace dependencies and local links |
|
|
36
|
-
| `repo init` | Add recommended scripts, workspace patterns, and tooling entries |
|
|
37
|
-
| `repo doctor` | Check root files, Node version, CLI dependency, stale config files, and hooks |
|
|
38
|
-
|
|
39
|
-
Fix blocking issues reported by `doctor`, then run it again.
|
|
40
|
-
|
|
41
|
-
## Create A Package
|
|
42
|
-
|
|
43
|
-
List templates first:
|
|
44
|
-
|
|
45
|
-
```bash
|
|
46
|
-
pnpm exec repo templates
|
|
47
|
-
```
|
|
48
|
-
|
|
49
|
-
Create a TypeScript library:
|
|
50
|
-
|
|
51
|
-
```bash
|
|
52
|
-
pnpm exec repo new sdk --template tsdown
|
|
53
|
-
```
|
|
54
|
-
|
|
55
|
-
Preview before writing files:
|
|
56
|
-
|
|
57
|
-
```bash
|
|
58
|
-
pnpm exec repo new sdk --template tsdown --dry-run
|
|
59
|
-
pnpm exec repo new sdk --template tsdown --json --out plans/sdk.json
|
|
60
|
-
```
|
|
61
|
-
|
|
62
|
-
`--json` and `--out` imply `--dry-run`, which makes them suitable for CI, editor integrations, and scripts.
|
|
63
|
-
|
|
64
|
-
## Use Root Scripts
|
|
65
|
-
|
|
66
|
-
After `repo init`, daily commands can be shorter:
|
|
67
|
-
|
|
68
|
-
```bash
|
|
69
|
-
pnpm run repo:init
|
|
70
|
-
pnpm run repo:doctor -- --json
|
|
71
|
-
pnpm run repo:new -- sdk --template tsdown
|
|
72
|
-
pnpm run repo:check
|
|
73
|
-
```
|
|
74
|
-
|
|
75
|
-
| Root script | Equivalent CLI |
|
|
76
|
-
| ------------------------------ | ---------------------------- |
|
|
77
|
-
| `pnpm run repo:init` | `pnpm exec repo init` |
|
|
78
|
-
| `pnpm run repo:doctor -- args` | `pnpm exec repo doctor args` |
|
|
79
|
-
| `pnpm run repo:new -- args` | `pnpm exec repo new args` |
|
|
80
|
-
| `pnpm run repo:check` | `pnpm exec repo check` |
|
|
81
|
-
|
|
82
|
-
## Verify Before Committing
|
|
83
|
-
|
|
84
|
-
```bash
|
|
85
|
-
pnpm build
|
|
86
|
-
pnpm lint
|
|
87
|
-
pnpm typecheck
|
|
88
|
-
pnpm test
|
|
89
|
-
```
|
|
90
|
-
|
|
91
|
-
Or use the repoctl verification entry:
|
|
92
|
-
|
|
93
|
-
```bash
|
|
94
|
-
pnpm run repo:check
|
|
95
|
-
pnpm exec repo check --dry-run
|
|
96
|
-
pnpm exec repo check --json --out reports/check-plan.json
|
|
97
|
-
```
|
|
98
|
-
|
|
99
|
-
## Sync Template Assets
|
|
100
|
-
|
|
101
|
-
```bash
|
|
102
|
-
pnpm exec repo upgrade
|
|
103
|
-
pnpm exec repo upgrade --no-overwrite
|
|
104
|
-
pnpm exec repo upgrade --yes
|
|
105
|
-
```
|
|
106
|
-
|
|
107
|
-
- `--no-overwrite` preserves changed managed files.
|
|
108
|
-
- `--yes` or `--overwrite` is for explicit automated overwrites.
|
|
109
|
-
- Non-TTY environments do not open interactive prompts.
|
|
110
|
-
|
|
111
|
-
## Next Steps
|
|
112
|
-
|
|
113
|
-
- Adopt an existing repository: [Adopt Existing Repositories](./adopt-existing.md).
|
|
114
|
-
- Set team defaults: [Configuration](./config.md).
|
|
115
|
-
- Inspect template keys: [Templates](./templates.md).
|
|
116
|
-
- Share diagnostic output: [Troubleshooting](./troubleshooting.md).
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
# repoctl Overview
|
|
2
|
-
|
|
3
|
-
`repoctl` is the user-facing package name for this monorepo toolkit. Its recommended command is `repo`.
|
|
4
|
-
|
|
5
|
-
The CLI does not replace pnpm, Turborepo, or changesets. It gives teams a stable layer for common monorepo actions: setup, diagnostics, scaffolding, local verification, and template asset upgrades.
|
|
6
|
-
|
|
7
|
-
## When To Use It
|
|
8
|
-
|
|
9
|
-
| Goal | Command |
|
|
10
|
-
| ----------------------------------------------------- | ------------------------ |
|
|
11
|
-
| Add recommended scripts and workspace defaults | `pnpm exec repo init` |
|
|
12
|
-
| Check whether a repository is ready to develop | `pnpm exec repo doctor` |
|
|
13
|
-
| Create a package, app, docs site, service, or CLI | `pnpm exec repo new` |
|
|
14
|
-
| Reproduce the recommended pre-commit or pre-push flow | `pnpm exec repo check` |
|
|
15
|
-
| Sync newer standard assets from the template | `pnpm exec repo upgrade` |
|
|
16
|
-
| Persist output for CI, editors, or issue reports | `--json --out <file>` |
|
|
17
|
-
|
|
18
|
-
## Recommended Command Layers
|
|
19
|
-
|
|
20
|
-
### repo:\* Root Scripts
|
|
21
|
-
|
|
22
|
-
```bash
|
|
23
|
-
pnpm run repo:init
|
|
24
|
-
pnpm run repo:doctor
|
|
25
|
-
pnpm run repo:new
|
|
26
|
-
pnpm run repo:check
|
|
27
|
-
```
|
|
28
|
-
|
|
29
|
-
These are the best commands for day-to-day team docs. They are short, explicit, and do not collide with pnpm built-in commands.
|
|
30
|
-
|
|
31
|
-
### Explicit CLI Calls
|
|
32
|
-
|
|
33
|
-
```bash
|
|
34
|
-
pnpm exec repo init
|
|
35
|
-
pnpm exec repo doctor
|
|
36
|
-
pnpm exec repo templates
|
|
37
|
-
pnpm exec repo new sdk --template tsdown
|
|
38
|
-
pnpm exec repo check --dry-run
|
|
39
|
-
```
|
|
40
|
-
|
|
41
|
-
Use this form in CI, scripts, troubleshooting docs, and reproducible examples.
|
|
42
|
-
|
|
43
|
-
### Grouped Commands
|
|
44
|
-
|
|
45
|
-
```bash
|
|
46
|
-
pnpm exec repo ws ls
|
|
47
|
-
pnpm exec repo tg init --all
|
|
48
|
-
pnpm exec repo env support --markdown --redact
|
|
49
|
-
pnpm exec repo config inspect
|
|
50
|
-
```
|
|
51
|
-
|
|
52
|
-
Grouped commands are for maintainers and automation that need finer control.
|
|
53
|
-
|
|
54
|
-
## Command Entrypoints
|
|
55
|
-
|
|
56
|
-
The package exposes multiple bins:
|
|
57
|
-
|
|
58
|
-
```bash
|
|
59
|
-
pnpm exec repoctl doctor
|
|
60
|
-
pnpm exec repoctl new
|
|
61
|
-
```
|
|
62
|
-
|
|
63
|
-
The docs prefer `repo` so new users only need to remember one command name.
|
|
64
|
-
|
|
65
|
-
## Keep Reading
|
|
66
|
-
|
|
67
|
-
- [Getting Started](./getting-started.md)
|
|
68
|
-
- [Choose By Scenario](./scenarios.md)
|
|
69
|
-
- [Command Reference](./commands.md)
|
|
70
|
-
- [Configuration](./config.md)
|
|
71
|
-
- [Templates](./templates.md)
|
|
72
|
-
- [Workflows and CI](./workflows.md)
|
|
73
|
-
- [Troubleshooting](./troubleshooting.md)
|
|
74
|
-
- [Command Aliases](./aliases.md)
|
|
@@ -1,128 +0,0 @@
|
|
|
1
|
-
# Templates
|
|
2
|
-
|
|
3
|
-
repoctl templates are maintained by `@icebreakers/monorepo-templates`. The CLI, scaffolder, and docs share the same template metadata.
|
|
4
|
-
|
|
5
|
-
## Built-In Templates
|
|
6
|
-
|
|
7
|
-
| Key | Category | Default target | Use case |
|
|
8
|
-
| ------------- | -------- | ------------------ | ----------------------- |
|
|
9
|
-
| `tsdown` | library | `packages/tsdown` | TypeScript library |
|
|
10
|
-
| `vue-lib` | library | `packages/vue-lib` | Vue 3 component library |
|
|
11
|
-
| `vue-hono` | app | `apps/client` | Vue 3 + Hono app |
|
|
12
|
-
| `hono-server` | service | `apps/server` | Hono API service |
|
|
13
|
-
| `vitepress` | docs | `apps/website` | VitePress docs site |
|
|
14
|
-
| `cli` | tool | `apps/cli` | TypeScript CLI |
|
|
15
|
-
|
|
16
|
-
## Discover Templates
|
|
17
|
-
|
|
18
|
-
```bash
|
|
19
|
-
repo templates
|
|
20
|
-
repo templates tsdown
|
|
21
|
-
repo templates --category library
|
|
22
|
-
repo templates --json
|
|
23
|
-
repo templates --markdown --out docs/templates.md
|
|
24
|
-
```
|
|
25
|
-
|
|
26
|
-
## Create From A Template
|
|
27
|
-
|
|
28
|
-
```bash
|
|
29
|
-
repo new sdk --template tsdown
|
|
30
|
-
repo new ui --template vue-lib
|
|
31
|
-
repo new api --template hono-server
|
|
32
|
-
repo new website --template vitepress
|
|
33
|
-
repo new toolbox --template cli
|
|
34
|
-
```
|
|
35
|
-
|
|
36
|
-
Simple names are placed in the conventional target folder. Library templates go under `packages/`; app templates go under `apps/`. If you pass an explicit path such as `packages/shared-utils`, repoctl respects it.
|
|
37
|
-
|
|
38
|
-
## Choose By Goal
|
|
39
|
-
|
|
40
|
-
### Publish an npm library
|
|
41
|
-
|
|
42
|
-
```bash
|
|
43
|
-
repo new sdk --template tsdown
|
|
44
|
-
```
|
|
45
|
-
|
|
46
|
-
Check first:
|
|
47
|
-
|
|
48
|
-
- `package.json` `name`, `exports`, and `types`.
|
|
49
|
-
- Whether `tsdown.config.ts` matches the desired output format.
|
|
50
|
-
- Whether public types need `tsd` tests.
|
|
51
|
-
|
|
52
|
-
### Build reusable Vue components
|
|
53
|
-
|
|
54
|
-
```bash
|
|
55
|
-
repo new ui --template vue-lib
|
|
56
|
-
```
|
|
57
|
-
|
|
58
|
-
Check first:
|
|
59
|
-
|
|
60
|
-
- Component entry points only expose stable APIs.
|
|
61
|
-
- Styles pass Stylelint.
|
|
62
|
-
- A docs site or example app should be created alongside it if needed.
|
|
63
|
-
|
|
64
|
-
### Create an app or service
|
|
65
|
-
|
|
66
|
-
```bash
|
|
67
|
-
repo new web --template vue-hono
|
|
68
|
-
repo new api --template hono-server
|
|
69
|
-
```
|
|
70
|
-
|
|
71
|
-
Check first:
|
|
72
|
-
|
|
73
|
-
- Runtime environment variables and deployment constraints.
|
|
74
|
-
- `dev`, `build`, and `typecheck` scripts are part of root tasks.
|
|
75
|
-
- CI needs integration or E2E tests.
|
|
76
|
-
|
|
77
|
-
### Create a docs site
|
|
78
|
-
|
|
79
|
-
```bash
|
|
80
|
-
repo new docs --template vitepress
|
|
81
|
-
```
|
|
82
|
-
|
|
83
|
-
Check first:
|
|
84
|
-
|
|
85
|
-
- Nav and sidebar are organized around the product or package.
|
|
86
|
-
- A second locale is required.
|
|
87
|
-
- `repo templates --markdown` output should be written into docs.
|
|
88
|
-
|
|
89
|
-
### Create a CLI
|
|
90
|
-
|
|
91
|
-
```bash
|
|
92
|
-
repo new toolbox --template cli
|
|
93
|
-
```
|
|
94
|
-
|
|
95
|
-
Check first:
|
|
96
|
-
|
|
97
|
-
- The `bin` field matches the final command name.
|
|
98
|
-
- Argument parsing, exit codes, and help output are testable.
|
|
99
|
-
- README documents command usage.
|
|
100
|
-
|
|
101
|
-
## Preview Creation
|
|
102
|
-
|
|
103
|
-
```bash
|
|
104
|
-
repo new website --template vitepress --dry-run
|
|
105
|
-
repo new website --template vitepress --json
|
|
106
|
-
repo new website --template vitepress --json --out plans/website.json
|
|
107
|
-
```
|
|
108
|
-
|
|
109
|
-
`--dry-run` does not write files. It shows the template, source directory, target directory, package name, and output files.
|
|
110
|
-
|
|
111
|
-
`--json` emits the same plan as structured data and implies `--dry-run`.
|
|
112
|
-
|
|
113
|
-
`--out <file>` persists the preview and also implies `--dry-run`.
|
|
114
|
-
|
|
115
|
-
## Check Template Health
|
|
116
|
-
|
|
117
|
-
```bash
|
|
118
|
-
repo templates --check
|
|
119
|
-
repo templates --check --json
|
|
120
|
-
```
|
|
121
|
-
|
|
122
|
-
The check validates duplicate sources and targets, existing source directories, package metadata, categories, descriptions, and temporary files that would be filtered by the scaffolder.
|
|
123
|
-
|
|
124
|
-
## Keep Reading
|
|
125
|
-
|
|
126
|
-
- [Adopt Existing Repositories](./adopt-existing.md)
|
|
127
|
-
- [Workflows and CI](./workflows.md)
|
|
128
|
-
- [Configuration](./config.md)
|