|
| 1 | +# CLAUDE.md |
| 2 | + |
| 3 | +This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository. |
| 4 | + |
| 5 | +## Project Overview |
| 6 | + |
| 7 | +Documentation site for QIT (Quality Insights Toolkit), WooCommerce's automated testing platform for WordPress plugins and themes. Built with **Docusaurus v3.8.1** and deployed to https://qit.woo.com/. |
| 8 | + |
| 9 | +## Commands |
| 10 | + |
| 11 | +```bash |
| 12 | +# Install dependencies (requires Node 20, see .nvmrc) |
| 13 | +npm install |
| 14 | + |
| 15 | +# Local dev server with hot reload (http://localhost:3000) |
| 16 | +npm start |
| 17 | + |
| 18 | +# Production build (outputs to /build) |
| 19 | +npm run build |
| 20 | + |
| 21 | +# Serve built site locally |
| 22 | +npm run serve |
| 23 | + |
| 24 | +# Clear Docusaurus cache |
| 25 | +npm run clear |
| 26 | +``` |
| 27 | + |
| 28 | +No linting or test suites are configured. |
| 29 | + |
| 30 | +## Architecture |
| 31 | + |
| 32 | +**Docusaurus static site** with these key areas: |
| 33 | + |
| 34 | +- `docs/` — All documentation content as Markdown files. Organized into sections matching the sidebar categories (core-concepts, managed-tests, custom-tests, environment, etc.) |
| 35 | +- `sidebars.js` — Defines the documentation navigation structure. When adding/removing docs, update this file. |
| 36 | +- `docusaurus.config.js` — Site configuration including Algolia search, Prism syntax highlighting languages, and strict broken link checking (`onBrokenLinks: 'throw'`). |
| 37 | +- `src/components/` — React components used within docs (e.g., `TestTypes.js` renders the list of all QIT test types, reused across pages). |
| 38 | +- `src/prism/qitbash.js` — Custom Prism language definition for QIT CLI command syntax highlighting. Used via the `qitbash` language tag in code blocks. |
| 39 | +- `src/css/custom.css` — Global styles including color tokens for light/dark themes and custom Prism token colors for the `qitbash` language. |
| 40 | +- `changelog/` — Version release notes. |
| 41 | + |
| 42 | +## Key Conventions |
| 43 | + |
| 44 | +- **Broken links are build errors.** Docusaurus is configured to throw on broken links, anchors, and markdown links. Always verify internal links after renaming or moving docs. |
| 45 | +- **Package manager is npm**, not yarn (despite the README mentioning yarn — the lockfile is `package-lock.json`). |
| 46 | +- **Main branch is `trunk`**, not `main` or `master`. |
| 47 | +- **QIT CLI code blocks** use the custom `qitbash` language tag for syntax-highlighted CLI examples. Standard shell commands use `bash`. |
| 48 | +- Docs use MDX, so React components can be imported and used directly in markdown files. |
| 49 | + |
| 50 | +## Deployment |
| 51 | + |
| 52 | +GitHub Actions (`.github/workflows/deploy.yml`) builds the site and deploys via a PHP upload script. Pushes to `trunk` deploy to production; manual dispatch can target staging. |
0 commit comments