Closed Exortions closed 1 year ago
I'm happy to review PRs starting on the new packages. I wanted to add TS, just doesn't have the time.
With a progressive strategy and a nice roadmap, this could be done.
The first stab is launched over https://github.com/SBoudrias/Inquirer.js/pull/1112 - there's a fair amount of work, but I explained which files to focus on there. We can do them one by one!
Yep, you should create a new branch for TypeScript.
Nevermind, looks like you already did 😅
@SBoudrias I'll be working on packages/core/src/lib/screen-manager.js.
@SBoudrias I'd like to help migrate the other packages. Can I work on @inquirer/password and @inquirer/select and others if they are free as well?
I'll take @inquirer/checkbox as a reference
@TDP17 that'd be great! I'll leave those to you for at least a week. Feel free to send an incomplete PR if you get stuck somewhere; that way I'll know the progress and can help take the branch over if I want to wrap this up sooner 😄
If I want to convert my plugin to typescript https://github.com/mokkabonna/inquirer-autocomplete-prompt is the approach here the way to go? Import from @inquirer/core and use the createprompt?
type SelectConfig = AsyncPromptConfig & {
choices: { value: string; name?: string; description?: string; disabled?: boolean }[];
pageSize?: number;
};
export default createPrompt<string, SelectConfig>((config, done) => {
Hey @mokkabonna, yes that'd be the ideal. One thing to note is that afterward your custom prompt will be usable standalone (which I think overall is better.)
But it won't be register-able through inquirer.registerPrompt
since I didn't wrap up writing the new core inquirer module yet. If you're curious, the WIP is in https://github.com/SBoudrias/Inquirer.js/pull/1173, but there's still missing a lot (and I'm considering the need to add a backward compatibility layer since otherwise all custom prompt would stop working with an eventual new major release.)
Ok nice to know. I try to stay as aligned with what you are doing here as I can so I will then probably go down this route as well.
I'll mark this one as complete since the new package is out and in typescript https://github.com/SBoudrias/Inquirer.js/discussions/1214
Refactoring the codebase to TypeScript in my opinion would have a few advantages:
Of course, I understand if TypeScript isn't your thing, but if it is, I'd be happy to make a PR for at least some (if not most) of the packages.