From 141739eb928e169f18e1b55963bc0d78d817a879 Mon Sep 17 00:00:00 2001 From: coderaiser Date: Tue, 31 Oct 2023 19:00:34 +0200 Subject: [PATCH] feature: wisdom: @putout/cli-choose v1.0.1 --- lib/prompts.js | 29 ++++++----------------------- package.json | 1 + 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/lib/prompts.js b/lib/prompts.js index 3339e29..3b025f6 100644 --- a/lib/prompts.js +++ b/lib/prompts.js @@ -1,33 +1,16 @@ import enquirer from 'enquirer'; import actions from 'enquirer/lib/combos.js'; import tryToCatch from 'try-to-catch'; +import {choose as chooseCLI} from '@putout/cli-choose'; const {Select, Confirm} = enquirer; -const custom = { - h: 'left', - j: 'down', - k: 'up', - l: 'right', -}; - -actions.keys = { - ...actions.keys, - ...custom, -}; - export const choose = async () => { - const prompt = new Select({ - name: 'version', - message: 'What type of changes are you goint to publish 🎁 ?', - choices: [ - 'patch', - 'minor', - 'major', - ], - }); - - return await run(prompt); + return chooseCLI('What type of changes are you goint to publish 🎁 ?', [ + 'patch', + 'minor', + 'major', + ]); }; export const ask = async (name, version) => { diff --git a/package.json b/package.json index 69e79d7..90e5a5d 100644 --- a/package.json +++ b/package.json @@ -32,6 +32,7 @@ "url": "git://github.com/coderaiser/wisdom.git" }, "dependencies": { + "@putout/cli-choose": "^1.0.1", "changelog-io": "^8.0.0", "currify": "^4.0.0", "enquirer": "^2.3.6",