npm-update-package 0.48.2 → 0.49.0
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/README.md
CHANGED
|
@@ -2,10 +2,6 @@
|
|
|
2
2
|
[](https://standardjs.com)
|
|
3
3
|
[](https://github.com/npm-update-package/npm-update-package/actions/workflows/eslint.yml)
|
|
4
4
|
[](https://github.com/npm-update-package/npm-update-package/actions/workflows/test.yml)
|
|
5
|
-

|
|
6
|
-

|
|
7
|
-

|
|
8
|
-

|
|
9
5
|
|
|
10
6
|
# npm-update-package
|
|
11
7
|
|
package/dist/package.json
CHANGED
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "npm-update-package",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.49.0",
|
|
4
4
|
"description": "CLI tool for creating pull requests to update npm packages",
|
|
5
5
|
"scripts": {
|
|
6
|
-
"badges": "jest-coverage-badges output docs",
|
|
7
6
|
"build": "tsc --project tsconfig.build.json",
|
|
8
7
|
"clean": "rimraf dist",
|
|
9
8
|
"lint": "eslint '**/*.{js,ts}'",
|
|
10
|
-
"posttest": "npm run badges",
|
|
11
9
|
"prebuild": "npm run clean",
|
|
12
10
|
"prepare": "husky install",
|
|
13
11
|
"prepublish": "npm-run-all lint test build",
|
|
@@ -23,7 +21,7 @@
|
|
|
23
21
|
"http-status-codes": "2.2.0",
|
|
24
22
|
"io-ts": "2.2.16",
|
|
25
23
|
"lodash": "4.14.2",
|
|
26
|
-
"log4js": "6.4.
|
|
24
|
+
"log4js": "6.4.4",
|
|
27
25
|
"mustache": "4.1.0",
|
|
28
26
|
"node-fetch": "2.6.7",
|
|
29
27
|
"npm-check-updates": "12.5.4",
|
|
@@ -46,19 +44,18 @@
|
|
|
46
44
|
"eslint": "8.11.0",
|
|
47
45
|
"eslint-config-standard-with-typescript": "21.0.1",
|
|
48
46
|
"eslint-plugin-import": "2.25.4",
|
|
49
|
-
"eslint-plugin-jest": "26.1.
|
|
47
|
+
"eslint-plugin-jest": "26.1.3",
|
|
50
48
|
"eslint-plugin-node": "11.1.0",
|
|
51
49
|
"eslint-plugin-promise": "6.0.0",
|
|
52
50
|
"eslint-plugin-tsdoc": "0.2.14",
|
|
53
51
|
"husky": "7.0.4",
|
|
54
52
|
"jest": "27.4.7",
|
|
55
|
-
"jest-coverage-badges": "1.1.2",
|
|
56
53
|
"lint-staged": "12.3.7",
|
|
57
54
|
"npm-run-all": "4.1.5",
|
|
58
55
|
"rimraf": "3.0.2",
|
|
59
|
-
"ts-jest": "27.1.
|
|
56
|
+
"ts-jest": "27.1.4",
|
|
60
57
|
"ts-node": "10.7.0",
|
|
61
|
-
"typescript": "4.6.
|
|
58
|
+
"typescript": "4.6.3",
|
|
62
59
|
"utility-types": "3.10.0"
|
|
63
60
|
},
|
|
64
61
|
"repository": {
|
|
@@ -10,6 +10,7 @@ const json_1 = require("../../../json");
|
|
|
10
10
|
const package_json_2 = require("../../../package-json");
|
|
11
11
|
const metadata_1 = require("../metadata");
|
|
12
12
|
const optimizeGitHubUrl_1 = require("./optimizeGitHubUrl");
|
|
13
|
+
// TODO: Split into multiple classes and functions
|
|
13
14
|
class PullRequestBodyCreator {
|
|
14
15
|
constructor({ options, releasesFetcher }) {
|
|
15
16
|
this.options = options;
|
|
@@ -19,9 +20,12 @@ class PullRequestBodyCreator {
|
|
|
19
20
|
const sections = [];
|
|
20
21
|
const outdatedPackagesTable = this.createOutdatedPackagesTable(outdatedPackage);
|
|
21
22
|
sections.push(`This PR updates these packages:\n\n${outdatedPackagesTable}`);
|
|
22
|
-
const diffSection = this.createDiffSection(outdatedPackage);
|
|
23
|
-
sections.push(diffSection);
|
|
24
23
|
const gitRepo = await this.extractRepository(outdatedPackage);
|
|
24
|
+
const diffSection = this.createDiffSection({
|
|
25
|
+
outdatedPackage,
|
|
26
|
+
gitRepo
|
|
27
|
+
});
|
|
28
|
+
sections.push(diffSection);
|
|
25
29
|
if ((gitRepo === null || gitRepo === void 0 ? void 0 : gitRepo.isGitHub) === true) {
|
|
26
30
|
const releaseNotesSection = await this.createReleaseNotesSection({
|
|
27
31
|
outdatedPackage,
|
|
@@ -41,14 +45,19 @@ class PullRequestBodyCreator {
|
|
|
41
45
|
sections.push(`---\n${footer}`);
|
|
42
46
|
return sections.join('\n\n');
|
|
43
47
|
}
|
|
44
|
-
createDiffSection(outdatedPackage) {
|
|
48
|
+
createDiffSection({ outdatedPackage, gitRepo }) {
|
|
45
49
|
const packageName = outdatedPackage.name;
|
|
46
50
|
const currentVersion = outdatedPackage.currentVersion.version;
|
|
47
51
|
const newVersion = outdatedPackage.newVersion.version;
|
|
52
|
+
const links = [];
|
|
53
|
+
if ((gitRepo === null || gitRepo === void 0 ? void 0 : gitRepo.isGitHub) === true) {
|
|
54
|
+
links.push(`- [GitHub](${gitRepo.url.toString()}/compare/v${currentVersion}...v${newVersion})`);
|
|
55
|
+
}
|
|
56
|
+
links.push(`- [npmfs](https://npmfs.com/compare/${packageName}/${currentVersion}/${newVersion})`);
|
|
57
|
+
links.push(`- [Renovate Bot Package Diff](https://renovatebot.com/diffs/npm/${packageName}/${currentVersion}/${newVersion})`);
|
|
48
58
|
return `## Package diffs
|
|
49
59
|
|
|
50
|
-
|
|
51
|
-
- [Renovate Bot Package Diff](https://renovatebot.com/diffs/npm/${packageName}/${currentVersion}/${newVersion})`;
|
|
60
|
+
${links.join('\n')}`;
|
|
52
61
|
}
|
|
53
62
|
createFooter() {
|
|
54
63
|
return `This PR has been generated by [${package_json_1.default.name}](${package_json_1.default.homepage}) v${package_json_1.default.version}`;
|
package/package.json
CHANGED
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "npm-update-package",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.49.0",
|
|
4
4
|
"description": "CLI tool for creating pull requests to update npm packages",
|
|
5
5
|
"scripts": {
|
|
6
|
-
"badges": "jest-coverage-badges output docs",
|
|
7
6
|
"build": "tsc --project tsconfig.build.json",
|
|
8
7
|
"clean": "rimraf dist",
|
|
9
8
|
"lint": "eslint '**/*.{js,ts}'",
|
|
10
|
-
"posttest": "npm run badges",
|
|
11
9
|
"prebuild": "npm run clean",
|
|
12
10
|
"prepare": "husky install",
|
|
13
11
|
"prepublish": "npm-run-all lint test build",
|
|
@@ -23,7 +21,7 @@
|
|
|
23
21
|
"http-status-codes": "2.2.0",
|
|
24
22
|
"io-ts": "2.2.16",
|
|
25
23
|
"lodash": "4.14.2",
|
|
26
|
-
"log4js": "6.4.
|
|
24
|
+
"log4js": "6.4.4",
|
|
27
25
|
"mustache": "4.1.0",
|
|
28
26
|
"node-fetch": "2.6.7",
|
|
29
27
|
"npm-check-updates": "12.5.4",
|
|
@@ -46,19 +44,18 @@
|
|
|
46
44
|
"eslint": "8.11.0",
|
|
47
45
|
"eslint-config-standard-with-typescript": "21.0.1",
|
|
48
46
|
"eslint-plugin-import": "2.25.4",
|
|
49
|
-
"eslint-plugin-jest": "26.1.
|
|
47
|
+
"eslint-plugin-jest": "26.1.3",
|
|
50
48
|
"eslint-plugin-node": "11.1.0",
|
|
51
49
|
"eslint-plugin-promise": "6.0.0",
|
|
52
50
|
"eslint-plugin-tsdoc": "0.2.14",
|
|
53
51
|
"husky": "7.0.4",
|
|
54
52
|
"jest": "27.4.7",
|
|
55
|
-
"jest-coverage-badges": "1.1.2",
|
|
56
53
|
"lint-staged": "12.3.7",
|
|
57
54
|
"npm-run-all": "4.1.5",
|
|
58
55
|
"rimraf": "3.0.2",
|
|
59
|
-
"ts-jest": "27.1.
|
|
56
|
+
"ts-jest": "27.1.4",
|
|
60
57
|
"ts-node": "10.7.0",
|
|
61
|
-
"typescript": "4.6.
|
|
58
|
+
"typescript": "4.6.3",
|
|
62
59
|
"utility-types": "3.10.0"
|
|
63
60
|
},
|
|
64
61
|
"repository": {
|