Getting started with monolithic repo using Lerna

Monolithic repositories maintain all packages in one project. Big company like Facebook(React), Google(Angular), Meteor, NestJS, Babel, and etc.

Getting started with monolithic repo using Lerna
Getting started with lerna the monolithic repo - mobilelabs.in

Monolithic repositories maintain all packages in one project. Big company like Facebook(React), Google(Angular), Meteor, NestJS, Babel, and etc.

Most commonly used monolithic tool is lerna.

lerna/lerna
:dragon: A tool for managing JavaScript projects with multiple packages. - lerna/lerna

Lerna is based on the javascript projects, it has fixed and independent modes.

Lets get our hands dirty!

	npm install -g lerna

Create a folder and setup Lerna

	lerna init && npm install

This will generates following file by default

  • /packages
  • lerna.json(config for the lerna)
  • package.json(all our packages will go here)

Time for creating new package

	lerna create api
	lerna create salesforce

Publishing packages

	lerna publish

This will publish you packages in NPM registry, you can also mark this repo as private.

Summary

We have seen what is monolithic and how to use Lerna to achieve this pattern also we have gone through how to create packages in monolithic repos and publishing it.