npm-update-package 0.45.7 → 0.45.10
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
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
[](https://badge.fury.io/js/npm-update-package)
|
|
2
2
|
[](https://standardjs.com)
|
|
3
|
+

|
|
4
|
+

|
|
5
|
+

|
|
6
|
+

|
|
3
7
|
|
|
4
8
|
# npm-update-package
|
|
5
9
|
|
|
@@ -18,86 +22,174 @@ Some options can embed variables like `{{packageName}}`(HTML-escaped) or `{{{pac
|
|
|
18
22
|
|
|
19
23
|
### `--commit-message`
|
|
20
24
|
|
|
21
|
-
Commit message template
|
|
25
|
+
Commit message template.
|
|
22
26
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
27
|
+
|Name|Value|
|
|
28
|
+
|---|---|
|
|
29
|
+
|type|string|
|
|
30
|
+
|required|false|
|
|
31
|
+
|default|`chore(deps): {{{level}}} update {{{packageName}}} to v{{{newVersion}}}`|
|
|
32
|
+
|
|
33
|
+
#### Available variables
|
|
34
|
+
|
|
35
|
+
|Variable|Description|
|
|
36
|
+
|---|---|
|
|
37
|
+
|`currentVersion`|Current package version|
|
|
38
|
+
|`newVersion`|New package version|
|
|
39
|
+
|`packageName`|Package name|
|
|
40
|
+
|`level`|Semver level (`major`/`minor`/`patch`)|
|
|
41
|
+
|`dependencyType`|Dependency type (`dependencies`/`devDependencies`/`peerDependencies`/`optionalDependencies`)|
|
|
42
|
+
|
|
43
|
+
#### Example
|
|
44
|
+
|
|
45
|
+
```sh
|
|
46
|
+
npx npm-update-package \
|
|
47
|
+
--github-token $GITHUB_TOKEN \
|
|
48
|
+
--commit-message "chore(deps): {{{level}}} update {{{packageName}}} to v{{{newVersion}}}"
|
|
49
|
+
```
|
|
32
50
|
|
|
33
51
|
### `--github-token`
|
|
34
52
|
|
|
35
|
-
[GitHub token](#github-token)
|
|
53
|
+
[GitHub token](#github-token).
|
|
36
54
|
|
|
37
|
-
|
|
38
|
-
|
|
55
|
+
|Name|Value|
|
|
56
|
+
|---|---|
|
|
57
|
+
|type|string|
|
|
58
|
+
|required|true|
|
|
39
59
|
|
|
40
60
|
### `--ignore-packages`
|
|
41
61
|
|
|
42
|
-
Package names to ignore
|
|
62
|
+
Package names to ignore.
|
|
63
|
+
|
|
64
|
+
|Name|Value|
|
|
65
|
+
|---|---|
|
|
66
|
+
|type|string[]|
|
|
67
|
+
|required|false|
|
|
43
68
|
|
|
44
|
-
|
|
45
|
-
|
|
69
|
+
#### Example
|
|
70
|
+
|
|
71
|
+
```sh
|
|
72
|
+
npx npm-update-package \
|
|
73
|
+
--github-token $GITHUB_TOKEN \
|
|
74
|
+
--ignore-packages @types/jest jest
|
|
75
|
+
```
|
|
46
76
|
|
|
47
77
|
### `--log-level`
|
|
48
78
|
|
|
49
|
-
Log level to show
|
|
79
|
+
Log level to show.
|
|
80
|
+
|
|
81
|
+
|Name|Value|
|
|
82
|
+
|---|---|
|
|
83
|
+
|type|string|
|
|
84
|
+
|required|false|
|
|
85
|
+
|default|`info`|
|
|
86
|
+
|
|
87
|
+
#### Allowed values
|
|
50
88
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
89
|
+
|Value|Description|
|
|
90
|
+
|---|---|
|
|
91
|
+
|`off`|Do not output any logs.|
|
|
92
|
+
|`fatal`|Output fatal logs.|
|
|
93
|
+
|`error`|Output fatal/error logs.|
|
|
94
|
+
|`warn`|Output fatal/error/warn logs.|
|
|
95
|
+
|`info`|Output fatal/error/warn/info logs.|
|
|
96
|
+
|`debug`|Output fatal/error/warn/info/debug logs.|
|
|
97
|
+
|`trace`|Output fatal/error/warn/info/debug/trace logs.|
|
|
98
|
+
|
|
99
|
+
#### Example
|
|
100
|
+
|
|
101
|
+
```sh
|
|
102
|
+
npx npm-update-package \
|
|
103
|
+
--github-token $GITHUB_TOKEN \
|
|
104
|
+
--log-level info
|
|
105
|
+
```
|
|
62
106
|
|
|
63
107
|
### `--package-manager`
|
|
64
108
|
|
|
65
|
-
Package manager of your project
|
|
109
|
+
Package manager of your project.
|
|
110
|
+
|
|
111
|
+
|Name|Value|
|
|
112
|
+
|---|---|
|
|
113
|
+
|type|string|
|
|
114
|
+
|required|false|
|
|
115
|
+
|default|`npm`|
|
|
116
|
+
|
|
117
|
+
#### Allowed values
|
|
66
118
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
119
|
+
|Value|Description|
|
|
120
|
+
|---|---|
|
|
121
|
+
|`npm`|npm|
|
|
122
|
+
|`yarn`|Yarn|
|
|
123
|
+
|
|
124
|
+
#### Example
|
|
125
|
+
|
|
126
|
+
```sh
|
|
127
|
+
npx npm-update-package \
|
|
128
|
+
--github-token $GITHUB_TOKEN \
|
|
129
|
+
--package-manager npm
|
|
130
|
+
```
|
|
73
131
|
|
|
74
132
|
### `--pr-body-notes`
|
|
75
133
|
|
|
76
|
-
Additional notes for Pull request body
|
|
134
|
+
Additional notes for Pull request body.
|
|
135
|
+
|
|
136
|
+
|Name|Value|
|
|
137
|
+
|---|---|
|
|
138
|
+
|type|string|
|
|
139
|
+
|required|false|
|
|
77
140
|
|
|
78
|
-
|
|
79
|
-
|
|
141
|
+
#### Example
|
|
142
|
+
|
|
143
|
+
```sh
|
|
144
|
+
npx npm-update-package \
|
|
145
|
+
--github-token $GITHUB_TOKEN \
|
|
146
|
+
--pr-body-notes "**:warning: Please see diff and release notes before merging.**"
|
|
147
|
+
```
|
|
80
148
|
|
|
81
149
|
### `--pr-title`
|
|
82
150
|
|
|
83
|
-
Pull request title template
|
|
151
|
+
Pull request title template.
|
|
152
|
+
|
|
153
|
+
|Name|Value|
|
|
154
|
+
|---|---|
|
|
155
|
+
|type|string|
|
|
156
|
+
|required|false|
|
|
157
|
+
|default|`chore(deps): {{{level}}} update {{{packageName}}} to v{{{newVersion}}}`|
|
|
84
158
|
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
159
|
+
#### Available variables
|
|
160
|
+
|
|
161
|
+
|Variable|Description|
|
|
162
|
+
|---|---|
|
|
163
|
+
|`currentVersion`|Current package version|
|
|
164
|
+
|`newVersion`|New package version|
|
|
165
|
+
|`packageName`|Package name|
|
|
166
|
+
|`level`|Semver level (`major`/`minor`/`patch`)|
|
|
167
|
+
|`dependencyType`|Dependency type (`dependencies`/`devDependencies`/`peerDependencies`/`optionalDependencies`)|
|
|
168
|
+
|
|
169
|
+
#### Example
|
|
170
|
+
|
|
171
|
+
```sh
|
|
172
|
+
npx npm-update-package \
|
|
173
|
+
--github-token $GITHUB_TOKEN \
|
|
174
|
+
--pr-title "chore(deps): {{{level}}} update {{{packageName}}} to v{{{newVersion}}}"
|
|
175
|
+
```
|
|
94
176
|
|
|
95
177
|
### `--reviewers`
|
|
96
178
|
|
|
97
|
-
User names to request reviews
|
|
179
|
+
User names to request reviews.
|
|
98
180
|
|
|
99
|
-
|
|
100
|
-
|
|
181
|
+
|Name|Value|
|
|
182
|
+
|---|---|
|
|
183
|
+
|type|string[]|
|
|
184
|
+
|required|false|
|
|
185
|
+
|
|
186
|
+
#### Example
|
|
187
|
+
|
|
188
|
+
```sh
|
|
189
|
+
npx npm-update-package \
|
|
190
|
+
--github-token $GITHUB_TOKEN \
|
|
191
|
+
--reviewers npm-update-package npm-update-package-bot
|
|
192
|
+
```
|
|
101
193
|
|
|
102
194
|
## GitHub token
|
|
103
195
|
|
package/dist/package.json
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "npm-update-package",
|
|
3
|
-
"version": "0.45.
|
|
3
|
+
"version": "0.45.10",
|
|
4
4
|
"description": "CLI tool for creating pull requests to update npm packages",
|
|
5
5
|
"scripts": {
|
|
6
|
+
"badges": "jest-coverage-badges output docs",
|
|
6
7
|
"build": "tsc --project tsconfig.build.json",
|
|
7
8
|
"clean": "rimraf dist",
|
|
8
9
|
"lint": "eslint '**/*.{js,ts}'",
|
|
10
|
+
"prebadges": "npm test",
|
|
9
11
|
"prebuild": "npm run clean",
|
|
10
12
|
"prepare": "husky install",
|
|
11
13
|
"prepublish": "npm-run-all lint test build",
|
|
@@ -50,6 +52,7 @@
|
|
|
50
52
|
"eslint-plugin-tsdoc": "0.2.14",
|
|
51
53
|
"husky": "7.0.4",
|
|
52
54
|
"jest": "27.4.7",
|
|
55
|
+
"jest-coverage-badges": "1.1.2",
|
|
53
56
|
"lint-staged": "12.3.5",
|
|
54
57
|
"npm-run-all": "4.1.5",
|
|
55
58
|
"rimraf": "3.0.2",
|
|
@@ -9,6 +9,7 @@ const file_1 = require("../../../file");
|
|
|
9
9
|
const json_1 = require("../../../json");
|
|
10
10
|
const package_json_2 = require("../../../package-json");
|
|
11
11
|
const metadata_1 = require("../metadata");
|
|
12
|
+
const optimizeGitHubUrl_1 = require("./optimizeGitHubUrl");
|
|
12
13
|
class PullRequestBodyCreator {
|
|
13
14
|
constructor({ options, releasesFetcher }) {
|
|
14
15
|
this.options = options;
|
|
@@ -74,7 +75,10 @@ ${this.options.prBodyNotes}`;
|
|
|
74
75
|
if (releases.length === 0) {
|
|
75
76
|
return undefined;
|
|
76
77
|
}
|
|
77
|
-
const items = releases.map(({ tag, url }) =>
|
|
78
|
+
const items = releases.map(({ tag, url }) => {
|
|
79
|
+
const optimizedUrl = (0, optimizeGitHubUrl_1.optimizeGitHubUrl)(url);
|
|
80
|
+
return `- [${tag}](${optimizedUrl})`;
|
|
81
|
+
});
|
|
78
82
|
return `## Release notes
|
|
79
83
|
|
|
80
84
|
${items.join('\n')}`;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.optimizeGitHubUrl = void 0;
|
|
4
|
+
const url_1 = require("url");
|
|
5
|
+
/**
|
|
6
|
+
* Convert URL to prevent linking to other repositories.
|
|
7
|
+
*/
|
|
8
|
+
const optimizeGitHubUrl = (url) => {
|
|
9
|
+
const newUrl = new url_1.URL(url);
|
|
10
|
+
if (newUrl.host === 'github.com') {
|
|
11
|
+
newUrl.host = 'togithub.com';
|
|
12
|
+
}
|
|
13
|
+
return newUrl.toString();
|
|
14
|
+
};
|
|
15
|
+
exports.optimizeGitHubUrl = optimizeGitHubUrl;
|
package/package.json
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "npm-update-package",
|
|
3
|
-
"version": "0.45.
|
|
3
|
+
"version": "0.45.10",
|
|
4
4
|
"description": "CLI tool for creating pull requests to update npm packages",
|
|
5
5
|
"scripts": {
|
|
6
|
+
"badges": "jest-coverage-badges output docs",
|
|
6
7
|
"build": "tsc --project tsconfig.build.json",
|
|
7
8
|
"clean": "rimraf dist",
|
|
8
9
|
"lint": "eslint '**/*.{js,ts}'",
|
|
10
|
+
"prebadges": "npm test",
|
|
9
11
|
"prebuild": "npm run clean",
|
|
10
12
|
"prepare": "husky install",
|
|
11
13
|
"prepublish": "npm-run-all lint test build",
|
|
@@ -50,6 +52,7 @@
|
|
|
50
52
|
"eslint-plugin-tsdoc": "0.2.14",
|
|
51
53
|
"husky": "7.0.4",
|
|
52
54
|
"jest": "27.4.7",
|
|
55
|
+
"jest-coverage-badges": "1.1.2",
|
|
53
56
|
"lint-staged": "12.3.5",
|
|
54
57
|
"npm-run-all": "4.1.5",
|
|
55
58
|
"rimraf": "3.0.2",
|