Skip to content

Commit cbba2b2

Browse files
authored
Fix up GitHub files related to TypeScript SDK (#2943)
Co-authored-by: Zeke Foppa <bfops@users.noreply.github.com>
1 parent 09717e9 commit cbba2b2

File tree

8 files changed

+24
-42
lines changed

8 files changed

+24
-42
lines changed

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

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

modules/quickstart-chat/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,5 @@ and described by [the SpacetimeDB C# SDK quickstart](https://spacetimedb.com/doc
2020
### TypeScript
2121

2222
A web client for this module, built with TypeScript and React, is defined
23-
in [the TypeScript SDK's examples](https://github.com/clockworklabs/spacetimedb-typescript-sdk/tree/main/examples/quickstart-chat),
23+
in [the TypeScript SDK's examples](https://github.com/clockworklabs/SpacetimeDB/tree/master/sdks/typescript/examples/quickstart-chat),
2424
and described by [the SpacetimeDB TypeScript SDK quickstart](https://spacetimedb.com/docs/sdks/typescript/quickstart).

sdks/typescript/.changeset/config.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"$schema": "https://unpkg.com/@changesets/config@3.0.2/schema.json",
33
"changelog": [
44
"@changesets/changelog-github",
5-
{ "repo": "clockworklabs/spacetimedb-typescript-sdk" }
5+
{ "repo": "clockworklabs/SpacetimeDB" }
66
],
77
"commit": false,
88
"fixed": [],

sdks/typescript/.github/pull_request_template.md

Lines changed: 0 additions & 19 deletions
This file was deleted.

sdks/typescript/.github/spacetimedb-version.txt

Lines changed: 0 additions & 1 deletion
This file was deleted.

sdks/typescript/DEVELOP.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# Migration note
2+
3+
We are in the process of moving from the `spacetimedb-typescript-sdk` repo to the `sdks/typescript` subdirectory of [SpacetimeDB](https://github.com/clockworklabs/SpacetimeDB). **Any new changes should be made there**. The `spacetimedb-typescript-sdk` repo will only be updated on release. Apologies in advance for any sharp edges while the migration is in progress.
4+
15
# Notes for maintainers
26

37
The directory `packages/sdk/src/client_api` is generated from [the SpacetimeDB client-api-messages](https://github.com/clockworklabs/SpacetimeDB/tree/master/crates/client-api-messages).

sdks/typescript/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
`@clockworklabs/spacetimedb-sdk` is a TypeScript SDK for SpacetimeDB.
22

3-
Source code can be found here on [GitHub](https://github.com/clockworklabs/spacetimedb-typescript-sdk/blob/main/packages/sdk).
3+
Source code can be found here on [GitHub](https://github.com/clockworklabs/SpacetimeDB/blob/master/sdks/typescript/packages/sdk).

0 commit comments

Comments
 (0)