npm-update-package 0.23.2 → 0.24.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
@@ -57,7 +57,7 @@ Package manager of your project
57
57
  - required: false
58
58
  - allowed values
59
59
  - `npm`: npm
60
- - `yarn`: Yarn
60
+ - `yarn`: Yarn (**It has not been tested yet.**)
61
61
  - default: `npm`
62
62
 
63
63
  ### `--pull-request-title`
package/dist/app.js CHANGED
@@ -3,6 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.app = void 0;
4
4
  exports.app = {
5
5
  name: 'npm-update-package',
6
- version: '0.23.2',
6
+ version: '0.24.0',
7
7
  web: 'https://github.com/npm-update-package/npm-update-package'
8
8
  };
@@ -20,6 +20,13 @@ class GitHub {
20
20
  const { data } = await this.octokit.pulls.create(params);
21
21
  return data;
22
22
  }
23
+ async deleteBranch({ owner, repo, branch }) {
24
+ await this.octokit.git.deleteRef({
25
+ owner,
26
+ repo,
27
+ ref: `heads/${branch}`
28
+ });
29
+ }
23
30
  // TODO: fetch all branches with page option
24
31
  async fetchBranches(params) {
25
32
  const { data } = await this.octokit.repos.listBranches({
@@ -1,7 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.PullRequestCloser = void 0;
4
- // TODO: Add test
5
4
  class PullRequestCloser {
6
5
  constructor(github) {
7
6
  this.github = github;
@@ -12,6 +11,11 @@ class PullRequestCloser {
12
11
  repo: pullRequest.base.repo.name,
13
12
  pull_number: pullRequest.number
14
13
  });
14
+ await this.github.deleteBranch({
15
+ owner: pullRequest.base.repo.owner.login,
16
+ repo: pullRequest.base.repo.name,
17
+ branch: pullRequest.head.ref
18
+ });
15
19
  }
16
20
  }
17
21
  exports.PullRequestCloser = PullRequestCloser;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "npm-update-package",
3
- "version": "0.23.2",
3
+ "version": "0.24.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": "12.20.40",
38
38
  "@types/parse-github-url": "1.0.0",
39
39
  "@types/semver": "7.3.9",
40
- "@typescript-eslint/eslint-plugin": "5.9.1",
40
+ "@typescript-eslint/eslint-plugin": "5.10.0",
41
41
  "eslint": "8.7.0",
42
42
  "eslint-config-standard-with-typescript": "21.0.1",
43
43
  "eslint-plugin-import": "2.25.4",