Skip to content

fix(create): honor non-interactive mode in scaffolded generators - #2677

Draft
SaKaNa-Y wants to merge 1 commit into
voidzero-dev:mainfrom
SaKaNa-Y:fix/generator-non-interactive
Draft

fix(create): honor non-interactive mode in scaffolded generators#2677
SaKaNa-Y wants to merge 1 commit into
voidzero-dev:mainfrom
SaKaNa-Y:fix/generator-non-interactive

Conversation

@SaKaNa-Y

Copy link
Copy Markdown
Contributor

Running a scaffolded local generator with vp create <generator> --no-interactive still entered Bingo's prompts when required arguments were missing. With closed stdin, this exited with an unsettled top-level await instead of an actionable validation error. Bingo's --skip-requests flag does not disable prompts.

Pass VP_CREATE_INTERACTIVE to local Bingo generators. The starter uses Bingo's programmatic API in non-interactive mode, validates CLI arguments and required template options before generation, and rejects existing output directories. Interactive runs, help, and version requests retain the Bingo CLI path.

This applies to newly scaffolded generators. Existing copied entrypoints require an update, and custom template options need corresponding CLI argument declarations; the starter README documents both requirements.

Validation:

  • pnpm exec vitest run packages/cli/src/create/__tests__: 194 tests passed.
  • pnpm exec tsc --project packages/cli/templates/generator/tsconfig.json: passed.
  • cargo test -p vp_cli_snapshots -- create_generator_: both generator cases passed in comparison mode after recording and reviewing the updated snapshot.
  • Focused formatting and lint checks passed.

The regression covers missing arguments without prompts, no output directory on validation failure, preservation of existing files, successful file generation, and the interactive execution path. Validation was scoped to generator behavior; the full repository test suite was not run.

Pass the interaction mode to local Bingo generators and validate starter arguments before invoking the programmatic API. Preserve the interactive CLI path and document the update needed for existing generators.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant