@sanity/plugin-kit 2.1.13 → 2.1.15
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 +41 -7
- package/assets/inject/semver-workflow/.github/workflows/main.yml +1 -1
- package/lib/package.json +16 -16
- package/lib/src/actions/link-watch.js +9 -1
- package/lib/src/actions/link-watch.js.map +1 -1
- package/lib/src/presets/semver-workflow.js +1 -1
- package/lib/src/util/user.js +5 -4
- package/lib/src/util/user.js.map +1 -1
- package/package.json +16 -16
- package/src/actions/link-watch.ts +9 -1
- package/src/presets/semver-workflow.ts +1 -1
- package/src/util/user.ts +3 -4
package/README.md
CHANGED
|
@@ -26,12 +26,12 @@ Check the [FAQ](#faq) fro more on these.
|
|
|
26
26
|
- [Verify plugin package](#verify-plugin-package)
|
|
27
27
|
- [Upgrading a v2 plugin](#upgrading-a-v2-plugin)
|
|
28
28
|
- [Upgrade help in v2 Studio](#upgrade-help-in-v2-studio)
|
|
29
|
-
- [Inject config into existing v3 plugin](#inject-config-into-existing-
|
|
29
|
+
- [Inject config into existing v3 plugin](#inject-config-into-existing-package)
|
|
30
30
|
- [Testing a plugin in Sanity Studio](#testing-a-plugin-in-sanity-studio)
|
|
31
31
|
- [Upgrading from plugin-kit 1.x](#upgrade-from-v1x-to-v2)
|
|
32
32
|
- [FAQ](#faq) aka "Do I _have_ to use this plugin-kit?" aka No
|
|
33
33
|
- [Configuration reference](#configuration-reference)
|
|
34
|
-
- [Developing plugin-kit](#
|
|
34
|
+
- [Developing plugin-kit](#develop-plugin-kit)
|
|
35
35
|
|
|
36
36
|
## Installation
|
|
37
37
|
|
|
@@ -57,8 +57,26 @@ npx @sanity/plugin-kit init sanity-plugin-testing-it-out
|
|
|
57
57
|
cd sanity-plugin-testing-it-out
|
|
58
58
|
npm run link-watch
|
|
59
59
|
|
|
60
|
-
# In another shell
|
|
60
|
+
# In another shell
|
|
61
61
|
cd /path/to/my-studio
|
|
62
|
+
# now link the plugin to your Sanity studio using the command indicated by link-watch output (see below)
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
Run **ONE** of the below commands, **based on the package manager** used in your studio:
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
# studio uses yarn
|
|
69
|
+
cd /path/to/my-studio
|
|
70
|
+
yalc add --link sanity-plugin-testing-it-out && yarn install
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
```bash
|
|
74
|
+
# studio uses npm
|
|
75
|
+
cd /path/to/my-studio
|
|
76
|
+
npx yalc add sanity-plugin-testing-it-out && npx yalc link sanity-plugin-testing-it-out && npm install
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
# Use this command if your studio uses yarn
|
|
62
80
|
npx yalc add sanity-plugin-testing-it-out && npx yalc link sanity-plugin-testing-it-out && npm install
|
|
63
81
|
|
|
64
82
|
```
|
|
@@ -122,7 +140,10 @@ Each check will explain why it is needed, steps to fix it and how it can be indi
|
|
|
122
140
|
|
|
123
141
|
### What it is _not_
|
|
124
142
|
|
|
125
|
-
`verify-package` is _not_ a codemod tool
|
|
143
|
+
`verify-package` is _not_ a codemod tool. It will only check files and recommended settings: it will not change any files.
|
|
144
|
+
|
|
145
|
+
Consider using `npx @sanity/plugin-kit inject` if you want to add recommended V3 plugin configuration automatically.
|
|
146
|
+
See the [Inject docs](#inject-config-into-existing-package) for more on this.
|
|
126
147
|
|
|
127
148
|
### Upgrading a v2 plugin
|
|
128
149
|
|
|
@@ -160,16 +181,29 @@ npx @sanity/plugin-kit verify-package --studio --single
|
|
|
160
181
|
|
|
161
182
|
This will only output the first validation that fails. Useful when working through the list of issues by fixing and rerunning the command.
|
|
162
183
|
|
|
163
|
-
|
|
184
|
+
## Inject config into existing package
|
|
164
185
|
|
|
165
|
-
|
|
186
|
+
```
|
|
187
|
+
npx @sanity/plugin-kit inject
|
|
188
|
+
```
|
|
189
|
+
will inject recommended V3 plugin package boilerplate into an existing plugin.
|
|
190
|
+
Be sure to commit any local changes before running this command, so you can easily revert anything
|
|
191
|
+
you dont want.
|
|
166
192
|
|
|
193
|
+
Consult the inject command CLI help:
|
|
167
194
|
```
|
|
168
195
|
npx @sanity/plugin-kit inject --help
|
|
169
196
|
```
|
|
170
197
|
|
|
171
198
|
for up-to-date specifics.
|
|
172
199
|
|
|
200
|
+
### Presets
|
|
201
|
+
|
|
202
|
+
The inject command can do more work by adding presets. Consult the individual preset docs for details:
|
|
203
|
+
|
|
204
|
+
* [semver-workflow](./docs/semver-workflow.md) - Add an opinionated Github workflow to automate NPM releases
|
|
205
|
+
* [renovatebot](./docs/renovatebot.md) - Add opinionated Renovatebot config to make dependency management a breeze
|
|
206
|
+
|
|
173
207
|
## Testing a plugin in Sanity Studio
|
|
174
208
|
|
|
175
209
|
Ensure you have the following script setup in package.json:
|
|
@@ -447,7 +481,7 @@ npm run test -- test/verify-package.test.ts
|
|
|
447
481
|
npm run test -- test/verify-package.test.ts --snapshot
|
|
448
482
|
```
|
|
449
483
|
|
|
450
|
-
##
|
|
484
|
+
## Develop plugin-kit
|
|
451
485
|
|
|
452
486
|
### Release new version
|
|
453
487
|
|
package/lib/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sanity/plugin-kit",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.15",
|
|
4
4
|
"description": "Enhanced Sanity.io plugin development experience",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"sanity-io",
|
|
@@ -65,47 +65,47 @@
|
|
|
65
65
|
"email-validator": "^2.0.4",
|
|
66
66
|
"execa": "^5.1.1",
|
|
67
67
|
"find-babel-config": "^1.2.0",
|
|
68
|
-
"get-it": "^
|
|
68
|
+
"get-it": "^7.0.2",
|
|
69
69
|
"get-latest-version": "^4.0.0",
|
|
70
70
|
"git-remote-origin-url": "^3.1.0",
|
|
71
|
-
"git-user-info": "^
|
|
71
|
+
"git-user-info": "^2.0.3",
|
|
72
72
|
"github-url-to-object": "^4.0.6",
|
|
73
73
|
"inquirer": "^8.2.5",
|
|
74
74
|
"meow": "^9.0.0",
|
|
75
75
|
"nodemon": "^2.0.20",
|
|
76
|
-
"npm-packlist": "^
|
|
76
|
+
"npm-packlist": "^7.0.2",
|
|
77
77
|
"npm-run-path": "^4.0.1",
|
|
78
78
|
"outdent": "^0.8.0",
|
|
79
79
|
"p-any": "^3.0.0",
|
|
80
80
|
"p-props": "^4.0.0",
|
|
81
|
-
"postcss": "^8.4.
|
|
81
|
+
"postcss": "^8.4.19",
|
|
82
82
|
"rimraf": "^3.0.2",
|
|
83
83
|
"semver": "^7.3.8",
|
|
84
84
|
"spdx-license-ids": "^3.0.12",
|
|
85
|
-
"validate-npm-package-name": "^
|
|
85
|
+
"validate-npm-package-name": "^5.0.0",
|
|
86
86
|
"xdg-basedir": "^4.0.0",
|
|
87
87
|
"yalc": "^1.0.0-pre.53"
|
|
88
88
|
},
|
|
89
89
|
"devDependencies": {
|
|
90
90
|
"@commitlint/cli": "^17.2.0",
|
|
91
91
|
"@commitlint/config-conventional": "^17.2.0",
|
|
92
|
-
"@sanity/pkg-utils": "^1.
|
|
92
|
+
"@sanity/pkg-utils": "^1.18.0",
|
|
93
93
|
"@sanity/semantic-release-preset": "^2.0.2",
|
|
94
|
-
"@types/eslint": "^8.4.
|
|
94
|
+
"@types/eslint": "^8.4.10",
|
|
95
95
|
"@types/fs-extra": "^9.0.13",
|
|
96
|
-
"@types/inquirer": "^
|
|
97
|
-
"@types/node": "^
|
|
96
|
+
"@types/inquirer": "^9.0.3",
|
|
97
|
+
"@types/node": "^18.11.9",
|
|
98
98
|
"@types/nodemon": "^1.19.2",
|
|
99
99
|
"@types/tap": "^15.0.7",
|
|
100
|
-
"@typescript-eslint/eslint-plugin": "^5.
|
|
101
|
-
"@typescript-eslint/parser": "^5.
|
|
102
|
-
"eslint": "^8.
|
|
100
|
+
"@typescript-eslint/eslint-plugin": "^5.43.0",
|
|
101
|
+
"@typescript-eslint/parser": "^5.43.0",
|
|
102
|
+
"eslint": "^8.27.0",
|
|
103
103
|
"eslint-config-prettier": "^8.5.0",
|
|
104
104
|
"eslint-config-sanity": "^6.0.0",
|
|
105
105
|
"eslint-plugin-prettier": "^4.2.1",
|
|
106
106
|
"eslint-plugin-react-hooks": "^4.6.0",
|
|
107
107
|
"fs-extra": "^10.1.0",
|
|
108
|
-
"husky": "^8.0.
|
|
108
|
+
"husky": "^8.0.2",
|
|
109
109
|
"json5": "^2.2.1",
|
|
110
110
|
"lint-staged": "^13.0.3",
|
|
111
111
|
"prettier": "^2.7.1",
|
|
@@ -113,8 +113,8 @@
|
|
|
113
113
|
"readdirp": "^3.6.0",
|
|
114
114
|
"rimraf": "^3.0.2",
|
|
115
115
|
"sanity": "3.0.0-rc.2",
|
|
116
|
-
"sinon": "^14.0.
|
|
117
|
-
"tap": "^16.3.
|
|
116
|
+
"sinon": "^14.0.2",
|
|
117
|
+
"tap": "^16.3.1",
|
|
118
118
|
"ts-node": "^10.9.1",
|
|
119
119
|
"typescript": "^4.8.4"
|
|
120
120
|
},
|
|
@@ -62,7 +62,15 @@ function linkWatch({ basePath }) {
|
|
|
62
62
|
log_1.default.info((0, outdent_1.default) `
|
|
63
63
|
Watching ${watch.folder} for changes to files with extensions: ${watch.extensions}
|
|
64
64
|
|
|
65
|
-
To test this package in another
|
|
65
|
+
To test this package in Sanity Studio or another package, in a separate shell run:
|
|
66
|
+
cd /path/to/sanity/studio-or-package
|
|
67
|
+
|
|
68
|
+
Then, run one of the below commands, based on the package manager used in studio-or-package:
|
|
69
|
+
|
|
70
|
+
## yarn
|
|
71
|
+
${chalk_1.default.greenBright(`yalc add --link ${pkg.name} && yarn install`)}
|
|
72
|
+
|
|
73
|
+
## npm
|
|
66
74
|
${chalk_1.default.greenBright(`npx yalc add ${pkg.name} && npx yalc link ${pkg.name} && npm install`)}
|
|
67
75
|
`.trimStart());
|
|
68
76
|
})
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"link-watch.js","source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,CAAC,OAAO,CAAC,CAAC,CAAA;QAE7B,iBAAO;aACJ,EAAE,CAAC,OAAO,EAAE;YACX,aAAG,CAAC,IAAI,CACN,IAAA,iBAAO,EAAA;mBACI,KAAK,CAAC,MAAM,0CAA0C,KAAK,CAAC,UAAU;;;;;;;;UAQ/E,eAAK,CAAC,WAAW,CAAC,mBAAmB,GAAG,CAAC,IAAI,kBAAkB,CAAC;;;UAGhE,eAAK,CAAC,WAAW,CAAC,gBAAgB,GAAG,CAAC,IAAI,qBAAqB,GAAG,CAAC,IAAI,iBAAiB,CAAC;OAC5F,CAAC,SAAS,EAAE,CACZ,CAAA;QACH,CAAC,CAAC;aACD,EAAE,CAAC,MAAM,EAAE;YACV,OAAO,CAAC,IAAI,EAAE,CAAA;QAChB,CAAC,CAAC;aACD,EAAE,CAAC,SAAS,EAAE,UAAU,KAAU;YACjC,aAAG,CAAC,IAAI,CAAC,yBAAyB,EAAE,eAAK,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC,CAAA;YAC/D,aAAG,CAAC,IAAI,CAAC,6BAA6B,CAAC,CAAA;QACzC,CAAC,CAAC,CAAA;;CACL;AAvDD,8BAuDC"}
|
|
@@ -60,7 +60,7 @@ function addDevDependencies(options) {
|
|
|
60
60
|
semantic-release preset injected.
|
|
61
61
|
|
|
62
62
|
Please confer
|
|
63
|
-
https://github.com/sanity-io/plugin-kit/blob/main/docs/semver-workflow.md
|
|
63
|
+
https://github.com/sanity-io/plugin-kit/blob/main/docs/semver-workflow.md#manual-steps-after-inject
|
|
64
64
|
to finalize configuration for this preset.
|
|
65
65
|
`.trim()));
|
|
66
66
|
});
|
package/lib/src/util/user.js
CHANGED
|
@@ -15,8 +15,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
15
15
|
exports.getPackageUserInfo = exports.getUserInfo = void 0;
|
|
16
16
|
const path_1 = __importDefault(require("path"));
|
|
17
17
|
const xdg_basedir_1 = __importDefault(require("xdg-basedir"));
|
|
18
|
-
|
|
19
|
-
const git_user_info_1 = __importDefault(require("git-user-info"));
|
|
18
|
+
const git_user_info_1 = require("git-user-info");
|
|
20
19
|
const email_validator_1 = require("email-validator");
|
|
21
20
|
const files_1 = require("./files");
|
|
22
21
|
const request_1 = require("./request");
|
|
@@ -92,8 +91,10 @@ function getSanityUserInfo() {
|
|
|
92
91
|
});
|
|
93
92
|
}
|
|
94
93
|
function getGitUserInfo() {
|
|
95
|
-
|
|
96
|
-
|
|
94
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
95
|
+
const user = yield (0, git_user_info_1.getGitUserInfo)();
|
|
96
|
+
return user ? { name: user.name, email: user.email } : undefined;
|
|
97
|
+
});
|
|
97
98
|
}
|
|
98
99
|
function filterString(val) {
|
|
99
100
|
return (val || '').trim();
|
package/lib/src/util/user.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"user.js","sourceRoot":"","sources":["../../../src/util/user.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,gDAAuB;AACvB,8DAAoC;AACpC,
|
|
1
|
+
{"version":3,"file":"user.js","sourceRoot":"","sources":["../../../src/util/user.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,gDAAuB;AACvB,8DAAoC;AACpC,iDAA+D;AAC/D,qDAAwD;AACxD,mCAAoC;AACpC,uCAAiC;AACjC,qCAA+B;AAS/B,SAAsB,WAAW,CAC/B,EAAC,uBAAuB,EAAE,KAAK,EAAgB,EAC/C,GAAiB;;;QAEjB,MAAM,QAAQ,GACZ,kBAAkB,CAAC,EAAC,MAAM,EAAE,MAAA,KAAK,CAAC,MAAM,mCAAI,GAAG,aAAH,GAAG,uBAAH,GAAG,CAAE,MAAM,EAAC,CAAC;YACzD,CAAC,MAAM,iBAAiB,EAAE,CAAC;YAC1B,CAAC,MAAM,cAAc,EAAE,CAAsB,CAAA;QAChD,IAAI,uBAAuB,EAAE;YAC3B,OAAO,aAAa,CAAC,QAAQ,CAAC,CAAA;SAC/B;QA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,SAAS,cAAc,CAAC,KAAa;IACnC,OAAO,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,UAAU,CAAA;AAC7C,CAAC;AAED,SAAS,iBAAiB,CAAC,KAAa;IACtC,IAAI,CAAC,KAAK,EAAE;QACV,OAAO,IAAI,CAAA;KACZ;IAED,OAAO,IAAA,0BAAY,EAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,uCAAuC,CAAA;AAC7E,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sanity/plugin-kit",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.15",
|
|
4
4
|
"description": "Enhanced Sanity.io plugin development experience",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"sanity-io",
|
|
@@ -65,47 +65,47 @@
|
|
|
65
65
|
"email-validator": "^2.0.4",
|
|
66
66
|
"execa": "^5.1.1",
|
|
67
67
|
"find-babel-config": "^1.2.0",
|
|
68
|
-
"get-it": "^
|
|
68
|
+
"get-it": "^7.0.2",
|
|
69
69
|
"get-latest-version": "^4.0.0",
|
|
70
70
|
"git-remote-origin-url": "^3.1.0",
|
|
71
|
-
"git-user-info": "^
|
|
71
|
+
"git-user-info": "^2.0.3",
|
|
72
72
|
"github-url-to-object": "^4.0.6",
|
|
73
73
|
"inquirer": "^8.2.5",
|
|
74
74
|
"meow": "^9.0.0",
|
|
75
75
|
"nodemon": "^2.0.20",
|
|
76
|
-
"npm-packlist": "^
|
|
76
|
+
"npm-packlist": "^7.0.2",
|
|
77
77
|
"npm-run-path": "^4.0.1",
|
|
78
78
|
"outdent": "^0.8.0",
|
|
79
79
|
"p-any": "^3.0.0",
|
|
80
80
|
"p-props": "^4.0.0",
|
|
81
|
-
"postcss": "^8.4.
|
|
81
|
+
"postcss": "^8.4.19",
|
|
82
82
|
"rimraf": "^3.0.2",
|
|
83
83
|
"semver": "^7.3.8",
|
|
84
84
|
"spdx-license-ids": "^3.0.12",
|
|
85
|
-
"validate-npm-package-name": "^
|
|
85
|
+
"validate-npm-package-name": "^5.0.0",
|
|
86
86
|
"xdg-basedir": "^4.0.0",
|
|
87
87
|
"yalc": "^1.0.0-pre.53"
|
|
88
88
|
},
|
|
89
89
|
"devDependencies": {
|
|
90
90
|
"@commitlint/cli": "^17.2.0",
|
|
91
91
|
"@commitlint/config-conventional": "^17.2.0",
|
|
92
|
-
"@sanity/pkg-utils": "^1.
|
|
92
|
+
"@sanity/pkg-utils": "^1.18.0",
|
|
93
93
|
"@sanity/semantic-release-preset": "^2.0.2",
|
|
94
|
-
"@types/eslint": "^8.4.
|
|
94
|
+
"@types/eslint": "^8.4.10",
|
|
95
95
|
"@types/fs-extra": "^9.0.13",
|
|
96
|
-
"@types/inquirer": "^
|
|
97
|
-
"@types/node": "^
|
|
96
|
+
"@types/inquirer": "^9.0.3",
|
|
97
|
+
"@types/node": "^18.11.9",
|
|
98
98
|
"@types/nodemon": "^1.19.2",
|
|
99
99
|
"@types/tap": "^15.0.7",
|
|
100
|
-
"@typescript-eslint/eslint-plugin": "^5.
|
|
101
|
-
"@typescript-eslint/parser": "^5.
|
|
102
|
-
"eslint": "^8.
|
|
100
|
+
"@typescript-eslint/eslint-plugin": "^5.43.0",
|
|
101
|
+
"@typescript-eslint/parser": "^5.43.0",
|
|
102
|
+
"eslint": "^8.27.0",
|
|
103
103
|
"eslint-config-prettier": "^8.5.0",
|
|
104
104
|
"eslint-config-sanity": "^6.0.0",
|
|
105
105
|
"eslint-plugin-prettier": "^4.2.1",
|
|
106
106
|
"eslint-plugin-react-hooks": "^4.6.0",
|
|
107
107
|
"fs-extra": "^10.1.0",
|
|
108
|
-
"husky": "^8.0.
|
|
108
|
+
"husky": "^8.0.2",
|
|
109
109
|
"json5": "^2.2.1",
|
|
110
110
|
"lint-staged": "^13.0.3",
|
|
111
111
|
"prettier": "^2.7.1",
|
|
@@ -113,8 +113,8 @@
|
|
|
113
113
|
"readdirp": "^3.6.0",
|
|
114
114
|
"rimraf": "^3.0.2",
|
|
115
115
|
"sanity": "3.0.0-rc.2",
|
|
116
|
-
"sinon": "^14.0.
|
|
117
|
-
"tap": "^16.3.
|
|
116
|
+
"sinon": "^14.0.2",
|
|
117
|
+
"tap": "^16.3.1",
|
|
118
118
|
"ts-node": "^10.9.1",
|
|
119
119
|
"typescript": "^4.8.4"
|
|
120
120
|
},
|
|
@@ -72,7 +72,15 @@ export async function linkWatch({basePath}: {basePath: string}) {
|
|
|
72
72
|
outdent`
|
|
73
73
|
Watching ${watch.folder} for changes to files with extensions: ${watch.extensions}
|
|
74
74
|
|
|
75
|
-
To test this package in another
|
|
75
|
+
To test this package in Sanity Studio or another package, in a separate shell run:
|
|
76
|
+
cd /path/to/sanity/studio-or-package
|
|
77
|
+
|
|
78
|
+
Then, run one of the below commands, based on the package manager used in studio-or-package:
|
|
79
|
+
|
|
80
|
+
## yarn
|
|
81
|
+
${chalk.greenBright(`yalc add --link ${pkg.name} && yarn install`)}
|
|
82
|
+
|
|
83
|
+
## npm
|
|
76
84
|
${chalk.greenBright(`npx yalc add ${pkg.name} && npx yalc link ${pkg.name} && npm install`)}
|
|
77
85
|
`.trimStart()
|
|
78
86
|
)
|
|
@@ -65,7 +65,7 @@ async function addDevDependencies(options: InjectOptions) {
|
|
|
65
65
|
semantic-release preset injected.
|
|
66
66
|
|
|
67
67
|
Please confer
|
|
68
|
-
https://github.com/sanity-io/plugin-kit/blob/main/docs/semver-workflow.md
|
|
68
|
+
https://github.com/sanity-io/plugin-kit/blob/main/docs/semver-workflow.md#manual-steps-after-inject
|
|
69
69
|
to finalize configuration for this preset.
|
|
70
70
|
`.trim()
|
|
71
71
|
)
|
package/src/util/user.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import path from 'path'
|
|
2
2
|
import xdgBasedir from 'xdg-basedir'
|
|
3
|
-
|
|
4
|
-
import gitUserInfo from 'git-user-info'
|
|
3
|
+
import {getGitUserInfo as _getGitUserInfo} from 'git-user-info'
|
|
5
4
|
import {validate as isValidEmail} from 'email-validator'
|
|
6
5
|
import {readJsonFile} from './files'
|
|
7
6
|
import {request} from './request'
|
|
@@ -98,8 +97,8 @@ async function getSanityUserInfo(): Promise<User | undefined> {
|
|
|
98
97
|
}
|
|
99
98
|
}
|
|
100
99
|
|
|
101
|
-
function getGitUserInfo(): User | undefined {
|
|
102
|
-
const user =
|
|
100
|
+
async function getGitUserInfo(): Promise<User | undefined> {
|
|
101
|
+
const user = await _getGitUserInfo()
|
|
103
102
|
return user ? {name: user.name, email: user.email} : undefined
|
|
104
103
|
}
|
|
105
104
|
|