Skip to content

Commit b1d0793

Browse files
Merge pull request #431 from gridaco/canary
Grida Canvas - Scene Graph & CRDT
2 parents 5c6170f + 508cb31 commit b1d0793

File tree

236 files changed

+36340
-7989
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

236 files changed

+36340
-7989
lines changed

AGENTS.md

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ We use turborepo (except few isolated packages).
176176
To run test, build, and dev, use below commands.
177177

178178
```sh
179-
# run tests
179+
# run tests (all, not recommended. requires crates build)
180180
turbo test
181181

182182
# run tests for packages
@@ -185,16 +185,19 @@ turbo test --filter='./packages/*'
185185
# build packages (required for typecheck for its dependants)
186186
turbo build --filter='./packages/*'
187187

188+
# build packages in watch mode
189+
pnpm dev:packages --concurrency 100
190+
188191
# run tests except for rust crates
189192
turbo test --filter='!./crates/*'
190193

191-
# run build
194+
# run build (all, not recommended)
192195
turbo build
193196

194197
# run dev
195198
turbo dev
196199

197-
# run typecheck
200+
# run typecheck (always run)
198201
turbo typecheck # fallback when build fails due to network issues (nextjs package might fail due to font fetching issues)
199202

200203
# for crates specific tests
@@ -223,14 +226,15 @@ file. After cloning the repo or installing dependencies, run the following
223226
steps before executing `pnpm typecheck`:
224227

225228
```sh
226-
# install dependencies for shared packages and the editor
227-
pnpm install --filter "./packages/*"
228-
pnpm install --filter editor
229+
pnpm install
229230

230231
# build shared packages and the wasm bundle
231232
pnpm turbo build --filter="./packages/*"
232-
pnpm --filter @grida/canvas-wasm build
233+
pnpm turbo build --filter @grida/canvas-wasm
233234

234235
# finally, run the repository-wide typecheck
235236
pnpm typecheck
237+
238+
# run test (only packages and editor)
239+
pnpm turbo test --filter='./packages/*' --filter=editor
236240
```

Cargo.lock

Lines changed: 27 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/grida-canvas-fonts/tests/e2e_round_trip_simple_test.rs

Lines changed: 45 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -28,20 +28,22 @@ fn test_round_trip_italic_to_roman_to_italic() {
2828

2929
// Create font faces with real data
3030
let font_data: Vec<_> = paths.iter().map(|p| fs::read(p).unwrap()).collect();
31-
31+
3232
// Helper function to create font_faces
33-
let create_font_faces = || vec![
34-
UIFontFace {
35-
face_id: "Inter-VariableFont_opsz,wght.ttf".to_string(),
36-
data: &font_data[0],
37-
user_font_style_italic: Some(false), // Roman
38-
},
39-
UIFontFace {
40-
face_id: "Inter-Italic-VariableFont_opsz,wght.ttf".to_string(),
41-
data: &font_data[1],
42-
user_font_style_italic: Some(true), // Italic
43-
},
44-
];
33+
let create_font_faces = || {
34+
vec![
35+
UIFontFace {
36+
face_id: "Inter-VariableFont_opsz,wght.ttf".to_string(),
37+
data: &font_data[0],
38+
user_font_style_italic: Some(false), // Roman
39+
},
40+
UIFontFace {
41+
face_id: "Inter-Italic-VariableFont_opsz,wght.ttf".to_string(),
42+
data: &font_data[1],
43+
user_font_style_italic: Some(true), // Italic
44+
},
45+
]
46+
};
4547

4648
// Start with italic style
4749
let initial_style = CurrentTextStyle {
@@ -122,20 +124,22 @@ fn test_round_trip_roman_to_italic_to_roman() {
122124

123125
// Create font faces with real data
124126
let font_data: Vec<_> = paths.iter().map(|p| fs::read(p).unwrap()).collect();
125-
127+
126128
// Helper function to create font_faces
127-
let create_font_faces = || vec![
128-
UIFontFace {
129-
face_id: "Inter-VariableFont_opsz,wght.ttf".to_string(),
130-
data: &font_data[0],
131-
user_font_style_italic: Some(false), // Roman
132-
},
133-
UIFontFace {
134-
face_id: "Inter-Italic-VariableFont_opsz,wght.ttf".to_string(),
135-
data: &font_data[1],
136-
user_font_style_italic: Some(true), // Italic
137-
},
138-
];
129+
let create_font_faces = || {
130+
vec![
131+
UIFontFace {
132+
face_id: "Inter-VariableFont_opsz,wght.ttf".to_string(),
133+
data: &font_data[0],
134+
user_font_style_italic: Some(false), // Roman
135+
},
136+
UIFontFace {
137+
face_id: "Inter-Italic-VariableFont_opsz,wght.ttf".to_string(),
138+
data: &font_data[1],
139+
user_font_style_italic: Some(true), // Italic
140+
},
141+
]
142+
};
139143

140144
// Start with roman style
141145
let initial_style = CurrentTextStyle {
@@ -215,20 +219,22 @@ fn test_round_trip_with_smart_resolution() {
215219

216220
// Create font faces with real data
217221
let font_data: Vec<_> = paths.iter().map(|p| fs::read(p).unwrap()).collect();
218-
222+
219223
// Helper function to create font_faces
220-
let create_font_faces = || vec![
221-
UIFontFace {
222-
face_id: "Inter-VariableFont_opsz,wght.ttf".to_string(),
223-
data: &font_data[0],
224-
user_font_style_italic: Some(false),
225-
},
226-
UIFontFace {
227-
face_id: "Inter-Italic-VariableFont_opsz,wght.ttf".to_string(),
228-
data: &font_data[1],
229-
user_font_style_italic: Some(true),
230-
},
231-
];
224+
let create_font_faces = || {
225+
vec![
226+
UIFontFace {
227+
face_id: "Inter-VariableFont_opsz,wght.ttf".to_string(),
228+
data: &font_data[0],
229+
user_font_style_italic: Some(false),
230+
},
231+
UIFontFace {
232+
face_id: "Inter-Italic-VariableFont_opsz,wght.ttf".to_string(),
233+
data: &font_data[1],
234+
user_font_style_italic: Some(true),
235+
},
236+
]
237+
};
232238

233239
// Test with smart resolution (explicit properties + custom_axes)
234240
let mut custom_axes = HashMap::new();

0 commit comments

Comments
 (0)