npm-update-package 0.40.0 → 0.41.2
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
|
@@ -49,14 +49,21 @@ class GitHub {
|
|
|
49
49
|
ref: `heads/${branch}`
|
|
50
50
|
});
|
|
51
51
|
}
|
|
52
|
-
// TODO: fetch all branches with page option
|
|
53
52
|
async fetchBranches({ owner, repo }) {
|
|
54
|
-
const
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
53
|
+
const branches = [];
|
|
54
|
+
for (let page = 1;; page++) {
|
|
55
|
+
const { data } = await this.octokit.repos.listBranches({
|
|
56
|
+
owner,
|
|
57
|
+
repo,
|
|
58
|
+
per_page: 100,
|
|
59
|
+
page
|
|
60
|
+
});
|
|
61
|
+
if (data.length === 0) {
|
|
62
|
+
break;
|
|
63
|
+
}
|
|
64
|
+
branches.push(...data);
|
|
65
|
+
}
|
|
66
|
+
return branches;
|
|
60
67
|
}
|
|
61
68
|
async fetchLabel({ owner, repo, name }) {
|
|
62
69
|
const { data } = await this.octokit.issues.getLabel({
|
|
@@ -66,14 +73,21 @@ class GitHub {
|
|
|
66
73
|
});
|
|
67
74
|
return data;
|
|
68
75
|
}
|
|
69
|
-
// TODO: fetch all pull requests with page option
|
|
70
76
|
async fetchPullRequests({ owner, repo }) {
|
|
71
|
-
const
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
+
const pullRequests = [];
|
|
78
|
+
for (let page = 1;; page++) {
|
|
79
|
+
const { data } = await this.octokit.pulls.list({
|
|
80
|
+
owner,
|
|
81
|
+
repo,
|
|
82
|
+
per_page: 100,
|
|
83
|
+
page
|
|
84
|
+
});
|
|
85
|
+
if (data.length === 0) {
|
|
86
|
+
break;
|
|
87
|
+
}
|
|
88
|
+
pullRequests.push(...data);
|
|
89
|
+
}
|
|
90
|
+
return pullRequests;
|
|
77
91
|
}
|
|
78
92
|
async fetchReleases({ owner, repo }) {
|
|
79
93
|
const releases = [];
|
|
@@ -15,10 +15,7 @@ class PullRequestBodyCreator {
|
|
|
15
15
|
}
|
|
16
16
|
async create(outdatedPackage) {
|
|
17
17
|
const gitRepo = await this.extractRepository(outdatedPackage);
|
|
18
|
-
const outdatedPackagesTable = this.createOutdatedPackagesTable(
|
|
19
|
-
outdatedPackage,
|
|
20
|
-
gitRepo
|
|
21
|
-
});
|
|
18
|
+
const outdatedPackagesTable = this.createOutdatedPackagesTable(outdatedPackage);
|
|
22
19
|
const metadataSection = this.createMetadataSection(outdatedPackage);
|
|
23
20
|
const footer = this.createFooter();
|
|
24
21
|
const body = `This PR updates these packages:
|
|
@@ -71,10 +68,9 @@ ${footer}`;
|
|
|
71
68
|
|
|
72
69
|
${items.join('\n')}`;
|
|
73
70
|
}
|
|
74
|
-
createOutdatedPackagesTable(
|
|
71
|
+
createOutdatedPackagesTable(outdatedPackage) {
|
|
75
72
|
const packageName = outdatedPackage.name;
|
|
76
73
|
const packageLink = `[${packageName}](https://www.npmjs.com/package/${packageName})`;
|
|
77
|
-
const repositoryLink = gitRepo !== undefined ? `[${gitRepo.owner}/${gitRepo.name}](${gitRepo.url.toString()})` : '-';
|
|
78
74
|
const dependencyType = outdatedPackage.dependencyType;
|
|
79
75
|
const level = outdatedPackage.level;
|
|
80
76
|
const currentVersion = outdatedPackage.currentVersion.version;
|
|
@@ -83,9 +79,9 @@ ${items.join('\n')}`;
|
|
|
83
79
|
const newVersionLink = `[\`${newVersion}\`](https://www.npmjs.com/package/${packageName}/v/${newVersion})`;
|
|
84
80
|
const diffLink = `[diff](https://renovatebot.com/diffs/npm/${packageName}/${currentVersion}/${newVersion})`;
|
|
85
81
|
const version = `${currentVersionLink} -> ${newVersionLink} (${diffLink})`;
|
|
86
|
-
return `|Package|
|
|
87
|
-
|
|
88
|
-
|${packageLink}|${
|
|
82
|
+
return `|Package|Dependency type|Level|Version|
|
|
83
|
+
|---|---|---|---|
|
|
84
|
+
|${packageLink}|${dependencyType}|${level}|${version}|`;
|
|
89
85
|
}
|
|
90
86
|
createMetadataSection(outdatedPackage) {
|
|
91
87
|
const metadata = (0, metadata_1.createPullRequestMetadata)([outdatedPackage]);
|