8000 GitHub - liuqiang1357/monorepo-starter: A modern monorepo starter template using pnpm workspaces, Turborepo, and Changesets.
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

liuqiang1357/monorepo-starter

Repository files navigation

Monorepo Starter

A modern monorepo starter template using pnpm workspaces, Turborepo, and Changesets.

Features

  • 📦 pnpm - Fast package management
  • 🏎️ Turborepo - High-performance build system
  • 🚢 Changesets - Versioning and publishing
  • 🧹 Husky - Git hooks
  • 📝 commitlint - Enforce conventional commits
  • 🛡️ ESLint - Code linting with shared configurations
  • 🔄 TypeScript - Shared TypeScript configurations
  • 🎨 Prettier - Code formatting with shared configurations

Requirements

  • Node.js 22.x
  • pnpm 10.5.2+

Project Structure

monorepo-starter/
├── apps/                 # Application packages
│   ├── web/              # Next.js web application
│   └── storybook/        # Storybook UI component documentation and playground
├── packages/             # Shared packages, libraries, and utilities
│   ├── typescript-config/ # Shared TypeScript configurations
│   ├── eslint-config/    # Shared ESLint configurations
│   ├── prettier-config/  # Shared Prettier configurations
│   └── ui/               # Shared UI component library
├── .changeset/          # Changeset files
├── .github/             # GitHub related files (workflows, templates, etc.)
├── .husky/              # Git hooks configuration
├── .vscode/             # VS Code settings
├── .turbo/              # Turborepo cache
├── LICENSE              # License file
├── .gitignore           # Git ignore file
├── .node-version        # Node.js version
├── .npmrc               # npm configuration
├── commitlint.config.js # Commitlint configuration
├── package.json         # Root package.json
├── pnpm-lock.yaml       # pnpm lock file
├── pnpm-workspace.yaml  # pnpm workspace configuration
└── turbo.json           # Turborepo configuration

Getting Started

# Clone and install
git clone https://github.com/yourusername/monorepo-starter.git
cd monorepo-starter
pnpm install

Common Commands

# Development
pnpm dev         # Start development servers
pnpm build       # Build all packages
pnpm test        # Run tests

# Code Quality
pnpm lint        # Run linting
pnpm lint-staged # Run staged files linting
pnpm check-types # Type checking
pnpm format      # Format code

# UI Components
pnpm add-ui -- [component...]  # Add shadcn UI components to the UI library

Code Quality

Husky Git Hooks

  • pre-commit: Runs type checking and linting on code
  • commit-msg: Validates commit messages

Conventional Commits

Follow the Conventional Commits specification:

<type>(<scope>): <subject>

Common types: feat, fix, docs, style, refactor, perf, test, build, ci, chore

Creating Commits

# Interactive commit prompt
pnpm commit

# Manual commit
git commit -m "type(scope): subject" -m "description"

Publishing Packages

# Create a changeset
pnpm changeset

# Version packages
pnpm changeset version

# Publish packages
pnpm publish-packages

Adding New Apps and Packages

  1. Create a directory in apps/ or packages/
  2. Initialize your application/package
  3. Add to workspace in package.json

License

MIT License - see the LICENSE file for details.

About

A modern monorepo starter template using pnpm workspaces, Turborepo, and Changesets.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published
0