npm-update-package 2.0.0 → 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/dist/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "npm-update-package",
|
|
3
|
-
"version": "2.0.
|
|
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",
|
|
@@ -32,17 +32,15 @@
|
|
|
32
32
|
"type-guards": "0.15.0"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
|
-
"@npm-update-package/eslint-config-typescript": "
|
|
35
|
+
"@npm-update-package/eslint-config-typescript": "2.0.0",
|
|
36
36
|
"@tsconfig/node16": "1.0.3",
|
|
37
37
|
"@types/mustache": "4.2.2",
|
|
38
38
|
"@types/node": "16.18.25",
|
|
39
39
|
"@types/node-fetch": "2.6.3",
|
|
40
40
|
"@types/parse-github-url": "1.0.0",
|
|
41
41
|
"@types/semver": "7.3.13",
|
|
42
|
-
"@typescript-eslint/eslint-plugin": "5.59.1",
|
|
43
42
|
"eslint": "8.39.0",
|
|
44
43
|
"eslint-plugin-jest": "27.2.1",
|
|
45
|
-
"eslint-plugin-sonarjs": "0.19.0",
|
|
46
44
|
"jest": "29.5.0",
|
|
47
45
|
"npm-run-all": "4.1.5",
|
|
48
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
|
|
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
|
|
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
|
|
7
|
+
const node_fs_1 = __importDefault(require("node:fs"));
|
|
8
8
|
const readFile = async (path) => {
|
|
9
|
-
return await
|
|
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
|
|
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
|
|
47
|
+
url: new node_url_1.URL(`https://${host}/${owner}/${name}`),
|
|
48
48
|
owner,
|
|
49
49
|
name,
|
|
50
50
|
isGitHub: host === HOST_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
|
|
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
|
|
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": "2.0.
|
|
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",
|
|
@@ -32,17 +32,15 @@
|
|
|
32
32
|
"type-guards": "0.15.0"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
|
-
"@npm-update-package/eslint-config-typescript": "
|
|
35
|
+
"@npm-update-package/eslint-config-typescript": "2.0.0",
|
|
36
36
|
"@tsconfig/node16": "1.0.3",
|
|
37
37
|
"@types/mustache": "4.2.2",
|
|
38
38
|
"@types/node": "16.18.25",
|
|
39
39
|
"@types/node-fetch": "2.6.3",
|
|
40
40
|
"@types/parse-github-url": "1.0.0",
|
|
41
41
|
"@types/semver": "7.3.13",
|
|
42
|
-
"@typescript-eslint/eslint-plugin": "5.59.1",
|
|
43
42
|
"eslint": "8.39.0",
|
|
44
43
|
"eslint-plugin-jest": "27.2.1",
|
|
45
|
-
"eslint-plugin-sonarjs": "0.19.0",
|
|
46
44
|
"jest": "29.5.0",
|
|
47
45
|
"npm-run-all": "4.1.5",
|
|
48
46
|
"rimraf": "5.0.0",
|