As the Wizard is a core part of onboarding new users to Kusk and therefore it should be well written and tested to increase confidence when releasing it.
This PR splits the wizard up into smaller components that we can test in isolation / mock where the real thing isn't required
Changes
create internal wizard prompt package with a default implementation of a prompter interface. The idea behind this is that we can't use the promptui package in tests because a) it logs to stdout b) requires an interactive stdin session. This way we can mock a test prompter in the tests and have it return set values
Each generator now has a dedicated flow and the wizard itself simply fetches the flows and runs them without calling a specifically named function like flowAmbassador. This separates concerns as now the wizard doesn't need to care about what flow to run, it hands that off to another component.
As the Wizard is a core part of onboarding new users to Kusk and therefore it should be well written and tested to increase confidence when releasing it.
This PR splits the wizard up into smaller components that we can test in isolation / mock where the real thing isn't required
Changes
flowAmbassador
. This separates concerns as now the wizard doesn't need to care about what flow to run, it hands that off to another component.Checklist