Sodaru Mono repo Utility
Mono repos helps to build the related packages in single git repos
lerna
is the opensource tool used to maintain npm mono-repos. lerna is not maintained actively and has not suppport for peer dependencies
This tool contains the subset of features from lerna
and some extra features
npm i npm-mono-repo
mono-repo -h
mono-repo <command> [-p|--packages package1 package2 package3 ...] [-v|--verbose]
The command
applies to selected packages only.
If no packages is provided, all packages are considered
Prints verbose log to std out
mono-repo install [--save | --save-dev | --save-peer] [<package-filters>] [-v] [-d|--dependencies [pkg1 pkg2 ...]]
install npm packages to packages in the mono-repo
-
[-d|--dependencies [pkg1 pkg2 ...]]
( Optional ) Name of the packages tobe installed- if no packages provided this is similar to
npm i
- if package name is one if the package in mono-repo , then it is
symlink
ed - if
package.json
contains the a package from mono-repo, it is alwayssymlink
ed
- if no packages provided this is similar to
-
[--save | --save-dev | --save-peer]
( Optional ) Save the packages as dependencies or devDependencies or peerDependencies- no support for
optional
orbundled
dependencies
- no support for
mono-repo clean [<package-filters>] [-v]
delete node_modules and package-lock.json from every (or selected) package
mono-repo create [-v] <packageDirName>
creates a new package at packagesDir/packageDirName
packageDirName
( Required ) Name of the directory to be created for the package
mono-repo run [<package-filters>] [-v] <npm-script> [<npm-script-args>]
Runs the npm script in every (or selected) package (In the 'dependency first' order)
IMP NOTE: Skips if package does not have
script
to run
-
npm-script
( Required ) Name of the script to be run -
[<npm-script-args>]
( Optional ) list of args to be passed tonpm run
command
mono-repo version [<package-filters>] [-v]
Applies root package version to all (or selected) child packages, and updates the symlinked dependency's version
To be used in version
script of the root package to pipeline the version change from root to child packages.
IMP NOTE:
- Lifecycle scipts
preversion
,version
,postversion
are not run- The updated files are added to git stage, if git is enabled for the root package
mono-repo publish [-v]
Runs npm publish
on all child packages (In the 'dependency first' order) whose version matches with the root package.
- skips
private
packages
mono-repo init [-v]
initializes mono repo , by adding required scripts to root package
This project is a part of the Open Source Initiative from Sodaru Technologies
Write an email to [email protected] for queries on this project