npm-update-package 1.5.24 → 2.0.1

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
@@ -52,7 +52,7 @@ CLI tool for creating pull requests to update npm packages
52
52
  ## Requirements
53
53
 
54
54
  - Git
55
- - Node.js v14 or later
55
+ - Node.js v16 or later
56
56
  - npm or Yarn
57
57
 
58
58
  ## Supported platforms
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "npm-update-package",
3
- "version": "1.5.24",
3
+ "version": "2.0.1",
4
4
  "description": "CLI tool for creating pull requests to update npm packages",
5
5
  "scripts": {
6
6
  "build": "tsc --project tsconfig.build.json",
@@ -13,14 +13,14 @@
13
13
  },
14
14
  "bin": "dist/src/bin/npm-update-package.js",
15
15
  "engines": {
16
- "node": ">=14"
16
+ "node": ">=16"
17
17
  },
18
18
  "dependencies": {
19
19
  "@octokit/rest": "19.0.7",
20
20
  "array-shuffle": "2.0.0",
21
- "commander": "10.0.0",
21
+ "commander": "10.0.1",
22
22
  "execa": "5.1.1",
23
- "fp-ts": "2.13.1",
23
+ "fp-ts": "2.14.0",
24
24
  "http-status-codes": "2.2.0",
25
25
  "io-ts": "2.2.20",
26
26
  "log4js": "6.9.1",
@@ -32,27 +32,15 @@
32
32
  "type-guards": "0.15.0"
33
33
  },
34
34
  "devDependencies": {
35
- "@eslint-recommended/eslint-config-typescript": "12.0.0",
36
- "@npm-update-package/eslint-config-typescript": "1.0.1",
37
- "@tsconfig/node14": "1.0.3",
35
+ "@npm-update-package/eslint-config-typescript": "2.0.0",
36
+ "@tsconfig/node16": "1.0.3",
38
37
  "@types/mustache": "4.2.2",
39
- "@types/node": "14.18.34",
38
+ "@types/node": "16.18.25",
40
39
  "@types/node-fetch": "2.6.3",
41
40
  "@types/parse-github-url": "1.0.0",
42
41
  "@types/semver": "7.3.13",
43
- "@typescript-eslint/eslint-plugin": "5.58.0",
44
- "eslint": "8.38.0",
45
- "eslint-config-standard-with-typescript": "34.0.1",
46
- "eslint-plugin-eslint-comments": "3.2.0",
47
- "eslint-plugin-import": "2.27.5",
48
- "eslint-plugin-import-newlines": "1.3.1",
42
+ "eslint": "8.39.0",
49
43
  "eslint-plugin-jest": "27.2.1",
50
- "eslint-plugin-jsdoc": "41.1.1",
51
- "eslint-plugin-n": "15.7.0",
52
- "eslint-plugin-promise": "6.1.1",
53
- "eslint-plugin-sonarjs": "0.19.0",
54
- "eslint-plugin-tsdoc": "0.2.17",
55
- "eslint-plugin-unicorn": "45.0.2",
56
44
  "jest": "29.5.0",
57
45
  "npm-run-all": "4.1.5",
58
46
  "rimraf": "5.0.0",
@@ -4,11 +4,11 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.canReadWrite = void 0;
7
- const fs_1 = __importDefault(require("fs"));
7
+ const node_fs_1 = __importDefault(require("node:fs"));
8
8
  // TODO: Add test
9
9
  const canReadWrite = async (path) => {
10
10
  try {
11
- await fs_1.default.promises.access(path, fs_1.default.constants.R_OK | fs_1.default.constants.W_OK);
11
+ await node_fs_1.default.promises.access(path, node_fs_1.default.constants.R_OK | node_fs_1.default.constants.W_OK);
12
12
  }
13
13
  catch {
14
14
  return false;
@@ -4,8 +4,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.readFile = void 0;
7
- const fs_1 = __importDefault(require("fs"));
7
+ const node_fs_1 = __importDefault(require("node:fs"));
8
8
  const readFile = async (path) => {
9
- return await fs_1.default.promises.readFile(path, 'utf8');
9
+ return await node_fs_1.default.promises.readFile(path, 'utf8');
10
10
  };
11
11
  exports.readFile = readFile;
@@ -4,7 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.GitRepository = void 0;
7
- const url_1 = require("url");
7
+ const node_url_1 = require("node:url");
8
8
  const parse_github_url_1 = __importDefault(require("parse-github-url"));
9
9
  const HOST_GITHUB = 'github.com';
10
10
  class GitRepository {
@@ -44,7 +44,7 @@ class GitRepository {
44
44
  return undefined;
45
45
  }
46
46
  return new GitRepository({
47
- url: new url_1.URL(`https://${host}/${owner}/${name}`),
47
+ url: new node_url_1.URL(`https://${host}/${owner}/${name}`),
48
48
  owner,
49
49
  name,
50
50
  isGitHub: host === HOST_GITHUB
@@ -106,12 +106,14 @@ class GitHub {
106
106
  return data;
107
107
  }
108
108
  async requestReviewers({ owner, repo, pullNumber, reviewers }) {
109
- await this.octokit.pulls.requestReviewers({
110
- owner,
111
- repo,
109
+ // For some reason, some argument types are `never`, so type assertions are used.
110
+ const params = {
111
+ owner: owner,
112
+ repo: repo,
112
113
  pull_number: pullNumber,
113
- reviewers
114
- });
114
+ reviewers: reviewers
115
+ };
116
+ await this.octokit.pulls.requestReviewers(params);
115
117
  }
116
118
  }
117
119
  exports.GitHub = GitHub;
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.GitHubUrlOptimizer = void 0;
4
- const url_1 = require("url");
4
+ const node_url_1 = require("node:url");
5
5
  class GitHubUrlOptimizer {
6
6
  constructor(options) {
7
7
  this.options = options;
@@ -10,7 +10,7 @@ class GitHubUrlOptimizer {
10
10
  * Convert URL to prevent linking to other repositories.
11
11
  */
12
12
  optimize(url) {
13
- const newUrl = url instanceof url_1.URL ? url : new url_1.URL(url);
13
+ const newUrl = url instanceof node_url_1.URL ? url : new node_url_1.URL(url);
14
14
  if (newUrl.host === 'github.com') {
15
15
  newUrl.host = this.options.prBodyGithubHost;
16
16
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "npm-update-package",
3
- "version": "1.5.24",
3
+ "version": "2.0.1",
4
4
  "description": "CLI tool for creating pull requests to update npm packages",
5
5
  "scripts": {
6
6
  "build": "tsc --project tsconfig.build.json",
@@ -13,14 +13,14 @@
13
13
  },
14
14
  "bin": "dist/src/bin/npm-update-package.js",
15
15
  "engines": {
16
- "node": ">=14"
16
+ "node": ">=16"
17
17
  },
18
18
  "dependencies": {
19
19
  "@octokit/rest": "19.0.7",
20
20
  "array-shuffle": "2.0.0",
21
- "commander": "10.0.0",
21
+ "commander": "10.0.1",
22
22
  "execa": "5.1.1",
23
- "fp-ts": "2.13.1",
23
+ "fp-ts": "2.14.0",
24
24
  "http-status-codes": "2.2.0",
25
25
  "io-ts": "2.2.20",
26
26
  "log4js": "6.9.1",
@@ -32,27 +32,15 @@
32
32
  "type-guards": "0.15.0"
33
33
  },
34
34
  "devDependencies": {
35
- "@eslint-recommended/eslint-config-typescript": "12.0.0",
36
- "@npm-update-package/eslint-config-typescript": "1.0.1",
37
- "@tsconfig/node14": "1.0.3",
35
+ "@npm-update-package/eslint-config-typescript": "2.0.0",
36
+ "@tsconfig/node16": "1.0.3",
38
37
  "@types/mustache": "4.2.2",
39
- "@types/node": "14.18.34",
38
+ "@types/node": "16.18.25",
40
39
  "@types/node-fetch": "2.6.3",
41
40
  "@types/parse-github-url": "1.0.0",
42
41
  "@types/semver": "7.3.13",
43
- "@typescript-eslint/eslint-plugin": "5.58.0",
44
- "eslint": "8.38.0",
45
- "eslint-config-standard-with-typescript": "34.0.1",
46
- "eslint-plugin-eslint-comments": "3.2.0",
47
- "eslint-plugin-import": "2.27.5",
48
- "eslint-plugin-import-newlines": "1.3.1",
42
+ "eslint": "8.39.0",
49
43
  "eslint-plugin-jest": "27.2.1",
50
- "eslint-plugin-jsdoc": "41.1.1",
51
- "eslint-plugin-n": "15.7.0",
52
- "eslint-plugin-promise": "6.1.1",
53
- "eslint-plugin-sonarjs": "0.19.0",
54
- "eslint-plugin-tsdoc": "0.2.17",
55
- "eslint-plugin-unicorn": "45.0.2",
56
44
  "jest": "29.5.0",
57
45
  "npm-run-all": "4.1.5",
58
46
  "rimraf": "5.0.0",