Inquirer.js icon indicating copy to clipboard operation
Inquirer.js copied to clipboard

[Breaking] Migrate `inquirer` to typescript + dual module bundle

Open SBoudrias opened this issue 1 year ago • 2 comments

Need much more work on fixing core types - might do & ship; but might not.

SBoudrias avatar Jun 29 '24 21:06 SBoudrias

Thinking about this some more, I think what is a more likely outcome is to release inquirer without the typescript definitions. @types/inquirer are pretty good, and I don't want to bother replicating them right now.

If shipping as-is with definition, the experience would be worse for TS users; simply due to the migration process having been mostly automated.

But, the goal is to dual ship CJS/ESM so we remove a big pain point; not catching up on types (if someone want to help do just that, they're absolutely welcome to.) And this goal, I think we reach if no emitting declarations 🤔

I'll leave open a few days while I reflect on this. Feel free to comment one way or another!

SBoudrias avatar Jun 30 '24 21:06 SBoudrias

Small note, you replaced all /Inquirer.js/ to /Inquirer.mjs/ urls

prisis avatar Jun 30 '24 22:06 prisis

So, due to usage of both export {} and export default, it'd still be a breaking change from v8.x to use require('inquirer').default. I dug this more today, and I don't think there's a way around this (it also creates issues with supporting CJS + typescript; but the other issue gets in a way before getting there.)

So thinking we might just go as-is with default 🤔

SBoudrias avatar Jul 01 '24 19:07 SBoudrias

Moving to #1461 with a v10 release branch.

SBoudrias avatar Jul 07 '24 18:07 SBoudrias