Skip to content

Commit

Permalink
Merge pull request #23 from Updater/npm-peer-dep
Browse files Browse the repository at this point in the history
Npm peer dep
  • Loading branch information
pmowrer authored Jan 15, 2018
2 parents c562f5c + 5d68ef8 commit 75e3026
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
15 changes: 12 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,14 @@ A push may release multiple package versions. In order to avoid version collisio

## Install
```bash
npm install -D semantic-release semantic-release-monorepo
npm install -D semantic-release semantic-release-monorepo @semantic-release/[email protected]
```

### Peer dependency on @semantic-release/npm
The `@semantic-release/npm` package is a `semantic-release` plugin that provides functionality for releasing on `npm`. While it's technically optional, it covers a very likely use case and is applied by default by `semantic-release` (minor version dependency, `^2.0.0`).

Unfortunately, `@semantic-release/npm` version `2.6.1` and above is incompatible with `semantic-release-monorepo` ([discussion](https://github.com/semantic-release/npm/issues/36)). Until a solution is found, `semantic-release-monorepo` only supports the version range `2 - 2.6.0`.

## Usage
Run `semantic-release-monorepo` for the package in the current working directory:
```bash
Expand All @@ -28,10 +33,14 @@ npx semantic-release -e -semantic-release-monorepo
It helps to think about `semantic-releaase-monorepo` as a variation on `semantic-release`'s default behavior, using the latter's plugin system to adapt it to work with a monorepo.

### With Lerna
Run `semantic-release-monorepo` for each package in a monorepo managed by [`lerna`](https://github.com/lerna/lerna):
The monorepo management tool [`lerna`](https://github.com/lerna/lerna) can be used to run `semantic-release-monorepo` across all packages in a monorepo:

```bash
lerna exec --concurrency 1 -- npx semantic-release -e -semantic-release-monorepo
lerna exec --concurrency 1 -- npx --no-install semantic-release -e -semantic-release-monorepo
```
Note that this requires installing `semantic-release` and `semantic-release-monorepo` for each package.

Alternatively, thanks to how [`npx's package resolution works`](https://github.com/zkat/npx#description), if the repository root is in `$PATH` (typically true on CI), `semantic-release` and `semantic-release-monorepo` can be installed in the repo root instead of for each package, likely saving both time and disk space.

## Configuration
The set of plugins in this package wrap other `semantic-release` plugins to modify their behavior. By default, the same plugin configuration as `semantic-release` is used, but any plugin configuration should be compatible.
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
},
"license": "MIT",
"peerDependencies": {
"@semantic-release/npm": "2 - 2.6.0",
"semantic-release": ">=11.1.0"
},
"dependencies": {
Expand Down

0 comments on commit 75e3026

Please sign in to comment.