Allow vp create to scaffold into a non-empty directory
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 55/100
Research direction
Start at the vp create entry point and reproduce vp create vite:application --directory . in directories containing .git, README.md, and .DS_Store, including interactive mode. Define the supported non-empty-directory behavior, including collision handling and confirmation, then verify existing files remain intact and scaffolding still succeeds.
Written by the indexing model from the issue text.
Description
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.
- Dominant language
- Rust
- Stars
- 6k
- Forks
- 271
- Avg merge
- 19h 51m
- Merged PRs (30d)
- 140
Getting set up
Starts the project's dev container in your browser, under your own GitHub account.
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from voidzero-dev/vite-plus
-
`vite-plus/test/browser-playwright` types import `playwright`, which vite-plus does not declare, so provider options go unchecked under pnpmPossibly taken @liangmiQwQ claimed this 2 days ago. Openpending triage
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
voidzero-dev/vite-plus#2854 · 1 assignee ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
voidzero-dev/vite-plus#2849 ·
Maintainers usually reply within 1 day
-
`vp migrate` fails when there is no `package.json`Possibly taken @TheAlexLichter claimed this 8 days ago. Openpending triage
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
voidzero-dev/vite-plus#2801 · 1 reaction ·
Maintainers usually reply within 1 day
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
voidzero-dev/vite-plus#2097 · 10 comments · 2 reactions ·
Maintainers usually reply within 1 day
-
pending triage
Difficulty 3/5 1-2 days Newbie friendliness 72/100
voidzero-dev/vite-plus#2873 · 2 reactions ·
Maintainers usually reply within 1 day
All issues in voidzero-dev/vite-plus
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
tree-sitter/tree-sitter#6005 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
maplibre/maplibre-tile-spec#1844 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 92/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
rust-windowing/winit#4731 ·
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day