blueprint

GitHub

A React-based UI toolkit for the web

RAW Rules

AGENTS.md

# Blueprint.js Agentic Development Guide

## Build/Test Commands

- **Build**: `pnpm compile` (all packages), `pnpm nx compile @blueprintjs/core` (single package)
- **Test all**: `pnpm test`, `pnpm nx run-many -t test`
- **Test single package**: `pnpm nx test:vitest:run @blueprintjs/core` or `cd packages/core && pnpm test:vitest:run`
- **Distribute**: `pnpm dist`, `pnpm nx dist @blueprintjs/core` (single package)
- **Lint**: `pnpm lint`, `pnpm lint-fix` (auto-fix), `pnpm nx lint @blueprintjs/core` (single package)
- **Format**: `pnpm format`, `pnpm format-check`
- **Pre-commit hook**: `pnpm exec lint-staged` (via `.husky/pre-commit`)
- **Verify all**: `pnpm verify` (compile + dist + test + lint + format-check)

## Architecture

- **Monorepo** using pnpm workspaces + Nx task runner
- **Package manager**: pnpm v10.29.3 (strict dependency resolution)
- **Packages**: Core UI components in `packages/` - core, datetime, select, table, icons, colors
- **Apps**: docs-app (blueprintjs.com), demo-app, table-dev-app for development
- **Build tools**: node-build-scripts, webpack-build-scripts
- **Testing**: Vitest (components), Jest (build scripts), Enzyme + Chai + Sinon
    - New tests should be written with React Testing Library (RTL)

## Code Style

- **Prettier**: 120 char width, 4-space tabs (2 for SCSS/YAML), trailing commas
- **ESLint**: TypeScript-ESLint + custom @blueprintjs rules, no console.log
- **Imports**: Use workspace: deps
- **Types**: Strict TypeScript, React 18 peer deps
- **Components**: Follow existing patterns in packages/core/src/components/
- **Styling**: SCSS in src/, compiled to lib/css/