Skip to content
/ monoo Public

Monorepo development & continuous integration tooling.

License

Notifications You must be signed in to change notification settings

ulivz/monoo

Repository files navigation

monoo

npm version

Monorepo development & continuous integration tooling.

Motivation

When we released monorepo, a headache problem was that release flow failed but some packages had been published to NPM. At this time, you may discard current release, or publish manually one by one, but it's quite troublesome in a monorepo with a large number of packages.

mono introduced a post patch process, it helps you to continue current release with visible release status.

Features

  • Restartable release flow, powered by a post patch release process with visible release status.
  • Quickly launch on-demand development build for monorepo.
  • Generated changelog with author.

Table of Contents

Install

npm i -g monoo # globally
npm i -D monoo # as devDependencies

Usage

A complete release workflow

If you had a monorepo as:

.
├── lerna.json
├── package.json
└── packages
    ├── foo
    ├── bar
    ├── baz
    └── qux

If current version is 2.1.1, after a period of time, I decide to release a patch version with latest version, so I execute:

monoo release

You'll receive a prompt log to choose a release version, and you selected 2.1.2 to continue.

If release process got failed, you'll see a visible release status under patch stage:

Just select Y to finish release for all unpublished packages.

Execute build after bump version

You may execute monoo release after build packages, but if your build process generated assets that contains the version of each, you'll get a wrong version at final NPM assets, you can execute build after version is bumped:

monoo release --build --ignore-scripts 
# Note that --ignore-scripts is required if you set `prepublishOnly` for sub packages.

Independent patch process

Patch process has been integrated into release flow, you can also use it separately:

monoo patch --tag=latest       # launch patch process with latest tag.

Generate Changelog

Changelog process has been integrated into release flow, You can also use it separately:

monoo changelog # generate changelog

The equivalent command under release flow is:

monoo changelog --beautify --commit --gitPush --attachAuthor --authorNameType name

Attach commit author

monoo changelog --attachAuthor

Commits under generated changelog will be attached with commit author:

 ### Bug Fixes
 
-* **scope:** xx ([d1cfea5](...))
+* **scope:** xx ([d1cfea5](...)) [@ULIVZ](https://github.com/ulivz)

Create commit

monoo changelog --commit

monoo will create a commit for generated changelog.

Auto push

monoo changelog --gitPush

monoo will create a push action to remote repository.

On-demand development build

using lerna run dev will launch all dev process for all packages, using monoo dev will launch a on-demand development build for monorepo.

monoo dev

Commands

monoo release

Using monoo release to replace lerna publish:

monoo release                  # standard release flow
monoo release --no-changelog   # do not generate changelog
monoo release --ignore-scripts # ignore npm scripts under release process.
monoo release --dry-run        # preview execution

monoo patch

monoo patch --tag laest      # standard release flow
monoo patch --tag next       # launch patch process with next tag.
monoo patch --tag latest --ignore-scripts    # Ignore npm scripts under patch process.

monoo changelog

monoo changelog
monoo changelog --beautify              # beautify changelog
monoo changelog --commit                # create a commit
monoo changelog --gitPush               # push to remote repository
monoo changelog --attachAuthor          # add author to generated changelog
monoo changelog --authorNameType email  # set display author to author's email
monoo changelog --authorNameType name   # set display author to author's name

Recommended composable flags:

monoo changelog --beautify --commit --gitPush --attachAuthor --authorNameType name

monoo dev

monoo dev       # launch a on-demand development build for monorepo.

Projects Using MONOO

Projects that use MONOO:

  • VuePress: 📝 Minimalistic Vue-powered static site generator.
  • Many ByteDance projects.
  • Feel free to add yours here...

FAQ

I don't use lerna, can I use it?

monoo leverage lerna under the hood, but you can still use it in other monorepo tool chains, such as rush.

Author

MIT © ULIVZ

About

Monorepo development & continuous integration tooling.

Resources

License

Stars

Watchers

Forks

Packages

No packages published