npm-update-package 0.24.3 → 0.25.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
|
@@ -60,6 +60,13 @@ Package manager of your project
|
|
|
60
60
|
- `yarn`: Yarn
|
|
61
61
|
- default: `npm`
|
|
62
62
|
|
|
63
|
+
### `--pull-request-reviewers`
|
|
64
|
+
|
|
65
|
+
Reviewers of pull request
|
|
66
|
+
|
|
67
|
+
- type: string[]
|
|
68
|
+
- required: false
|
|
69
|
+
|
|
63
70
|
### `--pull-request-title`
|
|
64
71
|
|
|
65
72
|
Pull request title template
|
package/dist/app.js
CHANGED
package/dist/github/GitHub.js
CHANGED
|
@@ -47,5 +47,13 @@ class GitHub {
|
|
|
47
47
|
const { data } = await this.octokit.repos.get(params);
|
|
48
48
|
return data;
|
|
49
49
|
}
|
|
50
|
+
async requestReviewers({ owner, repo, pullNumber, reviewers }) {
|
|
51
|
+
await this.octokit.pulls.requestReviewers({
|
|
52
|
+
owner,
|
|
53
|
+
repo,
|
|
54
|
+
pull_number: pullNumber,
|
|
55
|
+
reviewers
|
|
56
|
+
});
|
|
57
|
+
}
|
|
50
58
|
}
|
|
51
59
|
exports.GitHub = GitHub;
|
|
@@ -3,12 +3,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.PullRequestCreator = void 0;
|
|
4
4
|
const createPullRequestBody_1 = require("./createPullRequestBody");
|
|
5
5
|
class PullRequestCreator {
|
|
6
|
-
constructor({ github, gitRepo, githubRepo, pullRequestTitleCreator, logger }) {
|
|
6
|
+
constructor({ github, gitRepo, githubRepo, pullRequestTitleCreator, logger, reviewers }) {
|
|
7
7
|
this.github = github;
|
|
8
8
|
this.gitRepo = gitRepo;
|
|
9
9
|
this.githubRepo = githubRepo;
|
|
10
10
|
this.pullRequestTitleCreator = pullRequestTitleCreator;
|
|
11
11
|
this.logger = logger;
|
|
12
|
+
this.reviewers = reviewers;
|
|
12
13
|
}
|
|
13
14
|
async create({ outdatedPackage, branchName }) {
|
|
14
15
|
const title = this.pullRequestTitleCreator.create(outdatedPackage);
|
|
@@ -30,6 +31,14 @@ class PullRequestCreator {
|
|
|
30
31
|
issue_number: pullRequest.number,
|
|
31
32
|
labels: ['npm-update-package']
|
|
32
33
|
});
|
|
34
|
+
if (this.reviewers !== undefined) {
|
|
35
|
+
await this.github.requestReviewers({
|
|
36
|
+
owner: this.gitRepo.owner,
|
|
37
|
+
repo: this.gitRepo.name,
|
|
38
|
+
pullNumber: pullRequest.number,
|
|
39
|
+
reviewers: this.reviewers
|
|
40
|
+
});
|
|
41
|
+
}
|
|
33
42
|
return pullRequest;
|
|
34
43
|
}
|
|
35
44
|
}
|
package/dist/main.js
CHANGED
|
@@ -56,7 +56,8 @@ const main = async ({ options, logger }) => {
|
|
|
56
56
|
gitRepo,
|
|
57
57
|
githubRepo,
|
|
58
58
|
pullRequestTitleCreator,
|
|
59
|
-
logger
|
|
59
|
+
logger,
|
|
60
|
+
reviewers: options.pullRequestReviewers
|
|
60
61
|
});
|
|
61
62
|
const commitMessageCreator = new git_1.CommitMessageCreator(options.commitMessage);
|
|
62
63
|
const pullRequestFinder = new github_1.PullRequestFinder(pullRequests);
|
package/dist/options/Options.js
CHANGED
|
@@ -4,11 +4,16 @@ exports.isOptions = void 0;
|
|
|
4
4
|
const io_ts_1 = require("io-ts");
|
|
5
5
|
const logger_1 = require("../logger");
|
|
6
6
|
const package_manager_1 = require("../package-manager");
|
|
7
|
-
const Options = (0, io_ts_1.
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
7
|
+
const Options = (0, io_ts_1.intersection)([
|
|
8
|
+
(0, io_ts_1.type)({
|
|
9
|
+
commitMessage: io_ts_1.string,
|
|
10
|
+
githubToken: io_ts_1.string,
|
|
11
|
+
logLevel: (0, io_ts_1.union)([(0, io_ts_1.literal)(logger_1.LogLevel.Off), (0, io_ts_1.literal)(logger_1.LogLevel.Error), (0, io_ts_1.literal)(logger_1.LogLevel.Info), (0, io_ts_1.literal)(logger_1.LogLevel.Debug)]),
|
|
12
|
+
packageManager: (0, io_ts_1.union)([(0, io_ts_1.literal)(package_manager_1.PackageManagerName.Npm), (0, io_ts_1.literal)(package_manager_1.PackageManagerName.Yarn)]),
|
|
13
|
+
pullRequestTitle: io_ts_1.string
|
|
14
|
+
}),
|
|
15
|
+
(0, io_ts_1.partial)({
|
|
16
|
+
pullRequestReviewers: (0, io_ts_1.array)(io_ts_1.string)
|
|
17
|
+
})
|
|
18
|
+
]);
|
|
14
19
|
exports.isOptions = Options.is;
|
|
@@ -42,6 +42,12 @@ exports.cliOptions = [
|
|
|
42
42
|
],
|
|
43
43
|
default: package_manager_1.PackageManagerName.Npm
|
|
44
44
|
},
|
|
45
|
+
{
|
|
46
|
+
name: 'pull-request-reviewers',
|
|
47
|
+
description: 'Reviewers of pull request',
|
|
48
|
+
type: OptionType_1.OptionType.StringArray,
|
|
49
|
+
required: false
|
|
50
|
+
},
|
|
45
51
|
{
|
|
46
52
|
name: 'pull-request-title',
|
|
47
53
|
description: 'Pull request title template',
|