Contributing to VitePress
We’re excited that you’re interested in contributing to VitePress! This guide will help you get started with contributing to the project.Code of Conduct
VitePress has adopted the same Code of Conduct as the Vue.js project. Please read and follow it.Ways to Contribute
Report Bugs
Help us identify and fix issues by reporting bugs you encounter.
Suggest Features
Share ideas for new features or improvements to existing ones.
Improve Documentation
Help make the docs better by fixing errors or adding examples.
Submit Code
Contribute bug fixes, new features, or performance improvements.
Development Setup
VitePress uses pnpm for package management. While npm and yarn may work, pnpm is recommended for consistency.
Pull Request Guidelines
# Create and switch to a new branch
git checkout -b feat/my-awesome-feature
# Or for a bug fix
git checkout -b fix/issue-123
Open a suggestion issue first and get approval before working on new features. This ensures your work aligns with project goals.
# Run unit tests
pnpm test:unit
# Run unit tests in watch mode
pnpm test:unit:watch
# Run e2e tests
pnpm test:e2e
# Run all tests
pnpm test
Commit messages MUST follow the commit message convention for automatic changelog generation.
Commit Message Convention
VitePress follows the Angular commit convention for automated changelog generation.Format
Commit messages must match this pattern:Structure
Types
feat - New Feature
feat - New Feature
Appears under “Features” in changelog:
fix - Bug Fix
fix - Bug Fix
Appears under “Bug Fixes” in changelog:
perf - Performance Improvement
perf - Performance Improvement
Appears under “Performance Improvements” in changelog:
docs - Documentation
docs - Documentation
Documentation changes:
Other Types
Other Types
Other valid types (won’t appear in changelog unless they have BREAKING CHANGE):
style: Code style changes (formatting, semicolons, etc)refactor: Code refactoringtest: Adding or updating testschore: Maintenance tasksbuild: Build system changesci: CI configuration changesdx: Developer experience improvements
Scope
The scope specifies the area of change:theme: Default theme changesclient: Client-side codebuild: Build systemmarkdown: Markdown processingsearch: Search functionality- etc.
Subject Guidelines
- Use imperative, present tense: “change” not “changed” or “changes”
- Don’t capitalize first letter
- No period (.) at the end
- Keep under 50 characters
Breaking Changes
If your commit includes breaking changes:Examples
Testing Guidelines
Unit Tests
Located in__tests__/unit/:
E2E Tests
Located in__tests__/e2e/:
Init Tests
Tests for thevitepress init command:
Code Style
VitePress uses Prettier for code formatting:Code is automatically formatted on commit via git hooks, so you usually don’t need to run these manually.
Project Structure
Development Workflow
Making a Bug Fix
- Find or create an issue describing the bug
- Create a branch:
git checkout -b fix/issue-123 - Write a failing test that reproduces the bug
- Fix the bug and ensure the test passes
- Commit:
fix: resolve issue with X - Push and create PR
Adding a Feature
- Open a discussion or issue proposing the feature
- Wait for approval from maintainers
- Create a branch:
git checkout -b feat/awesome-feature - Implement the feature with tests
- Update documentation if needed
- Commit:
feat(scope): add awesome feature - Push and create PR
Improving Documentation
- Create a branch:
git checkout -b docs/improve-guide - Make changes to markdown files in
docs/ - Test locally:
pnpm run docs - Commit:
docs: improve migration guide - Push and create PR
Building VitePress
Development Build
Production Build
Build Documentation
Getting Help
If you need help contributing:- GitHub Discussions: vuejs/vitepress/discussions
- Discord: chat.vuejs.org
- Issues: Search existing issues or create a new one
Recognition
All contributors are recognized in:- GitHub contributors list
- Release notes for their contributions
- The VitePress community
Thank you for contributing to VitePress! Every contribution, no matter how small, makes a difference.