|
| 1 | +# GitHub Copilot Instructions for VitePress Documentation Site |
| 2 | + |
| 3 | +## Repository Overview |
| 4 | + |
| 5 | +This is a VitePress-based documentation site using Vue 3 with the following technology stack: |
| 6 | +- **VitePress**: Static site generator for documentation |
| 7 | +- **Vue 3**: JavaScript framework for interactive components |
| 8 | +- **Yarn**: Package manager (v1.22.19) |
| 9 | +- **ESLint**: Code linting |
| 10 | +- **Prettier**: Code formatting |
| 11 | +- **Algolia**: Search integration |
| 12 | + |
| 13 | +## Critical Commands & Timeouts |
| 14 | + |
| 15 | +### NEVER CANCEL THESE COMMANDS |
| 16 | +Always use adequate timeouts and NEVER cancel the following operations: |
| 17 | + |
| 18 | +#### Package Management |
| 19 | +```bash |
| 20 | +yarn install |
| 21 | +``` |
| 22 | +- **Timeout**: 180 seconds minimum |
| 23 | +- **Expected time**: 30-60 seconds |
| 24 | +- **NEVER CANCEL**: Dependencies installation is critical |
| 25 | + |
| 26 | +#### Build Process |
| 27 | +```bash |
| 28 | +yarn run build |
| 29 | +``` |
| 30 | +- **Timeout**: 180 seconds minimum |
| 31 | +- **Expected time**: 7-10 seconds |
| 32 | +- **Output**: Creates optimized production build in `/dist` |
| 33 | +- **NEVER CANCEL**: Build process generates critical assets |
| 34 | + |
| 35 | +#### Development Server |
| 36 | +```bash |
| 37 | +yarn run dev |
| 38 | +``` |
| 39 | +- **Timeout**: Use async=true with 30+ second delays |
| 40 | +- **Expected behavior**: Starts server at http://localhost:5173/ |
| 41 | +- **Status**: Ready when "Local: http://localhost:5173/" appears |
| 42 | +- **NEVER CANCEL**: Dev server needs time to initialize |
| 43 | + |
| 44 | +#### Preview Server |
| 45 | +```bash |
| 46 | +yarn run preview |
| 47 | +``` |
| 48 | +- **Timeout**: Use async=true with 30+ second delays |
| 49 | +- **Purpose**: Preview production build locally |
| 50 | +- **NEVER CANCEL**: Preview server startup takes time |
| 51 | + |
| 52 | +## Code Quality Commands |
| 53 | + |
| 54 | +### Linting |
| 55 | +```bash |
| 56 | +yarn run eslint |
| 57 | +``` |
| 58 | +- **Timeout**: 120 seconds |
| 59 | +- **Expected behavior**: Will show linting errors (known issues exist) |
| 60 | +- **Note**: ESLint currently reports errors in source files and dist folder |
| 61 | +- **Action**: Focus only on fixing new errors you introduce |
| 62 | + |
| 63 | +### Code Formatting |
| 64 | +```bash |
| 65 | +yarn run prettier-check |
| 66 | +``` |
| 67 | +- **Timeout**: 120 seconds |
| 68 | +- **Purpose**: Check code formatting consistency |
| 69 | +- **Note**: Repository has existing formatting issues (143 files) |
| 70 | + |
| 71 | +```bash |
| 72 | +yarn run prettier-write |
| 73 | +``` |
| 74 | +- **Timeout**: 120 seconds |
| 75 | +- **Purpose**: Auto-fix formatting issues |
| 76 | +- **Use**: Only when specifically requested or for new files |
| 77 | + |
| 78 | +## Directory Structure |
| 79 | + |
| 80 | +### Source Files |
| 81 | +- `/src/`: Main documentation content (Markdown files) |
| 82 | +- `/.vitepress/`: VitePress configuration and theme |
| 83 | +- `/.vitepress/config.js`: Main configuration file |
| 84 | +- `/.vitepress/nav.json`: Navigation structure |
| 85 | +- `/.vitepress/sidebar.js`: Sidebar configuration |
| 86 | +- `/.vitepress/theme/`: Custom theme components |
| 87 | + |
| 88 | +### Build Output |
| 89 | +- `/dist/`: Generated build files (DO NOT EDIT MANUALLY) |
| 90 | +- Contains optimized assets and generated pages |
| 91 | + |
| 92 | +### Configuration Files |
| 93 | +- `package.json`: Dependencies and scripts |
| 94 | +- `yarn.lock`: Locked dependency versions |
| 95 | +- `eslint.config.js`: ESLint configuration |
| 96 | +- `.prettierrc.json`: Prettier configuration |
| 97 | + |
| 98 | +## Development Guidelines |
| 99 | + |
| 100 | +### Working with Documentation |
| 101 | +1. **Content location**: All documentation files are in `/src/` |
| 102 | +2. **Markdown format**: Use standard markdown with VitePress extensions |
| 103 | +3. **Navigation**: Update `/.vitepress/nav.json` for new sections |
| 104 | +4. **Sidebar**: Modify `/.vitepress/sidebar.js` for page organization |
| 105 | + |
| 106 | +### Build Process Validation |
| 107 | +1. Always run `yarn run build` after content changes |
| 108 | +2. Verify build completes successfully (6-10 seconds expected) |
| 109 | +3. Check for any build errors or warnings |
| 110 | +4. Test with `yarn run preview` if needed |
| 111 | + |
| 112 | +### Development Server Testing |
| 113 | +1. Start with `yarn run dev` (use async=true) |
| 114 | +2. Wait for "Local: http://localhost:5173/" message |
| 115 | +3. Allow 30+ seconds for initial startup |
| 116 | +4. Verify site loads correctly |
| 117 | +5. Test navigation and search functionality |
| 118 | + |
| 119 | +### Code Quality Checks |
| 120 | +1. Run `yarn run eslint` before committing |
| 121 | +2. Focus only on NEW errors in files you modified |
| 122 | +3. Ignore existing errors in dist folder and other files |
| 123 | +4. Run `yarn run prettier-check` for formatting validation |
| 124 | + |
| 125 | +## File Modification Guidelines |
| 126 | + |
| 127 | +### Documentation Files |
| 128 | +- **Location**: `/src/` directory and subdirectories |
| 129 | +- **Format**: Markdown (.md) with VitePress frontmatter |
| 130 | +- **Images**: Store in appropriate subdirectories |
| 131 | +- **Links**: Use relative paths for internal links |
| 132 | + |
| 133 | +### Configuration Changes |
| 134 | +- **Navigation**: Edit `/.vitepress/nav.json` |
| 135 | +- **Sidebar**: Edit `/.vitepress/sidebar.js` |
| 136 | +- **Site config**: Edit `/.vitepress/config.js` |
| 137 | +- **Theme**: Modify files in `/.vitepress/theme/` |
| 138 | + |
| 139 | +### DO NOT MODIFY |
| 140 | +- `/dist/` directory (build output) |
| 141 | +- `yarn.lock` (unless updating dependencies) |
| 142 | +- `.git/` directory |
| 143 | + |
| 144 | +## Testing & Validation Scenarios |
| 145 | + |
| 146 | +### Content Changes |
| 147 | +1. Edit markdown file in `/src/` |
| 148 | +2. Run `yarn run build` (180s timeout) |
| 149 | +3. Verify build success |
| 150 | +4. Test with `yarn run dev` (async=true) |
| 151 | +5. Validate content renders correctly |
| 152 | + |
| 153 | +### Navigation Updates |
| 154 | +1. Modify `/.vitepress/nav.json` or `sidebar.js` |
| 155 | +2. Run `yarn run build` (180s timeout) |
| 156 | +3. Test navigation in dev server |
| 157 | +4. Verify all links work correctly |
| 158 | + |
| 159 | +### Theme Customizations |
| 160 | +1. Edit files in `/.vitepress/theme/` |
| 161 | +2. Run `yarn run build` (180s timeout) |
| 162 | +3. Test with `yarn run dev` (async=true) |
| 163 | +4. Verify visual changes are correct |
| 164 | + |
| 165 | +## Common Issues & Solutions |
| 166 | + |
| 167 | +### Build Failures |
| 168 | +- Check for markdown syntax errors |
| 169 | +- Verify all links are valid |
| 170 | +- Ensure images exist at specified paths |
| 171 | +- Check frontmatter YAML syntax |
| 172 | + |
| 173 | +### ESLint Errors |
| 174 | +- Focus on errors in files you're modifying |
| 175 | +- Ignore dist folder errors (they're generated) |
| 176 | +- Fix undefined variables and unused imports |
| 177 | +- Follow Vue 3 and VitePress conventions |
| 178 | + |
| 179 | +### Development Server Issues |
| 180 | +- Allow adequate startup time (30+ seconds) |
| 181 | +- Check for port conflicts (5173) |
| 182 | +- Restart server if hot reload stops working |
| 183 | +- Use `yarn run preview` for production testing |
| 184 | + |
| 185 | +## Command Execution Rules |
| 186 | + |
| 187 | +### Always Use Timeouts |
| 188 | +- **Short commands**: 120 seconds minimum |
| 189 | +- **Build/Install**: 180 seconds minimum |
| 190 | +- **Dev server**: Use async=true with delays |
| 191 | + |
| 192 | +### Never Cancel |
| 193 | +- Package installation (`yarn install`) |
| 194 | +- Build process (`yarn run build`) |
| 195 | +- Server startup (dev/preview) |
| 196 | +- Large file operations |
| 197 | + |
| 198 | +### Error Handling |
| 199 | +- Read error messages completely |
| 200 | +- Focus on actionable errors only |
| 201 | +- Ignore pre-existing issues unless specifically requested |
| 202 | +- Test changes incrementally |
| 203 | + |
| 204 | +## Algolia Search Integration |
| 205 | + |
| 206 | +The site includes Algolia search functionality: |
| 207 | +- Configuration in `/.vitepress/config.js` |
| 208 | +- Search index is managed externally |
| 209 | +- Test search functionality after content changes |
| 210 | +- Verify search results are relevant and up-to-date |
| 211 | + |
| 212 | +Remember: This is a documentation site where content quality and user experience are paramount. Always validate changes thoroughly and maintain the existing site structure unless specifically requested to modify it. |
0 commit comments