It is similiar with lerna. But lerna is a little complicated.
Project structure can be below
mppm-repo/
package.json
mppm.config.js
packages/
package-1/
package.json
package-2/
package.json
Get started
npm install -D mppm
Initialize mppm config with mppm.config.js
in root folder.
eg:
module.exports = {
packages: ['packages/*'],
versionStep: 'patch',
publishRegistry: 'https://registry.npmjs.org/'
}
Above config arguments can be set:
-
packages
Default value is['packages/*']
-
versionStep
major
, if versionStep ismajor
, the major version will be changed, eg:1.1.1 => 2.0.0
minor
,1.1.1 => 1.2.0
patch
,1.1.1 => 1.1.2
premajor
,1.1.1 => 2.0.0-0
preminor
,1.1.1 => 1.2.0-0
prepatch
,1.1.1 => 1.1.2-0
prerelease
,1.1.1 => 1.1.2-0
-
versionPreid
It only works whenversionStep
is one ofprerelease | prepatch | preminor | premajor
. Eg, ifversionStep
isprelease
andversionPreid
isbeta
, version will be changed like1.1.1 => 1.1.2-beta.0
-
commitBranch
Specified branch to be committed -
commitMessage
Specified message to be committed -
publishRegistry
Your registry to publish, default ishttps://registry.npmjs.org/
npx mppm bootstrap
It will install dependencies and devDependencies for each package.
If there are dependencies between packages, they will be linked each other.
npx mppm run <command>
It will execute npm run <command>
for each package.
npx mppm changed
It will get all changed packages since last commit
npx mppm publish
Publish changed packages and packages which link changed packages.