repoctl 3.2.18 → 4.0.1

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 +130 -0
  2. package/package.json +8 -4
package/README.md ADDED
@@ -0,0 +1,130 @@
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 setup` is safe to run in an existing pnpm workspace. By default it creates missing root files, appends missing workspace patterns, and skips existing README/tooling files; use `--force` or `--overwrite` when you explicitly want managed files rewritten. Use `--yes` in CI.
44
+
45
+ `repo upgrade` is also CI-safe. In a non-TTY process it will not prompt; changed files are skipped unless you pass `--yes` or `--overwrite`. Use `--no-overwrite` when automation must preserve every changed file.
46
+
47
+ `repo doctor` is intentionally lightweight. It checks root workspace files, Node version compatibility, CLI dependency presence, recommended root scripts, config conflicts, workspace pattern coverage, legacy local tooling imports, and whether Husky plus lint-staged are both wired. Use `repo doctor --json --out reports/doctor.json` when automation needs a persisted report.
48
+ 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.
49
+
50
+ ## Common Commands
51
+
52
+ ```sh
53
+ # sync repo standards
54
+ pnpm exec repo upgrade
55
+ pnpm exec repo upgrade --yes
56
+ pnpm exec repo upgrade --no-overwrite
57
+
58
+ # create a specific template without extra prompts
59
+ pnpm exec repo new dashboard --template vue-hono
60
+ pnpm exec repo new dashboard --template vue-hono --dry-run
61
+ pnpm exec repo new dashboard --template vue-hono --json
62
+ pnpm exec repo new dashboard --template vue-hono --json --out plans/dashboard.json
63
+ # invalid template keys fail with a suggestion instead of falling back silently
64
+
65
+ # discover available templates
66
+ pnpm exec repo templates
67
+ pnpm exec repo templates tsdown
68
+ pnpm exec repo templates --category library
69
+ pnpm exec repo templates --check
70
+ pnpm exec repo templates --check --json
71
+ pnpm exec repo templates --json
72
+ pnpm exec repo templates --markdown
73
+ pnpm exec repo templates tsdown --markdown
74
+ pnpm exec repo templates --markdown --out docs/templates.md
75
+
76
+ # advanced workspace upgrade
77
+ pnpm exec repo ws up
78
+
79
+ # inspect verification routing
80
+ pnpm exec repo check --dry-run
81
+ pnpm exec repo check --json --out reports/check-plan.json
82
+
83
+ # collect environment info for debugging
84
+ pnpm exec repo env info
85
+ pnpm exec repo env info --json --out reports/env.json
86
+ pnpm exec repo env snapshot --json --out reports/snapshot.json
87
+
88
+ # inspect workspace packages
89
+ pnpm exec repo ws ls
90
+ pnpm exec repo ws ls --json --include-private
91
+ pnpm exec repo ws ls --json --out reports/workspaces.json
92
+
93
+ # generate tooling configs
94
+ pnpm exec repo tg init --all
95
+ ```
96
+
97
+ ## Config
98
+
99
+ Create `repoctl.config.ts` in the workspace root to customize defaults.
100
+
101
+ ```ts
102
+ import { defineMonorepoConfig } from 'repoctl'
103
+
104
+ export default defineMonorepoConfig({
105
+ commands: {
106
+ init: {
107
+ preset: 'standard',
108
+ },
109
+ create: {
110
+ defaultTemplate: 'tsdown',
111
+ },
112
+ },
113
+ })
114
+ ```
115
+
116
+ 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`.
117
+
118
+ Prefer `repoctl.config.ts`. `monorepo.config.ts` remains supported for compatibility, but the two files cannot coexist.
119
+
120
+ ## Compatibility
121
+
122
+ `repoctl new foo`, `repoctl doctor`, and `repoctl check` remain supported as compatibility aliases.
123
+
124
+ ## Performance Notes
125
+
126
+ 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.
127
+
128
+ ## Advanced Usage
129
+
130
+ 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.1",
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.1"
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 .",