@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.
Files changed (161) hide show
  1. package/README.md +12 -8
  2. package/README.zh-CN.md +16 -0
  3. package/assets/.changeset/ledger.yaml +51 -0
  4. package/assets/.github/ISSUE_TEMPLATE/config.yml +1 -1
  5. package/assets/.github/workflows/release.yml +22 -97
  6. package/assets/AGENTS.md +5 -4
  7. package/assets/CONTRIBUTING.md +27 -2
  8. package/assets/SECURITY.md +12 -14
  9. package/assets/package.json +18 -10
  10. package/assets/pnpm-workspace.yaml +8 -0
  11. package/package.json +6 -4
  12. package/templates/cli/package.json +11 -4
  13. package/templates/client/package.json +22 -6
  14. package/templates/server/package.json +14 -7
  15. package/templates/server/vitest.config.ts +1 -4
  16. package/templates/tsdown/package.json +11 -4
  17. package/templates/tsdown/vitest.config.ts +1 -4
  18. package/templates/vitepress/.vitepress/config.ts +146 -165
  19. package/templates/vitepress/ai/index.md +12 -23
  20. package/templates/vitepress/ai/llms-txt.md +13 -31
  21. package/templates/vitepress/getting-started.md +3 -32
  22. package/templates/vitepress/index.md +27 -30
  23. package/templates/vitepress/knowledge/index.md +17 -41
  24. package/templates/vitepress/monorepo/commands.md +13 -18
  25. package/templates/vitepress/monorepo/index.md +22 -100
  26. package/templates/vitepress/monorepo/manage.md +15 -227
  27. package/templates/vitepress/monorepo/publish.md +17 -245
  28. package/templates/vitepress/monorepo/templates.md +10 -17
  29. package/templates/vitepress/monorepo/troubleshooting.md +13 -16
  30. package/templates/vitepress/package.json +11 -5
  31. package/templates/vitepress/public/_redirects +3 -0
  32. package/templates/vitepress/repoctl/adopt-existing.md +51 -53
  33. package/templates/vitepress/repoctl/aliases.md +18 -18
  34. package/templates/vitepress/repoctl/checks.md +21 -68
  35. package/templates/vitepress/repoctl/commands.md +16 -64
  36. package/templates/vitepress/repoctl/config.md +14 -35
  37. package/templates/vitepress/repoctl/doctor.md +20 -60
  38. package/templates/vitepress/repoctl/execution-model.md +16 -69
  39. package/templates/vitepress/repoctl/getting-started.md +34 -40
  40. package/templates/vitepress/repoctl/index.md +33 -61
  41. package/templates/vitepress/repoctl/reports.md +20 -74
  42. package/templates/vitepress/repoctl/scenarios.md +26 -28
  43. package/templates/vitepress/repoctl/template-assets.md +19 -88
  44. package/templates/vitepress/repoctl/templates.md +50 -81
  45. package/templates/vitepress/repoctl/troubleshooting.md +32 -46
  46. package/templates/vitepress/repoctl/workflows.md +38 -67
  47. package/templates/vitepress/thinking.md +4 -85
  48. package/templates/vitepress/tools/changeset.md +12 -85
  49. package/templates/vitepress/tools/husky.md +6 -124
  50. package/templates/vitepress/tools/index.md +13 -32
  51. package/templates/vitepress/tools/lint-staged.md +5 -96
  52. package/templates/vitepress/tools/llms-txt.md +4 -6
  53. package/templates/vitepress/tools/pnpm.md +7 -119
  54. package/templates/vitepress/tools/renovate.md +3 -87
  55. package/templates/vitepress/tools/turborepo.md +5 -157
  56. package/templates/vitepress/why/how-to-reuse-js-code.md +6 -247
  57. package/templates/vitepress/why/index.md +14 -1
  58. package/templates/vitepress/why/js-cjs-mjs.md +9 -96
  59. package/templates/vitepress/why/js-keywords.md +4 -129
  60. package/templates/vitepress/why/modern/bundlers.md +3 -50
  61. package/templates/vitepress/why/modern/dts.md +4 -90
  62. package/templates/vitepress/why/modern/esm-vs-cjs.md +4 -81
  63. package/templates/vitepress/why/modern/index.md +10 -51
  64. package/templates/vitepress/why/modern/package-entry-points.md +6 -117
  65. package/templates/vitepress/why/modern/typescript.md +4 -152
  66. package/templates/vitepress/why/publish-basic-npm-package.md +17 -144
  67. package/templates/vitepress/why/what-is-npm-package.md +4 -159
  68. package/templates/vitepress/zh/ai/index.md +33 -0
  69. package/templates/vitepress/zh/ai/llms-txt.md +42 -0
  70. package/templates/vitepress/zh/getting-started.md +40 -0
  71. package/templates/vitepress/zh/index.md +66 -0
  72. package/templates/vitepress/zh/knowledge/index.md +50 -0
  73. package/templates/vitepress/zh/monorepo/commands.md +21 -0
  74. package/templates/vitepress/zh/monorepo/index.md +115 -0
  75. package/templates/vitepress/zh/monorepo/manage.md +243 -0
  76. package/templates/vitepress/zh/monorepo/publish.md +87 -0
  77. package/templates/vitepress/zh/monorepo/templates.md +21 -0
  78. package/templates/vitepress/zh/monorepo/troubleshooting.md +20 -0
  79. package/templates/vitepress/zh/repoctl/adopt-existing.md +135 -0
  80. package/templates/vitepress/{en → zh}/repoctl/aliases.md +18 -18
  81. package/templates/vitepress/zh/repoctl/checks.md +86 -0
  82. package/templates/vitepress/zh/repoctl/commands.md +168 -0
  83. package/templates/vitepress/zh/repoctl/config.md +90 -0
  84. package/templates/vitepress/zh/repoctl/doctor.md +86 -0
  85. package/templates/vitepress/zh/repoctl/execution-model.md +81 -0
  86. package/templates/vitepress/zh/repoctl/getting-started.md +122 -0
  87. package/templates/vitepress/zh/repoctl/index.md +102 -0
  88. package/templates/vitepress/zh/repoctl/reports.md +94 -0
  89. package/templates/vitepress/{en → zh}/repoctl/scenarios.md +28 -26
  90. package/templates/vitepress/zh/repoctl/template-assets.md +116 -0
  91. package/templates/vitepress/zh/repoctl/templates.md +159 -0
  92. package/templates/vitepress/zh/repoctl/troubleshooting.md +110 -0
  93. package/templates/vitepress/zh/repoctl/workflows.md +118 -0
  94. package/templates/vitepress/zh/thinking.md +88 -0
  95. package/templates/vitepress/zh/tools/changeset.md +75 -0
  96. package/templates/vitepress/zh/tools/husky.md +130 -0
  97. package/templates/vitepress/zh/tools/index.md +38 -0
  98. package/templates/vitepress/zh/tools/lint-staged.md +103 -0
  99. package/templates/vitepress/zh/tools/llms-txt.md +9 -0
  100. package/templates/vitepress/zh/tools/pnpm.md +127 -0
  101. package/templates/vitepress/zh/tools/renovate.md +91 -0
  102. package/templates/vitepress/zh/tools/turborepo.md +166 -0
  103. package/templates/vitepress/zh/why/assets/npm-dt.svg +15 -0
  104. package/templates/vitepress/zh/why/assets/npm-ts.svg +19 -0
  105. package/templates/vitepress/zh/why/examples/0.npm-basic-package/index.js +10 -0
  106. package/templates/vitepress/zh/why/examples/0.npm-basic-package/package.json +11 -0
  107. package/templates/vitepress/zh/why/examples/1.npm-basic-package/index.cjs +12 -0
  108. package/templates/vitepress/zh/why/examples/1.npm-basic-package/index.d.ts +1 -0
  109. package/templates/vitepress/zh/why/examples/1.npm-basic-package/index.js +8 -0
  110. package/templates/vitepress/zh/why/examples/1.npm-basic-package/package.json +19 -0
  111. package/templates/vitepress/zh/why/examples/2.npm-basic-package/README.md +1 -0
  112. package/templates/vitepress/zh/why/examples/2.npm-basic-package/package-lock.json +30 -0
  113. package/templates/vitepress/zh/why/examples/2.npm-basic-package/package.json +35 -0
  114. package/templates/vitepress/zh/why/examples/2.npm-basic-package/rename-ext.js +24 -0
  115. package/templates/vitepress/zh/why/examples/2.npm-basic-package/src/index.ts +8 -0
  116. package/templates/vitepress/zh/why/examples/2.npm-basic-package/tsconfig.cjs.json +8 -0
  117. package/templates/vitepress/zh/why/examples/2.npm-basic-package/tsconfig.esm.json +7 -0
  118. package/templates/vitepress/zh/why/examples/2.npm-basic-package/tsconfig.json +18 -0
  119. package/templates/vitepress/zh/why/examples/3.npm-basic-package/README.md +1 -0
  120. package/templates/vitepress/zh/why/examples/3.npm-basic-package/package-lock.json +1496 -0
  121. package/templates/vitepress/zh/why/examples/3.npm-basic-package/package.json +31 -0
  122. package/templates/vitepress/zh/why/examples/3.npm-basic-package/src/index.ts +8 -0
  123. package/templates/vitepress/zh/why/examples/3.npm-basic-package/tsconfig.json +16 -0
  124. package/templates/vitepress/zh/why/examples/3.npm-basic-package/tsdown.config.ts +16 -0
  125. package/templates/vitepress/zh/why/examples/usage-cjs/cjs.cjs +4 -0
  126. package/templates/vitepress/zh/why/examples/usage-cjs/esm.mjs +4 -0
  127. package/templates/vitepress/zh/why/examples/usage-cjs/index.js +8 -0
  128. package/templates/vitepress/zh/why/examples/usage-cjs/package-lock.json +36 -0
  129. package/templates/vitepress/zh/why/examples/usage-cjs/package.json +20 -0
  130. package/templates/vitepress/zh/why/examples/usage-esm/cjs.cjs +4 -0
  131. package/templates/vitepress/zh/why/examples/usage-esm/createRequire.js +7 -0
  132. package/templates/vitepress/zh/why/examples/usage-esm/esm.mjs +4 -0
  133. package/templates/vitepress/zh/why/examples/usage-esm/index.js +8 -0
  134. package/templates/vitepress/zh/why/examples/usage-esm/package-lock.json +36 -0
  135. package/templates/vitepress/zh/why/examples/usage-esm/package.json +21 -0
  136. package/templates/vitepress/zh/why/how-to-reuse-js-code.md +250 -0
  137. package/templates/vitepress/zh/why/index.md +1 -0
  138. package/templates/vitepress/zh/why/js-cjs-mjs.md +99 -0
  139. package/templates/vitepress/zh/why/js-keywords.md +132 -0
  140. package/templates/vitepress/zh/why/modern/bundlers.md +52 -0
  141. package/templates/vitepress/zh/why/modern/dts.md +93 -0
  142. package/templates/vitepress/zh/why/modern/esm-vs-cjs.md +84 -0
  143. package/templates/vitepress/zh/why/modern/index.md +55 -0
  144. package/templates/vitepress/zh/why/modern/package-entry-points.md +128 -0
  145. package/templates/vitepress/zh/why/modern/typescript.md +155 -0
  146. package/templates/vitepress/zh/why/publish-basic-npm-package.md +146 -0
  147. package/templates/vitepress/zh/why/what-is-npm-package.md +162 -0
  148. package/templates/vue-lib/package.json +12 -5
  149. package/templates/vue-lib/vitest.config.ts +1 -1
  150. package/assets/.changeset/config.json +0 -21
  151. package/assets/.changeset/publish-versioned-packages.md +0 -5
  152. package/templates/vitepress/en/index.md +0 -63
  153. package/templates/vitepress/en/knowledge/monorepo.md +0 -37
  154. package/templates/vitepress/en/repoctl/adopt-existing.md +0 -133
  155. package/templates/vitepress/en/repoctl/commands.md +0 -120
  156. package/templates/vitepress/en/repoctl/config.md +0 -69
  157. package/templates/vitepress/en/repoctl/getting-started.md +0 -116
  158. package/templates/vitepress/en/repoctl/index.md +0 -74
  159. package/templates/vitepress/en/repoctl/templates.md +0 -128
  160. package/templates/vitepress/en/repoctl/troubleshooting.md +0 -96
  161. package/templates/vitepress/en/repoctl/workflows.md +0 -89
@@ -1,96 +0,0 @@
1
- # Troubleshooting
2
-
3
- repoctl focuses on reports that can be reproduced, saved, and shared.
4
-
5
- ## Start With Doctor
6
-
7
- ```bash
8
- repo doctor
9
- repo doctor --strict
10
- ```
11
-
12
- `doctor` checks:
13
-
14
- - Current directory and repository root.
15
- - Node.js version.
16
- - `pnpm-workspace.yaml`.
17
- - The `repoctl` CLI dependency.
18
- - Recommended root scripts.
19
- - Conflicting config files.
20
- - Husky and lint-staged wiring.
21
-
22
- ## Save A Diagnostic Report
23
-
24
- ```bash
25
- repo doctor --json --out reports/doctor.json
26
- repo doctor --markdown --redact --out reports/doctor.md
27
- ```
28
-
29
- Markdown reports are useful in issues and PRs. `--redact` removes local absolute paths.
30
-
31
- ## Inspect The Verification Plan
32
-
33
- ```bash
34
- repo check --dry-run
35
- repo check --json --out reports/check-plan.json
36
- repo check --markdown --redact --out reports/check-plan.md
37
- ```
38
-
39
- Use this when you need to understand why a file triggers a workspace typecheck or which tasks pre-push would run.
40
-
41
- ## Collect Environment Information
42
-
43
- ```bash
44
- repo env info
45
- repo env support --markdown --redact --out reports/support.md
46
- repo env snapshot --json --out reports/snapshot.json
47
- repo env paths --markdown --redact --out reports/paths.md
48
- ```
49
-
50
- These commands help compare local, CI, Git, Node, pnpm, and workspace differences.
51
-
52
- ## Common Fixes
53
-
54
- ### Not At Repository Root
55
-
56
- Change into the directory that contains `pnpm-workspace.yaml` and the root `package.json`, then run:
57
-
58
- ```bash
59
- repo doctor
60
- ```
61
-
62
- ### Conflicting Config Files
63
-
64
- Keep only:
65
-
66
- ```txt
67
- repoctl.config.ts
68
- ```
69
-
70
- `monorepo.config.ts` is no longer loaded at runtime; rename it to `repoctl.config.ts`.
71
-
72
- ### Unknown Template Key
73
-
74
- List available templates:
75
-
76
- ```bash
77
- repo templates
78
- ```
79
-
80
- Explicit `--template` values are validated first. Invalid keys fail with suggestions.
81
-
82
- ### Automation Should Not Prompt
83
-
84
- Use non-interactive options:
85
-
86
- ```bash
87
- repo init --yes
88
- repo upgrade --no-overwrite
89
- repo check --json --out reports/check-plan.json
90
- ```
91
-
92
- ## Keep Reading
93
-
94
- - [Workflows and CI](./workflows.md)
95
- - [Command Reference](./commands.md)
96
- - [Command Aliases](./aliases.md)
@@ -1,89 +0,0 @@
1
- # Workflows and CI
2
-
3
- repoctl commands have two audiences: humans using short daily commands, and automation consuming stable reports.
4
-
5
- ## Local Daily Workflow
6
-
7
- ```bash
8
- pnpm install
9
- pnpm run repo:doctor
10
- pnpm run repo:new -- sdk --template tsdown
11
- pnpm run repo:check
12
- pnpm build
13
- ```
14
-
15
- | Step | What It Proves |
16
- | ---------------------- | ------------------------------------------------------- |
17
- | `pnpm install` | Workspace dependencies and local links are ready |
18
- | `pnpm run repo:doctor` | Root files, Node, scripts, config, and hooks are usable |
19
- | `pnpm run repo:new` | New packages follow template conventions |
20
- | `pnpm run repo:check` | The lightweight local verification flow is reproducible |
21
- | `pnpm build` | The workspace build graph has no obvious breakage |
22
-
23
- ## Adopt An Existing Repository
24
-
25
- ```bash
26
- pnpm add -D repoctl
27
- pnpm exec repo init --yes
28
- pnpm exec repo doctor --markdown --out reports/doctor.md
29
- pnpm exec repo upgrade --no-overwrite
30
- pnpm exec repo doctor
31
- ```
32
-
33
- Start conservatively with `--no-overwrite`. After reviewing asset drift, decide whether `--yes` or `--overwrite` is appropriate.
34
-
35
- ## Fast CI Gate
36
-
37
- ```bash
38
- pnpm install --frozen-lockfile
39
- pnpm exec repo doctor --strict
40
- pnpm exec repo check --full
41
- ```
42
-
43
- This is a simple gate for small repositories or early projects. `doctor --strict` treats warnings as failures.
44
-
45
- ## CI Report Mode
46
-
47
- ```bash
48
- pnpm exec repo doctor --json --out reports/doctor.json
49
- pnpm exec repo check --json --out reports/check-plan.json
50
- pnpm exec repo env support --markdown --redact --out reports/support.md
51
- ```
52
-
53
- Use these outputs as CI artifacts:
54
-
55
- - `doctor.json` for scripts.
56
- - `check-plan.json` to explain verification routing.
57
- - `support.md` for issues, PRs, and external collaboration.
58
-
59
- ## Hooks
60
-
61
- ```bash
62
- repo verify pre-commit
63
- repo verify staged-typecheck packages/app/src/main.ts
64
- repo verify commit-msg .git/COMMIT_EDITMSG
65
- repo verify pre-push
66
- ```
67
-
68
- | Stage | Recommended Behavior |
69
- | ---------- | --------------------------------------------------------- |
70
- | pre-commit | Focus on staged files, lint, and workspace typecheck |
71
- | commit-msg | Enforce Conventional Commit messages |
72
- | pre-push | Run root lint/typecheck and affected build/test/tsd tasks |
73
-
74
- ## Non-Interactive Options
75
-
76
- | Scenario | Option |
77
- | ------------------------------------- | -------------------------------------------------- |
78
- | Accept setup defaults | `repo init --yes` |
79
- | Preserve changed files during upgrade | `repo upgrade --no-overwrite` |
80
- | Explicitly overwrite standard assets | `repo upgrade --yes` or `repo upgrade --overwrite` |
81
- | Preview only | `--dry-run` |
82
- | Output for scripts | `--json --out <file>` |
83
- | Share a redacted report | `--markdown --redact --out <file>` |
84
-
85
- ## Keep Reading
86
-
87
- - [Command Reference](./commands.md)
88
- - [Troubleshooting](./troubleshooting.md)
89
- - [Command Aliases](./aliases.md)