Skip to content

Commit 5440075

Browse files
committed
docs(rfc): document global CLI fallback
1 parent 0ad8765 commit 5440075

1 file changed

Lines changed: 9 additions & 9 deletions

File tree

rfcs/exec-command.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ Based on pnpm exec behavior (reference: `exec/plugin-commands-script-runners/src
179179
### Key Differences from vpx
180180

181181
- `vp exec` prepends only `./node_modules/.bin` from the current directory — it does **not** walk up parent directories. Use `vpx` if you want monorepo root binaries.
182-
- `vp exec` never falls back to global vp packages or remote download — commands resolve through `node_modules/.bin` + system PATH only.
182+
- After the Vite+ CLI is selected, `vp exec` never falls back to globally installed executable packages or remote downloads — commands resolve through `node_modules/.bin` + system PATH only.
183183

184184
## Implementation Architecture
185185

@@ -206,7 +206,7 @@ Route in `execute_command()`:
206206
Commands::Exec { args } => commands::delegate::execute(cwd, "exec", &args).await,
207207
```
208208

209-
The global CLI always delegates `exec` to the local CLI — there is no fallback path or direct execution in the global CLI. This follows the same unconditional delegation pattern as other Category C commands.
209+
The global CLI always delegates `exec` to the JavaScript CLI. Delegation resolves the project's local `vite-plus` first, then falls back to the globally installed `vite-plus` when no local CLI is available. When this fallback occurs inside a project, `vp` recommends migration if `vite-plus` is not declared as a dependency, or recommends installing dependencies if it is declared but unavailable. The Rust global CLI has no direct `exec` implementation.
210210

211211
### Local CLI
212212

@@ -256,16 +256,16 @@ The following existing code is reused:
256256

257257
## Design Decisions
258258

259-
### 1. Unconditional Delegation (No Global CLI Fallback)
259+
### 1. Local-First Delegation with Global CLI Fallback
260260

261-
**Decision**: The global CLI always delegates `exec` to the local CLI. There is no fallback path for projects without vite-plus as a dependency.
261+
**Decision**: The global CLI delegates `exec` to the project-local `vite-plus` when available. Otherwise, it provides migration or installation guidance inside projects and continues with the globally installed `vite-plus` CLI.
262262

263263
**Rationale**:
264264

265265
- Simplifies the global CLI — no need for a direct-execution codepath
266266
- Consistent with how all Category C commands are dispatched
267-
- The local CLI has all the workspace awareness needed for `--recursive`, `--filter`, etc.
268-
- Projects using `vp exec` are expected to have vite-plus installed
267+
- The delegated CLI has all the workspace awareness needed for `--recursive`, `--filter`, etc.
268+
- The warning directs projects to migrate or install their declared dependencies without making the global fallback unusable
269269

270270
### 2. No Directory Walk-Up (Unlike vpx)
271271

@@ -278,14 +278,14 @@ The following existing code is reused:
278278
- Walking up would blur the boundary between package-level and workspace-level binaries
279279
- Use `vpx` if you want walk-up behavior
280280

281-
### 3. Workspace Features Only via Local CLI
281+
### 3. Workspace Features Use the Delegated CLI
282282

283-
**Decision**: `--recursive`, `--workspace-root`, `--filter`, `--parallel`, `--reverse`, `--resume-from`, and `--report-summary` only work when vite-plus is a local dependency (local CLI handles them).
283+
**Decision**: `--recursive`, `--workspace-root`, `--filter`, `--parallel`, `--reverse`, `--resume-from`, and `--report-summary` are handled by the resolved `vite-plus` CLI, whether project-local or the global fallback.
284284

285285
**Rationale**:
286286

287287
- These features require workspace awareness from vite-task infrastructure
288-
- The global CLI fallback is for simple, single-directory exec
288+
- The project-local and globally installed CLIs use the same workspace-aware implementation
289289
- This is consistent with how `vp run` handles workspace features
290290

291291
### 4. Same Env Var Convention

0 commit comments

Comments
 (0)