Skip to content

Commit 49684d5

Browse files
committed
fix: cleanup package.json from no longer used lerna calls
1 parent fbe70c7 commit 49684d5

File tree

4 files changed

+18
-28
lines changed

4 files changed

+18
-28
lines changed

@commitlint/prompt/src/input.ts

+6-7
Original file line numberDiff line numberDiff line change
@@ -52,13 +52,12 @@ async function input(prompter: () => Prompter): Promise<string> {
5252
}
5353
}
5454

55-
results[input] =
56-
(await getPrompt(input, {
57-
rules: inputRules,
58-
settings: inputSettings,
59-
results,
60-
prompter,
61-
})) || null;
55+
results[input] = await getPrompt(input, {
56+
rules: inputRules,
57+
settings: inputSettings,
58+
results,
59+
prompter,
60+
});
6261
})
6362
)
6463
).catch((err) => {

@commitlint/prompt/src/library/format.ts

+5-14
Original file line numberDiff line numberDiff line change
@@ -11,20 +11,11 @@ export default format;
1111
*/
1212
function format(input: Result, debug = false): string {
1313
const results = debug
14-
? Object.entries(input).reduce<Result>(
15-
(registry, [name, value]) => {
16-
registry[name as 'type' | 'scope' | 'subject' | 'body' | 'footer'] =
17-
value === null ? chalk.grey(`<${name}>`) : chalk.bold(value);
18-
return registry;
19-
},
20-
{
21-
type: null,
22-
scope: null,
23-
subject: null,
24-
body: null,
25-
footer: null,
26-
}
27-
)
14+
? Object.entries(input).reduce<Result>((registry, [name, value]) => {
15+
registry[name as 'type' | 'scope' | 'subject' | 'body' | 'footer'] =
16+
value === null ? chalk.grey(`<${name}>`) : chalk.bold(value);
17+
return registry;
18+
}, {})
2819
: input;
2920

3021
// Return formatted string

@commitlint/prompt/src/library/get-prompt.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ function getPrompt(
2525
results?: Result;
2626
prompter?: () => Prompter;
2727
} = {}
28-
): Promise<string | void> {
28+
): Promise<string | undefined> {
2929
const {rules = [], settings = {}, results = {}, prompter} = context;
3030

3131
if (typeof prompter !== 'function') {
@@ -82,7 +82,7 @@ function getPrompt(
8282
prompt.removeAllListeners('keypress');
8383
prompt.removeAllListeners('client_prompt_submit');
8484
prompt.ui.redraw.done();
85-
return Promise.resolve();
85+
return Promise.resolve(undefined);
8686
}
8787

8888
const caseRule = rules.find(getHasName('case'));

package.json

+5-5
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
"version": "1.0.0",
66
"license": "MIT",
77
"scripts": {
8-
"build": "tsc -b && lerna run build --stream --parallel --include-dependencies",
9-
"watch": "lerna run watch --stream --parallel --include-dependencies",
8+
"build": "tsc -b",
9+
"watch": "tsc --watch",
1010
"clean": "tsc -b --clean && lerna clean --yes && lerna exec 'git clean -xdf lib' && git clean -xdf node_modules",
1111
"commit": "node @commitlint/prompt-cli/cli.js",
1212
"deps": "lerna run deps",
@@ -18,9 +18,9 @@
1818
"format-fix": "prettier **/*.{ts,js,json,yml,md} --write",
1919
"publish": "lerna publish --conventional-commits",
2020
"reinstall": "yarn clean && yarn install",
21-
"start": "lerna run start --stream --parallel --include-dependencies",
22-
"test": "jest && lerna run test --stream --parallel --include-dependencies",
23-
"test-ci": "jest --runInBand && lerna run test --stream --parallel --include-dependencies"
21+
"start": "yarn watch",
22+
"test": "jest",
23+
"test-ci": "jest --runInBand"
2424
},
2525
"commitlint": {
2626
"extends": [

0 commit comments

Comments
 (0)