| 
									
										
										
										
											2019-07-25 23:50:39 -07:00
										 |  |  | /** | 
					
						
							|  |  |  |  * @license | 
					
						
							| 
									
										
										
										
											2020-05-19 12:08:49 -07:00
										 |  |  |  * Copyright Google LLC All Rights Reserved. | 
					
						
							| 
									
										
										
										
											2019-07-25 23:50:39 -07:00
										 |  |  |  * | 
					
						
							|  |  |  |  * Use of this source code is governed by an MIT-style license that can be | 
					
						
							|  |  |  |  * found in the LICENSE file at https://angular.io/license
 | 
					
						
							|  |  |  |  */ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | module.exports = (gulp) => () => { | 
					
						
							| 
									
										
										
										
											2019-07-30 15:21:52 -06:00
										 |  |  |   const tag = process.env.TAG; | 
					
						
							|  |  |  |   const ptag = process.env.PREVIOUS_ZONE_TAG; | 
					
						
							| 
									
										
										
										
											2019-07-25 23:50:39 -07:00
										 |  |  |   const conventionalChangelog = require('gulp-conventional-changelog'); | 
					
						
							| 
									
										
										
										
											2019-08-01 13:41:37 -06:00
										 |  |  |   // the tag of zone.js will start with `zone.js-`, such as `zone.js-0.10.0`
 | 
					
						
							|  |  |  |   // we will remove the first 8 (zone.js-) chars to get the real version.
 | 
					
						
							|  |  |  |   const version = tag.replace(/^zone\.js-/, ''); | 
					
						
							| 
									
										
										
										
											2019-07-25 23:50:39 -07:00
										 |  |  |   return gulp.src('packages/zone.js/CHANGELOG.md') | 
					
						
							| 
									
										
										
										
											2019-08-01 13:41:37 -06:00
										 |  |  |       .pipe(conventionalChangelog( | 
					
						
							|  |  |  |           { | 
					
						
							|  |  |  |             preset: 'angular', | 
					
						
							|  |  |  |           }, | 
					
						
							|  |  |  |           {linkCompare: true, previousTag: ptag, currentTag: tag, version: version}, { | 
					
						
							|  |  |  |             // Ignore commits that have a different scope than `zone.js`.
 | 
					
						
							|  |  |  |             extendedRegexp: true, | 
					
						
							|  |  |  |             grep: '^[^(]+\\(zone\\.js\\)', | 
					
						
							|  |  |  |             from: ptag, | 
					
						
							| 
									
										
										
										
											2019-08-13 16:15:55 -07:00
										 |  |  |             to: 'HEAD', | 
					
						
							| 
									
										
										
										
											2019-08-01 13:41:37 -06:00
										 |  |  |           })) | 
					
						
							| 
									
										
										
										
											2019-07-25 23:50:39 -07:00
										 |  |  |       .pipe(gulp.dest('./packages/zone.js/')); | 
					
						
							|  |  |  | }; |