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
+36-8Lines changed: 36 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,36 +16,40 @@ This file provides guidance to Claude Code (claude.ai/code) and also Gemini CLI
16
16
- Run `pretter -w [filename]` after modifying a file (ts, tsx, md, json, ...) to format it correctly.
17
17
- All .js and .ts files are formatted by the tool prettier
18
18
- Add suitable types when you write code
19
-
- Variable name styles are "camelCase" for local and "FOO_BAR" for global variables. If you edit older code not following these guidlines, adjust this rule to fit the files style.
19
+
- Follow DRY principles!
20
+
- Variable name styles are `camelCase` for local and `FOO_BAR` for global variables. React Components and Classes are `FooBar`. If you edit older code not following these guidlines, adjust this rule to fit the files style.
20
21
- Some older code is JavaScript or CoffeeScript, which will be translated to TypeScript
21
22
- Use ES modules (import/export) syntax, not CommonJS (require)
22
23
- 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.
24
+
-**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
25
-**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
26
25
27
## Development Commands
26
28
27
29
### Essential Commands
28
30
29
31
-`pnpm build-dev` - Build all packages for development
30
-
-`pnpm clean` - Clean all node_modules and dist directories
32
+
-`pnpm clean` - Clean all `node_modules` and `dist` directories
31
33
-`pnpm test` - Run full test suite
32
34
-`pnpm depcheck` - Check for dependency issues
35
+
-`python3 ./scripts/check_npm_packages.py` - Check npm package consistency across packages
33
36
-`prettier -w [filename]` to format the style of a file after editing it
34
37
- after creating a file, run `git add [filename]` to start tracking it
35
38
36
39
### Package-Specific Commands
37
40
38
41
-`cd packages/[package] && pnpm build` - Build and compile a specific package
39
42
- for packages/next and packages/static, run `cd packages/[package] && pnpm build-dev`
40
-
-`cd packages/[package] && pnpm tsc:watch` - TypeScript compilation in watch mode for a specific package
41
43
-`cd packages/[package] && pnpm test` - Run tests for a specific package
42
44
-`cd packages/[package] && pnpm build` - Build a specific package
45
+
- To typecheck the frontend, it is best to run `cd packages/static && pnpm build` - this implicitly compiles the frontend and reports typescript errors
43
46
-**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
47
45
48
### Development
46
49
47
50
-**IMPORTANT**: Always run `prettier -w [filename]` immediately after editing any .ts, .tsx, .md, or .json file to ensure consistent styling
48
51
- After TypeScript or `*.tsx` changes, run `pnpm build` in the relevant package directory
52
+
- When editing the frontend, run `pnpm build-dev` in `packages/static`. This implicitly builds the frontend!
49
53
50
54
## Architecture Overview
51
55
@@ -165,18 +169,34 @@ CoCalc is organized as a monorepo with key packages:
165
169
166
170
CoCalc uses react-intl for internationalization with SimpleLocalize as the translation platform.
167
171
172
+
### Architecture Overview
173
+
174
+
-**Library**: Uses `react-intl` library with `defineMessages()` and `defineMessage()`
175
+
-**Default Language**: English uses `defaultMessage` directly - no separate English translation files
176
+
-**Supported Languages**: 19+ languages including German, Chinese, Spanish, French, Italian, Dutch, Russian, Japanese, Portuguese, Korean, Polish, Turkish, Hebrew, Hindi, Hungarian, Arabic, and Basque
177
+
-**Translation Platform**: SimpleLocalize with OpenAI GPT-4o for automatic translations
178
+
168
179
### Translation ID Naming Convention
169
180
170
181
Translation IDs follow a hierarchical pattern: `[directory].[subdir].[filename].[aspect].[label|title|tooltip|...]`
171
182
172
183
Examples:
184
+
173
185
-`labels.masked_files` - for common UI labels
174
186
-`account.sign-out.button.title` - for account sign-out dialog
175
187
-`command.generic.force_build.label` - for command labels
Copy file name to clipboardExpand all lines: src/compute/compute/package.json
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -53,7 +53,7 @@
53
53
"devDependencies": {
54
54
"@types/cookie": "^0.6.0",
55
55
"@types/node": "^18.16.14",
56
-
"typescript": "^5.7.3"
56
+
"typescript": "^5.9.2"
57
57
},
58
58
"pnpm-comment": "There is a WRONG warning during install saying this onlyBuiltDependencies won't be used because it is in this file, but this is the ONLY place that works. We do also put it there.",
0 commit comments