@immobiliarelabs/standard-version
Advanced tools
Comparing version 10.2.0 to 10.2.1
@@ -0,1 +1,8 @@ | ||
## [10.2.1](https://github.com/immobiliare/standard-version/compare/v10.2.0...v10.2.1) (2023-11-08) | ||
### Bug Fixes | ||
* **git-semver-tags:** now return promises ([87b04be](https://github.com/immobiliare/standard-version/commit/87b04be102384d56e54b8d3ee09c99dd981bcb46)) | ||
# [10.2.0](https://github.com/immobiliare/standard-version/compare/v10.1.0...v10.2.0) (2023-11-08) | ||
@@ -2,0 +9,0 @@ |
@@ -13,3 +13,3 @@ const gitSemverTags = require('git-semver-tags'); | ||
function latestSemverTag(n = 1, opts) { | ||
async function latestSemverTag(n = 1, opts) { | ||
if (typeof n === 'object') opts = n; | ||
@@ -25,37 +25,27 @@ | ||
); | ||
return new Promise((resolve, reject) => { | ||
gitSemverTags({ tagPrefix }, function (err, tags) { | ||
if (err) { | ||
return reject(err); | ||
} else if (!tags.length) { | ||
tags = tagPrefix ? [tagPrefix + '1.0.0'] : ['1.0.0']; | ||
} | ||
if (typeof n !== 'number' || n <= 0) n = tags.length; | ||
// follow me on this because it ugly | ||
return resolve( | ||
tags | ||
.filter((tag) => { | ||
if (changelogIncludesPrereleases) return true; | ||
// if returns null its not a prerelease | ||
return semver.prerelease(tag) === null; | ||
}) | ||
// we need to replace any custom tags prefix | ||
.map((tag) => { | ||
// [original, cleaned for sorting] | ||
return { | ||
raw: tag, | ||
clean: clearTag(tag, tagPrefix), | ||
}; | ||
}) | ||
// so we can sort them cronologically following semver | ||
.sort((a, b) => semver.rcompare(a.clean, b.clean)) | ||
// then re-add prefix so we can use tags for git commands or they 404 | ||
.map(({ clean, raw }) => (withPrefix ? raw : clean)) | ||
.slice(0, n) | ||
); | ||
}); | ||
}); | ||
let tags = await gitSemverTags({ tagPrefix }); | ||
if (!tags.length) { | ||
tags = tagPrefix ? [tagPrefix + '1.0.0'] : ['1.0.0']; | ||
} | ||
return ( | ||
tags | ||
.filter((tag) => { | ||
if (changelogIncludesPrereleases) return true; | ||
// if returns null its not a prerelease | ||
return semver.prerelease(tag) === null; | ||
}) | ||
// we need to replace any custom tags prefix | ||
.map((tag) => { | ||
// [original, cleaned for sorting] | ||
return { | ||
raw: tag, | ||
clean: clearTag(tag, tagPrefix), | ||
}; | ||
}) | ||
// so we can sort them cronologically following semver | ||
.sort((a, b) => semver.rcompare(a.clean, b.clean)) | ||
// then re-add prefix so we can use tags for git commands or they 404 | ||
.map(({ clean, raw }) => (withPrefix ? raw : clean)) | ||
.slice(0, n) | ||
); | ||
} | ||
@@ -62,0 +52,0 @@ |
{ | ||
"name": "@immobiliarelabs/standard-version", | ||
"version": "10.2.0", | ||
"version": "10.2.1", | ||
"description": "replacement for `npm version` with automatic CHANGELOG generation", | ||
@@ -62,3 +62,3 @@ "bin": "bin/cli.js", | ||
"find-up": "^5.0.0", | ||
"git-semver-tags": "^4.0.0", | ||
"git-semver-tags": "^7.0.1", | ||
"semver": "^7.1.1", | ||
@@ -65,0 +65,0 @@ "stringify-package": "^1.0.1", |
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
145351
2428
+ Addedgit-semver-tags@7.0.1(transitive)
+ Addedmeow@12.1.1(transitive)
Updatedgit-semver-tags@^7.0.1