Skip to content
/ monorepo-starter Public template

A starter template for a monorepo using NPM workspaces ๐Ÿ—‚๏ธ

License

Notifications You must be signed in to change notification settings

bent10/monorepo-starter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Logo

A starter template for a monorepo using NPM workspaces.

Features

  • Quick start: Efficient starting point for Web and Node.js projects
  • Lightweight: Only native NPM workspaces, for speed and simplicity
  • Multilingual support: Supports multiple programming languages in a single repository
  • Modern syntax: Supports the latest language features
  • Flexible output: Output in any format
  • Automatic updates: Keeps your dependencies up to date. See recipes for more info
  • Automated releases: Automatically handles GitHub releases, NPM publishing, and changelog updates. Check out recipes for details
  • Live Playground: Includes a live environment for testing code

Installation

To start a new project with this template, use one of the following methods:

Clone from GitHub

Click the "Use this template" button above or clone the repository. Then, install dependencies:

npm i

Use npx degit

Clone the template and install dependencies:

npx degit "bent10/monorepo-starter" my-project
cd my-project
npm i

Commands

  • npm run dev -w pkgName: Starts the dev server for a specific package
  • npm run build: Builds the project and checks types
  • npm test: Runs tests with Vitest
  • npm run coverage: Generates test coverage reports
  • npm run types: Generates TypeScript declaration files
  • npm run lint: Checks types and lints the project
  • npm run format: Formats code using Prettier

Use these commands to manage your development workflow. Add -w or --workspace to target specific packages:

npm run build -w pkg1 -w pkg2 ...

Packages

Package Description Version
js-lib JavaScript library v0.0.0-development
theme Bootstrap-powered theme v0.0.0-development
vite-plugin Vite plugin v0.0.0-development

Adding new packages

To add a new package:

  1. Run the following command with your desired template:

    # For npm 6.x
    npm create vite@latest packages/new-package --template react
    
    # For npm 7+
    npm create vite@latest packages/new-package -- --template react

    Check available templates

  2. Open packages/new-package/package.json and remove dependencies already included in doogu (e.g., vite, vitest, typescript, prettier, eslint).

Your new package is now ready for development with Vite features.

Recipes

Related

  • module-starter โ€“ A minimalist template for modern web development
  • doogu โ€“ A wrapper around modern JavaScript tools

Contributing

We ๐Ÿ’›ย  issues.

When committing, please conform to the semantic-release commit standards. Please install commitizen and the adapter globally, if you have not already.

npm i -g commitizen cz-conventional-changelog

Now you can use git cz or just cz instead of git commit when committing. You can also use git-cz, which is an alias for cz.

git add . && git cz

License

GitHub

A project by Stilearning ยฉ 2021-2024.