conventional-changelog-beemo
Advanced tools
Comparing version 1.5.2 to 1.5.3
@@ -1,5 +0,11 @@ | ||
### 1.5.2 - 2019-11-10 | ||
### 1.5.3 - 2019-11-12 | ||
#### 🐞 Fixes | ||
- Actually support deep links (monorepos, etc) correctly. | ||
### 1.5.2 - 2019-11-11 | ||
#### 🐞 Fixes | ||
- Will not autolink `@username` tokens that are wrapped in backticks. | ||
@@ -6,0 +12,0 @@ - Will properly link commits and issues within monorepos, or projects that define invalid |
@@ -29,4 +29,33 @@ "use strict"; | ||
}; | ||
function createLink(paths, context) { | ||
return [context.host, context.owner, context.repository, ...paths].filter(Boolean).join('/'); | ||
function createLink(paths, context, reference = {}) { | ||
const owner = reference.owner || context.owner; | ||
const repository = reference.repository || context.repository; | ||
const url = []; | ||
if (repository) { | ||
if (context.host) { | ||
url.push(context.host); | ||
} | ||
if (owner) { | ||
url.push(owner); | ||
} | ||
url.push(repository); | ||
} | ||
else { | ||
url.push(context.repoUrl); | ||
} | ||
let base = url.join('/'); | ||
// If deep linking to a sub-folder (monorepo project, etc), | ||
// extract the base URL if possible. | ||
[ | ||
// github, gitlab | ||
'tree', | ||
'blob', | ||
// bitbucket | ||
'src', | ||
].forEach(browsePart => { | ||
if (base.includes(`/${browsePart}/`)) { | ||
[base] = base.split(`/${browsePart}/`); | ||
} | ||
}); | ||
return [base, ...paths].join('/'); | ||
} | ||
@@ -86,3 +115,3 @@ const options = { | ||
commit.references.forEach(reference => { | ||
reference.issueLink = createLink([context.issue, reference.issue], context); | ||
reference.issueLink = createLink([context.issue, reference.issue], context, reference); | ||
let source = `${reference.repository || ''}#${reference.issue}`; | ||
@@ -89,0 +118,0 @@ if (reference.owner) { |
{ | ||
"name": "conventional-changelog-beemo", | ||
"version": "1.5.2", | ||
"version": "1.5.3", | ||
"description": "Conventional changelog preset for Beemo and associated projects.", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
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
24105
495