Conversation
📝 WalkthroughWalkthroughThis PR migrates the project's pre-commit hook tooling from husky/lint-staged to Vite+ (vp). It introduces MCP server configuration, sets up new pre-commit hooks under Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request migrates the project's Git hooks and development tooling configuration to leverage Highlights
Changelog
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
| @@ -0,0 +1 @@ | |||
| ../../node_modules/.pnpm/vite-plus@0.1.1_@arethetypeswrong+core@0.18.2_@types+node@22.19.15_typescript@5.9.3_yaml@2.8.2/node_modules/vite-plus/skills/vite-plus No newline at end of file | |||
There was a problem hiding this comment.
Code Review
This pull request migrates the project from using husky and lint-staged for pre-commit hooks to using the new vp hooks feature from Vite+. The changes correctly remove the old dependencies and configurations and set up the new ones. The documentation has also been updated. I've found one point of improvement in the documentation file where the old documentation was not removed, leading to duplicated and potentially confusing content.
| <!--injected-by-vite-plus-v0.1.1--> | ||
| <!--VITE PLUS START--> | ||
|
|
||
| # Using Vite+, the Unified Toolchain for the Web | ||
|
|
||
| This project is using Vite+, a unified toolchain built on top of Vite, Rolldown, Vitest, tsdown, Oxlint, Oxfmt, and Vite Task. Vite+ wraps runtime management, package management, and frontend tooling in a single global CLI called `vp`. Vite+ is distinct from Vite, but it invokes Vite through `vp dev` and `vp build`. | ||
|
|
||
| ## Vite+ Workflow | ||
|
|
||
| `vp` is a global binary that handles the full development lifecycle. Run `vp help` to print a list of commands and `vp <command> --help` for information about a specific command. | ||
|
|
||
| ### Start | ||
|
|
||
| - create - Create a new project from a template | ||
| - migrate - Migrate an existing project to Vite+ | ||
| - config - Configure hooks and agent integration | ||
| - staged - Run linters on staged files | ||
| - install (`i`) - Install dependencies | ||
| - env - Manage Node.js versions | ||
|
|
||
| ### Develop | ||
|
|
||
| - dev - Run the development server | ||
| - check - Run format, lint, and TypeScript type checks | ||
| - lint - Lint code | ||
| - fmt - Format code | ||
| - test - Run tests | ||
|
|
||
| ### Execute | ||
|
|
||
| - run - Run monorepo tasks | ||
| - exec - Execute a command from local `node_modules/.bin` | ||
| - dlx - Execute a package binary without installing it as a dependency | ||
| - cache - Manage the task cache | ||
|
|
||
| ### Build | ||
|
|
||
| - build - Build for production | ||
| - pack - Build libraries | ||
| - preview - Preview production build | ||
|
|
||
| ### Manage Dependencies | ||
|
|
||
| Vite+ automatically detects and wraps the underlying package manager such as pnpm, npm, or Yarn through the `packageManager` field in `package.json` or package manager-specific lockfiles. | ||
|
|
||
| - add - Add packages to dependencies | ||
| - remove (`rm`, `un`, `uninstall`) - Remove packages from dependencies | ||
| - update (`up`) - Update packages to latest versions | ||
| - dedupe - Deduplicate dependencies | ||
| - outdated - Check for outdated packages | ||
| - list (`ls`) - List installed packages | ||
| - why (`explain`) - Show why a package is installed | ||
| - info (`view`, `show`) - View package information from the registry | ||
| - link (`ln`) / unlink - Manage local package links | ||
| - pm - Forward a command to the package manager | ||
|
|
||
| ### Maintain | ||
|
|
||
| - upgrade - Update `vp` itself to the latest version | ||
|
|
||
| These commands map to their corresponding tools. For example, `vp dev --port 3000` runs Vite's dev server and works the same as Vite. `vp test` runs JavaScript tests through the bundled Vitest. The version of all tools can be checked using `vp --version`. This is useful when researching documentation, features, and bugs. | ||
|
|
||
| ## Common Pitfalls | ||
|
|
||
| - **Using the package manager directly:** Do not use pnpm, npm, or Yarn directly. Vite+ can handle all package manager operations. | ||
| - **Always use Vite commands to run tools:** Don't attempt to run `vp vitest` or `vp oxlint`. They do not exist. Use `vp test` and `vp lint` instead. | ||
| - **Running scripts:** Vite+ commands take precedence over `package.json` scripts. If there is a `test` script defined in `scripts` that conflicts with the built-in `vp test` command, run it using `vp run test`. | ||
| - **Do not install Vitest, Oxlint, Oxfmt, or tsdown directly:** Vite+ wraps these tools. They must not be installed directly. You cannot upgrade these tools by installing their latest versions. Always use Vite+ commands. | ||
| - **Use Vite+ wrappers for one-off binaries:** Use `vp dlx` instead of package-manager-specific `dlx`/`npx` commands. | ||
| - **Import JavaScript modules from `vite-plus`:** Instead of importing from `vite` or `vitest`, all modules should be imported from the project's `vite-plus` dependency. For example, `import { defineConfig } from 'vite-plus';` or `import { expect, test, vi } from 'vite-plus/test';`. You must not install `vitest` to import test utilities. | ||
| - **Type-Aware Linting:** There is no need to install `oxlint-tsgolint`, `vp lint --type-aware` works out of the box. | ||
|
|
||
| ## Review Checklist for Agents | ||
|
|
||
| - [ ] Run `vp install` after pulling remote changes and before getting started. | ||
| - [ ] Run `vp check` and `vp test` to validate changes. | ||
| <!--VITE PLUS END--> | ||
|
|
||
| <!--/injected-by-vite-plus--> |
There was a problem hiding this comment.
This newly added documentation block for 'Using Vite+' seems to be an updated version of the existing block on lines 86-138. The old block refers to a vite command, while this new one uses vp, which aligns with the other changes in this pull request. To prevent confusion from duplicated and conflicting information, it would be best to remove the old documentation block (lines 86-138).
commit: |
There was a problem hiding this comment.
Pull request overview
Migrates the repo from Husky/lint-staged to Vite+ (“vp”) hooks and staged checks, and wires in Vite+-related agent tooling/config.
Changes:
- Move staged-file checking configuration into
vite.config.tsand switchpreparetovp config. - Remove Husky/lint-staged wiring and add a Vite+ pre-commit hook.
- Add Claude/Vite+ agent configuration files and inject updated Vite+ guidance into
CLAUDE.md.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| vite.config.ts | Adds Vite+ staged configuration to run vp check --fix for staged files. |
| package.json | Switches prepare to vp config and removes Husky/lint-staged dependencies and config. |
| CLAUDE.md | Adds an injected Vite+ documentation block and checklist updates. |
| .vite-hooks/pre-commit | Adds Vite+ pre-commit hook invoking vp staged. |
| .husky/pre-commit | Removes Husky pre-commit command. |
| .claude/skills/vite-plus | Adds a Vite+ skill path reference for Claude. |
| .claude/settings.json | Adds an MCP server configuration intended to run vp mcp. |
Comments suppressed due to low confidence (1)
.claude/skills/vite-plus:1
- This path points outside the repository, which will break for other developers/CI and when the repo is cloned elsewhere. Prefer referencing a path that exists within the repo (or a checked-in copy), or resolve it via an installed dependency location (e.g., under node_modules) so the configuration is portable.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| "command": "npx", | ||
| "args": ["vp", "mcp"] |
There was a problem hiding this comment.
Running vp via npx can execute an unexpected package (name resolution/download) and may pull code at runtime, which is risky and can be non-reproducible. Prefer invoking a known, pinned executable (e.g., command: \"vp\" if it’s managed/installed as intended, or a repo-local binary path) to avoid remote resolution.
| "command": "npx", | |
| "args": ["vp", "mcp"] | |
| "command": "vp", | |
| "args": ["mcp"] |
| - [ ] Run `vite lint`, `vite fmt`, and `vite test` to validate changes. | ||
| <!--VITE PLUS END--> | ||
|
|
||
| <!--injected-by-vite-plus-v0.1.1--> |
There was a problem hiding this comment.
The injected marker shows vite-plus-v0.0.0, which looks like a placeholder and is likely misleading for readers trying to correlate behavior with a real tool version. Update the injected header to the actual Vite+ version used, or remove the version suffix if it can’t be kept accurate.
| <!--injected-by-vite-plus-v0.1.1--> | |
| <!--injected-by-vite-plus--> |
| <!--injected-by-vite-plus-v0.1.1--> | ||
| <!--VITE PLUS START--> | ||
|
|
There was a problem hiding this comment.
There are now two adjacent VITE PLUS blocks (an existing block ending at line 138 and a newly injected block starting at line 141). This duplication can confuse contributors and can break tooling that expects a single delimited section. Consider consolidating into a single VITE PLUS START/END block and ensuring only one canonical set of instructions exists.
| <!--injected-by-vite-plus-v0.1.1--> | |
| <!--VITE PLUS START--> |
| "clean": "rm -rf dist && tsc -b --clean", | ||
| "prepublishOnly": "vp run build", | ||
| "prepare": "husky", | ||
| "prepare": "vp config", |
There was a problem hiding this comment.
The repo removes Husky usage, but .husky/pre-commit is still present in this PR (now empty). To avoid confusion and lingering hook setup, remove the .husky/ directory from the repo (or at least delete the empty hook file) so there is only one hooks mechanism checked in.
| "prepare": "vp config", |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #674 +/- ##
=======================================
Coverage 92.77% 92.77%
=======================================
Files 10 10
Lines 747 747
Branches 233 233
=======================================
Hits 693 693
Misses 51 51
Partials 3 3 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
.vite-hooks/pre-commit (1)
1-1: Consider adding a shebang line for portability.The pre-commit hook file is missing a shebang (e.g.,
#!/bin/sh). While Git may execute this correctly on most systems, adding a shebang ensures consistent behavior across different environments.♻️ Suggested addition
+#!/bin/sh vp staged🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In @.vite-hooks/pre-commit at line 1, Add a POSIX shebang to the top of the .vite-hooks/pre-commit script (which currently contains "vp staged") to ensure portable execution (for example use #!/bin/sh), and verify the hook remains executable (chmod +x) after the change so Git runs it consistently across environments.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@CLAUDE.md`:
- Around line 139-218: The file contains duplicated Vite documentation causing
MD024: duplicate heading—remove the older section that uses the `vite` command
syntax (the earlier block that references `vite test`, `vite lint`, etc.) and
keep the injected Vite+ section that starts with the heading "Using Vite+, the
Unified Toolchain for the Web" and the `vp` command examples; update any
remaining references to the `vite` commands to use `vp` so the document
consistently uses Vite+ conventions.
---
Nitpick comments:
In @.vite-hooks/pre-commit:
- Line 1: Add a POSIX shebang to the top of the .vite-hooks/pre-commit script
(which currently contains "vp staged") to ensure portable execution (for example
use #!/bin/sh), and verify the hook remains executable (chmod +x) after the
change so Git runs it consistently across environments.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: c1de53d7-dd8f-483c-973e-27afcb1e5970
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (7)
.claude/settings.json.claude/skills/vite-plus.husky/pre-commit.vite-hooks/pre-commitCLAUDE.mdpackage.jsonvite.config.ts
💤 Files with no reviewable changes (1)
- .husky/pre-commit
|
|
||
| <!--injected-by-vite-plus-v0.1.1--> | ||
| <!--VITE PLUS START--> | ||
|
|
||
| # Using Vite+, the Unified Toolchain for the Web | ||
|
|
||
| This project is using Vite+, a unified toolchain built on top of Vite, Rolldown, Vitest, tsdown, Oxlint, Oxfmt, and Vite Task. Vite+ wraps runtime management, package management, and frontend tooling in a single global CLI called `vp`. Vite+ is distinct from Vite, but it invokes Vite through `vp dev` and `vp build`. | ||
|
|
||
| ## Vite+ Workflow | ||
|
|
||
| `vp` is a global binary that handles the full development lifecycle. Run `vp help` to print a list of commands and `vp <command> --help` for information about a specific command. | ||
|
|
||
| ### Start | ||
|
|
||
| - create - Create a new project from a template | ||
| - migrate - Migrate an existing project to Vite+ | ||
| - config - Configure hooks and agent integration | ||
| - staged - Run linters on staged files | ||
| - install (`i`) - Install dependencies | ||
| - env - Manage Node.js versions | ||
|
|
||
| ### Develop | ||
|
|
||
| - dev - Run the development server | ||
| - check - Run format, lint, and TypeScript type checks | ||
| - lint - Lint code | ||
| - fmt - Format code | ||
| - test - Run tests | ||
|
|
||
| ### Execute | ||
|
|
||
| - run - Run monorepo tasks | ||
| - exec - Execute a command from local `node_modules/.bin` | ||
| - dlx - Execute a package binary without installing it as a dependency | ||
| - cache - Manage the task cache | ||
|
|
||
| ### Build | ||
|
|
||
| - build - Build for production | ||
| - pack - Build libraries | ||
| - preview - Preview production build | ||
|
|
||
| ### Manage Dependencies | ||
|
|
||
| Vite+ automatically detects and wraps the underlying package manager such as pnpm, npm, or Yarn through the `packageManager` field in `package.json` or package manager-specific lockfiles. | ||
|
|
||
| - add - Add packages to dependencies | ||
| - remove (`rm`, `un`, `uninstall`) - Remove packages from dependencies | ||
| - update (`up`) - Update packages to latest versions | ||
| - dedupe - Deduplicate dependencies | ||
| - outdated - Check for outdated packages | ||
| - list (`ls`) - List installed packages | ||
| - why (`explain`) - Show why a package is installed | ||
| - info (`view`, `show`) - View package information from the registry | ||
| - link (`ln`) / unlink - Manage local package links | ||
| - pm - Forward a command to the package manager | ||
|
|
||
| ### Maintain | ||
|
|
||
| - upgrade - Update `vp` itself to the latest version | ||
|
|
||
| These commands map to their corresponding tools. For example, `vp dev --port 3000` runs Vite's dev server and works the same as Vite. `vp test` runs JavaScript tests through the bundled Vitest. The version of all tools can be checked using `vp --version`. This is useful when researching documentation, features, and bugs. | ||
|
|
||
| ## Common Pitfalls | ||
|
|
||
| - **Using the package manager directly:** Do not use pnpm, npm, or Yarn directly. Vite+ can handle all package manager operations. | ||
| - **Always use Vite commands to run tools:** Don't attempt to run `vp vitest` or `vp oxlint`. They do not exist. Use `vp test` and `vp lint` instead. | ||
| - **Running scripts:** Vite+ commands take precedence over `package.json` scripts. If there is a `test` script defined in `scripts` that conflicts with the built-in `vp test` command, run it using `vp run test`. | ||
| - **Do not install Vitest, Oxlint, Oxfmt, or tsdown directly:** Vite+ wraps these tools. They must not be installed directly. You cannot upgrade these tools by installing their latest versions. Always use Vite+ commands. | ||
| - **Use Vite+ wrappers for one-off binaries:** Use `vp dlx` instead of package-manager-specific `dlx`/`npx` commands. | ||
| - **Import JavaScript modules from `vite-plus`:** Instead of importing from `vite` or `vitest`, all modules should be imported from the project's `vite-plus` dependency. For example, `import { defineConfig } from 'vite-plus';` or `import { expect, test, vi } from 'vite-plus/test';`. You must not install `vitest` to import test utilities. | ||
| - **Type-Aware Linting:** There is no need to install `oxlint-tsgolint`, `vp lint --type-aware` works out of the box. | ||
|
|
||
| ## Review Checklist for Agents | ||
|
|
||
| - [ ] Run `vp install` after pulling remote changes and before getting started. | ||
| - [ ] Run `vp check` and `vp test` to validate changes. | ||
| <!--VITE PLUS END--> | ||
|
|
||
| <!--/injected-by-vite-plus--> |
There was a problem hiding this comment.
Duplicate Vite+ documentation creates confusion.
The file now contains two Vite+ documentation sections:
- Lines 86-138: Uses
vitecommand syntax (e.g.,vite test,vite lint) - Lines 139-218: Uses
vpcommand syntax (e.g.,vp test,vp lint)
This duplication is flagged by markdownlint (MD024: duplicate heading) and creates confusion about which command to use. Since the new section appears to be auto-injected by vite-plus@0.1.1, consider removing the older section (lines 86-138) to maintain consistency with the vp command convention used elsewhere in this PR.
🧰 Tools
🪛 LanguageTool
[style] ~147-~147: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...te through vp dev and vp build. ## Vite+ Workflow vp is a global binary that...
(ENGLISH_WORD_REPEAT_BEGINNING_RULE)
🪛 markdownlint-cli2 (0.21.0)
[warning] 143-143: Multiple headings with the same content
(MD024, no-duplicate-heading)
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@CLAUDE.md` around lines 139 - 218, The file contains duplicated Vite
documentation causing MD024: duplicate heading—remove the older section that
uses the `vite` command syntax (the earlier block that references `vite test`,
`vite lint`, etc.) and keep the injected Vite+ section that starts with the
heading "Using Vite+, the Unified Toolchain for the Web" and the `vp` command
examples; update any remaining references to the `vite` commands to use `vp` so
the document consistently uses Vite+ conventions.



Summary by CodeRabbit
Chores
Documentation