Repository navigation
feat(tui): put every command in the wizard, not just new - #13
Merged
Merged
Conversation
A bare `scaffold` walked to a `scaffold new` command and nothing else, so the two commands added since — update and publish — existed only for someone who already knew to type them. The wizard is how a first-time user finds a command; a command missing from it is a command they will not find. It now asks what to do first. update and publish act on a project that already exists, so outside one they are not offered at all — the same reason a web project is never asked about a database. With one action to choose from the screen is skipped: a menu with one answer asks nothing. A test asserts every action the menu offers is one scaffold's own dispatch accepts, so the menu and the case statement cannot drift. is_scaffold_project comes out of `scaffold` while passing: the same two-line check had been written out three times, and the wizard needed a fourth.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this changes
A bare
scaffoldwalked to ascaffold newcommand and nothing else. The two commands added since —updateandpublish— existed only for someone who already knew to type them, and the wizard is how a first-time user finds a command in the first place.It now asks what to do first:
updateandpublishboth act on a project that already exists, so outside one they are not offered at all — the same reasoningdocs/tour/09-wizard.mdalready gives for never asking awebproject about a database: a refusal the user can walk into is worse than one they cannot. With one action to choose from the screen is skipped, because a menu with one answer asks nothing and costs a keystroke.publishasks its one real question (visibility, private first, matching what the flag defaults to unset).updateasks nothing — it takes only a directory, and the wizard already knows which.Two smaller things, both while passing:
is_scaffold_projectcomes out ofscaffold. The same two-line check was written out three times and the wizard needed a fourth.y/Ngate is now one function rather than three copies.How it was verified
privateis offered first, and that the answer column still fits the widest question — measured from the prompts, so a new screen widens the column rather than overflowing it.scaffold's ownmainhas a case for, so the menu and the dispatch cannot drift. This repository has shipped a second copy of a list that then drifted twice (scripts/adapter-matrix.shexists because of the first).scaffold publish --public, and asserts the name prompt — which belongs tonew— was never shown.Checklist
mise run lintpassesmise run test-runnerpasses