English
Getting Started
Prerequisites
- Node.js
^22.18.0 || ^24.11.0 || >=26.0.0 - pnpm
11.28.5(pinned by the rootpackageManagerfield)
Installation
Initialize your project
Clone or download this template, then run the dependency-free initializer:
bash
git clone https://github.com/YunYouJun/starter-monorepo.git
cd starter-monorepo
node scripts/init.mjs --project-name my-library --package-name @acme/core \
--description "My TypeScript library"
cd ../my-librarySee Initialization for prompts, validation rules, metadata, and local package verification.
Install Dependencies
bash
pnpm install --frozen-lockfileProject Structure
starter-monorepo/
├── apps/
│ └── web/ # Optional deployable Nuxt application
├── docs/ # Documentation site
│ ├── .vitepress/ # VitePress config
│ ├── guide/ # English guides
│ ├── zh/guide/ # Chinese guides
│ ├── api/ # API docs (auto-generated)
│ └── public/ # Static assets
├── packages/
│ └── pkg-placeholder/ # Example package
│ ├── src/ # Source code
│ ├── test/ # Tests
│ ├── tsdown.config.ts # Build configuration
│ └── dist/ # Build output
├── package.json # Root package.json
├── pnpm-workspace.yaml # pnpm workspace config
└── tsconfig.json # TypeScript configOptional Nuxt application
Use apps/web for a general deployable Nuxt application. The name web describes its platform while leaving room for its role to grow and for sibling applications such as apps/mobile, apps/desktop, or apps/admin.
Reserve apps/site for an explicitly content, marketing, or corporate website that may coexist with a separate product web app. Avoid framework-based names such as apps/nuxt; application directories should communicate their responsibility or platform.
The workspace already includes the apps/* package glob. Once apps/web/package.json exists, pnpm will discover it automatically. See the Nuxt Web Application guide for the recommended Nuxt 4 structure and instructions for adapting Vitesse Nuxt without creating a nested workspace or lockfile.
Development
Build All Packages
bash
pnpm buildRun in Development Mode
bash
pnpm devRun Tests
bash
pnpm testType Check
bash
pnpm typecheckLint Code
bash
pnpm lintWorking with Documentation
Start Documentation Site
bash
pnpm docs:devVisit http://localhost:5173 to view the documentation.
Generate API Documentation
bash
pnpm docs:apiThis will:
- Read source code from
packages/*/src - Parse JSDoc comments and TypeScript types
- Generate Markdown docs in
docs/api/
pnpm docs:dev generates the API pages before starting VitePress, so it also works on a fresh checkout. pnpm predocs remains an alias for pnpm docs:api.
Build Documentation
bash
pnpm docs:buildPreview Built Documentation
bash
pnpm docs:previewCreating a New Package
- Create a new directory in
packages/:
bash
mkdir packages/my-package
cd packages/my-package- Initialize package.json:
json
{
"name": "my-package",
"version": "0.0.0",
"type": "module",
"exports": {
".": "./dist/index.mjs",
"./package.json": "./package.json"
},
"types": "./dist/index.d.mts",
"files": ["dist"]
}- Create source files:
bash
mkdir src
echo "export const hello = 'world'" > src/index.ts- Add build config (
tsdown.config.ts):
typescript
import { defineConfig } from 'tsdown'
export default defineConfig({
entry: ['src/index.ts'],
dts: true,
exports: true,
publint: true,
})Next Steps
- Learn about Configuration
- Explore the API Reference
- Read the Changelog