|
| 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 | +Marketing website and documentation for OpenSearch Observability Stack — an OpenTelemetry-native observability platform. Built with Astro 5, React 19, and Tailwind CSS 4. |
| 8 | + |
| 9 | +## Commands |
| 10 | + |
| 11 | +```bash |
| 12 | +npm install # Install dependencies |
| 13 | +npm run dev # Dev server at localhost:4321 |
| 14 | +npm run build # Full production build (main site + Starlight docs) |
| 15 | +npm run build:main # Build main site only |
| 16 | +npm run build:starlight # Build Starlight docs only (runs npm ci in starlight-docs/) |
| 17 | +npm test # Run all tests (vitest --run) |
| 18 | +npx vitest --run src/components/Hero.test.ts # Run a single test file |
| 19 | +npm run test:watch # Run tests in watch mode |
| 20 | +npm run test:coverage # Run tests with v8 coverage |
| 21 | +``` |
| 22 | + |
| 23 | +## Architecture |
| 24 | + |
| 25 | +### Two-Site Build |
| 26 | + |
| 27 | +The project produces two separate Astro builds merged into one output: |
| 28 | + |
| 29 | +1. **Main marketing site** (`src/`) — Astro + React + Tailwind. Single-page landing at `/opensearch-agentops-website/`. Configured in root `astro.config.mjs`. |
| 30 | +2. **Documentation site** (`starlight-docs/`) — Astro Starlight. Served at `/opensearch-agentops-website/docs/`. Has its own `package.json` and `astro.config.mjs`. The `build` script runs both and copies Starlight output into `dist/docs/`. |
| 31 | + |
| 32 | +Both sites use `base: '/opensearch-agentops-website'` (or `/opensearch-agentops-website/docs`) for GitHub Pages deployment. All internal links must respect this base path. |
| 33 | + |
| 34 | +### Component Patterns |
| 35 | + |
| 36 | +- **Astro components** (`.astro`) handle static markup and layout (Hero, Features, Navigation, Footer, etc.) |
| 37 | +- **React components** (`.tsx`) handle interactive/client-side behavior (CyclingTagline, IntegrationPathsTabs, DeveloperTestimonials) |
| 38 | +- Components and their tests live side-by-side in `src/components/` |
| 39 | + |
| 40 | +### Testing |
| 41 | + |
| 42 | +- **Framework**: Vitest with happy-dom environment |
| 43 | +- **Setup**: `vitest.setup.ts` imports `@testing-library/jest-dom/vitest` |
| 44 | +- **Test location**: Co-located with source files (e.g., `Hero.astro` → `Hero.test.ts`, `Hero.unit.test.ts`) |
| 45 | +- **React component tests**: Use `@testing-library/react` (`.test.tsx` files) |
| 46 | +- **Astro component tests**: Test HTML output as strings (`.test.ts` / `.unit.test.ts` files) |
| 47 | +- **Coverage**: Includes only `src/**/*.{ts,tsx}`, excludes `.astro` files |
| 48 | + |
| 49 | +### Starlight Docs |
| 50 | + |
| 51 | +Documentation content lives in `starlight-docs/src/content/docs/` organized by section directories (get-started, send-data, investigate, apm, dashboards, alerts, etc.). Pages are Markdown/MDX with required frontmatter (`title`, `description`). Sidebar is auto-generated from directory structure via `starlight-docs/astro.config.mjs`. |
| 52 | + |
| 53 | +To dev the docs site independently: |
| 54 | +```bash |
| 55 | +cd starlight-docs && npm install && npm run dev |
| 56 | +``` |
0 commit comments