@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
|
@@ -1,4 +1,14 @@
|
|
|
1
|
+
import type { EnhanceAppContext, Theme } from 'vitepress'
|
|
1
2
|
import DefaultTheme from 'vitepress/theme'
|
|
3
|
+
import HomePage from './components/HomePage.vue'
|
|
4
|
+
import Layout from './Layout.vue'
|
|
2
5
|
import './tailwind.css'
|
|
6
|
+
import './home/index.css'
|
|
3
7
|
|
|
4
|
-
export default
|
|
8
|
+
export default {
|
|
9
|
+
...DefaultTheme,
|
|
10
|
+
Layout,
|
|
11
|
+
enhanceApp({ app }: EnhanceAppContext) {
|
|
12
|
+
app.component('HomePage', HomePage)
|
|
13
|
+
},
|
|
14
|
+
} satisfies Theme
|
|
@@ -9,8 +9,8 @@ The documentation build generates `/llms.txt` and `/llms-full.txt`. English is t
|
|
|
9
9
|
## Usage
|
|
10
10
|
|
|
11
11
|
```text
|
|
12
|
-
https://
|
|
13
|
-
https://
|
|
12
|
+
https://repoctl.icebreaker.top/llms.txt
|
|
13
|
+
https://repoctl.icebreaker.top/llms-full.txt
|
|
14
14
|
```
|
|
15
15
|
|
|
16
16
|
Use the compact index for discovery and the full file only when the consumer has enough context budget.
|
|
@@ -1,63 +1,9 @@
|
|
|
1
1
|
---
|
|
2
|
-
layout:
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
tagline: Initialize, diagnose, scaffold, verify, and upgrade practical Turborepo workspaces from one CLI.
|
|
8
|
-
image:
|
|
9
|
-
src: /logo.jpg
|
|
10
|
-
alt: repoctl logo
|
|
11
|
-
actions:
|
|
12
|
-
- theme: brand
|
|
13
|
-
text: Get Started
|
|
14
|
-
link: /repoctl/getting-started
|
|
15
|
-
- theme: alt
|
|
16
|
-
text: Commands
|
|
17
|
-
link: /repoctl/commands
|
|
18
|
-
- theme: alt
|
|
19
|
-
text: AI Docs
|
|
20
|
-
link: /ai/
|
|
21
|
-
|
|
22
|
-
features:
|
|
23
|
-
- title: Adopt existing workspaces
|
|
24
|
-
details: Run setup and doctor to align workspace patterns, root scripts, config files, and commit hooks.
|
|
25
|
-
- title: Create packages and apps
|
|
26
|
-
details: Scaffold libraries, apps, services, docs, and CLIs with interactive prompts or explicit template keys.
|
|
27
|
-
- title: Make checks repeatable
|
|
28
|
-
details: Preview and run local verification plans that match your lint, typecheck, build, test, and tsd workflow.
|
|
29
|
-
- title: AI-readable documentation
|
|
30
|
-
details: Generate llms.txt, llms-full.txt, and Markdown page output so AI coding tools can read the repoctl docs directly.
|
|
2
|
+
layout: page
|
|
3
|
+
aside: false
|
|
4
|
+
pageClass: repoctl-home-page
|
|
5
|
+
title: repoctl
|
|
6
|
+
description: Task-first CLI for initializing, maintaining, validating, and releasing pnpm and Turborepo monorepos.
|
|
31
7
|
---
|
|
32
8
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
```bash
|
|
36
|
-
pnpm add -D repoctl
|
|
37
|
-
pnpm exec repo init
|
|
38
|
-
pnpm exec repo doctor
|
|
39
|
-
pnpm exec repo new
|
|
40
|
-
pnpm exec repo check
|
|
41
|
-
```
|
|
42
|
-
|
|
43
|
-
Generated repositories expose the same workflow as shorter root scripts:
|
|
44
|
-
|
|
45
|
-
```bash
|
|
46
|
-
pnpm run repo:init
|
|
47
|
-
pnpm run repo:doctor
|
|
48
|
-
pnpm run repo:new
|
|
49
|
-
pnpm run repo:check
|
|
50
|
-
```
|
|
51
|
-
|
|
52
|
-
## Keep Reading
|
|
53
|
-
|
|
54
|
-
- [repoctl Overview](./repoctl/index.md)
|
|
55
|
-
- [Getting Started](./repoctl/getting-started.md)
|
|
56
|
-
- [Adopt Existing Repositories](./repoctl/adopt-existing.md)
|
|
57
|
-
- [Choose By Scenario](./repoctl/scenarios.md)
|
|
58
|
-
- [Command Reference](./repoctl/commands.md)
|
|
59
|
-
- [Configuration](./repoctl/config.md)
|
|
60
|
-
- [Templates](./repoctl/templates.md)
|
|
61
|
-
- [Workflows and CI](./repoctl/workflows.md)
|
|
62
|
-
- [AI Docs: llms.txt](./ai/llms-txt.md)
|
|
63
|
-
- [Knowledge Base](./knowledge/index.md)
|
|
9
|
+
<HomePage locale="en" />
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# Learn the system
|
|
2
|
+
|
|
3
|
+
Use Learn after the first workflow works. These pages explain the boundaries around repoctl, monorepos, packages, templates, and the tools that run underneath.
|
|
4
|
+
|
|
5
|
+
## Concepts
|
|
6
|
+
|
|
7
|
+
- [How repoctl fits into a repository](./repoctl-model)
|
|
8
|
+
- [Monorepo foundations](./monorepo/)
|
|
9
|
+
- [Modern npm packages](./packages/)
|
|
10
|
+
- [Template systems](./monorepo/templates)
|
|
11
|
+
|
|
12
|
+
## Tools
|
|
13
|
+
|
|
14
|
+
The [tool guides](./tools/) explain pnpm, Turborepo, versioning, hooks, staged checks, and dependency automation.
|
|
15
|
+
|
|
16
|
+
## Reading order
|
|
17
|
+
|
|
18
|
+
Start with the repository model, then choose either monorepo foundations or package publishing. Return to the [tasks](/tasks/) section whenever you need an executable sequence.
|
|
@@ -13,4 +13,4 @@
|
|
|
13
13
|
|
|
14
14
|
One command layer matters because scripts, documentation, CI, and contributor expectations otherwise drift independently. repoctl keeps task names stable while pnpm and Turborepo continue to perform dependency installation and task execution.
|
|
15
15
|
|
|
16
|
-
See the complete [repoctl command reference](
|
|
16
|
+
See the complete [repoctl command reference](/reference/commands).
|
|
@@ -32,6 +32,6 @@ repoctl adds the missing workflow layer:
|
|
|
32
32
|
|
|
33
33
|
## Keep Reading
|
|
34
34
|
|
|
35
|
-
- [repoctl Overview](
|
|
36
|
-
- [Command Reference](
|
|
37
|
-
- [Templates](
|
|
35
|
+
- [repoctl Overview](/learn/repoctl-model)
|
|
36
|
+
- [Command Reference](/reference/commands)
|
|
37
|
+
- [Templates](/reference/templates)
|
|
@@ -11,4 +11,4 @@ repo templates --check
|
|
|
11
11
|
|
|
12
12
|
The publishable `@icebreakers/monorepo-templates` package owns the registry and packaged assets. Individual `templates/*` workspaces are private and are not release units.
|
|
13
13
|
|
|
14
|
-
See [Templates](
|
|
14
|
+
See [Templates](/reference/templates) and [Template Asset Management](/reference/template-assets).
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
https://repoctl.icebreaker.top/
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
https://repoctl.icebreaker.top/
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# What Is An npm Package?
|
|
2
|
+
|
|
3
|
+
An npm package is a versioned archive with a `package.json` contract. It may provide runtime JavaScript, type declarations, a command-line binary, configuration presets, or assets. Publishing a folder is easy; maintaining that contract is the real work.
|
|
4
|
+
|
|
5
|
+
## The package boundary
|
|
6
|
+
|
|
7
|
+
```text
|
|
8
|
+
package.json name, version, exports, files, engines
|
|
9
|
+
README.md install and supported usage
|
|
10
|
+
dist/ built runtime and type declarations
|
|
11
|
+
LICENSE license terms for consumers
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
Only files named by `files`, exports, and package metadata should be treated as public. Internal source layout is free to change until it appears in the published contract.
|
|
15
|
+
|
|
16
|
+
## Inspect what ships
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
npm pack --dry-run
|
|
20
|
+
pnpm pack --pack-destination ./artifacts
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
Review the archive after every material packaging change. This catches missing declarations, accidental source publication, and files referenced by `exports` that were not included.
|
|
24
|
+
|
|
25
|
+
## Version with intent
|
|
26
|
+
|
|
27
|
+
- Patch: compatible fix or metadata correction.
|
|
28
|
+
- Minor: compatible capability, such as a new public command or template.
|
|
29
|
+
- Major: incompatible API, behavior, or supported runtime change.
|
|
30
|
+
|
|
31
|
+
Repository versioning tools record that decision, but they cannot determine whether a consumer will be broken. Write the release note from the consumer's point of view.
|
|
32
|
+
|
|
33
|
+
## Keep Reading
|
|
34
|
+
|
|
35
|
+
- [Publishing A Package](/learn/packages/publish)
|
|
36
|
+
- [Modern Package Guide](./modern/)
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# Bundlers
|
|
2
|
+
|
|
3
|
+
Choose a bundler by the package boundary you need to ship. A library build needs reliable entry points and declarations; a component library also needs framework and CSS handling; an application build needs an optimized browser bundle.
|
|
4
|
+
|
|
5
|
+
## Current choices
|
|
6
|
+
|
|
7
|
+
| Tool | Good fit | Notes |
|
|
8
|
+
| ---------- | ----------------------------------------------- | ------------------------------------------------- |
|
|
9
|
+
| `tsdown` | TypeScript libraries and tooling | Produces modern library output with declarations |
|
|
10
|
+
| `vite` | Applications and component libraries | Strong development server and library mode |
|
|
11
|
+
| `rolldown` | Toolchains that need Rollup-compatible behavior | Evaluate ecosystem compatibility before migration |
|
|
12
|
+
|
|
13
|
+
The repoctl generic library template uses `tsdown`. Vue component libraries continue to use Vite library mode.
|
|
14
|
+
|
|
15
|
+
## tsdown library configuration
|
|
16
|
+
|
|
17
|
+
:::code-group
|
|
18
|
+
|
|
19
|
+
```ts [tsdown.config.ts]
|
|
20
|
+
import { defineConfig } from 'tsdown'
|
|
21
|
+
|
|
22
|
+
export default defineConfig({
|
|
23
|
+
entry: ['./src/index.ts'],
|
|
24
|
+
format: ['cjs', 'esm'],
|
|
25
|
+
dts: true,
|
|
26
|
+
clean: true,
|
|
27
|
+
target: 'node18',
|
|
28
|
+
})
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
:::
|
|
32
|
+
|
|
33
|
+
## Retired defaults
|
|
34
|
+
|
|
35
|
+
`tsup` and `unbuild` are not recommended for new repoctl templates. Existing projects can migrate when their build behavior and published artifacts are covered by tests. Do not rewrite a working package merely to follow a tooling trend.
|
|
36
|
+
|
|
37
|
+
## Keep Reading
|
|
38
|
+
|
|
39
|
+
- [TypeScript](./typescript.md)
|
|
40
|
+
- [Package Entry Points](./package-entry-points.md)
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# Type Declarations
|
|
2
|
+
|
|
3
|
+
Type declarations describe the public TypeScript contract of a JavaScript package. They must be generated from the same source and exported through the same public entry points as the runtime code.
|
|
4
|
+
|
|
5
|
+
## Emit declarations
|
|
6
|
+
|
|
7
|
+
```json
|
|
8
|
+
{
|
|
9
|
+
"compilerOptions": {
|
|
10
|
+
"declaration": true,
|
|
11
|
+
"declarationMap": true,
|
|
12
|
+
"emitDeclarationOnly": false,
|
|
13
|
+
"outDir": "./dist"
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
Bundlers such as tsdown can emit declaration files alongside runtime output. The important rule is that declaration paths are stable and match the package exports map.
|
|
19
|
+
|
|
20
|
+
## Link types to exports
|
|
21
|
+
|
|
22
|
+
```json
|
|
23
|
+
{
|
|
24
|
+
"exports": {
|
|
25
|
+
".": {
|
|
26
|
+
"types": "./dist/index.d.ts",
|
|
27
|
+
"import": "./dist/index.js",
|
|
28
|
+
"require": "./dist/index.cjs"
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
The top-level `types` field is useful for simple packages. Per-entry `types` declarations are necessary when a package exposes subpaths or format-specific output.
|
|
35
|
+
|
|
36
|
+
## Test the public contract
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
pnpm tsd
|
|
40
|
+
pnpm pack --dry-run
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
Type tests should import from the package name, not a source file. That proves the declarations consumers receive are compatible with the documented API.
|
|
44
|
+
|
|
45
|
+
## Keep Reading
|
|
46
|
+
|
|
47
|
+
- [Package Entry Points](./package-entry-points.md)
|
|
48
|
+
- [TypeScript](./typescript.md)
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# ESM vs CommonJS
|
|
2
|
+
|
|
3
|
+
Node supports two JavaScript module systems. ESM uses `import` and `export`; CommonJS uses `require` and `module.exports`. A package can support both, but it must state how each consumer reaches the correct file.
|
|
4
|
+
|
|
5
|
+
## Identify the format
|
|
6
|
+
|
|
7
|
+
| Signal | Meaning |
|
|
8
|
+
| ------------------------------- | ------------------- |
|
|
9
|
+
| `.mjs` | Always ESM |
|
|
10
|
+
| `.cjs` | Always CommonJS |
|
|
11
|
+
| `.js` with `"type": "module"` | ESM |
|
|
12
|
+
| `.js` without that package type | CommonJS by default |
|
|
13
|
+
|
|
14
|
+
Avoid guessing from syntax alone. Node resolves a `.js` file from its extension and the nearest package boundary.
|
|
15
|
+
|
|
16
|
+
## Publish both formats
|
|
17
|
+
|
|
18
|
+
```json
|
|
19
|
+
{
|
|
20
|
+
"type": "module",
|
|
21
|
+
"exports": {
|
|
22
|
+
".": {
|
|
23
|
+
"import": "./dist/index.js",
|
|
24
|
+
"require": "./dist/index.cjs"
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
Use an exports map rather than asking consumers to reach into `dist`. It gives each module system an intentional entry point and prevents accidental private imports becoming a public API.
|
|
31
|
+
|
|
32
|
+
## Interoperability rules
|
|
33
|
+
|
|
34
|
+
- Keep the package API identical across formats where possible.
|
|
35
|
+
- Test both `import` and `require` from a consumer fixture.
|
|
36
|
+
- Do not publish TypeScript source as the runtime entry point.
|
|
37
|
+
- Use `.cjs` for CommonJS output when the package itself declares `type: module`.
|
|
38
|
+
|
|
39
|
+
## Keep Reading
|
|
40
|
+
|
|
41
|
+
- [Package Entry Points](./package-entry-points.md)
|
|
42
|
+
- [Type Declarations](./dts.md)
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# Modern Package Guide
|
|
2
|
+
|
|
3
|
+
A publishable package is more than a source folder. Consumers depend on its runtime format, type declarations, entry points, files list, and compatibility policy. This guide explains the decisions that keep those contracts explicit.
|
|
4
|
+
|
|
5
|
+
## Start with the consumer
|
|
6
|
+
|
|
7
|
+
Before choosing a bundler or module format, answer these questions:
|
|
8
|
+
|
|
9
|
+
- Will consumers load the package through ESM, CommonJS, or both?
|
|
10
|
+
- Does the package ship runtime code, types, a CLI, or generated assets?
|
|
11
|
+
- Which Node versions must work?
|
|
12
|
+
- Should consumers import one public entry point or several intentional subpaths?
|
|
13
|
+
|
|
14
|
+
The answers define the package boundary. Tooling should implement that boundary, not invent it.
|
|
15
|
+
|
|
16
|
+
## Recommended shape
|
|
17
|
+
|
|
18
|
+
```text
|
|
19
|
+
src/ source code
|
|
20
|
+
dist/ generated ESM, CommonJS, and declaration files
|
|
21
|
+
package.json public metadata and exports map
|
|
22
|
+
README.md installation and usage contract
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
Use `files` to publish only the built output and deliberately included documentation. Run `npm pack --dry-run` before publishing to inspect the actual package tarball.
|
|
26
|
+
|
|
27
|
+
## Topics
|
|
28
|
+
|
|
29
|
+
- [ESM vs CommonJS](./esm-vs-cjs.md)
|
|
30
|
+
- [Type Declarations](./dts.md)
|
|
31
|
+
- [Package Entry Points](./package-entry-points.md)
|
|
32
|
+
- [Bundlers](./bundlers.md)
|
|
33
|
+
- [TypeScript](./typescript.md)
|
|
34
|
+
|
|
35
|
+
## Keep Reading
|
|
36
|
+
|
|
37
|
+
- [What Is An npm Package?](/learn/packages/)
|
|
38
|
+
- [Publishing A Package](/learn/packages/publish)
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# Package Entry Points
|
|
2
|
+
|
|
3
|
+
The `exports` field is the public map of a package. It selects files for ESM, CommonJS, types, and intentional subpath imports while preventing consumers from coupling to internal folders.
|
|
4
|
+
|
|
5
|
+
## Define one primary entry
|
|
6
|
+
|
|
7
|
+
```json
|
|
8
|
+
{
|
|
9
|
+
"name": "example-package",
|
|
10
|
+
"exports": {
|
|
11
|
+
".": {
|
|
12
|
+
"types": "./dist/index.d.ts",
|
|
13
|
+
"import": "./dist/index.js",
|
|
14
|
+
"require": "./dist/index.cjs"
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
Consumers can now use `import { feature } from 'example-package'` or `require('example-package')` without knowing your output layout.
|
|
21
|
+
|
|
22
|
+
## Add a deliberate subpath
|
|
23
|
+
|
|
24
|
+
```json
|
|
25
|
+
{
|
|
26
|
+
"exports": {
|
|
27
|
+
".": "./dist/index.js",
|
|
28
|
+
"./cli": "./dist/cli.js",
|
|
29
|
+
"./package.json": "./package.json"
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
Each subpath is a public promise. Add one only when it has a stable purpose, documentation, and tests. Do not expose `./dist/*` as a shortcut around API design.
|
|
35
|
+
|
|
36
|
+
## Verify consumers
|
|
37
|
+
|
|
38
|
+
- Test the root import and every documented subpath.
|
|
39
|
+
- Verify both ESM and CommonJS branches when both are published.
|
|
40
|
+
- Check `npm pack --dry-run` includes every exported file.
|
|
41
|
+
- Treat removing or changing a public subpath as a breaking change.
|
|
42
|
+
|
|
43
|
+
## Keep Reading
|
|
44
|
+
|
|
45
|
+
- [ESM vs CommonJS](./esm-vs-cjs.md)
|
|
46
|
+
- [Type Declarations](./dts.md)
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# TypeScript
|
|
2
|
+
|
|
3
|
+
TypeScript gives a package one source language for implementation and public types. Build output should remain JavaScript plus declarations so consumers do not need your development compiler configuration.
|
|
4
|
+
|
|
5
|
+
## Start with a strict package config
|
|
6
|
+
|
|
7
|
+
```jsonc
|
|
8
|
+
{
|
|
9
|
+
"compilerOptions": {
|
|
10
|
+
"target": "ES2020",
|
|
11
|
+
"module": "ESNext",
|
|
12
|
+
"moduleResolution": "bundler",
|
|
13
|
+
"strict": true,
|
|
14
|
+
"declaration": true,
|
|
15
|
+
"declarationMap": true,
|
|
16
|
+
"outDir": "./dist",
|
|
17
|
+
"skipLibCheck": true
|
|
18
|
+
},
|
|
19
|
+
"include": ["src"]
|
|
20
|
+
}
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
Use a separate configuration only when an output format genuinely needs different compiler behavior. Prefer a bundler configuration for output strategy and keep the TypeScript configuration focused on source checking and declaration generation.
|
|
24
|
+
|
|
25
|
+
## Build and test from artifacts
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
pnpm build
|
|
29
|
+
pnpm typecheck
|
|
30
|
+
pnpm tsd
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
Run type tests against the generated package contract. A source-only test can pass while the published declaration path or exports map is broken.
|
|
34
|
+
|
|
35
|
+
## Runtime execution
|
|
36
|
+
|
|
37
|
+
For local scripts, `tsx` can run TypeScript without creating a development `dist` directory. That is convenient for tooling, but it is not a replacement for building libraries before testing the package that consumers install.
|
|
38
|
+
|
|
39
|
+
## Keep Reading
|
|
40
|
+
|
|
41
|
+
- [Type Declarations](./dts.md)
|
|
42
|
+
- [Bundlers](./bundlers.md)
|
|
43
|
+
- [Publishing A Package](/learn/packages/publish)
|
|
@@ -11,4 +11,4 @@ A modern package needs a deliberate module format, export map, declaration strat
|
|
|
11
11
|
- [Bundlers](./modern/bundlers.md)
|
|
12
12
|
- [TypeScript](./modern/typescript.md)
|
|
13
13
|
|
|
14
|
-
Runnable evolution examples remain under `
|
|
14
|
+
Runnable evolution examples remain under `learn/packages/examples/` and are intentionally excluded from the generated AI documentation index.
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# JavaScript, CommonJS, and ESM Files
|
|
2
|
+
|
|
3
|
+
File extensions tell Node which module loader should read a file. Use them deliberately when a package publishes both module formats or when a script must work independently of the nearest `package.json`.
|
|
4
|
+
|
|
5
|
+
## Extension rules
|
|
6
|
+
|
|
7
|
+
| Extension | Module format |
|
|
8
|
+
| --------- | ----------------------------------------------------- |
|
|
9
|
+
| `.mjs` | ESM in every package |
|
|
10
|
+
| `.cjs` | CommonJS in every package |
|
|
11
|
+
| `.js` | Determined by the nearest `package.json` `type` field |
|
|
12
|
+
|
|
13
|
+
```json
|
|
14
|
+
{
|
|
15
|
+
"type": "module"
|
|
16
|
+
}
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
With this declaration, `.js` files are ESM. Use `.cjs` for CommonJS output such as a compatibility build or an older tooling configuration file.
|
|
20
|
+
|
|
21
|
+
## Avoid ambiguous output
|
|
22
|
+
|
|
23
|
+
```text
|
|
24
|
+
dist/index.js ESM output
|
|
25
|
+
dist/index.cjs CommonJS output
|
|
26
|
+
dist/index.d.ts Type declarations
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
Connect these files through `exports`; do not ask consumers to infer a `dist` layout. A clear output layout also makes package tarball checks easier.
|
|
30
|
+
|
|
31
|
+
## Keep Reading
|
|
32
|
+
|
|
33
|
+
- [ESM vs CommonJS](./modern/esm-vs-cjs.md)
|
|
34
|
+
- [Package Entry Points](./modern/package-entry-points.md)
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# Publishing A Package
|
|
2
|
+
|
|
3
|
+
Publishing is the point where the repository's package contract becomes public. Build first, test the built artifacts, inspect the tarball, and publish only after the version intent and changelog describe the consumer-visible change.
|
|
4
|
+
|
|
5
|
+
## Prepare the package
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
pnpm --filter example-package build
|
|
9
|
+
pnpm --filter example-package typecheck
|
|
10
|
+
pnpm --filter example-package test
|
|
11
|
+
pnpm --filter example-package tsd
|
|
12
|
+
pnpm --filter example-package pack --pack-destination ../../artifacts
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
Run the package commands against generated output where possible. A source-only test does not prove that `exports`, files, or declarations will resolve after installation.
|
|
16
|
+
|
|
17
|
+
## Verify package metadata
|
|
18
|
+
|
|
19
|
+
```json
|
|
20
|
+
{
|
|
21
|
+
"name": "example-package",
|
|
22
|
+
"version": "1.0.0",
|
|
23
|
+
"files": ["dist", "README.md", "LICENSE"],
|
|
24
|
+
"publishConfig": { "access": "public" }
|
|
25
|
+
}
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
Use `npm pack --dry-run` to see what users receive. Confirm the runtime entry point, declaration files, README, and license are present.
|
|
29
|
+
|
|
30
|
+
## Release through the repository workflow
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
pnpm change
|
|
34
|
+
pnpm version -r
|
|
35
|
+
pnpm publish -r
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
The version ledger preserves why the release exists. Do not manually edit a package version to bypass fixed-group or changelog rules.
|
|
39
|
+
|
|
40
|
+
## Keep Reading
|
|
41
|
+
|
|
42
|
+
- [pnpm Versioning](/learn/tools/changeset.md)
|
|
43
|
+
- [Modern Package Guide](./modern/)
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# Reusing JavaScript
|
|
2
|
+
|
|
3
|
+
Reuse source code through an explicit package boundary. Copying files between applications is fast once and expensive every time the shared behavior changes; a local workspace package makes ownership, versioning, and tests visible.
|
|
4
|
+
|
|
5
|
+
## Start with a workspace package
|
|
6
|
+
|
|
7
|
+
```json
|
|
8
|
+
{
|
|
9
|
+
"dependencies": {
|
|
10
|
+
"@example/shared": "workspace:*"
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
The workspace protocol uses the local package during development and protects the repository from accidentally resolving an unrelated registry version.
|
|
16
|
+
|
|
17
|
+
## Export a narrow API
|
|
18
|
+
|
|
19
|
+
```ts
|
|
20
|
+
export function normalizeName(value: string) {
|
|
21
|
+
return value.trim().toLowerCase()
|
|
22
|
+
}
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
Keep the public entry point small. A shared package should expose behavior that has a real consumer, not a collection of unrelated helpers that happen to be nearby.
|
|
26
|
+
|
|
27
|
+
## Choose the right reuse level
|
|
28
|
+
|
|
29
|
+
| Need | Better boundary |
|
|
30
|
+
| ---------------------------- | -------------------------------------- |
|
|
31
|
+
| Shared runtime behavior | A versioned package |
|
|
32
|
+
| Shared build and lint policy | A preset package or managed asset |
|
|
33
|
+
| Shared application feature | A feature package with clear ownership |
|
|
34
|
+
| One-off project setup | A template, not a dependency |
|
|
35
|
+
|
|
36
|
+
## Keep Reading
|
|
37
|
+
|
|
38
|
+
- [What Is An npm Package?](/learn/packages/)
|
|
39
|
+
- [Template Systems](/learn/monorepo/templates.md)
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# JavaScript Runtime Keywords
|
|
2
|
+
|
|
3
|
+
Modern JavaScript modules have different runtime globals depending on whether Node loads them as CommonJS or ESM. Know the boundary before copying code between build tools, scripts, and package entry points.
|
|
4
|
+
|
|
5
|
+
## CommonJS values
|
|
6
|
+
|
|
7
|
+
```js
|
|
8
|
+
console.log(__filename)
|
|
9
|
+
console.log(__dirname)
|
|
10
|
+
console.log(require.main)
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
These values are available in CommonJS modules. They are not automatically present in ESM files.
|
|
14
|
+
|
|
15
|
+
## ESM equivalents
|
|
16
|
+
|
|
17
|
+
```js
|
|
18
|
+
import path from 'node:path'
|
|
19
|
+
import { fileURLToPath } from 'node:url'
|
|
20
|
+
|
|
21
|
+
const filename = fileURLToPath(import.meta.url)
|
|
22
|
+
const dirname = path.dirname(filename)
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
Use `import.meta.url` as the starting point for resolving files relative to an ESM module. Prefer explicit Node built-in imports such as `node:path` so bundlers and readers can identify runtime-only dependencies.
|
|
26
|
+
|
|
27
|
+
## Keep code portable
|
|
28
|
+
|
|
29
|
+
- Keep filesystem access behind a small module when browser builds share source code.
|
|
30
|
+
- Do not use CommonJS globals in a package that declares `type: module`.
|
|
31
|
+
- Test generated ESM and CommonJS outputs independently when both are published.
|
|
32
|
+
|
|
33
|
+
## Keep Reading
|
|
34
|
+
|
|
35
|
+
- [JavaScript, CommonJS, and ESM Files](/learn/packages/module-extensions)
|
|
36
|
+
- [Reusing JavaScript](/learn/packages/reuse-javascript)
|
|
@@ -64,11 +64,11 @@ The docs prefer `repo` so new users only need to remember one command name.
|
|
|
64
64
|
|
|
65
65
|
## Keep Reading
|
|
66
66
|
|
|
67
|
-
- [
|
|
68
|
-
- [
|
|
69
|
-
- [Command Reference](
|
|
70
|
-
- [Configuration](
|
|
71
|
-
- [Templates](
|
|
72
|
-
- [
|
|
73
|
-
- [
|
|
74
|
-
- [Command Aliases](
|
|
67
|
+
- [Install and initialize](/start/install)
|
|
68
|
+
- [Task index](/tasks/)
|
|
69
|
+
- [Command Reference](/reference/commands)
|
|
70
|
+
- [Configuration](/reference/config)
|
|
71
|
+
- [Templates](/reference/templates)
|
|
72
|
+
- [Add checks to CI](/tasks/ci)
|
|
73
|
+
- [Troubleshoot](/tasks/troubleshooting)
|
|
74
|
+
- [Command Aliases](/reference/aliases)
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# pnpm Versioning
|
|
2
|
+
|
|
3
|
+
repoctl uses pnpm's native versioning workflow. A change intent records why a publishable package needs a release, and the repository ledger keeps that intent with the source change.
|
|
4
|
+
|
|
5
|
+
## Record release intent
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
pnpm change
|
|
9
|
+
pnpm version -r
|
|
10
|
+
pnpm publish -r
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Choose the smallest version bump that matches the public contract. Removing a managed asset from a published template package is a minor change because consumers no longer receive that asset. Metadata-only URL changes are patch changes.
|
|
14
|
+
|
|
15
|
+
## Fixed packages
|
|
16
|
+
|
|
17
|
+
Some packages version together because they share a public contract. The versioning configuration defines those groups; do not manually align versions in package manifests.
|
|
18
|
+
|
|
19
|
+
## Before publishing
|
|
20
|
+
|
|
21
|
+
1. Build the affected packages.
|
|
22
|
+
2. Run lint and typecheck.
|
|
23
|
+
3. Run unit, integration, and end-to-end tests where available.
|
|
24
|
+
4. Confirm the generated changelog and package contents match the intent.
|
|
25
|
+
|
|
26
|
+
## Keep Reading
|
|
27
|
+
|
|
28
|
+
- [Publishing and Changelogs](/learn/monorepo/publish.md)
|
|
29
|
+
- [Add checks to CI](/tasks/ci)
|
|
30
|
+
- [Template Assets](/reference/template-assets)
|