This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
Lerna + npm workspaces monorepo with ~38 packages under packages/*. Nx is used only for build caching (see nx.json). Node 24 / npm 11 (.nvmrc). Most packages are libraries built with Babel + Sass; the four apps (code-studio, embed-widget, embed-chart, embed-grid) are built with Vite.
The web UI does not work standalone — it requires a deephaven-core server on port 10000 (override with VITE_PROXY_URL in packages/<app>/.env.local). For E2E, core must run with anonymous auth and -Ddeephaven.application.dir=tests/docker-scripts/data/app.d (see README's E2E section).
npm start— build icons, then watch types and start dev servers (code-studioon :4000,embed-widgeton :4010).npm run start:app/npm run start:embed-widget— start a single dev server.npm run build— full prod build:build:necessary→types→build:packages→build:apps. Always builds@deephaven/iconsfirst because it generates SVGs other packages consume.npm run types/npm run watch:types—tsc --buildusing project references. Top-level packages must be listed in the roottsconfig.jsonreferences for type emit to work.npm test— Jest watch mode, filtered to files changed sinceorigin/main. Presspto filter by name,Shift+Pto toggle theeslint/stylelintjest projects.npm run test:unit— runsbuild:necessary, then all unit tests across every package'sjest.config.cjs.npm run test:lint— runs ESLint and Stylelint as jest projects viajest-runner-eslint/jest-runner-stylelint. Faster thanlint:packageswhen narrowed (-- --changedSince origin/main).- Single test:
npm run test:unit -- <pattern>(matches filename or test name), ornpm run test:debug <pattern>to attach a debugger. npm run e2e/npm run e2e:headed— Playwright; requireslocalhost:4000/ide/reachable and core running.npm run e2e:dockerbuilds a prod image and runs everything in docker. Snapshots are Linux-only — update CI snapshots withnpm run e2e:update-ci-snapshots.DH_LOG_LEVEL=4 npm test— enable@deephaven/logoutput in tests (suppressed by default injest.setup.ts).
- App entry points all live in
packages/code-studio(main UI),packages/embed-widget(single-widget embed),packages/embed-chart,packages/embed-grid.code-studiodepends on nearly every other package and is the fastest way to see end-to-end effects. - Rendering / layout stack:
golden-layout(low-level panel framework) →dashboard(panel state + APIs) →dashboard-core-plugins(concrete panel types: chart, grid, console, filter, linker) →code-studiowires plugins into the app shell. Plugins are registered via@deephaven/plugin. - Data grids:
gridis a generic high-performance canvas grid;iris-gridis the Deephaven-aware grid that knows about the JS API (filters, totals rows, snapshots, etc.).iris-griddepends ongrid. - JS API integration:
jsapi-types(TypeScript types for the API delivered by core),jsapi-shim(re-exports the runtime API loaded from core),jsapi-bootstrap(React context + hooks likeuseApi,useObjectFetcher,useWidgetthat gate UI on API readiness),jsapi-components(React components that consume the API),jsapi-utils(framework-free helpers),jsapi-nodejs(Node loader for using the API server-side). - State:
reduxpackage owns the root store, reducer registry, middleware, and selectors. Other packages register reducers viareducerRegistry.react-hooksandjsapi-bootstrapprovide React-side primitives. - UI primitives:
componentsis the design system. It re-exports a curated subset of@adobe/react-spectrumfromcomponents/src/spectrum— the rest of the codebase must not import@adobe/react-spectrumdirectly (enforced byno-restricted-importsin the root ESLint config). Insidecomponents, onlysrc/spectrum/**andsrc/theme/**may import the spectrum package. - No self-imports: the same ESLint rule forbids a package from importing its own
@deephaven/<name>alias — use relative paths within a package.
- Unit tests resolve workspace packages from source via Jest
moduleNameMapper(^@deephaven/(?!icons|jsapi-types)(.*)$ → packages/$1/src), so you don't need to rebuild dependencies between edits.iconsandjsapi-typesare exceptions and ship pre-built. - Each package has a thin
jest.config.cjsthat extendsjest.config.base.cjs. Tests run underjsdomwithjest.setup.tsmockingmatchMedia,ResizeObserver,IntersectionObserver, fonts, etc. - The "dh-core" JS API is mocked globally via
__mocks__/dh-core— most tests that touch the API use@deephaven/test-utilshelpers and the mock proxy pattern (TestUtils.createMockProxy<T>()).
- Conventional Commits are required for PR titles (enforced by
conventional-pr-check.yml). Types:feat,fix,docs,style,refactor,perf,test,build,ci,chore,revert. Breaking changes use aBREAKING CHANGE:footer in the PR description — do not use the!shorthand. - Lerna versioning is conventional-commits driven; release notes and CHANGELOGs are generated automatically.
- ESLint extends Airbnb + React; Prettier and Stylelint are wired through
@deephaven/prettier-configand@deephaven/stylelint-config. Runnpm run test:lintrather than calling eslint/stylelint directly so caching works. - New packages: copy
embed-widgetfor an app,componentsfor a library, then add to roottsconfig.jsonreferences if it needs to participate innpm run types.