/frontend-monorepo-template

Monorepo template using yarn 2 workspaces, minimal sub-packages, and automated releases to Github + npmjs.

Primary LanguageTypeScript

frontend-monorepo-template

npm package Build Status Downloads Issues Commitizen Friendly Semantic Release

Monorepo template configured with Yarn 2, Typescript, automated Gihub releases and npm publishing.

Structure

project
│   README.md
│
└───.github
│   └───workflows
│       │   release.yml
│       │   unit-tests.yml
│
└───packages
    └───package-a
    │   │   release.yml
    │   │   package.json
    │   │   tsconfig.json
    │   └───src
    │   |     | index.ts
    │   └───test
    │         | index.spec.ts
    └───package-b
        │   release.yml
        │   package.json
        │   tsconfig.json
        └───src
        |     | index.ts
        └───test
               | index.spec.ts

The folder packages contains independent npm packages. Each one has its own package.json with a unique name and yarn workspaces will automatically recognize them. Review yarn workspaces for requirements.

Shared configuration examples

Generate new project

  1. Option 1 - Generate GitHub template since this repo is configured as a template
  2. Option 2 - scaffold new project with degit
    • mkdir new-monorepo
    • npx degit NazimHAli/frontend-monorepo-template new-monorepo
Optional & recommended configurations
  • semantic-releases
    • Automates versioning, GitHub releases + publishing to registries like npmjs
  • commitizen
    • Simple commit conventions for internet citizens. When you commit with Commitizen, you'll be prompted to fill out any required commit fields at commit time.

Run scripts against each package

  • yarn workspaces foreach run test
  • yarn workspaces foreach run build

Similar projects