Skip to content

feat: add vite doc command using VitePress#169

Closed
Copilot wants to merge 1 commit intomainfrom
copilot/fix-121-3
Closed

feat: add vite doc command using VitePress#169
Copilot wants to merge 1 commit intomainfrom
copilot/fix-121-3

Conversation

Copy link

Copilot AI commented Sep 21, 2025

This PR adds a new built-in vite doc command that integrates VitePress for documentation serving and building, following the same patterns as other built-in commands like lint, test, and build.

Usage

# Serve documentation (default VitePress dev command)
vite doc

# Build documentation for production
vite doc -- --build

# Serve with custom host
vite doc -- --host 0.0.0.0

# Pass any VitePress arguments
vite doc -- --port 3000 --open

Implementation

The implementation follows the established architecture pattern:

  • Rust Core: Added Doc command variant and doc.rs module that handles VitePress execution
  • JavaScript Resolver: Created doc.ts that resolves VitePress binary path with helpful error messages when VitePress is not installed
  • NAPI Bindings: Updated binding layer to include doc resolver with proper error handling
  • Error Types: Added DocFailed error variant for consistent error reporting

Error Handling

When VitePress is not installed, users get a helpful error message:

VitePress not found. Please install vitepress in your project:
  npm install -D vitepress

Testing

  • Added comprehensive unit tests for command parsing
  • End-to-end testing confirms the command successfully starts VitePress
  • All existing tests continue to pass
  • Error handling verified for missing dependencies

This provides a unified developer experience where documentation is handled the same way as other development tasks in the vite+ ecosystem, making it easy to serve and build documentation alongside other project tasks.

Fixes #121.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI changed the title [WIP] feat: add vite doc using vitepress feat: add vite doc command using VitePress Sep 21, 2025
Copilot AI requested a review from fengmk2 September 21, 2025 04:45
@fengmk2
Copy link
Member

fengmk2 commented Sep 21, 2025

#172

@fengmk2 fengmk2 closed this Sep 21, 2025
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

2 participants