https://github.com/ota-meshi/mrpm
npm package
https://github.com/ota-meshi/mrpm
cli monorepo nodejs npm package
Last synced: 11 months ago
JSON representation
npm package
- Host: GitHub
- URL: https://github.com/ota-meshi/mrpm
- Owner: ota-meshi
- License: mit
- Created: 2018-04-23T11:56:46.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2024-12-17T19:07:39.000Z (over 1 year ago)
- Last Synced: 2025-02-27T05:24:29.813Z (over 1 year ago)
- Topics: cli, monorepo, nodejs, npm, package
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/mrpm
- Size: 190 KB
- Stars: 3
- Watchers: 3
- Forks: 1
- Open Issues: 11
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# mrpm
[](https://www.npmjs.com/package/mrpm)
[](https://www.npmjs.com/package/mrpm)
[](http://www.npmtrends.com/mrpm)
[](http://www.npmtrends.com/mrpm)
[](http://www.npmtrends.com/mrpm)
[](http://www.npmtrends.com/mrpm)
[](https://travis-ci.org/ota-meshi/mrpm)
MonoRepo Package Manager.
This is the CLI tool that runs the npm command for each monorepo projects.
Inspired by [mariuslundgard/monorepo](https://github.com/mariuslundgard/monorepo).
## Why?
It was created to execute a simple npm command in order of dependencies.
## Usage
### install
```bash
npm i -D mrpm
```
### Example of dir & package.json
```
pkgroot
+--packages
| +--subpkg1
| | `--package.json
| `--subpkg2
| `--package.json
`--package.json
```
`pkgroot/package.json`
```json5
{
//...
"private": true,
//...
"scripts": {
"test": "mrpm run test",
"build": "mrpm run build",
//...
},
//...
}
```
`pkgroot/packages/subpkg1/package.json` or
`pkgroot/packages/subpkg2/package.json`
```json5
{
// If `private` is set to `true`, it will be excluded from `publish`
// "private": true,
//...
"scripts": {
"test": "...",
"build": "...",
//...
},
//...
}
```
### Example of commands
* `npm install` for each monorepo projects.
```bash
mrpm install
```
* `npm update` for each monorepo projects.
```bash
mrpm update
```
* `npm publish` for each monorepo projects.
```bash
mrpm publish
```
* `npm run` script for each monorepo projects.
```bash
mrpm run xxx
```
* `npm prune` for each monorepo projects.
```bash
mrpm prune
```
### Options
* `--mrpm-max-workers=`
Specifies the maximum number of workers the worker-pool will spawn for running commands.
## Example of Deploy with [Travis CI](https://travis-ci.org/).
### files
* `package.json`
* `.travis.yml`
* `deploy.sh`
### package.json
```json5
{
//...
"private": true,
//...
"scripts": {
//...
"publish:all": "mrpm publish",
//...
},
"devDependencies": {
"mrpm": "x.x.x"
}
}
```
### .travis.yml
```yml
language: node_js
node_js:
- "node"
deploy:
provider: script
script: sh $TRAVIS_BUILD_DIR/deploy.sh
```
### deploy.sh
```sh
#!/usr/bin/env bash
npm config set //registry.npmjs.org/:_authToken $NPM_TOKEN
npm run publish:all
```