Skip to content

ReasonableTech/monorepo-starter

Repository files navigation

Monorepo Starter

A CLI tool for creating pnpm monorepos with apps and packages structure.

Features

  • 🚀 Quick Setup: Generate monorepos with a single command
  • 📦 pnpm Workspaces: Built-in support for pnpm workspaces
  • ⚛️ React Support: Create React apps with Vite
  • 🔧 TypeScript First: TypeScript by default with JavaScript option
  • 📱 Multiple Templates: Basic, React, Full-stack, and Electron templates
  • 🔧 Shared Configuration: ESLint, TypeScript configs across packages
  • 🎯 Utilities: Reusable utility packages

Usage

# Using npm
npm create pnpm-monorepo my-project

# Using pnpm
pnpm dlx create-pnpm-monorepo my-project

# Using yarn
yarn create pnpm-monorepo my-project

Templates

  • Basic: Just workspace structure with shared packages
  • React: React app with Vite and shared UI components
  • Full Stack: React + API + shared packages
  • Electron: Desktop app with React

Generated Structure

my-project/
├── pnpm-workspace.yaml
├── package.json
├── apps/
│   ├── web/          # React app (if selected)
│   ├── api/          # Backend API (if selected)
│   └── desktop/      # Electron app (if selected)
├── packages/
│   ├── ui/           # Shared UI components
│   ├── config/       # Shared configurations
│   └── utils/        # Shared utilities
└── .gitignore

Development

This project is itself a pnpm monorepo:

# Install dependencies
pnpm install

# Build the CLI
pnpm build

# Test the CLI locally
cd apps/cli
npm link

# Use the CLI
create-pnpm-monorepo test-project

Architecture

  • apps/cli/: The main CLI tool package
  • packages/templates/: Template files for different project types
  • packages/config/: Shared configuration files (ESLint, TypeScript)
  • packages/utils/: Utilities for file manipulation and template processing

Publishing

The CLI tool is published as create-pnpm-monorepo and can be used with npm create, pnpm dlx, or yarn create.

License

MIT

About

A CLI tool for quickly bootstrapping JavaScript/TypeScript monorepos with multiple apps

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors