You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jun 3, 2023. It is now read-only.
Copy file name to clipboardExpand all lines: README.md
+45-34Lines changed: 45 additions & 34 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -28,7 +28,7 @@
28
28
29
29
## About
30
30
31
-
`release-workspaces` brings the power of tools like Lerna and Release It! into one package, built to work with [npm workspaces](https://docs.npmjs.com/cli/v7/using-npm/workspaces). Using this utility, you can do the following:
31
+
`release-workspaces` brings the power of Release It! to monorepos. All built with [npm workspaces](https://docs.npmjs.com/cli/v7/using-npm/workspaces) in mind. Using this utility, you can do the following:
One of the key benefits of npm workspaces is running commands across packages, and managing inter-package dependencies. However, like non-workspace projects, versioning and publishing is more or less a very manual process.
43
+
44
+
It's therefore _not_ in the perview of this package to interact with behavior beyond versioning and publishing.
45
+
40
46
## Assumptions
41
47
42
48
This tool assumes a few things about your workflow:
43
49
44
-
- You're using npm workspaces (of course) (npm 7.x)
50
+
- You're using npm workspaces (npm 7.x)
45
51
- All your packages will use the same version for each release
46
52
47
53
## Usage
48
54
49
55
`release-workspaces` is used primarily as a command line integration tool combined with an optional configuration file.
50
56
51
-
The basic requirement is to have a `version` field defined in your root `package.json` (you can alternatively add [`metadata.version`](#metadata) to your config file). This will be the version of your packages, and is automatically updated for you after a release succeeds, but before the git step.
57
+
The basic requirement is to have a `version` field defined in your root `package.json` (you can alternatively add [`metadata.version`](#metadata) to your config file). This will be the version of your packages, and is automatically updated for you after a release succeeds.
52
58
53
59
Using the tool can be as simple as this:
54
60
55
61
```sh
56
62
$ release-workspaces --increment major
63
+
# or
64
+
$ release-workspaces -i major
57
65
```
58
66
59
67
With only a `version` field in your root `package.json`, mind you!
60
68
61
69
Here's a more complex example of incrementing packages from prerelease, to release candidate, to minor version.
|`--increment`, `-i`| string | The release increment. E.g. `minor`, `prepatch`, `prerelease`, etc. |
160
+
|`--increment-to`, `-s`| string | A specific version to publish. E.g., `3.0.0`, `3.0.0-rc.2`, etc. |
161
+
|`--preid`, `-p`| string | Sets the prerelease id. E.g. `alpha`, `rc`, etc. |
162
+
|`--npm-tag`, `-n`| string | If given, sets the npm publish tag. Otherwise uses the `preid`. E.g. `next`. |
163
+
|`--dry-run`, `-d`| boolean | Prints normal output but doesn't execute. |
164
+
|`--verbose`, `-b`| boolean | Prints all commands and mutating script calls (can be used with `--dry-run`/`-d`). |
154
165
155
166
Note that if `--npm-tag` isn't given, then the tool will fall back to the value given for `--preid`, else it will use `latest`.
156
167
@@ -160,29 +171,29 @@ Similarly, if you run a git-only release (no version, no publish), the tool will
160
171
161
172
Using config options via CLI will override your config. Useful for one-off releases and otherwise augmenting a base configuration for release types (alpha release, release candidate, no-increment publish, etc).
162
173
163
-
You can use any of the existing config options as CLI flags by using the formula `--<key>.<property> [value]`. E.g., change the default or user-configured commit message: `--git.commitMessage "chore: release ${version}"` or disable all git checks with `--git.skipChecks`.
174
+
You can use any of the existing config options as CLI flags by using the formula `--<key>.<property> [value]`. E.g., change the default or user-configured commit message: `--git.commitMessage "chore: release \${version}"` or disable all git checks with `--git.skipChecks`.
164
175
165
176
Similarly, you can negate any boolean option by prepending `--no-` to it. E.g., `--no-git.requireCleanDir`.
166
177
167
178
## Cheatsheet
168
179
169
180
Here are a few handy examples of how to achieve certain release results with CLI flags. Replace `minor` with your intended release increment.
0 commit comments