Skip to content

Commit 8c209ac

Browse files
release v5.0.0
1 parent c9647aa commit 8c209ac

4 files changed

Lines changed: 205 additions & 39 deletions

File tree

CHANGELOG.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,33 @@
22
All notable changes will be documented in this file.
33
`version-bump-prompt` adheres to [Semantic Versioning](http://semver.org/).
44

5+
## [v5.0.0](https://github.com/JS-DevTools/version-bump-prompt/tree/v5.0.0) (2019-03-10)
6+
7+
### Breaking Changes
8+
9+
- Completely rewritten CLI with new argument syntax. See [the docs](https://jsdevtools.org/ez-spawn/) for details.
10+
11+
- Arguments like `--major` and `--minor` have been replaced with a positional argument. So `bump --major` becomes `bump major`.
12+
13+
- The `--prompt` argument is no longer needed. It's now the default. If you want, you can explicitly specify it as a positional argument (e.g. `bump prompt`)
14+
15+
- The `--lock` argument is no longer needed. The `package-lock.json` file is now updated by default.
16+
17+
- The `--grep` argument is no longer needed. Just provide a list of file names and/or globs for version-bump-prompt to update. So `bump --grep ReadMe.md` becomes `bump ReadMe.md`.
18+
19+
- Previously, version-bump-prompt _always_ updated `package.json`, `bower.json`, and `component.json` if they existed. Now it updates `package.json` and `package-lock.json` by default if they exist. You can override the default by explicitly specifying the files (e.g. `bump bower.json package.json ReadMe.md`)
20+
21+
### Other Changes
22+
23+
- Completely rewritten in TypeScript
24+
25+
- Version-Bump-Prompt now includes a Node.js API, so you can use it programmatically instead of just as a CLI
26+
27+
- You now have full control over the git commit message and tag name. The `--commit` and `--tag` arguments accept an optional string with `%s` placeholders, which will be replaced with the version number. This matches the behavior of the [npm version command](https://docs.npmjs.com/cli/version.html).
28+
29+
[Full Changelog](https://github.com/JS-DevTools/version-bump-prompt/compare/v4.2.2...v5.0.0)
30+
31+
532
## [v4.2.0](https://github.com/JS-DevTools/version-bump-prompt/tree/v4.2.0) (2018-09-30)
633

734
- Output of [npm version scripts](https://docs.npmjs.com/cli/version) is now shown. Thanks to [@didoo](https://github.com/didoo) for [the PR](https://github.com/JS-DevTools/version-bump-prompt/pull/27)!

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "version-bump-prompt",
3-
"version": "4.3.0",
3+
"version": "5.0.0",
44
"description": "Automatically (or with prompts) bump your version number, commit changes, tag, and push to Git",
55
"keywords": [
66
"version",

readme.md

Lines changed: 176 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -11,22 +11,26 @@
1111

1212
![Screenshot](https://jsdevtools.org/version-bump-prompt/img/screenshot.gif)
1313

14-
#### Automate your release process with a single command that can:
14+
### Automate your release process with a single command that can:
1515

16-
* Optionally prompt for the type of version bump (major, minor, revision, beta, etc.)
17-
* Bump the version number in all of your JSON manifests, including:
16+
- Prompt for the type of version bump
17+
18+
- Bump the version number **any** file, including:
1819
- `package.json`
19-
- `bower.json`
20-
- `component.json`
21-
* Replace version number strings in text files, including:
20+
- `package-lock.json`
2221
- config files
23-
- source code
24-
- README files
22+
- source code files
23+
- ReadMe files
2524
- license files
26-
* Run your `preversion`, `version`, and `postversion` scripts
27-
* Commit changes to GIT
28-
* Tag the commit with the version number
29-
* Push the commit to remote
25+
26+
- Run your `preversion`, `version`, and `postversion` scripts
27+
28+
- Commit changes to git
29+
30+
- Tag the commit with the version number
31+
32+
- Push the commit to remote
33+
3034

3135

3236
Installation
@@ -38,42 +42,176 @@ npm install -g version-bump-prompt
3842
```
3943

4044

45+
4146
Usage
4247
--------------------------
4348

4449
```
45-
Usage: bump [options]
50+
bump [release] [options] [files...]
51+
52+
Automatically (or with prompts) bump your version number, commit changes, tag, and push to Git
53+
54+
release:
55+
The release version or type. Can be one of the following:
56+
- A semver version number (ex: 1.23.456)
57+
- prompt: Prompt for the version number (this is the default)
58+
- major: Increase major version
59+
- minor: Increase minor version
60+
- patch: Increase patch version
61+
- premajor: Increase major version, pre-release
62+
- preminor: Increase preminor version, pre-release
63+
- prepatch: Increase prepatch version, pre-release
64+
- prerelease: Increase prerelease version
65+
66+
options:
67+
--preid <name> The identifier for prerelease versions.
68+
Defaults to "beta".
4669
47-
Options:
70+
-c, --commit [message] Commit changed files to Git.
71+
Defaults to "release vX.X.X".
4872
49-
-h, --help output usage information
50-
-V, --version output the version number
51-
--major Increase major version
52-
--minor Increase minor version
53-
--patch Increase patch version
54-
--premajor Increase major version, pre-release
55-
--preminor Increase preminor version, pre-release
56-
--prepatch Increase prepatch version, pre-release
57-
--prerelease Increase prerelease version
58-
--prompt Prompt for type of bump (patch, minor, major, premajor, prerelase, etc.)
59-
--preid <name> The identifier for prerelease versions (default is "beta")
60-
--commit [message] Commit changed files to Git (default message is "release vX.X.X")
61-
--no-verify Bypasses the pre-commit and commit-msg hooks
62-
--tag Tag the commit in Git
63-
--push Push the Git commit
64-
--all Commit/tag/push ALL pending files, not just the ones changed by bump
65-
--grep <filespec...> Files and/or globs to do a text-replace of the old version number with the new one
66-
--lock Update the package-lock.json file as well
73+
-t, --tag [tag] Tag the commit in Git.
74+
The Default tag is "vX.X.X"
6775
68-
Examples:
76+
-p, --push Push the Git commit.
6977
70-
$ bump --patch
71-
$ bump --major --tag
72-
$ bump --patch --tag --all --grep README.md LICENSE
73-
$ bump --prompt --tag --push --all
78+
-a, --all Commit/tag/push ALL pending files,
79+
not just the ones that were bumped.
80+
(same as "git commit -a")
81+
82+
--no-verify Bypass Git commit hooks
83+
(same as "git commit --no-verify")
84+
85+
-v, --version Show the version number
86+
87+
-q, --quiet Suppress unnecessary output
88+
89+
-h, --help Show usage information
90+
91+
files...
92+
One or more files and/or globs to bump (ex: README.md *.txt docs/**/*).
93+
Defaults to package.json and package-lock.json.
7494
```
7595

7696

97+
98+
Examples
99+
--------------------------
100+
101+
### Default Behavior (no arguments)
102+
103+
```
104+
bump
105+
```
106+
107+
When run without any arguments, the `bump` command will do the following:
108+
109+
- Prompt the user to select the bump type (major, minor, prerelease, etc.)
110+
- Update the version number in `package.json` and `package-lock.json`
111+
- Run any [npm version scripts](https://docs.npmjs.com/cli/version.html) (`preversion`, `version`, or `postversion`)
112+
- It will **NOT** commit, tag, or push to git.
113+
114+
115+
### Bump Without Prompting
116+
You can specify an explicit version number:
117+
118+
```
119+
bump 1.23.456
120+
bump 1.23.456-beta.1
121+
```
122+
123+
Or you can specify a release type:
124+
125+
```
126+
bump major
127+
bump patch
128+
bump prerelease
129+
```
130+
131+
For pre-releases, the default identifier is "beta". You can change it using the `--preid` argument:
132+
133+
```
134+
bump premajor --preid alpha
135+
```
136+
137+
All of the above commands do the following:
138+
139+
- Update the version number in `package.json` and `package-lock.json`
140+
- Run any [npm version scripts](https://docs.npmjs.com/cli/version.html) (`preversion`, `version`, or `postversion`)
141+
- It will **NOT** commit, tag, or push to git.
142+
143+
144+
145+
### Git Commit
146+
You can use the `--commit` argument by itself to prompt the user for the version number. If you don't specify a commit message, then it defaults to "**release vX.X.X**". If you _do_ specify a commit message, then the version number will be appended to it. Or you can insert `%s` placeholders in the message, and they'll be replaced with the version number instead.
147+
148+
```
149+
bump --commit
150+
bump --commit "This is release v"
151+
bump --commit "The v%s release"
152+
```
153+
154+
You can also specify a release type instead of prompting the user:
155+
156+
```
157+
bump major --commit
158+
bump minor --commit "This is release v"
159+
bump patch --commit "The v%s release"
160+
```
161+
162+
The above commands do the following:
163+
164+
- Update the version number in `package.json` and `package-lock.json`
165+
- Run any [npm version scripts](https://docs.npmjs.com/cli/version.html) (`preversion`, `version`, or `postversion`)
166+
- Commit the `package.json` and `package-lock.json` files to git
167+
- The commit will **NOT** be tagged
168+
- The commit will **NOT** be pushed to the remote
169+
170+
171+
### Git Tag
172+
The `--commit` argument does not tag the commit by default. You can use the `--tag` argument to do that. You can optionally specify a tag name, which can contain `%s` placeholders, just like the commit message.
173+
174+
You don't need to specify the `--commit` argument, since it's implied by `--tag`. Unless you want to customize the commit message.
175+
176+
```
177+
bump --tag
178+
bump major --tag "v%s tag"
179+
bump patch --commit "release v" --tag "v"
180+
```
181+
182+
The above commands do the following:
183+
184+
- Update the version number in `package.json` and `package-lock.json`
185+
- Run any [npm version scripts](https://docs.npmjs.com/cli/version.html) (`preversion`, `version`, or `postversion`)
186+
- Commit the `package.json` and `package-lock.json` files to git
187+
- Tag the commit
188+
- The commit will **NOT** be pushed to the remote
189+
190+
191+
### Git Push
192+
The `--push` argument pushes the git commit and tags.
193+
194+
```
195+
bump --commit --push
196+
bump major --tag --push
197+
bump patch --tag "v%s tag" --push
198+
bump prerelease --commit "release v" --tag "v" --push
199+
```
200+
201+
202+
### Specifying Files to Update
203+
All of the `bump` commands shown above operate on the `package.json` and `package-lock.json` files by default. You can specify a custom list of files and/or [glob patterns](https://www.npmjs.com/package/glob#glob-primer) to update instead.
204+
205+
> **Note:** If you specify your own file list, then the `package.json` and `package-lock.json` files will **not** be updated by default. You need to explicitly include them in your file list if you want them updated.
206+
207+
```
208+
bump README.md
209+
bump package.json package-lock.json README.md
210+
bump *.json *.md
211+
```
212+
213+
214+
77215
Version Scripts
78216
--------------------------
79217
`version-bump-prompt` will execute your `preversion`, `version`, and `postversion` scripts, just like [the `npm version` command](https://docs.npmjs.com/cli/version) does. If your `package.json` file contains any or all of these scripts, then they will be executed in the following order:
@@ -111,6 +249,7 @@ Version-Bump-Prompt is a fork of [Version-Bump](https://github.com/alexeyraspopo
111249
Both the original project and this fork are licensed under the [MIT License](http://en.wikipedia.org/wiki/MIT_License)
112250

113251

252+
114253
Big Thanks To
115254
--------------------------
116255
Thanks to these awesome companies for their support of Open Source developers ❤

0 commit comments

Comments
 (0)