File tree Expand file tree Collapse file tree 2 files changed +48
-1
lines changed Expand file tree Collapse file tree 2 files changed +48
-1
lines changed Original file line number Diff line number Diff line change 12
12
"dartanalyzer" : " cd dist/dart && pub install && cd ../.. && ts-node scripts/ci/dart_analyzer" ,
13
13
"demo-app" : " ng serve" ,
14
14
"test" : " karma start test/karma.conf.js" ,
15
- "tslint" : " tslint -c tslint.json 'src/**/*.ts'" ,
15
+ "tslint" : " tslint -c tslint.json 'src/**/*.ts'" ,
16
16
"typings" : " typings install --ambient" ,
17
17
"postinstall" : " npm run typings" ,
18
18
"e2e" : " protractor ./protractor.conf.js"
34
34
"zone.js" : " 0.5.15"
35
35
},
36
36
"devDependencies" : {
37
+ "add-stream" : " ^1.0.0" ,
37
38
"angular-cli" : " ^0.0.24" ,
38
39
"angular-cli-github-pages" : " ^0.2.0" ,
39
40
"broccoli-autoprefixer" : " ^4.1.0" ,
42
43
"broccoli-sass" : " ^0.7.0" ,
43
44
"broccoli-source" : " ^1.1.0" ,
44
45
"browserstacktunnel-wrapper" : " ^1.4.2" ,
46
+ "conventional-changelog" : " ^1.1.0" ,
45
47
"ember-cli-inject-live-reload" : " ^1.3.0" ,
46
48
"fs-extra" : " ^0.26.5" ,
47
49
"glob" : " ^6.0.4" ,
Original file line number Diff line number Diff line change
1
+ 'use strict' ;
2
+ /**
3
+ * Creates a conventional changelog from the current git repository / metadata.
4
+ */
5
+
6
+ var fs = require ( 'fs' ) ;
7
+ var addStream = require ( 'add-stream' ) ;
8
+ var cl = require ( 'conventional-changelog' ) ;
9
+ var inStream = fs . createReadStream ( 'CHANGELOG.md' ) ;
10
+
11
+ /**
12
+ * When the command line argument `--force` is provided, then the full changelog will created and overwritten.
13
+ * By default, it will only create the changelog from the latest tag to head and prepends it to the changelog.
14
+ */
15
+ var isForce = process . argv . indexOf ( '--force' ) !== - 1 ;
16
+
17
+ inStream . on ( 'error' , function ( err ) {
18
+ console . error ( 'An error occurred, while reading the previous changelog file.\n' +
19
+ 'If there is no previous changelog, then you should create an empty file or use the `--force` flag.\n' + err ) ;
20
+
21
+ process . exit ( 1 ) ;
22
+ } ) ;
23
+
24
+ var config = {
25
+ preset : 'angular' ,
26
+ releaseCount : isForce ? 0 : 1
27
+ } ;
28
+
29
+ var stream = cl ( config )
30
+ . on ( 'error' , function ( err ) {
31
+ console . error ( 'An error occurred while generating the changelog: ' + err ) ;
32
+ } )
33
+ . pipe ( ! isForce && addStream ( inStream ) || getOutputStream ( ) ) ;
34
+
35
+ // When we are pre-pending the new changelog, then we need to wait for the input stream to be ending,
36
+ // otherwise we can't write into the same destination.
37
+ if ( ! isForce ) {
38
+ inStream . on ( 'end' , function ( ) {
39
+ stream . pipe ( getOutputStream ( ) ) ;
40
+ } ) ;
41
+ }
42
+
43
+ function getOutputStream ( ) {
44
+ return fs . createWriteStream ( 'CHANGELOG.md' ) ;
45
+ }
You can’t perform that action at this time.
0 commit comments