-
Notifications
You must be signed in to change notification settings - Fork 80
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #23 from Updater/npm-peer-dep
Npm peer dep
- Loading branch information
Showing
2 changed files
with
13 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
|
@@ -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. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters