Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions .github/workflows/typescript-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -102,16 +102,16 @@ jobs:
spacetime server clear -y

- name: Generate client bindings
working-directory: modules/quickstart-chat
working-directory: templates/quickstart-chat-ts/spacetimedb
run: |
spacetime generate --lang typescript --out-dir ../../crates/bindings-typescript/examples/quickstart-chat/src/module_bindings
cd ../../crates/bindings-typescript
spacetime generate --lang typescript --out-dir ../src/module_bindings
cd ../../../crates/bindings-typescript
pnpm format

- name: Check for changes
working-directory: crates/bindings-typescript
working-directory: templates/quickstart-chat-ts
run: |
"${GITHUB_WORKSPACE}"/tools/check-diff.sh examples/quickstart-chat/src/module_bindings || {
"${GITHUB_WORKSPACE}"/tools/check-diff.sh src/module_bindings || {
echo "Error: Bindings are dirty. Please generate bindings again and commit them to this branch."
exit 1
}
Expand All @@ -122,18 +122,18 @@ jobs:
# disown

# - name: Publish module to SpacetimeDB
# working-directory: SpacetimeDB/modules/quickstart-chat
# working-directory: SpacetimeDB/templates/quickstart-chat-ts/spacetimedb
# run: |
# spacetime logout && spacetime login --server-issued-login local
# spacetime publish -s local quickstart-chat -c -y

# - name: Publish module to SpacetimeDB
# working-directory: SpacetimeDB/modules/quickstart-chat
# working-directory: SpacetimeDB/templates/quickstart-chat-ts/spacetimedb
# run: |
# spacetime logs quickstart-chat

- name: Check that quickstart-chat builds
working-directory: crates/bindings-typescript/examples/quickstart-chat
working-directory: templates/quickstart-chat-ts
run: pnpm build

# - name: Run quickstart-chat tests
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ members = [
"modules/keynote-benchmarks",
"modules/perf-test",
"modules/module-test",
"modules/quickstart-chat",
"templates/quickstart-chat-rs/spacetimedb",
"modules/sdk-test",
"modules/sdk-test-connect-disconnect",
"modules/sdk-test-procedure",
Expand Down
24 changes: 0 additions & 24 deletions crates/bindings-typescript/examples/basic-react/.gitignore

This file was deleted.

24 changes: 0 additions & 24 deletions crates/bindings-typescript/examples/empty/.gitignore

This file was deleted.

24 changes: 0 additions & 24 deletions crates/bindings-typescript/examples/quickstart-chat/.gitignore

This file was deleted.

18 changes: 10 additions & 8 deletions crates/cli/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,16 +55,16 @@ fn get_manifest_dir() -> PathBuf {
//
// * `get_templates_json` - returns contents of the JSON file with the list of templates
// * `get_template_files` - returns a HashMap with templates contents based on the
// templates list at crates/cli/templates/templates-list.json
// templates list at templates/templates-list.json
// * `get_cursorrules` - returns contents of a cursorrules file
fn generate_template_files() {
let manifest_dir = get_manifest_dir();
let manifest_path = Path::new(&manifest_dir);
let templates_json_path = manifest_path.join("templates/templates-list.json");
let repo_root = get_repo_root();
let templates_json_path = repo_root.join("templates/templates-list.json");
let out_dir = std::env::var("OUT_DIR").unwrap();
let dest_path = Path::new(&out_dir).join("embedded_templates.rs");

println!("cargo:rerun-if-changed=templates/templates-list.json");
println!("cargo:rerun-if-changed=../../templates/templates-list.json");

let templates_json =
fs::read_to_string(&templates_json_path).expect("Failed to read templates/templates-list.json");
Expand All @@ -76,8 +76,9 @@ fn generate_template_files() {
generated_code.push_str("use std::collections::HashMap;\n\n");

generated_code.push_str("pub fn get_templates_json() -> &'static str {\n");
generated_code
.push_str(" include_str!(concat!(env!(\"CARGO_MANIFEST_DIR\"), \"/templates/templates-list.json\"))\n");
generated_code.push_str(
" include_str!(concat!(env!(\"CARGO_MANIFEST_DIR\"), \"/../../templates/templates-list.json\"))\n",
);
generated_code.push_str("}\n\n");

generated_code
Expand All @@ -92,8 +93,9 @@ fn generate_template_files() {
let server_path = PathBuf::from(server_source);
let client_path = PathBuf::from(client_source);

let server_full_path = Path::new(&manifest_dir).join(&server_path);
let client_full_path = Path::new(&manifest_dir).join(&client_path);
let templates_dir = repo_root.join("templates");
let server_full_path = templates_dir.join(&server_path);
let client_full_path = templates_dir.join(&client_path);

if server_full_path.exists() {
generate_template_entry(&mut generated_code, &server_path, server_source, &manifest_dir);
Expand Down
3 changes: 0 additions & 3 deletions crates/cli/templates/basic-c-sharp/client/.gitignore

This file was deleted.

2 changes: 0 additions & 2 deletions crates/cli/templates/basic-c-sharp/server/.gitignore

This file was deleted.

2 changes: 0 additions & 2 deletions crates/cli/templates/basic-rust/server/.cargo/config.toml

This file was deleted.

17 changes: 0 additions & 17 deletions crates/cli/templates/basic-rust/server/.gitignore

This file was deleted.

Empty file.
2 changes: 0 additions & 2 deletions modules/quickstart-chat/.cargo/config.toml

This file was deleted.

17 changes: 0 additions & 17 deletions modules/quickstart-chat/.gitignore

This file was deleted.

1 change: 0 additions & 1 deletion modules/quickstart-chat/LICENSE

This file was deleted.

Loading
Loading