FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

fix(create): initialize git once for new monorepos by jong-kyung · Pull Request #2417 · voidzero-dev/vite-plus · GitHub

fix(create): initialize git once for new monorepos - #2417

Merged
fengmk2 merged 6 commits into
voidzero-dev:mainfrom
jong-kyung:fix/create-monorepo-double-git-init
Aug 15, 2026
Merged

fengmk2 merged 6 commits into
voidzero-dev:mainfrom
jong-kyung:fix/create-monorepo-double-git-init

Conversation

Copy link
Copy Markdown
Collaborator

Description

Creating a new monorepo with vp create vite:monorepo handled git initialization through two separate code paths, which caused three related problems:

  • In verbose interactive mode without --git/--no-git, the user was prompted twice ("Initialize a git repository?" from resolveGitInit, then "Initialize git repository:" inside the monorepo branch).
  • When the two answers differed, the second answer was silently overridden because the later initGitRepository call keyed off the first prompt's result.
  • On the common (compact) path, git init ran twice: once via a direct spawn.sync right after scaffolding and again via initGitRepository after the monorepo rewrite.

Fix

  • Remove the duplicate prompt; resolveGitInit already asks up front before scaffolding.
  • Keep a single initGitRepository call, placed before the hook preflight so shouldSkipStagedMigrationForHooks sees the destination's intended git root (same reasoning as the standalone path).
  • Move the failure warning and stderr output into the shared initGitRepository helper so both the monorepo and standalone paths report a failed git init.

Creating a new monorepo prompted for git initialization twice in
verbose interactive mode and ran `git init` twice on the common path:
once through a direct spawn right after scaffolding and again through
`initGitRepository` after the monorepo rewrite. The second run also
used the first prompt's answer, so answering no to the second prompt
was silently overridden.

Remove the duplicate prompt and keep a single `initGitRepository` call
placed before the hook preflight, matching the standalone path, and
move the failure warning into the shared helper so both paths report
a failed `git init`.

netlify Bot commented Aug 11, 2026
edited
Loading

Copy link
Copy Markdown

Deploy Preview for viteplus-preview canceled.

Name Link
🔨 Latest commit 7cefbd8
🔍 Latest deploy log https://app.netlify.com/projects/viteplus-preview/deploys/6a800edb86e0da000861398e

jong-kyung self-assigned this Aug 11, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Bravo.

Reviewed commit: b880b1933b

ℹ️ 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".

jong-kyung marked this pull request as ready for review August 12, 2026 00:07
jong-kyung requested a review from fengmk2 August 12, 2026 00:07
fengmk2 added test: e2e Auto run e2e tests test: create-e2e Run `vp create` e2e tests labels Aug 15, 2026
fengmk2 merged commit b518dbb into voidzero-dev:main Aug 15, 2026
98 checks passed
jong-kyung deleted the fix/create-monorepo-double-git-init branch August 15, 2026 09:53
fengmk2 pushed a commit that referenced this pull request Aug 24, 2026
…1.4 support (#2536)

Fresh installs now use a split directory layout instead of a single
`~/.vite-plus` root. Unix follows the XDG base directory specification,
and Windows uses the standard `%LOCALAPPDATA%` and `%APPDATA%` folders.
Existing `~/.vite-plus` installs keep their current directory layout.
`vp migrate` also converts `tsup` projects, and `vp` now sends Bun `1.4`
package-manager commands to `bun` directly. The published npm package
shrank by about half, and the upgrade check no longer delays each
command.

### Breaking Changes

- Fresh installs now use a split directory layout instead of a single
root: XDG base directories on Unix, and the standard known folders on
Windows. Existing `~/.vite-plus` installs keep their current layout, and
the installer does not move their files. `VP_HOME` still selects the
single-root layout
([#2346](#2346)), by
@forehalo

| Category | Unix default | Windows default | Single-root (`VP_HOME`) |
  | --- | --- | --- | --- |
| bin | `~/.local/share/vite-plus/bin` | `%LOCALAPPDATA%\vite-plus\bin`
| `<root>/bin` |
| data | `~/.local/share/vite-plus` | `%LOCALAPPDATA%\vite-plus\data` |
`<root>` |
| cache | `~/.cache/vite-plus` | `%LOCALAPPDATA%\vite-plus\cache` |
`<root>/cache` |
  | config | `~/.config/vite-plus` | `%APPDATA%\vite-plus` | `<root>` |
| state | `~/.local/state/vite-plus` | `%LOCALAPPDATA%\vite-plus\state`
| `<root>` |

The installer configures your shell for the new location, and CI that
installs through `setup-vp` keeps the single-root layout automatically.
Update each hard-coded `~/.vite-plus/bin` path, such as a path in a
Dockerfile.

### Highlights

- `vp migrate` now converts `tsup` projects. It replaces the `tsup`
dependency and script with `vp pack`. It also changes `tsup.config.ts`
to a `tsdown.config.ts` that imports from `vite-plus/pack`
([#2434](#2434)), by
@KTrain5169
- Shell integrations now accept the global `-C` flag. `vp -C <dir> env
use` changes the environment of your current shell. The `-C<dir>` and
`-C=<dir>` forms also work. In zsh, Fish, Nushell, and PowerShell, `vpr`
completion keeps the working directory when it changes the command to
`vp run` ([#2508](#2508)),
by @simulacre7
- The published `vite-plus` npm package shrank from 1.05 MB to 516 kB, a
51% reduction. It now includes only Markdown files from the
documentation workspace. It no longer includes VitePress tooling,
images, or deployment files
([#2480](#2480)), by
@liangmiQwQ

### Features

- With Bun `1.4` or later, Vite+ forwards these commands and flags to
`bun`. Earlier Bun versions keep their fallback or unsupported behavior
and report the required Bun version
([#2513](#2513)), by
@jong-kyung
  - `vp dedupe` runs `bun dedupe`, including `--check`
  - `vp pm prune` runs `bun prune`
  - `vp pm audit --fix` runs `bun audit fix`
  - `vp add`, `vp remove`, and `vp update` send `--filter` to `bun`
  - `vp add --save-catalog` sends `--catalog` to `bun`
- The upgrade check no longer delays fast commands. It runs in a
separate process. It reports an available update during a later command,
and commands no longer wait for the registry
([#2380](#2380)), by
@liangmiQwQ
- Upgrade the bundled toolchain
([#2443](#2443),
[#2500](#2500),
[#2504](#2504),
[#2519](#2519),
[#2532](#2532)), by
@voidzero-guard[bot]:
  - `vite`: `8.2.1` to `8.2.2`
  - `rolldown`: `1.2.3` to `1.2.5`
  - `vitest`: `4.1.10` to `4.1.11`
  - `oxlint`: `1.77.0` to `1.79.0`
  - `oxfmt`: `0.62.0` to `0.64.0`
  - Oxc packages and crates: `0.143.0` to `0.146.0`
- Vite+ now accepts `@vitejs/devtools` `0.5.x`. The optional peer range
is `^0.4.0 || ^0.5.0`. This repository uses `0.5.2`.
- `oxfmt` and `oxlint` can report new issues after the upgrade. Run `vp
check` locally. Use `vp fmt` to fix formatting changes.
- `vp toolchain` draws its tree with Unicode glyphs. It no longer uses
ASCII connectors
([#2442](#2442)), by
@liangmiQwQ

### Fixes & Enhancements

- At a workspace root, bare app commands now use `defaultPackage` or
detected root configuration before they select a member package. A
workspace without member packages runs the command in the root
([#2530](#2530),
[#2533](#2533)), by
@fengmk2
- `vp up` no longer changes `"vite": "catalog:"` to a version alias
under `pnpm`. Catalog references now stay unchanged during an update.
Run `vp migrate` once to correct an existing project
([#2425](#2425)), by
@fengmk2
- If the server accepts range requests, an interrupted runtime download
continues from the bytes on disk. It does not start again
([#2452](#2452)), by
@tarikermis
- The local CLI shows the install instructions when you run a
global-only command such as `env`, `upgrade`, or `implode`
([#2522](#2522)), by
@jong-kyung
- `vp up -g` asks npm for globally installed package versions. A
project-level setting no longer makes the lookup fail and hide an
available update
([#2438](#2438)), by
@jong-kyung
- When hooks are disabled through `HUSKY=0`, `VP_GIT_HOOKS=0`, or
`VITE_GIT_HOOKS=0`, `vp config` skips the Git lookup. This lets `vp
config` run in a container without Git
([#2458](#2458)), by
@tarikermis
- `vp create vite:monorepo` now asks once about Git and runs `git init`
once ([#2417](#2417)), by
@jong-kyung
- `vp create` does not ask about pre-commit hooks when you choose not to
initialize Git
([#2477](#2477)), by
@liangmiQwQ
- `vp pack --no-config` does not read the Vite config. A local
`vite.config.*` file, its `pack` options, and its hooks no longer run
([#2486](#2486)), by
@jong-kyung
- `vp pack --help` shows the supported `--no-config` options
([#2487](#2487)), by
@jong-kyung
- `vp staged --no-concurrent` works again. `--concurrent` accepts
`true`, `false`, or a number greater than `0`. It rejects other values.
Vite+ also rejects `--no-cwd`, `--no-diff`, and `--no-diff-filter`
([#2501](#2501)), by
@RSS1102
- `vp` reads about 450 kB less JavaScript at start. It loads the
`--init` and `--migrate` helpers only when a command needs them
([#2490](#2490)), by
@jong-kyung
- The standalone `vp` binary is smaller. Vite+ no longer copies the
package-manager command tree, and it disables unused tar and dialoguer
features ([#2507](#2507)),
by @liangmiQwQ
- A generated Fish environment file escapes the special characters in a
path ([#2492](#2492)), by
@fengmk2
- A generated POSIX shell environment file escapes the special
characters in a path. It also removes each duplicate Vite+ bin entry
([#2494](#2494)), by
@fengmk2
- The generated `cmd.exe` wrapper preserves the exit status from `vp env
use`. It does not apply output after a failed command
([#2496](#2496)), by
@fengmk2
- `vp exec` resolves a relative `PATH` entry such as
`./node_modules/.bin` against the working directory of the command
([#2350](#2350)), by
@RSS1102
- Older GitLab `setup-vp` templates continue to work. The installer
selects the legacy layout for them. A template can select the new layout
with `VP_VPDIRS_AWARE=1`
([#2520](#2520)), by
@fengmk2
- The Windows installer checks the directory variables and the requested
version before it downloads a payload. It also repairs a broken
`current` junction
([#2505](#2505)), by
@fengmk2
- `install.sh` does not show shell configuration warnings when `CI=true`
([#2511](#2511)), by
@fengmk2
- On Windows, `vp implode` can remove Vite+ roots that contain long or
locked paths. A native helper does this work, and it retries cleanup and
writes an error log if cleanup fails
([#2510](#2510)), by
@fengmk2
- A Windows trampoline sidecar must have a `vite-plus-shim-v1` header.
The trampoline rejects one without that header instead of guessing the
install layout
([#2526](#2526)), by
@fengmk2

### Docs

- Document the `vite-plus/test` import surface
([#2413](#2413)), by
@jong-kyung
- Add `vp hooks` to the README command list
([#2446](#2446)), by
@lyzno1

### Chore

- Add Yii to the core team
([#2435](#2435)), by
@forehalo
- Include install e2e in the aggregate CI status
([#2439](#2439)), by
@jong-kyung
- Use the catalog for shared dependencies
([#2447](#2447)), by
@liangmiQwQ
- Replace `husky` with `vp` git hooks in this repo
([#1001](#1001)), by
@Arthie
- Exclude test fixtures from Renovate scanning
([#2457](#2457)), by
@fengmk2
- Keep the binary size report in the job summary for fork PRs
([#2448](#2448)), by
@fengmk2
- Update crate-ci/typos action to v1.49.0
([#2467](#2467)), by
@renovate[bot]
- Update GitHub Actions
([#2474](#2474)), by
@renovate[bot]
- Update the `napi` crate to `3.12.2`
([#2527](#2527)), by
@fengmk2
- Ignore every `vite-task` git dependency in Renovate
([#2478](#2478)), by
@fengmk2
- Link preview installers and pin install scripts in CI
([#2499](#2499)), by
@fengmk2
- Cover PowerShell setup in tests
([#2495](#2495)), by
@fengmk2
- Cover Nushell file-based use in tests
([#2497](#2497)), by
@fengmk2
- Remove redundant dist/test inclusion from the CLI package
([#2506](#2506)), by
@jong-kyung
- Redact the `bun` build hash in snapshots
([#2514](#2514)), by
@jong-kyung
- Align the command-routing RFC with the current global CLI
([#2528](#2528)), by
@jong-kyung
- Fold v0.2.9 release learnings into the release-manager skill
([#2429](#2429)), by
@fengmk2
- Add `vp_pm_cli_macros` and `vp_toolchain` to the repo map
([#2524](#2524)), by
@jong-kyung

### Bundled Versions

| Tool | Version | Source |
| --------------- | ---------- |
---------------------------------------------------------------------------------
|
| vite | `8.2.2` |
[`de1111a`](vitejs/vite@de1111a)
|
| rolldown | `1.2.5` |
[`84c904b`](rolldown/rolldown@84c904b)
|
| tsdown | `0.22.14` | [npm](https://npmx.dev/package/tsdown/v/0.22.14)
|
| vitest | `4.1.11` | [npm](https://npmx.dev/package/vitest/v/4.1.11) |
| oxlint | `1.79.0` | [npm](https://npmx.dev/package/oxlint/v/1.79.0) |
| oxlint-tsgolint | `7.0.2001` |
[npm](https://npmx.dev/package/oxlint-tsgolint/v/7.0.2001) |
| oxfmt | `0.64.0` | [npm](https://npmx.dev/package/oxfmt/v/0.64.0) |

### Upgrade

```bash
vp upgrade
```

### New Contributors

@simulacre7

**Full Changelog**:
v0.2.9...v0.3.0
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

Labels

test: create-e2e Run `vp create` e2e tests test: e2e Auto run e2e tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants


Back | FazBrowse Home | New Git URL