@icebreakers/monorepo-templates 1.2.1 → 1.3.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.
- package/assets/.github/workflows/ci.yml +4 -4
- package/assets/.github/workflows/release.yml +8 -7
- package/assets/package.json +9 -8
- package/assets/renovate.json +0 -1
- package/assets/turbo.json +3 -0
- package/assets-data.mjs +0 -1
- package/dist/cli.mjs +1 -1
- package/dist/index.mjs +1 -1
- package/dist/{prepare--cxFop8c.mjs → prepare-D7eJqEqy.mjs} +1 -2
- package/package.json +5 -5
- package/templates/cli/package.json +1 -1
- package/templates/client/package.json +10 -10
- package/templates/client/worker-configuration.d.ts +463 -202
- package/templates/server/package.json +3 -3
- package/templates/server/worker-configuration.d.ts +463 -202
- package/templates/tsdown/package.json +1 -1
- package/templates/vitepress/.vitepress/config.ts +26 -126
- package/templates/vitepress/.vitepress/env.d.ts +1 -0
- package/templates/vitepress/.vitepress/home/content.ts +94 -0
- package/templates/vitepress/.vitepress/home/types.ts +49 -0
- package/templates/vitepress/.vitepress/navigation/routes.ts +146 -0
- package/templates/vitepress/.vitepress/seo.ts +54 -0
- package/templates/vitepress/.vitepress/theme/Layout.vue +27 -0
- package/templates/vitepress/.vitepress/theme/components/HomePage.vue +112 -0
- package/templates/vitepress/.vitepress/theme/home/foundation.css +237 -0
- package/templates/vitepress/.vitepress/theme/home/index.css +3 -0
- package/templates/vitepress/.vitepress/theme/home/responsive.css +142 -0
- package/templates/vitepress/.vitepress/theme/home/sections.css +232 -0
- package/templates/vitepress/.vitepress/theme/index.ts +11 -1
- package/templates/vitepress/ai/llms-txt.md +2 -2
- package/templates/vitepress/index.md +6 -60
- package/templates/vitepress/learn/index.md +18 -0
- package/templates/vitepress/{monorepo → learn/monorepo}/commands.md +1 -1
- package/templates/vitepress/{monorepo → learn/monorepo}/index.md +3 -3
- package/templates/vitepress/{monorepo → learn/monorepo}/templates.md +1 -1
- package/templates/vitepress/learn/packages/examples/2.npm-basic-package/README.md +1 -0
- package/templates/vitepress/learn/packages/examples/3.npm-basic-package/README.md +1 -0
- package/templates/vitepress/learn/packages/index.md +36 -0
- package/templates/vitepress/learn/packages/modern/bundlers.md +40 -0
- package/templates/vitepress/learn/packages/modern/dts.md +48 -0
- package/templates/vitepress/learn/packages/modern/esm-vs-cjs.md +42 -0
- package/templates/vitepress/learn/packages/modern/index.md +38 -0
- package/templates/vitepress/learn/packages/modern/package-entry-points.md +46 -0
- package/templates/vitepress/learn/packages/modern/typescript.md +43 -0
- package/templates/vitepress/{why/index.md → learn/packages/modern-overview.md} +1 -1
- package/templates/vitepress/learn/packages/module-extensions.md +34 -0
- package/templates/vitepress/learn/packages/publish.md +43 -0
- package/templates/vitepress/learn/packages/reuse-javascript.md +39 -0
- package/templates/vitepress/learn/packages/runtime-globals.md +36 -0
- package/templates/vitepress/{repoctl/index.md → learn/repoctl-model.md} +8 -8
- package/templates/vitepress/learn/tools/changeset.md +30 -0
- package/templates/vitepress/learn/tools/husky.md +50 -0
- package/templates/vitepress/learn/tools/lint-staged.md +39 -0
- package/templates/vitepress/{tools → learn/tools}/llms-txt.md +1 -1
- package/templates/vitepress/learn/tools/pnpm.md +47 -0
- package/templates/vitepress/learn/tools/renovate.md +31 -0
- package/templates/vitepress/learn/tools/turborepo.md +40 -0
- package/templates/vitepress/package.json +14 -7
- package/templates/vitepress/public/brand/apple-touch-icon.png +0 -0
- package/templates/vitepress/public/brand/favicon.ico +0 -0
- package/templates/vitepress/public/brand/repoctl-lockup-dark.svg +6 -0
- package/templates/vitepress/public/brand/repoctl-lockup.svg +20 -0
- package/templates/vitepress/public/brand/repoctl-mark-192.png +0 -0
- package/templates/vitepress/public/brand/repoctl-mark-dark.svg +13 -0
- package/templates/vitepress/public/brand/repoctl-mark.svg +13 -0
- package/templates/vitepress/public/brand/repoctl-social-en.png +0 -0
- package/templates/vitepress/public/brand/repoctl-social-en.webp +0 -0
- package/templates/vitepress/public/brand/repoctl-social-zh.png +0 -0
- package/templates/vitepress/public/brand/repoctl-social-zh.webp +0 -0
- package/templates/vitepress/public/favicon.ico +0 -0
- package/templates/vitepress/public/logo.jpg +0 -0
- package/templates/vitepress/public/repoctl-doctor.png +0 -0
- package/templates/vitepress/{repoctl → reference}/commands.md +2 -2
- package/templates/vitepress/reference/index.md +15 -0
- package/templates/vitepress/reference/output.md +37 -0
- package/templates/vitepress/{repoctl → reference}/templates.md +2 -2
- package/templates/vitepress/scripts/check-locales.ts +196 -0
- package/templates/vitepress/start/choose-next.md +14 -0
- package/templates/vitepress/start/first-run.md +39 -0
- package/templates/vitepress/start/index.md +26 -0
- package/templates/vitepress/{repoctl/getting-started.md → start/install.md} +5 -5
- package/templates/vitepress/{repoctl → tasks}/adopt-existing.md +30 -4
- package/templates/vitepress/{repoctl → tasks}/checks.md +27 -1
- package/templates/vitepress/{repoctl/workflows.md → tasks/ci.md} +65 -4
- package/templates/vitepress/tasks/create-project.md +37 -0
- package/templates/vitepress/{repoctl/scenarios.md → tasks/index.md} +8 -8
- package/templates/vitepress/tasks/release.md +31 -0
- package/templates/vitepress/{repoctl → tasks}/reports.md +25 -0
- package/templates/vitepress/{repoctl → tasks}/troubleshooting.md +30 -4
- package/templates/vitepress/tsconfig.json +7 -0
- package/templates/vitepress/wrangler.jsonc +20 -3
- package/templates/vitepress/zh/ai/index.md +1 -1
- package/templates/vitepress/zh/ai/llms-txt.md +7 -7
- package/templates/vitepress/zh/index.md +6 -63
- package/templates/vitepress/zh/learn/index.md +18 -0
- package/templates/vitepress/zh/{monorepo → learn/monorepo}/commands.md +3 -3
- package/templates/vitepress/zh/{monorepo → learn/monorepo}/manage.md +4 -4
- package/templates/vitepress/zh/{monorepo → learn/monorepo}/templates.md +2 -2
- package/templates/vitepress/zh/{monorepo → learn/monorepo}/troubleshooting.md +2 -2
- package/templates/vitepress/zh/learn/packages/examples/2.npm-basic-package/README.md +1 -0
- package/templates/vitepress/zh/learn/packages/examples/3.npm-basic-package/README.md +1 -0
- package/templates/vitepress/zh/{why → learn/packages}/modern/index.md +1 -1
- package/templates/vitepress/zh/learn/packages/modern-overview.md +38 -0
- package/templates/vitepress/zh/{repoctl/index.md → learn/repoctl-model.md} +19 -19
- package/templates/vitepress/zh/{tools → learn/tools}/husky.md +1 -1
- package/templates/vitepress/zh/{tools → learn/tools}/lint-staged.md +1 -1
- package/templates/vitepress/zh/{tools → learn/tools}/llms-txt.md +1 -1
- package/templates/vitepress/zh/{tools → learn/tools}/pnpm.md +1 -1
- package/templates/vitepress/zh/{tools → learn/tools}/turborepo.md +1 -1
- package/templates/vitepress/zh/{repoctl → reference}/commands.md +4 -4
- package/templates/vitepress/zh/{repoctl → reference}/config.md +1 -1
- package/templates/vitepress/zh/reference/index.md +15 -0
- package/templates/vitepress/zh/reference/output.md +37 -0
- package/templates/vitepress/zh/{repoctl → reference}/templates.md +4 -4
- package/templates/vitepress/zh/start/choose-next.md +14 -0
- package/templates/vitepress/zh/{repoctl/doctor.md → start/diagnose.md} +1 -1
- package/templates/vitepress/zh/start/first-run.md +39 -0
- package/templates/vitepress/zh/start/index.md +26 -0
- package/templates/vitepress/zh/{repoctl/getting-started.md → start/install.md} +5 -5
- package/templates/vitepress/zh/{repoctl → tasks}/adopt-existing.md +30 -4
- package/templates/vitepress/zh/{repoctl → tasks}/checks.md +27 -1
- package/templates/vitepress/zh/{repoctl/workflows.md → tasks/ci.md} +73 -12
- package/templates/vitepress/zh/tasks/create-project.md +37 -0
- package/templates/vitepress/zh/{repoctl/scenarios.md → tasks/index.md} +8 -8
- package/templates/vitepress/zh/tasks/release.md +31 -0
- package/templates/vitepress/zh/{repoctl → tasks}/reports.md +25 -0
- package/templates/vitepress/zh/{repoctl → tasks}/troubleshooting.md +39 -13
- package/templates/vue-lib/package.json +3 -3
- package/assets/netlify.toml +0 -14
- package/templates/vitepress/getting-started.md +0 -11
- package/templates/vitepress/knowledge/index.md +0 -26
- package/templates/vitepress/thinking.md +0 -7
- package/templates/vitepress/tools/changeset.md +0 -25
- package/templates/vitepress/tools/husky.md +0 -12
- package/templates/vitepress/tools/lint-staged.md +0 -12
- package/templates/vitepress/tools/pnpm.md +0 -15
- package/templates/vitepress/tools/renovate.md +0 -7
- package/templates/vitepress/tools/turborepo.md +0 -14
- package/templates/vitepress/why/examples/2.npm-basic-package/README.md +0 -1
- package/templates/vitepress/why/examples/3.npm-basic-package/README.md +0 -1
- package/templates/vitepress/why/how-to-reuse-js-code.md +0 -9
- package/templates/vitepress/why/js-cjs-mjs.md +0 -12
- package/templates/vitepress/why/js-keywords.md +0 -7
- package/templates/vitepress/why/modern/bundlers.md +0 -5
- package/templates/vitepress/why/modern/dts.md +0 -7
- package/templates/vitepress/why/modern/esm-vs-cjs.md +0 -7
- package/templates/vitepress/why/modern/index.md +0 -14
- package/templates/vitepress/why/modern/package-entry-points.md +0 -17
- package/templates/vitepress/why/modern/typescript.md +0 -7
- package/templates/vitepress/why/publish-basic-npm-package.md +0 -19
- package/templates/vitepress/why/what-is-npm-package.md +0 -7
- package/templates/vitepress/zh/getting-started.md +0 -40
- package/templates/vitepress/zh/knowledge/index.md +0 -50
- package/templates/vitepress/zh/thinking.md +0 -88
- package/templates/vitepress/zh/why/examples/2.npm-basic-package/README.md +0 -1
- package/templates/vitepress/zh/why/examples/3.npm-basic-package/README.md +0 -1
- package/templates/vitepress/zh/why/index.md +0 -1
- /package/templates/vitepress/{monorepo → learn/monorepo}/manage.md +0 -0
- /package/templates/vitepress/{monorepo → learn/monorepo}/publish.md +0 -0
- /package/templates/vitepress/{monorepo → learn/monorepo}/troubleshooting.md +0 -0
- /package/templates/vitepress/{why → learn/packages}/assets/npm-dt.svg +0 -0
- /package/templates/vitepress/{why → learn/packages}/assets/npm-ts.svg +0 -0
- /package/templates/vitepress/{why → learn/packages}/examples/0.npm-basic-package/index.js +0 -0
- /package/templates/vitepress/{why → learn/packages}/examples/0.npm-basic-package/package.json +0 -0
- /package/templates/vitepress/{why → learn/packages}/examples/1.npm-basic-package/index.cjs +0 -0
- /package/templates/vitepress/{why → learn/packages}/examples/1.npm-basic-package/index.d.ts +0 -0
- /package/templates/vitepress/{why → learn/packages}/examples/1.npm-basic-package/index.js +0 -0
- /package/templates/vitepress/{why → learn/packages}/examples/1.npm-basic-package/package.json +0 -0
- /package/templates/vitepress/{why → learn/packages}/examples/2.npm-basic-package/package-lock.json +0 -0
- /package/templates/vitepress/{why → learn/packages}/examples/2.npm-basic-package/package.json +0 -0
- /package/templates/vitepress/{why → learn/packages}/examples/2.npm-basic-package/rename-ext.js +0 -0
- /package/templates/vitepress/{why → learn/packages}/examples/2.npm-basic-package/src/index.ts +0 -0
- /package/templates/vitepress/{why → learn/packages}/examples/2.npm-basic-package/tsconfig.cjs.json +0 -0
- /package/templates/vitepress/{why → learn/packages}/examples/2.npm-basic-package/tsconfig.esm.json +0 -0
- /package/templates/vitepress/{why → learn/packages}/examples/2.npm-basic-package/tsconfig.json +0 -0
- /package/templates/vitepress/{why → learn/packages}/examples/3.npm-basic-package/package-lock.json +0 -0
- /package/templates/vitepress/{why → learn/packages}/examples/3.npm-basic-package/package.json +0 -0
- /package/templates/vitepress/{why → learn/packages}/examples/3.npm-basic-package/src/index.ts +0 -0
- /package/templates/vitepress/{why → learn/packages}/examples/3.npm-basic-package/tsconfig.json +0 -0
- /package/templates/vitepress/{why → learn/packages}/examples/3.npm-basic-package/tsdown.config.ts +0 -0
- /package/templates/vitepress/{why → learn/packages}/examples/usage-cjs/cjs.cjs +0 -0
- /package/templates/vitepress/{why → learn/packages}/examples/usage-cjs/esm.mjs +0 -0
- /package/templates/vitepress/{why → learn/packages}/examples/usage-cjs/index.js +0 -0
- /package/templates/vitepress/{why → learn/packages}/examples/usage-cjs/package-lock.json +0 -0
- /package/templates/vitepress/{why → learn/packages}/examples/usage-cjs/package.json +0 -0
- /package/templates/vitepress/{why → learn/packages}/examples/usage-esm/cjs.cjs +0 -0
- /package/templates/vitepress/{why → learn/packages}/examples/usage-esm/createRequire.js +0 -0
- /package/templates/vitepress/{why → learn/packages}/examples/usage-esm/esm.mjs +0 -0
- /package/templates/vitepress/{why → learn/packages}/examples/usage-esm/index.js +0 -0
- /package/templates/vitepress/{why → learn/packages}/examples/usage-esm/package-lock.json +0 -0
- /package/templates/vitepress/{why → learn/packages}/examples/usage-esm/package.json +0 -0
- /package/templates/vitepress/{tools → learn/tools}/index.md +0 -0
- /package/templates/vitepress/{repoctl → reference}/aliases.md +0 -0
- /package/templates/vitepress/{repoctl → reference}/config.md +0 -0
- /package/templates/vitepress/{repoctl → reference}/execution-model.md +0 -0
- /package/templates/vitepress/{repoctl → reference}/template-assets.md +0 -0
- /package/templates/vitepress/{repoctl/doctor.md → start/diagnose.md} +0 -0
- /package/templates/vitepress/zh/{monorepo → learn/monorepo}/index.md +0 -0
- /package/templates/vitepress/zh/{monorepo → learn/monorepo}/publish.md +0 -0
- /package/templates/vitepress/zh/{why → learn/packages}/assets/npm-dt.svg +0 -0
- /package/templates/vitepress/zh/{why → learn/packages}/assets/npm-ts.svg +0 -0
- /package/templates/vitepress/zh/{why → learn/packages}/examples/0.npm-basic-package/index.js +0 -0
- /package/templates/vitepress/zh/{why → learn/packages}/examples/0.npm-basic-package/package.json +0 -0
- /package/templates/vitepress/zh/{why → learn/packages}/examples/1.npm-basic-package/index.cjs +0 -0
- /package/templates/vitepress/zh/{why → learn/packages}/examples/1.npm-basic-package/index.d.ts +0 -0
- /package/templates/vitepress/zh/{why → learn/packages}/examples/1.npm-basic-package/index.js +0 -0
- /package/templates/vitepress/zh/{why → learn/packages}/examples/1.npm-basic-package/package.json +0 -0
- /package/templates/vitepress/zh/{why → learn/packages}/examples/2.npm-basic-package/package-lock.json +0 -0
- /package/templates/vitepress/zh/{why → learn/packages}/examples/2.npm-basic-package/package.json +0 -0
- /package/templates/vitepress/zh/{why → learn/packages}/examples/2.npm-basic-package/rename-ext.js +0 -0
- /package/templates/vitepress/zh/{why → learn/packages}/examples/2.npm-basic-package/src/index.ts +0 -0
- /package/templates/vitepress/zh/{why → learn/packages}/examples/2.npm-basic-package/tsconfig.cjs.json +0 -0
- /package/templates/vitepress/zh/{why → learn/packages}/examples/2.npm-basic-package/tsconfig.esm.json +0 -0
- /package/templates/vitepress/zh/{why → learn/packages}/examples/2.npm-basic-package/tsconfig.json +0 -0
- /package/templates/vitepress/zh/{why → learn/packages}/examples/3.npm-basic-package/package-lock.json +0 -0
- /package/templates/vitepress/zh/{why → learn/packages}/examples/3.npm-basic-package/package.json +0 -0
- /package/templates/vitepress/zh/{why → learn/packages}/examples/3.npm-basic-package/src/index.ts +0 -0
- /package/templates/vitepress/zh/{why → learn/packages}/examples/3.npm-basic-package/tsconfig.json +0 -0
- /package/templates/vitepress/zh/{why → learn/packages}/examples/3.npm-basic-package/tsdown.config.ts +0 -0
- /package/templates/vitepress/zh/{why → learn/packages}/examples/usage-cjs/cjs.cjs +0 -0
- /package/templates/vitepress/zh/{why → learn/packages}/examples/usage-cjs/esm.mjs +0 -0
- /package/templates/vitepress/zh/{why → learn/packages}/examples/usage-cjs/index.js +0 -0
- /package/templates/vitepress/zh/{why → learn/packages}/examples/usage-cjs/package-lock.json +0 -0
- /package/templates/vitepress/zh/{why → learn/packages}/examples/usage-cjs/package.json +0 -0
- /package/templates/vitepress/zh/{why → learn/packages}/examples/usage-esm/cjs.cjs +0 -0
- /package/templates/vitepress/zh/{why → learn/packages}/examples/usage-esm/createRequire.js +0 -0
- /package/templates/vitepress/zh/{why → learn/packages}/examples/usage-esm/esm.mjs +0 -0
- /package/templates/vitepress/zh/{why → learn/packages}/examples/usage-esm/index.js +0 -0
- /package/templates/vitepress/zh/{why → learn/packages}/examples/usage-esm/package-lock.json +0 -0
- /package/templates/vitepress/zh/{why → learn/packages}/examples/usage-esm/package.json +0 -0
- /package/templates/vitepress/zh/{why/what-is-npm-package.md → learn/packages/index.md} +0 -0
- /package/templates/vitepress/zh/{why → learn/packages}/modern/bundlers.md +0 -0
- /package/templates/vitepress/zh/{why → learn/packages}/modern/dts.md +0 -0
- /package/templates/vitepress/zh/{why → learn/packages}/modern/esm-vs-cjs.md +0 -0
- /package/templates/vitepress/zh/{why → learn/packages}/modern/package-entry-points.md +0 -0
- /package/templates/vitepress/zh/{why → learn/packages}/modern/typescript.md +0 -0
- /package/templates/vitepress/zh/{why/js-cjs-mjs.md → learn/packages/module-extensions.md} +0 -0
- /package/templates/vitepress/zh/{why/publish-basic-npm-package.md → learn/packages/publish.md} +0 -0
- /package/templates/vitepress/zh/{why/how-to-reuse-js-code.md → learn/packages/reuse-javascript.md} +0 -0
- /package/templates/vitepress/zh/{why/js-keywords.md → learn/packages/runtime-globals.md} +0 -0
- /package/templates/vitepress/zh/{tools → learn/tools}/changeset.md +0 -0
- /package/templates/vitepress/zh/{tools → learn/tools}/index.md +0 -0
- /package/templates/vitepress/zh/{tools → learn/tools}/renovate.md +0 -0
- /package/templates/vitepress/zh/{repoctl → reference}/aliases.md +0 -0
- /package/templates/vitepress/zh/{repoctl → reference}/execution-model.md +0 -0
- /package/templates/vitepress/zh/{repoctl → reference}/template-assets.md +0 -0
|
@@ -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,116 +2,30 @@ 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',
|
|
10
|
+
srcExclude: ['CHANGELOG.md', 'learn/packages/examples/**', 'zh/learn/packages/examples/**'],
|
|
108
11
|
title: 'repoctl',
|
|
109
|
-
description: '
|
|
12
|
+
description: 'A practical CLI guide for setting up, checking, and maintaining pnpm and Turborepo monorepos.',
|
|
110
13
|
lastUpdated: true,
|
|
111
14
|
cleanUrls: true,
|
|
112
|
-
|
|
15
|
+
sitemap: { hostname: siteOrigin },
|
|
16
|
+
transformHead: createPageHead,
|
|
17
|
+
head: [
|
|
18
|
+
['link', { rel: 'icon', type: 'image/svg+xml', href: '/brand/repoctl-mark.svg' }],
|
|
19
|
+
['link', { rel: 'icon', type: 'image/svg+xml', href: '/brand/repoctl-mark-dark.svg', media: '(prefers-color-scheme: dark)' }],
|
|
20
|
+
['link', { rel: 'alternate icon', type: 'image/x-icon', href: '/brand/favicon.ico' }],
|
|
21
|
+
['link', { rel: 'apple-touch-icon', sizes: '180x180', href: '/brand/apple-touch-icon.png' }],
|
|
22
|
+
],
|
|
113
23
|
themeConfig: {
|
|
114
|
-
logo:
|
|
24
|
+
logo: {
|
|
25
|
+
light: '/brand/repoctl-mark.svg',
|
|
26
|
+
dark: '/brand/repoctl-mark-dark.svg',
|
|
27
|
+
alt: 'repoctl',
|
|
28
|
+
},
|
|
115
29
|
search: { provider: 'local' },
|
|
116
30
|
socialLinks: [{ icon: 'github', link: 'https://github.com/sonofmagic/repoctl' }],
|
|
117
31
|
},
|
|
@@ -120,18 +34,11 @@ export default withMermaid(defineConfig({
|
|
|
120
34
|
label: 'English',
|
|
121
35
|
lang: 'en-US',
|
|
122
36
|
title: 'repoctl',
|
|
123
|
-
description: '
|
|
37
|
+
description: 'A practical CLI guide for setting up, checking, and maintaining pnpm and Turborepo monorepos.',
|
|
124
38
|
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
|
-
],
|
|
39
|
+
nav: createNav('en'),
|
|
133
40
|
outline: { label: 'On This Page', level: [2, 3] },
|
|
134
|
-
sidebar: createSidebars(''
|
|
41
|
+
sidebar: createSidebars('en'),
|
|
135
42
|
editLink: {
|
|
136
43
|
pattern: 'https://github.com/sonofmagic/repoctl/edit/main/templates/vitepress/:path',
|
|
137
44
|
text: 'Edit this page',
|
|
@@ -145,18 +52,11 @@ export default withMermaid(defineConfig({
|
|
|
145
52
|
lang: 'zh-CN',
|
|
146
53
|
link: '/zh/',
|
|
147
54
|
title: 'repoctl',
|
|
148
|
-
description: '面向 pnpm 与 Turborepo monorepo
|
|
55
|
+
description: '面向 pnpm 与 Turborepo monorepo 的实用 CLI 文档。',
|
|
149
56
|
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
|
-
],
|
|
57
|
+
nav: createNav('zh'),
|
|
158
58
|
outline: { label: '目录', level: [2, 3] },
|
|
159
|
-
sidebar: createSidebars('
|
|
59
|
+
sidebar: createSidebars('zh'),
|
|
160
60
|
editLink: {
|
|
161
61
|
pattern: 'https://github.com/sonofmagic/repoctl/edit/main/templates/vitepress/:path',
|
|
162
62
|
text: '为此页提供修改建议',
|
|
@@ -172,14 +72,14 @@ export default withMermaid(defineConfig({
|
|
|
172
72
|
Tailwindcss(),
|
|
173
73
|
llmstxt({
|
|
174
74
|
title: 'repoctl',
|
|
175
|
-
description: '
|
|
176
|
-
domain:
|
|
75
|
+
description: 'Practical documentation for setting up, checking, and maintaining pnpm and Turborepo monorepos. Chinese documentation is available under /zh/.',
|
|
76
|
+
domain: siteOrigin,
|
|
177
77
|
ignoreFiles: [
|
|
178
78
|
'zh/**',
|
|
179
79
|
'en/**',
|
|
180
80
|
'CHANGELOG.md',
|
|
181
81
|
'thinking.md',
|
|
182
|
-
'
|
|
82
|
+
'learn/packages/examples/**',
|
|
183
83
|
'.vitepress/**',
|
|
184
84
|
'**/node_modules/**',
|
|
185
85
|
'**/internal/**',
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
declare module '*.css'
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import type { DocsLocale } from '../navigation/routes'
|
|
2
|
+
import type { HomeContent } from './types'
|
|
3
|
+
|
|
4
|
+
const english = {
|
|
5
|
+
hero: {
|
|
6
|
+
label: 'repoctl documentation',
|
|
7
|
+
title: 'What does your repository need next?',
|
|
8
|
+
description: 'Initialize, diagnose, create, check, and release pnpm or Turborepo workspaces from one task-first CLI.',
|
|
9
|
+
primaryAction: { label: 'Get started', href: '/start/' },
|
|
10
|
+
secondaryAction: { label: 'Browse commands', href: '/reference/commands' },
|
|
11
|
+
imageAlt: 'A real repoctl doctor report showing repository checks and findings',
|
|
12
|
+
},
|
|
13
|
+
tasks: {
|
|
14
|
+
title: 'Choose a task',
|
|
15
|
+
description: 'Pick the result you need. Each path begins with the smallest safe command.',
|
|
16
|
+
items: [
|
|
17
|
+
{ title: 'Start a new repository', body: 'Set up the shared conventions before you add projects.', command: 'repo init', link: { label: 'Start here', href: '/start/' } },
|
|
18
|
+
{ title: 'Adopt an existing repository', body: 'Inspect current choices and preview changes before writing.', command: 'repo doctor', link: { label: 'Plan adoption', href: '/tasks/adopt-existing' } },
|
|
19
|
+
{ title: 'Create a package or app', body: 'Use a known template so names, scripts, and boundaries stay consistent.', command: 'repo new', link: { label: 'Create a project', href: '/tasks/create-project' } },
|
|
20
|
+
{ title: 'Run a repository check', body: 'Plan lint, types, builds, and tests before a commit or CI run.', command: 'repo check', link: { label: 'Run checks', href: '/tasks/checks' } },
|
|
21
|
+
],
|
|
22
|
+
},
|
|
23
|
+
firstRun: {
|
|
24
|
+
title: 'Three commands to a useful baseline',
|
|
25
|
+
description: 'Install repoctl, initialize its managed defaults, then diagnose the workspace.',
|
|
26
|
+
steps: [
|
|
27
|
+
{ title: 'Install', command: 'pnpm add -D repoctl', body: 'Keep repoctl with the repository so teammates and CI use the same version.' },
|
|
28
|
+
{ title: 'Initialize', command: 'pnpm exec repo init', body: 'Review the file plan before adding managed scripts and configuration.' },
|
|
29
|
+
{ title: 'Diagnose', command: 'pnpm exec repo doctor', body: 'Use the first blocker as your next task. Run the diagnosis again after each fix.' },
|
|
30
|
+
],
|
|
31
|
+
},
|
|
32
|
+
evidence: {
|
|
33
|
+
title: 'See the plan before the repository changes',
|
|
34
|
+
description: 'Preview work, redact local paths, and keep the exact command sequence with the report.',
|
|
35
|
+
code: 'pnpm exec repo new docs --template vitepress --dry-run\npnpm exec repo check --dry-run\npnpm exec repo doctor --markdown --redact',
|
|
36
|
+
link: { label: 'See how diagnosis works', href: '/start/diagnose' },
|
|
37
|
+
},
|
|
38
|
+
layers: {
|
|
39
|
+
title: 'Continue with the decision in front of you',
|
|
40
|
+
description: 'Move from the current task to the level of detail you need.',
|
|
41
|
+
items: [
|
|
42
|
+
{ title: 'Daily tasks', body: 'Adoption, project creation, checks, CI, reports, releases, and troubleshooting.', link: { label: 'Open tasks', href: '/tasks/' } },
|
|
43
|
+
{ title: 'Understand the system', body: 'Monorepo boundaries, modern npm packages, templates, and the tools underneath.', link: { label: 'Open Learn', href: '/learn/' } },
|
|
44
|
+
{ title: 'Look up exact behavior', body: 'Commands, configuration, output formats, aliases, and execution details.', link: { label: 'Open Reference', href: '/reference/' } },
|
|
45
|
+
],
|
|
46
|
+
},
|
|
47
|
+
} satisfies HomeContent
|
|
48
|
+
|
|
49
|
+
const chinese = {
|
|
50
|
+
hero: {
|
|
51
|
+
label: 'repoctl 文档',
|
|
52
|
+
title: '仓库下一步,该做什么?',
|
|
53
|
+
description: '用一个任务型 CLI 初始化、诊断、创建、校验与发布 pnpm 和 Turborepo 工作区。',
|
|
54
|
+
primaryAction: { label: '开始使用', href: '/zh/start/' },
|
|
55
|
+
secondaryAction: { label: '查看命令', href: '/zh/reference/commands' },
|
|
56
|
+
imageAlt: '真实的 repoctl doctor 报告,展示仓库检查结果与发现项',
|
|
57
|
+
},
|
|
58
|
+
tasks: {
|
|
59
|
+
title: '选择一项任务',
|
|
60
|
+
description: '选择你要得到的结果,每条路径都从最小的安全命令开始。',
|
|
61
|
+
items: [
|
|
62
|
+
{ title: '新建仓库', body: '先建立共享约定,再开始添加项目。', command: 'repo init', link: { label: '从这里开始', href: '/zh/start/' } },
|
|
63
|
+
{ title: '接入已有仓库', body: '先检查当前决策,预览变化后再写入。', command: 'repo doctor', link: { label: '制定接入计划', href: '/zh/tasks/adopt-existing' } },
|
|
64
|
+
{ title: '创建包或应用', body: '使用已知模板,让名称、脚本和边界保持一致。', command: 'repo new', link: { label: '创建项目', href: '/zh/tasks/create-project' } },
|
|
65
|
+
{ title: '运行仓库校验', body: '提交或运行 CI 前,先规划 lint、类型、构建和测试。', command: 'repo check', link: { label: '运行校验', href: '/zh/tasks/checks' } },
|
|
66
|
+
],
|
|
67
|
+
},
|
|
68
|
+
firstRun: {
|
|
69
|
+
title: '三条命令,建立可用基线',
|
|
70
|
+
description: '安装 repoctl,初始化受管默认值,再诊断当前工作区。',
|
|
71
|
+
steps: [
|
|
72
|
+
{ title: '安装', command: 'pnpm add -D repoctl', body: '把 repoctl 保存在仓库中,让成员和 CI 使用相同版本。' },
|
|
73
|
+
{ title: '初始化', command: 'pnpm exec repo init', body: '写入受管脚本和配置前,先检查文件计划。' },
|
|
74
|
+
{ title: '诊断', command: 'pnpm exec repo doctor', body: '把第一个阻塞项作为下一项任务,修复后再次运行诊断。' },
|
|
75
|
+
],
|
|
76
|
+
},
|
|
77
|
+
evidence: {
|
|
78
|
+
title: '仓库变化前,先看清执行计划',
|
|
79
|
+
description: '预览操作、脱敏本地路径,并让报告保留准确的命令顺序。',
|
|
80
|
+
code: 'pnpm exec repo new docs --template vitepress --dry-run\npnpm exec repo check --dry-run\npnpm exec repo doctor --markdown --redact',
|
|
81
|
+
link: { label: '了解诊断流程', href: '/zh/start/diagnose' },
|
|
82
|
+
},
|
|
83
|
+
layers: {
|
|
84
|
+
title: '沿着当前决策继续深入',
|
|
85
|
+
description: '从手头任务出发,只进入你现在需要的细节层级。',
|
|
86
|
+
items: [
|
|
87
|
+
{ title: '日常任务', body: '接入、创建项目、校验、CI、报告、发布和排障。', link: { label: '打开任务', href: '/zh/tasks/' } },
|
|
88
|
+
{ title: '理解系统', body: 'Monorepo 边界、现代 npm 包、模板和底层工具。', link: { label: '打开理解', href: '/zh/learn/' } },
|
|
89
|
+
{ title: '查找准确行为', body: '命令、配置、输出格式、别名和执行细节。', link: { label: '打开参考', href: '/zh/reference/' } },
|
|
90
|
+
],
|
|
91
|
+
},
|
|
92
|
+
} satisfies HomeContent
|
|
93
|
+
|
|
94
|
+
export const homeContent: Record<DocsLocale, HomeContent> = { en: english, zh: chinese }
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
export interface HomeLink {
|
|
2
|
+
label: string
|
|
3
|
+
href: string
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
export interface HomeContent {
|
|
7
|
+
hero: {
|
|
8
|
+
label: string
|
|
9
|
+
title: string
|
|
10
|
+
description: string
|
|
11
|
+
primaryAction: HomeLink
|
|
12
|
+
secondaryAction: HomeLink
|
|
13
|
+
imageAlt: string
|
|
14
|
+
}
|
|
15
|
+
tasks: {
|
|
16
|
+
title: string
|
|
17
|
+
description: string
|
|
18
|
+
items: Array<{
|
|
19
|
+
title: string
|
|
20
|
+
body: string
|
|
21
|
+
command: string
|
|
22
|
+
link: HomeLink
|
|
23
|
+
}>
|
|
24
|
+
}
|
|
25
|
+
firstRun: {
|
|
26
|
+
title: string
|
|
27
|
+
description: string
|
|
28
|
+
steps: Array<{
|
|
29
|
+
title: string
|
|
30
|
+
command: string
|
|
31
|
+
body: string
|
|
32
|
+
}>
|
|
33
|
+
}
|
|
34
|
+
evidence: {
|
|
35
|
+
title: string
|
|
36
|
+
description: string
|
|
37
|
+
code: string
|
|
38
|
+
link: HomeLink
|
|
39
|
+
}
|
|
40
|
+
layers: {
|
|
41
|
+
title: string
|
|
42
|
+
description: string
|
|
43
|
+
items: Array<{
|
|
44
|
+
title: string
|
|
45
|
+
body: string
|
|
46
|
+
link: HomeLink
|
|
47
|
+
}>
|
|
48
|
+
}
|
|
49
|
+
}
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
import type { DefaultTheme } from 'vitepress'
|
|
2
|
+
|
|
3
|
+
export type DocsLocale = 'en' | 'zh'
|
|
4
|
+
|
|
5
|
+
interface LocalizedText {
|
|
6
|
+
en: string
|
|
7
|
+
zh: string
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export interface RouteItem {
|
|
11
|
+
slug: string
|
|
12
|
+
label: LocalizedText
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export interface RouteSection {
|
|
16
|
+
id: 'start' | 'tasks' | 'reference' | 'learn' | 'ai'
|
|
17
|
+
label: LocalizedText
|
|
18
|
+
items: readonly RouteItem[]
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
const item = (slug: string, en: string, zh: string): RouteItem => ({ slug, label: { en, zh } })
|
|
22
|
+
|
|
23
|
+
export const routeSections = [
|
|
24
|
+
{
|
|
25
|
+
id: 'start',
|
|
26
|
+
label: { en: 'Start', zh: '开始' },
|
|
27
|
+
items: [
|
|
28
|
+
item('', 'Start here', '从这里开始'),
|
|
29
|
+
item('install', 'Install and initialize', '安装并初始化'),
|
|
30
|
+
item('first-run', 'Your first run', '第一次运行'),
|
|
31
|
+
item('diagnose', 'Run a diagnosis', '运行诊断'),
|
|
32
|
+
item('choose-next', 'Choose the next task', '选择下一项任务'),
|
|
33
|
+
],
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
id: 'tasks',
|
|
37
|
+
label: { en: 'Tasks', zh: '任务' },
|
|
38
|
+
items: [
|
|
39
|
+
item('', 'Task index', '任务索引'),
|
|
40
|
+
item('adopt-existing', 'Adopt an existing workspace', '接入已有 workspace'),
|
|
41
|
+
item('create-project', 'Create a package or app', '创建包或应用'),
|
|
42
|
+
item('checks', 'Run checks', '运行校验'),
|
|
43
|
+
item('reports', 'Reports and output', '报告与输出'),
|
|
44
|
+
item('ci', 'Add checks to CI', '把校验加入 CI'),
|
|
45
|
+
item('release', 'Release packages', '发布包'),
|
|
46
|
+
item('troubleshooting', 'Troubleshoot', '排障'),
|
|
47
|
+
],
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
id: 'reference',
|
|
51
|
+
label: { en: 'Reference', zh: '参考' },
|
|
52
|
+
items: [
|
|
53
|
+
item('', 'Reference overview', '参考总览'),
|
|
54
|
+
item('commands', 'Command reference', '命令参考'),
|
|
55
|
+
item('config', 'Configuration', '配置文件'),
|
|
56
|
+
item('execution-model', 'Execution model', '执行模型'),
|
|
57
|
+
item('output', 'Output formats', '输出格式'),
|
|
58
|
+
item('aliases', 'Command aliases', '命令别名'),
|
|
59
|
+
item('templates', 'Templates', '模板'),
|
|
60
|
+
item('template-assets', 'Managed template assets', '受管模板资产'),
|
|
61
|
+
],
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
id: 'learn',
|
|
65
|
+
label: { en: 'Learn', zh: '理解' },
|
|
66
|
+
items: [
|
|
67
|
+
item('', 'Learn overview', '理解总览'),
|
|
68
|
+
item('repoctl-model', 'How repoctl fits in', 'repoctl 如何融入仓库'),
|
|
69
|
+
item('monorepo/', 'Monorepo foundations', 'Monorepo 基础'),
|
|
70
|
+
item('monorepo/manage', 'Manage a monorepo', '管理 Monorepo'),
|
|
71
|
+
item('monorepo/publish', 'Publishing and changelogs', '发包与变更日志'),
|
|
72
|
+
item('monorepo/commands', 'Monorepo commands', 'Monorepo 命令'),
|
|
73
|
+
item('monorepo/templates', 'Template systems', '模板体系'),
|
|
74
|
+
item('monorepo/troubleshooting', 'Monorepo troubleshooting', 'Monorepo 排障'),
|
|
75
|
+
item('packages/', 'Modern npm packages', '现代 npm 包'),
|
|
76
|
+
item('packages/modern-overview', 'Modern package guide', '现代包指南'),
|
|
77
|
+
item('packages/reuse-javascript', 'Reuse JavaScript', '复用 JavaScript'),
|
|
78
|
+
item('packages/module-extensions', 'Module extensions', '模块文件后缀'),
|
|
79
|
+
item('packages/runtime-globals', 'Runtime globals', '运行时关键字'),
|
|
80
|
+
item('packages/publish', 'Publish a package', '发布 npm 包'),
|
|
81
|
+
item('packages/modern/', 'Package details', '现代包细节'),
|
|
82
|
+
item('packages/modern/esm-vs-cjs', 'ESM and CommonJS', 'ESM 与 CommonJS'),
|
|
83
|
+
item('packages/modern/dts', 'Type declarations', '类型声明'),
|
|
84
|
+
item('packages/modern/package-entry-points', 'Package entry points', '包入口'),
|
|
85
|
+
item('packages/modern/bundlers', 'Bundlers', '构建工具'),
|
|
86
|
+
item('packages/modern/typescript', 'TypeScript', 'TypeScript'),
|
|
87
|
+
item('tools/', 'Tool guides', '工具专题'),
|
|
88
|
+
item('tools/pnpm', 'pnpm', 'pnpm'),
|
|
89
|
+
item('tools/turborepo', 'Turborepo', 'Turborepo'),
|
|
90
|
+
item('tools/changeset', 'Versioning', '版本管理'),
|
|
91
|
+
item('tools/husky', 'Husky', 'Husky'),
|
|
92
|
+
item('tools/lint-staged', 'lint-staged', 'lint-staged'),
|
|
93
|
+
item('tools/renovate', 'Renovate', 'Renovate'),
|
|
94
|
+
item('tools/llms-txt', 'llms.txt', 'llms.txt'),
|
|
95
|
+
],
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
id: 'ai',
|
|
99
|
+
label: { en: 'AI', zh: 'AI' },
|
|
100
|
+
items: [
|
|
101
|
+
item('', 'AI documentation', 'AI 文档'),
|
|
102
|
+
item('llms-txt', 'llms.txt', 'llms.txt'),
|
|
103
|
+
],
|
|
104
|
+
},
|
|
105
|
+
] as const satisfies readonly RouteSection[]
|
|
106
|
+
|
|
107
|
+
export type RouteSectionId = (typeof routeSections)[number]['id']
|
|
108
|
+
|
|
109
|
+
function prefixFor(locale: DocsLocale) {
|
|
110
|
+
return locale === 'zh' ? '/zh' : ''
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
export function routePath(section: RouteSectionId, slug: string, locale: DocsLocale) {
|
|
114
|
+
const prefix = prefixFor(locale)
|
|
115
|
+
return `${prefix}/${section}/${slug}`.replace(/\/+/g, '/')
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
function sectionItems(section: RouteSection, locale: DocsLocale): DefaultTheme.SidebarItem[] {
|
|
119
|
+
return section.items.map(route => ({
|
|
120
|
+
text: route.label[locale],
|
|
121
|
+
link: routePath(section.id, route.slug, locale),
|
|
122
|
+
}))
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
export function createSidebars(locale: DocsLocale): DefaultTheme.SidebarMulti {
|
|
126
|
+
const prefix = prefixFor(locale)
|
|
127
|
+
return Object.fromEntries(routeSections.map(section => [
|
|
128
|
+
`${prefix}/${section.id}/`,
|
|
129
|
+
[{ text: section.label[locale], items: sectionItems(section, locale) }],
|
|
130
|
+
]))
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
export function createNav(locale: DocsLocale): DefaultTheme.NavItem[] {
|
|
134
|
+
const prefix = prefixFor(locale)
|
|
135
|
+
const text = locale === 'zh'
|
|
136
|
+
? { start: '开始', tasks: '任务', reference: '参考', learn: '理解', ai: 'AI 文档' }
|
|
137
|
+
: { start: 'Start', tasks: 'Tasks', reference: 'Reference', learn: 'Learn', ai: 'AI Docs' }
|
|
138
|
+
return (Object.keys(text) as RouteSectionId[]).map(section => ({
|
|
139
|
+
text: text[section],
|
|
140
|
+
link: `${prefix}/${section}/`.replace(/\/+/g, '/'),
|
|
141
|
+
}))
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
export function allDocumentRoutes(locale: DocsLocale) {
|
|
145
|
+
return routeSections.flatMap(section => section.items.map(item => routePath(section.id, item.slug, locale)))
|
|
146
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import type { HeadConfig, TransformContext } from 'vitepress'
|
|
2
|
+
|
|
3
|
+
export const siteOrigin = 'https://repoctl.icebreaker.top'
|
|
4
|
+
|
|
5
|
+
function routeFromPage(page: string) {
|
|
6
|
+
const withoutExtension = page.replace(/\.md$/, '')
|
|
7
|
+
if (withoutExtension === 'index') {
|
|
8
|
+
return '/'
|
|
9
|
+
}
|
|
10
|
+
if (withoutExtension.endsWith('/index')) {
|
|
11
|
+
return `/${withoutExtension.slice(0, -6)}`
|
|
12
|
+
}
|
|
13
|
+
return `/${withoutExtension}`
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
function localeRoutes(page: string) {
|
|
17
|
+
const sourcePage = page.startsWith('zh/') ? page.slice(3) : page
|
|
18
|
+
const english = routeFromPage(sourcePage)
|
|
19
|
+
const chinese = routeFromPage(`zh/${sourcePage}`)
|
|
20
|
+
return { english, chinese }
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export function createPageHead({ page, title, description }: TransformContext): HeadConfig[] {
|
|
24
|
+
const { english, chinese } = localeRoutes(page)
|
|
25
|
+
const isChinese = page.startsWith('zh/')
|
|
26
|
+
const current = isChinese ? chinese : english
|
|
27
|
+
const canonical = `${siteOrigin}${current}`
|
|
28
|
+
const socialImage = `${siteOrigin}/brand/repoctl-social-${isChinese ? 'zh' : 'en'}.png`
|
|
29
|
+
const socialImageAlt = isChinese
|
|
30
|
+
? 'repoctl:面向 pnpm 与 Turborepo monorepo 的任务型 CLI'
|
|
31
|
+
: 'repoctl: task-first CLI for pnpm and Turborepo monorepos'
|
|
32
|
+
|
|
33
|
+
return [
|
|
34
|
+
['link', { rel: 'canonical', href: canonical }],
|
|
35
|
+
['link', { rel: 'alternate', hreflang: 'en', href: `${siteOrigin}${english}` }],
|
|
36
|
+
['link', { rel: 'alternate', hreflang: 'zh-CN', href: `${siteOrigin}${chinese}` }],
|
|
37
|
+
['link', { rel: 'alternate', hreflang: 'x-default', href: `${siteOrigin}${english}` }],
|
|
38
|
+
['meta', { property: 'og:type', content: 'website' }],
|
|
39
|
+
['meta', { property: 'og:site_name', content: 'repoctl' }],
|
|
40
|
+
['meta', { property: 'og:title', content: title }],
|
|
41
|
+
['meta', { property: 'og:description', content: description }],
|
|
42
|
+
['meta', { property: 'og:url', content: canonical }],
|
|
43
|
+
['meta', { property: 'og:locale', content: isChinese ? 'zh_CN' : 'en_US' }],
|
|
44
|
+
['meta', { property: 'og:image', content: socialImage }],
|
|
45
|
+
['meta', { property: 'og:image:width', content: '1200' }],
|
|
46
|
+
['meta', { property: 'og:image:height', content: '630' }],
|
|
47
|
+
['meta', { property: 'og:image:alt', content: socialImageAlt }],
|
|
48
|
+
['meta', { name: 'twitter:card', content: 'summary_large_image' }],
|
|
49
|
+
['meta', { name: 'twitter:title', content: title }],
|
|
50
|
+
['meta', { name: 'twitter:description', content: description }],
|
|
51
|
+
['meta', { name: 'twitter:image', content: socialImage }],
|
|
52
|
+
['meta', { name: 'twitter:image:alt', content: socialImageAlt }],
|
|
53
|
+
]
|
|
54
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { useData } from 'vitepress'
|
|
3
|
+
import DefaultTheme from 'vitepress/theme'
|
|
4
|
+
import { computed } from 'vue'
|
|
5
|
+
|
|
6
|
+
const { Layout } = DefaultTheme
|
|
7
|
+
const { lang } = useData()
|
|
8
|
+
const notFoundTitle = computed(() => lang.value === 'zh-CN' ? '页面不存在' : 'Page not found')
|
|
9
|
+
const notFoundBody = computed(() => lang.value === 'zh-CN'
|
|
10
|
+
? '这个地址不属于新的文档结构。请从开始、任务或参考章节继续。'
|
|
11
|
+
: 'This address is not part of the new documentation structure. Continue with Start, Tasks, or Reference.')
|
|
12
|
+
</script>
|
|
13
|
+
|
|
14
|
+
<template>
|
|
15
|
+
<Layout>
|
|
16
|
+
<template #not-found>
|
|
17
|
+
<main class="repoctl-not-found">
|
|
18
|
+
<p class="repoctl-not-found__code">
|
|
19
|
+
404
|
|
20
|
+
</p>
|
|
21
|
+
<h1>{{ notFoundTitle }}</h1>
|
|
22
|
+
<p>{{ notFoundBody }}</p>
|
|
23
|
+
<a href="/start/">{{ lang === 'zh-CN' ? '返回开始' : 'Back to Start' }}</a>
|
|
24
|
+
</main>
|
|
25
|
+
</template>
|
|
26
|
+
</Layout>
|
|
27
|
+
</template>
|