Plugin for semantic-release to update version of workspace dependency.
Step | Description |
---|---|
verifyConditions |
Verify configuration |
prepare |
Update version of workspace dependency |
npm i -D semantic-release-workspace-dependency
The plugin can be configured in the semantic-release configuration file:
Add semantic-release-workspace-dependency
after @semantic-release/npm
and @semantic-release/git
plugins.
Plugin is supposed to be used in repository with multiple packages (monorepository strategy)
with semantic-release-commit-filter
.
Let's say that we have workspace:
- package
foo
- package
bar
depends onfoo
Package bar
has depenency defined in package as foo:*
.
Your must run build
and semantic-release
for each package using your monorepo tool (nx, wireit, etc.)
which can detect the correct order of execution.
When package bar
is going to be published on prepare
step it replace *
by latest verion of foo
package.
Version will be taken for git tags. *
can be any valid semver range, e.g. 1.X
Variable | Description |
---|---|
prefix |
Version prefix, can be ^ (default), ~ or '' |
{
"extends": ["semantic-release-commit-filter"],
"plugins": [
"@semantic-release/npm",
"@semantic-release/git",
["semantic-release-workspace-dependency", { "prefix": "^" }]
]
}
MIT License (c) 2022