GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Allow vp create to scaffold into a non-empty directory · Issue #2521 · voidzero-dev/vite-plus

Allow vp create to scaffold into a non-empty directory #2521

New issue
Copy link
New issue
Copy link
Open
Open
Allow vp create to scaffold into a non-empty directory#2521
Copy link
Labels
enhancementNew feature or request

Description

@iangregsondev
iangregsondev
opened on Aug 21, 2026
Issue body actions

Description

As a developer using Vite+ I want vp create to scaffold into a directory that already has content, so that I can add Vite+ to an existing project instead of only starting from an empty folder.

Today vp create --directory . refuses if the target holds anything other than .git:

Use --directory to specify a different location or remove the directory first
Target directory "…" is not empty

.git is already excluded — both as a directory in a normal clone and as a file in a git worktree — so support for existing repositories looks intended. But one unrelated entry blocks it, and an existing repository almost always has one.

I hit this adding a Vite+ frontend build to a Python project (a ComfyUI custom node pack). The repository root holds README.md, LICENSE, and pyproject.toml, all of which have to stay, so vp create cannot run there at all. My workaround was to scaffold into a scratch directory and copy the result across by hand, which loses the interactive prompts and is easy to get wrong.

Verified on v0.2.9, one scaffold per row:

Target directory contains vp create vite:application --directory .
.git directory (plain repo) succeeds
.git file (git worktree) succeeds
.git + README.md refuses
README.md only refuses
.DS_Store only refuses

Suggested solution

A flag that permits a non-empty target:

vp create vite:application --directory . --force

Behaviour: write the template into the directory, leave existing files alone, and overwrite only where template and directory collide. In interactive mode, listing the files that would be overwritten and asking to confirm would make it safe to run against real work.

Alternative

A lighter change that would cover most cases on its own: widen the set of entries the emptiness check ignores, alongside .git, to the files usually present in a fresh repository — README.md, LICENSE, .gitignore, .gitattributes, .DS_Store, .vscode/, .idea/.

Merging into an existing package.json rather than replacing it would be the ideal end state, but either of the above would unblock the case on its own.

Additional context

Platform: macOS (darwin 25.5.0), Node 24.19.0, pnpm 11.22.0, vp v0.2.9.

Two smaller things noticed while narrowing this down, both in the same area. Happy to split either into its own issue.

First, when the directory name is not a valid npm package name, vp create generates a random unrelated name rather than sanitising or prompting. My directory is ComfyUI-DenoiseHQNodes.feat-1-save-image-node, which is invalid because of the uppercase letters. Three runs produced appoint-track, perspective-detailed, and nation-virtually. In non-interactive mode that name lands in package.json unnoticed. Lowercasing and replacing invalid characters would give a usable default here.

Second, when the emptiness check fails in interactive mode the reason is not shown — output ends at Scaffolding failed (0s). Non-interactive mode does print Target directory "…" is not empty. This may share a code path with #2453.

Validations

  • Read the Contributing Guidelines.
  • Confirm this request is for Vite+ itself and not for Vite, Vitest, tsdown, Rolldown, or Oxc.
  • Check that there isn't already an issue requesting the same feature.
Reacted by Leslie Lau

Activity

  1. liangmiQwQ
    added
    enhancementNew feature or request
    on Aug 21, 2026
  2. m0g3r
    added a commit that references this issue on Sep 28, 2026

    fix(create): sanitize the derived package name instead of inventing one

    336086a
  3. kshanxs commented on Oct 10, 2026

    @kshanxs
    kshanxs
    on Oct 10, 2026
    Contributor
    More actions

    I looked into this and would like to pick it up. Two findings: widening the ignore list alone does not unblock vite:application, because create-vite runs its own emptiness check (only .git is ignored) and --overwrite empties the directory; and the bundled/monorepo templates would overwrite an existing README.md / .gitignore.

    Proposal: add a "keep existing files" path — scaffold into a temp directory, then merge into the target, skipping files that already exist and listing the ones skipped. Interactive mode gets it as a third option next to "Cancel" and "Remove existing files"; non-interactive mode gets a flag (--force, or a name you prefer). Would you accept a PR along those lines, and should collisions keep the existing file or overwrite it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402775 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.