Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const changelog_lines = changelog.split("\n");
CHANGELOG.header = changelog_lines.splice(0, 2).join("\n");
CHANGELOG.changes = changelog_lines.splice(2, changelog_lines.length - 6).join("\n");
// Get changelog body.
const tag_message = run("git", ["cat-file", "-p", COMMIT_TAG])[1].toString().split("\n");
if (tag_message[0].startsWith("object")) {
CHANGELOG.body = tag_message.slice(5).join("\n");
}
resolve();
});
// Generate changelog from commit messages.
require("conventional-changelog")({
preset: "angular"
}).pipe(changelog_buffer);
});
}
module.exports = function (from, cb) {
git.getCommits({
log: console.log.bind(console),
warn: console.warn.bind(console),
from: from
}, efh(cb)(function (commits) {
cb(null, commits)
}))
}
commits.map(function (commit) {
return parseRawCommit(commit.hash + '\n' + commit.message)
}).filter(function (commit) {
return !!commit
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'));