@uirouter/publish-scripts 2.5.5 → 2.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/release.js CHANGED
@@ -1,164 +1,164 @@
1
- #!/usr/bin/env node
2
-
3
- require('./util').packageDir();
4
- require('shelljs/global');
5
- const open = require('open');
6
-
7
- const readlineSync = require('readline-sync');
8
- const shelljs = require('shelljs');
9
- const fs = require('fs');
10
- const path = require('path');
11
- const semver = require('semver');
12
- const packageJson = JSON.parse(fs.readFileSync('package.json'));
13
- const modifiedFiles = [];
14
-
15
- const yargs = require('yargs')
16
- .option('dryrun', {
17
- alias: ['dry-run', 'd'],
18
- description: 'Dry run: Ignores dirty working copy and does not commit or publish anything.',
19
- boolean: true,
20
- })
21
- .option('deps', {
22
- description: 'Deps to include in changelog',
23
- array: true,
24
- });
25
-
26
- const util = require('./util');
27
- const _exec = util._exec;
28
-
29
- if (yargs.argv.dryrun) {
30
- console.log('Dry run mode...')
31
- } else {
32
- util.ensureCleanMaster('master');
33
- }
34
-
35
-
36
- // Bump version
37
- const currentVersion = JSON.parse(fs.readFileSync('./package.json')).version;
38
- const versionBumps = ['patch', 'minor', 'major', 'none'];
39
-
40
- const versionBump = versionBumps[readlineSync.keyInSelect(versionBumps, `Current version: ${currentVersion} ; bump version?`)];
41
- if (!versionBump) {
42
- process.exit(1);
43
- }
44
-
45
- let version = currentVersion;
46
- if (versionBump !== 'none') {
47
- version = semver.inc(currentVersion, versionBump);
48
-
49
- console.log(`Bumping version: ${version}`);
50
-
51
- packageJson.version = version;
52
- fs.writeFileSync('package.json', JSON.stringify(packageJson, null, 2) + "\n");
53
- modifiedFiles.push('package.json');
54
-
55
- if (yargs.argv.bower) {
56
- const bowerJson = fs.readFileSync('bower.json');
57
- bowerJson.version = version;
58
- fs.writeFileSync('bower.json', JSON.stringify(bowerJson, null, 2) + "\n");
59
- modifiedFiles.push('bower.json');
60
- }
61
- }
62
-
63
-
64
- // Generate changelog
65
- let changelog;
66
- if (readlineSync.keyInYN('\n\nUpdate CHANGELOG?')) {
67
- const depsArg = yargs.argv.deps ? `--deps ${yargs.argv.deps.join(' ')}` : '';
68
- const show_changelog = path.resolve(__dirname, 'show_changelog.js');
69
-
70
- changelog = _exec(`${show_changelog} ${depsArg}`, true).stdout;
71
-
72
- console.log('CHANGELOG:\n\n');
73
- console.log(changelog);
74
-
75
- const tempChangelogFile = `CHANGELOG.md.${version}`;
76
- fs.writeFileSync(tempChangelogFile, changelog);
77
-
78
- console.log(`Wrote changelog to temp file: ${tempChangelogFile}`);
79
- if (!readlineSync.keyInYN('Does the CHANGELOG look OK?')) {
80
- process.exit(1);
81
- }
82
-
83
- let existingChangelog = fs.readFileSync('CHANGELOG.md');
84
- changelog = fs.readFileSync(tempChangelogFile);
85
- fs.writeFileSync('CHANGELOG.md', changelog + '\n' + existingChangelog);
86
- fs.unlinkSync(tempChangelogFile);
87
- modifiedFiles.push('CHANGELOG.md');
88
- }
89
-
90
-
91
- // Run tests
92
- if (readlineSync.keyInYN('Run tests?')) {
93
- _exec('npm test')
94
- }
95
-
96
-
97
- // Commit and push changes
98
- if (!readlineSync.keyInYN('Ready to publish?')) {
99
- console.log(`\n\nRun this command to undo changes:\n\ngit checkout ${modifiedFiles.join(' ')}\n\n`);
100
- process.exit(1);
101
- }
102
-
103
- if (!yargs.argv.dryrun) {
104
- _exec(`git commit -m ${version} ${modifiedFiles.join(' ')}`);
105
- _exec(`git add ${modifiedFiles.join(' ')}`); // in case prettier reformatted these files
106
- }
107
-
108
- if (!yargs.argv.dryrun) {
109
- util.ensureCleanMaster('master');
110
- }
111
-
112
-
113
- // Publish to NPM and push to github
114
- if (!yargs.argv.dryrun) {
115
- const distDir = packageJson.distDir || '.';
116
- if (distDir !== '.' && packageJson.scripts && packageJson.scripts.build) {
117
- _exec('npm run build')
118
- }
119
- shelljs.pushd(distDir);
120
- _exec(`npm publish`);
121
- shelljs.popd();
122
- _exec(`git tag ${version}`);
123
- _exec(`git push origin master`);
124
- _exec(`git push origin ${version}`);
125
- }
126
-
127
-
128
- // Help with manual steps
129
- let githuburl = packageJson.repository && packageJson.repository.url;
130
- githuburl = githuburl && githuburl.replace(/^git\+/, '').replace(/\.git$/, '');
131
-
132
- if (githuburl) {
133
- if (changelog) {
134
- const haspbcopy = shelljs.exec(`which pbcopy`, true).code === 0;
135
- console.log(`\n\n1) Update the GitHub release with the release notes/CHANGELOG`);
136
- console.log(`\n (Make sure you see "\u2714 Existing tag")`);
137
-
138
- if (haspbcopy) {
139
- fs.writeFileSync('CHANGELOG.tmp', changelog);
140
- _exec('pbcopy < CHANGELOG.tmp', true);
141
- fs.unlinkSync('CHANGELOG.tmp');
142
- console.log(`(The CHANGELOG has been copied to your clipboard)`);
143
- } else {
144
- console.log('CHANGELOG:\n\n');
145
- console.log(changelog);
146
- }
147
- console.log(`\n${githuburl}/releases/edit/${version}`);
148
- open(`${githuburl}/releases/edit/${version}`);
149
- }
150
-
151
- console.log(`\n\n2) Check for milestones`);
152
- console.log(`\n${githuburl}/milestones`);
153
-
154
- console.log(`\n\n\n`);
155
- } else {
156
- console.log("Could not determine github URL from package.json")
157
- }
158
-
159
- // Generate docs
160
- util.packageDir();
161
- if (fs.existsSync('typedoc.json') && readlineSync.keyInYN('Generate docs?')) {
162
- _exec('generate_docs');
163
- _exec('publish_docs');
164
- }
1
+ #!/usr/bin/env node
2
+
3
+ require('./util').packageDir();
4
+ require('shelljs/global');
5
+ const open = require('open');
6
+
7
+ const readlineSync = require('readline-sync');
8
+ const shelljs = require('shelljs');
9
+ const fs = require('fs');
10
+ const path = require('path');
11
+ const semver = require('semver');
12
+ const packageJson = JSON.parse(fs.readFileSync('package.json'));
13
+ const modifiedFiles = [];
14
+
15
+ const yargs = require('yargs')
16
+ .option('dryrun', {
17
+ alias: ['dry-run', 'd'],
18
+ description: 'Dry run: Ignores dirty working copy and does not commit or publish anything.',
19
+ boolean: true,
20
+ })
21
+ .option('deps', {
22
+ description: 'Deps to include in changelog',
23
+ array: true,
24
+ });
25
+
26
+ const util = require('./util');
27
+ const _exec = util._exec;
28
+
29
+ if (yargs.argv.dryrun) {
30
+ console.log('Dry run mode...')
31
+ } else {
32
+ util.ensureCleanMaster('master');
33
+ }
34
+
35
+
36
+ // Bump version
37
+ const currentVersion = JSON.parse(fs.readFileSync('./package.json')).version;
38
+ const versionBumps = ['patch', 'minor', 'major', 'none'];
39
+
40
+ const versionBump = versionBumps[readlineSync.keyInSelect(versionBumps, `Current version: ${currentVersion} ; bump version?`)];
41
+ if (!versionBump) {
42
+ process.exit(1);
43
+ }
44
+
45
+ let version = currentVersion;
46
+ if (versionBump !== 'none') {
47
+ version = semver.inc(currentVersion, versionBump);
48
+
49
+ console.log(`Bumping version: ${version}`);
50
+
51
+ packageJson.version = version;
52
+ fs.writeFileSync('package.json', JSON.stringify(packageJson, null, 2) + "\n");
53
+ modifiedFiles.push('package.json');
54
+
55
+ if (yargs.argv.bower) {
56
+ const bowerJson = fs.readFileSync('bower.json');
57
+ bowerJson.version = version;
58
+ fs.writeFileSync('bower.json', JSON.stringify(bowerJson, null, 2) + "\n");
59
+ modifiedFiles.push('bower.json');
60
+ }
61
+ }
62
+
63
+
64
+ // Generate changelog
65
+ let changelog;
66
+ if (readlineSync.keyInYN('\n\nUpdate CHANGELOG?')) {
67
+ const depsArg = yargs.argv.deps ? `--deps ${yargs.argv.deps.join(' ')}` : '';
68
+ const show_changelog = path.resolve(__dirname, 'show_changelog.js');
69
+
70
+ changelog = _exec(`node ${show_changelog} ${depsArg}`, true).stdout;
71
+
72
+ console.log('CHANGELOG:\n\n');
73
+ console.log(changelog);
74
+
75
+ const tempChangelogFile = `CHANGELOG.md.${version}`;
76
+ fs.writeFileSync(tempChangelogFile, changelog);
77
+
78
+ console.log(`Wrote changelog to temp file: ${tempChangelogFile}`);
79
+ if (!readlineSync.keyInYN('Does the CHANGELOG look OK?')) {
80
+ process.exit(1);
81
+ }
82
+
83
+ let existingChangelog = fs.readFileSync('CHANGELOG.md');
84
+ changelog = fs.readFileSync(tempChangelogFile);
85
+ fs.writeFileSync('CHANGELOG.md', changelog + '\n' + existingChangelog);
86
+ fs.unlinkSync(tempChangelogFile);
87
+ modifiedFiles.push('CHANGELOG.md');
88
+ }
89
+
90
+
91
+ // Run tests
92
+ if (readlineSync.keyInYN('Run tests?')) {
93
+ _exec('npm test')
94
+ }
95
+
96
+
97
+ // Commit and push changes
98
+ if (!readlineSync.keyInYN('Ready to publish?')) {
99
+ console.log(`\n\nRun this command to undo changes:\n\ngit checkout ${modifiedFiles.join(' ')}\n\n`);
100
+ process.exit(1);
101
+ }
102
+
103
+ if (!yargs.argv.dryrun) {
104
+ _exec(`git commit -m ${version} ${modifiedFiles.join(' ')}`);
105
+ _exec(`git add ${modifiedFiles.join(' ')}`); // in case prettier reformatted these files
106
+ }
107
+
108
+ if (!yargs.argv.dryrun) {
109
+ util.ensureCleanMaster('master');
110
+ }
111
+
112
+
113
+ // Publish to NPM and push to github
114
+ if (!yargs.argv.dryrun) {
115
+ const distDir = packageJson.distDir || '.';
116
+ if (distDir !== '.' && packageJson.scripts && packageJson.scripts.build) {
117
+ _exec('npm run build')
118
+ }
119
+ shelljs.pushd(distDir);
120
+ _exec(`npm publish`);
121
+ shelljs.popd();
122
+ _exec(`git tag ${version}`);
123
+ _exec(`git push origin master`);
124
+ _exec(`git push origin ${version}`);
125
+ }
126
+
127
+
128
+ // Help with manual steps
129
+ let githuburl = packageJson.repository && packageJson.repository.url;
130
+ githuburl = githuburl && githuburl.replace(/^git\+/, '').replace(/\.git$/, '');
131
+
132
+ if (githuburl) {
133
+ if (changelog) {
134
+ const haspbcopy = shelljs.exec(`which pbcopy`, true).code === 0;
135
+ console.log(`\n\n1) Update the GitHub release with the release notes/CHANGELOG`);
136
+ console.log(`\n (Make sure you see "\u2714 Existing tag")`);
137
+
138
+ if (haspbcopy) {
139
+ fs.writeFileSync('CHANGELOG.tmp', changelog);
140
+ _exec('pbcopy < CHANGELOG.tmp', true);
141
+ fs.unlinkSync('CHANGELOG.tmp');
142
+ console.log(`(The CHANGELOG has been copied to your clipboard)`);
143
+ } else {
144
+ console.log('CHANGELOG:\n\n');
145
+ console.log(changelog);
146
+ }
147
+ console.log(`\n${githuburl}/releases/edit/${version}`);
148
+ open(`${githuburl}/releases/edit/${version}`);
149
+ }
150
+
151
+ console.log(`\n\n2) Check for milestones`);
152
+ console.log(`\n${githuburl}/milestones`);
153
+
154
+ console.log(`\n\n\n`);
155
+ } else {
156
+ console.log("Could not determine github URL from package.json")
157
+ }
158
+
159
+ // Generate docs
160
+ util.packageDir();
161
+ if (fs.existsSync('typedoc.json') && readlineSync.keyInYN('Generate docs?')) {
162
+ _exec('generate_docs');
163
+ _exec('publish_docs');
164
+ }
package/show_changelog.js CHANGED
@@ -1,142 +1,142 @@
1
- #!/usr/bin/env node
2
- "use strict";
3
-
4
- const shelljs = require('shelljs');
5
- const path = require('path');
6
- const fs = require('fs');
7
- const conventionalChangelog = require('conventional-changelog');
8
- const _exec = require('./util')._exec;
9
- const yargs = require('yargs')
10
- .option('from', {
11
- description: 'The starting tag'
12
- })
13
- .option('to', {
14
- description: 'The ending tag'
15
- })
16
- .option('deps', {
17
- description: 'Include changelogs of dependencies',
18
- array: true,
19
- })
20
- .check(argv => {
21
- if (argv.to && !argv.from)
22
- throw new Error(`If you specify a 'to', you should also specify a 'from'.`);
23
- return true;
24
- });
25
-
26
- let options = {
27
- preset: 'ui-router-core'
28
- };
29
-
30
- const context = {}, gitOpts = { merges: null };
31
- const to = yargs.argv.to;
32
- const from = yargs.argv.from;
33
- const deps = yargs.argv.deps || [];
34
- const scriptPath = path.resolve(__dirname, __filename);
35
-
36
- if (to && from) {
37
- gitOpts.to = context.currentTag = to;
38
- gitOpts.from = context.previousTag = from;
39
- } else if (from) {
40
- gitOpts.from = context.previousTag = from;
41
- } else if (!to && !from) {
42
- gitOpts.from = context.previousTag = getVersion('current');
43
- } else {
44
- throw new Error('How did this happen?');
45
- }
46
-
47
- const cwd = shelljs.pwd().stdout;
48
-
49
- if (deps.length) {
50
- // If --deps was used, shell out and re-run the show_changelog command without the --deps argument
51
- // This is an awful hack to flush the changelog to stdout before getting the dependency changelog(s)
52
- // because conventional-changelog-core doesn't seem to have a callback to tap into
53
- const fromArg = (from ? ` --from ${from}` : '');
54
- const toArg = (to ? ` --to ${to}` : '');
55
- let stdout = _exec(`${scriptPath} ${fromArg} ${toArg}`, true).stdout;
56
- console.log(stdout.trim());
57
-
58
- shelljs.mkdir('.show_changelog.tmp');
59
- try {
60
- deps.forEach(showDepChangelog);
61
- } finally {
62
- shelljs.cd(cwd);
63
- shelljs.rm('-rf', '.show_changelog.tmp');
64
- }
65
- } else {
66
- showChangelog(context, gitOpts);
67
- }
68
-
69
- function showDepChangelog(dependency) {
70
- if (typeof dependency !== 'string') throw new Error('Expected dep to be a string: ' + dependency);
71
-
72
- const tmpdir = path.resolve(cwd, '.show_changelog.tmp', dependency.replace(/[^a-zA-Z]/g, "_"));
73
-
74
- const pkgPath = `${cwd}/node_modules/${dependency}/package.json`;
75
- const pkg = JSON.parse(fs.readFileSync(pkgPath));
76
- const repotype = pkg.repository && pkg.repository.type;
77
- let giturl = pkg.repository && pkg.repository.url;
78
-
79
- if (repotype !== 'git') {
80
- throw new Error(`Expected repository.type to be 'git' in ${pkgPath} but it was '${repotype}'`);
81
- }
82
-
83
- if (!giturl) {
84
- throw new Error(`Expected repository.url to be defined in ${pkgPath} `);
85
- }
86
-
87
- giturl = giturl.replace(/^git\+/, '');
88
-
89
- const from = getDepVersion(dependency, 'tag', gitOpts.from);
90
- const to = (function() {
91
- if (gitOpts.to) return getDepVersion(dependency, 'tag', gitOpts.to);
92
- return getDepVersion(dependency, 'workingcopy');
93
- }());
94
-
95
- if (from === to) return;
96
-
97
- try {
98
- _exec(`git clone ${giturl} ${tmpdir}`, true);
99
- shelljs.config.silent = true;
100
- shelljs.pushd(tmpdir);
101
- shelljs.config.silent = false;
102
- console.log(`\n`);
103
- console.log(`---`);
104
- console.log(`\n`);
105
- console.log(`### Updated \`${dependency}\` from ${from} to ${to}`);
106
- console.log(`\n`);
107
- console.log(`Changelog for \`${dependency}\`:`);
108
- console.log(`\n`);
109
- let depChangelog = _exec(`node ${scriptPath} --from ${from} --to ${to}`, true).stdout.trim();
110
- console.log(depChangelog.split(/[\r\n]/).slice(1).join('\n'));
111
- } finally {
112
- shelljs.config.silent = true;
113
- shelljs.popd();
114
- shelljs.config.silent = false;
115
- }
116
- }
117
-
118
- // mode: 'workingcopy', 'current', 'previous', 'tag'
119
- // tag: (optional) the tag to fetch from
120
- function getVersion(mode, tag) {
121
- const showversion = path.resolve(__dirname, 'show_version.js');
122
- return _exec(`node ${showversion} --${mode} ${tag || ''}`, true).stdout.replace(/[\r\n]/g, '');
123
- }
124
-
125
- // dep: the dependency
126
- // mode: 'workingcopy', 'current', 'previous', 'tag'
127
- // tag: (optional) the tag to fetch from
128
- function getDepVersion(dep, mode, tag) {
129
- const showversion = path.resolve(__dirname, 'show_version.js');
130
- return _exec(`node ${showversion} --dep ${dep} --${mode} ${tag || ''}`, true).stdout.replace(/[\r\n]/g, '');
131
- }
132
-
133
- function showChangelog(context, gitOpts) {
134
- var writerOpts = {
135
- doFlush: true,
136
- generateOn: function () {
137
- return false;
138
- }
139
- };
140
- const readable = conventionalChangelog(options, context, gitOpts, undefined, writerOpts).pipe(process.stdout);
141
- return new Promise(resolve => readable.on('end', resolve));
142
- }
1
+ #!/usr/bin/env node
2
+ "use strict";
3
+
4
+ const shelljs = require('shelljs');
5
+ const path = require('path');
6
+ const fs = require('fs');
7
+ const conventionalChangelog = require('conventional-changelog');
8
+ const _exec = require('./util')._exec;
9
+ const yargs = require('yargs')
10
+ .option('from', {
11
+ description: 'The starting tag'
12
+ })
13
+ .option('to', {
14
+ description: 'The ending tag'
15
+ })
16
+ .option('deps', {
17
+ description: 'Include changelogs of dependencies',
18
+ array: true,
19
+ })
20
+ .check(argv => {
21
+ if (argv.to && !argv.from)
22
+ throw new Error(`If you specify a 'to', you should also specify a 'from'.`);
23
+ return true;
24
+ });
25
+
26
+ let options = {
27
+ preset: 'ui-router-core'
28
+ };
29
+
30
+ const context = {}, gitOpts = { merges: null };
31
+ const to = yargs.argv.to;
32
+ const from = yargs.argv.from;
33
+ const deps = yargs.argv.deps || [];
34
+ const scriptPath = path.resolve(__dirname, __filename);
35
+
36
+ if (to && from) {
37
+ gitOpts.to = context.currentTag = to;
38
+ gitOpts.from = context.previousTag = from;
39
+ } else if (from) {
40
+ gitOpts.from = context.previousTag = from;
41
+ } else if (!to && !from) {
42
+ gitOpts.from = context.previousTag = getVersion('current');
43
+ } else {
44
+ throw new Error('How did this happen?');
45
+ }
46
+
47
+ const cwd = shelljs.pwd().stdout;
48
+
49
+ if (deps.length) {
50
+ // If --deps was used, shell out and re-run the show_changelog command without the --deps argument
51
+ // This is an awful hack to flush the changelog to stdout before getting the dependency changelog(s)
52
+ // because conventional-changelog-core doesn't seem to have a callback to tap into
53
+ const fromArg = (from ? ` --from ${from}` : '');
54
+ const toArg = (to ? ` --to ${to}` : '');
55
+ let stdout = _exec(`node ${scriptPath} ${fromArg} ${toArg}`, true).stdout;
56
+ console.log(stdout.trim());
57
+
58
+ shelljs.mkdir('.show_changelog.tmp');
59
+ try {
60
+ deps.forEach(showDepChangelog);
61
+ } finally {
62
+ shelljs.cd(cwd);
63
+ shelljs.rm('-rf', '.show_changelog.tmp');
64
+ }
65
+ } else {
66
+ showChangelog(context, gitOpts);
67
+ }
68
+
69
+ function showDepChangelog(dependency) {
70
+ if (typeof dependency !== 'string') throw new Error('Expected dep to be a string: ' + dependency);
71
+
72
+ const tmpdir = path.resolve(cwd, '.show_changelog.tmp', dependency.replace(/[^a-zA-Z]/g, "_"));
73
+
74
+ const pkgPath = `${cwd}/node_modules/${dependency}/package.json`;
75
+ const pkg = JSON.parse(fs.readFileSync(pkgPath));
76
+ const repotype = pkg.repository && pkg.repository.type;
77
+ let giturl = pkg.repository && pkg.repository.url;
78
+
79
+ if (repotype !== 'git') {
80
+ throw new Error(`Expected repository.type to be 'git' in ${pkgPath} but it was '${repotype}'`);
81
+ }
82
+
83
+ if (!giturl) {
84
+ throw new Error(`Expected repository.url to be defined in ${pkgPath} `);
85
+ }
86
+
87
+ giturl = giturl.replace(/^git\+/, '');
88
+
89
+ const from = getDepVersion(dependency, 'tag', gitOpts.from);
90
+ const to = (function() {
91
+ if (gitOpts.to) return getDepVersion(dependency, 'tag', gitOpts.to);
92
+ return getDepVersion(dependency, 'workingcopy');
93
+ }());
94
+
95
+ if (from === to) return;
96
+
97
+ try {
98
+ _exec(`git clone ${giturl} ${tmpdir}`, true);
99
+ shelljs.config.silent = true;
100
+ shelljs.pushd(tmpdir);
101
+ shelljs.config.silent = false;
102
+ console.log(`\n`);
103
+ console.log(`---`);
104
+ console.log(`\n`);
105
+ console.log(`### Updated \`${dependency}\` from ${from} to ${to}`);
106
+ console.log(`\n`);
107
+ console.log(`Changelog for \`${dependency}\`:`);
108
+ console.log(`\n`);
109
+ let depChangelog = _exec(`node ${scriptPath} --from ${from} --to ${to}`, true).stdout.trim();
110
+ console.log(depChangelog.split(/[\r\n]/).slice(1).join('\n'));
111
+ } finally {
112
+ shelljs.config.silent = true;
113
+ shelljs.popd();
114
+ shelljs.config.silent = false;
115
+ }
116
+ }
117
+
118
+ // mode: 'workingcopy', 'current', 'previous', 'tag'
119
+ // tag: (optional) the tag to fetch from
120
+ function getVersion(mode, tag) {
121
+ const showversion = path.resolve(__dirname, 'show_version.js');
122
+ return _exec(`node ${showversion} --${mode} ${tag || ''}`, true).stdout.replace(/[\r\n]/g, '');
123
+ }
124
+
125
+ // dep: the dependency
126
+ // mode: 'workingcopy', 'current', 'previous', 'tag'
127
+ // tag: (optional) the tag to fetch from
128
+ function getDepVersion(dep, mode, tag) {
129
+ const showversion = path.resolve(__dirname, 'show_version.js');
130
+ return _exec(`node ${showversion} --dep ${dep} --${mode} ${tag || ''}`, true).stdout.replace(/[\r\n]/g, '');
131
+ }
132
+
133
+ function showChangelog(context, gitOpts) {
134
+ var writerOpts = {
135
+ doFlush: true,
136
+ generateOn: function () {
137
+ return false;
138
+ }
139
+ };
140
+ const readable = conventionalChangelog(options, context, gitOpts, undefined, writerOpts).pipe(process.stdout);
141
+ return new Promise(resolve => readable.on('end', resolve));
142
+ }