Repository navigation
feat(init): accept scaffold choices as flags - #495
Merged
Merged
Conversation
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.
Fixes #491.
Adds
--toolchain,--framework,--starterand--deploytovoid init, with the same values as the prompts. Without an interactive terminal, a missing choice no longer prompts: init prints the flag it needs and its values, and exits with code 1. Unknown values fail the same way.create-voidforwards the arguments after the project name tovoid init:run()uses a shell on Windows, so only arguments made of letters, digits,-and=are forwarded. Without a terminal and a project name, it fails instead of asking for the name.Out of scope: signing in after choosing
cloudflareorvoid, and the prompts for existing projects (database, demo), stay interactive. The docs suggest--deploy noneandvoid connectlater for non-interactive runs.Tests:
init.test.tsmocks the prompts, so itsbeforeEachnow gives init a terminal. It also setsCI=true, so Git and AGENTS.md setup keep skipping their prompts as they do in CI.Checked:
init.test.ts(3 new tests),cli-help.test.ts, and thecreate-voidtestsvoidandcreate-void14 tests in
init.test.tsfail locally on main too (vite-plusresolves, so the install command differs). This PR adds no new failures.