Skip to content

Commit 8ff4601

Browse files
authored
Merge branch 'master' into bfops/blackholio-ci
2 parents 039dbc5 + 4115658 commit 8ff4601

77 files changed

Lines changed: 17954 additions & 111 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Docs - Check Link Validity
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches:
7+
- master
8+
merge_group:
9+
10+
jobs:
11+
check-links:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Checkout repository
15+
uses: actions/checkout@v3
16+
17+
- name: Set up Node.js
18+
uses: actions/setup-node@v3
19+
with:
20+
node-version: '16' # or the version of Node.js you're using
21+
22+
- name: Install dependencies
23+
working-directory: docs
24+
run: |
25+
npm install
26+
27+
- name: Run link check
28+
working-directory: docs
29+
run: |
30+
npm run check-links
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Docs - Validate nav.ts Matches nav.js
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches:
7+
- master
8+
merge_group:
9+
10+
jobs:
11+
validate-build:
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- name: Checkout repository
16+
uses: actions/checkout@v3
17+
18+
- name: Set up Node.js
19+
uses: actions/setup-node@v3
20+
with:
21+
node-version: '16'
22+
23+
- name: Install dependencies
24+
working-directory: docs
25+
run: |
26+
npm install
27+
28+
- name: Backup existing nav.js
29+
working-directory: docs
30+
run: |
31+
mv docs/nav.js docs/nav.js.original
32+
33+
- name: Build nav.ts
34+
working-directory: docs
35+
run: |
36+
npm run build
37+
38+
- name: Compare generated nav.js with original nav.js
39+
working-directory: docs
40+
run: |
41+
diff -q docs/nav.js docs/nav.js.original || (echo "Generated nav.js differs from committed version. Run 'npm run build' and commit the updated file." && exit 1)
42+
43+
- name: Restore original nav.js
44+
working-directory: docs
45+
if: success() || failure()
46+
run: |
47+
mv docs/nav.js.original docs/nav.js

sdks/typescript/.github/workflows/lint.yml renamed to .github/workflows/lint.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
name: Lint
1+
name: TypeScript - Lint
22

33
on:
44
pull_request:
55
push:
66
branches:
7-
- main
7+
- master
88

99
jobs:
1010
build:
@@ -25,6 +25,7 @@ jobs:
2525
run_install: true
2626

2727
- name: Get pnpm store directory
28+
working-directory: sdks/typescript
2829
shell: bash
2930
run: |
3031
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
@@ -38,4 +39,5 @@ jobs:
3839
${{ runner.os }}-pnpm-store-
3940
4041
- name: Lint
42+
working-directory: sdks/typescript
4143
run: pnpm lint

.github/workflows/pr-only-ci.yml

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -31,18 +31,12 @@ jobs:
3131
with:
3232
ref: ${{ env.GIT_REF }}
3333
- uses: dsherret/rust-toolchain-file@v1
34-
- name: Checkout docs
35-
uses: actions/checkout@v4
36-
with:
37-
repository: clockworklabs/spacetime-docs
38-
ref: master
39-
path: spacetime-docs
4034
- name: Check for docs change
4135
run: |
42-
cargo run --features markdown-docs -p spacetimedb-cli > spacetime-docs/docs/cli-reference.md
43-
cd spacetime-docs
36+
cargo run --features markdown-docs -p spacetimedb-cli > docs/docs/cli-reference.md
37+
cd docs
4438
# This is needed because our website doesn't render markdown quite properly.
45-
# See the README in spacetime-docs for more details.
39+
# See the README in docs for more details.
4640
sed -i'' -E 's!^(##) `(.*)`$!\1 \2!' docs/cli-reference.md
4741
sed -i'' -E 's!^(######) \*\*(.*)\*\*$!\1 <b>\2</b>!' docs/cli-reference.md
4842
git status

sdks/typescript/.github/workflows/test.yml renamed to .github/workflows/test.yml

Lines changed: 13 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1-
name: Tests
1+
name: TypeScript - Tests
22

33
on:
44
push:
55
branches:
6-
- main
76
- master
87
pull_request:
98

@@ -27,6 +26,7 @@ jobs:
2726

2827
- name: Get pnpm store directory
2928
shell: bash
29+
working-directory: sdks/typescript
3030
run: |
3131
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
3232
@@ -39,10 +39,11 @@ jobs:
3939
${{ runner.os }}-pnpm-store-
4040
4141
- name: Compile
42+
working-directory: sdks/typescript
4243
run: pnpm compile
4344

4445
- name: Run sdk tests
45-
working-directory: packages/sdk
46+
working-directory: sdks/typescript/packages/sdk
4647
run: pnpm test
4748

4849
# - name: Extract SpacetimeDB branch name from file
@@ -70,42 +71,37 @@ jobs:
7071
# echo "branch=$branch" >> $GITHUB_OUTPUT
7172
# echo "Using SpacetimeDB branch from file: $branch"
7273

73-
- name: Checkout SpacetimeDB
74-
uses: actions/checkout@v4
75-
with:
76-
repository: clockworklabs/SpacetimeDB
77-
# ref: ${{ steps.extract-branch.outputs.branch }}
78-
path: SpacetimeDB
79-
8074
- name: Install Rust toolchain
8175
uses: dtolnay/rust-toolchain@stable
8276

8377
- name: Cache Rust dependencies
8478
uses: Swatinem/rust-cache@v2
8579
with:
86-
workspaces: SpacetimeDB/modules/quickstart-chat
80+
workspaces: modules/quickstart-chat
8781
shared-key: quickstart-chat-test
8882

8983
- name: Install SpacetimeDB CLI from the local checkout
9084
run: |
91-
cargo install --force --path SpacetimeDB/crates/cli --locked --message-format=short
92-
cargo install --force --path SpacetimeDB/crates/standalone --locked --message-format=short
85+
cargo install --force --path crates/cli --locked --message-format=short
86+
cargo install --force --path crates/standalone --locked --message-format=short
9387
# Add a handy alias using the old binary name, so that we don't have to rewrite all scripts (incl. in submodules).
9488
rm -f $HOME/.cargo/bin/spacetime
9589
ln -s $HOME/.cargo/bin/spacetimedb-cli $HOME/.cargo/bin/spacetime
9690
# Clear any existing information
9791
spacetime server clear -y
9892
env:
9993
# Share the target directory with our local project to avoid rebuilding same SpacetimeDB crates twice.
100-
CARGO_TARGET_DIR: SpacetimeDB/modules/quickstart-chat/target
94+
CARGO_TARGET_DIR: modules/quickstart-chat/target
10195

10296
- name: Generate client bindings
103-
working-directory: SpacetimeDB/modules/quickstart-chat
97+
working-directory: modules/quickstart-chat
10498
run: |
105-
spacetime generate --lang typescript --out-dir ../../../examples/quickstart-chat/src/module_bindings
99+
spacetime generate --lang typescript --out-dir ../../sdks/typescript/examples/quickstart-chat/src/module_bindings
100+
cd ../../sdks/typescript
106101
pnpm lint --write
107102
108103
- name: Check for changes
104+
working-directory: sdks/typescript
109105
run: |
110106
# This was copied from SpacetimeDB/tools/check-diff.sh.
111107
# It's required because `spacetime generate` creates lines with the SpacetimeDB commit
@@ -133,7 +129,7 @@ jobs:
133129
# spacetime logs quickstart-chat
134130

135131
- name: Check that quickstart-chat builds
136-
working-directory: examples/quickstart-chat
132+
working-directory: sdks/typescript/examples/quickstart-chat
137133
run: pnpm build
138134

139135
# - name: Run quickstart-chat tests

Cargo.lock

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

crates/client-api/Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,13 +51,15 @@ jsonwebtoken.workspace = true
5151
scopeguard.workspace = true
5252
serde_with.workspace = true
5353
async-stream.workspace = true
54+
humantime.workspace = true
5455

5556
[target.'cfg(not(target_env = "msvc"))'.dependencies]
5657
jemalloc_pprof.workspace = true
5758

5859
[dev-dependencies]
5960
jsonwebtoken.workspace = true
6061
pretty_assertions = { workspace = true, features = ["unstable"] }
62+
toml.workspace = true
6163

6264
[lints]
6365
workspace = true

crates/client-api/src/routes/database.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ use spacetimedb_lib::db::raw_def::v9::RawModuleDefV9;
3131
use spacetimedb_lib::identity::AuthCtx;
3232
use spacetimedb_lib::{sats, Timestamp};
3333

34-
use super::subscribe::handle_websocket;
34+
use super::subscribe::{handle_websocket, HasWebSocketOptions};
3535

3636
#[derive(Deserialize)]
3737
pub struct CallParams {
@@ -790,7 +790,7 @@ pub struct DatabaseRoutes<S> {
790790

791791
impl<S> Default for DatabaseRoutes<S>
792792
where
793-
S: NodeDelegate + ControlStateDelegate + Clone + 'static,
793+
S: NodeDelegate + ControlStateDelegate + HasWebSocketOptions + Clone + 'static,
794794
{
795795
fn default() -> Self {
796796
use axum::routing::{delete, get, post, put};

0 commit comments

Comments
 (0)