This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
Cube is a semantic layer for building data applications. This is a monorepo containing the complete Cube ecosystem including:
- Cube backend server and core components
- Client libraries for JavaScript/React/Vue/Angular
- Database drivers for various data sources
- Documentation site
- Rust components (CubeSQL, CubeStore)
Note: This project uses Yarn as the package manager.
# Build all packages
yarn build
# Run TypeScript compilation across all packages
yarn tsc
# Watch mode for TypeScript compilation
yarn tsc:watch
# Clean build artifacts
yarn clean
# Run linting across all packages
yarn lint
# Fix linting issues
yarn lint:fix
# Lint package.json files
yarn lint:npm# Run tests (most packages have individual test commands)
yarn test
# Test individual packages
cd packages/cubejs-[package-name]
yarn testThe documentation is in /docs directory:
cd docs
yarn dev # Start development server
yarn build # Build for production/packages: All JavaScript/TypeScript packages managed by Lerna- Core packages:
cubejs-server-core,cubejs-schema-compiler,cubejs-query-orchestrator - Client libraries:
cubejs-client-core,cubejs-client-react, etc. - Database drivers:
cubejs-postgres-driver,cubejs-bigquery-driver, etc. - API layer:
cubejs-api-gateway
- Core packages:
/rust: Rust components including CubeSQL (SQL interface) and CubeStore (distributed storage)/docs: Next.js documentation site/examples: Example implementations and recipes
- Schema Compiler: Compiles data models into executable queries
- Query Orchestrator: Manages query execution, caching, and pre-aggregations
- API Gateway: Provides REST, GraphQL, and SQL APIs
- CubeSQL: Postgres-compatible SQL interface (Rust)
- CubeStore: Distributed OLAP storage engine (Rust)
- Tesseract: Native SQL planner (Rust) located in
/rust/cubesqlplanner- enabled viaCUBESQL_SQL_PUSH_DOWN=trueenvironment variable
- Uses Yarn workspaces with Lerna for package management
- TypeScript compilation is coordinated across packages
- Jest for unit testing with package-specific configurations
- Most packages have Jest-based unit tests in
/testdirectories - TypeScript packages use
jest.config.jswith TypeScript compilation - Snapshot testing for SQL compilation and query planning
- Driver-specific integration tests in
/packages/cubejs-testing-drivers - End-to-end tests in
/packages/cubejs-testing - Docker-based testing environments for database drivers
# Individual package testing
cd packages/[package-name]
yarn test
# Driver integration tests (requires Docker)
cd packages/cubejs-testing-drivers
yarn test- Making Changes: Work in individual packages, changes are coordinated via Lerna
- Building: Use
yarn tscto compile TypeScript across all packages - Testing: Run relevant tests for modified packages
- Linting: Ensure code passes
yarn lintbefore committing
Use conventional commits with these prefixes:
feat:— new featuresfix:— bug fixesdocs:— documentation changesrefactor:— code refactoring
Include scope in parentheses when applicable, e.g., fix(tesseract): or feat(databricks-jdbc-driver):.
*.test.ts/js: Jest unit testsjest.config.js: Jest configuration per packagetsconfig.json: TypeScript configuration (inherits from root)CHANGELOG.md: Per-package changelogs maintained by Lernasrc/: Source code directorydist/: Compiled output (not committed)
- This is documentation for the old Cube docs site structure (the existing
/docs/CLAUDE.mdrefers to the documentation site) - The main Cube application development happens in
/packages - For data model changes, focus on
cubejs-schema-compilerpackage - For query execution changes, focus on
cubejs-query-orchestratorpackage - Database connectivity is handled by individual driver packages
- Lerna: Monorepo management and publishing
- TypeScript: Primary language for most packages
- Jest: Testing framework
- Rollup: Bundling for client libraries
- Docker: Testing environments for database drivers