The purpose of the package ↗ is keeping app/lib information (version, name, description, dependencies, scripts etc.).
- ➡ rimraf - cross-platform way to remove files and folders
-
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/*'