npm-update-package 0.52.1 → 0.53.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 CHANGED
@@ -18,6 +18,8 @@ CLI tool for creating pull requests to update npm packages
18
18
  - [commitMessage](#commitmessage)
19
19
  - [fetchReleaseNotes](#fetchreleasenotes)
20
20
  - [fetchSleepTime](#fetchsleeptime)
21
+ - [gitUserEmail](#gituseremail)
22
+ - [gitUserName](#gitusername)
21
23
  - [githubToken](#githubtoken)
22
24
  - [ignorePackages](#ignorepackages)
23
25
  - [logLevel](#loglevel)
@@ -135,6 +137,42 @@ npx npm-update-package \
135
137
  --fetch-sleep-time 2000
136
138
  ```
137
139
 
140
+ ### gitUserEmail
141
+
142
+ Git user email.
143
+
144
+ |Name|Value|
145
+ |---|---|
146
+ |cli|`--git-user-email`|
147
+ |type|string|
148
+ |required|false|
149
+
150
+ Example:
151
+
152
+ ```sh
153
+ npx npm-update-package \
154
+ --github-token $GITHUB_TOKEN \
155
+ --git-user-email octocat@example.com
156
+ ```
157
+
158
+ ### gitUserName
159
+
160
+ Git user name.
161
+
162
+ |Name|Value|
163
+ |---|---|
164
+ |cli|`--git-user-name`|
165
+ |type|string|
166
+ |required|false|
167
+
168
+ Example:
169
+
170
+ ```sh
171
+ npx npm-update-package \
172
+ --github-token $GITHUB_TOKEN \
173
+ --git-user-name octocat
174
+ ```
175
+
138
176
  ### githubToken
139
177
 
140
178
  [GitHub token](#github-token).
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "npm-update-package",
3
- "version": "0.52.1",
3
+ "version": "0.53.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",
@@ -15,7 +15,7 @@
15
15
  "bin": "dist/src/bin.js",
16
16
  "dependencies": {
17
17
  "@octokit/rest": "18.12.0",
18
- "commander": "8.3.0",
18
+ "commander": "9.1.0",
19
19
  "execa": "5.1.1",
20
20
  "fp-ts": "2.11.9",
21
21
  "http-status-codes": "2.2.0",
@@ -33,14 +33,14 @@
33
33
  "devDependencies": {
34
34
  "@jest/types": "27.4.2",
35
35
  "@tsconfig/node12": "1.0.9",
36
- "@types/jest": "27.4.0",
37
- "@types/lodash": "4.14.180",
36
+ "@types/jest": "27.4.1",
37
+ "@types/lodash": "4.14.181",
38
38
  "@types/mustache": "4.1.2",
39
39
  "@types/node": "12.20.40",
40
40
  "@types/node-fetch": "2.6.1",
41
41
  "@types/parse-github-url": "1.0.0",
42
42
  "@types/semver": "7.3.9",
43
- "@typescript-eslint/eslint-plugin": "5.16.0",
43
+ "@typescript-eslint/eslint-plugin": "5.17.0",
44
44
  "eslint": "8.12.0",
45
45
  "eslint-config-standard-with-typescript": "21.0.1",
46
46
  "eslint-plugin-import": "2.25.4",
@@ -27,6 +27,9 @@ class Git {
27
27
  async restore(...files) {
28
28
  await this.terminal.run('git', 'checkout', ...files);
29
29
  }
30
+ async setConfig(key, value) {
31
+ await this.terminal.run('git', 'config', key, value);
32
+ }
30
33
  async switch(branchName) {
31
34
  await this.terminal.run('git', 'checkout', branchName);
32
35
  }
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.GitConfigInitializer = void 0;
4
+ class GitConfigInitializer {
5
+ constructor({ options, git }) {
6
+ this.options = options;
7
+ this.git = git;
8
+ }
9
+ async initialize() {
10
+ if (this.options.gitUserName !== undefined) {
11
+ await this.git.setConfig('user.name', this.options.gitUserName);
12
+ }
13
+ if (this.options.gitUserEmail !== undefined) {
14
+ await this.git.setConfig('user.email', this.options.gitUserEmail);
15
+ }
16
+ }
17
+ }
18
+ exports.GitConfigInitializer = GitConfigInitializer;
@@ -17,4 +17,5 @@ Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./CommitMessageCreator"), exports);
18
18
  __exportStar(require("./createBranchName"), exports);
19
19
  __exportStar(require("./Git"), exports);
20
+ __exportStar(require("./GitConfigInitializer"), exports);
20
21
  __exportStar(require("./GitRepository"), exports);
package/dist/src/main.js CHANGED
@@ -108,6 +108,11 @@ const main = async ({ options, logger }) => {
108
108
  pullRequestsCloser,
109
109
  packageUpdater
110
110
  });
111
+ const gitConfigInitializer = new git_1.GitConfigInitializer({
112
+ options,
113
+ git
114
+ });
115
+ await gitConfigInitializer.initialize();
111
116
  const outdatedPackagesProcessor = new core_1.OutdatedPackagesProcessor({
112
117
  outdatedPackageProcessor,
113
118
  logger
@@ -27,6 +27,8 @@ const Options = (0, io_ts_1.intersection)([
27
27
  }),
28
28
  (0, io_ts_1.partial)({
29
29
  assignees: (0, io_ts_1.array)(io_ts_1.string),
30
+ gitUserEmail: io_ts_1.string,
31
+ gitUserName: io_ts_1.string,
30
32
  ignorePackages: (0, io_ts_1.array)(io_ts_1.string),
31
33
  prBodyNotes: io_ts_1.string,
32
34
  reviewers: (0, io_ts_1.array)(io_ts_1.string)
@@ -32,6 +32,18 @@ exports.cliOptions = [
32
32
  required: false,
33
33
  default: 1000
34
34
  },
35
+ {
36
+ name: 'git-user-email',
37
+ description: 'Git user email',
38
+ type: OptionType_1.OptionType.String,
39
+ required: false
40
+ },
41
+ {
42
+ name: 'git-user-name',
43
+ description: 'Git user name',
44
+ type: OptionType_1.OptionType.String,
45
+ required: false
46
+ },
35
47
  {
36
48
  name: 'github-token',
37
49
  description: 'GitHub token',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "npm-update-package",
3
- "version": "0.52.1",
3
+ "version": "0.53.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",
@@ -15,7 +15,7 @@
15
15
  "bin": "dist/src/bin.js",
16
16
  "dependencies": {
17
17
  "@octokit/rest": "18.12.0",
18
- "commander": "8.3.0",
18
+ "commander": "9.1.0",
19
19
  "execa": "5.1.1",
20
20
  "fp-ts": "2.11.9",
21
21
  "http-status-codes": "2.2.0",
@@ -33,14 +33,14 @@
33
33
  "devDependencies": {
34
34
  "@jest/types": "27.4.2",
35
35
  "@tsconfig/node12": "1.0.9",
36
- "@types/jest": "27.4.0",
37
- "@types/lodash": "4.14.180",
36
+ "@types/jest": "27.4.1",
37
+ "@types/lodash": "4.14.181",
38
38
  "@types/mustache": "4.1.2",
39
39
  "@types/node": "12.20.40",
40
40
  "@types/node-fetch": "2.6.1",
41
41
  "@types/parse-github-url": "1.0.0",
42
42
  "@types/semver": "7.3.9",
43
- "@typescript-eslint/eslint-plugin": "5.16.0",
43
+ "@typescript-eslint/eslint-plugin": "5.17.0",
44
44
  "eslint": "8.12.0",
45
45
  "eslint-config-standard-with-typescript": "21.0.1",
46
46
  "eslint-plugin-import": "2.25.4",