Skip to content

Commit

Permalink
Separate the 2 modes and explain independent mode more [ci skip]
Browse files Browse the repository at this point in the history
  • Loading branch information
hzoo committed Jun 5, 2016
1 parent 7f6aa4b commit 469c199
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions README.md
Expand Up @@ -87,10 +87,21 @@ This will create a `lerna.json` configuration file as well as a `packages` folde

## How it works

Lerna projects operate on a single version line. The version is kept in the `lerna.json` file at the root of your project under the `version` key. When you run `lerna publish`, if a module has been updated since the last time a release was made, it will be updated to the new version you're releasing. This means that you only publish a new version of a package when you need to.
There are 2 modes when working with Lerna.

> **Note:** Depending on the project you might want to run this in
> `--independent` mode (where each package is separately versioned), also described in more detail [below](https://github.com/lerna/lerna/blob/master/README.md#--independent--i).
### Fixed/Locked mode (default)

Fixed mode Lerna projects operate on a single version line. The version is kept in the `lerna.json` file at the root of your project under the `version` key. When you run `lerna publish`, if a module has been updated since the last time a release was made, it will be updated to the new version you're releasing. This means that you only publish a new version of a package when you need to.

This is the mode that [Babel](https://github.com/babel/babel) is currently using. Use this if you want to automatically tie all package versions together. One issue with this approach is that a major change in any package will result in all packages having a new major version.

### Independent mode (`--independent`)

Independent mode Lerna projects allows maintainers to increment package versions independently of each other. Each time you publish, you will get a prompt for each package that has changed to specify if it's a patch, minor, major or custom change.

Independent mode allows you to more specifically update versions for each package and makes sense for a group of components. Combining this mode with something like [semantic-release](https://github.com/semantic-release/semantic-release) would make it less painful. (There is work on this already at [atlassian/lerna-semantic-release](https://github.com/atlassian/lerna-semantic-release).

> The `version` key in `lerna.json` is ignored in independent mode.
## Commands

Expand Down

0 comments on commit 469c199

Please sign in to comment.