You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(cli): pack runnable ranking requires a pack block or the tsdown default entry
A Vite config without a pack block does not make bare vp pack succeed, so
it no longer counts as pack-runnable; document the per-command runnable
rules normatively in the RFC and docs.
Copy file name to clipboardExpand all lines: docs/guide/monorepo.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -197,7 +197,7 @@ error: `vp build` at the workspace root needs a target package.
197
197
Or run every package's build script: vp run -r build
198
198
```
199
199
200
-
Packages that look runnable for the command (an `index.html` or `vite.config.*` for `dev` / `build` / `preview`, a library entry for `pack`) are ranked first in both the picker and the listing.
200
+
Packages that look runnable for the command are ranked first in both the picker and the listing: a `vite.config.*`or root `index.html`for `dev` / `build` / `preview`, and a `pack` config block or tsdown's default `src/index.ts` entry for `pack`.
Copy file name to clipboardExpand all lines: rfcs/cwd-flag.md
+17-1Lines changed: 17 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -276,11 +276,27 @@ The global binary also resolves the local `vite-plus` install from `<dir>`, matc
276
276
277
277
### Picker contents
278
278
279
-
- One row per workspace package: name plus relative path. Nothing is filtered out; packages that look runnable for the command (`vite.config.*` or `index.html` for `dev`/`build`/`preview`, a pack config or library entry for `pack`) rank first, then by path, so apps surface at the top while everything stays searchable.
279
+
- One row per workspace package: name plus relative path. Nothing is filtered out; likely-runnable packages (rules below) rank first, then by path, so apps surface at the top while everything stays searchable.
280
280
- Fuzzy search over name and path via `vite_select::fuzzy_match`, paging identical to the task picker.
281
281
- A runnable workspace root appears as a `(workspace root)` entry, keeping today's "run at root" behavior one keystroke away.
282
282
- With exactly one likely-runnable package, the picker auto-selects it, printing only the `Selected package:` line and the tip.
283
283
284
+
### The likely-runnable heuristic
285
+
286
+
Used only for ranking and single-candidate auto-select, never to hide a package: a misjudged package still appears in the picker and listing, just lower. Judged per package directory from file existence and static config extraction; nothing is executed, and parent directories never count.
|`dev` / `build` / `preview`| its directory directly contains one of Vite's config file names (`vite.config.{js,mjs,ts,cjs,mts,cts}`, the exact list Vite probes), **or** an `index.html` at the package root (Vite's default app entry) |
291
+
|`pack`| its `vite.config.*` declares a `pack` block (read via static extraction; a Vite config without `pack` does not count), **or**`src/index.ts` exists (tsdown's only default entry) |
292
+
293
+
"Exactly one likely-runnable package" means: after sorting rows runnable-first, the first row is runnable and the second is not. Auto-select additionally requires an interactive terminal.
294
+
295
+
Accepted trade-offs, tolerable because the signal never hides anything and a wrong auto-select is immediately visible (the `Selected package:` line, with the `Tip:` line showing the explicit `-C` form):
296
+
297
+
- A library whose `vite.config.*` exists only for Vitest or lint settings ranks as runnable for `dev`/`build`/`preview`. A refinement could demote configs whose only top-level keys are tool blocks, via the same static extraction; deferred until it bites in practice.
298
+
- An app whose `index.html` lives outside the package root (custom Vite `root`) or whose config is inherited from a parent directory is not ranked first, and never auto-selects.
0 commit comments