Skip to content
Merged
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
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
name: Lint
name: TypeScript - Lint

on:
pull_request:
push:
branches:
- main
- master

jobs:
build:
Expand All @@ -25,6 +25,7 @@ jobs:
run_install: true

- name: Get pnpm store directory
working-directory: sdks/typescript
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
Expand All @@ -38,4 +39,5 @@ jobs:
${{ runner.os }}-pnpm-store-

- name: Lint
working-directory: sdks/typescript
run: pnpm lint
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
name: Tests
name: TypeScript - Tests

on:
push:
branches:
- main
- master
pull_request:

Expand All @@ -27,6 +26,7 @@ jobs:

- name: Get pnpm store directory
shell: bash
working-directory: sdks/typescript
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV

Expand All @@ -39,10 +39,11 @@ jobs:
${{ runner.os }}-pnpm-store-

- name: Compile
working-directory: sdks/typescript
run: pnpm compile

- name: Run sdk tests
working-directory: packages/sdk
working-directory: sdks/typescript/packages/sdk
run: pnpm test

# - name: Extract SpacetimeDB branch name from file
Expand Down Expand Up @@ -70,42 +71,37 @@ jobs:
# echo "branch=$branch" >> $GITHUB_OUTPUT
# echo "Using SpacetimeDB branch from file: $branch"

- name: Checkout SpacetimeDB
uses: actions/checkout@v4
with:
repository: clockworklabs/SpacetimeDB
# ref: ${{ steps.extract-branch.outputs.branch }}
path: SpacetimeDB

- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable

- name: Cache Rust dependencies
uses: Swatinem/rust-cache@v2
with:
workspaces: SpacetimeDB/modules/quickstart-chat
workspaces: modules/quickstart-chat
shared-key: quickstart-chat-test

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

- name: Generate client bindings
working-directory: SpacetimeDB/modules/quickstart-chat
working-directory: modules/quickstart-chat
run: |
spacetime generate --lang typescript --out-dir ../../../examples/quickstart-chat/src/module_bindings
spacetime generate --lang typescript --out-dir ../../sdks/typescript/examples/quickstart-chat/src/module_bindings
cd ../../sdks/typescript
pnpm lint --write

- name: Check for changes
working-directory: sdks/typescript
run: |
# This was copied from SpacetimeDB/tools/check-diff.sh.
# It's required because `spacetime generate` creates lines with the SpacetimeDB commit
Expand Down Expand Up @@ -133,7 +129,7 @@ jobs:
# spacetime logs quickstart-chat

- name: Check that quickstart-chat builds
working-directory: examples/quickstart-chat
working-directory: sdks/typescript/examples/quickstart-chat
run: pnpm build

# - name: Run quickstart-chat tests
Expand Down
2 changes: 1 addition & 1 deletion modules/quickstart-chat/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@ and described by [the SpacetimeDB C# SDK quickstart](https://spacetimedb.com/doc
### TypeScript

A web client for this module, built with TypeScript and React, is defined
in [the TypeScript SDK's examples](https://github.com/clockworklabs/spacetimedb-typescript-sdk/tree/main/examples/quickstart-chat),
in [the TypeScript SDK's examples](https://github.com/clockworklabs/SpacetimeDB/tree/master/sdks/typescript/examples/quickstart-chat),
and described by [the SpacetimeDB TypeScript SDK quickstart](https://spacetimedb.com/docs/sdks/typescript/quickstart).
2 changes: 1 addition & 1 deletion sdks/typescript/.changeset/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"$schema": "https://unpkg.com/@changesets/config@3.0.2/schema.json",
"changelog": [
"@changesets/changelog-github",
{ "repo": "clockworklabs/spacetimedb-typescript-sdk" }
{ "repo": "clockworklabs/SpacetimeDB" }
],
"commit": false,
"fixed": [],
Expand Down
19 changes: 0 additions & 19 deletions sdks/typescript/.github/pull_request_template.md

This file was deleted.

1 change: 0 additions & 1 deletion sdks/typescript/.github/spacetimedb-version.txt

This file was deleted.

4 changes: 4 additions & 0 deletions sdks/typescript/DEVELOP.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Migration note

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.

# Notes for maintainers

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).
Expand Down
2 changes: 1 addition & 1 deletion sdks/typescript/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
`@clockworklabs/spacetimedb-sdk` is a TypeScript SDK for SpacetimeDB.

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