Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
return new Promise((resolve, reject) => {
const data = [];
conventionalChangelog({
preset: 'angular'
})
.on('data', chunk => {
data.push(chunk);
})
.on('end', () => {
resolve(data.join(''));
})
.on('error', error => {
reject(error);
});
});
}
gulp.task('changelog', function () {
return changelog({
preset: 'angular',
releaseCount: 0
})
.pipe(fs.createWriteStream('CHANGELOG.md'));
});
export default function (cb) {
const pkg = JSON.parse(readFile('./package.json'))
const repository = pkg.repository ? parseUrl(pkg.repository.url) : null
changelog({
version: pkg.version,
repository: repository,
file: false
}, cb)
}
gulp.task('changelog', function () {
return conventionalChangelog({
preset: 'angular',
releaseCount: 0
})
.pipe(fs.createWriteStream('CHANGELOG.md'));
});
function runConventionalChangelog({
args,
templateContext,
gitRawCommitsOpts,
resolve,
reject,
}) {
const changelogStream = conventionalChangelog(
args,
templateContext,
gitRawCommitsOpts
).on('error', reject);
const readStream = fs.createReadStream(args.infile).on('error', reject);
if (args.sameFile) {
if (args.append) {
changelogStream
.pipe(
fs.createWriteStream(args.outfile, {
flags: 'a',
})
)
.on('finish', resolve);
} else {
gulp.task('changelog', () => {
return changelog({
preset: 'angular',
releaseCount: 0
})
.pipe(fs.createWriteStream(paths.changelog));
});
gulp.task('release-generate-changelog', () => {
const newChangesStream = changelog(
{preset: 'angular', warn: log},
{},
{},
{noteKeywords: ['BREAKING CHANGE', 'DEPRECATION WARNING']},
{transform: commitTransform}
);
const oldChangesStream = gulp.src('../CHANGELOG.md')
.pipe(map((file, cb) => cb(null, file.contents)));
const latestChangesFileStream = newChangesStream
.pipe(source('LATEST_CHANGES.md'));
const changelogFileStream = series(newChangesStream, oldChangesStream)
.pipe(source('CHANGELOG.md'));