npm-update-package 1.4.9 → 1.4.11
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 +4 -8
- package/dist/src/github/GitHub.js +3 -6
- package/dist/src/github/pull-request/creator/AssigneesAdder.js +2 -5
- package/dist/src/github/pull-request/creator/ReviewersAdder.js +2 -5
- package/dist/src/util/index.js +2 -0
- package/dist/src/util/range.js +9 -0
- package/dist/src/util/sampleSize.js +11 -0
- package/package.json +4 -8
package/dist/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "npm-update-package",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.11",
|
|
4
4
|
"description": "CLI tool for creating pull requests to update npm packages",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"build": "tsc --project tsconfig.build.json",
|
|
@@ -16,12 +16,12 @@
|
|
|
16
16
|
},
|
|
17
17
|
"dependencies": {
|
|
18
18
|
"@octokit/rest": "19.0.4",
|
|
19
|
+
"array-shuffle": "2.0.0",
|
|
19
20
|
"commander": "9.4.0",
|
|
20
21
|
"execa": "5.1.1",
|
|
21
22
|
"fp-ts": "2.12.3",
|
|
22
23
|
"http-status-codes": "2.2.0",
|
|
23
24
|
"io-ts": "2.2.18",
|
|
24
|
-
"lodash": "4.14.2",
|
|
25
25
|
"log4js": "6.6.1",
|
|
26
26
|
"mustache": "4.2.0",
|
|
27
27
|
"node-fetch": "2.6.7",
|
|
@@ -32,26 +32,22 @@
|
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
34
|
"@tsconfig/node14": "1.0.3",
|
|
35
|
-
"@types/lodash": "4.14.185",
|
|
36
35
|
"@types/mustache": "4.2.1",
|
|
37
|
-
"@types/node": "14.18.
|
|
36
|
+
"@types/node": "14.18.31",
|
|
38
37
|
"@types/node-fetch": "2.6.2",
|
|
39
38
|
"@types/parse-github-url": "1.0.0",
|
|
40
39
|
"@types/semver": "7.3.12",
|
|
41
|
-
"@typescript-eslint/eslint-plugin": "5.38.
|
|
40
|
+
"@typescript-eslint/eslint-plugin": "5.38.1",
|
|
42
41
|
"eslint": "8.24.0",
|
|
43
|
-
"eslint-config-lodash": "1.1.0",
|
|
44
42
|
"eslint-config-standard-with-typescript": "23.0.0",
|
|
45
43
|
"eslint-plugin-eslint-comments": "3.2.0",
|
|
46
44
|
"eslint-plugin-import": "2.26.0",
|
|
47
45
|
"eslint-plugin-import-newlines": "1.2.3",
|
|
48
46
|
"eslint-plugin-jest": "27.0.4",
|
|
49
|
-
"eslint-plugin-lodash": "7.4.0",
|
|
50
47
|
"eslint-plugin-n": "15.3.0",
|
|
51
48
|
"eslint-plugin-promise": "6.0.1",
|
|
52
49
|
"eslint-plugin-tsdoc": "0.2.17",
|
|
53
50
|
"eslint-plugin-unicorn": "43.0.2",
|
|
54
|
-
"eslint-plugin-you-dont-need-lodash-underscore": "6.12.0",
|
|
55
51
|
"jest": "29.0.3",
|
|
56
52
|
"npm-run-all": "4.1.5",
|
|
57
53
|
"rimraf": "3.0.2",
|
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
3
|
exports.GitHub = void 0;
|
|
7
|
-
const
|
|
4
|
+
const util_1 = require("../util");
|
|
8
5
|
class GitHub {
|
|
9
6
|
constructor(octokit) {
|
|
10
7
|
this.octokit = octokit;
|
|
@@ -62,7 +59,7 @@ class GitHub {
|
|
|
62
59
|
}
|
|
63
60
|
async fetchBranches({ owner, repo }) {
|
|
64
61
|
const branches = [];
|
|
65
|
-
for (const page of (0,
|
|
62
|
+
for (const page of (0, util_1.range)(1, 11)) {
|
|
66
63
|
const { data } = await this.octokit.repos.listBranches({
|
|
67
64
|
owner,
|
|
68
65
|
repo,
|
|
@@ -86,7 +83,7 @@ class GitHub {
|
|
|
86
83
|
}
|
|
87
84
|
async fetchPullRequests({ owner, repo }) {
|
|
88
85
|
const pullRequests = [];
|
|
89
|
-
for (const page of (0,
|
|
86
|
+
for (const page of (0, util_1.range)(1, 11)) {
|
|
90
87
|
const { data } = await this.octokit.pulls.list({
|
|
91
88
|
owner,
|
|
92
89
|
repo,
|
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
3
|
exports.AssigneesAdder = void 0;
|
|
7
|
-
const
|
|
4
|
+
const util_1 = require("../../../util");
|
|
8
5
|
class AssigneesAdder {
|
|
9
6
|
constructor({ github, gitRepo }) {
|
|
10
7
|
this.github = github;
|
|
@@ -15,7 +12,7 @@ class AssigneesAdder {
|
|
|
15
12
|
owner: this.gitRepo.owner,
|
|
16
13
|
repo: this.gitRepo.name,
|
|
17
14
|
issueNumber,
|
|
18
|
-
assignees: size !== undefined ? (0,
|
|
15
|
+
assignees: size !== undefined ? (0, util_1.sampleSize)(assignees, size) : assignees
|
|
19
16
|
});
|
|
20
17
|
}
|
|
21
18
|
}
|
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
3
|
exports.ReviewersAdder = void 0;
|
|
7
|
-
const
|
|
4
|
+
const util_1 = require("../../../util");
|
|
8
5
|
class ReviewersAdder {
|
|
9
6
|
constructor({ github, gitRepo }) {
|
|
10
7
|
this.github = github;
|
|
@@ -15,7 +12,7 @@ class ReviewersAdder {
|
|
|
15
12
|
owner: this.gitRepo.owner,
|
|
16
13
|
repo: this.gitRepo.name,
|
|
17
14
|
pullNumber,
|
|
18
|
-
reviewers: size !== undefined ? (0,
|
|
15
|
+
reviewers: size !== undefined ? (0, util_1.sampleSize)(reviewers, size) : reviewers
|
|
19
16
|
});
|
|
20
17
|
}
|
|
21
18
|
}
|
package/dist/src/util/index.js
CHANGED
|
@@ -14,4 +14,6 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./range"), exports);
|
|
18
|
+
__exportStar(require("./sampleSize"), exports);
|
|
17
19
|
__exportStar(require("./sleep"), exports);
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.sampleSize = void 0;
|
|
7
|
+
const array_shuffle_1 = __importDefault(require("array-shuffle"));
|
|
8
|
+
const sampleSize = (array, size) => {
|
|
9
|
+
return (0, array_shuffle_1.default)(array).slice(0, size);
|
|
10
|
+
};
|
|
11
|
+
exports.sampleSize = sampleSize;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "npm-update-package",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.11",
|
|
4
4
|
"description": "CLI tool for creating pull requests to update npm packages",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"build": "tsc --project tsconfig.build.json",
|
|
@@ -16,12 +16,12 @@
|
|
|
16
16
|
},
|
|
17
17
|
"dependencies": {
|
|
18
18
|
"@octokit/rest": "19.0.4",
|
|
19
|
+
"array-shuffle": "2.0.0",
|
|
19
20
|
"commander": "9.4.0",
|
|
20
21
|
"execa": "5.1.1",
|
|
21
22
|
"fp-ts": "2.12.3",
|
|
22
23
|
"http-status-codes": "2.2.0",
|
|
23
24
|
"io-ts": "2.2.18",
|
|
24
|
-
"lodash": "4.14.2",
|
|
25
25
|
"log4js": "6.6.1",
|
|
26
26
|
"mustache": "4.2.0",
|
|
27
27
|
"node-fetch": "2.6.7",
|
|
@@ -32,26 +32,22 @@
|
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
34
|
"@tsconfig/node14": "1.0.3",
|
|
35
|
-
"@types/lodash": "4.14.185",
|
|
36
35
|
"@types/mustache": "4.2.1",
|
|
37
|
-
"@types/node": "14.18.
|
|
36
|
+
"@types/node": "14.18.31",
|
|
38
37
|
"@types/node-fetch": "2.6.2",
|
|
39
38
|
"@types/parse-github-url": "1.0.0",
|
|
40
39
|
"@types/semver": "7.3.12",
|
|
41
|
-
"@typescript-eslint/eslint-plugin": "5.38.
|
|
40
|
+
"@typescript-eslint/eslint-plugin": "5.38.1",
|
|
42
41
|
"eslint": "8.24.0",
|
|
43
|
-
"eslint-config-lodash": "1.1.0",
|
|
44
42
|
"eslint-config-standard-with-typescript": "23.0.0",
|
|
45
43
|
"eslint-plugin-eslint-comments": "3.2.0",
|
|
46
44
|
"eslint-plugin-import": "2.26.0",
|
|
47
45
|
"eslint-plugin-import-newlines": "1.2.3",
|
|
48
46
|
"eslint-plugin-jest": "27.0.4",
|
|
49
|
-
"eslint-plugin-lodash": "7.4.0",
|
|
50
47
|
"eslint-plugin-n": "15.3.0",
|
|
51
48
|
"eslint-plugin-promise": "6.0.1",
|
|
52
49
|
"eslint-plugin-tsdoc": "0.2.17",
|
|
53
50
|
"eslint-plugin-unicorn": "43.0.2",
|
|
54
|
-
"eslint-plugin-you-dont-need-lodash-underscore": "6.12.0",
|
|
55
51
|
"jest": "29.0.3",
|
|
56
52
|
"npm-run-all": "4.1.5",
|
|
57
53
|
"rimraf": "3.0.2",
|