ChristianUlbrich / lerna-release-prototype-in-action

This is a very basic Lerna.js release prototype!

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Lerna-Release-Prototype

Intro

This is a prototype for testing out Lerna.js releases. It can be fully tested, by using a local NPM Registry (Docker-based Verdaccio).

Setup

You need to have Node and Docker installed.

  1. install deps npm install
  2. run local test registry npm run start:test-registry
  3. create a test user for publishing npm adduser --registry http://localhost:4873

Release Flow 101

This prototype is for modelling the usage of a monorepo with the Release Flow1 branching model. It basically boils down, to only using very short-lived topic branches that are directly merged into master. The master branch is used for doing releases - in terms of NPM it will mean for publishing packages.

For implementing a feature you'd have to do the following steps:

  1. create a topic branch
  2. actually implement a feature
  3. (optionally) release a canary version for "others"
  4. merge-request it into master
  5. upon approval it will get merged into master and your topic branch is deleted

Releases are always carried out from the master branch and involves in terms of a monorepo the following steps:

  1. all changed components, i.e. all components that have changed since the last release must be bumped and then published
  2. components that do depend on other components (in the repo) need to be bumped and published as well

Example: Modify a component that is not consumed by other internal components and release it

In this example we will modify a component, that is not depended on by other components. Its change should only impact itself.

  1. create a topic branch: npm run create-topic-branch topic/modify-b
  2. implement it (change it): npm run modify:component-b
  3. merge-request and approve it: npm run finish-topic-branch topic/modify-b && npm run delete-topic-branch topic/modify-b
  4. release it: npm run publish-all

Now you'd have to enter the version bump (major, minor, patch) and it will get released (i.e. published)

Example: Modify a component that is consumed by other internal components

In this example we will modify a component, that is depended on by other components. Its change should trigger new releases for other components as well.

  1. create a topic branch: npm run create-topic-branch topic/modify-a
  2. implement it (change it): npm run modify:component-a
  3. merge-request and approve it: npm run finish-topic-branch topic/modify-a && npm run delete-topic-branch topic/modify-a
  4. release it: npm run publish-all

Now you'd have to enter the version bump (major, minor, patch) for both components; first for the modified component and second for the component, that is depending on it. Both will get released (i.e. published).

About

This is a very basic Lerna.js release prototype!


Languages

Language:TypeScript 78.1%Language:HTML 13.4%Language:JavaScript 8.5%Language:CSS 0.0%