Skip to content

fix(create): scaffold libraries in git directories - #2287

Merged
fengmk2 merged 4 commits into
voidzero-dev:mainfrom
RSS1102:fix/library-scaffold-git-directory
Aug 3, 2026
Merged

fix(create): scaffold libraries in git directories#2287
fengmk2 merged 4 commits into
voidzero-dev:mainfrom
RSS1102:fix/library-scaffold-git-directory

Conversation

@RSS1102

@RSS1102 RSS1102 commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Summary

  • allow the built-in vite:library template to scaffold into a target containing only .git by passing --force to degit
  • re-check target availability immediately before degit so existing user files are not overwritten
  • surface captured degit output and fail when the command does not produce package.json
  • cover .git directories, worktree .git files, user-file preservation, and degit failure propagation

Testing

  • vp check
  • pnpm -F vite-plus test src/create/__tests__ (13 files, 185 tests)
  • cargo test -p vite_cli_snapshots -- create_library_in_git_directory (record and compare modes)
  • manual end-to-end vp create vite:library --directory . in a freshly initialized Git repository

Fixes #2254

@netlify

netlify Bot commented Jul 31, 2026

Copy link
Copy Markdown

Deploy Preview for viteplus-preview canceled.

Name Link
🔨 Latest commit 8b25b75
🔍 Latest deploy log https://app.netlify.com/projects/viteplus-preview/deploys/6a700e54d4f9f30008e2ffc0

@RSS1102
RSS1102 marked this pull request as ready for review August 1, 2026 13:51
@fengmk2

fengmk2 commented Aug 3, 2026

Copy link
Copy Markdown
Member

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Hooray!

Reviewed commit: 8b25b757f7

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@fengmk2 fengmk2 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.

@RSS1102 Thanks!

@fengmk2 fengmk2 self-assigned this Aug 3, 2026
@fengmk2
fengmk2 merged commit 77f9977 into voidzero-dev:main Aug 3, 2026
59 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.

vp create vite:library fails ("Scaffolding failed" / silent exit 0) when target dir is non-empty (e.g. contains .git), while vite:monorepo succeeds

2 participants