npm-update-package 1.4.31 → 1.5.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
@@ -21,6 +21,7 @@ CLI tool for creating pull requests to update npm packages
21
21
  - [`--assignees-sample-size`](#--assignees-sample-size)
22
22
  - [`--commit-message`](#--commit-message)
23
23
  - [`--dependency-types`](#--dependency-types)
24
+ - [`--draft-pr`](#--draft-pr)
24
25
  - [`--fetch-release-notes`](#--fetch-release-notes)
25
26
  - [`--fetch-sleep-time`](#--fetch-sleep-time)
26
27
  - [`--git-user-email`](#--git-user-email)
@@ -181,6 +182,24 @@ npx npm-update-package \
181
182
  --dependency-types dependencies devDependencies
182
183
  ```
183
184
 
185
+ ### `--draft-pr`
186
+
187
+ Whether to create pull request as draft.
188
+
189
+ |Name|Value|
190
+ |---|---|
191
+ |type|boolean|
192
+ |required|-|
193
+ |default|`false`|
194
+
195
+ Example:
196
+
197
+ ```sh
198
+ npx npm-update-package \
199
+ --github-token <github-token> \
200
+ --draft-pr true
201
+ ```
202
+
184
203
  ### `--fetch-release-notes`
185
204
 
186
205
  Whether to fetch release notes.
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "npm-update-package",
3
- "version": "1.4.31",
3
+ "version": "1.5.0",
4
4
  "description": "CLI tool for creating pull requests to update npm packages",
5
5
  "scripts": {
6
6
  "build": "tsc --project tsconfig.build.json",
@@ -37,7 +37,7 @@
37
37
  "@types/node": "14.18.32",
38
38
  "@types/node-fetch": "2.6.2",
39
39
  "@types/parse-github-url": "1.0.0",
40
- "@types/semver": "7.3.12",
40
+ "@types/semver": "7.3.13",
41
41
  "@typescript-eslint/eslint-plugin": "5.41.0",
42
42
  "eslint": "8.26.0",
43
43
  "eslint-config-standard-with-typescript": "23.0.0",
@@ -39,14 +39,15 @@ class GitHub {
39
39
  color
40
40
  });
41
41
  }
42
- async createPullRequest({ owner, repo, baseBranch, headBranch, title, body }) {
42
+ async createPullRequest({ owner, repo, baseBranch, headBranch, title, body, draft }) {
43
43
  const { data } = await this.octokit.pulls.create({
44
44
  owner,
45
45
  repo,
46
46
  base: baseBranch,
47
47
  head: headBranch,
48
48
  title,
49
- body
49
+ body,
50
+ draft
50
51
  });
51
52
  return data;
52
53
  }
@@ -25,7 +25,8 @@ class PullRequestCreator {
25
25
  baseBranch: this.githubRepo.default_branch,
26
26
  headBranch: branchName,
27
27
  title,
28
- body
28
+ body,
29
+ draft: this.options.draftPr
29
30
  });
30
31
  logger_1.logger.debug(`pullRequest=${JSON.stringify(pullRequest)}`);
31
32
  await this.labelsAdder.add(pullRequest.number);
@@ -16,6 +16,7 @@ const Options = (0, io_ts_1.intersection)([
16
16
  (0, io_ts_1.literal)(package_json_1.DependencyType.BundledDependencies),
17
17
  (0, io_ts_1.literal)(package_json_1.DependencyType.OptionalDependencies)
18
18
  ])),
19
+ draftPr: io_ts_1.boolean,
19
20
  fetchReleaseNotes: io_ts_1.boolean,
20
21
  fetchSleepTime: io_ts_1.number,
21
22
  githubToken: io_ts_1.string,
@@ -52,6 +52,13 @@ exports.cliOptions = [
52
52
  package_json_1.DependencyType.OptionalDependencies
53
53
  ]
54
54
  },
55
+ {
56
+ name: 'draft-pr',
57
+ description: 'Whether to create pull request as draft',
58
+ type: OptionType_1.OptionType.Boolean,
59
+ required: false,
60
+ default: false
61
+ },
55
62
  {
56
63
  name: 'fetch-release-notes',
57
64
  description: 'Whether to fetch release notes',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "npm-update-package",
3
- "version": "1.4.31",
3
+ "version": "1.5.0",
4
4
  "description": "CLI tool for creating pull requests to update npm packages",
5
5
  "scripts": {
6
6
  "build": "tsc --project tsconfig.build.json",
@@ -37,7 +37,7 @@
37
37
  "@types/node": "14.18.32",
38
38
  "@types/node-fetch": "2.6.2",
39
39
  "@types/parse-github-url": "1.0.0",
40
- "@types/semver": "7.3.12",
40
+ "@types/semver": "7.3.13",
41
41
  "@typescript-eslint/eslint-plugin": "5.41.0",
42
42
  "eslint": "8.26.0",
43
43
  "eslint-config-standard-with-typescript": "23.0.0",