Skip to content

[serverless] Migrate to @inquirer/prompts and remove inquirer-checkbox-plus-prompt#2255

Closed
Drarig29 wants to merge 4 commits into
masterfrom
corentin.girard/migrate-inquirer
Closed

[serverless] Migrate to @inquirer/prompts and remove inquirer-checkbox-plus-prompt#2255
Drarig29 wants to merge 4 commits into
masterfrom
corentin.girard/migrate-inquirer

Conversation

@Drarig29

@Drarig29 Drarig29 commented Apr 10, 2026

Copy link
Copy Markdown
Contributor

What and why?

This PR migrates our interactive prompt handling from the legacy inquirer package to @inquirer/prompts and removes inquirer-checkbox-plus-prompt. The rewritten prompt stack is ESM-only, so this also adds a small runtime loader that keeps prompt usage compatible with the repo's current CommonJS build. As a side effect, removing the old prompt packages drops one direct lodash path from the runtime dependency graph.

How?

  • Replace legacy question-object prompt calls in packages/base, packages/plugin-lambda, and packages/plugin-cloud-run with @inquirer/prompts helpers.
  • Reimplement Lambda function selection with a local filter + checkbox flow instead of inquirer-checkbox-plus-prompt.
  • Add a shared prompt loader for the ESM package, and teach Knip to ignore @inquirer/prompts, glob, and tsdown because they are used through dynamic/runtime tooling paths that Knip does not statically resolve.
  • Update prompt tests, dependency metadata, LICENSE-3rdparty.csv, and yarn.lock to match the migration.
  • Validate locally with yarn lint:packages, yarn lint:all, yarn tsc:build, JEST_USE_WATCHMAN=0 yarn test --watchman=false packages/base/src/helpers/__tests__/prompt.test.ts packages/plugin-lambda/src/__tests__/prompt.test.ts, and node bin/check-licenses.js.

Review checklist

  • Feature or bugfix MUST have appropriate tests (unit, integration)

@Drarig29 Drarig29 added the serverless Related to [aas, cloud-run, lambda, stepfunctions] label Apr 10, 2026
@Drarig29 Drarig29 changed the title Migrate prompt handling to @inquirer/prompts and remove checkbox-plus [serverless] Migrate to @inquirer/prompts and remove inquirer-checkbox-plus-prompt Apr 10, 2026
@Drarig29 Drarig29 marked this pull request as ready for review April 10, 2026 17:19
@Drarig29 Drarig29 requested review from a team as code owners April 10, 2026 17:19
@Drarig29 Drarig29 requested a review from nina9753 April 10, 2026 17:19

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

any way we can avoid handwriting the types here? this feels like itll quickly become a problem to update in the future

Comment on lines +102 to +110
// eslint-disable-next-line @typescript-eslint/no-implied-eval -- TypeScript rewrites plain `import()` to `require()` in our CommonJS emit.
const importInquirerModule = new Function('specifier', 'return import(specifier)') as (
specifier: string
) => Promise<unknown>

// Preserve a real runtime dynamic import so Node can load the ESM-only prompt package from CommonJS output.
export const loadPrompts = () => importInquirerModule('@inquirer/prompts') as Promise<InquirerPrompts>

export const loadCore = () => importInquirerModule('@inquirer/core') as Promise<InquirerCore>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this needed because we emit commonjs and the new inquirer package is esm only? if so, I'd love to discuss with the guild what it would take to migrate our package from commonjs to esm since it seems like that's the future of the ecosystem

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

serverless Related to [aas, cloud-run, lambda, stepfunctions]

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants