Skip to content

feat: add vite doc command using VitePress#122

Closed
Copilot wants to merge 2 commits intomainfrom
copilot/fix-121
Closed

feat: add vite doc command using VitePress#122
Copilot wants to merge 2 commits intomainfrom
copilot/fix-121

Conversation

Copy link

Copilot AI commented Sep 15, 2025

This PR implements the vite doc command that leverages VitePress for documentation development, following the same architectural pattern as other built-in commands like vite build, vite test, and vite lint.

Implementation

The command integrates seamlessly with the existing VitePress setup in the /docs directory:

# Start VitePress development server
vite doc

# Pass arguments to VitePress
vite doc -- --port 3000 --host

# Get VitePress help
vite doc -- --help

Architecture

Rust Side (vite_task):

  • Added Commands::Doc enum variant for argument parsing
  • Created doc.rs module that handles VitePress command resolution
  • Integrated with existing execution pipeline and caching system

TypeScript Side (packages/cli):

  • Added doc.ts resolver that locates vitepress/bin/vitepress.js using Node.js module resolution
  • Updated NAPI bindings to include the doc resolver function
  • Follows the same error handling pattern as other tool resolvers

Error Handling:

  • Added DocFailed error variant for consistent error reporting
  • Proper error conversion between JavaScript and Rust via NAPI

Benefits

  • Consistent UX: Uses the same command pattern as other vite-plus tools
  • Zero Configuration: Leverages existing VitePress setup in /docs
  • Argument Forwarding: Supports all VitePress CLI arguments via --
  • Performance: Benefits from vite-plus caching and execution optimizations

The implementation maintains the established architectural patterns while providing a seamless documentation development experience.

Fixes #121.


💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

Co-authored-by: Boshen <1430279+Boshen@users.noreply.github.com>
Copilot AI changed the title [WIP] feat: add vite doc using vitepress feat: add vite doc command using VitePress Sep 15, 2025
Copilot AI requested a review from Boshen September 15, 2025 13:41
@Boshen Boshen assigned fengmk2 and unassigned Boshen Sep 15, 2025
@fengmk2
Copy link
Member

fengmk2 commented Sep 16, 2025

@copilot rebase

Copy link
Author

Copilot AI commented Sep 16, 2025

@copilot rebase

I'm unable to perform git rebase operations directly since force push is not available in my environment. If you need the branch rebased, you'll need to either:

  1. Rebase manually using: git rebase main on the branch
  2. Or let me know if there are any specific conflicts or changes you'd like me to address, and I can make those changes which will create new commits

The current branch is clean and up to date with the remote.

@fengmk2
Copy link
Member

fengmk2 commented Sep 17, 2025

@copilot rebase again

Copy link
Author

Copilot AI commented Sep 17, 2025

@copilot rebase again

As I mentioned previously, I cannot perform git rebase operations due to environment limitations - I don't have the ability to do force pushes which are required for rebasing.

The branch remains clean and ready. If you need to rebase onto the latest main branch, you'll need to do it manually with:

git checkout copilot/fix-121
git rebase main
git push --force-with-lease

If there are specific merge conflicts or changes you'd like me to address instead, please let me know and I can make those changes.

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.

feat: add vite doc using vitepress

3 participants