diff --git a/sdks/typescript/.github/workflows/lint.yml b/.github/workflows/lint.yml similarity index 86% rename from sdks/typescript/.github/workflows/lint.yml rename to .github/workflows/lint.yml index 8adf4aa22aa..72c1f153f02 100644 --- a/sdks/typescript/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -1,10 +1,10 @@ -name: Lint +name: TypeScript - Lint on: pull_request: push: branches: - - main + - master jobs: build: @@ -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 @@ -38,4 +39,5 @@ jobs: ${{ runner.os }}-pnpm-store- - name: Lint + working-directory: sdks/typescript run: pnpm lint diff --git a/sdks/typescript/.github/workflows/test.yml b/.github/workflows/test.yml similarity index 83% rename from sdks/typescript/.github/workflows/test.yml rename to .github/workflows/test.yml index 4a55076fcb0..a73cda9a87e 100644 --- a/sdks/typescript/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,9 +1,8 @@ -name: Tests +name: TypeScript - Tests on: push: branches: - - main - master pull_request: @@ -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 @@ -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 @@ -70,26 +71,19 @@ 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 @@ -97,15 +91,17 @@ jobs: 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 @@ -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 diff --git a/modules/quickstart-chat/README.md b/modules/quickstart-chat/README.md index 805758f2e6e..33cefe667eb 100644 --- a/modules/quickstart-chat/README.md +++ b/modules/quickstart-chat/README.md @@ -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). diff --git a/sdks/typescript/.changeset/config.json b/sdks/typescript/.changeset/config.json index 362ba234a2e..1aa0b7611c3 100644 --- a/sdks/typescript/.changeset/config.json +++ b/sdks/typescript/.changeset/config.json @@ -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": [], diff --git a/sdks/typescript/.github/pull_request_template.md b/sdks/typescript/.github/pull_request_template.md deleted file mode 100644 index 4b7720bd2d4..00000000000 --- a/sdks/typescript/.github/pull_request_template.md +++ /dev/null @@ -1,19 +0,0 @@ -## Description of Changes - -_Describe what has been changed, any new features or bug fixes_ - -## API - -- [ ] This is an API breaking change to the SDK - -_If the API is breaking, please state below what will break_ - -## Requires SpacetimeDB PRs - -_List any PRs here that are required for this SDK change to work_ - -## Testing - -_Write instructions for a test that you performed for this PR_ - -- [ ] Describe a test for this PR that you have completed diff --git a/sdks/typescript/.github/spacetimedb-version.txt b/sdks/typescript/.github/spacetimedb-version.txt deleted file mode 100644 index 1f7391f92b6..00000000000 --- a/sdks/typescript/.github/spacetimedb-version.txt +++ /dev/null @@ -1 +0,0 @@ -master diff --git a/sdks/typescript/DEVELOP.md b/sdks/typescript/DEVELOP.md index f01377803f1..a533def1b55 100644 --- a/sdks/typescript/DEVELOP.md +++ b/sdks/typescript/DEVELOP.md @@ -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). diff --git a/sdks/typescript/README.md b/sdks/typescript/README.md index 23a253890e0..264f89a3612 100644 --- a/sdks/typescript/README.md +++ b/sdks/typescript/README.md @@ -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).