mirror of
https://github.com/clockworklabs/SpacetimeDB.git
synced 2026-05-14 03:37:55 -04:00
d78517fd9a
# Description of Changes This PR does several small things: 1. It removes the explicit `h1` tags on every page, and either uses the side bar title directly, or puts it in the frontmatter 2. It merges what are currently called quickstarts into a single Chat App Tutorial 3. It creates new quickstarts which just use `spacetime dev --template` to get you up and running quickly 4. It adds a "The Zen of SpacetimeDB" page much like the Zen of Python which goes over the 5 key principles of SpacetimeDB 5. It reorders all Tabs groups so that the ordering is `TypeScript`, `C#`, `Rust`, `Unreal`, `C++`, `Blueprints` (order of decreasing popularity). 6. It improves the sidebar navigation by having categories act as overview pages, and also fixes the breadcrumbs 7. It fixes various small typos and issues 8. Closes #3610 and adds cursor rules files generally 9. It fixes general styling on the docs page by bring it inline with the UI design: Old: <img width="1678" height="958" alt="image" src="https://github.com/user-attachments/assets/f36efee6-b81a-4463-a179-da68b3a7152e" /> New: <img width="1678" height="957" alt="image" src="https://github.com/user-attachments/assets/f430f77d-0663-47f2-9727-45cbfe10e4c7" /> https://github.com/user-attachments/assets/adc5a78a-ada8-45b5-8078-a45cb81477a3 # API and ABI breaking changes This PR does NOT change any old links. It does add new pages though. # Expected complexity level and risk 3 - it's a large change. I manually tested the TypeScript Chat App Tutorial but I have not gone through the Rust and C# quickstarts. However, we have testing on the quickstarts and this is text only so can be carefully reviewed. # Testing <!-- Describe any testing you've done, and any testing you'd like your reviewers to do, so that you're confident that all the changes work as expected! --> - [x] Ran through each step of the Chat App TypeScript tutorial to ensure it is working - [x] Ran and tested the styles and the functionality of the side bar --------- Signed-off-by: Tyler Cloutier <cloutiertyler@users.noreply.github.com> Co-authored-by: spacetimedb-bot <spacetimedb-bot@users.noreply.github.com> Co-authored-by: clockworklabs-bot <clockworklabs-bot@users.noreply.github.com> Co-authored-by: Zeke Foppa <bfops@users.noreply.github.com> Co-authored-by: clockwork-labs-bot <clockwork-labs-bot@users.noreply.github.com>
73 lines
2.4 KiB
Rust
73 lines
2.4 KiB
Rust
use assert_cmd::cargo::cargo_bin_cmd;
|
|
use predicates::prelude::*;
|
|
|
|
#[test]
|
|
fn cli_dev_help_shows_template_option() {
|
|
let mut cmd = cargo_bin_cmd!("spacetimedb-cli");
|
|
cmd.args(["dev", "--help"])
|
|
.assert()
|
|
.success()
|
|
.stdout(predicate::str::contains("--template"))
|
|
.stdout(predicate::str::contains("-t"));
|
|
}
|
|
|
|
#[test]
|
|
fn cli_dev_accepts_template_flag() {
|
|
// This test verifies that the CLI correctly parses the --template flag.
|
|
// We use --help after the flag to avoid actually running dev mode,
|
|
// but this still validates that the flag is recognized.
|
|
let mut cmd = cargo_bin_cmd!("spacetimedb-cli");
|
|
// Running with an invalid server should fail, but not because of the template flag
|
|
cmd.args(["dev", "--template", "react", "--server", "nonexistent-server-12345"])
|
|
.assert()
|
|
.failure()
|
|
// The error should be about the server, not about an unrecognized --template flag
|
|
.stderr(
|
|
predicate::str::contains("template")
|
|
.not()
|
|
.or(predicate::str::contains("unrecognized").not()),
|
|
);
|
|
}
|
|
|
|
#[test]
|
|
fn cli_dev_accepts_short_template_flag() {
|
|
let mut cmd = cargo_bin_cmd!("spacetimedb-cli");
|
|
cmd.args(["dev", "-t", "typescript", "--server", "nonexistent-server-12345"])
|
|
.assert()
|
|
.failure()
|
|
// The error should be about the server, not about an unrecognized -t flag
|
|
.stderr(
|
|
predicate::str::contains("-t")
|
|
.not()
|
|
.or(predicate::str::contains("unrecognized").not()),
|
|
);
|
|
}
|
|
|
|
#[test]
|
|
fn cli_init_with_template_creates_project() {
|
|
// Test that `spacetime init --template` successfully creates a project
|
|
// We use init directly since dev forwards to it for template handling
|
|
let temp_dir = tempfile::tempdir().expect("failed to create temp dir");
|
|
|
|
let mut cmd = cargo_bin_cmd!("spacetimedb-cli");
|
|
cmd.current_dir(temp_dir.path())
|
|
.args([
|
|
"init",
|
|
"--template",
|
|
"basic-rust",
|
|
"--local",
|
|
"--non-interactive",
|
|
"test-project",
|
|
])
|
|
.assert()
|
|
.success();
|
|
|
|
// Verify expected files were created
|
|
let project_dir = temp_dir.path().join("test-project");
|
|
assert!(
|
|
project_dir.join("spacetimedb").exists(),
|
|
"spacetimedb directory should exist"
|
|
);
|
|
assert!(project_dir.join("src").exists(), "src directory should exist");
|
|
}
|