Skip to content

feat!: CLI Genie v2 - TypeScript rewrite - #1

Merged
bentoms-dev merged 2 commits into
mainfrom
v2-modernise
Nov 3, 2026
Merged

bentoms-dev merged 2 commits into
mainfrom
v2-modernise

Conversation

@bentoms-dev

Copy link
Copy Markdown
Owner

What does this change?

Rewrites CLI Genie as v2.0.0 in TypeScript. Merging this publishes 2.0.0 to npm through the Release workflow, using trusted publishing.

Fixes the broken 1.0.x package:

  • CliGenie wasn't included in the published package.
  • main pointed at the example script.
  • require('cli-genie').CliGenie was undefined.
  • Inquirer 9 couldn't be loaded with require.
  • when never received earlier answers, so conditional questions never appeared.

New:

  • ESM + CJS builds with type definitions.
  • 10 step types, with message, default and choices computable from earlier answers.
  • A review screen where users can change any answer, a progress counter and a genie theme.
  • A non-interactive mode (fromArgv / fromEnv) with type conversion and validation.
  • Hooks, typed errors and clean Ctrl+C handling.
  • JSON wizards and a cli-genie command.
  • The v1 API still works through compatibility helpers.

Breaking:

  • Requires Node 22.13+.
  • run() resolves with the answers instead of printing them.
  • Errors are thrown instead of setting process.exitCode.

See the CHANGELOG and the README's "Migrating from v1" section.

Checklist

  • npm run check passes: typecheck, lint, format check, 39/39 tests and build all pass locally
  • Tests added or updated
  • Docs (README) updated if the public API changed
  • Changeset added (npm run changeset) if this affects users: not needed, because the version is already set to 2.0.0 and CHANGELOG.md is written by hand. changeset publish publishes it because 2.0.0 isn't on npm yet.

bentoms-dev and others added 2 commits November 3, 2026 14:43
Fixes the broken 1.0.x package: CliGenie was not shipped, main pointed at
the example, the documented named export was undefined, inquirer 9 could not
be required, and `when` never received earlier answers.

- TypeScript source with ESM + CJS builds and type definitions
- 10 step types with dynamic message/default/choices
- Review screen with change-an-answer, progress counter, genie theme
- Non-interactive mode with fromArgv/fromEnv, coercion and validation
- Hooks, typed errors and clean Ctrl+C handling
- JSON wizard definitions and a `cli-genie` command
- v1 API kept working through compatibility helpers
- Vitest suite, ESLint, Prettier, CI matrix, Dependabot and Changesets
  releases using npm trusted publishing with provenance

BREAKING CHANGE: requires Node 22.13+; run() resolves with the answers
instead of logging them and throws errors instead of setting exitCode.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@bentoms-dev
bentoms-dev merged commit f15be01 into main Nov 3, 2026
5 checks passed
@bentoms-dev
bentoms-dev deleted the v2-modernise branch November 3, 2026 13:46
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