Skip to content

Commit 8ec7866

Browse files
committed
fix: integrate review feedback
1 parent b822c33 commit 8ec7866

File tree

4 files changed

+18
-26
lines changed

4 files changed

+18
-26
lines changed

@commitlint/prompt/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,9 @@
3737
"node": ">=v12"
3838
},
3939
"devDependencies": {
40-
"@commitlint/config-angular": "^11.0.0",
41-
"@commitlint/types": "^11.0.0",
4240
"@commitlint/utils": "^14.0.0",
41+
"@commitlint/types": "^13.2.0",
42+
"@commitlint/config-angular": "^13.2.0",
4343
"@types/inquirer": "^6.5.0",
4444
"inquirer": "^6.5.2",
4545
"commitizen": "^4.2.4"

@commitlint/prompt/src/index.ts

+4-12
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,8 @@ import {input} from './input';
33

44
type Commit = (input: string) => void;
55

6-
/**
7-
* Entry point for commitizen
8-
* @param cz inquirer instance passed by commitizen
9-
* @param commit callback to execute with complete commit message
10-
* @return {void}
11-
*/
12-
export async function prompter(
13-
cz: typeof inquirer,
14-
commit: Commit
15-
): Promise<void> {
16-
const message = await input(cz.prompt);
17-
commit(message);
6+
export function prompter(cz: typeof inquirer, commit: Commit): void {
7+
input(cz.prompt).then((message) => {
8+
commit(message);
9+
});
1810
}

@commitlint/prompt/src/inquirer/InputCustomPrompt.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
/// <reference path="./inquirer.d.ts" />
2-
import {Interface as ReadlineInterface, Key} from 'readline';
3-
42
import chalk from 'chalk';
53
import inquirer from 'inquirer';
64
import InputPrompt from 'inquirer/lib/prompts/input';
75
import observe from 'inquirer/lib/utils/events';
6+
import {Interface as ReadlineInterface, Key} from 'readline';
87
import type {Subscription} from 'rxjs/internal/Subscription';
98

109
import Answers = inquirer.Answers;
@@ -86,7 +85,6 @@ export default class InputCustomPrompt<
8685
render(error?: string): void {
8786
const answered = this.status === 'answered';
8887

89-
let bottomContent = '';
9088
let message = this.getQuestion();
9189
const length = this.measureInput(this.rl.line);
9290

@@ -96,6 +94,8 @@ export default class InputCustomPrompt<
9694
message += this.opt.transformer(this.rl.line, this.answers, {});
9795
}
9896

97+
let bottomContent = '';
98+
9999
if (error) {
100100
bottomContent = chalk.red('>> ') + error;
101101
} else if (!answered) {

yarn.lock

+9-9
Original file line numberDiff line numberDiff line change
@@ -1398,17 +1398,17 @@
13981398
resolved "https://registry.npmjs.org/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39"
13991399
integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==
14001400

1401-
"@commitlint/config-angular-type-enum@^11.0.0":
1402-
version "11.0.0"
1403-
resolved "https://registry.npmjs.org/@commitlint/config-angular-type-enum/-/config-angular-type-enum-11.0.0.tgz#7a7f6982e45d3696d72eb343a5d1dc23b2f003e0"
1404-
integrity sha512-dSyxdkU36aEgDUWBSiM5lsZ/h2K7uCyKf+A5Sf3+Z5JhcLD9GzTo5W+c8KgwTBdL39dkL7sN+EVgsXNjW99pJg==
1401+
"@commitlint/config-angular-type-enum@^13.2.0":
1402+
version "13.2.0"
1403+
resolved "https://registry.npmjs.org/@commitlint/config-angular-type-enum/-/config-angular-type-enum-13.2.0.tgz#e3f9b8a07118ed8e060b0b1d04a549f74957634d"
1404+
integrity sha512-HSP9lzCoHC9+bjJquvByiSUpo0GbAipbjcT6l3Jl6XOzkCjhnUkYcQ2b/O5nXv3mf8Vv/n5k2Sk4nbCYEVpSGQ==
14051405

1406-
"@commitlint/config-angular@^11.0.0":
1407-
version "11.0.0"
1408-
resolved "https://registry.npmjs.org/@commitlint/config-angular/-/config-angular-11.0.0.tgz#c1cc1dd902a4b9d2a5c072ff38e3ace9be7138e0"
1409-
integrity sha512-H8QSEOmfRsPW0Iehid5fY7NZ2HXmyKC6Q83MLFf9KRnmCcbgJtH+faECtqlvPntayO3CYbA4UenIerOaQ0vOAg==
1406+
"@commitlint/config-angular@^13.2.0":
1407+
version "13.2.0"
1408+
resolved "https://registry.npmjs.org/@commitlint/config-angular/-/config-angular-13.2.0.tgz#78c62551279bdf7ed3a9bf993751f346c42b2944"
1409+
integrity sha512-mfytI8ZrPt7kuxjZo0ZfFw0bg1zEa2kI6/prVaYJ0FJgOE8EP1Co9Y4DJZEegohfYFeRcFK3radog7WOr2pzdw==
14101410
dependencies:
1411-
"@commitlint/config-angular-type-enum" "^11.0.0"
1411+
"@commitlint/config-angular-type-enum" "^13.2.0"
14121412

14131413
"@endemolshinegroup/cosmiconfig-typescript-loader@^3.0.2":
14141414
version "3.0.2"

0 commit comments

Comments
 (0)