Commit Graph

19 Commits

Author SHA1 Message Date
clockwork-labs-bot f83d41c75c docs: consolidate outstanding docs fixes (#5166)
## Summary

Consolidates the outstanding docs PRs opened by `clockwork-labs-bot` /
Docs Gremlin into one reviewable PR:

- #4958
- #5085
- #5089
- #5097
- #5112
- #5114
- #5117
- #5127
- #5138
- #5165
- #5175
- #5222

This combines docs updates for:

- getting-started links
- server-issued auth token reconnect behavior in the Unity tutorial
- C++ module/client language coverage
- Unreal client ticking / `FrameTick` guidance
- C# connection callback signatures and codegen language spelling
- deterministic schedule-table sample time
- client frame ticking troubleshooting
- corrected `spacetime generate` usage for Unreal bindings
- TypeScript framework integration reference updates for SolidJS and
current React query-builder tuple usage

## Validation

- `rg -n '^(<<<<<<<|=======|>>>>>>>)' docs crates skills`
- `git diff --check origin/master...HEAD`
- `pnpm --dir docs typecheck`
- `pnpm --dir docs build`

---------

Co-authored-by: clockwork-labs-bot <clockwork-labs-bot@users.noreply.github.com>
Co-authored-by: rain <rain@rain.local>
Co-authored-by: Tyler Cloutier <cloutiertyler@users.noreply.github.com>
2026-06-05 15:43:27 +00:00
Zeke Foppa 8641c17e4e Client binaries from DigitalOcean -> AWS (#5077)
# Description of Changes

Use an AWS bucket for client binaries instead of DigitalOcean.

Note that this will effectively hamstring the DigitalOcean mirror for
any old clients (i.e. ones before this change is released). But it's
only a mirror, and they can "fix" it by upgrading to a version with this
change.

# API and ABI breaking changes

None

# Expected complexity level and risk

1

# Testing

- [x] Manually ran the package job on this PR and confirmed that some of
the resulting URLs are indeed downloadable from the AWS urls

---------

Co-authored-by: Zeke Foppa <bfops@users.noreply.github.com>
2026-05-20 18:57:20 +00:00
euxaristia a3ecae707c fix(update): check version exists before confirming uninstall (#4774)
## Summary

Prevents `spacetime version uninstall <ver>` from showing a confirmation
prompt when the version isn't installed, which previously resulted in a
cryptic "No such file or directory (os error 2)" error after the user
confirmed.

## Changes

### Bug fix
- Check if the version directory exists **before** showing the y/N
prompt
- Return a clear error message: `v{version} is not installed`

### Tests (4 unit tests)
- `test_uninstall_nonexistent_version_errors_before_prompt` — confirms
error fires before prompt for missing versions
- `test_uninstall_current_version_errors` — confirms you can't uninstall
the active version
- `test_uninstall_current_keyword_errors` — confirms the literal string
"current" is rejected
- `test_uninstall_existing_version_with_yes` — confirms normal uninstall
flow works

## Verification

```
cargo check -p spacetimedb-update
cargo clippy -p spacetimedb-update -- -D warnings
cargo test -p spacetimedb-update uninstall
```

## Reproduction

Before this fix:
```
$ spacetime version uninstall 2.0.3
Uninstall v2.0.3? yes
Error: No such file or directory (os error 2)
```

After this fix:
```
$ spacetime version uninstall 2.0.3
Error: v2.0.3 is not installed
```

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-05-04 21:50:50 +00:00
clockwork-labs-bot 5404126aba CLI - Notify users if there's an update available (#4363)
## Summary

Adds a version update check to the `spacetimedb-update` proxy, so users
are notified when a newer version of SpacetimeDB is available.

## Changes

Adds `crates/update/src/update_notice.rs` — a lightweight update check
that runs in the proxy path before exec'ing the CLI:

- **Cache-based**: Stores the last check result in
`~/.spacetime/.update_check_cache`. Only hits the network once every 24
hours.
- **Non-blocking on cache hit**: If the cache is fresh, it's a single
file read — no network, no delay.
- **Short timeout**: When the cache is stale, makes a single HTTP
request to GitHub releases API with a 5-second timeout. Uses the same
`SPACETIME_UPDATE_RELEASES_URL` env var as `spacetime version upgrade`.
- **Best-effort**: Any failure (network, parse, file I/O) is silently
ignored. The update check never interferes with the user's command.
- **Uses semver**: Proper version comparison via the `semver` crate
(already a dependency).

## Output

When a newer version is available:
```
A new version of SpacetimeDB is available: v2.1.0 (current: v2.0.0)
Run `spacetime version upgrade` to update.
```

# Testing
- [x] I get a warning if my local version is less than 2.0.2
- [x] If I have a cached update check, I get the same error even if I
have no network connection
- [x] if the cache is old, the next command checks again
- [x] if I'm not connected and the cache is stale, I'm still able to use
the CLI

---------

Co-authored-by: clockwork-labs-bot <clockwork-labs-bot@users.noreply.github.com>
Co-authored-by: Zeke Foppa <bfops@users.noreply.github.com>
Co-authored-by: clockwork-labs-bot <bot@clockworklabs.com>
Co-authored-by: Zeke Foppa <196249+bfops@users.noreply.github.com>
2026-03-05 22:20:57 +00:00
Noa e3582131fe Migrate to Rust 2024 (#3802)
# Description of Changes

It'd be best to review this commit-by-commit, and using
[difftastic](https://difftastic.wilfred.me.uk) to easily tell when
changes are minor in terms of syntax but a line based diff doesn't show
that.

# Expected complexity level and risk

3 - edition2024 does bring changes to drop order, which could cause
issues with locks, but I looked through [all of the warnings that
weren't fixed
automatically](https://gistcdn.githack.com/coolreader18/80485ae5c5f82de1784229cce2febb26/raw/ba80f3fecda66ceb34f4f7ad73b98ea02d4893a2/warnings.html)
and couldn't find any issues.

# Testing

n/a; internal code change
2026-03-03 11:06:52 +00:00
Alessandro Asoni 12f931e52c Sort version output of spacetime version list (#4250)
# Description of Changes

The output of `spacetime version list` is sorted in alphabetical order,
which is not the correct semver order.
This fixes the order printed, by sorting correctly.

Example before:
```
1.11.0
1.9.0
1.3.0
1.3.1
1.1.2
1.12.0 (current)
1.0.0
```

After:
```
1.12.0 (current)
1.11.0
1.9.0
1.3.1
1.3.0
1.1.2
1.0.0
```

# API and ABI breaking changes

Not an API or ABI breaking change

# Expected complexity level and risk

1

# Testing

Ran `spacetime version list` and `spacetime version list --all` with the
new code and confirmed that the result was correctly sorted.
I additionally tested that if the latest available version was not
installed that it would show with the upgrade hint command.
2026-02-12 20:03:43 +00:00
John Detter 2ffe174388 Download from Digital Ocean if Github download fails (#4265)
# Description of Changes

<!-- Please describe your change, mention any related tickets, and so on
here. -->

Since Github has been going down *a lot* recently, we would like to add
support for downloading from our mirror instead. This PR updates:
- The install script for both windows and linux to try the mirror if
Github is down
- The `spacetime version install ...` to install a specific version
- The `spacetime upgrade` which grabs the latest version from Github.

# API and ABI breaking changes

<!-- If this is an API or ABI breaking change, please apply the
corresponding GitHub label. -->

None

# Expected complexity level and risk

3 - This is touching both the windows and linux/macos install scripts
which are quite sensitive. Proper manual testing is needed on this (see
Testing below)

<!--
How complicated do you think these changes are? Grade on a scale from 1
to 5,
where 1 is a trivial change, and 5 is a deep-reaching and complex
change.

This complexity rating applies not only to the complexity apparent in
the diff,
but also to its interactions with existing and future code.

If you answered more than a 2, explain what is complex about the PR,
and what other components it interacts with in potentially concerning
ways. -->

# 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! -->

For these tests I executed the respective install script locally. To
simulate github being down I set the github download to http instead of
https and then I spun up a local server which returns 500. I also added
a `127.0.0.1 github.com` entry to my hosts file (this works on both
Windows, linux and macOS).

Linux
- [x] Tested that the Github download works normally
- [x] Tested that if Github returns a 500 the digital ocean download
works normally

The download failed here and then it correctly retried with the mirror -
I wasn't able to capture the retry part because it's part of the
progress spinner so it just updates dynamically but this was the final
output:
```
boppy@geralt:~/clockwork/SpacetimeDB$ spacetime-install
The SpacetimeDB command line tool will now be installed:
        CLI configuration directory: /home/boppy/.config/spacetime/
        `spacetime` binary: /home/boppy/.local/bin/spacetime
        directory for installed SpacetimeDB versions: /home/boppy/.local/share/spacetime/bin
        database directory: /home/boppy/.local/share/spacetime/data
Would you like to continue? yes
Downloading latest version...
  Installing v1.12.0: done!                                                                                                                                                                                                                                 The `spacetime` command has been installed as /home/boppy/.local/bin/spacetime

The install process is complete; check out our quickstart guide to get started!
        <https://spacetimedb.com/docs/getting-started>
```

Windows
- [x] Tested that the Github download works normally
- [x] Tested that if Github returns a 500 the digital ocean download
works normally

This worked as well:
```
PS C:\Users\boppy\clockwork\SpacetimeDB\crates\update> .\spacetime-install.ps1
vcruntime140.dll is already installed at C:\WINDOWS\System32\vcruntime140.dll
Downloading installer...
Download failed, trying mirror...
We have added spacetimedb to your Path. You may have to logout and log back in to reload your environment.
```

macOS
- [x] Tested that the Github download works normally
- [x] Tested that if Github returns a 500 the digital ocean download
works normally

```
boppy@Johns-Laptop update % bash ./spacetime-install.sh
Downloading installer...
curl: (22) The requested URL returned error: 500
Download failed, trying mirror...
The SpacetimeDB command line tool will now be installed:
        CLI configuration directory: /Users/boppy/.config/spacetime/
        `spacetime` binary: /Users/boppy/.local/bin/spacetime
        directory for installed SpacetimeDB versions: /Users/boppy/.local/share/spacetime/bin
        database directory: /Users/boppy/.local/share/spacetime/data
Would you like to continue? yes
Downloading latest version...
  Installing v1.12.0: done!
The `spacetime` command has been installed as /Users/boppy/.local/bin/spacetime

The install process is complete; check out our quickstart guide to get started!
        <https://spacetimedb.com/docs/getting-started>
```
2026-02-12 03:48:05 +00:00
Zeke Foppa 79137b5016 Fix spacetime version list not showing current version (#2680)
Co-authored-by: Zeke Foppa <bfops@users.noreply.github.com>
2025-07-23 16:52:23 +00:00
Zeke Foppa 6ebb2abe34 spacetimedb-update self-install fails if the install fails. (#2642)
Co-authored-by: Zeke Foppa <bfops@users.noreply.github.com>
2025-04-21 18:47:25 +00:00
John Detter ae85f64bcb Fix error with the install script (#2635)
Co-authored-by: John Detter <no-reply@boppygames.gg>
2025-04-18 18:51:48 +00:00
John Detter 84ac8119e1 Fix quickstart link (#2346)
Co-authored-by: John Detter <no-reply@boppygames.gg>
2025-03-05 17:29:30 +00:00
Noa 51c833b95e Remove errant backslash that got into the 'please add to path' message (#2333) 2025-03-03 18:17:29 +00:00
Noa 43b4085e22 Print a message with a shell line to add bindir to PATH (#2327) 2025-02-28 20:33:23 +00:00
Noa 956b4f8e5b Add dockerfile for cli (#2312) 2025-02-27 20:24:43 +00:00
Tyler Cloutier e5cdda78ce Removed the EULA check in the CLI (#2315) 2025-02-27 18:44:35 +00:00
Noa b8ebe42484 Fix self-replace on windows (#2294) 2025-02-26 16:42:59 +00:00
Noa 30ba0f9d97 Use fixed term width for cli help test (#2293) 2025-02-21 20:18:26 +00:00
Noa 27a2afa2b8 Update install script (#2265)
Co-authored-by: John Detter <no-reply@boppygames.gg>
2025-02-21 06:10:31 +00:00
Noa e6775eb93a Finish spacetimedb-update functionality (#2126) 2025-02-06 20:32:46 +00:00