Skip to content

Commit b8b92cb

Browse files
authored
Merge branch 'master' into release/v2.2.0
2 parents c8d0df4 + 3eb4584 commit b8b92cb

61 files changed

Lines changed: 5223 additions & 241 deletions

Some content is hidden

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

Cargo.lock

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

Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,15 @@ members = [
4848
"modules/sdk-test-connect-disconnect",
4949
"modules/sdk-test-procedure",
5050
"modules/sdk-test-view",
51+
"modules/sdk-test-case-conversion",
5152
"modules/sdk-test-view-pk",
5253
"modules/sdk-test-event-table",
5354
"sdks/rust/tests/test-client",
5455
"sdks/rust/tests/test-counter",
5556
"sdks/rust/tests/connect_disconnect_client",
5657
"sdks/rust/tests/procedure-client",
5758
"sdks/rust/tests/view-client",
59+
"sdks/rust/tests/case-conversion-client",
5860
"sdks/rust/tests/view-pk-client",
5961
"sdks/rust/tests/event-table-client",
6062
"tools/ci",
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
node_modules/
2+
dist/
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
# Case Conversion Test Client (TypeScript)
2+
3+
TypeScript SDK test client for the Rust module `sdk-test-case-conversion`.
4+
Tests that the TS SDK correctly handles case-converted names with digit boundaries.
5+
6+
## What it tests
7+
8+
- Table accessors: `player1`, `person2`, `person_at_level_2`
9+
- Field names with digit boundaries: `player1Id`, `currentLevel2`, `status3Field`
10+
- Nested structs: `personInfo.ageValue1`, `personInfo.scoreTotal`
11+
- Enum variants: `Player2Status` (`Active1`, `BannedUntil`)
12+
- Explicit reducer names: `banPlayer1`
13+
- Query builder: filters on digit-boundary columns, right semijoins
14+
15+
## Prerequisites
16+
17+
1. Build the SpacetimeDB CLI and standalone server:
18+
19+
```bash
20+
cargo build -p spacetimedb-cli -p spacetimedb-standalone
21+
```
22+
23+
2. Build the TS SDK (from repo root):
24+
```bash
25+
cd crates/bindings-typescript && pnpm install && pnpm build
26+
```
27+
28+
## Regenerate bindings
29+
30+
If the Rust module (`modules/sdk-test-case-conversion`) changes:
31+
32+
```bash
33+
pnpm run generate
34+
```
35+
36+
This runs `spacetime generate` against the module and formats the output.
37+
38+
## Run via the Rust test harness (recommended)
39+
40+
From the repo root:
41+
42+
```bash
43+
cargo test -p spacetimedb-sdk --test test case_conversion_rust_ts_client
44+
```
45+
46+
This compiles the Rust module, starts a local server, publishes the module, generates
47+
bindings, builds the TS client, and runs each subcommand (`insert-player`, `insert-person`,
48+
`ban-player`, `query-builder-filter`, `query-builder-join`).
49+
50+
## Run manually
51+
52+
1. Start the standalone server:
53+
54+
```bash
55+
spacetime start
56+
```
57+
58+
2. Publish the module:
59+
60+
```bash
61+
spacetime publish sdk-test-case-conversion \
62+
--module-path modules/sdk-test-case-conversion --server local
63+
```
64+
65+
3. Generate bindings (if not already done):
66+
67+
```bash
68+
cd crates/bindings-typescript/case-conversion-test-client
69+
pnpm run generate
70+
```
71+
72+
4. Build and run a test:
73+
```bash
74+
pnpm install
75+
pnpm run build
76+
SPACETIME_SDK_TEST_DB_NAME=sdk-test-case-conversion node dist/index.js insert-player
77+
```
78+
79+
Available subcommands: `insert-player`, `insert-person`, `ban-player`,
80+
`query-builder-filter`, `query-builder-join`.

0 commit comments

Comments
 (0)