Skip to content

Commit

Permalink
docs: add guidance for the new features
Browse files Browse the repository at this point in the history
  • Loading branch information
e-cloud committed Nov 22, 2016
1 parent a1840dc commit d784d46
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 <name>`.

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:
Expand Down

0 comments on commit d784d46

Please sign in to comment.