git-conventional-commits
Advanced tools
Comparing version 2.0.0 to 2.0.1
@@ -18,3 +18,3 @@ { | ||
"commitScopes": [], | ||
"releaseTagGlobPattern": "v[0-9].*", | ||
"releaseTagGlobPattern": "v[0-9]*.[0-9]*.[0-9]*", | ||
"issueRegexPattern": "(^|\\s)#\\d+(\\s|$)" | ||
@@ -21,0 +21,0 @@ }, |
@@ -93,3 +93,3 @@ const fs = require("fs"); | ||
// match only release version e.g. 1.2.3 ((?:[^-]|$) ignores pre-release versions e.g. 1.2.3-SNAPSHOT) | ||
config.convention.semanticVersionRegex = /(?<major>\d+)\.(?<minor>\d+)\.(?<patch>\d+)(?:[^-]|$)/; | ||
config.convention.semanticVersionRegex = /(?<major>\d+)\.(?<minor>\d+)\.(?<patch>\d+)/; | ||
@@ -96,0 +96,0 @@ config.changelog.commitIgnoreRegex = () => RegExp(config.changelog.commitIgnoreRegexPattern || '(?!)'); |
const execAsync = require('./execAsync'); | ||
async function getLastTag(tagGlobPattern, commitAnchor = 'HEAD') { | ||
return await execAsync(`git describe --tags --match=${tagGlobPattern} --no-abbrev ${commitAnchor}`, {encoding: 'UTF-8'}) | ||
/** | ||
* @function | ||
* @param {Object} options - changelog specific generator parameters. | ||
* @param {Object} [options.commitAnchor] - commit anchor. | ||
* @param {string} [options.matchPattern] - tag glob pattern. | ||
* @param {string} [options.excludePattern] - tag exclude glob pattern. | ||
*/ | ||
async function getLastTag( | ||
{ | ||
commitAnchor = 'HEAD', | ||
matchPattern= '*', | ||
excludePattern, | ||
} | ||
) { | ||
return await execAsync(`git describe --tags --match=${matchPattern} ${excludePattern ? `--exclude=${excludePattern}` : ''} --no-abbrev ${commitAnchor}`, {encoding: 'UTF-8'}) | ||
.then(output => output.trim()) | ||
@@ -6,0 +19,0 @@ .catch(err => { |
@@ -129,4 +129,8 @@ const Git = require("./git"); | ||
async function getLastReleaseTag(commitRef) { | ||
return await Git.getLastTag(convention.releaseTagGlobPattern, commitRef) | ||
return await Git.getLastTag({ | ||
commitAnchor: commitRef, | ||
matchPattern: convention.releaseTagGlobPattern, | ||
excludePattern: '*-*', // exclude pre-release versions | ||
}) | ||
} | ||
}; |
{ | ||
"name": "git-conventional-commits", | ||
"version": "2.0.0", | ||
"version": "2.0.1", | ||
"description": "git conventional commits util", | ||
@@ -5,0 +5,0 @@ "licence": "GPLv3", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
72460
742