diff --git a/README.md b/README.md index 18323c175..cf17b76c2 100644 --- a/README.md +++ b/README.md @@ -96,6 +96,40 @@ As long as your git commit messages are conventional and accurate, you no longer After you cut a release, you can push the new git tag and `npm publish` (or `npm publish --tag next`) when you're ready. +### Release as a pre-release + +Use `--prerelease`, you can generate a pre-release. + +Suppose the last version of your code is `1.0.0`, and your code to be committed has patched changes. Run +```bash +# npm run script +npm run release -- --prerelease +``` +you will get version `1.0.1-0`. + +If you want to name the pre-release, you specify the name via `--prerelease `. + +For example, the wanted name is `alpha` +. Use the example above: +```bash +# npm run script +npm run release -- --prerelease alpha +``` +you will get version `1.0.1-alpha.0` + +### Release as a target type imperatively like `npm version` + +You can use `--release-as` to generate a `major`, `minor` or `patch` release imperatively. + +Suppose the last version of your code is `1.0.0`, and your code to be committed has patched changes. Run +```bash +# npm run script +npm run release -- --release-as minor +``` +you will get version `1.1.0` rather than the smartly generated version `1.0.1`. + +**NOTE:** you can combine `--release-as` and `--prerelease` to generate a release. That's useful when publishing experimental feature(s). + ### Prevent Git Hooks If you use git hooks, like pre-commit, to test your code before committing, you can prevent hooks from being verified during the commit step by passing the `--no-verify` option: