npm-update-package 0.12.0 → 0.16.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 +19 -18
- package/dist/app.js +1 -1
- package/dist/git/Git.js +3 -3
- package/dist/logger/LogLevel.js +2 -1
- package/dist/main.js +4 -1
- package/dist/options/Options.js +1 -1
- package/dist/options/initOptions.js +1 -0
- package/package.json +8 -8
package/README.md
CHANGED
|
@@ -5,14 +5,6 @@
|
|
|
5
5
|
|
|
6
6
|
CLI tool for creating pull request to update npm packages
|
|
7
7
|
|
|
8
|
-
## Caution
|
|
9
|
-
|
|
10
|
-
This package is currently under development, so the major version is 0 yet.
|
|
11
|
-
|
|
12
|
-
## Requirements
|
|
13
|
-
|
|
14
|
-
- Git v2.23.0 or higher
|
|
15
|
-
|
|
16
8
|
## Usage
|
|
17
9
|
|
|
18
10
|
```sh
|
|
@@ -57,7 +49,7 @@ Template strings such as `--branch-name` can embed variables like `{{packageName
|
|
|
57
49
|
|
|
58
50
|
Branch name template
|
|
59
51
|
|
|
60
|
-
-
|
|
52
|
+
- type: string
|
|
61
53
|
- variables:
|
|
62
54
|
- `currentVersion`
|
|
63
55
|
- `newVersion`
|
|
@@ -70,7 +62,7 @@ Branch name template
|
|
|
70
62
|
|
|
71
63
|
Commit message template
|
|
72
64
|
|
|
73
|
-
-
|
|
65
|
+
- type: string
|
|
74
66
|
- variables:
|
|
75
67
|
- `currentVersion`
|
|
76
68
|
- `newVersion`
|
|
@@ -83,17 +75,19 @@ Commit message template
|
|
|
83
75
|
|
|
84
76
|
GitHub token
|
|
85
77
|
|
|
86
|
-
-
|
|
78
|
+
- type: string
|
|
87
79
|
- required: true
|
|
88
80
|
|
|
89
81
|
### `--log-level`
|
|
90
82
|
|
|
91
83
|
Log level to show
|
|
92
84
|
|
|
93
|
-
-
|
|
94
|
-
|
|
95
|
-
- `
|
|
96
|
-
- `
|
|
85
|
+
- type: string
|
|
86
|
+
- allowed values:
|
|
87
|
+
- `off`: Do not output any logs.
|
|
88
|
+
- `error`: Output error logs.
|
|
89
|
+
- `info`: Output error/info logs.
|
|
90
|
+
- `debug`: Output error/info/debug logs.
|
|
97
91
|
- required: false
|
|
98
92
|
- default: `info`
|
|
99
93
|
|
|
@@ -101,7 +95,8 @@ Log level to show
|
|
|
101
95
|
|
|
102
96
|
Package manager of your project
|
|
103
97
|
|
|
104
|
-
-
|
|
98
|
+
- type: string
|
|
99
|
+
- allowed values:
|
|
105
100
|
- `npm`
|
|
106
101
|
- `yarn`
|
|
107
102
|
- required: false
|
|
@@ -111,7 +106,7 @@ Package manager of your project
|
|
|
111
106
|
|
|
112
107
|
Pull request body template
|
|
113
108
|
|
|
114
|
-
-
|
|
109
|
+
- type: string
|
|
115
110
|
- variables:
|
|
116
111
|
- `appName`
|
|
117
112
|
- `appVersion`
|
|
@@ -138,7 +133,7 @@ This PR has been generated by [{{{appName}}}]({{{appWeb}}}) v{{appVersion}}
|
|
|
138
133
|
|
|
139
134
|
Pull request title template
|
|
140
135
|
|
|
141
|
-
-
|
|
136
|
+
- type: string
|
|
142
137
|
- variables:
|
|
143
138
|
- `currentVersion`
|
|
144
139
|
- `newVersion`
|
|
@@ -146,3 +141,9 @@ Pull request title template
|
|
|
146
141
|
- `updateType`
|
|
147
142
|
- required: false
|
|
148
143
|
- default: `chore(deps): {{updateType}} update {{{packageName}}} to v{{newVersion}}`
|
|
144
|
+
|
|
145
|
+
## FAQ
|
|
146
|
+
|
|
147
|
+
### Conflicts have occurred in PR. What should I do?
|
|
148
|
+
|
|
149
|
+
If conflicts have occurred in PR, close it and run npm-update-package again.
|
package/dist/app.js
CHANGED
package/dist/git/Git.js
CHANGED
|
@@ -14,7 +14,7 @@ class Git {
|
|
|
14
14
|
await this.terminal.run('git', 'commit', '--message', message);
|
|
15
15
|
}
|
|
16
16
|
async createBranch(branchName) {
|
|
17
|
-
await this.terminal.run('git', '
|
|
17
|
+
await this.terminal.run('git', 'checkout', '-b', branchName);
|
|
18
18
|
}
|
|
19
19
|
async getConfig(key) {
|
|
20
20
|
const { stdout } = await this.terminal.run('git', 'config', key);
|
|
@@ -39,13 +39,13 @@ class Git {
|
|
|
39
39
|
await this.terminal.run('git', 'branch', '-D', branchName);
|
|
40
40
|
}
|
|
41
41
|
async restore(...files) {
|
|
42
|
-
await this.terminal.run('git', '
|
|
42
|
+
await this.terminal.run('git', 'checkout', ...files);
|
|
43
43
|
}
|
|
44
44
|
async setConfig(key, value) {
|
|
45
45
|
await this.terminal.run('git', 'config', key, value);
|
|
46
46
|
}
|
|
47
47
|
async switch(branchName) {
|
|
48
|
-
await this.terminal.run('git', '
|
|
48
|
+
await this.terminal.run('git', 'checkout', branchName);
|
|
49
49
|
}
|
|
50
50
|
}
|
|
51
51
|
exports.Git = Git;
|
package/dist/logger/LogLevel.js
CHANGED
|
@@ -4,7 +4,8 @@ exports.isLogLevel = exports.LogLevel = void 0;
|
|
|
4
4
|
exports.LogLevel = {
|
|
5
5
|
Debug: 'debug',
|
|
6
6
|
Error: 'error',
|
|
7
|
-
Info: 'info'
|
|
7
|
+
Info: 'info',
|
|
8
|
+
Off: 'off'
|
|
8
9
|
};
|
|
9
10
|
const logLevels = Object.values(exports.LogLevel);
|
|
10
11
|
const isLogLevel = (value) => logLevels.includes(value);
|
package/dist/main.js
CHANGED
|
@@ -11,7 +11,10 @@ const processors_1 = require("./processors");
|
|
|
11
11
|
const terminal_1 = require("./terminal");
|
|
12
12
|
// TODO: add test
|
|
13
13
|
const main = async ({ options, logger }) => {
|
|
14
|
-
logger.debug(`options=${JSON.stringify(
|
|
14
|
+
logger.debug(`options=${JSON.stringify({
|
|
15
|
+
...options,
|
|
16
|
+
githubToken: options.githubToken !== '' ? '***' : ''
|
|
17
|
+
})}`);
|
|
15
18
|
const packageJsonParser = new package_json_1.PackageJsonParser(logger);
|
|
16
19
|
const packageJsonReader = new package_json_1.PackageJsonReader({
|
|
17
20
|
packageJsonParser,
|
package/dist/options/Options.js
CHANGED
|
@@ -8,7 +8,7 @@ const Options = (0, io_ts_1.type)({
|
|
|
8
8
|
branchName: io_ts_1.string,
|
|
9
9
|
commitMessage: io_ts_1.string,
|
|
10
10
|
githubToken: io_ts_1.string,
|
|
11
|
-
logLevel: (0, io_ts_1.union)([(0, io_ts_1.literal)(logger_1.LogLevel.Error), (0, io_ts_1.literal)(logger_1.LogLevel.Info), (0, io_ts_1.literal)(logger_1.LogLevel.Debug)]),
|
|
11
|
+
logLevel: (0, io_ts_1.union)([(0, io_ts_1.literal)(logger_1.LogLevel.Off), (0, io_ts_1.literal)(logger_1.LogLevel.Error), (0, io_ts_1.literal)(logger_1.LogLevel.Info), (0, io_ts_1.literal)(logger_1.LogLevel.Debug)]),
|
|
12
12
|
packageManager: (0, io_ts_1.union)([(0, io_ts_1.literal)(package_manager_1.PackageManagerName.Npm), (0, io_ts_1.literal)(package_manager_1.PackageManagerName.Yarn)]),
|
|
13
13
|
pullRequestBody: io_ts_1.string,
|
|
14
14
|
pullRequestTitle: io_ts_1.string
|
|
@@ -15,6 +15,7 @@ const initOptions = () => {
|
|
|
15
15
|
.requiredOption('--github-token <value>', 'GitHub token')
|
|
16
16
|
.addOption(new commander_1.Option('--log-level <value>', 'Log level to show')
|
|
17
17
|
.choices([
|
|
18
|
+
logger_1.LogLevel.Off,
|
|
18
19
|
logger_1.LogLevel.Error,
|
|
19
20
|
logger_1.LogLevel.Info,
|
|
20
21
|
logger_1.LogLevel.Debug
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "npm-update-package",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.16.0",
|
|
4
4
|
"description": "CLI tool for creating pull request to update npm packages",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"build": "tsc --project tsconfig.build.json",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"io-ts": "2.2.16",
|
|
25
25
|
"log4js": "6.3.0",
|
|
26
26
|
"mustache": "4.1.0",
|
|
27
|
-
"npm-check-updates": "12.0.
|
|
27
|
+
"npm-check-updates": "12.0.5",
|
|
28
28
|
"parse-github-url": "1.0.2",
|
|
29
29
|
"semver": "7.3.5"
|
|
30
30
|
},
|
|
@@ -36,22 +36,22 @@
|
|
|
36
36
|
"@types/node": "12.20.15",
|
|
37
37
|
"@types/parse-github-url": "1.0.0",
|
|
38
38
|
"@types/semver": "7.3.9",
|
|
39
|
-
"@typescript-eslint/eslint-plugin": "5.
|
|
40
|
-
"eslint": "8.
|
|
39
|
+
"@typescript-eslint/eslint-plugin": "5.8.0",
|
|
40
|
+
"eslint": "8.5.0",
|
|
41
41
|
"eslint-config-standard-with-typescript": "21.0.1",
|
|
42
42
|
"eslint-plugin-import": "2.25.3",
|
|
43
43
|
"eslint-plugin-jest": "25.3.0",
|
|
44
44
|
"eslint-plugin-node": "11.1.0",
|
|
45
|
-
"eslint-plugin-promise": "
|
|
45
|
+
"eslint-plugin-promise": "6.0.0",
|
|
46
46
|
"eslint-plugin-tsdoc": "0.2.14",
|
|
47
47
|
"husky": "7.0.4",
|
|
48
48
|
"jest": "27.0.6",
|
|
49
|
-
"lint-staged": "12.1.
|
|
49
|
+
"lint-staged": "12.1.4",
|
|
50
50
|
"npm-run-all": "4.1.5",
|
|
51
51
|
"rimraf": "3.0.2",
|
|
52
|
-
"ts-jest": "27.1.
|
|
52
|
+
"ts-jest": "27.1.2",
|
|
53
53
|
"ts-node": "10.4.0",
|
|
54
|
-
"typescript": "4.5.
|
|
54
|
+
"typescript": "4.5.4",
|
|
55
55
|
"utility-types": "3.10.0"
|
|
56
56
|
},
|
|
57
57
|
"repository": {
|