repoctl 3.2.18 → 4.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.
Files changed (2) hide show
  1. package/README.md +124 -0
  2. package/package.json +8 -4
package/README.md ADDED
@@ -0,0 +1,124 @@
1
+ # repoctl
2
+
3
+ Package name: `repoctl`. Recommended command: `repo`.
4
+
5
+ ## Install
6
+
7
+ ```sh
8
+ pnpm add -D repoctl
9
+ ```
10
+
11
+ ## Quick Start
12
+
13
+ ```sh
14
+ pnpm exec repo setup
15
+ pnpm exec repo doctor
16
+ pnpm exec repo doctor --json
17
+ pnpm exec repo doctor --json --out reports/doctor.json
18
+ pnpm exec repo templates
19
+ pnpm exec repo new my-package
20
+ pnpm exec repo check
21
+ pnpm exec repo check --dry-run
22
+ pnpm exec repo env info
23
+ ```
24
+
25
+ Inside generated repos, the same workflow is available as shorter root scripts:
26
+
27
+ ```sh
28
+ pnpm setup
29
+ pnpm doctor
30
+ pnpm new my-package
31
+ pnpm check
32
+ ```
33
+
34
+ ## What Each Command Is For
35
+
36
+ - `repo setup`: initialize the workspace with the recommended metadata and tooling defaults.
37
+ - `repo doctor`: diagnose whether the current repo is ready to use.
38
+ - `repo templates`: list the built-in package/app templates and their target folders.
39
+ - `repo new`: create a new package or app.
40
+ - `repo check`: run the recommended local verification flow.
41
+ - `repo upgrade`: sync the latest standard assets and scripts from the template.
42
+
43
+ `repo doctor` is intentionally lightweight. It checks root workspace files, Node version compatibility, CLI dependency presence, recommended root scripts, config conflicts, and whether Husky plus lint-staged are both wired. Use `repo doctor --json --out reports/doctor.json` when automation needs a persisted report.
44
+ Use `repo check --dry-run` or `repo check --json --out reports/check-plan.json` when automation needs to inspect the verification plan before running it.
45
+
46
+ ## Common Commands
47
+
48
+ ```sh
49
+ # sync repo standards
50
+ pnpm exec repo upgrade
51
+
52
+ # create a specific template without extra prompts
53
+ pnpm exec repo new dashboard --template vue-hono
54
+ pnpm exec repo new dashboard --template vue-hono --dry-run
55
+ pnpm exec repo new dashboard --template vue-hono --json
56
+ pnpm exec repo new dashboard --template vue-hono --json --out plans/dashboard.json
57
+ # invalid template keys fail with a suggestion instead of falling back silently
58
+
59
+ # discover available templates
60
+ pnpm exec repo templates
61
+ pnpm exec repo templates tsdown
62
+ pnpm exec repo templates --category library
63
+ pnpm exec repo templates --check
64
+ pnpm exec repo templates --check --json
65
+ pnpm exec repo templates --json
66
+ pnpm exec repo templates --markdown
67
+ pnpm exec repo templates tsdown --markdown
68
+ pnpm exec repo templates --markdown --out docs/templates.md
69
+
70
+ # advanced workspace upgrade
71
+ pnpm exec repo ws up
72
+
73
+ # inspect verification routing
74
+ pnpm exec repo check --dry-run
75
+ pnpm exec repo check --json --out reports/check-plan.json
76
+
77
+ # collect environment info for debugging
78
+ pnpm exec repo env info
79
+ pnpm exec repo env info --json --out reports/env.json
80
+ pnpm exec repo env snapshot --json --out reports/snapshot.json
81
+
82
+ # inspect workspace packages
83
+ pnpm exec repo ws ls
84
+ pnpm exec repo ws ls --json --include-private
85
+ pnpm exec repo ws ls --json --out reports/workspaces.json
86
+
87
+ # generate tooling configs
88
+ pnpm exec repo tg init --all
89
+ ```
90
+
91
+ ## Config
92
+
93
+ Create `repoctl.config.ts` in the workspace root to customize defaults.
94
+
95
+ ```ts
96
+ import { defineMonorepoConfig } from 'repoctl'
97
+
98
+ export default defineMonorepoConfig({
99
+ commands: {
100
+ init: {
101
+ preset: 'standard',
102
+ },
103
+ create: {
104
+ defaultTemplate: 'tsdown',
105
+ },
106
+ },
107
+ })
108
+ ```
109
+
110
+ When `commands.create.defaultTemplate` is set, `repo new foo` creates the package directly and places it under the conventional base directory inferred from the template, such as `packages/foo` or `apps/foo`.
111
+
112
+ Prefer `repoctl.config.ts`. `monorepo.config.ts` remains supported for compatibility, but the two files cannot coexist.
113
+
114
+ ## Compatibility
115
+
116
+ `repoctl new foo`, `repoctl doctor`, and `repoctl check` remain supported as compatibility aliases.
117
+
118
+ ## Performance Notes
119
+
120
+ The CLI keeps startup lightweight by registering the command tree first and loading each command implementation only when that action runs. Workspace discovery also uses an in-process cache, so repeated checks inside one command reuse the same `pnpm-workspace.yaml` and package scan results.
121
+
122
+ ## Advanced Usage
123
+
124
+ If you need the lower-level API and tooling wrappers, see `@icebreakers/monorepo`.
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "repoctl",
3
3
  "type": "module",
4
- "version": "3.2.18",
5
- "description": "One-command repo toolchain control built on @icebreakers/monorepo",
4
+ "version": "4.0.0",
5
+ "description": "Default task-first CLI for pnpm and Turbo monorepo setup and maintenance",
6
6
  "author": "ice breaker <hi@sonofmagic.top>",
7
7
  "license": "MIT",
8
8
  "homepage": "https://monorepo.icebreaker.top",
@@ -15,8 +15,12 @@
15
15
  "url": "https://github.com/sonofmagic/monorepo-template/issues"
16
16
  },
17
17
  "keywords": [
18
+ "repoctl",
18
19
  "repo",
20
+ "cli",
19
21
  "toolchain",
22
+ "pnpm",
23
+ "turbo",
20
24
  "monorepo"
21
25
  ],
22
26
  "sideEffects": false,
@@ -56,13 +60,13 @@
56
60
  "node": ">=23.5.0 || ^22.13.0 || ^21.7.0 || ^20.12.0"
57
61
  },
58
62
  "dependencies": {
59
- "@icebreakers/monorepo": "3.2.18"
63
+ "@icebreakers/monorepo": "4.0.0"
60
64
  },
61
65
  "scripts": {
62
66
  "dev": "tsdown --watch --sourcemap",
63
67
  "build": "tsdown",
64
68
  "test": "vitest run --passWithNoTests",
65
- "typecheck": "pnpm --filter @icebreakers/monorepo build && tsc -p tsconfig.json",
69
+ "typecheck": "pnpm --filter @icebreakers/monorepo build && node ../../node_modules/typescript/bin/tsc -p tsconfig.json",
66
70
  "tsd": "pnpm --filter @icebreakers/monorepo build && pnpm build && tsd --files test-d/**/*.test-d.ts",
67
71
  "release": "pnpm publish",
68
72
  "lint": "eslint .",