Avoid duplicating scripts in a monorepo
Manage your scripts in a centralized way using run-scoped
Run arbitrary script from package.json
in any sub-directory or package
* See how to set up a monorepo using lerna here
rs [--scope packageNameGlob="*"] [--prefix pathToPackages="packages"]
{
"scripts": {
"prelog:env": "cross-env FOO=prelog printenv FOO",
"log:env": "cross-env FOO=log printenv FOO",
"postlog:env": "cross-env FOO=postlog printenv FOO"
}
}
packages
├── common
└── greet
rs log --scope greet
path-your-project/packages/greet
cross-env FOO=prelog printenv FOO
prelog
path-your-project/packages/greet
cross-env FOO=log printenv FOO
log
path-your-project/packages/greet
cross-env FOO=postlog printenv FOO
postlog