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
Copy file name to clipboardExpand all lines: README.md
+27
Original file line number
Diff line number
Diff line change
@@ -152,6 +152,33 @@ standard-version --no-verify
152
152
153
153
If you have your GPG key set up, add the `--sign` or `-s` flag to your `standard-version` command.
154
154
155
+
### Lifecycle scripts
156
+
157
+
`standard-version` supports lifecycle scripts. These allow you to execute your
158
+
own supplementary commands during the release. The following
159
+
hooks are available:
160
+
161
+
*`prebump`: executed before the version bump is calculated. If the `prebump`
162
+
script returns a version #, it will be used rather than
163
+
the version calculated by `standard-version`.
164
+
*`postbump`: executed after the version has been bumped and written to
165
+
package.json. The flag `--new-version` is populated with the version that is
166
+
being released.
167
+
*`precommit`: called after CHANGELOG.md and package.json have been updated,
168
+
but before changes have been committed to git.
169
+
170
+
Simply add the following to your package.json, to enable lifecycle scripts:
171
+
172
+
```json
173
+
{
174
+
"standard-version": {
175
+
"scripts": {
176
+
"prebump": "echo 9.9.9"
177
+
}
178
+
}
179
+
}
180
+
```
181
+
155
182
### Committing generated artifacts in the release commit
156
183
157
184
If you want to commit generated artifacts in the release commit (e.g. [#96](https://github.com/conventional-changelog/standard-version/issues/96)), you can use the `--commit-all` or `-a` flag. You will need to stage the artifacts you want to commit, so your `release` command could look like this:
@@ -145,62 +155,52 @@ function getTypePriority (type) {
145
155
}
146
156
147
157
functionbumpVersion(releaseAs,callback){
148
-
if(releaseAs){
149
-
callback(null,{
150
-
releaseType: releaseAs
151
-
})
152
-
}else{
153
-
conventionalRecommendedBump({
154
-
preset: 'angular'
155
-
},function(err,release){
156
-
callback(err,release)
157
-
})
158
-
}
159
-
}
160
-
161
-
functionoutputChangelog(argv,cb){
162
-
createIfMissing(argv)
163
-
varheader='# Change Log\n\nAll notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.\n'
varheader='# Change Log\n\nAll notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.\n'
0 commit comments