You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/CLAUDE.md
+31-5Lines changed: 31 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -20,6 +20,7 @@ This file provides guidance to Claude Code (claude.ai/code) and also Gemini CLI
20
20
- Some older code is JavaScript or CoffeeScript, which will be translated to TypeScript
21
21
- Use ES modules (import/export) syntax, not CommonJS (require)
22
22
- Organize the list of imports in such a way: installed npm packages are on top, newline, then are imports from @cocalc's code base. Sorted alphabetically.
23
+
-**Colors**: Always use the `COLORS` dictionary from `@cocalc/util/theme` for all color values. Never hardcode colors like `#f0f0f0` or `rgb(...)`. Import with `import { COLORS } from "@cocalc/util/theme";` and use predefined constants like `COLORS.GRAY_M`, `COLORS.GRAY_L`, `COLORS.GRAY_LL`, etc.
23
24
-**Backend Logging**: Use `getLogger` from `@cocalc/project/logger` for logging in backend code. Do NOT use `console.log`. Example: `const L = getLogger("module:name").debug;`
24
25
25
26
## Development Commands
@@ -40,6 +41,7 @@ This file provides guidance to Claude Code (claude.ai/code) and also Gemini CLI
40
41
-`cd packages/[package] && pnpm tsc:watch` - TypeScript compilation in watch mode for a specific package
41
42
-`cd packages/[package] && pnpm test` - Run tests for a specific package
42
43
-`cd packages/[package] && pnpm build` - Build a specific package
44
+
- To typecheck the frontend, it is best to run `cd packages/static && pnpm build` - this implicitly compiles the frontend and reports typescript errors
43
45
-**IMPORTANT**: When modifying packages like `util` that other packages depend on, you must run `pnpm build` in the modified package before typechecking dependent packages
44
46
45
47
### Development
@@ -165,18 +167,34 @@ CoCalc is organized as a monorepo with key packages:
165
167
166
168
CoCalc uses react-intl for internationalization with SimpleLocalize as the translation platform.
167
169
170
+
### Architecture Overview
171
+
172
+
-**Library**: Uses `react-intl` library with `defineMessages()` and `defineMessage()`
173
+
-**Default Language**: English uses `defaultMessage` directly - no separate English translation files
174
+
-**Supported Languages**: 19+ languages including German, Chinese, Spanish, French, Italian, Dutch, Russian, Japanese, Portuguese, Korean, Polish, Turkish, Hebrew, Hindi, Hungarian, Arabic, and Basque
175
+
-**Translation Platform**: SimpleLocalize with OpenAI GPT-4o for automatic translations
176
+
168
177
### Translation ID Naming Convention
169
178
170
179
Translation IDs follow a hierarchical pattern: `[directory].[subdir].[filename].[aspect].[label|title|tooltip|...]`
171
180
172
181
Examples:
182
+
173
183
-`labels.masked_files` - for common UI labels
174
184
-`account.sign-out.button.title` - for account sign-out dialog
175
185
-`command.generic.force_build.label` - for command labels
0 commit comments