From f0c6c17e4a4231c82ffdc942332f80666f8e1d20 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=ABl?= Date: Sat, 6 Jun 2026 15:13:59 +0200 Subject: [PATCH] docs: rewrite CLAUDE.md for pnpm/Nx monorepo --- CLAUDE.md | 144 ++++++++++++++++++++++++++++-------------------------- 1 file changed, 74 insertions(+), 70 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index a9ed8c0ffd..3da8b9799b 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -2,22 +2,35 @@ This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository. +## Repository layout + +This is a **pnpm + Nx monorepo** (not Yarn — the older single-package layout is gone). Workspaces are defined in `pnpm-workspace.yaml`: + +- `apps/web` (`element-web`) — the browser client. **This is where almost all feature work happens.** Source is `apps/web/src/` (not a top-level `/src/`). +- `apps/desktop` (`element-desktop`) — the Electron wrapper. Uses Vitest for unit tests and `hak` for native modules. +- `packages/module-api` (`@element-hq/element-web-module-api`) — public API surface for runtime modules. +- `packages/shared-components` (`@element-hq/web-shared-components`) — shared React components; home of Storybook. +- `packages/playwright-common`, `packages/vite-common` — shared test/build helpers. + +Build orchestration is Nx (`nx.json`); most `apps/web` scripts (`build`, `start`, `test`, `lint:types`) delegate to Nx targets defined in `apps/web/project.json`, which handle prebuild steps (`prebuild:module_system`, `prebuild:rethemendex`) automatically. + ## Prerequisites -- Node.js >= 22.18 -- Yarn 1.x (classic) +- Node.js: `.node-version` pins **24** (package.json `engines` allows `>=22.18`) +- pnpm (the repo uses a `pnpm-lock.yaml` and a catalog for shared dependency versions) ## Commands -### Setup -- `yarn install` - Install dependencies -- Copy `config.sample.json` to `config.json` and configure (see docs/config.md) +Run package-scoped commands from inside the package dir (e.g. `cd apps/web`) or from the root with `pnpm --filter element-web