|
| 1 | +# CLAUDE.md |
| 2 | + |
| 3 | +This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository. |
| 4 | + |
| 5 | +## Package Manager |
| 6 | + |
| 7 | +**IMPORTANT: This project uses Yarn (v1.22.19) as its package manager. Always use `yarn` commands instead of `npm` for dependency management and script execution.** |
| 8 | + |
| 9 | +## Development Commands |
| 10 | + |
| 11 | +### Build |
| 12 | +```bash |
| 13 | +# Build all packages in the monorepo |
| 14 | +yarn build |
| 15 | + |
| 16 | +# Type check all packages |
| 17 | +yarn tsc |
| 18 | +``` |
| 19 | + |
| 20 | +### Testing |
| 21 | +```bash |
| 22 | +# Run tests in core package |
| 23 | +cd packages/core && yarn test |
| 24 | + |
| 25 | +# Run tests in react package |
| 26 | +cd packages/react && yarn test |
| 27 | + |
| 28 | +# Run tests with coverage in react package |
| 29 | +cd packages/react && yarn coverage |
| 30 | +``` |
| 31 | + |
| 32 | +### Linting |
| 33 | +```bash |
| 34 | +# Lint all files from root |
| 35 | +yarn lint |
| 36 | +``` |
| 37 | + |
| 38 | +### Documentation |
| 39 | +```bash |
| 40 | +# Generate documentation with TypeDoc |
| 41 | +yarn docs |
| 42 | +``` |
| 43 | + |
| 44 | +### Installing Dependencies |
| 45 | +```bash |
| 46 | +# Install all dependencies |
| 47 | +yarn install |
| 48 | + |
| 49 | +# Add a new dependency to a specific package |
| 50 | +cd packages/core && yarn add <package-name> |
| 51 | +cd packages/react && yarn add <package-name> |
| 52 | +``` |
| 53 | + |
| 54 | +## Architecture |
| 55 | + |
| 56 | +This is a Lerna monorepo containing two main packages: |
| 57 | + |
| 58 | +1. **landingai** (`packages/core/`) - Core JavaScript library for LandingLens API integration |
| 59 | + - Provides API client for inference endpoints |
| 60 | + - Contains utility functions for annotations, colors, and math operations |
| 61 | + - Exports TypeScript types for predictions and API responses |
| 62 | + |
| 63 | +2. **landingai-react** (`packages/react/`) - React components library |
| 64 | + - Provides React components for image collection and inference visualization |
| 65 | + - Uses React Context API for API configuration (`InferenceContext`) |
| 66 | + - Main components: `PhotoCollector`, `InferenceResult`, and annotation visualizers |
| 67 | + |
| 68 | +### Key Dependencies |
| 69 | +- Build tools: esbuild for bundling, TypeScript for type checking |
| 70 | +- Testing: Jest for core package, Vitest for React package |
| 71 | +- Monorepo management: Lerna with Yarn workspaces |
| 72 | +- React versions supported: 16.8.0+ and 17.0.0 |
| 73 | + |
| 74 | +### Code Conventions |
| 75 | +- ESLint configuration requires semicolons and single quotes |
| 76 | +- TypeScript strict mode is enabled |
| 77 | +- Component CSS uses CSS modules (`.module.css` files) |
| 78 | +- All public APIs are exported through package index files |
0 commit comments