-
-
Notifications
You must be signed in to change notification settings - Fork 17
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 #31 from davidchambers/integration
readme: document npm-scripts integration
- Loading branch information
Showing
1 changed file
with
17 additions
and
8 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 |
---|---|---|
|
@@ -12,7 +12,7 @@ Several things will happen if one elects to continue: | |
git add 'package.json' | ||
git commit --message 'Version 0.6.1' | ||
git tag --annotate 'v0.6.1' --message 'Version 0.6.1' | ||
git push origin 'refs/heads/master' 'refs/tags/v0.6.1' | ||
git push --atomic 'origin' 'refs/heads/master' 'refs/tags/v0.6.1' | ||
npm publish # Only for non-private packages. | ||
|
||
xyz accepts several optional arguments, described in the help text: | ||
|
@@ -22,12 +22,21 @@ xyz accepts several optional arguments, described in the help text: | |
### Integration | ||
|
||
Installing xyz globally is okay, but it's good practice to add it as a dev | ||
dependency and reference it like so: | ||
dependency. | ||
|
||
$ node_modules/.bin/xyz | ||
#### npm | ||
|
||
If one is using Make or a similar tool, it's helpful to define aliases for | ||
the various publish commands: | ||
```json | ||
"scripts": { | ||
"release": "xyz --repo [email protected]:owner/repo.git --increment", | ||
} | ||
``` | ||
|
||
```console | ||
$ npm run release minor | ||
``` | ||
|
||
#### Make | ||
|
||
```make | ||
XYZ = node_modules/.bin/xyz --repo [email protected]:owner/repo.git | ||
|
@@ -37,6 +46,6 @@ release-major release-minor release-patch: | |
@$(XYZ) --increment $(@:release-%=%) | ||
``` | ||
|
||
This makes it simple to publish a release of the desired kind: | ||
|
||
$ make release-patch | ||
```console | ||
$ make release-minor | ||
``` |