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
+21-8Lines changed: 21 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -156,18 +156,16 @@ If you have your GPG key set up, add the `--sign` or `-s` flag to your `standard
156
156
157
157
`standard-version` supports lifecycle scripts. These allow you to execute your
158
158
own supplementary commands during the release. The following
159
-
hooks are available:
159
+
hooks are available and execute in the order documented:
160
160
161
-
*`prebump`: executed before the version bump is calculated. If the `prebump`
161
+
*`prebump`/`postbump`: executed before and after the version is bumped. If the `prebump`
162
162
script returns a version #, it will be used rather than
163
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.
164
+
*`prechangelog`/`postchangelog`: executes before and after the CHANGELOG is generated.
165
+
*`precommit`/`postcommit`: called before and after the commit step.
166
+
*`pretag`/`posttag`: called before and after the tagging step.
169
167
170
-
Simply add the following to your package.json, to enable lifecycle scripts:
168
+
Simply add the following to your package.json to configure lifecycle scripts:
171
169
172
170
```json
173
171
{
@@ -179,6 +177,21 @@ Simply add the following to your package.json, to enable lifecycle scripts:
179
177
}
180
178
```
181
179
180
+
### Skipping lifecycle steps
181
+
182
+
You can skip any of the lifecycle steps (`bump`, `changelog`, `commit`, `tag`),
183
+
by adding the following to your package.json:
184
+
185
+
```json
186
+
{
187
+
"standard-version": {
188
+
"skip": {
189
+
"changelog": true
190
+
}
191
+
}
192
+
}
193
+
```
194
+
182
195
### Committing generated artifacts in the release commit
183
196
184
197
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:
* extract the in-pre-release type in target version
133
-
*
134
-
* @param version
135
-
* @return {string}
136
-
*/
137
-
functiongetCurrentActiveType(version){
138
-
vartypelist=TypeList
139
-
for(vari=0;i<typelist.length;i++){
140
-
if(semver[typelist[i]](version)){
141
-
returntypelist[i]
142
-
}
143
-
}
144
-
}
145
-
146
-
/**
147
-
* calculate the priority of release type,
148
-
* major - 2, minor - 1, patch - 0
149
-
*
150
-
* @param type
151
-
* @return {number}
152
-
*/
153
-
functiongetTypePriority(type){
154
-
returnTypeList.indexOf(type)
155
-
}
156
-
157
-
functionbumpVersion(releaseAs,callback){
158
-
returnnewPromise((resolve,reject)=>{
159
-
if(releaseAs){
160
-
returnresolve({
161
-
releaseType: releaseAs
162
-
})
163
-
}else{
164
-
conventionalRecommendedBump({
165
-
preset: 'angular'
166
-
},function(err,release){
167
-
if(err)returnreject(err)
168
-
elsereturnresolve(release)
169
-
})
170
-
}
171
-
})
172
-
}
173
-
174
-
functionoutputChangelog(args,newVersion){
175
-
returnnewPromise((resolve,reject)=>{
176
-
createIfMissing(args)
177
-
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