This is a prototype for testing out Lerna.js releases. It can be fully tested, by using a local NPM Registry (Docker-based Verdaccio).
You need to have Node and Docker installed.
- install deps
npm install
- run local test registry
npm run start:test-registry
- create a test user for publishing
npm adduser --registry http://localhost:4873
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:
- create a topic branch
- actually implement a feature
- (optionally) release a canary version for "others"
- merge-request it into master
- 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:
- all changed components, i.e. all components that have changed since the last release must be bumped and then published
- components that do depend on other components (in the repo) need to be bumped and published as well
In this example we will modify a component, that is not depended on by other components. Its change should only impact itself.
- create a topic branch:
npm run create-topic-branch topic/modify-b
- implement it (change it):
npm run modify:component-b
- merge-request and approve it:
npm run finish-topic-branch topic/modify-b && npm run delete-topic-branch topic/modify-b
- 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)
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.
- create a topic branch:
npm run create-topic-branch topic/modify-a
- implement it (change it):
npm run modify:component-a
- merge-request and approve it:
npm run finish-topic-branch topic/modify-a && npm run delete-topic-branch topic/modify-a
- 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).