@icebreakers/monorepo-templates 1.2.0 → 1.3.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/.github/workflows/ci.yml +4 -4
- package/assets/.github/workflows/release.yml +10 -7
- package/assets/package.json +2 -1
- package/assets/pnpm-workspace.yaml +2 -9
- package/assets/renovate.json +0 -1
- package/assets-data.mjs +0 -1
- package/dist/cli.mjs +1 -1
- package/dist/index.mjs +1 -1
- package/dist/{prepare-CNCmvco-.mjs → prepare-D7eJqEqy.mjs} +21 -2
- package/package.json +5 -3
- package/templates/cli/package.json +1 -1
- package/templates/client/package.json +1 -1
- package/templates/server/package.json +1 -1
- package/templates/tsdown/package.json +1 -1
- package/templates/vitepress/.vitepress/config.ts +9 -119
- package/templates/vitepress/.vitepress/env.d.ts +1 -0
- package/templates/vitepress/.vitepress/home/content.ts +186 -0
- package/templates/vitepress/.vitepress/home/types.ts +65 -0
- package/templates/vitepress/.vitepress/navigation/routes.ts +138 -0
- package/templates/vitepress/.vitepress/seo.ts +40 -0
- package/templates/vitepress/.vitepress/theme/components/HomePage.vue +134 -0
- package/templates/vitepress/.vitepress/theme/home/foundation.css +180 -0
- package/templates/vitepress/.vitepress/theme/home/index.css +3 -0
- package/templates/vitepress/.vitepress/theme/home/responsive.css +49 -0
- package/templates/vitepress/.vitepress/theme/home/sections.css +153 -0
- package/templates/vitepress/.vitepress/theme/index.ts +9 -1
- package/templates/vitepress/ai/llms-txt.md +2 -2
- package/templates/vitepress/index.md +6 -60
- package/templates/vitepress/package.json +11 -4
- package/templates/vitepress/public/repoctl-doctor.png +0 -0
- package/templates/vitepress/repoctl/workflows.md +35 -0
- package/templates/vitepress/scripts/check-locales.ts +162 -0
- package/templates/vitepress/thinking.md +15 -0
- package/templates/vitepress/tools/changeset.md +17 -12
- package/templates/vitepress/tools/husky.md +41 -3
- package/templates/vitepress/tools/lint-staged.md +32 -5
- package/templates/vitepress/tools/pnpm.md +39 -7
- package/templates/vitepress/tools/renovate.md +27 -3
- package/templates/vitepress/tools/turborepo.md +33 -7
- package/templates/vitepress/tsconfig.json +7 -0
- package/templates/vitepress/why/examples/2.npm-basic-package/README.md +1 -1
- package/templates/vitepress/why/examples/3.npm-basic-package/README.md +1 -1
- package/templates/vitepress/why/how-to-reuse-js-code.md +36 -6
- package/templates/vitepress/why/js-cjs-mjs.md +31 -9
- package/templates/vitepress/why/js-keywords.md +33 -4
- package/templates/vitepress/why/modern/bundlers.md +37 -2
- package/templates/vitepress/why/modern/dts.md +44 -3
- package/templates/vitepress/why/modern/esm-vs-cjs.md +38 -3
- package/templates/vitepress/why/modern/index.md +33 -9
- package/templates/vitepress/why/modern/package-entry-points.md +33 -4
- package/templates/vitepress/why/modern/typescript.md +40 -4
- package/templates/vitepress/why/publish-basic-npm-package.md +37 -13
- package/templates/vitepress/why/what-is-npm-package.md +32 -3
- package/templates/vitepress/wrangler.jsonc +20 -3
- package/templates/vitepress/zh/ai/index.md +1 -1
- package/templates/vitepress/zh/ai/llms-txt.md +1 -1
- package/templates/vitepress/zh/index.md +6 -63
- package/templates/vitepress/zh/repoctl/workflows.md +35 -0
- package/templates/vitepress/zh/thinking.md +9 -6
- package/templates/vitepress/zh/why/examples/2.npm-basic-package/README.md +1 -1
- package/templates/vitepress/zh/why/examples/3.npm-basic-package/README.md +1 -1
- package/templates/vitepress/zh/why/index.md +38 -1
- package/templates/vue-lib/package.json +1 -1
- package/assets/.changeset/ledger.yaml +0 -51
- package/assets/netlify.toml +0 -14
|
@@ -27,14 +27,14 @@ jobs:
|
|
|
27
27
|
|
|
28
28
|
steps:
|
|
29
29
|
- name: Check out code
|
|
30
|
-
uses: actions/checkout@v7
|
|
30
|
+
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
31
31
|
with:
|
|
32
32
|
fetch-depth: 2
|
|
33
33
|
|
|
34
|
-
- uses: pnpm/action-setup@v6
|
|
34
|
+
- uses: pnpm/action-setup@0977fd99725f1db4007ccb2928dbb4e90d06cc86 # v6.0.10
|
|
35
35
|
|
|
36
36
|
- name: Setup Node.js environment
|
|
37
|
-
uses: actions/setup-node@v7
|
|
37
|
+
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
|
|
38
38
|
with:
|
|
39
39
|
node-version: ${{ matrix.node-version }}
|
|
40
40
|
cache: pnpm
|
|
@@ -68,6 +68,6 @@ jobs:
|
|
|
68
68
|
run: pnpm test
|
|
69
69
|
|
|
70
70
|
- name: Upload coverage reports to Codecov
|
|
71
|
-
uses: codecov/codecov-action@v7
|
|
71
|
+
uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0
|
|
72
72
|
env:
|
|
73
73
|
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
|
|
@@ -30,8 +30,6 @@ on:
|
|
|
30
30
|
required: false
|
|
31
31
|
type: string
|
|
32
32
|
|
|
33
|
-
concurrency: ${{ github.workflow }}-${{ github.ref }}
|
|
34
|
-
|
|
35
33
|
env:
|
|
36
34
|
HUSKY: 0
|
|
37
35
|
NPM_CONFIG_PROVENANCE: true
|
|
@@ -42,19 +40,24 @@ permissions:
|
|
|
42
40
|
pull-requests: write
|
|
43
41
|
id-token: write
|
|
44
42
|
|
|
43
|
+
concurrency:
|
|
44
|
+
group: ${{ github.workflow }}-${{ github.ref }}
|
|
45
|
+
cancel-in-progress: false
|
|
46
|
+
|
|
45
47
|
jobs:
|
|
46
48
|
release:
|
|
47
|
-
if: github.event_name == 'push' || github.event_name == 'workflow_dispatch'
|
|
48
49
|
name: Release
|
|
49
50
|
runs-on: ubuntu-latest
|
|
50
51
|
steps:
|
|
51
52
|
- name: Checkout Repo
|
|
52
|
-
uses: actions/checkout@v7
|
|
53
|
+
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
54
|
+
with:
|
|
55
|
+
fetch-depth: 0
|
|
53
56
|
|
|
54
|
-
- uses: pnpm/action-setup@v6
|
|
57
|
+
- uses: pnpm/action-setup@0977fd99725f1db4007ccb2928dbb4e90d06cc86 # v6.0.10
|
|
55
58
|
|
|
56
59
|
- name: Setup Node.js environment
|
|
57
|
-
uses: actions/setup-node@v7
|
|
60
|
+
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
|
|
58
61
|
with:
|
|
59
62
|
node-version: 24
|
|
60
63
|
cache: pnpm
|
|
@@ -65,7 +68,7 @@ jobs:
|
|
|
65
68
|
|
|
66
69
|
- name: Run repo release CI
|
|
67
70
|
env:
|
|
68
|
-
GITHUB_TOKEN: ${{ github.token }}
|
|
71
|
+
GITHUB_TOKEN: ${{ secrets.REPOCTL_RELEASE_TOKEN || secrets.CHANGESETS_RELEASE_TOKEN || github.token }}
|
|
69
72
|
REPO_RELEASE_MODE: ${{ inputs.mode || 'auto' }}
|
|
70
73
|
REPO_RELEASE_PACKAGE: ${{ inputs.package }}
|
|
71
74
|
REPO_RELEASE_VERSION: ${{ inputs.version }}
|
package/assets/package.json
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
"packageManager": "pnpm@11.22.0",
|
|
7
7
|
"description": "Source workspace for repoctl, a task-first CLI for pnpm and Turborepo monorepos",
|
|
8
8
|
"author": "ice breaker <hi@sonofmagic.top>",
|
|
9
|
-
"homepage": "https://
|
|
9
|
+
"homepage": "https://repoctl.icebreaker.top",
|
|
10
10
|
"repository": {
|
|
11
11
|
"type": "git",
|
|
12
12
|
"url": "git+https://github.com/sonofmagic/repoctl.git"
|
|
@@ -29,6 +29,7 @@
|
|
|
29
29
|
"tooling:build": "turbo run build --filter=@icebreakers/monorepo --filter=repoctl",
|
|
30
30
|
"dev": "turbo run dev --parallel",
|
|
31
31
|
"test": "vitest run",
|
|
32
|
+
"test:packaged-doctor": "node scripts/smoke-packaged-doctor.mjs",
|
|
32
33
|
"test:dev": "vitest",
|
|
33
34
|
"lint": "pnpm run tooling:build && turbo run lint",
|
|
34
35
|
"tsd": "turbo run tsd",
|
|
@@ -2,20 +2,13 @@ packages:
|
|
|
2
2
|
- apps/*
|
|
3
3
|
- packages/*
|
|
4
4
|
- templates/*
|
|
5
|
-
-
|
|
6
|
-
|
|
5
|
+
- "!**/test/**"
|
|
7
6
|
minimumReleaseAge: 0
|
|
8
|
-
|
|
9
7
|
versioning:
|
|
10
|
-
fixed:
|
|
11
|
-
- ['@icebreakers/monorepo', repoctl]
|
|
12
|
-
ignore:
|
|
13
|
-
- '@icebreakers/client'
|
|
14
8
|
changelog:
|
|
15
9
|
storage: repository
|
|
16
|
-
|
|
17
10
|
allowBuilds:
|
|
18
|
-
|
|
11
|
+
"@tailwindcss/oxide": true
|
|
19
12
|
esbuild: true
|
|
20
13
|
msgpackr-extract: true
|
|
21
14
|
sharp: true
|
package/assets/renovate.json
CHANGED
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-D7eJqEqy.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";
|
|
@@ -2,6 +2,7 @@ import * as path$1 from "node:path";
|
|
|
2
2
|
import path from "node:path";
|
|
3
3
|
import { fileURLToPath } from "node:url";
|
|
4
4
|
import fs from "node:fs/promises";
|
|
5
|
+
import YAML from "yaml";
|
|
5
6
|
//#region assets-data.mjs
|
|
6
7
|
const coreAssetTargets = [
|
|
7
8
|
".changeset",
|
|
@@ -31,8 +32,7 @@ const extraAssetTargets = [
|
|
|
31
32
|
"renovate.json",
|
|
32
33
|
"SECURITY.md",
|
|
33
34
|
"CODE_OF_CONDUCT.md",
|
|
34
|
-
"CONTRIBUTING.md"
|
|
35
|
-
"netlify.toml"
|
|
35
|
+
"CONTRIBUTING.md"
|
|
36
36
|
];
|
|
37
37
|
const assetTargets = [...coreAssetTargets, ...extraAssetTargets];
|
|
38
38
|
function getAssetTargets(core = false) {
|
|
@@ -201,6 +201,14 @@ const sourceRepoReleaseToolingBuildStepPattern = /\r?\n\s+- name: Build Release
|
|
|
201
201
|
function removeSourceRepoReleaseToolingBuildStepContent(content) {
|
|
202
202
|
return content.replaceAll(sourceRepoReleaseToolingBuildStepPattern, "\n");
|
|
203
203
|
}
|
|
204
|
+
function sanitizePublishedWorkspaceContent(content) {
|
|
205
|
+
const workspace = YAML.parse(content);
|
|
206
|
+
if (!workspace?.versioning || typeof workspace.versioning !== "object") return content;
|
|
207
|
+
delete workspace.versioning["fixed"];
|
|
208
|
+
delete workspace.versioning["ignore"];
|
|
209
|
+
delete workspace.versioning["lanes"];
|
|
210
|
+
return YAML.stringify(workspace);
|
|
211
|
+
}
|
|
204
212
|
async function pathExists(targetPath) {
|
|
205
213
|
try {
|
|
206
214
|
await fs.access(targetPath);
|
|
@@ -286,6 +294,15 @@ async function writePublishedToolingConfigs() {
|
|
|
286
294
|
if (await pathExists(targetPath)) await fs.writeFile(targetPath, content);
|
|
287
295
|
}));
|
|
288
296
|
}
|
|
297
|
+
async function sanitizePublishedWorkspace() {
|
|
298
|
+
const workspacePath = path$1.join(assetsDir, "pnpm-workspace.yaml");
|
|
299
|
+
if (!await pathExists(workspacePath)) return;
|
|
300
|
+
const content = await fs.readFile(workspacePath, "utf8");
|
|
301
|
+
await fs.writeFile(workspacePath, sanitizePublishedWorkspaceContent(content), "utf8");
|
|
302
|
+
}
|
|
303
|
+
async function removePublishedReleaseState() {
|
|
304
|
+
await fs.rm(path$1.join(assetsDir, ".changeset", "ledger.yaml"), { force: true });
|
|
305
|
+
}
|
|
289
306
|
async function removeSourceRepoReleaseToolingBuildStep() {
|
|
290
307
|
const releaseWorkflowPath = path$1.join(assetsDir, ".github/workflows/release.yml");
|
|
291
308
|
if (!await pathExists(releaseWorkflowPath)) return;
|
|
@@ -310,6 +327,8 @@ async function prepareAssets(options = {}) {
|
|
|
310
327
|
await resetDir(assetsDir, overwriteExisting);
|
|
311
328
|
await resetDir(templatesDir, overwriteExisting);
|
|
312
329
|
await copyAssets(repoRoot, overwriteExisting);
|
|
330
|
+
await sanitizePublishedWorkspace();
|
|
331
|
+
await removePublishedReleaseState();
|
|
313
332
|
await writePublishedToolingConfigs();
|
|
314
333
|
await removeSourceRepoReleaseToolingBuildStep();
|
|
315
334
|
await copyTemplates(repoRoot, overwriteExisting);
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@icebreakers/monorepo-templates",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.3.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",
|
|
8
|
-
"homepage": "https://
|
|
8
|
+
"homepage": "https://repoctl.icebreaker.top",
|
|
9
9
|
"repository": {
|
|
10
10
|
"type": "git",
|
|
11
11
|
"url": "git+https://github.com/sonofmagic/repoctl.git",
|
|
@@ -49,7 +49,8 @@
|
|
|
49
49
|
"@inquirer/input": "^5.1.2",
|
|
50
50
|
"@inquirer/select": "^5.2.1",
|
|
51
51
|
"commander": "^15.0.0",
|
|
52
|
-
"nanoexec": "^1.1.0"
|
|
52
|
+
"nanoexec": "^1.1.0",
|
|
53
|
+
"yaml": "^2.9.0"
|
|
53
54
|
},
|
|
54
55
|
"publishConfig": {
|
|
55
56
|
"access": "public"
|
|
@@ -57,6 +58,7 @@
|
|
|
57
58
|
"scripts": {
|
|
58
59
|
"dev": "tsdown --watch --sourcemap",
|
|
59
60
|
"build": "tsdown",
|
|
61
|
+
"test": "vitest run",
|
|
60
62
|
"typecheck": "node ../../node_modules/typescript/bin/tsc -p tsconfig.json",
|
|
61
63
|
"tsd": "pnpm build && tsd --files test-d/**/*.test-d.ts",
|
|
62
64
|
"sync:assets": "pnpm run build && node dist/cli.mjs",
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
"description": "Internal CLI template shipped with repoctl",
|
|
7
7
|
"author": "ice breaker <hi@sonofmagic.top>",
|
|
8
8
|
"license": "MIT",
|
|
9
|
-
"homepage": "https://
|
|
9
|
+
"homepage": "https://repoctl.icebreaker.top",
|
|
10
10
|
"repository": {
|
|
11
11
|
"type": "git",
|
|
12
12
|
"url": "git+https://github.com/sonofmagic/repoctl.git",
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"version": "0.0.1",
|
|
5
5
|
"private": true,
|
|
6
6
|
"description": "Internal Vue and Cloudflare application template shipped with repoctl",
|
|
7
|
-
"homepage": "https://
|
|
7
|
+
"homepage": "https://repoctl.icebreaker.top",
|
|
8
8
|
"repository": {
|
|
9
9
|
"type": "git",
|
|
10
10
|
"url": "git+https://github.com/sonofmagic/repoctl.git",
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
"description": "Internal server package template shipped with repoctl",
|
|
7
7
|
"author": "ice breaker <hi@sonofmagic.top>",
|
|
8
8
|
"license": "MIT",
|
|
9
|
-
"homepage": "https://
|
|
9
|
+
"homepage": "https://repoctl.icebreaker.top",
|
|
10
10
|
"repository": {
|
|
11
11
|
"type": "git",
|
|
12
12
|
"url": "git+https://github.com/sonofmagic/repoctl.git",
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
"description": "Internal TypeScript library template shipped with repoctl",
|
|
7
7
|
"author": "ice breaker <hi@sonofmagic.top>",
|
|
8
8
|
"license": "MIT",
|
|
9
|
-
"homepage": "https://
|
|
9
|
+
"homepage": "https://repoctl.icebreaker.top",
|
|
10
10
|
"repository": {
|
|
11
11
|
"type": "git",
|
|
12
12
|
"url": "git+https://github.com/sonofmagic/repoctl.git",
|
|
@@ -2,106 +2,8 @@ import Tailwindcss from '@tailwindcss/vite'
|
|
|
2
2
|
import { defineConfig } from 'vitepress'
|
|
3
3
|
import llmstxt from 'vitepress-plugin-llms'
|
|
4
4
|
import { withMermaid } from 'vitepress-plugin-mermaid'
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
repoctl: string
|
|
8
|
-
repoctlItems: string[]
|
|
9
|
-
knowledge: string
|
|
10
|
-
knowledgeItems: string[]
|
|
11
|
-
packages: string
|
|
12
|
-
packageItems: string[]
|
|
13
|
-
ai: string
|
|
14
|
-
aiItems: string[]
|
|
15
|
-
tools: string
|
|
16
|
-
toolItems: string[]
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
const repoctlPaths = [
|
|
20
|
-
'',
|
|
21
|
-
'getting-started',
|
|
22
|
-
'adopt-existing',
|
|
23
|
-
'scenarios',
|
|
24
|
-
'execution-model',
|
|
25
|
-
'commands',
|
|
26
|
-
'checks',
|
|
27
|
-
'doctor',
|
|
28
|
-
'config',
|
|
29
|
-
'templates',
|
|
30
|
-
'template-assets',
|
|
31
|
-
'workflows',
|
|
32
|
-
'reports',
|
|
33
|
-
'troubleshooting',
|
|
34
|
-
'aliases',
|
|
35
|
-
]
|
|
36
|
-
const knowledgePaths = ['', 'manage', 'publish', 'commands', 'templates', 'troubleshooting']
|
|
37
|
-
const packagePaths = [
|
|
38
|
-
'how-to-reuse-js-code',
|
|
39
|
-
'js-cjs-mjs',
|
|
40
|
-
'js-keywords',
|
|
41
|
-
'what-is-npm-package',
|
|
42
|
-
'publish-basic-npm-package',
|
|
43
|
-
'index',
|
|
44
|
-
'modern/',
|
|
45
|
-
'modern/esm-vs-cjs',
|
|
46
|
-
'modern/dts',
|
|
47
|
-
'modern/package-entry-points',
|
|
48
|
-
'modern/bundlers',
|
|
49
|
-
'modern/typescript',
|
|
50
|
-
]
|
|
51
|
-
const aiPaths = ['', 'llms-txt']
|
|
52
|
-
const toolPaths = ['', 'pnpm', 'turborepo', 'changeset', 'husky', 'lint-staged', 'renovate', 'llms-txt']
|
|
53
|
-
|
|
54
|
-
const englishLabels: SidebarLabels = {
|
|
55
|
-
repoctl: 'repoctl',
|
|
56
|
-
repoctlItems: ['Overview', 'Getting Started', 'Adopt Existing Repos', 'Choose By Scenario', 'Execution Model', 'Command Reference', 'Verification', 'Doctor', 'Configuration', 'Templates', 'Template Assets', 'Workflows and CI', 'Reports', 'Troubleshooting', 'Command Aliases'],
|
|
57
|
-
knowledge: 'Knowledge Base',
|
|
58
|
-
knowledgeItems: ['Why Monorepo', 'Managing A Monorepo', 'Publishing and Changelogs', 'Monorepo Commands', 'Template Systems', 'Troubleshooting'],
|
|
59
|
-
packages: 'Modern Packages',
|
|
60
|
-
packageItems: ['Reusing JavaScript', 'Module Extensions', 'Runtime Globals', 'What Is An npm Package?', 'Publishing A Package', 'Package Evolution', 'Modern Package Guide', 'ESM vs CommonJS', 'Type Declarations', 'Package Entry Points', 'Bundlers', 'TypeScript'],
|
|
61
|
-
ai: 'AI',
|
|
62
|
-
aiItems: ['AI Documentation', 'llms.txt'],
|
|
63
|
-
tools: 'Tool Guides',
|
|
64
|
-
toolItems: ['Overview', 'pnpm', 'Turborepo', 'pnpm Versioning', 'Husky', 'lint-staged', 'Renovate', 'llms.txt'],
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
const chineseLabels: SidebarLabels = {
|
|
68
|
-
repoctl: 'repoctl',
|
|
69
|
-
repoctlItems: ['概览', '快速开始', '接入已有仓库', '按场景选命令', '执行模型', '命令速查', '校验链路', 'Doctor 诊断', '配置文件', '模板与创建', '模板资产治理', '工作流与 CI', '报告与自动化输出', '排障', '命令别名'],
|
|
70
|
-
knowledge: '知识库',
|
|
71
|
-
knowledgeItems: ['为什么使用 Monorepo', '管理 Monorepo', '发包与变更日志', 'Monorepo 命令', '模板体系', '常见问题排障'],
|
|
72
|
-
packages: '现代 npm 包',
|
|
73
|
-
packageItems: ['复用 JavaScript', '模块文件后缀', '运行时关键字', '什么是 npm 包', '发布 npm 包', '包的演进', '现代包指南', 'ESM 与 CommonJS', '类型声明', '包入口', '构建工具', 'TypeScript'],
|
|
74
|
-
ai: 'AI',
|
|
75
|
-
aiItems: ['AI 文档', 'llms.txt'],
|
|
76
|
-
tools: '工具专题',
|
|
77
|
-
toolItems: ['概览', 'pnpm', 'Turborepo', 'pnpm Versioning', 'Husky', 'lint-staged', 'Renovate', 'llms.txt'],
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
function prefixed(prefix: string, section: string, paths: string[], labels: string[]) {
|
|
81
|
-
return paths.map((path, index) => ({
|
|
82
|
-
text: labels[index]!,
|
|
83
|
-
link: `${prefix}/${section}/${path}`.replace(/\/+/g, '/'),
|
|
84
|
-
}))
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
function createSidebars(prefix: '' | '/zh', labels: SidebarLabels) {
|
|
88
|
-
const repoctl = [{ text: labels.repoctl, items: prefixed(prefix, 'repoctl', repoctlPaths, labels.repoctlItems) }]
|
|
89
|
-
const knowledge = [
|
|
90
|
-
{ text: labels.knowledge, items: prefixed(prefix, 'monorepo', knowledgePaths, labels.knowledgeItems) },
|
|
91
|
-
{ text: labels.packages, items: prefixed(prefix, 'why', packagePaths, labels.packageItems) },
|
|
92
|
-
]
|
|
93
|
-
const ai = [{ text: labels.ai, items: prefixed(prefix, 'ai', aiPaths, labels.aiItems) }]
|
|
94
|
-
const tools = [{ text: labels.tools, items: prefixed(prefix, 'tools', toolPaths, labels.toolItems) }]
|
|
95
|
-
return {
|
|
96
|
-
[`${prefix}/repoctl/`]: repoctl,
|
|
97
|
-
[`${prefix}/knowledge/`]: knowledge,
|
|
98
|
-
[`${prefix}/monorepo/`]: knowledge,
|
|
99
|
-
[`${prefix}/why/`]: knowledge,
|
|
100
|
-
[`${prefix}/ai/`]: ai,
|
|
101
|
-
[`${prefix}/tools/`]: tools,
|
|
102
|
-
[`${prefix || ''}/`]: repoctl,
|
|
103
|
-
}
|
|
104
|
-
}
|
|
5
|
+
import { createNav, createSidebars } from './navigation/routes'
|
|
6
|
+
import { createPageHead, siteOrigin } from './seo'
|
|
105
7
|
|
|
106
8
|
export default withMermaid(defineConfig({
|
|
107
9
|
outDir: '.vitepress/dist',
|
|
@@ -109,6 +11,8 @@ export default withMermaid(defineConfig({
|
|
|
109
11
|
description: 'Task-first CLI for initializing, maintaining, validating, and releasing pnpm and Turborepo monorepos.',
|
|
110
12
|
lastUpdated: true,
|
|
111
13
|
cleanUrls: true,
|
|
14
|
+
sitemap: { hostname: siteOrigin },
|
|
15
|
+
transformHead: createPageHead,
|
|
112
16
|
head: [['link', { rel: 'icon', href: '/logo.jpg' }]],
|
|
113
17
|
themeConfig: {
|
|
114
18
|
logo: '/logo.jpg',
|
|
@@ -122,16 +26,9 @@ export default withMermaid(defineConfig({
|
|
|
122
26
|
title: 'repoctl',
|
|
123
27
|
description: 'Task-first CLI for practical pnpm and Turborepo monorepos.',
|
|
124
28
|
themeConfig: {
|
|
125
|
-
nav:
|
|
126
|
-
{ text: 'repoctl', link: '/repoctl/' },
|
|
127
|
-
{ text: 'Getting Started', link: '/repoctl/getting-started' },
|
|
128
|
-
{ text: 'Commands', link: '/repoctl/commands' },
|
|
129
|
-
{ text: 'Knowledge Base', link: '/knowledge/' },
|
|
130
|
-
{ text: 'AI Docs', link: '/ai/' },
|
|
131
|
-
{ text: 'Tool Guides', link: '/tools/' },
|
|
132
|
-
],
|
|
29
|
+
nav: createNav('en'),
|
|
133
30
|
outline: { label: 'On This Page', level: [2, 3] },
|
|
134
|
-
sidebar: createSidebars(''
|
|
31
|
+
sidebar: createSidebars('en'),
|
|
135
32
|
editLink: {
|
|
136
33
|
pattern: 'https://github.com/sonofmagic/repoctl/edit/main/templates/vitepress/:path',
|
|
137
34
|
text: 'Edit this page',
|
|
@@ -147,16 +44,9 @@ export default withMermaid(defineConfig({
|
|
|
147
44
|
title: 'repoctl',
|
|
148
45
|
description: '面向 pnpm 与 Turborepo monorepo 的任务型 CLI。',
|
|
149
46
|
themeConfig: {
|
|
150
|
-
nav:
|
|
151
|
-
{ text: 'repoctl', link: '/zh/repoctl/' },
|
|
152
|
-
{ text: '快速开始', link: '/zh/repoctl/getting-started' },
|
|
153
|
-
{ text: '命令', link: '/zh/repoctl/commands' },
|
|
154
|
-
{ text: '知识库', link: '/zh/knowledge/' },
|
|
155
|
-
{ text: 'AI 文档', link: '/zh/ai/' },
|
|
156
|
-
{ text: '工具专题', link: '/zh/tools/' },
|
|
157
|
-
],
|
|
47
|
+
nav: createNav('zh'),
|
|
158
48
|
outline: { label: '目录', level: [2, 3] },
|
|
159
|
-
sidebar: createSidebars('
|
|
49
|
+
sidebar: createSidebars('zh'),
|
|
160
50
|
editLink: {
|
|
161
51
|
pattern: 'https://github.com/sonofmagic/repoctl/edit/main/templates/vitepress/:path',
|
|
162
52
|
text: '为此页提供修改建议',
|
|
@@ -173,7 +63,7 @@ export default withMermaid(defineConfig({
|
|
|
173
63
|
llmstxt({
|
|
174
64
|
title: 'repoctl',
|
|
175
65
|
description: 'Task-first CLI for pnpm and Turborepo monorepos. Simplified Chinese documentation is available under /zh/.',
|
|
176
|
-
domain:
|
|
66
|
+
domain: siteOrigin,
|
|
177
67
|
ignoreFiles: [
|
|
178
68
|
'zh/**',
|
|
179
69
|
'en/**',
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
declare module '*.css'
|
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
import type { DocsLocale } from '../navigation/routes'
|
|
2
|
+
import type { HomeContent } from './types'
|
|
3
|
+
|
|
4
|
+
const english = {
|
|
5
|
+
hero: {
|
|
6
|
+
label: 'Task-first monorepo operations',
|
|
7
|
+
title: 'Run monorepo work.',
|
|
8
|
+
description: 'One CLI for setup, diagnosis, scaffolding, verification, and release work in pnpm monorepos.',
|
|
9
|
+
primary: { label: 'Get Started', href: '/repoctl/getting-started' },
|
|
10
|
+
secondary: { label: 'Explore Commands', href: '/repoctl/commands' },
|
|
11
|
+
imageAlt: 'A real repoctl doctor report for this workspace',
|
|
12
|
+
},
|
|
13
|
+
proof: ['pnpm-native', 'Turborepo-aware', 'Dry-run first', 'JSON and Markdown reports', 'Built for CI'],
|
|
14
|
+
lifecycle: {
|
|
15
|
+
title: 'A stable task lifecycle',
|
|
16
|
+
description: 'Each command answers one repository question and leaves a reportable result.',
|
|
17
|
+
steps: [
|
|
18
|
+
{ title: 'Initialize', body: 'Install managed root assets and the standard repo scripts.', command: 'repo init' },
|
|
19
|
+
{ title: 'Diagnose', body: 'Inspect workspace structure, tool versions, hooks, and release configuration.', command: 'repo doctor' },
|
|
20
|
+
{ title: 'Create', body: 'Choose a known template and preview every planned file before writing.', command: 'repo new' },
|
|
21
|
+
{ title: 'Verify', body: 'Route lint, typecheck, build, test, and tsd through one repeatable plan.', command: 'repo check' },
|
|
22
|
+
{ title: 'Release', body: 'Record change intent, version fixed groups, publish, and complete hooks.', command: 'repo release' },
|
|
23
|
+
],
|
|
24
|
+
},
|
|
25
|
+
paths: {
|
|
26
|
+
title: 'Start where your repository is',
|
|
27
|
+
description: 'repoctl supports greenfield workspaces and careful adoption without forcing the same migration path.',
|
|
28
|
+
items: [
|
|
29
|
+
{
|
|
30
|
+
title: 'Create a new workspace',
|
|
31
|
+
body: 'Bootstrap the managed conventions, then scaffold only the packages and applications you need.',
|
|
32
|
+
commands: ['pnpm create repoctl', 'pnpm run repo:new'],
|
|
33
|
+
href: '/repoctl/getting-started',
|
|
34
|
+
linkLabel: 'Create a repository',
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
title: 'Adopt an existing workspace',
|
|
38
|
+
body: 'Capture a redacted baseline, preview asset drift, and opt into changes in reviewable steps.',
|
|
39
|
+
commands: ['repo doctor --markdown --redact', 'repo upgrade --no-overwrite'],
|
|
40
|
+
href: '/repoctl/adopt-existing',
|
|
41
|
+
linkLabel: 'Plan an adoption',
|
|
42
|
+
},
|
|
43
|
+
],
|
|
44
|
+
},
|
|
45
|
+
capabilities: {
|
|
46
|
+
title: 'Repository work with explicit boundaries',
|
|
47
|
+
description: 'The CLI keeps templates, managed assets, checks, and reports separate so automation stays understandable.',
|
|
48
|
+
items: [
|
|
49
|
+
{ title: 'Managed assets', body: 'Compare standard root files before replacing local decisions.' },
|
|
50
|
+
{ title: 'Template catalog', body: 'Create libraries, CLIs, services, clients, and docs from named templates.' },
|
|
51
|
+
{ title: 'Verification planner', body: 'See the exact task graph in dry-run, JSON, or Markdown before execution.' },
|
|
52
|
+
{ title: 'Environment reports', body: 'Share redacted support context without leaking repository paths or tokens.' },
|
|
53
|
+
],
|
|
54
|
+
},
|
|
55
|
+
commands: {
|
|
56
|
+
title: 'A command map you can remember',
|
|
57
|
+
description: 'Daily commands stay short. Explicit modes are available when scripts need stable output.',
|
|
58
|
+
items: [
|
|
59
|
+
{ command: 'repo init', purpose: 'Set up conventions' },
|
|
60
|
+
{ command: 'repo doctor', purpose: 'Diagnose repository health' },
|
|
61
|
+
{ command: 'repo templates', purpose: 'Inspect available templates' },
|
|
62
|
+
{ command: 'repo new', purpose: 'Create a workspace project' },
|
|
63
|
+
{ command: 'repo check', purpose: 'Plan or run verification' },
|
|
64
|
+
{ command: 'repo env', purpose: 'Report runtime context' },
|
|
65
|
+
{ command: 'repo upgrade', purpose: 'Reconcile managed assets' },
|
|
66
|
+
{ command: 'repo release', purpose: 'Version and publish packages' },
|
|
67
|
+
],
|
|
68
|
+
},
|
|
69
|
+
automation: {
|
|
70
|
+
title: 'Readable by people and automation',
|
|
71
|
+
description: 'Preview destructive work, write stable artifacts, and redact support output at the command boundary.',
|
|
72
|
+
formats: ['Terminal', 'JSON', 'Markdown', 'File output'],
|
|
73
|
+
code: 'repo check --full --dry-run --json --out reports/check-plan.json\nrepo env support --markdown --redact --out reports/support.md',
|
|
74
|
+
},
|
|
75
|
+
quickstart: {
|
|
76
|
+
title: 'Get to a useful diagnosis first',
|
|
77
|
+
description: 'Install repoctl locally, inspect the repository, then choose the next task from evidence.',
|
|
78
|
+
code: 'pnpm add -D repoctl\npnpm exec repo init\npnpm exec repo doctor\npnpm exec repo check --dry-run',
|
|
79
|
+
link: { label: 'Read the full setup guide', href: '/repoctl/getting-started' },
|
|
80
|
+
},
|
|
81
|
+
docs: {
|
|
82
|
+
title: 'Continue with the task in front of you',
|
|
83
|
+
description: 'The documentation is organized by repository outcome, with deeper references when you need implementation details.',
|
|
84
|
+
items: [
|
|
85
|
+
{ label: 'Choose by scenario', href: '/repoctl/scenarios', body: 'Map a repository goal to the smallest command sequence.' },
|
|
86
|
+
{ label: 'Execution model', href: '/repoctl/execution-model', body: 'Understand planning, writes, subprocesses, and output.' },
|
|
87
|
+
{ label: 'Configuration', href: '/repoctl/config', body: 'Set defaults without hiding command-line overrides.' },
|
|
88
|
+
{ label: 'Workflows and CI', href: '/repoctl/workflows', body: 'Build local and automated verification paths.' },
|
|
89
|
+
{ label: 'Troubleshooting', href: '/repoctl/troubleshooting', body: 'Diagnose common setup, template, and release failures.' },
|
|
90
|
+
{ label: 'AI documentation', href: '/ai/', body: 'Give coding tools concise or full Markdown context.' },
|
|
91
|
+
],
|
|
92
|
+
},
|
|
93
|
+
} satisfies HomeContent
|
|
94
|
+
|
|
95
|
+
const chinese = {
|
|
96
|
+
hero: {
|
|
97
|
+
label: '面向任务的 monorepo 操作入口',
|
|
98
|
+
title: '运行 monorepo 工作。',
|
|
99
|
+
description: '用一套 CLI 完成 pnpm monorepo 的初始化、诊断、创建、校验与发布。',
|
|
100
|
+
primary: { label: '快速开始', href: '/zh/repoctl/getting-started' },
|
|
101
|
+
secondary: { label: '查看命令', href: '/zh/repoctl/commands' },
|
|
102
|
+
imageAlt: 'repoctl 对当前仓库生成的真实 doctor 报告',
|
|
103
|
+
},
|
|
104
|
+
proof: ['原生支持 pnpm', '理解 Turborepo', '优先 dry-run', 'JSON 与 Markdown 报告', '适用于 CI'],
|
|
105
|
+
lifecycle: {
|
|
106
|
+
title: '稳定的任务生命周期',
|
|
107
|
+
description: '每条命令回答一个仓库问题,并留下可以复查和保存的结果。',
|
|
108
|
+
steps: [
|
|
109
|
+
{ title: '初始化', body: '安装受管根目录资产和标准 repo 脚本。', command: 'repo init' },
|
|
110
|
+
{ title: '诊断', body: '检查 workspace 结构、工具版本、hooks 与发布配置。', command: 'repo doctor' },
|
|
111
|
+
{ title: '创建', body: '选择已知模板,在写入前预览完整文件计划。', command: 'repo new' },
|
|
112
|
+
{ title: '校验', body: '用一份可复现计划串联 lint、typecheck、build、test 与 tsd。', command: 'repo check' },
|
|
113
|
+
{ title: '发布', body: '记录变更意图、更新固定版本组、发布并执行收尾 hook。', command: 'repo release' },
|
|
114
|
+
],
|
|
115
|
+
},
|
|
116
|
+
paths: {
|
|
117
|
+
title: '从仓库当前状态开始',
|
|
118
|
+
description: 'repoctl 同时支持新建项目和渐进接入,不强迫两类仓库走同一条迁移路线。',
|
|
119
|
+
items: [
|
|
120
|
+
{
|
|
121
|
+
title: '创建新 workspace',
|
|
122
|
+
body: '先生成受管约定,再按需创建具体的包和应用。',
|
|
123
|
+
commands: ['pnpm create repoctl', 'pnpm run repo:new'],
|
|
124
|
+
href: '/zh/repoctl/getting-started',
|
|
125
|
+
linkLabel: '创建仓库',
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
title: '接入已有 workspace',
|
|
129
|
+
body: '保存脱敏基线,预览资产差异,再用可审查的小步骤逐项接入。',
|
|
130
|
+
commands: ['repo doctor --markdown --redact', 'repo upgrade --no-overwrite'],
|
|
131
|
+
href: '/zh/repoctl/adopt-existing',
|
|
132
|
+
linkLabel: '制定接入计划',
|
|
133
|
+
},
|
|
134
|
+
],
|
|
135
|
+
},
|
|
136
|
+
capabilities: {
|
|
137
|
+
title: '边界清楚的仓库任务',
|
|
138
|
+
description: '模板、受管资产、校验与报告相互独立,让自动化保持透明。',
|
|
139
|
+
items: [
|
|
140
|
+
{ title: '受管资产', body: '覆盖本地决策前,先比较标准根目录文件。' },
|
|
141
|
+
{ title: '模板目录', body: '按名称创建类库、CLI、服务、客户端与文档站。' },
|
|
142
|
+
{ title: '校验计划', body: '执行前通过 dry-run、JSON 或 Markdown 查看完整任务图。' },
|
|
143
|
+
{ title: '环境报告', body: '隐藏仓库路径和 token 后再共享排障上下文。' },
|
|
144
|
+
],
|
|
145
|
+
},
|
|
146
|
+
commands: {
|
|
147
|
+
title: '记得住的命令地图',
|
|
148
|
+
description: '日常入口保持简短,脚本需要稳定输出时再使用显式模式。',
|
|
149
|
+
items: [
|
|
150
|
+
{ command: 'repo init', purpose: '建立仓库约定' },
|
|
151
|
+
{ command: 'repo doctor', purpose: '诊断仓库健康状态' },
|
|
152
|
+
{ command: 'repo templates', purpose: '查看可用模板' },
|
|
153
|
+
{ command: 'repo new', purpose: '创建 workspace 项目' },
|
|
154
|
+
{ command: 'repo check', purpose: '规划或执行校验' },
|
|
155
|
+
{ command: 'repo env', purpose: '输出运行环境' },
|
|
156
|
+
{ command: 'repo upgrade', purpose: '同步受管资产' },
|
|
157
|
+
{ command: 'repo release', purpose: '更新版本并发布' },
|
|
158
|
+
],
|
|
159
|
+
},
|
|
160
|
+
automation: {
|
|
161
|
+
title: '同时服务人和自动化',
|
|
162
|
+
description: '在命令边界预览写入、保存稳定产物,并对支持信息执行脱敏。',
|
|
163
|
+
formats: ['终端', 'JSON', 'Markdown', '文件输出'],
|
|
164
|
+
code: 'repo check --full --dry-run --json --out reports/check-plan.json\nrepo env support --markdown --redact --out reports/support.md',
|
|
165
|
+
},
|
|
166
|
+
quickstart: {
|
|
167
|
+
title: '先得到一份有效诊断',
|
|
168
|
+
description: '本地安装 repoctl,检查仓库,再根据证据选择下一项任务。',
|
|
169
|
+
code: 'pnpm add -D repoctl\npnpm exec repo init\npnpm exec repo doctor\npnpm exec repo check --dry-run',
|
|
170
|
+
link: { label: '阅读完整安装指南', href: '/zh/repoctl/getting-started' },
|
|
171
|
+
},
|
|
172
|
+
docs: {
|
|
173
|
+
title: '继续处理眼前的任务',
|
|
174
|
+
description: '文档按仓库目标组织,需要实现细节时再进入对应参考页。',
|
|
175
|
+
items: [
|
|
176
|
+
{ label: '按场景选命令', href: '/zh/repoctl/scenarios', body: '把仓库目标映射为最短命令链路。' },
|
|
177
|
+
{ label: '执行模型', href: '/zh/repoctl/execution-model', body: '理解计划、写入、子进程和输出。' },
|
|
178
|
+
{ label: '配置文件', href: '/zh/repoctl/config', body: '设置默认值,同时保留命令行覆盖。' },
|
|
179
|
+
{ label: '工作流与 CI', href: '/zh/repoctl/workflows', body: '建立本地和自动化校验路径。' },
|
|
180
|
+
{ label: '排障', href: '/zh/repoctl/troubleshooting', body: '诊断常见的安装、模板与发布问题。' },
|
|
181
|
+
{ label: 'AI 文档', href: '/zh/ai/', body: '为编程工具提供精简或完整 Markdown 上下文。' },
|
|
182
|
+
],
|
|
183
|
+
},
|
|
184
|
+
} satisfies HomeContent
|
|
185
|
+
|
|
186
|
+
export const homeContent: Record<DocsLocale, HomeContent> = { en: english, zh: chinese }
|