Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

git-conventional-commits

Package Overview
Dependencies
Maintainers
1
Versions
43
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

git-conventional-commits - npm Package Compare versions

Comparing version 2.5.2 to 2.6.0

68

lib/changelogGenerator.js

@@ -70,6 +70,4 @@ module.exports = function (config) {

`## **${releaseName || lastChangelogCommit.hash}**` +
` <sub><sup>${yyyy_mm_dd(lastChangelogCommit.date)} (${changelogCommitRangeMarkdown})</sup></sub>\n`;
`&emsp;<sub><sup>${yyyy_mm_dd(lastChangelogCommit.date)} (${changelogCommitRangeMarkdown})</sup></sub>\n`;
changelogMarkdown += "\n";
if (changesSectionCommits.length > 0 || breakingSectionCommits.length > 0) {

@@ -80,6 +78,7 @@ // ------ generate changes section

commitTypes.forEach((commitType) => {
changelogMarkdown += generateMarkdownCommitTypeSection(
commitType,
groupedChangelog[commitType]
);
changelogMarkdown += "\n" +
generateMarkdownCommitTypeSection(
commitType,
groupedChangelog[commitType]
);
});

@@ -96,3 +95,4 @@

if (breakingCommits.length) {
changelogMarkdown += generateMarkdownBreakingChangesSection(breakingCommits);
changelogMarkdown += "\n" +
generateMarkdownBreakingChangesSection(breakingCommits);
}

@@ -102,9 +102,15 @@

if (customMarkdown && customMarkdown.length) {
changelogMarkdown += generateCustomMarkdownSection(customMarkdown);
changelogMarkdown += "\n" +
generateCustomMarkdownSection(customMarkdown);
}
} else {
changelogMarkdown += "*no relevant changes*\n";
changelogMarkdown += "\n";
changelogMarkdown += "\n" +
"*no relevant changes*\n";
}
changelogMarkdown +=
"\n" +
"<br>\n" +
"\n";
return changelogMarkdown;

@@ -115,7 +121,7 @@ };

const typeSectionHeadline = config.headlines[commitType !== 'undefined' ? commitType : '?'] || commitType;
let typeSectionMarkdown = `### ${typeSectionHeadline}\n`;
let typeSectionMarkdown = `#### ${typeSectionHeadline}\n`;
const groupedCommits = bucketAggregation(commits, commit => commit.scope);
// sorted scopes with undefined scope at front, if present
const commitScopes = Object.keys(groupedCommits).sort((l, r) => {
const scopedCommits = bucketAggregation(commits, commit => commit.scope);
// sort scopes by name with, undefined scope at front, if present
const commitScopes = Object.keys(scopedCommits).sort((l, r) => {
if (l === 'undefined') return -1;

@@ -126,16 +132,22 @@ if (r === 'undefined') return 1;

commitScopes.forEach(scope => {
let scopeSectionMarkdown = '';
if (scope !== 'undefined') {
scopeSectionMarkdown += `##### \`${scope}\`\n`;
typeSectionMarkdown += "\n";
}
groupedCommits[scope].forEach(commit => {
scopeSectionMarkdown += `* ${generateMarkdownCommit(commit)}`;
});
typeSectionMarkdown += scopeSectionMarkdown + "\n";
typeSectionMarkdown += generateMarkdownScopeSection(scope, scopedCommits[scope]);
});
return typeSectionMarkdown + "\n";
return typeSectionMarkdown;
}
function generateMarkdownScopeSection(scope, commits) {
let scopeSectionMarkdown = '';
if (scope !== 'undefined') {
scopeSectionMarkdown += `##### \`${scope}\`\n`;
}
commits.forEach(commit => {
scopeSectionMarkdown += `* ${generateMarkdownCommit(commit)}`;
});
return scopeSectionMarkdown;
}
function generateMarkdownCommit(commit) {

@@ -158,4 +170,5 @@ let commitMarkdown = '';

});
commitMarkdown += ` (${referencesMarkdown.join(', ')})`;
return commitMarkdown + "\n";
commitMarkdown += ` (${referencesMarkdown.join(', ')})\n`;
return commitMarkdown;
}

@@ -186,5 +199,6 @@

breakingChangeMarkdown += "\n";
changelogMarkdown += breakingChangeMarkdown;
}));
return changelogMarkdown + "\n";
return changelogMarkdown;
}

@@ -197,3 +211,3 @@

});
return changelogMarkdown + "\n";
return changelogMarkdown;
}

@@ -200,0 +214,0 @@

{
"name": "git-conventional-commits",
"version": "2.5.2",
"version": "2.6.0",
"description": "git conventional commits util",

@@ -5,0 +5,0 @@ "licence": "GPLv3",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc