npm-update-package 0.28.0 → 0.29.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 +11 -6
- package/dist/app.js +1 -1
- package/dist/github/label/creator/LabelCreator.js +18 -9
- package/dist/logger/LogLevel.js +2 -1
- package/dist/options/Options.js +12 -2
- package/dist/options/cliOptions.js +1 -0
- package/package.json +5 -5
package/README.md
CHANGED
|
@@ -46,8 +46,9 @@ Log level to show
|
|
|
46
46
|
- `off`: Do not output any logs.
|
|
47
47
|
- `fatal`: Output fatal logs.
|
|
48
48
|
- `error`: Output fatal/error logs.
|
|
49
|
-
- `
|
|
50
|
-
- `
|
|
49
|
+
- `warn`: Output fatal/error/warn logs.
|
|
50
|
+
- `info`: Output fatal/error/warn/info logs.
|
|
51
|
+
- `debug`: Output fatal/error/warn/info/debug logs.
|
|
51
52
|
- default: `info`
|
|
52
53
|
|
|
53
54
|
### `--package-manager`
|
|
@@ -240,18 +241,22 @@ endif
|
|
|
240
241
|
|
|
241
242
|
:Fetch remote branches;
|
|
242
243
|
:Fetch pull requests;
|
|
243
|
-
|
|
244
|
+
|
|
245
|
+
if (Label does not exist) then (yes)
|
|
246
|
+
:Create label;
|
|
247
|
+
else (no)
|
|
248
|
+
endif
|
|
244
249
|
|
|
245
250
|
group OutdatedPackagesProcessor
|
|
246
251
|
while (Package exists) is (yes)
|
|
247
252
|
group OutdatedPackageProcessor
|
|
248
|
-
if (Remote branch
|
|
249
|
-
else (no)
|
|
253
|
+
if (Remote branch does not exist) then (yes)
|
|
250
254
|
:Create branch;
|
|
251
255
|
:Update package;
|
|
252
256
|
:Create pull request;
|
|
253
257
|
:Close old pull requests;
|
|
254
258
|
:Remove branch;
|
|
259
|
+
else (no)
|
|
255
260
|
endif
|
|
256
261
|
end group
|
|
257
262
|
endwhile (no)
|
|
@@ -264,7 +269,7 @@ end
|
|
|
264
269
|
```
|
|
265
270
|
-->
|
|
266
271
|
|
|
267
|
-
[](http://www.plantuml.com/plantuml/uml/VL1BJiCm4DtFATuoMVG2pQO82JP8L4WSm4scJSGa3fundzjJrqsJ5iJ6dtbFypuRDHSizaAd1ns2ZoDwrmsqVcI3ZzOuumQZgz_SWRKYwlOexaGk8xZ0YEFA_2fnIrZB0uflrf807XfYKKOn-9AElsvFj7vWgri4xhqnTi4DTSjQJVCnYY3mUsIrIV79xLZGU5OCti1VdTgDrFe-i3E696hrMpM7Upv7sfxjRuElMTK7-cmxOHHd84jeYKul2dzkc1S0oUdBCjN_ZcVFcLtbsUkOzay5LrV4PJSJ8buPNfgRuZAQx7mi1UPUW5Cp-SxXKbUd7ZA3Pe2kEBGv7h6N7m00)
|
|
268
273
|
|
|
269
274
|
## FAQ
|
|
270
275
|
|
package/dist/app.js
CHANGED
|
@@ -10,8 +10,23 @@ class LabelCreator {
|
|
|
10
10
|
this.logger = logger;
|
|
11
11
|
}
|
|
12
12
|
async create({ name, description, color }) {
|
|
13
|
+
const label = await this.fetchLabel(name);
|
|
14
|
+
if (label !== undefined) {
|
|
15
|
+
this.logger.info(`Skip creating ${name} label because it already exists.`);
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
await this.github.createLabel({
|
|
19
|
+
owner: this.gitRepo.owner,
|
|
20
|
+
repo: this.gitRepo.name,
|
|
21
|
+
name,
|
|
22
|
+
description,
|
|
23
|
+
color
|
|
24
|
+
});
|
|
25
|
+
this.logger.info(`${name} label has created.`);
|
|
26
|
+
}
|
|
27
|
+
async fetchLabel(name) {
|
|
13
28
|
try {
|
|
14
|
-
await this.github.fetchLabel({
|
|
29
|
+
return await this.github.fetchLabel({
|
|
15
30
|
owner: this.gitRepo.owner,
|
|
16
31
|
repo: this.gitRepo.name,
|
|
17
32
|
name
|
|
@@ -19,14 +34,8 @@ class LabelCreator {
|
|
|
19
34
|
}
|
|
20
35
|
catch (e) {
|
|
21
36
|
if ((0, errors_1.isNotFoundError)(e)) {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
repo: this.gitRepo.name,
|
|
25
|
-
name,
|
|
26
|
-
description,
|
|
27
|
-
color
|
|
28
|
-
});
|
|
29
|
-
this.logger.info(`${name} label has created.`);
|
|
37
|
+
this.logger.warn(e);
|
|
38
|
+
return undefined;
|
|
30
39
|
}
|
|
31
40
|
else {
|
|
32
41
|
throw e;
|
package/dist/logger/LogLevel.js
CHANGED
package/dist/options/Options.js
CHANGED
|
@@ -8,8 +8,18 @@ const Options = (0, io_ts_1.intersection)([
|
|
|
8
8
|
(0, io_ts_1.type)({
|
|
9
9
|
commitMessage: io_ts_1.string,
|
|
10
10
|
githubToken: io_ts_1.string,
|
|
11
|
-
logLevel: (0, io_ts_1.union)([
|
|
12
|
-
|
|
11
|
+
logLevel: (0, io_ts_1.union)([
|
|
12
|
+
(0, io_ts_1.literal)(logger_1.LogLevel.Off),
|
|
13
|
+
(0, io_ts_1.literal)(logger_1.LogLevel.Fatal),
|
|
14
|
+
(0, io_ts_1.literal)(logger_1.LogLevel.Error),
|
|
15
|
+
(0, io_ts_1.literal)(logger_1.LogLevel.Warn),
|
|
16
|
+
(0, io_ts_1.literal)(logger_1.LogLevel.Info),
|
|
17
|
+
(0, io_ts_1.literal)(logger_1.LogLevel.Debug)
|
|
18
|
+
]),
|
|
19
|
+
packageManager: (0, io_ts_1.union)([
|
|
20
|
+
(0, io_ts_1.literal)(package_manager_1.PackageManagerName.Npm),
|
|
21
|
+
(0, io_ts_1.literal)(package_manager_1.PackageManagerName.Yarn)
|
|
22
|
+
]),
|
|
13
23
|
pullRequestTitle: io_ts_1.string
|
|
14
24
|
}),
|
|
15
25
|
(0, io_ts_1.partial)({
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "npm-update-package",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.29.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",
|
|
@@ -23,9 +23,9 @@
|
|
|
23
23
|
"fp-ts": "2.11.8",
|
|
24
24
|
"http-status-codes": "2.2.0",
|
|
25
25
|
"io-ts": "2.2.16",
|
|
26
|
-
"log4js": "6.4.
|
|
26
|
+
"log4js": "6.4.1",
|
|
27
27
|
"mustache": "4.1.0",
|
|
28
|
-
"npm-check-updates": "12.2.
|
|
28
|
+
"npm-check-updates": "12.2.1",
|
|
29
29
|
"parse-github-url": "1.0.2",
|
|
30
30
|
"semver": "7.3.5",
|
|
31
31
|
"type-guards": "0.15.0"
|
|
@@ -42,13 +42,13 @@
|
|
|
42
42
|
"eslint": "8.7.0",
|
|
43
43
|
"eslint-config-standard-with-typescript": "21.0.1",
|
|
44
44
|
"eslint-plugin-import": "2.25.4",
|
|
45
|
-
"eslint-plugin-jest": "
|
|
45
|
+
"eslint-plugin-jest": "26.0.0",
|
|
46
46
|
"eslint-plugin-node": "11.1.0",
|
|
47
47
|
"eslint-plugin-promise": "6.0.0",
|
|
48
48
|
"eslint-plugin-tsdoc": "0.2.14",
|
|
49
49
|
"husky": "7.0.4",
|
|
50
50
|
"jest": "27.4.7",
|
|
51
|
-
"lint-staged": "12.
|
|
51
|
+
"lint-staged": "12.3.1",
|
|
52
52
|
"npm-run-all": "4.1.5",
|
|
53
53
|
"rimraf": "3.0.2",
|
|
54
54
|
"ts-jest": "27.1.3",
|