From ad74fbb99405fb7d570e28039cb48f77b7f8258e Mon Sep 17 00:00:00 2001 From: John Detter <4099508+jdetter@users.noreply.github.com> Date: Tue, 11 Nov 2025 16:14:52 +0000 Subject: [PATCH 1/7] Upgrade to version 1.8.0 --- Cargo.lock | 232 +++++++++--------- Cargo.toml | 66 ++--- LICENSE.txt | 4 +- .../BSATN.Codegen/BSATN.Codegen.csproj | 2 +- .../BSATN.Runtime/BSATN.Runtime.csproj | 2 +- crates/bindings-csharp/Codegen/Codegen.csproj | 2 +- crates/bindings-csharp/Runtime/Runtime.csproj | 2 +- crates/bindings-typescript/package.json | 2 +- .../project/typescript/package._json | 2 +- .../basic-c-sharp/server/StdbModule.csproj | 2 +- .../templates/basic-rust/client/Cargo.toml | 2 +- .../templates/basic-rust/server/Cargo.toml | 2 +- .../server-csharp/StdbModule.csproj | 2 +- licenses/BSL.txt | 4 +- sdks/csharp/SpacetimeDB.ClientSDK.csproj | 6 +- .../quickstart-chat/server/StdbModule.csproj | 2 +- .../regression-tests/server/StdbModule.csproj | 2 +- sdks/csharp/package.json | 2 +- 18 files changed, 169 insertions(+), 169 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index ebc8ff69367..cffd902f2c9 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -443,7 +443,7 @@ name = "benchmarks-module" version = "0.1.0" dependencies = [ "anyhow", - "spacetimedb 1.7.0", + "spacetimedb 1.8.0", ] [[package]] @@ -1072,7 +1072,7 @@ dependencies = [ [[package]] name = "connect_disconnect_client" -version = "1.7.0" +version = "1.8.0" dependencies = [ "anyhow", "spacetimedb-sdk", @@ -3420,7 +3420,7 @@ name = "keynote-benchmarks" version = "0.1.0" dependencies = [ "log", - "spacetimedb 1.7.0", + "spacetimedb 1.8.0", ] [[package]] @@ -3800,7 +3800,7 @@ version = "0.0.0" dependencies = [ "anyhow", "log", - "spacetimedb 1.7.0", + "spacetimedb 1.8.0", ] [[package]] @@ -4893,7 +4893,7 @@ name = "perf-test-module" version = "0.1.0" dependencies = [ "log", - "spacetimedb 1.7.0", + "spacetimedb 1.8.0", ] [[package]] @@ -5262,7 +5262,7 @@ dependencies = [ [[package]] name = "procedure-client" -version = "1.7.0" +version = "1.8.0" dependencies = [ "anyhow", "env_logger 0.10.2", @@ -5455,7 +5455,7 @@ name = "quickstart-chat-module" version = "0.1.0" dependencies = [ "log", - "spacetimedb 1.7.0", + "spacetimedb 1.8.0", ] [[package]] @@ -6545,7 +6545,7 @@ dependencies = [ "anyhow", "log", "paste", - "spacetimedb 1.7.0", + "spacetimedb 1.8.0", ] [[package]] @@ -6555,12 +6555,12 @@ dependencies = [ "anyhow", "log", "paste", - "spacetimedb 1.7.0", + "spacetimedb 1.8.0", ] [[package]] name = "sdk-unreal-test-harness" -version = "1.7.0" +version = "1.8.0" dependencies = [ "serial_test", "spacetimedb-testing", @@ -6994,7 +6994,7 @@ name = "spacetime-module" version = "0.1.0" dependencies = [ "log", - "spacetimedb 1.7.0", + "spacetimedb 1.8.0", ] [[package]] @@ -7017,7 +7017,7 @@ dependencies = [ [[package]] name = "spacetimedb" -version = "1.7.0" +version = "1.8.0" dependencies = [ "bytemuck", "derive_more 0.99.20", @@ -7027,28 +7027,28 @@ dependencies = [ "rand 0.8.5", "scoped-tls", "serde_json", - "spacetimedb-bindings-macro 1.7.0", - "spacetimedb-bindings-sys 1.7.0", - "spacetimedb-lib 1.7.0", - "spacetimedb-primitives 1.7.0", + "spacetimedb-bindings-macro 1.8.0", + "spacetimedb-bindings-sys 1.8.0", + "spacetimedb-lib 1.8.0", + "spacetimedb-primitives 1.8.0", "trybuild", ] [[package]] name = "spacetimedb-auth" -version = "1.7.0" +version = "1.8.0" dependencies = [ "anyhow", "serde", "serde_json", "serde_with", "spacetimedb-jsonwebtoken", - "spacetimedb-lib 1.7.0", + "spacetimedb-lib 1.8.0", ] [[package]] name = "spacetimedb-bench" -version = "1.7.0" +version = "1.8.0" dependencies = [ "anyhow", "anymap", @@ -7076,11 +7076,11 @@ dependencies = [ "spacetimedb-data-structures", "spacetimedb-datastore", "spacetimedb-execution", - "spacetimedb-lib 1.7.0", + "spacetimedb-lib 1.8.0", "spacetimedb-paths", - "spacetimedb-primitives 1.7.0", + "spacetimedb-primitives 1.8.0", "spacetimedb-query", - "spacetimedb-sats 1.7.0", + "spacetimedb-sats 1.8.0", "spacetimedb-schema", "spacetimedb-standalone", "spacetimedb-table", @@ -7109,13 +7109,13 @@ dependencies = [ [[package]] name = "spacetimedb-bindings-macro" -version = "1.7.0" +version = "1.8.0" dependencies = [ "heck 0.4.1", "humantime", "proc-macro2", "quote", - "spacetimedb-primitives 1.7.0", + "spacetimedb-primitives 1.8.0", "syn 2.0.107", ] @@ -7130,14 +7130,14 @@ dependencies = [ [[package]] name = "spacetimedb-bindings-sys" -version = "1.7.0" +version = "1.8.0" dependencies = [ - "spacetimedb-primitives 1.7.0", + "spacetimedb-primitives 1.8.0", ] [[package]] name = "spacetimedb-cli" -version = "1.7.0" +version = "1.8.0" dependencies = [ "anyhow", "base64 0.21.7", @@ -7180,9 +7180,9 @@ dependencies = [ "spacetimedb-data-structures", "spacetimedb-fs-utils", "spacetimedb-jsonwebtoken", - "spacetimedb-lib 1.7.0", + "spacetimedb-lib 1.8.0", "spacetimedb-paths", - "spacetimedb-primitives 1.7.0", + "spacetimedb-primitives 1.8.0", "spacetimedb-schema", "syntect", "tabled", @@ -7206,7 +7206,7 @@ dependencies = [ [[package]] name = "spacetimedb-client-api" -version = "1.7.0" +version = "1.8.0" dependencies = [ "anyhow", "async-stream", @@ -7243,7 +7243,7 @@ dependencies = [ "spacetimedb-data-structures", "spacetimedb-datastore", "spacetimedb-jsonwebtoken", - "spacetimedb-lib 1.7.0", + "spacetimedb-lib 1.8.0", "spacetimedb-paths", "spacetimedb-schema", "tempfile", @@ -7261,7 +7261,7 @@ dependencies = [ [[package]] name = "spacetimedb-client-api-messages" -version = "1.7.0" +version = "1.8.0" dependencies = [ "bytes", "bytestring", @@ -7275,16 +7275,16 @@ dependencies = [ "serde_json", "serde_with", "smallvec", - "spacetimedb-lib 1.7.0", - "spacetimedb-primitives 1.7.0", - "spacetimedb-sats 1.7.0", + "spacetimedb-lib 1.8.0", + "spacetimedb-primitives 1.8.0", + "spacetimedb-sats 1.8.0", "strum", "thiserror 1.0.69", ] [[package]] name = "spacetimedb-codegen" -version = "1.7.0" +version = "1.8.0" dependencies = [ "anyhow", "convert_case 0.6.0", @@ -7293,15 +7293,15 @@ dependencies = [ "itertools 0.12.1", "regex", "spacetimedb-data-structures", - "spacetimedb-lib 1.7.0", - "spacetimedb-primitives 1.7.0", + "spacetimedb-lib 1.8.0", + "spacetimedb-primitives 1.8.0", "spacetimedb-schema", "spacetimedb-testing", ] [[package]] name = "spacetimedb-commitlog" -version = "1.7.0" +version = "1.8.0" dependencies = [ "async-stream", "bitflags 2.10.0", @@ -7322,8 +7322,8 @@ dependencies = [ "spacetimedb-commitlog", "spacetimedb-fs-utils", "spacetimedb-paths", - "spacetimedb-primitives 1.7.0", - "spacetimedb-sats 1.7.0", + "spacetimedb-primitives 1.8.0", + "spacetimedb-sats 1.8.0", "tempfile", "thiserror 1.0.69", "tokio", @@ -7334,7 +7334,7 @@ dependencies = [ [[package]] name = "spacetimedb-core" -version = "1.7.0" +version = "1.8.0" dependencies = [ "anyhow", "arrayvec", @@ -7414,14 +7414,14 @@ dependencies = [ "spacetimedb-fs-utils", "spacetimedb-jsonwebtoken", "spacetimedb-jwks", - "spacetimedb-lib 1.7.0", + "spacetimedb-lib 1.8.0", "spacetimedb-memory-usage", "spacetimedb-metrics", "spacetimedb-paths", "spacetimedb-physical-plan", - "spacetimedb-primitives 1.7.0", + "spacetimedb-primitives 1.8.0", "spacetimedb-query", - "spacetimedb-sats 1.7.0", + "spacetimedb-sats 1.8.0", "spacetimedb-schema", "spacetimedb-snapshot", "spacetimedb-subscription", @@ -7456,7 +7456,7 @@ dependencies = [ [[package]] name = "spacetimedb-data-structures" -version = "1.7.0" +version = "1.8.0" dependencies = [ "ahash 0.8.12", "crossbeam-queue", @@ -7470,7 +7470,7 @@ dependencies = [ [[package]] name = "spacetimedb-datastore" -version = "1.7.0" +version = "1.8.0" dependencies = [ "anyhow", "bytes", @@ -7490,11 +7490,11 @@ dependencies = [ "spacetimedb-data-structures", "spacetimedb-durability", "spacetimedb-execution", - "spacetimedb-lib 1.7.0", + "spacetimedb-lib 1.8.0", "spacetimedb-metrics", "spacetimedb-paths", - "spacetimedb-primitives 1.7.0", - "spacetimedb-sats 1.7.0", + "spacetimedb-primitives 1.8.0", + "spacetimedb-sats 1.8.0", "spacetimedb-schema", "spacetimedb-snapshot", "spacetimedb-table", @@ -7505,7 +7505,7 @@ dependencies = [ [[package]] name = "spacetimedb-durability" -version = "1.7.0" +version = "1.8.0" dependencies = [ "anyhow", "itertools 0.12.1", @@ -7513,7 +7513,7 @@ dependencies = [ "scopeguard", "spacetimedb-commitlog", "spacetimedb-paths", - "spacetimedb-sats 1.7.0", + "spacetimedb-sats 1.8.0", "tempfile", "thiserror 1.0.69", "tokio", @@ -7522,22 +7522,22 @@ dependencies = [ [[package]] name = "spacetimedb-execution" -version = "1.7.0" +version = "1.8.0" dependencies = [ "anyhow", "itertools 0.12.1", "spacetimedb-expr", - "spacetimedb-lib 1.7.0", + "spacetimedb-lib 1.8.0", "spacetimedb-physical-plan", - "spacetimedb-primitives 1.7.0", - "spacetimedb-sats 1.7.0", + "spacetimedb-primitives 1.8.0", + "spacetimedb-sats 1.8.0", "spacetimedb-sql-parser", "spacetimedb-table", ] [[package]] name = "spacetimedb-expr" -version = "1.7.0" +version = "1.8.0" dependencies = [ "anyhow", "bigdecimal", @@ -7545,10 +7545,10 @@ dependencies = [ "derive_more 0.99.20", "ethnum", "pretty_assertions", - "spacetimedb 1.7.0", - "spacetimedb-lib 1.7.0", - "spacetimedb-primitives 1.7.0", - "spacetimedb-sats 1.7.0", + "spacetimedb 1.8.0", + "spacetimedb-lib 1.8.0", + "spacetimedb-primitives 1.8.0", + "spacetimedb-sats 1.8.0", "spacetimedb-schema", "spacetimedb-sql-parser", "thiserror 1.0.69", @@ -7556,7 +7556,7 @@ dependencies = [ [[package]] name = "spacetimedb-fs-utils" -version = "1.7.0" +version = "1.8.0" dependencies = [ "anyhow", "hex", @@ -7618,7 +7618,7 @@ dependencies = [ [[package]] name = "spacetimedb-lib" -version = "1.7.0" +version = "1.8.0" dependencies = [ "anyhow", "bitflags 2.10.0", @@ -7636,17 +7636,17 @@ dependencies = [ "ron", "serde", "serde_json", - "spacetimedb-bindings-macro 1.7.0", + "spacetimedb-bindings-macro 1.8.0", "spacetimedb-memory-usage", "spacetimedb-metrics", - "spacetimedb-primitives 1.7.0", - "spacetimedb-sats 1.7.0", + "spacetimedb-primitives 1.8.0", + "spacetimedb-sats 1.8.0", "thiserror 1.0.69", ] [[package]] name = "spacetimedb-memory-usage" -version = "1.7.0" +version = "1.8.0" dependencies = [ "decorum", "ethnum", @@ -7656,7 +7656,7 @@ dependencies = [ [[package]] name = "spacetimedb-metrics" -version = "1.7.0" +version = "1.8.0" dependencies = [ "arrayvec", "itertools 0.12.1", @@ -7666,7 +7666,7 @@ dependencies = [ [[package]] name = "spacetimedb-paths" -version = "1.7.0" +version = "1.8.0" dependencies = [ "anyhow", "chrono", @@ -7682,7 +7682,7 @@ dependencies = [ [[package]] name = "spacetimedb-pg" -version = "1.7.0" +version = "1.8.0" dependencies = [ "anyhow", "async-trait", @@ -7693,22 +7693,22 @@ dependencies = [ "pgwire", "spacetimedb-client-api", "spacetimedb-client-api-messages", - "spacetimedb-lib 1.7.0", + "spacetimedb-lib 1.8.0", "thiserror 1.0.69", "tokio", ] [[package]] name = "spacetimedb-physical-plan" -version = "1.7.0" +version = "1.8.0" dependencies = [ "anyhow", "derive_more 0.99.20", "either", "pretty_assertions", "spacetimedb-expr", - "spacetimedb-lib 1.7.0", - "spacetimedb-primitives 1.7.0", + "spacetimedb-lib 1.8.0", + "spacetimedb-primitives 1.8.0", "spacetimedb-schema", "spacetimedb-sql-parser", "spacetimedb-table", @@ -7728,7 +7728,7 @@ dependencies = [ [[package]] name = "spacetimedb-primitives" -version = "1.7.0" +version = "1.8.0" dependencies = [ "bitflags 2.10.0", "either", @@ -7741,7 +7741,7 @@ dependencies = [ [[package]] name = "spacetimedb-query" -version = "1.7.0" +version = "1.8.0" dependencies = [ "anyhow", "itertools 0.12.1", @@ -7749,9 +7749,9 @@ dependencies = [ "spacetimedb-client-api-messages", "spacetimedb-execution", "spacetimedb-expr", - "spacetimedb-lib 1.7.0", + "spacetimedb-lib 1.8.0", "spacetimedb-physical-plan", - "spacetimedb-primitives 1.7.0", + "spacetimedb-primitives 1.8.0", "spacetimedb-sql-parser", "spacetimedb-table", ] @@ -7784,7 +7784,7 @@ dependencies = [ [[package]] name = "spacetimedb-sats" -version = "1.7.0" +version = "1.8.0" dependencies = [ "ahash 0.8.12", "anyhow", @@ -7809,16 +7809,16 @@ dependencies = [ "serde_json", "sha3", "smallvec", - "spacetimedb-bindings-macro 1.7.0", + "spacetimedb-bindings-macro 1.8.0", "spacetimedb-memory-usage", "spacetimedb-metrics", - "spacetimedb-primitives 1.7.0", + "spacetimedb-primitives 1.8.0", "thiserror 1.0.69", ] [[package]] name = "spacetimedb-schema" -version = "1.7.0" +version = "1.8.0" dependencies = [ "anyhow", "derive_more 0.99.20", @@ -7835,9 +7835,9 @@ dependencies = [ "serial_test", "smallvec", "spacetimedb-data-structures", - "spacetimedb-lib 1.7.0", - "spacetimedb-primitives 1.7.0", - "spacetimedb-sats 1.7.0", + "spacetimedb-lib 1.8.0", + "spacetimedb-primitives 1.8.0", + "spacetimedb-sats 1.8.0", "spacetimedb-sql-parser", "spacetimedb-testing", "termcolor", @@ -7848,7 +7848,7 @@ dependencies = [ [[package]] name = "spacetimedb-sdk" -version = "1.7.0" +version = "1.8.0" dependencies = [ "anymap", "base64 0.21.7", @@ -7867,9 +7867,9 @@ dependencies = [ "rand 0.9.2", "spacetimedb-client-api-messages", "spacetimedb-data-structures", - "spacetimedb-lib 1.7.0", + "spacetimedb-lib 1.8.0", "spacetimedb-metrics", - "spacetimedb-sats 1.7.0", + "spacetimedb-sats 1.8.0", "spacetimedb-testing", "thiserror 1.0.69", "tokio", @@ -7878,7 +7878,7 @@ dependencies = [ [[package]] name = "spacetimedb-snapshot" -version = "1.7.0" +version = "1.8.0" dependencies = [ "anyhow", "blake3", @@ -7895,10 +7895,10 @@ dependencies = [ "spacetimedb-datastore", "spacetimedb-durability", "spacetimedb-fs-utils", - "spacetimedb-lib 1.7.0", + "spacetimedb-lib 1.8.0", "spacetimedb-paths", - "spacetimedb-primitives 1.7.0", - "spacetimedb-sats 1.7.0", + "spacetimedb-primitives 1.8.0", + "spacetimedb-sats 1.8.0", "spacetimedb-schema", "spacetimedb-table", "tempfile", @@ -7911,17 +7911,17 @@ dependencies = [ [[package]] name = "spacetimedb-sql-parser" -version = "1.7.0" +version = "1.8.0" dependencies = [ "derive_more 0.99.20", - "spacetimedb-lib 1.7.0", + "spacetimedb-lib 1.8.0", "sqlparser", "thiserror 1.0.69", ] [[package]] name = "spacetimedb-standalone" -version = "1.7.0" +version = "1.8.0" dependencies = [ "anyhow", "async-trait", @@ -7945,7 +7945,7 @@ dependencies = [ "spacetimedb-client-api-messages", "spacetimedb-core", "spacetimedb-datastore", - "spacetimedb-lib 1.7.0", + "spacetimedb-lib 1.8.0", "spacetimedb-paths", "spacetimedb-pg", "spacetimedb-schema", @@ -7962,20 +7962,20 @@ dependencies = [ [[package]] name = "spacetimedb-subscription" -version = "1.7.0" +version = "1.8.0" dependencies = [ "anyhow", "spacetimedb-execution", "spacetimedb-expr", - "spacetimedb-lib 1.7.0", + "spacetimedb-lib 1.8.0", "spacetimedb-physical-plan", - "spacetimedb-primitives 1.7.0", + "spacetimedb-primitives 1.8.0", "spacetimedb-query", ] [[package]] name = "spacetimedb-table" -version = "1.7.0" +version = "1.8.0" dependencies = [ "ahash 0.8.12", "blake3", @@ -7991,17 +7991,17 @@ dependencies = [ "rand 0.9.2", "smallvec", "spacetimedb-data-structures", - "spacetimedb-lib 1.7.0", + "spacetimedb-lib 1.8.0", "spacetimedb-memory-usage", - "spacetimedb-primitives 1.7.0", - "spacetimedb-sats 1.7.0", + "spacetimedb-primitives 1.8.0", + "spacetimedb-sats 1.8.0", "spacetimedb-schema", "thiserror 1.0.69", ] [[package]] name = "spacetimedb-testing" -version = "1.7.0" +version = "1.8.0" dependencies = [ "anyhow", "bytes", @@ -8018,7 +8018,7 @@ dependencies = [ "spacetimedb-client-api", "spacetimedb-core", "spacetimedb-data-structures", - "spacetimedb-lib 1.7.0", + "spacetimedb-lib 1.8.0", "spacetimedb-paths", "spacetimedb-schema", "spacetimedb-standalone", @@ -8029,7 +8029,7 @@ dependencies = [ [[package]] name = "spacetimedb-update" -version = "1.7.0" +version = "1.8.0" dependencies = [ "anyhow", "bytes", @@ -8054,7 +8054,7 @@ dependencies = [ [[package]] name = "spacetimedb-vm" -version = "1.7.0" +version = "1.8.0" dependencies = [ "anyhow", "arrayvec", @@ -8064,9 +8064,9 @@ dependencies = [ "smallvec", "spacetimedb-data-structures", "spacetimedb-execution", - "spacetimedb-lib 1.7.0", - "spacetimedb-primitives 1.7.0", - "spacetimedb-sats 1.7.0", + "spacetimedb-lib 1.8.0", + "spacetimedb-primitives 1.8.0", + "spacetimedb-sats 1.8.0", "spacetimedb-schema", "spacetimedb-table", "tempfile", @@ -8145,7 +8145,7 @@ dependencies = [ [[package]] name = "sqltest" -version = "1.7.0" +version = "1.8.0" dependencies = [ "anyhow", "async-trait", @@ -8164,8 +8164,8 @@ dependencies = [ "rust_decimal", "spacetimedb-core", "spacetimedb-datastore", - "spacetimedb-lib 1.7.0", - "spacetimedb-sats 1.7.0", + "spacetimedb-lib 1.8.0", + "spacetimedb-sats 1.8.0", "spacetimedb-vm", "sqllogictest", "sqllogictest-engines", @@ -8539,7 +8539,7 @@ dependencies = [ [[package]] name = "test-client" -version = "1.7.0" +version = "1.8.0" dependencies = [ "anyhow", "env_logger 0.10.2", @@ -8551,7 +8551,7 @@ dependencies = [ [[package]] name = "test-counter" -version = "1.7.0" +version = "1.8.0" dependencies = [ "anyhow", "spacetimedb-data-structures", @@ -9279,7 +9279,7 @@ version = "0.1.0" dependencies = [ "anyhow", "log", - "spacetimedb 1.7.0", + "spacetimedb 1.8.0", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index 0551f9f5edb..195b4130213 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -91,44 +91,44 @@ inherits = "release" debug = true [workspace.package] -version = "1.7.0" +version = "1.8.0" edition = "2021" # update rust-toolchain.toml too! rust-version = "1.90.0" [workspace.dependencies] -spacetimedb = { path = "crates/bindings", version = "=1.7.0" } -spacetimedb-auth = { path = "crates/auth", version = "=1.7.0" } -spacetimedb-bindings-macro = { path = "crates/bindings-macro", version = "=1.7.0" } -spacetimedb-bindings-sys = { path = "crates/bindings-sys", version = "=1.7.0" } -spacetimedb-cli = { path = "crates/cli", version = "=1.7.0" } -spacetimedb-client-api = { path = "crates/client-api", version = "=1.7.0" } -spacetimedb-client-api-messages = { path = "crates/client-api-messages", version = "=1.7.0" } -spacetimedb-codegen = { path = "crates/codegen", version = "=1.7.0" } -spacetimedb-commitlog = { path = "crates/commitlog", version = "=1.7.0" } -spacetimedb-core = { path = "crates/core", version = "=1.7.0" } -spacetimedb-data-structures = { path = "crates/data-structures", version = "=1.7.0" } -spacetimedb-datastore = { path = "crates/datastore", version = "=1.7.0" } -spacetimedb-durability = { path = "crates/durability", version = "=1.7.0" } -spacetimedb-execution = { path = "crates/execution", version = "=1.7.0" } -spacetimedb-expr = { path = "crates/expr", version = "=1.7.0" } -spacetimedb-lib = { path = "crates/lib", default-features = false, version = "=1.7.0" } -spacetimedb-memory-usage = { path = "crates/memory-usage", version = "=1.7.0", default-features = false } -spacetimedb-metrics = { path = "crates/metrics", version = "=1.7.0" } -spacetimedb-paths = { path = "crates/paths", version = "=1.7.0" } -spacetimedb-pg = { path = "crates/pg", version = "=1.7.0" } -spacetimedb-physical-plan = { path = "crates/physical-plan", version = "=1.7.0" } -spacetimedb-primitives = { path = "crates/primitives", version = "=1.7.0" } -spacetimedb-query = { path = "crates/query", version = "=1.7.0" } -spacetimedb-sats = { path = "crates/sats", version = "=1.7.0" } -spacetimedb-schema = { path = "crates/schema", version = "=1.7.0" } -spacetimedb-standalone = { path = "crates/standalone", version = "=1.7.0" } -spacetimedb-sql-parser = { path = "crates/sql-parser", version = "=1.7.0" } -spacetimedb-table = { path = "crates/table", version = "=1.7.0" } -spacetimedb-vm = { path = "crates/vm", version = "=1.7.0" } -spacetimedb-fs-utils = { path = "crates/fs-utils", version = "=1.7.0" } -spacetimedb-snapshot = { path = "crates/snapshot", version = "=1.7.0" } -spacetimedb-subscription = { path = "crates/subscription", version = "=1.7.0" } +spacetimedb = { path = "crates/bindings", version = "=1.8.0" } +spacetimedb-auth = { path = "crates/auth", version = "=1.8.0" } +spacetimedb-bindings-macro = { path = "crates/bindings-macro", version = "=1.8.0" } +spacetimedb-bindings-sys = { path = "crates/bindings-sys", version = "=1.8.0" } +spacetimedb-cli = { path = "crates/cli", version = "=1.8.0" } +spacetimedb-client-api = { path = "crates/client-api", version = "=1.8.0" } +spacetimedb-client-api-messages = { path = "crates/client-api-messages", version = "=1.8.0" } +spacetimedb-codegen = { path = "crates/codegen", version = "=1.8.0" } +spacetimedb-commitlog = { path = "crates/commitlog", version = "=1.8.0" } +spacetimedb-core = { path = "crates/core", version = "=1.8.0" } +spacetimedb-data-structures = { path = "crates/data-structures", version = "=1.8.0" } +spacetimedb-datastore = { path = "crates/datastore", version = "=1.8.0" } +spacetimedb-durability = { path = "crates/durability", version = "=1.8.0" } +spacetimedb-execution = { path = "crates/execution", version = "=1.8.0" } +spacetimedb-expr = { path = "crates/expr", version = "=1.8.0" } +spacetimedb-lib = { path = "crates/lib", default-features = false, version = "=1.8.0" } +spacetimedb-memory-usage = { path = "crates/memory-usage", version = "=1.8.0", default-features = false } +spacetimedb-metrics = { path = "crates/metrics", version = "=1.8.0" } +spacetimedb-paths = { path = "crates/paths", version = "=1.8.0" } +spacetimedb-pg = { path = "crates/pg", version = "=1.8.0" } +spacetimedb-physical-plan = { path = "crates/physical-plan", version = "=1.8.0" } +spacetimedb-primitives = { path = "crates/primitives", version = "=1.8.0" } +spacetimedb-query = { path = "crates/query", version = "=1.8.0" } +spacetimedb-sats = { path = "crates/sats", version = "=1.8.0" } +spacetimedb-schema = { path = "crates/schema", version = "=1.8.0" } +spacetimedb-standalone = { path = "crates/standalone", version = "=1.8.0" } +spacetimedb-sql-parser = { path = "crates/sql-parser", version = "=1.8.0" } +spacetimedb-table = { path = "crates/table", version = "=1.8.0" } +spacetimedb-vm = { path = "crates/vm", version = "=1.8.0" } +spacetimedb-fs-utils = { path = "crates/fs-utils", version = "=1.8.0" } +spacetimedb-snapshot = { path = "crates/snapshot", version = "=1.8.0" } +spacetimedb-subscription = { path = "crates/subscription", version = "=1.8.0" } # Prevent `ahash` from pulling in `getrandom` by disabling default features. # Modules use `getrandom02` and we need to prevent an incompatible version diff --git a/LICENSE.txt b/LICENSE.txt index 40f9d2c9477..e87554ac2f1 100644 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -5,7 +5,7 @@ Business Source License 1.1 Parameters Licensor: Clockwork Laboratories, Inc. -Licensed Work: SpacetimeDB 1.7.0 +Licensed Work: SpacetimeDB 1.8.0 The Licensed Work is (c) 2023 Clockwork Laboratories, Inc. @@ -21,7 +21,7 @@ Additional Use Grant: You may make use of the Licensed Work provided your Licensed Work by creating tables whose schemas are controlled by such third parties. -Change Date: 2030-10-31 +Change Date: 2030-11-11 Change License: GNU Affero General Public License v3.0 with a linking exception diff --git a/crates/bindings-csharp/BSATN.Codegen/BSATN.Codegen.csproj b/crates/bindings-csharp/BSATN.Codegen/BSATN.Codegen.csproj index 5784a4da6be..0b9d4d5d988 100644 --- a/crates/bindings-csharp/BSATN.Codegen/BSATN.Codegen.csproj +++ b/crates/bindings-csharp/BSATN.Codegen/BSATN.Codegen.csproj @@ -2,7 +2,7 @@ SpacetimeDB.BSATN.Codegen - 1.7.0 + 1.8.0 SpacetimeDB BSATN Codegen The SpacetimeDB BSATN Codegen implements the Roslyn incremental generators for BSATN serialization/deserialization in C#. diff --git a/crates/bindings-csharp/BSATN.Runtime/BSATN.Runtime.csproj b/crates/bindings-csharp/BSATN.Runtime/BSATN.Runtime.csproj index 97f12a6bfef..cabd8839c73 100644 --- a/crates/bindings-csharp/BSATN.Runtime/BSATN.Runtime.csproj +++ b/crates/bindings-csharp/BSATN.Runtime/BSATN.Runtime.csproj @@ -2,7 +2,7 @@ SpacetimeDB.BSATN.Runtime - 1.7.0 + 1.8.0 SpacetimeDB BSATN Runtime The SpacetimeDB BSATN Runtime implements APIs for BSATN serialization/deserialization in C#. true diff --git a/crates/bindings-csharp/Codegen/Codegen.csproj b/crates/bindings-csharp/Codegen/Codegen.csproj index aedc4de1c9b..d75f321631f 100644 --- a/crates/bindings-csharp/Codegen/Codegen.csproj +++ b/crates/bindings-csharp/Codegen/Codegen.csproj @@ -2,7 +2,7 @@ SpacetimeDB.Codegen - 1.7.0 + 1.8.0 SpacetimeDB Module Codegen The SpacetimeDB Codegen implements the Roslyn incremental generators for writing SpacetimeDB modules in C#. diff --git a/crates/bindings-csharp/Runtime/Runtime.csproj b/crates/bindings-csharp/Runtime/Runtime.csproj index 5e68bff2729..1263f264005 100644 --- a/crates/bindings-csharp/Runtime/Runtime.csproj +++ b/crates/bindings-csharp/Runtime/Runtime.csproj @@ -2,7 +2,7 @@ SpacetimeDB.Runtime - 1.7.0 + 1.8.0 SpacetimeDB Module Runtime The SpacetimeDB Runtime implements the database runtime bindings for writing SpacetimeDB modules in C#. diff --git a/crates/bindings-typescript/package.json b/crates/bindings-typescript/package.json index 74217fac8e8..4219947dc76 100644 --- a/crates/bindings-typescript/package.json +++ b/crates/bindings-typescript/package.json @@ -1,6 +1,6 @@ { "name": "spacetimedb", - "version": "1.7.0", + "version": "1.8.0", "description": "API and ABI bindings for the SpacetimeDB TypeScript module library", "homepage": "https://github.com/clockworklabs/SpacetimeDB#readme", "bugs": { diff --git a/crates/cli/src/subcommands/project/typescript/package._json b/crates/cli/src/subcommands/project/typescript/package._json index 9af76d05094..916b89a7729 100644 --- a/crates/cli/src/subcommands/project/typescript/package._json +++ b/crates/cli/src/subcommands/project/typescript/package._json @@ -10,6 +10,6 @@ "author": "", "license": "ISC", "dependencies": { - "spacetimedb": "1.7.*" + "spacetimedb": "1.8.*" } } \ No newline at end of file diff --git a/crates/cli/templates/basic-c-sharp/server/StdbModule.csproj b/crates/cli/templates/basic-c-sharp/server/StdbModule.csproj index 6121a5ae7f9..75dd64cb9f7 100644 --- a/crates/cli/templates/basic-c-sharp/server/StdbModule.csproj +++ b/crates/cli/templates/basic-c-sharp/server/StdbModule.csproj @@ -8,7 +8,7 @@ - + diff --git a/crates/cli/templates/basic-rust/client/Cargo.toml b/crates/cli/templates/basic-rust/client/Cargo.toml index 56befed5f8a..4426f687482 100644 --- a/crates/cli/templates/basic-rust/client/Cargo.toml +++ b/crates/cli/templates/basic-rust/client/Cargo.toml @@ -4,4 +4,4 @@ version = "0.1.0" edition = "2021" [dependencies] -spacetimedb-sdk = "1.7.*" +spacetimedb-sdk = "1.8.*" diff --git a/crates/cli/templates/basic-rust/server/Cargo.toml b/crates/cli/templates/basic-rust/server/Cargo.toml index 417cc88be6c..5cab11f9281 100644 --- a/crates/cli/templates/basic-rust/server/Cargo.toml +++ b/crates/cli/templates/basic-rust/server/Cargo.toml @@ -9,5 +9,5 @@ edition = "2021" crate-type = ["cdylib"] [dependencies] -spacetimedb = "1.7.*" +spacetimedb = "1.8.*" log = "0.4" diff --git a/demo/Blackholio/server-csharp/StdbModule.csproj b/demo/Blackholio/server-csharp/StdbModule.csproj index eea7fcc05cb..ed84bc2a56b 100644 --- a/demo/Blackholio/server-csharp/StdbModule.csproj +++ b/demo/Blackholio/server-csharp/StdbModule.csproj @@ -13,7 +13,7 @@ - + diff --git a/licenses/BSL.txt b/licenses/BSL.txt index 758ef4e8948..d8b600245f0 100644 --- a/licenses/BSL.txt +++ b/licenses/BSL.txt @@ -5,7 +5,7 @@ Business Source License 1.1 Parameters Licensor: Clockwork Laboratories, Inc. -Licensed Work: SpacetimeDB 1.7.0 +Licensed Work: SpacetimeDB 1.8.0 The Licensed Work is (c) 2023 Clockwork Laboratories, Inc. @@ -21,7 +21,7 @@ Additional Use Grant: You may make use of the Licensed Work provided your Licensed Work by creating tables whose schemas are controlled by such third parties. -Change Date: 2030-10-31 +Change Date: 2030-11-11 Change License: GNU Affero General Public License v3.0 with a linking exception diff --git a/sdks/csharp/SpacetimeDB.ClientSDK.csproj b/sdks/csharp/SpacetimeDB.ClientSDK.csproj index f1f24620b2f..490bd10a305 100644 --- a/sdks/csharp/SpacetimeDB.ClientSDK.csproj +++ b/sdks/csharp/SpacetimeDB.ClientSDK.csproj @@ -16,8 +16,8 @@ logo.png README.md https://github.com/clockworklabs/com.clockworklabs.spacetimedbsdk - 1.7.0 - 1.7.0 + 1.8.0 + 1.8.0 $(DefaultItemExcludes);*~/** packages @@ -25,7 +25,7 @@ - + diff --git a/sdks/csharp/examples~/quickstart-chat/server/StdbModule.csproj b/sdks/csharp/examples~/quickstart-chat/server/StdbModule.csproj index beac8e96f64..528f485954f 100644 --- a/sdks/csharp/examples~/quickstart-chat/server/StdbModule.csproj +++ b/sdks/csharp/examples~/quickstart-chat/server/StdbModule.csproj @@ -14,7 +14,7 @@ - + diff --git a/sdks/csharp/examples~/regression-tests/server/StdbModule.csproj b/sdks/csharp/examples~/regression-tests/server/StdbModule.csproj index 6121a5ae7f9..75dd64cb9f7 100644 --- a/sdks/csharp/examples~/regression-tests/server/StdbModule.csproj +++ b/sdks/csharp/examples~/regression-tests/server/StdbModule.csproj @@ -8,7 +8,7 @@ - + diff --git a/sdks/csharp/package.json b/sdks/csharp/package.json index 68dfccff873..8ff54b8afe6 100644 --- a/sdks/csharp/package.json +++ b/sdks/csharp/package.json @@ -1,7 +1,7 @@ { "name": "com.clockworklabs.spacetimedbsdk", "displayName": "SpacetimeDB SDK", - "version": "1.7.0", + "version": "1.8.0", "description": "The SpacetimeDB Client SDK is a software development kit (SDK) designed to interact with and manipulate SpacetimeDB modules..", "keywords": [], "author": { From 6b082b9127662f8f15a7df6a8ae80869509bb0d0 Mon Sep 17 00:00:00 2001 From: John Detter <4099508+jdetter@users.noreply.github.com> Date: Tue, 11 Nov 2025 16:58:58 +0000 Subject: [PATCH 2/7] Updated bindings --- .../identity_connected_reducer.ts | 33 ++-- .../identity_disconnected_reducer.ts | 33 ++-- .../src/module_bindings/index.ts | 177 ++++++------------ .../src/module_bindings/message_table.ts | 23 +-- .../src/module_bindings/message_type.ts | 42 ++--- .../module_bindings/send_message_reducer.ts | 36 ++-- .../src/module_bindings/set_name_reducer.ts | 32 ++-- .../src/module_bindings/user_table.ts | 32 ++-- .../src/module_bindings/user_type.ts | 44 ++--- 9 files changed, 162 insertions(+), 290 deletions(-) diff --git a/crates/bindings-typescript/examples/quickstart-chat/src/module_bindings/identity_connected_reducer.ts b/crates/bindings-typescript/examples/quickstart-chat/src/module_bindings/identity_connected_reducer.ts index c5f335a93ad..20586a05ea9 100644 --- a/crates/bindings-typescript/examples/quickstart-chat/src/module_bindings/identity_connected_reducer.ts +++ b/crates/bindings-typescript/examples/quickstart-chat/src/module_bindings/identity_connected_reducer.ts @@ -26,7 +26,7 @@ import { type ReducerEventContextInterface as __ReducerEventContextInterface, type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, type TableHandle as __TableHandle, -} from 'spacetimedb'; +} from "spacetimedb"; export type IdentityConnected = {}; let _cached_IdentityConnected_type_value: __AlgebraicTypeType | null = null; @@ -36,33 +36,26 @@ let _cached_IdentityConnected_type_value: __AlgebraicTypeType | null = null; */ export const IdentityConnected = { /** - * A function which returns this type represented as an AlgebraicType. - * This function is derived from the AlgebraicType used to generate this type. - */ + * A function which returns this type represented as an AlgebraicType. + * This function is derived from the AlgebraicType used to generate this type. + */ getTypeScriptAlgebraicType(): __AlgebraicTypeType { - if (_cached_IdentityConnected_type_value) - return _cached_IdentityConnected_type_value; - _cached_IdentityConnected_type_value = __AlgebraicTypeValue.Product({ - elements: [], - }); - _cached_IdentityConnected_type_value.value.elements.push(); + if (_cached_IdentityConnected_type_value) return _cached_IdentityConnected_type_value; + _cached_IdentityConnected_type_value = __AlgebraicTypeValue.Product({ elements: [] }); + _cached_IdentityConnected_type_value.value.elements.push( + ); return _cached_IdentityConnected_type_value; }, serialize(writer: __BinaryWriter, value: IdentityConnected): void { - __AlgebraicTypeValue.serializeValue( - writer, - IdentityConnected.getTypeScriptAlgebraicType(), - value - ); + __AlgebraicTypeValue.serializeValue(writer, IdentityConnected.getTypeScriptAlgebraicType(), value); }, deserialize(reader: __BinaryReader): IdentityConnected { - return __AlgebraicTypeValue.deserializeValue( - reader, - IdentityConnected.getTypeScriptAlgebraicType() - ); + return __AlgebraicTypeValue.deserializeValue(reader, IdentityConnected.getTypeScriptAlgebraicType()); }, -}; + +} export default IdentityConnected; + diff --git a/crates/bindings-typescript/examples/quickstart-chat/src/module_bindings/identity_disconnected_reducer.ts b/crates/bindings-typescript/examples/quickstart-chat/src/module_bindings/identity_disconnected_reducer.ts index 1d2c3901076..2364eebce96 100644 --- a/crates/bindings-typescript/examples/quickstart-chat/src/module_bindings/identity_disconnected_reducer.ts +++ b/crates/bindings-typescript/examples/quickstart-chat/src/module_bindings/identity_disconnected_reducer.ts @@ -26,7 +26,7 @@ import { type ReducerEventContextInterface as __ReducerEventContextInterface, type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, type TableHandle as __TableHandle, -} from 'spacetimedb'; +} from "spacetimedb"; export type IdentityDisconnected = {}; let _cached_IdentityDisconnected_type_value: __AlgebraicTypeType | null = null; @@ -36,33 +36,26 @@ let _cached_IdentityDisconnected_type_value: __AlgebraicTypeType | null = null; */ export const IdentityDisconnected = { /** - * A function which returns this type represented as an AlgebraicType. - * This function is derived from the AlgebraicType used to generate this type. - */ + * A function which returns this type represented as an AlgebraicType. + * This function is derived from the AlgebraicType used to generate this type. + */ getTypeScriptAlgebraicType(): __AlgebraicTypeType { - if (_cached_IdentityDisconnected_type_value) - return _cached_IdentityDisconnected_type_value; - _cached_IdentityDisconnected_type_value = __AlgebraicTypeValue.Product({ - elements: [], - }); - _cached_IdentityDisconnected_type_value.value.elements.push(); + if (_cached_IdentityDisconnected_type_value) return _cached_IdentityDisconnected_type_value; + _cached_IdentityDisconnected_type_value = __AlgebraicTypeValue.Product({ elements: [] }); + _cached_IdentityDisconnected_type_value.value.elements.push( + ); return _cached_IdentityDisconnected_type_value; }, serialize(writer: __BinaryWriter, value: IdentityDisconnected): void { - __AlgebraicTypeValue.serializeValue( - writer, - IdentityDisconnected.getTypeScriptAlgebraicType(), - value - ); + __AlgebraicTypeValue.serializeValue(writer, IdentityDisconnected.getTypeScriptAlgebraicType(), value); }, deserialize(reader: __BinaryReader): IdentityDisconnected { - return __AlgebraicTypeValue.deserializeValue( - reader, - IdentityDisconnected.getTypeScriptAlgebraicType() - ); + return __AlgebraicTypeValue.deserializeValue(reader, IdentityDisconnected.getTypeScriptAlgebraicType()); }, -}; + +} export default IdentityDisconnected; + diff --git a/crates/bindings-typescript/examples/quickstart-chat/src/module_bindings/index.ts b/crates/bindings-typescript/examples/quickstart-chat/src/module_bindings/index.ts index 89a6af89230..3baa918e542 100644 --- a/crates/bindings-typescript/examples/quickstart-chat/src/module_bindings/index.ts +++ b/crates/bindings-typescript/examples/quickstart-chat/src/module_bindings/index.ts @@ -1,7 +1,7 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.5.0 (commit 5bfc84351742a6a8dc717b6c0011946f2d1b632d). +// This was generated using spacetimedb cli version 1.8.0 (commit ad74fbb99405fb7d570e28039cb48f77b7f8258e). /* eslint-disable */ /* tslint:disable */ @@ -28,68 +28,66 @@ import { type ReducerEventContextInterface as __ReducerEventContextInterface, type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, type TableHandle as __TableHandle, -} from 'spacetimedb'; +} from "spacetimedb"; // Import and reexport all reducer arg types -import { IdentityConnected } from './identity_connected_reducer.ts'; +import { IdentityConnected } from "./identity_connected_reducer.ts"; export { IdentityConnected }; -import { IdentityDisconnected } from './identity_disconnected_reducer.ts'; +import { IdentityDisconnected } from "./identity_disconnected_reducer.ts"; export { IdentityDisconnected }; -import { SendMessage } from './send_message_reducer.ts'; +import { SendMessage } from "./send_message_reducer.ts"; export { SendMessage }; -import { SetName } from './set_name_reducer.ts'; +import { SetName } from "./set_name_reducer.ts"; export { SetName }; // Import and reexport all table handle types -import { MessageTableHandle } from './message_table.ts'; +import { MessageTableHandle } from "./message_table.ts"; export { MessageTableHandle }; -import { UserTableHandle } from './user_table.ts'; +import { UserTableHandle } from "./user_table.ts"; export { UserTableHandle }; // Import and reexport all types -import { Message } from './message_type.ts'; +import { Message } from "./message_type.ts"; export { Message }; -import { User } from './user_type.ts'; +import { User } from "./user_type.ts"; export { User }; const REMOTE_MODULE = { tables: { message: { - tableName: 'message' as const, + tableName: "message" as const, rowType: Message.getTypeScriptAlgebraicType(), }, user: { - tableName: 'user' as const, + tableName: "user" as const, rowType: User.getTypeScriptAlgebraicType(), - primaryKey: 'identity', + primaryKey: "identity", primaryKeyInfo: { - colName: 'identity', - colType: ( - User.getTypeScriptAlgebraicType() as __AlgebraicTypeVariants.Product - ).value.elements[0].algebraicType, + colName: "identity", + colType: (User.getTypeScriptAlgebraicType() as __AlgebraicTypeVariants.Product).value.elements[0].algebraicType, }, }, }, reducers: { identity_connected: { - reducerName: 'identity_connected', + reducerName: "identity_connected", argsType: IdentityConnected.getTypeScriptAlgebraicType(), }, identity_disconnected: { - reducerName: 'identity_disconnected', + reducerName: "identity_disconnected", argsType: IdentityDisconnected.getTypeScriptAlgebraicType(), }, send_message: { - reducerName: 'send_message', + reducerName: "send_message", argsType: SendMessage.getTypeScriptAlgebraicType(), }, set_name: { - reducerName: 'set_name', + reducerName: "set_name", argsType: SetName.getTypeScriptAlgebraicType(), }, }, versionInfo: { - cliVersion: '1.7.0', + cliVersion: "1.8.0", }, // Constructors which are used by the DbConnectionImpl to // extract type information from the generated RemoteModule. @@ -98,57 +96,48 @@ const REMOTE_MODULE = { // all we do is build a TypeScript object which we could have done inside the // SDK, but if in the future we wanted to create a class this would be // necessary because classes have methods, so we'll keep it. - eventContextConstructor: ( - imp: __DbConnectionImpl, - event: __Event - ) => { + eventContextConstructor: (imp: __DbConnectionImpl, event: __Event) => { return { ...(imp as DbConnection), - event, - }; + event + } }, dbViewConstructor: (imp: __DbConnectionImpl) => { return new RemoteTables(imp); }, - reducersConstructor: ( - imp: __DbConnectionImpl, - setReducerFlags: SetReducerFlags - ) => { + reducersConstructor: (imp: __DbConnectionImpl, setReducerFlags: SetReducerFlags) => { return new RemoteReducers(imp, setReducerFlags); }, setReducerFlagsConstructor: () => { return new SetReducerFlags(); - }, -}; + } +} // A type representing all the possible variants of a reducer. -export type Reducer = - | never - | { name: 'IdentityConnected'; args: IdentityConnected } - | { name: 'IdentityDisconnected'; args: IdentityDisconnected } - | { name: 'SendMessage'; args: SendMessage } - | { name: 'SetName'; args: SetName }; +export type Reducer = never +| { name: "IdentityConnected", args: IdentityConnected } +| { name: "IdentityDisconnected", args: IdentityDisconnected } +| { name: "SendMessage", args: SendMessage } +| { name: "SetName", args: SetName } +; export class RemoteReducers { - constructor( - private connection: __DbConnectionImpl, - private setCallReducerFlags: SetReducerFlags - ) {} + constructor(private connection: __DbConnectionImpl, private setCallReducerFlags: SetReducerFlags) {} onIdentityConnected(callback: (ctx: ReducerEventContext) => void) { - this.connection.onReducer('identity_connected', callback); + this.connection.onReducer("identity_connected", callback); } removeOnIdentityConnected(callback: (ctx: ReducerEventContext) => void) { - this.connection.offReducer('identity_connected', callback); + this.connection.offReducer("identity_connected", callback); } onIdentityDisconnected(callback: (ctx: ReducerEventContext) => void) { - this.connection.onReducer('identity_disconnected', callback); + this.connection.onReducer("identity_disconnected", callback); } removeOnIdentityDisconnected(callback: (ctx: ReducerEventContext) => void) { - this.connection.offReducer('identity_disconnected', callback); + this.connection.offReducer("identity_disconnected", callback); } sendMessage(text: string) { @@ -156,21 +145,15 @@ export class RemoteReducers { let __writer = new __BinaryWriter(1024); SendMessage.serialize(__writer, __args); let __argsBuffer = __writer.getBuffer(); - this.connection.callReducer( - 'send_message', - __argsBuffer, - this.setCallReducerFlags.sendMessageFlags - ); + this.connection.callReducer("send_message", __argsBuffer, this.setCallReducerFlags.sendMessageFlags); } onSendMessage(callback: (ctx: ReducerEventContext, text: string) => void) { - this.connection.onReducer('send_message', callback); + this.connection.onReducer("send_message", callback); } - removeOnSendMessage( - callback: (ctx: ReducerEventContext, text: string) => void - ) { - this.connection.offReducer('send_message', callback); + removeOnSendMessage(callback: (ctx: ReducerEventContext, text: string) => void) { + this.connection.offReducer("send_message", callback); } setName(name: string) { @@ -178,20 +161,17 @@ export class RemoteReducers { let __writer = new __BinaryWriter(1024); SetName.serialize(__writer, __args); let __argsBuffer = __writer.getBuffer(); - this.connection.callReducer( - 'set_name', - __argsBuffer, - this.setCallReducerFlags.setNameFlags - ); + this.connection.callReducer("set_name", __argsBuffer, this.setCallReducerFlags.setNameFlags); } onSetName(callback: (ctx: ReducerEventContext, name: string) => void) { - this.connection.onReducer('set_name', callback); + this.connection.onReducer("set_name", callback); } removeOnSetName(callback: (ctx: ReducerEventContext, name: string) => void) { - this.connection.offReducer('set_name', callback); + this.connection.offReducer("set_name", callback); } + } export class SetReducerFlags { @@ -204,6 +184,7 @@ export class SetReducerFlags { setName(flags: __CallReducerFlags) { this.setNameFlags = flags; } + } export class RemoteTables { @@ -211,69 +192,27 @@ export class RemoteTables { get message(): MessageTableHandle<'message'> { // clientCache is a private property - return new MessageTableHandle( - ( - this.connection as unknown as { clientCache: __ClientCache } - ).clientCache.getOrCreateTable(REMOTE_MODULE.tables.message) - ); + return new MessageTableHandle((this.connection as unknown as { clientCache: __ClientCache }).clientCache.getOrCreateTable(REMOTE_MODULE.tables.message)); } get user(): UserTableHandle<'user'> { // clientCache is a private property - return new UserTableHandle( - ( - this.connection as unknown as { clientCache: __ClientCache } - ).clientCache.getOrCreateTable(REMOTE_MODULE.tables.user) - ); + return new UserTableHandle((this.connection as unknown as { clientCache: __ClientCache }).clientCache.getOrCreateTable(REMOTE_MODULE.tables.user)); } } -export class SubscriptionBuilder extends __SubscriptionBuilderImpl< - RemoteTables, - RemoteReducers, - SetReducerFlags -> {} +export class SubscriptionBuilder extends __SubscriptionBuilderImpl { } -export class DbConnection extends __DbConnectionImpl< - RemoteTables, - RemoteReducers, - SetReducerFlags -> { - static builder = (): __DbConnectionBuilder< - DbConnection, - ErrorContext, - SubscriptionEventContext - > => { - return new __DbConnectionBuilder< - DbConnection, - ErrorContext, - SubscriptionEventContext - >(REMOTE_MODULE, (imp: __DbConnectionImpl) => imp as DbConnection); - }; +export class DbConnection extends __DbConnectionImpl { + static builder = (): __DbConnectionBuilder => { + return new __DbConnectionBuilder(REMOTE_MODULE, (imp: __DbConnectionImpl) => imp as DbConnection); + } subscriptionBuilder = (): SubscriptionBuilder => { return new SubscriptionBuilder(this); - }; + } } -export type EventContext = __EventContextInterface< - RemoteTables, - RemoteReducers, - SetReducerFlags, - Reducer ->; -export type ReducerEventContext = __ReducerEventContextInterface< - RemoteTables, - RemoteReducers, - SetReducerFlags, - Reducer ->; -export type SubscriptionEventContext = __SubscriptionEventContextInterface< - RemoteTables, - RemoteReducers, - SetReducerFlags ->; -export type ErrorContext = __ErrorContextInterface< - RemoteTables, - RemoteReducers, - SetReducerFlags ->; +export type EventContext = __EventContextInterface; +export type ReducerEventContext = __ReducerEventContextInterface; +export type SubscriptionEventContext = __SubscriptionEventContextInterface; +export type ErrorContext = __ErrorContextInterface; diff --git a/crates/bindings-typescript/examples/quickstart-chat/src/module_bindings/message_table.ts b/crates/bindings-typescript/examples/quickstart-chat/src/module_bindings/message_table.ts index 26b0bc1e34a..2ed9a758fb4 100644 --- a/crates/bindings-typescript/examples/quickstart-chat/src/module_bindings/message_table.ts +++ b/crates/bindings-typescript/examples/quickstart-chat/src/module_bindings/message_table.ts @@ -26,14 +26,9 @@ import { type ReducerEventContextInterface as __ReducerEventContextInterface, type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, type TableHandle as __TableHandle, -} from 'spacetimedb'; -import { Message } from './message_type'; -import { - type EventContext, - type Reducer, - RemoteReducers, - RemoteTables, -} from '.'; +} from "spacetimedb"; +import { Message } from "./message_type"; +import { type EventContext, type Reducer, RemoteReducers, RemoteTables } from "."; declare type __keep = [EventContext, Reducer, RemoteReducers, RemoteTables]; /** @@ -46,9 +41,7 @@ declare type __keep = [EventContext, Reducer, RemoteReducers, RemoteTables]; * but to directly chain method calls, * like `ctx.db.message.on_insert(...)`. */ -export class MessageTableHandle - implements __TableHandle -{ +export class MessageTableHandle implements __TableHandle { // phantom type to track the table name readonly tableName!: TableName; tableCache: __TableCache; @@ -67,17 +60,17 @@ export class MessageTableHandle onInsert = (cb: (ctx: EventContext, row: Message) => void) => { return this.tableCache.onInsert(cb); - }; + } removeOnInsert = (cb: (ctx: EventContext, row: Message) => void) => { return this.tableCache.removeOnInsert(cb); - }; + } onDelete = (cb: (ctx: EventContext, row: Message) => void) => { return this.tableCache.onDelete(cb); - }; + } removeOnDelete = (cb: (ctx: EventContext, row: Message) => void) => { return this.tableCache.removeOnDelete(cb); - }; + } } diff --git a/crates/bindings-typescript/examples/quickstart-chat/src/module_bindings/message_type.ts b/crates/bindings-typescript/examples/quickstart-chat/src/module_bindings/message_type.ts index e4080eced64..e30d67dfcd2 100644 --- a/crates/bindings-typescript/examples/quickstart-chat/src/module_bindings/message_type.ts +++ b/crates/bindings-typescript/examples/quickstart-chat/src/module_bindings/message_type.ts @@ -26,12 +26,12 @@ import { type ReducerEventContextInterface as __ReducerEventContextInterface, type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, type TableHandle as __TableHandle, -} from 'spacetimedb'; +} from "spacetimedb"; export type Message = { - sender: __Identity; - sent: __Timestamp; - text: string; + sender: __Identity, + sent: __Timestamp, + text: string, }; let _cached_Message_type_value: __AlgebraicTypeType | null = null; @@ -40,40 +40,30 @@ let _cached_Message_type_value: __AlgebraicTypeType | null = null; */ export const Message = { /** - * A function which returns this type represented as an AlgebraicType. - * This function is derived from the AlgebraicType used to generate this type. - */ + * A function which returns this type represented as an AlgebraicType. + * This function is derived from the AlgebraicType used to generate this type. + */ getTypeScriptAlgebraicType(): __AlgebraicTypeType { if (_cached_Message_type_value) return _cached_Message_type_value; _cached_Message_type_value = __AlgebraicTypeValue.Product({ elements: [] }); _cached_Message_type_value.value.elements.push( - { - name: 'sender', - algebraicType: __AlgebraicTypeValue.createIdentityType(), - }, - { - name: 'sent', - algebraicType: __AlgebraicTypeValue.createTimestampType(), - }, - { name: 'text', algebraicType: __AlgebraicTypeValue.String } + { name: "sender", algebraicType: __AlgebraicTypeValue.createIdentityType() }, + { name: "sent", algebraicType: __AlgebraicTypeValue.createTimestampType() }, + { name: "text", algebraicType: __AlgebraicTypeValue.String }, ); return _cached_Message_type_value; }, serialize(writer: __BinaryWriter, value: Message): void { - __AlgebraicTypeValue.serializeValue( - writer, - Message.getTypeScriptAlgebraicType(), - value - ); + __AlgebraicTypeValue.serializeValue(writer, Message.getTypeScriptAlgebraicType(), value); }, deserialize(reader: __BinaryReader): Message { - return __AlgebraicTypeValue.deserializeValue( - reader, - Message.getTypeScriptAlgebraicType() - ); + return __AlgebraicTypeValue.deserializeValue(reader, Message.getTypeScriptAlgebraicType()); }, -}; + +} export default Message; + + diff --git a/crates/bindings-typescript/examples/quickstart-chat/src/module_bindings/send_message_reducer.ts b/crates/bindings-typescript/examples/quickstart-chat/src/module_bindings/send_message_reducer.ts index e30d08b732e..9bc2cdcb036 100644 --- a/crates/bindings-typescript/examples/quickstart-chat/src/module_bindings/send_message_reducer.ts +++ b/crates/bindings-typescript/examples/quickstart-chat/src/module_bindings/send_message_reducer.ts @@ -26,10 +26,10 @@ import { type ReducerEventContextInterface as __ReducerEventContextInterface, type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, type TableHandle as __TableHandle, -} from 'spacetimedb'; +} from "spacetimedb"; export type SendMessage = { - text: string; + text: string, }; let _cached_SendMessage_type_value: __AlgebraicTypeType | null = null; @@ -38,35 +38,27 @@ let _cached_SendMessage_type_value: __AlgebraicTypeType | null = null; */ export const SendMessage = { /** - * A function which returns this type represented as an AlgebraicType. - * This function is derived from the AlgebraicType used to generate this type. - */ + * A function which returns this type represented as an AlgebraicType. + * This function is derived from the AlgebraicType used to generate this type. + */ getTypeScriptAlgebraicType(): __AlgebraicTypeType { if (_cached_SendMessage_type_value) return _cached_SendMessage_type_value; - _cached_SendMessage_type_value = __AlgebraicTypeValue.Product({ - elements: [], - }); - _cached_SendMessage_type_value.value.elements.push({ - name: 'text', - algebraicType: __AlgebraicTypeValue.String, - }); + _cached_SendMessage_type_value = __AlgebraicTypeValue.Product({ elements: [] }); + _cached_SendMessage_type_value.value.elements.push( + { name: "text", algebraicType: __AlgebraicTypeValue.String }, + ); return _cached_SendMessage_type_value; }, serialize(writer: __BinaryWriter, value: SendMessage): void { - __AlgebraicTypeValue.serializeValue( - writer, - SendMessage.getTypeScriptAlgebraicType(), - value - ); + __AlgebraicTypeValue.serializeValue(writer, SendMessage.getTypeScriptAlgebraicType(), value); }, deserialize(reader: __BinaryReader): SendMessage { - return __AlgebraicTypeValue.deserializeValue( - reader, - SendMessage.getTypeScriptAlgebraicType() - ); + return __AlgebraicTypeValue.deserializeValue(reader, SendMessage.getTypeScriptAlgebraicType()); }, -}; + +} export default SendMessage; + diff --git a/crates/bindings-typescript/examples/quickstart-chat/src/module_bindings/set_name_reducer.ts b/crates/bindings-typescript/examples/quickstart-chat/src/module_bindings/set_name_reducer.ts index e571226e6be..b22a9ad3f98 100644 --- a/crates/bindings-typescript/examples/quickstart-chat/src/module_bindings/set_name_reducer.ts +++ b/crates/bindings-typescript/examples/quickstart-chat/src/module_bindings/set_name_reducer.ts @@ -26,10 +26,10 @@ import { type ReducerEventContextInterface as __ReducerEventContextInterface, type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, type TableHandle as __TableHandle, -} from 'spacetimedb'; +} from "spacetimedb"; export type SetName = { - name: string; + name: string, }; let _cached_SetName_type_value: __AlgebraicTypeType | null = null; @@ -38,33 +38,27 @@ let _cached_SetName_type_value: __AlgebraicTypeType | null = null; */ export const SetName = { /** - * A function which returns this type represented as an AlgebraicType. - * This function is derived from the AlgebraicType used to generate this type. - */ + * A function which returns this type represented as an AlgebraicType. + * This function is derived from the AlgebraicType used to generate this type. + */ getTypeScriptAlgebraicType(): __AlgebraicTypeType { if (_cached_SetName_type_value) return _cached_SetName_type_value; _cached_SetName_type_value = __AlgebraicTypeValue.Product({ elements: [] }); - _cached_SetName_type_value.value.elements.push({ - name: 'name', - algebraicType: __AlgebraicTypeValue.String, - }); + _cached_SetName_type_value.value.elements.push( + { name: "name", algebraicType: __AlgebraicTypeValue.String }, + ); return _cached_SetName_type_value; }, serialize(writer: __BinaryWriter, value: SetName): void { - __AlgebraicTypeValue.serializeValue( - writer, - SetName.getTypeScriptAlgebraicType(), - value - ); + __AlgebraicTypeValue.serializeValue(writer, SetName.getTypeScriptAlgebraicType(), value); }, deserialize(reader: __BinaryReader): SetName { - return __AlgebraicTypeValue.deserializeValue( - reader, - SetName.getTypeScriptAlgebraicType() - ); + return __AlgebraicTypeValue.deserializeValue(reader, SetName.getTypeScriptAlgebraicType()); }, -}; + +} export default SetName; + diff --git a/crates/bindings-typescript/examples/quickstart-chat/src/module_bindings/user_table.ts b/crates/bindings-typescript/examples/quickstart-chat/src/module_bindings/user_table.ts index 85687a99eff..209a14a7648 100644 --- a/crates/bindings-typescript/examples/quickstart-chat/src/module_bindings/user_table.ts +++ b/crates/bindings-typescript/examples/quickstart-chat/src/module_bindings/user_table.ts @@ -26,14 +26,9 @@ import { type ReducerEventContextInterface as __ReducerEventContextInterface, type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, type TableHandle as __TableHandle, -} from 'spacetimedb'; -import { User } from './user_type'; -import { - type EventContext, - type Reducer, - RemoteReducers, - RemoteTables, -} from '.'; +} from "spacetimedb"; +import { User } from "./user_type"; +import { type EventContext, type Reducer, RemoteReducers, RemoteTables } from "."; declare type __keep = [EventContext, Reducer, RemoteReducers, RemoteTables]; /** @@ -46,9 +41,7 @@ declare type __keep = [EventContext, Reducer, RemoteReducers, RemoteTables]; * but to directly chain method calls, * like `ctx.db.user.on_insert(...)`. */ -export class UserTableHandle - implements __TableHandle -{ +export class UserTableHandle implements __TableHandle { // phantom type to track the table name readonly tableName!: TableName; tableCache: __TableCache; @@ -89,28 +82,25 @@ export class UserTableHandle onInsert = (cb: (ctx: EventContext, row: User) => void) => { return this.tableCache.onInsert(cb); - }; + } removeOnInsert = (cb: (ctx: EventContext, row: User) => void) => { return this.tableCache.removeOnInsert(cb); - }; + } onDelete = (cb: (ctx: EventContext, row: User) => void) => { return this.tableCache.onDelete(cb); - }; + } removeOnDelete = (cb: (ctx: EventContext, row: User) => void) => { return this.tableCache.removeOnDelete(cb); - }; + } // Updates are only defined for tables with primary keys. onUpdate = (cb: (ctx: EventContext, oldRow: User, newRow: User) => void) => { return this.tableCache.onUpdate(cb); - }; + } - removeOnUpdate = ( - cb: (ctx: EventContext, onRow: User, newRow: User) => void - ) => { + removeOnUpdate = (cb: (ctx: EventContext, onRow: User, newRow: User) => void) => { return this.tableCache.removeOnUpdate(cb); - }; -} + }} diff --git a/crates/bindings-typescript/examples/quickstart-chat/src/module_bindings/user_type.ts b/crates/bindings-typescript/examples/quickstart-chat/src/module_bindings/user_type.ts index 974cc8d48e6..808c7680c16 100644 --- a/crates/bindings-typescript/examples/quickstart-chat/src/module_bindings/user_type.ts +++ b/crates/bindings-typescript/examples/quickstart-chat/src/module_bindings/user_type.ts @@ -26,12 +26,12 @@ import { type ReducerEventContextInterface as __ReducerEventContextInterface, type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, type TableHandle as __TableHandle, -} from 'spacetimedb'; +} from "spacetimedb"; export type User = { - identity: __Identity; - name: string | undefined; - online: boolean; + identity: __Identity, + name: string | undefined, + online: boolean, }; let _cached_User_type_value: __AlgebraicTypeType | null = null; @@ -40,42 +40,30 @@ let _cached_User_type_value: __AlgebraicTypeType | null = null; */ export const User = { /** - * A function which returns this type represented as an AlgebraicType. - * This function is derived from the AlgebraicType used to generate this type. - */ + * A function which returns this type represented as an AlgebraicType. + * This function is derived from the AlgebraicType used to generate this type. + */ getTypeScriptAlgebraicType(): __AlgebraicTypeType { if (_cached_User_type_value) return _cached_User_type_value; _cached_User_type_value = __AlgebraicTypeValue.Product({ elements: [] }); _cached_User_type_value.value.elements.push( - { - name: 'identity', - algebraicType: __AlgebraicTypeValue.createIdentityType(), - }, - { - name: 'name', - algebraicType: __AlgebraicTypeValue.createOptionType( - __AlgebraicTypeValue.String - ), - }, - { name: 'online', algebraicType: __AlgebraicTypeValue.Bool } + { name: "identity", algebraicType: __AlgebraicTypeValue.createIdentityType() }, + { name: "name", algebraicType: __AlgebraicTypeValue.createOptionType(__AlgebraicTypeValue.String) }, + { name: "online", algebraicType: __AlgebraicTypeValue.Bool }, ); return _cached_User_type_value; }, serialize(writer: __BinaryWriter, value: User): void { - __AlgebraicTypeValue.serializeValue( - writer, - User.getTypeScriptAlgebraicType(), - value - ); + __AlgebraicTypeValue.serializeValue(writer, User.getTypeScriptAlgebraicType(), value); }, deserialize(reader: __BinaryReader): User { - return __AlgebraicTypeValue.deserializeValue( - reader, - User.getTypeScriptAlgebraicType() - ); + return __AlgebraicTypeValue.deserializeValue(reader, User.getTypeScriptAlgebraicType()); }, -}; + +} export default User; + + From 10d2150f3c2f1193940f144a21b788b6b4379f3c Mon Sep 17 00:00:00 2001 From: John Detter <4099508+jdetter@users.noreply.github.com> Date: Tue, 11 Nov 2025 17:50:36 +0000 Subject: [PATCH 3/7] Lints --- .../identity_connected_reducer.ts | 33 ++-- .../identity_disconnected_reducer.ts | 33 ++-- .../src/module_bindings/index.ts | 175 ++++++++++++------ .../src/module_bindings/message_table.ts | 23 ++- .../src/module_bindings/message_type.ts | 42 +++-- .../module_bindings/send_message_reducer.ts | 36 ++-- .../src/module_bindings/set_name_reducer.ts | 32 ++-- .../src/module_bindings/user_table.ts | 32 ++-- .../src/module_bindings/user_type.ts | 44 +++-- 9 files changed, 289 insertions(+), 161 deletions(-) diff --git a/crates/bindings-typescript/examples/quickstart-chat/src/module_bindings/identity_connected_reducer.ts b/crates/bindings-typescript/examples/quickstart-chat/src/module_bindings/identity_connected_reducer.ts index 20586a05ea9..c5f335a93ad 100644 --- a/crates/bindings-typescript/examples/quickstart-chat/src/module_bindings/identity_connected_reducer.ts +++ b/crates/bindings-typescript/examples/quickstart-chat/src/module_bindings/identity_connected_reducer.ts @@ -26,7 +26,7 @@ import { type ReducerEventContextInterface as __ReducerEventContextInterface, type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, type TableHandle as __TableHandle, -} from "spacetimedb"; +} from 'spacetimedb'; export type IdentityConnected = {}; let _cached_IdentityConnected_type_value: __AlgebraicTypeType | null = null; @@ -36,26 +36,33 @@ let _cached_IdentityConnected_type_value: __AlgebraicTypeType | null = null; */ export const IdentityConnected = { /** - * A function which returns this type represented as an AlgebraicType. - * This function is derived from the AlgebraicType used to generate this type. - */ + * A function which returns this type represented as an AlgebraicType. + * This function is derived from the AlgebraicType used to generate this type. + */ getTypeScriptAlgebraicType(): __AlgebraicTypeType { - if (_cached_IdentityConnected_type_value) return _cached_IdentityConnected_type_value; - _cached_IdentityConnected_type_value = __AlgebraicTypeValue.Product({ elements: [] }); - _cached_IdentityConnected_type_value.value.elements.push( - ); + if (_cached_IdentityConnected_type_value) + return _cached_IdentityConnected_type_value; + _cached_IdentityConnected_type_value = __AlgebraicTypeValue.Product({ + elements: [], + }); + _cached_IdentityConnected_type_value.value.elements.push(); return _cached_IdentityConnected_type_value; }, serialize(writer: __BinaryWriter, value: IdentityConnected): void { - __AlgebraicTypeValue.serializeValue(writer, IdentityConnected.getTypeScriptAlgebraicType(), value); + __AlgebraicTypeValue.serializeValue( + writer, + IdentityConnected.getTypeScriptAlgebraicType(), + value + ); }, deserialize(reader: __BinaryReader): IdentityConnected { - return __AlgebraicTypeValue.deserializeValue(reader, IdentityConnected.getTypeScriptAlgebraicType()); + return __AlgebraicTypeValue.deserializeValue( + reader, + IdentityConnected.getTypeScriptAlgebraicType() + ); }, - -} +}; export default IdentityConnected; - diff --git a/crates/bindings-typescript/examples/quickstart-chat/src/module_bindings/identity_disconnected_reducer.ts b/crates/bindings-typescript/examples/quickstart-chat/src/module_bindings/identity_disconnected_reducer.ts index 2364eebce96..1d2c3901076 100644 --- a/crates/bindings-typescript/examples/quickstart-chat/src/module_bindings/identity_disconnected_reducer.ts +++ b/crates/bindings-typescript/examples/quickstart-chat/src/module_bindings/identity_disconnected_reducer.ts @@ -26,7 +26,7 @@ import { type ReducerEventContextInterface as __ReducerEventContextInterface, type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, type TableHandle as __TableHandle, -} from "spacetimedb"; +} from 'spacetimedb'; export type IdentityDisconnected = {}; let _cached_IdentityDisconnected_type_value: __AlgebraicTypeType | null = null; @@ -36,26 +36,33 @@ let _cached_IdentityDisconnected_type_value: __AlgebraicTypeType | null = null; */ export const IdentityDisconnected = { /** - * A function which returns this type represented as an AlgebraicType. - * This function is derived from the AlgebraicType used to generate this type. - */ + * A function which returns this type represented as an AlgebraicType. + * This function is derived from the AlgebraicType used to generate this type. + */ getTypeScriptAlgebraicType(): __AlgebraicTypeType { - if (_cached_IdentityDisconnected_type_value) return _cached_IdentityDisconnected_type_value; - _cached_IdentityDisconnected_type_value = __AlgebraicTypeValue.Product({ elements: [] }); - _cached_IdentityDisconnected_type_value.value.elements.push( - ); + if (_cached_IdentityDisconnected_type_value) + return _cached_IdentityDisconnected_type_value; + _cached_IdentityDisconnected_type_value = __AlgebraicTypeValue.Product({ + elements: [], + }); + _cached_IdentityDisconnected_type_value.value.elements.push(); return _cached_IdentityDisconnected_type_value; }, serialize(writer: __BinaryWriter, value: IdentityDisconnected): void { - __AlgebraicTypeValue.serializeValue(writer, IdentityDisconnected.getTypeScriptAlgebraicType(), value); + __AlgebraicTypeValue.serializeValue( + writer, + IdentityDisconnected.getTypeScriptAlgebraicType(), + value + ); }, deserialize(reader: __BinaryReader): IdentityDisconnected { - return __AlgebraicTypeValue.deserializeValue(reader, IdentityDisconnected.getTypeScriptAlgebraicType()); + return __AlgebraicTypeValue.deserializeValue( + reader, + IdentityDisconnected.getTypeScriptAlgebraicType() + ); }, - -} +}; export default IdentityDisconnected; - diff --git a/crates/bindings-typescript/examples/quickstart-chat/src/module_bindings/index.ts b/crates/bindings-typescript/examples/quickstart-chat/src/module_bindings/index.ts index 3baa918e542..55d0176b247 100644 --- a/crates/bindings-typescript/examples/quickstart-chat/src/module_bindings/index.ts +++ b/crates/bindings-typescript/examples/quickstart-chat/src/module_bindings/index.ts @@ -28,66 +28,68 @@ import { type ReducerEventContextInterface as __ReducerEventContextInterface, type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, type TableHandle as __TableHandle, -} from "spacetimedb"; +} from 'spacetimedb'; // Import and reexport all reducer arg types -import { IdentityConnected } from "./identity_connected_reducer.ts"; +import { IdentityConnected } from './identity_connected_reducer.ts'; export { IdentityConnected }; -import { IdentityDisconnected } from "./identity_disconnected_reducer.ts"; +import { IdentityDisconnected } from './identity_disconnected_reducer.ts'; export { IdentityDisconnected }; -import { SendMessage } from "./send_message_reducer.ts"; +import { SendMessage } from './send_message_reducer.ts'; export { SendMessage }; -import { SetName } from "./set_name_reducer.ts"; +import { SetName } from './set_name_reducer.ts'; export { SetName }; // Import and reexport all table handle types -import { MessageTableHandle } from "./message_table.ts"; +import { MessageTableHandle } from './message_table.ts'; export { MessageTableHandle }; -import { UserTableHandle } from "./user_table.ts"; +import { UserTableHandle } from './user_table.ts'; export { UserTableHandle }; // Import and reexport all types -import { Message } from "./message_type.ts"; +import { Message } from './message_type.ts'; export { Message }; -import { User } from "./user_type.ts"; +import { User } from './user_type.ts'; export { User }; const REMOTE_MODULE = { tables: { message: { - tableName: "message" as const, + tableName: 'message' as const, rowType: Message.getTypeScriptAlgebraicType(), }, user: { - tableName: "user" as const, + tableName: 'user' as const, rowType: User.getTypeScriptAlgebraicType(), - primaryKey: "identity", + primaryKey: 'identity', primaryKeyInfo: { - colName: "identity", - colType: (User.getTypeScriptAlgebraicType() as __AlgebraicTypeVariants.Product).value.elements[0].algebraicType, + colName: 'identity', + colType: ( + User.getTypeScriptAlgebraicType() as __AlgebraicTypeVariants.Product + ).value.elements[0].algebraicType, }, }, }, reducers: { identity_connected: { - reducerName: "identity_connected", + reducerName: 'identity_connected', argsType: IdentityConnected.getTypeScriptAlgebraicType(), }, identity_disconnected: { - reducerName: "identity_disconnected", + reducerName: 'identity_disconnected', argsType: IdentityDisconnected.getTypeScriptAlgebraicType(), }, send_message: { - reducerName: "send_message", + reducerName: 'send_message', argsType: SendMessage.getTypeScriptAlgebraicType(), }, set_name: { - reducerName: "set_name", + reducerName: 'set_name', argsType: SetName.getTypeScriptAlgebraicType(), }, }, versionInfo: { - cliVersion: "1.8.0", + cliVersion: '1.8.0', }, // Constructors which are used by the DbConnectionImpl to // extract type information from the generated RemoteModule. @@ -96,48 +98,57 @@ const REMOTE_MODULE = { // all we do is build a TypeScript object which we could have done inside the // SDK, but if in the future we wanted to create a class this would be // necessary because classes have methods, so we'll keep it. - eventContextConstructor: (imp: __DbConnectionImpl, event: __Event) => { + eventContextConstructor: ( + imp: __DbConnectionImpl, + event: __Event + ) => { return { ...(imp as DbConnection), - event - } + event, + }; }, dbViewConstructor: (imp: __DbConnectionImpl) => { return new RemoteTables(imp); }, - reducersConstructor: (imp: __DbConnectionImpl, setReducerFlags: SetReducerFlags) => { + reducersConstructor: ( + imp: __DbConnectionImpl, + setReducerFlags: SetReducerFlags + ) => { return new RemoteReducers(imp, setReducerFlags); }, setReducerFlagsConstructor: () => { return new SetReducerFlags(); - } -} + }, +}; // A type representing all the possible variants of a reducer. -export type Reducer = never -| { name: "IdentityConnected", args: IdentityConnected } -| { name: "IdentityDisconnected", args: IdentityDisconnected } -| { name: "SendMessage", args: SendMessage } -| { name: "SetName", args: SetName } -; +export type Reducer = + | never + | { name: 'IdentityConnected'; args: IdentityConnected } + | { name: 'IdentityDisconnected'; args: IdentityDisconnected } + | { name: 'SendMessage'; args: SendMessage } + | { name: 'SetName'; args: SetName }; export class RemoteReducers { - constructor(private connection: __DbConnectionImpl, private setCallReducerFlags: SetReducerFlags) {} + constructor( + private connection: __DbConnectionImpl, + private setCallReducerFlags: SetReducerFlags + ) {} onIdentityConnected(callback: (ctx: ReducerEventContext) => void) { - this.connection.onReducer("identity_connected", callback); + this.connection.onReducer('identity_connected', callback); } removeOnIdentityConnected(callback: (ctx: ReducerEventContext) => void) { - this.connection.offReducer("identity_connected", callback); + this.connection.offReducer('identity_connected', callback); } onIdentityDisconnected(callback: (ctx: ReducerEventContext) => void) { - this.connection.onReducer("identity_disconnected", callback); + this.connection.onReducer('identity_disconnected', callback); } removeOnIdentityDisconnected(callback: (ctx: ReducerEventContext) => void) { - this.connection.offReducer("identity_disconnected", callback); + this.connection.offReducer('identity_disconnected', callback); } sendMessage(text: string) { @@ -145,15 +156,21 @@ export class RemoteReducers { let __writer = new __BinaryWriter(1024); SendMessage.serialize(__writer, __args); let __argsBuffer = __writer.getBuffer(); - this.connection.callReducer("send_message", __argsBuffer, this.setCallReducerFlags.sendMessageFlags); + this.connection.callReducer( + 'send_message', + __argsBuffer, + this.setCallReducerFlags.sendMessageFlags + ); } onSendMessage(callback: (ctx: ReducerEventContext, text: string) => void) { - this.connection.onReducer("send_message", callback); + this.connection.onReducer('send_message', callback); } - removeOnSendMessage(callback: (ctx: ReducerEventContext, text: string) => void) { - this.connection.offReducer("send_message", callback); + removeOnSendMessage( + callback: (ctx: ReducerEventContext, text: string) => void + ) { + this.connection.offReducer('send_message', callback); } setName(name: string) { @@ -161,17 +178,20 @@ export class RemoteReducers { let __writer = new __BinaryWriter(1024); SetName.serialize(__writer, __args); let __argsBuffer = __writer.getBuffer(); - this.connection.callReducer("set_name", __argsBuffer, this.setCallReducerFlags.setNameFlags); + this.connection.callReducer( + 'set_name', + __argsBuffer, + this.setCallReducerFlags.setNameFlags + ); } onSetName(callback: (ctx: ReducerEventContext, name: string) => void) { - this.connection.onReducer("set_name", callback); + this.connection.onReducer('set_name', callback); } removeOnSetName(callback: (ctx: ReducerEventContext, name: string) => void) { - this.connection.offReducer("set_name", callback); + this.connection.offReducer('set_name', callback); } - } export class SetReducerFlags { @@ -184,7 +204,6 @@ export class SetReducerFlags { setName(flags: __CallReducerFlags) { this.setNameFlags = flags; } - } export class RemoteTables { @@ -192,27 +211,69 @@ export class RemoteTables { get message(): MessageTableHandle<'message'> { // clientCache is a private property - return new MessageTableHandle((this.connection as unknown as { clientCache: __ClientCache }).clientCache.getOrCreateTable(REMOTE_MODULE.tables.message)); + return new MessageTableHandle( + ( + this.connection as unknown as { clientCache: __ClientCache } + ).clientCache.getOrCreateTable(REMOTE_MODULE.tables.message) + ); } get user(): UserTableHandle<'user'> { // clientCache is a private property - return new UserTableHandle((this.connection as unknown as { clientCache: __ClientCache }).clientCache.getOrCreateTable(REMOTE_MODULE.tables.user)); + return new UserTableHandle( + ( + this.connection as unknown as { clientCache: __ClientCache } + ).clientCache.getOrCreateTable(REMOTE_MODULE.tables.user) + ); } } -export class SubscriptionBuilder extends __SubscriptionBuilderImpl { } +export class SubscriptionBuilder extends __SubscriptionBuilderImpl< + RemoteTables, + RemoteReducers, + SetReducerFlags +> {} -export class DbConnection extends __DbConnectionImpl { - static builder = (): __DbConnectionBuilder => { - return new __DbConnectionBuilder(REMOTE_MODULE, (imp: __DbConnectionImpl) => imp as DbConnection); - } +export class DbConnection extends __DbConnectionImpl< + RemoteTables, + RemoteReducers, + SetReducerFlags +> { + static builder = (): __DbConnectionBuilder< + DbConnection, + ErrorContext, + SubscriptionEventContext + > => { + return new __DbConnectionBuilder< + DbConnection, + ErrorContext, + SubscriptionEventContext + >(REMOTE_MODULE, (imp: __DbConnectionImpl) => imp as DbConnection); + }; subscriptionBuilder = (): SubscriptionBuilder => { return new SubscriptionBuilder(this); - } + }; } -export type EventContext = __EventContextInterface; -export type ReducerEventContext = __ReducerEventContextInterface; -export type SubscriptionEventContext = __SubscriptionEventContextInterface; -export type ErrorContext = __ErrorContextInterface; +export type EventContext = __EventContextInterface< + RemoteTables, + RemoteReducers, + SetReducerFlags, + Reducer +>; +export type ReducerEventContext = __ReducerEventContextInterface< + RemoteTables, + RemoteReducers, + SetReducerFlags, + Reducer +>; +export type SubscriptionEventContext = __SubscriptionEventContextInterface< + RemoteTables, + RemoteReducers, + SetReducerFlags +>; +export type ErrorContext = __ErrorContextInterface< + RemoteTables, + RemoteReducers, + SetReducerFlags +>; diff --git a/crates/bindings-typescript/examples/quickstart-chat/src/module_bindings/message_table.ts b/crates/bindings-typescript/examples/quickstart-chat/src/module_bindings/message_table.ts index 2ed9a758fb4..26b0bc1e34a 100644 --- a/crates/bindings-typescript/examples/quickstart-chat/src/module_bindings/message_table.ts +++ b/crates/bindings-typescript/examples/quickstart-chat/src/module_bindings/message_table.ts @@ -26,9 +26,14 @@ import { type ReducerEventContextInterface as __ReducerEventContextInterface, type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, type TableHandle as __TableHandle, -} from "spacetimedb"; -import { Message } from "./message_type"; -import { type EventContext, type Reducer, RemoteReducers, RemoteTables } from "."; +} from 'spacetimedb'; +import { Message } from './message_type'; +import { + type EventContext, + type Reducer, + RemoteReducers, + RemoteTables, +} from '.'; declare type __keep = [EventContext, Reducer, RemoteReducers, RemoteTables]; /** @@ -41,7 +46,9 @@ declare type __keep = [EventContext, Reducer, RemoteReducers, RemoteTables]; * but to directly chain method calls, * like `ctx.db.message.on_insert(...)`. */ -export class MessageTableHandle implements __TableHandle { +export class MessageTableHandle + implements __TableHandle +{ // phantom type to track the table name readonly tableName!: TableName; tableCache: __TableCache; @@ -60,17 +67,17 @@ export class MessageTableHandle implements __TableHand onInsert = (cb: (ctx: EventContext, row: Message) => void) => { return this.tableCache.onInsert(cb); - } + }; removeOnInsert = (cb: (ctx: EventContext, row: Message) => void) => { return this.tableCache.removeOnInsert(cb); - } + }; onDelete = (cb: (ctx: EventContext, row: Message) => void) => { return this.tableCache.onDelete(cb); - } + }; removeOnDelete = (cb: (ctx: EventContext, row: Message) => void) => { return this.tableCache.removeOnDelete(cb); - } + }; } diff --git a/crates/bindings-typescript/examples/quickstart-chat/src/module_bindings/message_type.ts b/crates/bindings-typescript/examples/quickstart-chat/src/module_bindings/message_type.ts index e30d67dfcd2..e4080eced64 100644 --- a/crates/bindings-typescript/examples/quickstart-chat/src/module_bindings/message_type.ts +++ b/crates/bindings-typescript/examples/quickstart-chat/src/module_bindings/message_type.ts @@ -26,12 +26,12 @@ import { type ReducerEventContextInterface as __ReducerEventContextInterface, type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, type TableHandle as __TableHandle, -} from "spacetimedb"; +} from 'spacetimedb'; export type Message = { - sender: __Identity, - sent: __Timestamp, - text: string, + sender: __Identity; + sent: __Timestamp; + text: string; }; let _cached_Message_type_value: __AlgebraicTypeType | null = null; @@ -40,30 +40,40 @@ let _cached_Message_type_value: __AlgebraicTypeType | null = null; */ export const Message = { /** - * A function which returns this type represented as an AlgebraicType. - * This function is derived from the AlgebraicType used to generate this type. - */ + * A function which returns this type represented as an AlgebraicType. + * This function is derived from the AlgebraicType used to generate this type. + */ getTypeScriptAlgebraicType(): __AlgebraicTypeType { if (_cached_Message_type_value) return _cached_Message_type_value; _cached_Message_type_value = __AlgebraicTypeValue.Product({ elements: [] }); _cached_Message_type_value.value.elements.push( - { name: "sender", algebraicType: __AlgebraicTypeValue.createIdentityType() }, - { name: "sent", algebraicType: __AlgebraicTypeValue.createTimestampType() }, - { name: "text", algebraicType: __AlgebraicTypeValue.String }, + { + name: 'sender', + algebraicType: __AlgebraicTypeValue.createIdentityType(), + }, + { + name: 'sent', + algebraicType: __AlgebraicTypeValue.createTimestampType(), + }, + { name: 'text', algebraicType: __AlgebraicTypeValue.String } ); return _cached_Message_type_value; }, serialize(writer: __BinaryWriter, value: Message): void { - __AlgebraicTypeValue.serializeValue(writer, Message.getTypeScriptAlgebraicType(), value); + __AlgebraicTypeValue.serializeValue( + writer, + Message.getTypeScriptAlgebraicType(), + value + ); }, deserialize(reader: __BinaryReader): Message { - return __AlgebraicTypeValue.deserializeValue(reader, Message.getTypeScriptAlgebraicType()); + return __AlgebraicTypeValue.deserializeValue( + reader, + Message.getTypeScriptAlgebraicType() + ); }, - -} +}; export default Message; - - diff --git a/crates/bindings-typescript/examples/quickstart-chat/src/module_bindings/send_message_reducer.ts b/crates/bindings-typescript/examples/quickstart-chat/src/module_bindings/send_message_reducer.ts index 9bc2cdcb036..e30d08b732e 100644 --- a/crates/bindings-typescript/examples/quickstart-chat/src/module_bindings/send_message_reducer.ts +++ b/crates/bindings-typescript/examples/quickstart-chat/src/module_bindings/send_message_reducer.ts @@ -26,10 +26,10 @@ import { type ReducerEventContextInterface as __ReducerEventContextInterface, type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, type TableHandle as __TableHandle, -} from "spacetimedb"; +} from 'spacetimedb'; export type SendMessage = { - text: string, + text: string; }; let _cached_SendMessage_type_value: __AlgebraicTypeType | null = null; @@ -38,27 +38,35 @@ let _cached_SendMessage_type_value: __AlgebraicTypeType | null = null; */ export const SendMessage = { /** - * A function which returns this type represented as an AlgebraicType. - * This function is derived from the AlgebraicType used to generate this type. - */ + * A function which returns this type represented as an AlgebraicType. + * This function is derived from the AlgebraicType used to generate this type. + */ getTypeScriptAlgebraicType(): __AlgebraicTypeType { if (_cached_SendMessage_type_value) return _cached_SendMessage_type_value; - _cached_SendMessage_type_value = __AlgebraicTypeValue.Product({ elements: [] }); - _cached_SendMessage_type_value.value.elements.push( - { name: "text", algebraicType: __AlgebraicTypeValue.String }, - ); + _cached_SendMessage_type_value = __AlgebraicTypeValue.Product({ + elements: [], + }); + _cached_SendMessage_type_value.value.elements.push({ + name: 'text', + algebraicType: __AlgebraicTypeValue.String, + }); return _cached_SendMessage_type_value; }, serialize(writer: __BinaryWriter, value: SendMessage): void { - __AlgebraicTypeValue.serializeValue(writer, SendMessage.getTypeScriptAlgebraicType(), value); + __AlgebraicTypeValue.serializeValue( + writer, + SendMessage.getTypeScriptAlgebraicType(), + value + ); }, deserialize(reader: __BinaryReader): SendMessage { - return __AlgebraicTypeValue.deserializeValue(reader, SendMessage.getTypeScriptAlgebraicType()); + return __AlgebraicTypeValue.deserializeValue( + reader, + SendMessage.getTypeScriptAlgebraicType() + ); }, - -} +}; export default SendMessage; - diff --git a/crates/bindings-typescript/examples/quickstart-chat/src/module_bindings/set_name_reducer.ts b/crates/bindings-typescript/examples/quickstart-chat/src/module_bindings/set_name_reducer.ts index b22a9ad3f98..e571226e6be 100644 --- a/crates/bindings-typescript/examples/quickstart-chat/src/module_bindings/set_name_reducer.ts +++ b/crates/bindings-typescript/examples/quickstart-chat/src/module_bindings/set_name_reducer.ts @@ -26,10 +26,10 @@ import { type ReducerEventContextInterface as __ReducerEventContextInterface, type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, type TableHandle as __TableHandle, -} from "spacetimedb"; +} from 'spacetimedb'; export type SetName = { - name: string, + name: string; }; let _cached_SetName_type_value: __AlgebraicTypeType | null = null; @@ -38,27 +38,33 @@ let _cached_SetName_type_value: __AlgebraicTypeType | null = null; */ export const SetName = { /** - * A function which returns this type represented as an AlgebraicType. - * This function is derived from the AlgebraicType used to generate this type. - */ + * A function which returns this type represented as an AlgebraicType. + * This function is derived from the AlgebraicType used to generate this type. + */ getTypeScriptAlgebraicType(): __AlgebraicTypeType { if (_cached_SetName_type_value) return _cached_SetName_type_value; _cached_SetName_type_value = __AlgebraicTypeValue.Product({ elements: [] }); - _cached_SetName_type_value.value.elements.push( - { name: "name", algebraicType: __AlgebraicTypeValue.String }, - ); + _cached_SetName_type_value.value.elements.push({ + name: 'name', + algebraicType: __AlgebraicTypeValue.String, + }); return _cached_SetName_type_value; }, serialize(writer: __BinaryWriter, value: SetName): void { - __AlgebraicTypeValue.serializeValue(writer, SetName.getTypeScriptAlgebraicType(), value); + __AlgebraicTypeValue.serializeValue( + writer, + SetName.getTypeScriptAlgebraicType(), + value + ); }, deserialize(reader: __BinaryReader): SetName { - return __AlgebraicTypeValue.deserializeValue(reader, SetName.getTypeScriptAlgebraicType()); + return __AlgebraicTypeValue.deserializeValue( + reader, + SetName.getTypeScriptAlgebraicType() + ); }, - -} +}; export default SetName; - diff --git a/crates/bindings-typescript/examples/quickstart-chat/src/module_bindings/user_table.ts b/crates/bindings-typescript/examples/quickstart-chat/src/module_bindings/user_table.ts index 209a14a7648..85687a99eff 100644 --- a/crates/bindings-typescript/examples/quickstart-chat/src/module_bindings/user_table.ts +++ b/crates/bindings-typescript/examples/quickstart-chat/src/module_bindings/user_table.ts @@ -26,9 +26,14 @@ import { type ReducerEventContextInterface as __ReducerEventContextInterface, type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, type TableHandle as __TableHandle, -} from "spacetimedb"; -import { User } from "./user_type"; -import { type EventContext, type Reducer, RemoteReducers, RemoteTables } from "."; +} from 'spacetimedb'; +import { User } from './user_type'; +import { + type EventContext, + type Reducer, + RemoteReducers, + RemoteTables, +} from '.'; declare type __keep = [EventContext, Reducer, RemoteReducers, RemoteTables]; /** @@ -41,7 +46,9 @@ declare type __keep = [EventContext, Reducer, RemoteReducers, RemoteTables]; * but to directly chain method calls, * like `ctx.db.user.on_insert(...)`. */ -export class UserTableHandle implements __TableHandle { +export class UserTableHandle + implements __TableHandle +{ // phantom type to track the table name readonly tableName!: TableName; tableCache: __TableCache; @@ -82,25 +89,28 @@ export class UserTableHandle implements __TableHandle< onInsert = (cb: (ctx: EventContext, row: User) => void) => { return this.tableCache.onInsert(cb); - } + }; removeOnInsert = (cb: (ctx: EventContext, row: User) => void) => { return this.tableCache.removeOnInsert(cb); - } + }; onDelete = (cb: (ctx: EventContext, row: User) => void) => { return this.tableCache.onDelete(cb); - } + }; removeOnDelete = (cb: (ctx: EventContext, row: User) => void) => { return this.tableCache.removeOnDelete(cb); - } + }; // Updates are only defined for tables with primary keys. onUpdate = (cb: (ctx: EventContext, oldRow: User, newRow: User) => void) => { return this.tableCache.onUpdate(cb); - } + }; - removeOnUpdate = (cb: (ctx: EventContext, onRow: User, newRow: User) => void) => { + removeOnUpdate = ( + cb: (ctx: EventContext, onRow: User, newRow: User) => void + ) => { return this.tableCache.removeOnUpdate(cb); - }} + }; +} diff --git a/crates/bindings-typescript/examples/quickstart-chat/src/module_bindings/user_type.ts b/crates/bindings-typescript/examples/quickstart-chat/src/module_bindings/user_type.ts index 808c7680c16..974cc8d48e6 100644 --- a/crates/bindings-typescript/examples/quickstart-chat/src/module_bindings/user_type.ts +++ b/crates/bindings-typescript/examples/quickstart-chat/src/module_bindings/user_type.ts @@ -26,12 +26,12 @@ import { type ReducerEventContextInterface as __ReducerEventContextInterface, type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, type TableHandle as __TableHandle, -} from "spacetimedb"; +} from 'spacetimedb'; export type User = { - identity: __Identity, - name: string | undefined, - online: boolean, + identity: __Identity; + name: string | undefined; + online: boolean; }; let _cached_User_type_value: __AlgebraicTypeType | null = null; @@ -40,30 +40,42 @@ let _cached_User_type_value: __AlgebraicTypeType | null = null; */ export const User = { /** - * A function which returns this type represented as an AlgebraicType. - * This function is derived from the AlgebraicType used to generate this type. - */ + * A function which returns this type represented as an AlgebraicType. + * This function is derived from the AlgebraicType used to generate this type. + */ getTypeScriptAlgebraicType(): __AlgebraicTypeType { if (_cached_User_type_value) return _cached_User_type_value; _cached_User_type_value = __AlgebraicTypeValue.Product({ elements: [] }); _cached_User_type_value.value.elements.push( - { name: "identity", algebraicType: __AlgebraicTypeValue.createIdentityType() }, - { name: "name", algebraicType: __AlgebraicTypeValue.createOptionType(__AlgebraicTypeValue.String) }, - { name: "online", algebraicType: __AlgebraicTypeValue.Bool }, + { + name: 'identity', + algebraicType: __AlgebraicTypeValue.createIdentityType(), + }, + { + name: 'name', + algebraicType: __AlgebraicTypeValue.createOptionType( + __AlgebraicTypeValue.String + ), + }, + { name: 'online', algebraicType: __AlgebraicTypeValue.Bool } ); return _cached_User_type_value; }, serialize(writer: __BinaryWriter, value: User): void { - __AlgebraicTypeValue.serializeValue(writer, User.getTypeScriptAlgebraicType(), value); + __AlgebraicTypeValue.serializeValue( + writer, + User.getTypeScriptAlgebraicType(), + value + ); }, deserialize(reader: __BinaryReader): User { - return __AlgebraicTypeValue.deserializeValue(reader, User.getTypeScriptAlgebraicType()); + return __AlgebraicTypeValue.deserializeValue( + reader, + User.getTypeScriptAlgebraicType() + ); }, - -} +}; export default User; - - From dbc32bd29ca98e1f1ebf814eec54c29b68b5ab10 Mon Sep 17 00:00:00 2001 From: Zeke Foppa Date: Tue, 11 Nov 2025 10:33:28 -0800 Subject: [PATCH 4/7] [bfops/bump-version-test]: test --- crates/bindings-typescript/package.json | 2 +- crates/cli/src/subcommands/project/typescript/package._json | 2 +- smoketests/tests/quickstart.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/crates/bindings-typescript/package.json b/crates/bindings-typescript/package.json index 74217fac8e8..4219947dc76 100644 --- a/crates/bindings-typescript/package.json +++ b/crates/bindings-typescript/package.json @@ -1,6 +1,6 @@ { "name": "spacetimedb", - "version": "1.7.0", + "version": "1.8.0", "description": "API and ABI bindings for the SpacetimeDB TypeScript module library", "homepage": "https://github.com/clockworklabs/SpacetimeDB#readme", "bugs": { diff --git a/crates/cli/src/subcommands/project/typescript/package._json b/crates/cli/src/subcommands/project/typescript/package._json index 9af76d05094..916b89a7729 100644 --- a/crates/cli/src/subcommands/project/typescript/package._json +++ b/crates/cli/src/subcommands/project/typescript/package._json @@ -10,6 +10,6 @@ "author": "", "license": "ISC", "dependencies": { - "spacetimedb": "1.7.*" + "spacetimedb": "1.8.*" } } \ No newline at end of file diff --git a/smoketests/tests/quickstart.py b/smoketests/tests/quickstart.py index 9bed9fcd476..1289297eefe 100644 --- a/smoketests/tests/quickstart.py +++ b/smoketests/tests/quickstart.py @@ -361,7 +361,7 @@ class TypeScript(Rust): def server_postprocess(self, server_path: Path): build_typescript_sdk() - pnpm("install", TYPESCRIPT_BINDINGS_PATH, cwd=server_path) + pnpm("install", 'file:%s' % TYPESCRIPT_BINDINGS_PATH, cwd=server_path) def test_quickstart(self): """Run the TypeScript quickstart guides for server.""" From 1ed2d7ca9e99a66802a7872133d2dde734624480 Mon Sep 17 00:00:00 2001 From: Zeke Foppa Date: Tue, 11 Nov 2025 10:58:27 -0800 Subject: [PATCH 5/7] [bfops/bump-version-test]: fix --- smoketests/tests/quickstart.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/smoketests/tests/quickstart.py b/smoketests/tests/quickstart.py index 1289297eefe..87c93ad9c29 100644 --- a/smoketests/tests/quickstart.py +++ b/smoketests/tests/quickstart.py @@ -361,7 +361,10 @@ class TypeScript(Rust): def server_postprocess(self, server_path: Path): build_typescript_sdk() - pnpm("install", 'file:%s' % TYPESCRIPT_BINDINGS_PATH, cwd=server_path) + # We already have spacetimedb installed somehow, but it's not the right version. + # If we don't uninstall before installing, pnpm can panic because it can't find the specified version on npm. + pnpm("uninstall", 'spacetimedb', cwd=server_path) + pnpm("install", TYPESCRIPT_BINDINGS_PATH, cwd=server_path) def test_quickstart(self): """Run the TypeScript quickstart guides for server.""" From d516d7d18c813e5eb2477058c3c1e53afbfdf16c Mon Sep 17 00:00:00 2001 From: Zeke Foppa Date: Tue, 11 Nov 2025 11:20:23 -0800 Subject: [PATCH 6/7] [bfops/bump-version-test]: revert --- crates/bindings-typescript/package.json | 2 +- crates/cli/src/subcommands/project/typescript/package._json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/bindings-typescript/package.json b/crates/bindings-typescript/package.json index 4219947dc76..74217fac8e8 100644 --- a/crates/bindings-typescript/package.json +++ b/crates/bindings-typescript/package.json @@ -1,6 +1,6 @@ { "name": "spacetimedb", - "version": "1.8.0", + "version": "1.7.0", "description": "API and ABI bindings for the SpacetimeDB TypeScript module library", "homepage": "https://github.com/clockworklabs/SpacetimeDB#readme", "bugs": { diff --git a/crates/cli/src/subcommands/project/typescript/package._json b/crates/cli/src/subcommands/project/typescript/package._json index 916b89a7729..9af76d05094 100644 --- a/crates/cli/src/subcommands/project/typescript/package._json +++ b/crates/cli/src/subcommands/project/typescript/package._json @@ -10,6 +10,6 @@ "author": "", "license": "ISC", "dependencies": { - "spacetimedb": "1.8.*" + "spacetimedb": "1.7.*" } } \ No newline at end of file From f7d70270113141c3a2b688fd875c5ac344ec4bf2 Mon Sep 17 00:00:00 2001 From: Zeke Foppa Date: Tue, 11 Nov 2025 11:22:52 -0800 Subject: [PATCH 7/7] [bfops/bump-version-test]: comment --- smoketests/tests/quickstart.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/smoketests/tests/quickstart.py b/smoketests/tests/quickstart.py index 87c93ad9c29..ae20e93abd6 100644 --- a/smoketests/tests/quickstart.py +++ b/smoketests/tests/quickstart.py @@ -361,8 +361,9 @@ class TypeScript(Rust): def server_postprocess(self, server_path: Path): build_typescript_sdk() - # We already have spacetimedb installed somehow, but it's not the right version. - # If we don't uninstall before installing, pnpm can panic because it can't find the specified version on npm. + # We already have spacetimedb as a depencency, but it's expecting to fetch from npm. + # If we don't uninstall before installing, pnpm can panic because it can't find + # the specified version on npm (even though we're about to override it anyway). pnpm("uninstall", 'spacetimedb', cwd=server_path) pnpm("install", TYPESCRIPT_BINDINGS_PATH, cwd=server_path)