Skip to content

fix(init): clarify starter messages and cd into a new subfolder - #853

Merged
cpojer merged 1 commit into
voidzero-dev:mainfrom
morinokami:fix/init-output-messages
Nov 17, 2026
Merged

cpojer merged 1 commit into
voidzero-dev:mainfrom
morinokami:fix/init-output-messages

Conversation

@morinokami

Copy link
Copy Markdown
Collaborator

This PR fixes the output of void init when it creates a new project. Some messages were misleading, and the suggested dev command did not work when init created the project in a new subfolder.

More PRs will follow to shorten the rest of the void init output in the style of vp create, for example with a short summary instead of one line per created file.

Changes

No "skipping demo" after creating a starter

Right after writing the starter's files, init printed "Project already has pages, routes, or migrations, skipping demo". This reads as if init found files it did not expect, or failed to add something. The demo is only offered to existing projects without pages, routes, migrations or a schema. A new starter already comes with its own pages, so there is nothing to report. The demo check now runs only for existing projects, which keep all three of its messages.

No repeat of the database chosen for a starter

Right after the user chose the database (at the starter prompt or with --starter), init repeated it: "Using default D1 (SQLite) configuration", or "Configured PostgreSQL in void.config.ts" for PostgreSQL. The D1 line also uses the blue ● marker, which stands out more than the gray lines around it. The starter flow now writes the database setting without a message. Existing projects keep these lines, because there they tell whether void.config.ts changed.

No progress wording before the questions

"Empty project detected. Scaffolding a Pages starter..." reads like a progress line, but init then asks for the toolchain, framework and starter before it writes anything. The new wording, "Creating a Pages starter.", drops the trailing "...".

cd in the dev command for a new subfolder (bug fix)

When init runs in a non-empty folder and the user chooses "Create a new subfolder", the shell stays in the parent folder. The last line still said Run `vp dev` , which does not start the new app from there. The Git (optional) hint already covers this case with git -C <path>, and vp create prints cd my-app && vp dev. The last line now starts with cd <folder> && when the project is not in the current folder. The folder is relative to the shell and quoted like the Git hint. Both now use the new init-shell.ts.

Before / after

New project (--git --toolchain vite-plus --framework react --starter sqlite --deploy none). Blank lines are omitted and the vp install output is shortened.

-● Empty project detected. Scaffolding a Pages starter...
+● Empty project detected. Creating a Pages starter.
 ◇ Updated pnpm-workspace.yaml with approved builds
 ◇ Updated package.json with starter scripts and dependencies
 ◇ Created void.config.ts
 …
 ◇ Created .gitignore
-● Using default D1 (SQLite) configuration
 ◇ Created tsconfig.json
 ◇ Pinned worker compatibility_date in void.config.ts
 ◇ Created AGENTS.md with Void instructions
 ● Bundled Void docs: node_modules/void/docs/
-● Project already has pages, routes, or migrations, skipping demo
 ◇ Installing dependencies with vp
   … (vp install output)
 ◇ Installed dependencies with vp
 ◇ Generating initial Drizzle migration
 ◇ Generated initial Drizzle migration
 ● Git (optional): git add -A && git commit -m "chore: initial commit"
 ✓ Project initialized. Run `vp dev` to start developing.

With --starter postgresql, the DATABASE_URL note stays:

 ◇ Created .gitignore
-◇ Configured PostgreSQL in void.config.ts
 ╭─PostgreSQL local dev──────────────────────────────╮

From a non-empty parent directory, choosing "Create a new subfolder" and my-app:

 ● Git (optional): git -C /path/to/parent/my-app add -A && git -C /path/to/parent/my-app commit -m "chore: initial commit"
-✓ Project initialized. Run `vp dev` to start developing.
+✓ Project initialized. Run `cd my-app && vp dev` to start developing.

Design decisions

  • The starter flow passes { quiet: true } to applyDatabaseDialect(), whose branches are unchanged. Existing projects print the same messages.
  • Only the last line gets the cd. The DATABASE_URL note and the demo note still say vp dev.
  • A folder name that starts with - becomes cd ./-name, as in vp create, because cd - changes to the previous directory.
  • The Git (optional) hint keeps its absolute git -C path.

Checked

  • init.test.ts, init-git.test.ts and the new init-shell.test.ts. The new assertions fail without the source changes.
  • vp run check, vp lint and vp fmt --check
  • Full suite (vp test run): 815 files passed, 1 skipped
  • node --test .github/scripts/packed-*.test.mjs, and the packed consumer with npm and pnpm (React). The Vite+ variant could not finish locally: the global vp (1.5.0) waits for a reply to its terminal query, which the pseudo-terminal in packed-init.mjs does not send. A bare vp install in an empty project stalls the same way.
  • The built CLI before (void@1.9.1, whose init code matches the base commit) and after, for the three flows above.

🤖 Generated with Claude Code

Scaffolding a starter no longer reports that the project "already has
pages, routes, or migrations, skipping demo", and it no longer repeats
the database that the starter prompt just showed. The empty-project
notice now reads "Creating a Pages starter." because prompts follow it.

When init creates the project in a new subfolder, the final dev command
starts with `cd <folder> &&`, since the shell stays in the parent
directory. The initial commit hint shares the same path quoting.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@morinokami
morinokami marked this pull request as draft November 16, 2026 13:18

@cpojer cpojer left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice improvements and fixes, thanks!

@cpojer
cpojer marked this pull request as ready for review November 17, 2026 00:28
@cpojer
cpojer merged commit fbcd964 into voidzero-dev:main Nov 17, 2026
14 of 18 checks passed
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.

2 participants