npm-update-package 0.41.0 → 0.41.3

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.41.0",
3
+ "version": "0.41.3",
4
4
  "description": "CLI tool for creating pull requests to update npm packages",
5
5
  "scripts": {
6
6
  "build": "tsc --project tsconfig.build.json",
@@ -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 { data } = await this.octokit.repos.listBranches({
55
- owner,
56
- repo,
57
- per_page: 100
58
- });
59
- return data;
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 { data } = await this.octokit.pulls.list({
72
- owner,
73
- repo,
74
- per_page: 100
75
- });
76
- return data;
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 = [];
@@ -11,7 +11,10 @@ class ReleasesFetcher {
11
11
  owner: gitRepo.owner,
12
12
  repo: gitRepo.name
13
13
  });
14
- return releases.filter(({ tag_name: version }) => (0, semver_1.gte)(version, from.version) && (0, semver_1.lte)(version, to.version));
14
+ return releases.filter(({ tag_name: version }) => {
15
+ // TODO: Move these to SemVer
16
+ return (0, semver_1.valid)(version) !== null && (0, semver_1.gte)(version, from.version) && (0, semver_1.lte)(version, to.version);
17
+ });
15
18
  }
16
19
  }
17
20
  exports.ReleasesFetcher = ReleasesFetcher;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "npm-update-package",
3
- "version": "0.41.0",
3
+ "version": "0.41.3",
4
4
  "description": "CLI tool for creating pull requests to update npm packages",
5
5
  "scripts": {
6
6
  "build": "tsc --project tsconfig.build.json",