npm-update-package 0.45.8 → 0.45.9

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "npm-update-package",
3
- "version": "0.45.8",
3
+ "version": "0.45.9",
4
4
  "description": "CLI tool for creating pull requests to update npm packages",
5
5
  "scripts": {
6
6
  "build": "tsc --project tsconfig.build.json",
@@ -9,6 +9,7 @@ const file_1 = require("../../../file");
9
9
  const json_1 = require("../../../json");
10
10
  const package_json_2 = require("../../../package-json");
11
11
  const metadata_1 = require("../metadata");
12
+ const optimizeGitHubUrl_1 = require("./optimizeGitHubUrl");
12
13
  class PullRequestBodyCreator {
13
14
  constructor({ options, releasesFetcher }) {
14
15
  this.options = options;
@@ -74,7 +75,10 @@ ${this.options.prBodyNotes}`;
74
75
  if (releases.length === 0) {
75
76
  return undefined;
76
77
  }
77
- const items = releases.map(({ tag, url }) => `- [${tag}](${url})`);
78
+ const items = releases.map(({ tag, url }) => {
79
+ const optimizedUrl = (0, optimizeGitHubUrl_1.optimizeGitHubUrl)(url);
80
+ return `- [${tag}](${optimizedUrl})`;
81
+ });
78
82
  return `## Release notes
79
83
 
80
84
  ${items.join('\n')}`;
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.optimizeGitHubUrl = void 0;
4
+ const url_1 = require("url");
5
+ /**
6
+ * Convert URL to prevent linking to other repositories.
7
+ */
8
+ const optimizeGitHubUrl = (url) => {
9
+ const newUrl = new url_1.URL(url);
10
+ if (newUrl.host === 'github.com') {
11
+ newUrl.host = 'togithub.com';
12
+ }
13
+ return newUrl.toString();
14
+ };
15
+ exports.optimizeGitHubUrl = optimizeGitHubUrl;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "npm-update-package",
3
- "version": "0.45.8",
3
+ "version": "0.45.9",
4
4
  "description": "CLI tool for creating pull requests to update npm packages",
5
5
  "scripts": {
6
6
  "build": "tsc --project tsconfig.build.json",