npm-update-package 0.49.0 → 0.49.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/package.json
CHANGED
|
@@ -51,7 +51,9 @@ class PullRequestBodyCreator {
|
|
|
51
51
|
const newVersion = outdatedPackage.newVersion.version;
|
|
52
52
|
const links = [];
|
|
53
53
|
if ((gitRepo === null || gitRepo === void 0 ? void 0 : gitRepo.isGitHub) === true) {
|
|
54
|
-
|
|
54
|
+
const url = `${gitRepo.url.toString()}/compare/v${currentVersion}...v${newVersion}`;
|
|
55
|
+
const optimizedUrl = (0, optimizeGitHubUrl_1.optimizeGitHubUrl)(url).toString();
|
|
56
|
+
links.push(`- [GitHub](${optimizedUrl})`);
|
|
55
57
|
}
|
|
56
58
|
links.push(`- [npmfs](https://npmfs.com/compare/${packageName}/${currentVersion}/${newVersion})`);
|
|
57
59
|
links.push(`- [Renovate Bot Package Diff](https://renovatebot.com/diffs/npm/${packageName}/${currentVersion}/${newVersion})`);
|
|
@@ -94,7 +96,7 @@ ${this.options.prBodyNotes}`;
|
|
|
94
96
|
return undefined;
|
|
95
97
|
}
|
|
96
98
|
const items = releases.map(({ tag, url }) => {
|
|
97
|
-
const optimizedUrl = (0, optimizeGitHubUrl_1.optimizeGitHubUrl)(url);
|
|
99
|
+
const optimizedUrl = (0, optimizeGitHubUrl_1.optimizeGitHubUrl)(url).toString();
|
|
98
100
|
return `- [${tag}](${optimizedUrl})`;
|
|
99
101
|
});
|
|
100
102
|
return `## Release notes
|
|
@@ -6,10 +6,10 @@ const url_1 = require("url");
|
|
|
6
6
|
* Convert URL to prevent linking to other repositories.
|
|
7
7
|
*/
|
|
8
8
|
const optimizeGitHubUrl = (url) => {
|
|
9
|
-
const newUrl = new url_1.URL(url);
|
|
9
|
+
const newUrl = url instanceof url_1.URL ? url : new url_1.URL(url);
|
|
10
10
|
if (newUrl.host === 'github.com') {
|
|
11
11
|
newUrl.host = 'togithub.com';
|
|
12
12
|
}
|
|
13
|
-
return newUrl
|
|
13
|
+
return newUrl;
|
|
14
14
|
};
|
|
15
15
|
exports.optimizeGitHubUrl = optimizeGitHubUrl;
|