Skip to content

Commit b3ee44a

Browse files
committed
docs(rfc): drop tri-state restatement and fold package-name question
Three cleanups from /simplify review: - Per-extension migration section opened with a re-statement of the three result outcomes already enumerated in § Result. Replaced with a one-line pointer. - Open question #2 (final package name) was contingent on #1, not a standalone question. Folded the name into the package-publish question as a parenthetical. - resolveVpAt's doc comment restated what the code already says; collapsed to one short JSDoc line.
1 parent e041b2c commit b3ee44a

1 file changed

Lines changed: 10 additions & 19 deletions

File tree

rfcs/editor-extension-vite-plus-detection.md

Lines changed: 10 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -187,12 +187,7 @@ function declaresVitePlus(pkg: any | null): boolean {
187187
return Boolean(pkg?.dependencies?.['vite-plus'] || pkg?.devDependencies?.['vite-plus']);
188188
}
189189

190-
/**
191-
* Validate that `node_modules/vite-plus` at `dir` is a real vite-plus
192-
* install, then return the package manager's `.bin/vp` shim path.
193-
* The shim is the conventional entry point that extensions already
194-
* use for oxlint/oxfmt.
195-
*/
190+
/** Return the .bin/vp shim path iff a valid vite-plus install lives at `dir`. */
196191
function resolveVpAt(dir: string): string | null {
197192
try {
198193
const pkg = JSON.parse(
@@ -247,12 +242,8 @@ The async variant is the same algorithm with `fs.promises`.
247242

248243
## Per-extension migration
249244

250-
All four extensions run the detector first, then:
251-
252-
- `null` → fall through to the existing oxlint/oxfmt resolution.
253-
- `{ root, vpPath }` → launch `<vpPath> lint --lsp` / `fmt --lsp`. On
254-
launch failure, surface an upgrade hint.
255-
- `{ root }` → surface an install hint; do not launch anything Vite+.
245+
Every extension runs the detector first and dispatches on its result
246+
as defined in § Result above.
256247

257248
**On the launch path.** Validation (parsing
258249
`node_modules/vite-plus/package.json` and checking `name`) is the
@@ -308,13 +299,13 @@ IntelliJ — substitute their own equivalent. The fixture just asserts
308299
## Open questions
309300

310301
1. **Publish the detector as a shared npm package?** The current
311-
proposal is `@voidzero-dev/detect-vite-plus` at
312-
`packages/detect-vite-plus/`, consumed as a bundled devDependency
313-
by `oxc-vscode` and `coc-oxc`. The alternative is to let each
314-
Node-capable extension copy the ~50-line snippet directly.
315-
Decision deferred to the maintainers.
316-
2. **Final package name** if published.
317-
3. **"Declared but not installed" UX** — silent fallback to plain
302+
proposal is to publish it at `packages/detect-vite-plus/`,
303+
consumed as a bundled devDependency by `oxc-vscode` and `coc-oxc`;
304+
proposed name `@voidzero-dev/detect-vite-plus` (open to
305+
bikeshedding). The alternative is to let each Node-capable
306+
extension copy the ~50-line snippet directly. Decision deferred to
307+
the maintainers.
308+
2. **"Declared but not installed" UX** — silent fallback to plain
318309
oxlint vs. install notification. This RFC proposes a notification
319310
(silent fallback loses Vite+-aware behaviour anyway because the
320311
wrapper's `VP_VERSION` env var isn't set), but the specific

0 commit comments

Comments
 (0)