Skip to content

docs(rfc): standardize Vite+ project detection for editor extensions#1607

Closed
fengmk2 wants to merge 5 commits into
mainfrom
vp-detect
Closed

docs(rfc): standardize Vite+ project detection for editor extensions#1607
fengmk2 wants to merge 5 commits into
mainfrom
vp-detect

Conversation

@fengmk2
Copy link
Copy Markdown
Member

@fengmk2 fengmk2 commented May 17, 2026

Defines a portable rule the four oxc editor extensions (oxc-vscode,
oxc-zed, oxc-intellij-plugin, coc-oxc) can use to decide whether to
launch vp lint --lsp / vp fmt --lsp instead of plain oxlint/oxfmt:
locate the vp binary via each extension's existing bin-resolution
chain, falling back to a package.json deps check.

Includes the canonical rule, a reference TypeScript implementation,
per-extension migration notes, design decisions, and a conformance
fixture table.

Refs #1557

Defines a portable rule the four oxc editor extensions (oxc-vscode,
oxc-zed, oxc-intellij-plugin, coc-oxc) can use to decide whether to
launch `vp lint --lsp` / `vp fmt --lsp` instead of plain oxlint/oxfmt:
locate the `vp` binary via each extension's existing bin-resolution
chain, falling back to a package.json deps check.

Includes the canonical rule, a reference TypeScript implementation,
per-extension migration notes, design decisions, and a conformance
fixture table.

Refs #1557
@netlify
Copy link
Copy Markdown

netlify Bot commented May 17, 2026

Deploy Preview for viteplus-preview canceled.

Name Link
🔨 Latest commit 64c02ba
🔍 Latest deploy log https://app.netlify.com/projects/viteplus-preview/deploys/6a09d5b6f0e37c0007cea3e4

Copy link
Copy Markdown
Member Author

fengmk2 commented May 17, 2026


How to use the Graphite Merge Queue

Add the label auto-merge to this PR to add it to the merge queue.

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

This stack of pull requests is managed by Graphite. Learn more about stacking.

@fengmk2 fengmk2 self-assigned this May 17, 2026
fengmk2 added 4 commits May 17, 2026 22:25
Clarifies that the RFC's scope is the four oxc editor extensions, not
detection across all Vite+ tooling.
Drops the quoted question from the H1 and parallels the noun-phrase
style used by other RFCs (e.g. package-manager-detection.md).
Three correctness fixes uncovered by adversarial review:

1. Signal #1 is now strictly project-scoped. User-configured binPath
   overrides, global node_modules, and $PATH are explicitly excluded
   so that a globally-installed `vp` or a `vp` on $PATH cannot
   classify an unrelated workspace as Vite+. Locked as a decision and
   reflected in every per-extension migration plan.

2. The walk-up now stops AT the workspace root, not after. The
   previous reference loop set a "stop after this" flag and still
   advanced to the parent, which would let a nested checkout inherit
   a vite-plus install from its outer parent directory. Added a
   `parent-vite-plus-nested-repo` conformance fixture.

3. Signal #1 now requires a valid `vite-plus` package at the resolved
   ancestor: `node_modules/vite-plus/package.json` must parse and have
   `name === "vite-plus"`. The conformance fixture
   `bin-vp-without-package-json` previously required `null` but the
   reference code returned `vp-binary-found`; both are now consistent.
   Added `bin-vp-with-malformed-package`, `global-vp-on-path`, and
   `user-binpath-override` fixtures.

Refs #1557
Two cleanups from /simplify review:

- Read package.json once per walked-up directory (workspace-root check
  and deps check now share a single parse), eliminating a double
  filesystem read per ancestor.
- Drop the inline "Signal #1" / "Signal #2" / "Stop AT workspace root"
  comments — they narrate what the code already says via the variable
  names and control flow.

No behavioural change. The doc comment on isValidVitePlusInstall is
kept because it captures non-obvious intent (rejecting orphan trees).

Refs #1557
@fengmk2 fengmk2 closed this May 18, 2026
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.

1 participant