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
- 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).
- 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)!
One or more files and/or globs to bump (ex: README.md *.txt docs/**/*).
93
+
Defaults to package.json and package-lock.json.
74
94
```
75
95
76
96
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.
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
+
77
215
Version Scripts
78
216
--------------------------
79
217
`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
111
249
Both the original project and this fork are licensed under the [MIT License](http://en.wikipedia.org/wiki/MIT_License)
112
250
113
251
252
+
114
253
Big Thanks To
115
254
--------------------------
116
255
Thanks to these awesome companies for their support of Open Source developers ❤
0 commit comments