npm-update-package 0.45.6 → 0.45.9

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
@@ -18,86 +18,174 @@ Some options can embed variables like `{{packageName}}`(HTML-escaped) or `{{{pac
18
18
 
19
19
  ### `--commit-message`
20
20
 
21
- Commit message template
22
-
23
- - type: string
24
- - required: false
25
- - variables
26
- - `currentVersion`: current package version
27
- - `newVersion`: new package version
28
- - `packageName`: package name
29
- - `level`: semver level (major/minor/patch)
30
- - `dependencyType`: dependency type (dependencies/devDependencies/peerDependencies/optionalDependencies)
31
- - default: `chore(deps): {{{level}}} update {{{packageName}}} to v{{{newVersion}}}`
21
+ Commit message template.
22
+
23
+ |Name|Value|
24
+ |---|---|
25
+ |type|string|
26
+ |required|false|
27
+ |default|`chore(deps): {{{level}}} update {{{packageName}}} to v{{{newVersion}}}`|
28
+
29
+ #### Available variables
30
+
31
+ |Variable|Description|
32
+ |---|---|
33
+ |`currentVersion`|Current package version|
34
+ |`newVersion`|New package version|
35
+ |`packageName`|Package name|
36
+ |`level`|Semver level (`major`/`minor`/`patch`)|
37
+ |`dependencyType`|Dependency type (`dependencies`/`devDependencies`/`peerDependencies`/`optionalDependencies`)|
38
+
39
+ #### Example
40
+
41
+ ```sh
42
+ npx npm-update-package \
43
+ --github-token $GITHUB_TOKEN \
44
+ --commit-message "chore(deps): {{{level}}} update {{{packageName}}} to v{{{newVersion}}}"
45
+ ```
32
46
 
33
47
  ### `--github-token`
34
48
 
35
- [GitHub token](#github-token)
49
+ [GitHub token](#github-token).
36
50
 
37
- - type: string
38
- - required: true
51
+ |Name|Value|
52
+ |---|---|
53
+ |type|string|
54
+ |required|true|
39
55
 
40
56
  ### `--ignore-packages`
41
57
 
42
- Package names to ignore
58
+ Package names to ignore.
59
+
60
+ |Name|Value|
61
+ |---|---|
62
+ |type|string[]|
63
+ |required|false|
43
64
 
44
- - type: string[]
45
- - required: false
65
+ #### Example
66
+
67
+ ```sh
68
+ npx npm-update-package \
69
+ --github-token $GITHUB_TOKEN \
70
+ --ignore-packages @types/jest jest
71
+ ```
46
72
 
47
73
  ### `--log-level`
48
74
 
49
- Log level to show
75
+ Log level to show.
76
+
77
+ |Name|Value|
78
+ |---|---|
79
+ |type|string|
80
+ |required|false|
81
+ |default|`info`|
82
+
83
+ #### Allowed values
50
84
 
51
- - type: string
52
- - required: false
53
- - allowed values
54
- - `off`: Do not output any logs.
55
- - `fatal`: Output fatal logs.
56
- - `error`: Output fatal/error logs.
57
- - `warn`: Output fatal/error/warn logs.
58
- - `info`: Output fatal/error/warn/info logs.
59
- - `debug`: Output fatal/error/warn/info/debug logs.
60
- - `trace`: Output fatal/error/warn/info/debug/trace logs.
61
- - default: `info`
85
+ |Value|Description|
86
+ |---|---|
87
+ |`off`|Do not output any logs.|
88
+ |`fatal`|Output fatal logs.|
89
+ |`error`|Output fatal/error logs.|
90
+ |`warn`|Output fatal/error/warn logs.|
91
+ |`info`|Output fatal/error/warn/info logs.|
92
+ |`debug`|Output fatal/error/warn/info/debug logs.|
93
+ |`trace`|Output fatal/error/warn/info/debug/trace logs.|
94
+
95
+ #### Example
96
+
97
+ ```sh
98
+ npx npm-update-package \
99
+ --github-token $GITHUB_TOKEN \
100
+ --log-level info
101
+ ```
62
102
 
63
103
  ### `--package-manager`
64
104
 
65
- Package manager of your project
105
+ Package manager of your project.
106
+
107
+ |Name|Value|
108
+ |---|---|
109
+ |type|string|
110
+ |required|false|
111
+ |default|`npm`|
112
+
113
+ #### Allowed values
66
114
 
67
- - type: string
68
- - required: false
69
- - allowed values
70
- - `npm`: npm
71
- - `yarn`: Yarn
72
- - default: `npm`
115
+ |Value|Description|
116
+ |---|---|
117
+ |`npm`|npm|
118
+ |`yarn`|Yarn|
119
+
120
+ #### Example
121
+
122
+ ```sh
123
+ npx npm-update-package \
124
+ --github-token $GITHUB_TOKEN \
125
+ --package-manager npm
126
+ ```
73
127
 
74
128
  ### `--pr-body-notes`
75
129
 
76
- Additional notes for Pull request body
130
+ Additional notes for Pull request body.
131
+
132
+ |Name|Value|
133
+ |---|---|
134
+ |type|string|
135
+ |required|false|
77
136
 
78
- - type: string
79
- - required: false
137
+ #### Example
138
+
139
+ ```sh
140
+ npx npm-update-package \
141
+ --github-token $GITHUB_TOKEN \
142
+ --pr-body-notes "**:warning: Please see diff and release notes before merging.**"
143
+ ```
80
144
 
81
145
  ### `--pr-title`
82
146
 
83
- Pull request title template
147
+ Pull request title template.
148
+
149
+ |Name|Value|
150
+ |---|---|
151
+ |type|string|
152
+ |required|false|
153
+ |default|`chore(deps): {{{level}}} update {{{packageName}}} to v{{{newVersion}}}`|
84
154
 
85
- - type: string
86
- - required: false
87
- - variables
88
- - `currentVersion`: current package version
89
- - `newVersion`: new package version
90
- - `packageName`: package name
91
- - `level`: semver level (major/minor/patch)
92
- - `dependencyType`: dependency type (dependencies/devDependencies/peerDependencies/optionalDependencies)
93
- - default: `chore(deps): {{{level}}} update {{{packageName}}} to v{{{newVersion}}}`
155
+ #### Available variables
156
+
157
+ |Variable|Description|
158
+ |---|---|
159
+ |`currentVersion`|Current package version|
160
+ |`newVersion`|New package version|
161
+ |`packageName`|Package name|
162
+ |`level`|Semver level (`major`/`minor`/`patch`)|
163
+ |`dependencyType`|Dependency type (`dependencies`/`devDependencies`/`peerDependencies`/`optionalDependencies`)|
164
+
165
+ #### Example
166
+
167
+ ```sh
168
+ npx npm-update-package \
169
+ --github-token $GITHUB_TOKEN \
170
+ --pr-title "chore(deps): {{{level}}} update {{{packageName}}} to v{{{newVersion}}}"
171
+ ```
94
172
 
95
173
  ### `--reviewers`
96
174
 
97
- User names to request reviews
175
+ User names to request reviews.
98
176
 
99
- - type: string[]
100
- - required: false
177
+ |Name|Value|
178
+ |---|---|
179
+ |type|string[]|
180
+ |required|false|
181
+
182
+ #### Example
183
+
184
+ ```sh
185
+ npx npm-update-package \
186
+ --github-token $GITHUB_TOKEN \
187
+ --reviewers npm-update-package npm-update-package-bot
188
+ ```
101
189
 
102
190
  ## GitHub token
103
191
 
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "npm-update-package",
3
- "version": "0.45.6",
3
+ "version": "0.45.9",
4
4
  "description": "CLI tool for creating pull requests to update npm packages",
5
5
  "scripts": {
6
6
  "build": "tsc --project tsconfig.build.json",
@@ -24,7 +24,7 @@
24
24
  "log4js": "6.4.2",
25
25
  "mustache": "4.1.0",
26
26
  "node-fetch": "2.6.7",
27
- "npm-check-updates": "12.5.2",
27
+ "npm-check-updates": "12.5.3",
28
28
  "parse-github-url": "1.0.2",
29
29
  "semver": "7.3.5",
30
30
  "sleep-promise": "9.1.0",
@@ -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 }) => `- [${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,6 +1,6 @@
1
1
  {
2
2
  "name": "npm-update-package",
3
- "version": "0.45.6",
3
+ "version": "0.45.9",
4
4
  "description": "CLI tool for creating pull requests to update npm packages",
5
5
  "scripts": {
6
6
  "build": "tsc --project tsconfig.build.json",
@@ -24,7 +24,7 @@
24
24
  "log4js": "6.4.2",
25
25
  "mustache": "4.1.0",
26
26
  "node-fetch": "2.6.7",
27
- "npm-check-updates": "12.5.2",
27
+ "npm-check-updates": "12.5.3",
28
28
  "parse-github-url": "1.0.2",
29
29
  "semver": "7.3.5",
30
30
  "sleep-promise": "9.1.0",