Skip to content

Latest commit

 

History

History
78 lines (53 loc) · 1.37 KB

monorepo.md

File metadata and controls

78 lines (53 loc) · 1.37 KB

Package configuration

The purpose of the package ↗ is keeping app/lib information (version, name, description, dependencies, scripts etc.).

Contents

Prerequisites

  • ➡ rimraf - cross-platform way to remove files and folders

Setup

  • Create package.json file:

    // package.json
    
    {
      // Package info
    
      "name": "monorepo",
      "private": true,
      "description": "...",
      "author": "...",
      "license": "MIT",
    
      // Common scripts
    
      "scripts": {
        "clean": "rimraf \"**/node_modules\" && pnpm -r clean",
        "fresh": "pnpm clean && pnpm i",
        "nuke": "rimraf pnpm-lock.yaml && pnpm fresh"
      },
    
      // Prevent using other package managers except pnpm
    
      "engines": {
        "node": ">=14.16.0",
        "pnpm": ">=7.10.0",
        "npm": "please-use-pnpm",
        "yarn": "please-use-pnpm"
      },
      "packageManager": "[email protected]"
    }
  • Add npm configuration file:

    # .npmrc
    
    engine-strict = true
    auto-install-peers = true
  • Add pnpm workspace file:

    # pnpm-workspace.yaml
    
    packages:
      - 'apps/*'
      - 'packages/*'

License

MIT © Sergey Muravjev


⬅ Back