diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ac1de6b6a..c2c0b333d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -362,7 +362,6 @@ jobs: - name: Get pnpm store directory shell: bash - working-directory: sdks/typescript run: | echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV diff --git a/.github/workflows/typescript-test.yml b/.github/workflows/typescript-test.yml index 57dedcd51..49c183f80 100644 --- a/.github/workflows/typescript-test.yml +++ b/.github/workflows/typescript-test.yml @@ -26,7 +26,7 @@ jobs: - name: Get pnpm store directory shell: bash - working-directory: sdks/typescript + working-directory: crates/bindings-typescript run: | echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV @@ -38,22 +38,14 @@ jobs: restore-keys: | ${{ runner.os }}-pnpm-store- - - name: Build module library + - name: Build module library and SDK working-directory: crates/bindings-typescript run: pnpm build - - name: Run module library tests + - name: Run module library and SDK tests working-directory: crates/bindings-typescript run: pnpm test - - name: Build SDK - working-directory: sdks/typescript - run: pnpm build - - - name: Run SDK tests - working-directory: sdks/typescript - run: pnpm test - # - name: Extract SpacetimeDB branch name from file # id: extract-branch # run: | @@ -104,12 +96,12 @@ jobs: - name: Generate client bindings working-directory: modules/quickstart-chat run: | - spacetime generate --lang typescript --out-dir ../../sdks/typescript/examples/quickstart-chat/src/module_bindings - cd ../../sdks/typescript - pnpm lint --write + spacetime generate --lang typescript --out-dir ../../crates/bindings-typescript/examples/quickstart-chat/src/module_bindings + cd ../../crates/bindings-typescript + pnpm format - name: Check for changes - working-directory: sdks/typescript + working-directory: crates/bindings-typescript run: | # This was copied from SpacetimeDB/tools/check-diff.sh. # It's required because `spacetime generate` creates lines with the SpacetimeDB commit @@ -137,7 +129,7 @@ jobs: # spacetime logs quickstart-chat - name: Check that quickstart-chat builds - working-directory: sdks/typescript/examples/quickstart-chat + working-directory: crates/bindings-typescript/examples/quickstart-chat run: pnpm build # - name: Run quickstart-chat tests diff --git a/crates/bindings-typescript/.gitattributes b/crates/bindings-typescript/.gitattributes new file mode 100644 index 000000000..2167b5130 --- /dev/null +++ b/crates/bindings-typescript/.gitattributes @@ -0,0 +1,4 @@ +src/sdk/client_api/*.ts linguist-generated=true +src/lib/autogen/*.ts linguist-generated=true +test-app/src/module_bindings/*.ts linguist-generated=true +examples/quickstart/client/src/module_bindings/*.ts linguist-generated=true diff --git a/sdks/typescript/.gitignore b/crates/bindings-typescript/.gitignore similarity index 100% rename from sdks/typescript/.gitignore rename to crates/bindings-typescript/.gitignore diff --git a/sdks/typescript/.npmignore b/crates/bindings-typescript/.npmignore similarity index 100% rename from sdks/typescript/.npmignore rename to crates/bindings-typescript/.npmignore diff --git a/crates/bindings-typescript/DEVELOP.md b/crates/bindings-typescript/DEVELOP.md new file mode 100644 index 000000000..eea6a0bcc --- /dev/null +++ b/crates/bindings-typescript/DEVELOP.md @@ -0,0 +1,13 @@ +# Notes for maintainers + +The directory `src/sdk/client_api` is generated from [the SpacetimeDB client-api-messages](https://github.com/clockworklabs/SpacetimeDB/tree/master/crates/client-api-messages). + +The directory `src/lib/autogen` is generated from the SpacetimeDB `ModuleDef` definition using the `regen-typescript-moduledef` Rust program. + +In order to regenerate both of these bindings, run `pnpm generate`. + +Whenever the `client-api-messages` crate or the `ModuleDef` changes, you'll have to manually re-generate the definitions. + +## Releases and publishing + +In order to release and publish a new version of the package, update the version and run `npm publish`. diff --git a/crates/bindings-typescript/README.md b/crates/bindings-typescript/README.md new file mode 100644 index 000000000..f6e8a69d1 --- /dev/null +++ b/crates/bindings-typescript/README.md @@ -0,0 +1,118 @@ +## SpacetimeDB Module Library and SDK + +### Overview + +This repository contains both the SpacetimeDB module library and the TypeScript SDK for SpacetimeDB. The SDK allows you to interact with the database server from a client and applies type information from your SpacetimeDB server module. + +### Installation + +The SDK is an NPM package, thus you can use your package manager of choice like NPM or Yarn, for example: + +``` +npm add spacetimedb +``` + +You can use the package in the browser, using a bundler like vite/parcel/rsbuild, in server-side applications like NodeJS, Deno, Bun, NextJS, Remix, and in Cloudflare Workers. + +> NOTE: For usage in NodeJS 18-21, you need to install the `undici` package as a peer dependency: `npm add spacetimedb undici`. Node 22 and later are supported out of the box. + +### Usage + +In order to connect to a database you have to generate module bindings for your database. + +```ts +import { DbConnection } from './module_bindings'; + +const connection = DbConnection.builder() + .withUri('ws://localhost:3000') + .withModuleName('MODULE_NAME') + .onDisconnect(() => { + console.log('disconnected'); + }) + .onConnectError(() => { + console.log('client_error'); + }) + .onConnect((connection, identity, _token) => { + console.log( + 'Connected to SpacetimeDB with identity:', + identity.toHexString() + ); + + connection.subscriptionBuilder().subscribe('SELECT * FROM player'); + }) + .withToken('TOKEN') + .build(); +``` + +If you need to disconnect the client: + +```ts +connection.disconnect(); +``` + +Typically, you will use the SDK with types generated from SpacetimeDB module. For example, given a table named `Player` you can subscribe to player updates like this: + +```ts +connection.db.player.onInsert((ctx, player) => { + console.log(player); +}); +``` + +Given a reducer called `CreatePlayer` you can call it using a call method: + +```ts +connection.reducers.createPlayer(); +``` + +#### React Usage + +This module also include React hooks to subscribe to tables under the `spacetimedb/react` subpath. In order to use SpacetimeDB React hooks in your project, first add a `SpacetimeDBProvider` at the top of your component hierarchy: + +```tsx +const connectionBuilder = DbConnection.builder() + .withUri('ws://localhost:3000') + .withModuleName('MODULE_NAME') + .withLightMode(true) + .onDisconnect(() => { + console.log('disconnected'); + }) + .onConnectError(() => { + console.log('client_error'); + }) + .onConnect((conn, identity, _token) => { + console.log( + 'Connected to SpacetimeDB with identity:', + identity.toHexString() + ); + + conn.subscriptionBuilder().subscribe('SELECT * FROM player'); + }) + .withToken('TOKEN'); + +ReactDOM.createRoot(document.getElementById('root')!).render( + + + + + +); +``` + +One you add a `SpacetimeDBProvider` to your hierarchy, you can use SpacetimeDB React hooks in your render function: + +```tsx +function App() { + const conn = useSpacetimeDB(); + const { rows: messages } = useTable('message'); + + ... +} +``` + +### Developer notes + +To run the tests, do: + +```sh +pnpm build && pnpm test +``` diff --git a/sdks/typescript/examples/quickstart-chat/.gitignore b/crates/bindings-typescript/examples/quickstart-chat/.gitignore similarity index 100% rename from sdks/typescript/examples/quickstart-chat/.gitignore rename to crates/bindings-typescript/examples/quickstart-chat/.gitignore diff --git a/sdks/typescript/examples/quickstart-chat/CHANGELOG.md b/crates/bindings-typescript/examples/quickstart-chat/CHANGELOG.md similarity index 100% rename from sdks/typescript/examples/quickstart-chat/CHANGELOG.md rename to crates/bindings-typescript/examples/quickstart-chat/CHANGELOG.md diff --git a/sdks/typescript/examples/quickstart-chat/README.md b/crates/bindings-typescript/examples/quickstart-chat/README.md similarity index 100% rename from sdks/typescript/examples/quickstart-chat/README.md rename to crates/bindings-typescript/examples/quickstart-chat/README.md diff --git a/sdks/typescript/examples/quickstart-chat/index.html b/crates/bindings-typescript/examples/quickstart-chat/index.html similarity index 100% rename from sdks/typescript/examples/quickstart-chat/index.html rename to crates/bindings-typescript/examples/quickstart-chat/index.html diff --git a/sdks/typescript/examples/quickstart-chat/package.json b/crates/bindings-typescript/examples/quickstart-chat/package.json similarity index 95% rename from sdks/typescript/examples/quickstart-chat/package.json rename to crates/bindings-typescript/examples/quickstart-chat/package.json index b3a965a6e..3de530f99 100644 --- a/sdks/typescript/examples/quickstart-chat/package.json +++ b/crates/bindings-typescript/examples/quickstart-chat/package.json @@ -1,5 +1,5 @@ { - "name": "client", + "name": "@clockworklabs/quickstart-chat", "private": true, "version": "0.0.1", "type": "module", @@ -16,7 +16,7 @@ "spacetime:publish": "spacetime publish chat --project-path server --server testnet" }, "dependencies": { - "@clockworklabs/spacetimedb-sdk": "workspace:*", + "spacetimedb": "workspace:*", "react": "^18.3.1", "react-dom": "^18.3.1" }, diff --git a/sdks/typescript/examples/quickstart-chat/public/vite.svg b/crates/bindings-typescript/examples/quickstart-chat/public/vite.svg similarity index 100% rename from sdks/typescript/examples/quickstart-chat/public/vite.svg rename to crates/bindings-typescript/examples/quickstart-chat/public/vite.svg diff --git a/sdks/typescript/examples/quickstart-chat/src/.gitattributes b/crates/bindings-typescript/examples/quickstart-chat/src/.gitattributes similarity index 100% rename from sdks/typescript/examples/quickstart-chat/src/.gitattributes rename to crates/bindings-typescript/examples/quickstart-chat/src/.gitattributes diff --git a/sdks/typescript/examples/quickstart-chat/src/App.css b/crates/bindings-typescript/examples/quickstart-chat/src/App.css similarity index 100% rename from sdks/typescript/examples/quickstart-chat/src/App.css rename to crates/bindings-typescript/examples/quickstart-chat/src/App.css diff --git a/sdks/typescript/examples/quickstart-chat/src/App.integration.test.tsx b/crates/bindings-typescript/examples/quickstart-chat/src/App.integration.test.tsx similarity index 97% rename from sdks/typescript/examples/quickstart-chat/src/App.integration.test.tsx rename to crates/bindings-typescript/examples/quickstart-chat/src/App.integration.test.tsx index d4a83f1fe..f6584e119 100644 --- a/sdks/typescript/examples/quickstart-chat/src/App.integration.test.tsx +++ b/crates/bindings-typescript/examples/quickstart-chat/src/App.integration.test.tsx @@ -2,7 +2,7 @@ import { render, screen, waitFor } from '@testing-library/react'; import userEvent from '@testing-library/user-event'; import { describe, it, expect } from 'vitest'; import App from './App'; -import { SpacetimeDBProvider } from '@clockworklabs/spacetimedb-sdk/react'; +import { SpacetimeDBProvider } from 'spacetimedb/react'; import { DbConnection } from './module_bindings'; describe('App Integration Test', () => { diff --git a/sdks/typescript/examples/quickstart-chat/src/App.tsx b/crates/bindings-typescript/examples/quickstart-chat/src/App.tsx similarity index 97% rename from sdks/typescript/examples/quickstart-chat/src/App.tsx rename to crates/bindings-typescript/examples/quickstart-chat/src/App.tsx index 0a570fd2f..78ae2da57 100644 --- a/sdks/typescript/examples/quickstart-chat/src/App.tsx +++ b/crates/bindings-typescript/examples/quickstart-chat/src/App.tsx @@ -1,13 +1,8 @@ import React, { useState } from 'react'; import './App.css'; import { DbConnection, Message, User } from './module_bindings'; -import { - useSpacetimeDB, - useTable, - where, - eq, -} from '@clockworklabs/spacetimedb-sdk/react'; -import { Identity, Timestamp } from '@clockworklabs/spacetimedb-sdk'; +import { useSpacetimeDB, useTable, where, eq } from 'spacetimedb/react'; +import { Identity, Timestamp } from 'spacetimedb'; export type PrettyMessage = { senderName: string; diff --git a/sdks/typescript/examples/quickstart-chat/src/assets/react.svg b/crates/bindings-typescript/examples/quickstart-chat/src/assets/react.svg similarity index 100% rename from sdks/typescript/examples/quickstart-chat/src/assets/react.svg rename to crates/bindings-typescript/examples/quickstart-chat/src/assets/react.svg diff --git a/sdks/typescript/examples/quickstart-chat/src/index.css b/crates/bindings-typescript/examples/quickstart-chat/src/index.css similarity index 100% rename from sdks/typescript/examples/quickstart-chat/src/index.css rename to crates/bindings-typescript/examples/quickstart-chat/src/index.css diff --git a/sdks/typescript/examples/quickstart-chat/src/main.tsx b/crates/bindings-typescript/examples/quickstart-chat/src/main.tsx similarity index 89% rename from sdks/typescript/examples/quickstart-chat/src/main.tsx rename to crates/bindings-typescript/examples/quickstart-chat/src/main.tsx index cd20ca544..c19b3ce51 100644 --- a/sdks/typescript/examples/quickstart-chat/src/main.tsx +++ b/crates/bindings-typescript/examples/quickstart-chat/src/main.tsx @@ -2,8 +2,8 @@ import { StrictMode } from 'react'; import { createRoot } from 'react-dom/client'; import './index.css'; import App from './App.tsx'; -import { Identity } from '@clockworklabs/spacetimedb-sdk'; -import { SpacetimeDBProvider } from '@clockworklabs/spacetimedb-sdk/react'; +import { Identity } from 'spacetimedb'; +import { SpacetimeDBProvider } from 'spacetimedb/react'; import { DbConnection, ErrorContext } from './module_bindings/index.ts'; const onConnect = (conn: DbConnection, identity: Identity, token: string) => { diff --git a/sdks/typescript/examples/quickstart-chat/src/module_bindings/identity_connected_reducer.ts b/crates/bindings-typescript/examples/quickstart-chat/src/module_bindings/identity_connected_reducer.ts similarity index 97% rename from sdks/typescript/examples/quickstart-chat/src/module_bindings/identity_connected_reducer.ts rename to crates/bindings-typescript/examples/quickstart-chat/src/module_bindings/identity_connected_reducer.ts index 85c6400df..d2842500d 100644 --- a/sdks/typescript/examples/quickstart-chat/src/module_bindings/identity_connected_reducer.ts +++ b/crates/bindings-typescript/examples/quickstart-chat/src/module_bindings/identity_connected_reducer.ts @@ -25,7 +25,7 @@ import { type EventContextInterface as __EventContextInterface, type ReducerEventContextInterface as __ReducerEventContextInterface, type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, -} from '@clockworklabs/spacetimedb-sdk'; +} from 'spacetimedb'; export type IdentityConnected = {}; /** diff --git a/sdks/typescript/examples/quickstart-chat/src/module_bindings/identity_disconnected_reducer.ts b/crates/bindings-typescript/examples/quickstart-chat/src/module_bindings/identity_disconnected_reducer.ts similarity index 97% rename from sdks/typescript/examples/quickstart-chat/src/module_bindings/identity_disconnected_reducer.ts rename to crates/bindings-typescript/examples/quickstart-chat/src/module_bindings/identity_disconnected_reducer.ts index 701fb1f93..c15422dcf 100644 --- a/sdks/typescript/examples/quickstart-chat/src/module_bindings/identity_disconnected_reducer.ts +++ b/crates/bindings-typescript/examples/quickstart-chat/src/module_bindings/identity_disconnected_reducer.ts @@ -25,7 +25,7 @@ import { type EventContextInterface as __EventContextInterface, type ReducerEventContextInterface as __ReducerEventContextInterface, type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, -} from '@clockworklabs/spacetimedb-sdk'; +} from 'spacetimedb'; export type IdentityDisconnected = {}; /** diff --git a/sdks/typescript/examples/quickstart-chat/src/module_bindings/index.ts b/crates/bindings-typescript/examples/quickstart-chat/src/module_bindings/index.ts similarity index 99% rename from sdks/typescript/examples/quickstart-chat/src/module_bindings/index.ts rename to crates/bindings-typescript/examples/quickstart-chat/src/module_bindings/index.ts index 286339255..f71613908 100644 --- a/sdks/typescript/examples/quickstart-chat/src/module_bindings/index.ts +++ b/crates/bindings-typescript/examples/quickstart-chat/src/module_bindings/index.ts @@ -27,7 +27,7 @@ import { type EventContextInterface as __EventContextInterface, type ReducerEventContextInterface as __ReducerEventContextInterface, type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, -} from '@clockworklabs/spacetimedb-sdk'; +} from 'spacetimedb'; // Import and reexport all reducer arg types import { IdentityConnected } from './identity_connected_reducer.ts'; diff --git a/sdks/typescript/examples/quickstart-chat/src/module_bindings/message_table.ts b/crates/bindings-typescript/examples/quickstart-chat/src/module_bindings/message_table.ts similarity index 98% rename from sdks/typescript/examples/quickstart-chat/src/module_bindings/message_table.ts rename to crates/bindings-typescript/examples/quickstart-chat/src/module_bindings/message_table.ts index 337aa691f..6ad59b263 100644 --- a/sdks/typescript/examples/quickstart-chat/src/module_bindings/message_table.ts +++ b/crates/bindings-typescript/examples/quickstart-chat/src/module_bindings/message_table.ts @@ -25,7 +25,7 @@ import { type EventContextInterface as __EventContextInterface, type ReducerEventContextInterface as __ReducerEventContextInterface, type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, -} from '@clockworklabs/spacetimedb-sdk'; +} from 'spacetimedb'; import { Message } from './message_type'; import { type EventContext, diff --git a/sdks/typescript/examples/quickstart-chat/src/module_bindings/message_type.ts b/crates/bindings-typescript/examples/quickstart-chat/src/module_bindings/message_type.ts similarity index 98% rename from sdks/typescript/examples/quickstart-chat/src/module_bindings/message_type.ts rename to crates/bindings-typescript/examples/quickstart-chat/src/module_bindings/message_type.ts index da203406e..73bd5c672 100644 --- a/sdks/typescript/examples/quickstart-chat/src/module_bindings/message_type.ts +++ b/crates/bindings-typescript/examples/quickstart-chat/src/module_bindings/message_type.ts @@ -25,7 +25,7 @@ import { type EventContextInterface as __EventContextInterface, type ReducerEventContextInterface as __ReducerEventContextInterface, type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, -} from '@clockworklabs/spacetimedb-sdk'; +} from 'spacetimedb'; export type Message = { sender: __Identity; diff --git a/sdks/typescript/examples/quickstart-chat/src/module_bindings/send_message_reducer.ts b/crates/bindings-typescript/examples/quickstart-chat/src/module_bindings/send_message_reducer.ts similarity index 97% rename from sdks/typescript/examples/quickstart-chat/src/module_bindings/send_message_reducer.ts rename to crates/bindings-typescript/examples/quickstart-chat/src/module_bindings/send_message_reducer.ts index cda151bcd..7f2f7de31 100644 --- a/sdks/typescript/examples/quickstart-chat/src/module_bindings/send_message_reducer.ts +++ b/crates/bindings-typescript/examples/quickstart-chat/src/module_bindings/send_message_reducer.ts @@ -25,7 +25,7 @@ import { type EventContextInterface as __EventContextInterface, type ReducerEventContextInterface as __ReducerEventContextInterface, type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, -} from '@clockworklabs/spacetimedb-sdk'; +} from 'spacetimedb'; export type SendMessage = { text: string; diff --git a/sdks/typescript/examples/quickstart-chat/src/module_bindings/set_name_reducer.ts b/crates/bindings-typescript/examples/quickstart-chat/src/module_bindings/set_name_reducer.ts similarity index 97% rename from sdks/typescript/examples/quickstart-chat/src/module_bindings/set_name_reducer.ts rename to crates/bindings-typescript/examples/quickstart-chat/src/module_bindings/set_name_reducer.ts index f424cec06..e8d645119 100644 --- a/sdks/typescript/examples/quickstart-chat/src/module_bindings/set_name_reducer.ts +++ b/crates/bindings-typescript/examples/quickstart-chat/src/module_bindings/set_name_reducer.ts @@ -25,7 +25,7 @@ import { type EventContextInterface as __EventContextInterface, type ReducerEventContextInterface as __ReducerEventContextInterface, type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, -} from '@clockworklabs/spacetimedb-sdk'; +} from 'spacetimedb'; export type SetName = { name: string; diff --git a/sdks/typescript/examples/quickstart-chat/src/module_bindings/user_table.ts b/crates/bindings-typescript/examples/quickstart-chat/src/module_bindings/user_table.ts similarity index 98% rename from sdks/typescript/examples/quickstart-chat/src/module_bindings/user_table.ts rename to crates/bindings-typescript/examples/quickstart-chat/src/module_bindings/user_table.ts index efc16e926..e3d74b8f5 100644 --- a/sdks/typescript/examples/quickstart-chat/src/module_bindings/user_table.ts +++ b/crates/bindings-typescript/examples/quickstart-chat/src/module_bindings/user_table.ts @@ -25,7 +25,7 @@ import { type EventContextInterface as __EventContextInterface, type ReducerEventContextInterface as __ReducerEventContextInterface, type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, -} from '@clockworklabs/spacetimedb-sdk'; +} from 'spacetimedb'; import { User } from './user_type'; import { type EventContext, diff --git a/sdks/typescript/examples/quickstart-chat/src/module_bindings/user_type.ts b/crates/bindings-typescript/examples/quickstart-chat/src/module_bindings/user_type.ts similarity index 98% rename from sdks/typescript/examples/quickstart-chat/src/module_bindings/user_type.ts rename to crates/bindings-typescript/examples/quickstart-chat/src/module_bindings/user_type.ts index 2f30963f7..8f0f8a19b 100644 --- a/sdks/typescript/examples/quickstart-chat/src/module_bindings/user_type.ts +++ b/crates/bindings-typescript/examples/quickstart-chat/src/module_bindings/user_type.ts @@ -25,7 +25,7 @@ import { type EventContextInterface as __EventContextInterface, type ReducerEventContextInterface as __ReducerEventContextInterface, type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, -} from '@clockworklabs/spacetimedb-sdk'; +} from 'spacetimedb'; export type User = { identity: __Identity; diff --git a/sdks/typescript/examples/quickstart-chat/src/setupTests.ts b/crates/bindings-typescript/examples/quickstart-chat/src/setupTests.ts similarity index 100% rename from sdks/typescript/examples/quickstart-chat/src/setupTests.ts rename to crates/bindings-typescript/examples/quickstart-chat/src/setupTests.ts diff --git a/crates/bindings-typescript/test-app/src/vite-env.d.ts b/crates/bindings-typescript/examples/quickstart-chat/src/vite-env.d.ts similarity index 100% rename from crates/bindings-typescript/test-app/src/vite-env.d.ts rename to crates/bindings-typescript/examples/quickstart-chat/src/vite-env.d.ts diff --git a/sdks/typescript/examples/quickstart-chat/tsconfig.app.json b/crates/bindings-typescript/examples/quickstart-chat/tsconfig.app.json similarity index 100% rename from sdks/typescript/examples/quickstart-chat/tsconfig.app.json rename to crates/bindings-typescript/examples/quickstart-chat/tsconfig.app.json diff --git a/sdks/typescript/examples/quickstart-chat/tsconfig.json b/crates/bindings-typescript/examples/quickstart-chat/tsconfig.json similarity index 100% rename from sdks/typescript/examples/quickstart-chat/tsconfig.json rename to crates/bindings-typescript/examples/quickstart-chat/tsconfig.json diff --git a/sdks/typescript/examples/quickstart-chat/tsconfig.node.json b/crates/bindings-typescript/examples/quickstart-chat/tsconfig.node.json similarity index 100% rename from sdks/typescript/examples/quickstart-chat/tsconfig.node.json rename to crates/bindings-typescript/examples/quickstart-chat/tsconfig.node.json diff --git a/sdks/typescript/examples/quickstart-chat/vite.config.ts b/crates/bindings-typescript/examples/quickstart-chat/vite.config.ts similarity index 100% rename from sdks/typescript/examples/quickstart-chat/vite.config.ts rename to crates/bindings-typescript/examples/quickstart-chat/vite.config.ts diff --git a/sdks/typescript/examples/quickstart-chat/vitest.config.ts b/crates/bindings-typescript/examples/quickstart-chat/vitest.config.ts similarity index 100% rename from sdks/typescript/examples/quickstart-chat/vitest.config.ts rename to crates/bindings-typescript/examples/quickstart-chat/vitest.config.ts diff --git a/crates/bindings-typescript/package.json b/crates/bindings-typescript/package.json index 704581a63..2a3ac1d8b 100644 --- a/crates/bindings-typescript/package.json +++ b/crates/bindings-typescript/package.json @@ -1,6 +1,6 @@ { "name": "spacetimedb", - "version": "0.0.1", + "version": "1.4.0", "description": "API and ABI bindings for the SpacetimeDB TypeScript module library", "homepage": "https://github.com/clockworklabs/SpacetimeDB#readme", "bugs": { @@ -21,7 +21,9 @@ "type": "module", "sideEffects": false, "scripts": { - "build": "tsup", + "build:js": "tsup", + "build:types": "tsc -p tsconfig.build.json", + "build": "pnpm -s build:js && pnpm -s build:types", "format": "prettier . --write --ignore-path ../../.prettierignore", "lint": "eslint . && prettier . --check --ignore-path ../../.prettierignore", "test": "vitest run", @@ -29,39 +31,41 @@ "brotli-size": "brotli-size dist/index.js", "size": "pnpm -s build && size-limit", "generate:moduledef": "cargo run -p spacetimedb-codegen --example regen-typescript-moduledef && prettier --write src/lib/autogen", - "generate:client-api": "cargo build -p spacetimedb-standalone && cargo run -p spacetimedb-client-api-messages --example get_ws_schema > ws_schema.json && cargo run -p spacetimedb-cli generate --lang typescript --out-dir src/sdk/client_api --module-def ws_schema.json && rm ws_schema.json && find src/sdk/client_api -type f -exec perl -pi -e 's#\\@clockworklabs/spacetimedb-sdk#../../index#g' {} + && prettier --write src/sdk/client_api", + "generate:client-api": "cargo build -p spacetimedb-standalone && cargo run -p spacetimedb-client-api-messages --example get_ws_schema > ws_schema.json && cargo run -p spacetimedb-cli generate --lang typescript --out-dir src/sdk/client_api --module-def ws_schema.json && rm ws_schema.json && find src/sdk/client_api -type f -exec perl -pi -e 's#spacetimedb#../../index#g' {} + && prettier --write src/sdk/client_api", "generate:test-app": "pnpm --filter @clockworklabs/test-app generate", - "generate": "pnpm generate:moduledef && pnpm generate:client-api && pnpm generate:test-app" + "generate": "pnpm generate:moduledef && pnpm generate:client-api && pnpm generate:test-app", + "prepublishOnly": "pnpm run build && pnpm run test && pnpm run size" }, - "source": "src/index.ts", "main": "dist/index.cjs", "module": "dist/index.mjs", - "types": "src/index.ts", + "types": "dist/index.d.ts", "exports": { ".": { - "types": "./src/index.ts", - "source": "./src/index.ts", "development": "./src/index.ts", + "types": "./dist/index.d.ts", "browser": "./dist/index.browser.mjs", "import": "./dist/index.mjs", "require": "./dist/index.cjs", "default": "./dist/index.mjs" }, "./sdk": { - "types": "./src/sdk/index.ts", + "development": "./src/index.ts", + "types": "./dist/index.d.ts", "browser": "./dist/sdk/index.browser.mjs", "import": "./dist/sdk/index.mjs", "require": "./dist/sdk/index.cjs", "default": "./dist/sdk/index.mjs" }, "./react": { - "types": "./src/react/index.ts", + "development": "./src/react/index.ts", + "types": "./dist/react/index.d.ts", "import": "./dist/react/index.mjs", "require": "./dist/react/index.cjs", "default": "./dist/react/index.mjs" }, "./server": { - "types": "./src/server/index.ts", + "development": "./src/server/index.ts", + "types": "./dist/server/index.d.ts", "import": "./dist/server/index.mjs", "require": "./dist/server/index.cjs", "default": "./dist/server/index.mjs" diff --git a/crates/bindings-typescript/src/react/SpacetimeDBProvider.ts b/crates/bindings-typescript/src/react/SpacetimeDBProvider.ts index 2790f4745..0af29acf0 100644 --- a/crates/bindings-typescript/src/react/SpacetimeDBProvider.ts +++ b/crates/bindings-typescript/src/react/SpacetimeDBProvider.ts @@ -1,4 +1,7 @@ -import { DbConnectionBuilder, type DbConnectionImpl } from '../index'; +import { + DbConnectionBuilder, + type DbConnectionImpl, +} from '../sdk/db_connection_impl'; import * as React from 'react'; import { SpacetimeDBContext } from './useSpacetimeDB'; diff --git a/crates/bindings-typescript/src/react/useSpacetimeDB.ts b/crates/bindings-typescript/src/react/useSpacetimeDB.ts index cbaacafa2..505c81437 100644 --- a/crates/bindings-typescript/src/react/useSpacetimeDB.ts +++ b/crates/bindings-typescript/src/react/useSpacetimeDB.ts @@ -1,5 +1,5 @@ import { createContext, useContext, type Context } from 'react'; -import type { DbConnectionImpl } from '../index'; +import type { DbConnectionImpl } from '../sdk/db_connection_impl'; export const SpacetimeDBContext: Context = createContext(undefined); diff --git a/crates/bindings-typescript/src/react/useTable.ts b/crates/bindings-typescript/src/react/useTable.ts index af8c0d41c..d5aa0fe4d 100644 --- a/crates/bindings-typescript/src/react/useTable.ts +++ b/crates/bindings-typescript/src/react/useTable.ts @@ -6,7 +6,7 @@ import { useSyncExternalStore, } from 'react'; import { useSpacetimeDB } from './useSpacetimeDB'; -import { DbConnectionImpl, TableCache } from '../sdk'; +import { DbConnectionImpl, TableCache } from '../sdk/db_connection_impl'; export interface UseQueryCallbacks { onInsert?: (row: RowType) => void; diff --git a/crates/bindings-typescript/src/sdk/client_api/index.ts b/crates/bindings-typescript/src/sdk/client_api/index.ts index cb5d573f5..302674a33 100644 --- a/crates/bindings-typescript/src/sdk/client_api/index.ts +++ b/crates/bindings-typescript/src/sdk/client_api/index.ts @@ -1,7 +1,7 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.4.0 (commit 9e4684ee0f7b78689c60efbdcb7a9e23e34eea15). +// This was generated using ../../index cli version 1.4.0 (commit 9e4684ee0f7b78689c60efbdcb7a9e23e34eea15). /* eslint-disable */ /* tslint:disable */ diff --git a/crates/bindings-typescript/src/sdk/db_connection_builder.ts b/crates/bindings-typescript/src/sdk/db_connection_builder.ts index 331eb3704..35f7bd828 100644 --- a/crates/bindings-typescript/src/sdk/db_connection_builder.ts +++ b/crates/bindings-typescript/src/sdk/db_connection_builder.ts @@ -1,6 +1,6 @@ import { DbConnectionImpl, type ConnectionEvent } from './db_connection_impl'; import { EventEmitter } from './event_emitter'; -import type { Identity } from 'spacetimedb'; +import type { Identity } from '../'; import type RemoteModule from './spacetime_module'; import { ensureMinimumVersionOrThrow } from './version'; import { WebsocketDecompressAdapter } from './websocket_decompress_adapter'; diff --git a/crates/bindings-typescript/src/sdk/db_connection_impl.ts b/crates/bindings-typescript/src/sdk/db_connection_impl.ts index e9226108f..6181c84ca 100644 --- a/crates/bindings-typescript/src/sdk/db_connection_impl.ts +++ b/crates/bindings-typescript/src/sdk/db_connection_impl.ts @@ -1,12 +1,12 @@ -import { ConnectionId } from 'spacetimedb'; +import { ConnectionId } from '../'; import { AlgebraicType, type AlgebraicTypeVariants, type ComparablePrimitive, -} from 'spacetimedb'; -import { parseValue } from 'spacetimedb'; -import { BinaryReader } from 'spacetimedb'; -import { BinaryWriter } from 'spacetimedb'; +} from '../'; +import { parseValue } from '../'; +import { BinaryReader } from '../'; +import { BinaryWriter } from '../'; import { BsatnRowList } from './client_api/bsatn_row_list_type.ts'; import { ClientMessage } from './client_api/client_message_type.ts'; import { DatabaseUpdate } from './client_api/database_update_type.ts'; @@ -25,7 +25,7 @@ import { } from './event_context.ts'; import { EventEmitter } from './event_emitter.ts'; import { decompress } from './decompress.ts'; -import type { Identity } from 'spacetimedb'; +import type { Identity } from '../'; import type { IdentityTokenMessage, Message, diff --git a/crates/bindings-typescript/src/sdk/message_types.ts b/crates/bindings-typescript/src/sdk/message_types.ts index f85121b0b..ee7842019 100644 --- a/crates/bindings-typescript/src/sdk/message_types.ts +++ b/crates/bindings-typescript/src/sdk/message_types.ts @@ -1,8 +1,8 @@ -import { ConnectionId } from 'spacetimedb'; +import { ConnectionId } from '../'; import type { UpdateStatus } from './client_api/index.ts'; -import { Identity } from 'spacetimedb'; +import { Identity } from '../'; import type { TableUpdate } from './table_cache.ts'; -import { Timestamp } from 'spacetimedb'; +import { Timestamp } from '../'; export type InitialSubscriptionMessage> = { tag: 'InitialSubscription'; diff --git a/crates/bindings-typescript/src/sdk/reducer_event.ts b/crates/bindings-typescript/src/sdk/reducer_event.ts index f91717d31..aaebd27fa 100644 --- a/crates/bindings-typescript/src/sdk/reducer_event.ts +++ b/crates/bindings-typescript/src/sdk/reducer_event.ts @@ -1,7 +1,7 @@ -import { ConnectionId } from 'spacetimedb'; -import { Timestamp } from 'spacetimedb'; +import { ConnectionId } from '../'; +import { Timestamp } from '../'; import type { UpdateStatus } from './client_api/index.ts'; -import { Identity } from 'spacetimedb'; +import { Identity } from '../'; export type ReducerInfoType = { name: string; args?: any } | never; diff --git a/crates/bindings-typescript/src/sdk/spacetime_module.ts b/crates/bindings-typescript/src/sdk/spacetime_module.ts index b7e4d8107..4a76006f9 100644 --- a/crates/bindings-typescript/src/sdk/spacetime_module.ts +++ b/crates/bindings-typescript/src/sdk/spacetime_module.ts @@ -1,4 +1,4 @@ -import type { AlgebraicType } from 'spacetimedb'; +import type { AlgebraicType } from '../'; import type { DbConnectionImpl } from './db_connection_impl'; export interface TableRuntimeTypeInfo { diff --git a/crates/bindings-typescript/src/sdk/table_cache.ts b/crates/bindings-typescript/src/sdk/table_cache.ts index 57b4d86d3..dc9fce024 100644 --- a/crates/bindings-typescript/src/sdk/table_cache.ts +++ b/crates/bindings-typescript/src/sdk/table_cache.ts @@ -2,7 +2,7 @@ import { EventEmitter } from './event_emitter.ts'; import type { TableRuntimeTypeInfo } from './spacetime_module.ts'; import { stdbLogger } from './logger.ts'; -import type { ComparablePrimitive } from 'spacetimedb'; +import type { ComparablePrimitive } from '../'; import type { EventContextInterface } from './index.ts'; export type Operation< diff --git a/crates/bindings-typescript/src/sdk/websocket_decompress_adapter.ts b/crates/bindings-typescript/src/sdk/websocket_decompress_adapter.ts index bd2e84981..153e55d3b 100644 --- a/crates/bindings-typescript/src/sdk/websocket_decompress_adapter.ts +++ b/crates/bindings-typescript/src/sdk/websocket_decompress_adapter.ts @@ -1,13 +1,5 @@ import { decompress } from './decompress'; - -// Add type declarations for ImportMeta.env -interface ImportMetaEnv { - readonly BROWSER?: string; -} - -interface ImportMeta { - readonly env: ImportMetaEnv; -} +import { resolveWS } from './ws'; export class WebsocketDecompressAdapter { onclose?: (...ev: any[]) => void; @@ -91,27 +83,7 @@ export class WebsocketDecompressAdapter { }): Promise { const headers = new Headers(); - let WS: typeof WebSocket; - - if ((import.meta as unknown as ImportMeta).env?.BROWSER === 'false') { - if ('WebSocket' in globalThis) { - WS = WebSocket; - } else { - try { - const { WebSocket: UndiciWS } = await import('undici'); - WS = UndiciWS as unknown as typeof WebSocket; - } catch (err) { - console.warn( - '[spacetimedb-sdk] No global WebSocket found. ' + - 'On Node 18–21, please install `undici` (npm install undici) ' + - 'to enable WebSocket support.' - ); - throw err; - } - } - } else { - WS = WebSocket; - } + const WS = await resolveWS(); // We swap our original token to a shorter-lived token // to avoid sending the original via query params. diff --git a/crates/bindings-typescript/src/sdk/websocket_test_adapter.ts b/crates/bindings-typescript/src/sdk/websocket_test_adapter.ts index ecff4ed91..fc5a7255d 100644 --- a/crates/bindings-typescript/src/sdk/websocket_test_adapter.ts +++ b/crates/bindings-typescript/src/sdk/websocket_test_adapter.ts @@ -1,4 +1,4 @@ -import { AlgebraicType, BinaryWriter } from 'spacetimedb'; +import { AlgebraicType, BinaryWriter } from '../'; import { ServerMessage } from './client_api/index.ts'; class WebsocketTestAdapter { diff --git a/crates/bindings-typescript/src/sdk/ws.ts b/crates/bindings-typescript/src/sdk/ws.ts new file mode 100644 index 000000000..0ed018478 --- /dev/null +++ b/crates/bindings-typescript/src/sdk/ws.ts @@ -0,0 +1,24 @@ +export async function resolveWS(): Promise { + // Browser or Node >= 22 (or any env that exposes global WebSocket) + if (typeof (globalThis as any).WebSocket !== 'undefined') { + return (globalThis as any).WebSocket as typeof WebSocket; + } + + // Node without a global WebSocket: lazily load undici's polyfill. + // Use an unstatable dynamic import so bundlers don't prebundle it. + const dynamicImport = new Function('m', 'return import(m)') as ( + m: string + ) => Promise; + + try { + const { WebSocket: UndiciWS } = await dynamicImport('undici'); + return UndiciWS as unknown as typeof WebSocket; + } catch (err) { + console.warn( + '[spacetimedb-sdk] No global WebSocket found. ' + + 'On Node 18–21, please install `undici` (npm install undici) ' + + 'to enable WebSocket support.' + ); + throw err; + } +} diff --git a/crates/bindings-typescript/test-app/package.json b/crates/bindings-typescript/test-app/package.json index 553e14124..0961c1b5c 100644 --- a/crates/bindings-typescript/test-app/package.json +++ b/crates/bindings-typescript/test-app/package.json @@ -12,7 +12,7 @@ "format": "prettier . --write --ignore-path ../../../.prettierignore", "lint": "eslint . && prettier . --check --ignore-path ../../../.prettierignore", "preview": "vite preview", - "generate": "cargo build -p spacetimedb-standalone && cargo run -p spacetimedb-cli generate --lang typescript --out-dir src/module_bindings --project-path server && prettier --write src/module_bindings && find src/module_bindings -type f -exec perl -pi -e 's#\\@clockworklabs/spacetimedb-sdk#../../../src/index#g' {} + && prettier --write src/module_bindings", + "generate": "cargo build -p spacetimedb-standalone && cargo run -p spacetimedb-cli generate --lang typescript --out-dir src/module_bindings --project-path server && prettier --write src/module_bindings && find src/module_bindings -type f -exec perl -pi -e 's#spacetimedb#../../../src/index#g' {} + && prettier --write src/module_bindings", "spacetime:generate": "spacetime generate --lang typescript --out-dir src/module_bindings --project-path server", "spacetime:start": "spacetime start server", "spacetime:publish:local": "spacetime publish game --project-path server --server local", diff --git a/crates/bindings-typescript/test-app/src/module_bindings/index.ts b/crates/bindings-typescript/test-app/src/module_bindings/index.ts index bbaca7834..440a90048 100644 --- a/crates/bindings-typescript/test-app/src/module_bindings/index.ts +++ b/crates/bindings-typescript/test-app/src/module_bindings/index.ts @@ -1,7 +1,7 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.4.0 (commit 9e4684ee0f7b78689c60efbdcb7a9e23e34eea15). +// This was generated using ../../../src/index cli version 1.4.0 (commit 9e4684ee0f7b78689c60efbdcb7a9e23e34eea15). /* eslint-disable */ /* tslint:disable */ diff --git a/crates/bindings-typescript/tests/index.test.ts b/crates/bindings-typescript/tests/index.test.ts index a76da1fac..e244b60e4 100644 --- a/crates/bindings-typescript/tests/index.test.ts +++ b/crates/bindings-typescript/tests/index.test.ts @@ -1,5 +1,11 @@ import { describe, it, expect } from 'vitest'; -import { AlgebraicType, t } from '../src/index'; +import { + AlgebraicType, + ConnectionId, + Identity, + t, + type IdentityTokenMessage, +} from '../src/index'; describe('TypeBuilder', () => { it('builds the correct algebraic type for a point', () => { @@ -131,3 +137,18 @@ describe('TypeBuilder', () => { expect(col.columnMetadata.isScheduleAt).toBe(true); }); }); + +describe('Identity', () => { + it('imports something from the spacetimedb sdk', () => { + const _msg: IdentityTokenMessage = { + tag: 'IdentityToken', + identity: Identity.fromString( + '0xc200000000000000000000000000000000000000000000000000000000000000' + ), + token: 'some-token', + connectionId: ConnectionId.fromString( + '0x00000000000000000000000000000000' + ), + }; + }); +}); diff --git a/crates/bindings-typescript/tsconfig.build.json b/crates/bindings-typescript/tsconfig.build.json new file mode 100644 index 000000000..dfdffa318 --- /dev/null +++ b/crates/bindings-typescript/tsconfig.build.json @@ -0,0 +1,12 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "noEmit": false, + "declaration": true, + "emitDeclarationOnly": true, + "declarationMap": true, + "outDir": "dist", + "rootDir": "src" + }, + "include": ["src/**/*"] +} diff --git a/crates/bindings-typescript/tsup.config.ts b/crates/bindings-typescript/tsup.config.ts index a47c84fe0..68dde97bb 100644 --- a/crates/bindings-typescript/tsup.config.ts +++ b/crates/bindings-typescript/tsup.config.ts @@ -3,8 +3,8 @@ import { defineConfig, type Options } from 'tsup'; function commonEsbuildTweaks() { return (options: any) => { - // Prefer "exports"."source" when deps provide it; harmless otherwise. - options.conditions = ['source', 'import', 'default']; + // Prefer "exports"."development" when deps provide it; harmless otherwise. + options.conditions = ['development', 'import', 'default']; options.mainFields = ['browser', 'module', 'main']; }; } @@ -20,17 +20,12 @@ export default defineConfig([ format: ['esm', 'cjs'], target: 'es2022', outDir: 'dist', - dts: false, // types come from ./src in package.json + dts: false, sourcemap: true, clean: true, platform: 'neutral', treeshake: 'smallest', external: ['undici'], - // env variable used at build time to determine platform-specific code - // see: websocket_decompress_adapter.ts - env: { - BROWSER: 'false', - }, outExtension, esbuildOptions: commonEsbuildTweaks(), }, @@ -47,9 +42,6 @@ export default defineConfig([ platform: 'browser', treeshake: 'smallest', external: ['undici'], - env: { - BROWSER: 'true', - }, outExtension, esbuildOptions: commonEsbuildTweaks(), }, @@ -96,9 +88,6 @@ export default defineConfig([ platform: 'neutral', treeshake: 'smallest', external: ['undici'], - env: { - BROWSER: 'false', - }, outExtension, esbuildOptions: commonEsbuildTweaks(), }, @@ -115,9 +104,6 @@ export default defineConfig([ platform: 'browser', treeshake: 'smallest', external: ['undici'], - env: { - BROWSER: 'true', - }, outExtension, esbuildOptions: commonEsbuildTweaks(), }, @@ -134,9 +120,6 @@ export default defineConfig([ platform: 'neutral', // flip to 'node' if you actually rely on Node builtins treeshake: 'smallest', external: ['undici'], - env: { - BROWSER: 'false', - }, outExtension, esbuildOptions: commonEsbuildTweaks(), }, @@ -158,9 +141,6 @@ export default defineConfig([ platform: 'browser', treeshake: 'smallest', external: ['undici'], - env: { - BROWSER: 'true', - }, outExtension, esbuildOptions: commonEsbuildTweaks(), }, @@ -175,6 +155,7 @@ export default defineConfig([ sourcemap: true, minify: 'terser', platform: 'browser', + external: ['undici'], treeshake: 'smallest', outExtension: ({ format }) => ({ js: format === 'cjs' ? '.cjs' : '.mjs' }), esbuildOptions: commonEsbuildTweaks(), @@ -192,9 +173,6 @@ export default defineConfig([ platform: 'browser', treeshake: 'smallest', external: ['undici'], - env: { - BROWSER: 'true', - }, outExtension: ({ format }) => ({ js: format === 'cjs' ? '.cjs' : '.mjs' }), esbuildOptions: commonEsbuildTweaks(), }, diff --git a/crates/codegen/examples/regen-typescript-moduledef.rs b/crates/codegen/examples/regen-typescript-moduledef.rs index 55c811199..b47162d15 100644 --- a/crates/codegen/examples/regen-typescript-moduledef.rs +++ b/crates/codegen/examples/regen-typescript-moduledef.rs @@ -39,7 +39,7 @@ fn main() -> anyhow::Result<()> { if filename == "index.ts" { return Ok(()); } - let code = regex_replace!(&code, r"@clockworklabs/spacetimedb-sdk", "../../index"); + let code = regex_replace!(&code, r#"from "spacetimedb";"#, r#"from "../../index";"#); // Elide types which are related to client-side only things let code = regex_replace!(&code, r"type CallReducerFlags as __CallReducerFlags,", r""); diff --git a/crates/codegen/src/typescript.rs b/crates/codegen/src/typescript.rs index 5b052489c..cae72a400 100644 --- a/crates/codegen/src/typescript.rs +++ b/crates/codegen/src/typescript.rs @@ -705,7 +705,7 @@ fn print_spacetimedb_imports(out: &mut Indenter) { writeln!(out, "{ty},"); } out.dedent(1); - writeln!(out, "}} from \"@clockworklabs/spacetimedb-sdk\";"); + writeln!(out, "}} from \"spacetimedb\";"); } fn print_file_header(output: &mut Indenter, include_version: bool) { diff --git a/crates/codegen/tests/snapshots/codegen__codegen_typescript.snap b/crates/codegen/tests/snapshots/codegen__codegen_typescript.snap index e2422bdeb..c1a050ddb 100644 --- a/crates/codegen/tests/snapshots/codegen__codegen_typescript.snap +++ b/crates/codegen/tests/snapshots/codegen__codegen_typescript.snap @@ -30,7 +30,7 @@ import { type EventContextInterface as __EventContextInterface, type ReducerEventContextInterface as __ReducerEventContextInterface, type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, -} from "@clockworklabs/spacetimedb-sdk"; +} from "spacetimedb"; export type AddPlayer = { name: string, @@ -92,7 +92,7 @@ import { type EventContextInterface as __EventContextInterface, type ReducerEventContextInterface as __ReducerEventContextInterface, type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, -} from "@clockworklabs/spacetimedb-sdk"; +} from "spacetimedb"; export type AddPrivate = { name: string, @@ -154,7 +154,7 @@ import { type EventContextInterface as __EventContextInterface, type ReducerEventContextInterface as __ReducerEventContextInterface, type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, -} from "@clockworklabs/spacetimedb-sdk"; +} from "spacetimedb"; export type Add = { name: string, @@ -218,7 +218,7 @@ import { type EventContextInterface as __EventContextInterface, type ReducerEventContextInterface as __ReducerEventContextInterface, type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, -} from "@clockworklabs/spacetimedb-sdk"; +} from "spacetimedb"; export type AssertCallerIdentityIsModuleIdentity = {}; /** @@ -277,7 +277,7 @@ import { type EventContextInterface as __EventContextInterface, type ReducerEventContextInterface as __ReducerEventContextInterface, type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, -} from "@clockworklabs/spacetimedb-sdk"; +} from "spacetimedb"; export type Baz = { field: string, @@ -340,7 +340,7 @@ import { type EventContextInterface as __EventContextInterface, type ReducerEventContextInterface as __ReducerEventContextInterface, type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, -} from "@clockworklabs/spacetimedb-sdk"; +} from "spacetimedb"; export type ClientConnected = {}; /** @@ -399,7 +399,7 @@ import { type EventContextInterface as __EventContextInterface, type ReducerEventContextInterface as __ReducerEventContextInterface, type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, -} from "@clockworklabs/spacetimedb-sdk"; +} from "spacetimedb"; export type DeletePlayer = { id: bigint, @@ -461,7 +461,7 @@ import { type EventContextInterface as __EventContextInterface, type ReducerEventContextInterface as __ReducerEventContextInterface, type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, -} from "@clockworklabs/spacetimedb-sdk"; +} from "spacetimedb"; export type DeletePlayersByName = { name: string, @@ -523,7 +523,7 @@ import { type EventContextInterface as __EventContextInterface, type ReducerEventContextInterface as __ReducerEventContextInterface, type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, -} from "@clockworklabs/spacetimedb-sdk"; +} from "spacetimedb"; import { Baz } from "./baz_type"; // Mark import as potentially unused declare type __keep_Baz = Baz; @@ -599,7 +599,7 @@ import { type EventContextInterface as __EventContextInterface, type ReducerEventContextInterface as __ReducerEventContextInterface, type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, -} from "@clockworklabs/spacetimedb-sdk"; +} from "spacetimedb"; import { Baz as BazType } from "./baz_type"; // Mark import as potentially unused declare type __keep_BazType = BazType; @@ -638,7 +638,7 @@ import { type EventContextInterface as __EventContextInterface, type ReducerEventContextInterface as __ReducerEventContextInterface, type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, -} from "@clockworklabs/spacetimedb-sdk"; +} from "spacetimedb"; import { HasSpecialStuff } from "./has_special_stuff_type"; import { type EventContext, type Reducer, RemoteReducers, RemoteTables } from "."; declare type __keep = [EventContext, Reducer, RemoteReducers, RemoteTables]; @@ -713,7 +713,7 @@ import { type EventContextInterface as __EventContextInterface, type ReducerEventContextInterface as __ReducerEventContextInterface, type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, -} from "@clockworklabs/spacetimedb-sdk"; +} from "spacetimedb"; export type HasSpecialStuff = { identity: __Identity, @@ -780,7 +780,7 @@ import { type EventContextInterface as __EventContextInterface, type ReducerEventContextInterface as __ReducerEventContextInterface, type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, -} from "@clockworklabs/spacetimedb-sdk"; +} from "spacetimedb"; // Import and reexport all reducer arg types import { Add } from "./add_reducer.ts"; @@ -1433,7 +1433,7 @@ import { type EventContextInterface as __EventContextInterface, type ReducerEventContextInterface as __ReducerEventContextInterface, type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, -} from "@clockworklabs/spacetimedb-sdk"; +} from "spacetimedb"; export type ListOverAge = { age: number, @@ -1495,7 +1495,7 @@ import { type EventContextInterface as __EventContextInterface, type ReducerEventContextInterface as __ReducerEventContextInterface, type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, -} from "@clockworklabs/spacetimedb-sdk"; +} from "spacetimedb"; export type LogModuleIdentity = {}; /** @@ -1554,7 +1554,7 @@ import { type EventContextInterface as __EventContextInterface, type ReducerEventContextInterface as __ReducerEventContextInterface, type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, -} from "@clockworklabs/spacetimedb-sdk"; +} from "spacetimedb"; import { Player } from "./player_type"; import { type EventContext, type Reducer, RemoteReducers, RemoteTables } from "."; declare type __keep = [EventContext, Reducer, RemoteReducers, RemoteTables]; @@ -1703,7 +1703,7 @@ import { type EventContextInterface as __EventContextInterface, type ReducerEventContextInterface as __ReducerEventContextInterface, type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, -} from "@clockworklabs/spacetimedb-sdk"; +} from "spacetimedb"; import * as NamespaceTestCVariants from './namespace_test_c_variants' // The tagged union or sum type for the algebraic type `NamespaceTestC`. @@ -1772,7 +1772,7 @@ import { type EventContextInterface as __EventContextInterface, type ReducerEventContextInterface as __ReducerEventContextInterface, type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, -} from "@clockworklabs/spacetimedb-sdk"; +} from "spacetimedb"; export type Foo = { tag: "Foo" }; export type Bar = { tag: "Bar" }; @@ -1806,7 +1806,7 @@ import { type EventContextInterface as __EventContextInterface, type ReducerEventContextInterface as __ReducerEventContextInterface, type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, -} from "@clockworklabs/spacetimedb-sdk"; +} from "spacetimedb"; import * as NamespaceTestFVariants from './namespace_test_f_variants' // The tagged union or sum type for the algebraic type `NamespaceTestF`. @@ -1878,7 +1878,7 @@ import { type EventContextInterface as __EventContextInterface, type ReducerEventContextInterface as __ReducerEventContextInterface, type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, -} from "@clockworklabs/spacetimedb-sdk"; +} from "spacetimedb"; export type Foo = { tag: "Foo" }; export type Bar = { tag: "Bar" }; @@ -1913,7 +1913,7 @@ import { type EventContextInterface as __EventContextInterface, type ReducerEventContextInterface as __ReducerEventContextInterface, type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, -} from "@clockworklabs/spacetimedb-sdk"; +} from "spacetimedb"; import { Person } from "./person_type"; import { type EventContext, type Reducer, RemoteReducers, RemoteTables } from "."; declare type __keep = [EventContext, Reducer, RemoteReducers, RemoteTables]; @@ -2018,7 +2018,7 @@ import { type EventContextInterface as __EventContextInterface, type ReducerEventContextInterface as __ReducerEventContextInterface, type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, -} from "@clockworklabs/spacetimedb-sdk"; +} from "spacetimedb"; export type Person = { id: number, @@ -2085,7 +2085,7 @@ import { type EventContextInterface as __EventContextInterface, type ReducerEventContextInterface as __ReducerEventContextInterface, type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, -} from "@clockworklabs/spacetimedb-sdk"; +} from "spacetimedb"; import { PkMultiIdentity } from "./pk_multi_identity_type"; import { type EventContext, type Reducer, RemoteReducers, RemoteTables } from "."; declare type __keep = [EventContext, Reducer, RemoteReducers, RemoteTables]; @@ -2212,7 +2212,7 @@ import { type EventContextInterface as __EventContextInterface, type ReducerEventContextInterface as __ReducerEventContextInterface, type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, -} from "@clockworklabs/spacetimedb-sdk"; +} from "spacetimedb"; export type PkMultiIdentity = { id: number, @@ -2277,7 +2277,7 @@ import { type EventContextInterface as __EventContextInterface, type ReducerEventContextInterface as __ReducerEventContextInterface, type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, -} from "@clockworklabs/spacetimedb-sdk"; +} from "spacetimedb"; import { Player } from "./player_type"; import { type EventContext, type Reducer, RemoteReducers, RemoteTables } from "."; declare type __keep = [EventContext, Reducer, RemoteReducers, RemoteTables]; @@ -2426,7 +2426,7 @@ import { type EventContextInterface as __EventContextInterface, type ReducerEventContextInterface as __ReducerEventContextInterface, type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, -} from "@clockworklabs/spacetimedb-sdk"; +} from "spacetimedb"; export type Player = { identity: __Identity, @@ -2493,7 +2493,7 @@ import { type EventContextInterface as __EventContextInterface, type ReducerEventContextInterface as __ReducerEventContextInterface, type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, -} from "@clockworklabs/spacetimedb-sdk"; +} from "spacetimedb"; export type Point = { x: bigint, @@ -2558,7 +2558,7 @@ import { type EventContextInterface as __EventContextInterface, type ReducerEventContextInterface as __ReducerEventContextInterface, type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, -} from "@clockworklabs/spacetimedb-sdk"; +} from "spacetimedb"; import { Point } from "./point_type"; import { type EventContext, type Reducer, RemoteReducers, RemoteTables } from "."; declare type __keep = [EventContext, Reducer, RemoteReducers, RemoteTables]; @@ -2633,7 +2633,7 @@ import { type EventContextInterface as __EventContextInterface, type ReducerEventContextInterface as __ReducerEventContextInterface, type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, -} from "@clockworklabs/spacetimedb-sdk"; +} from "spacetimedb"; import { PrivateTable } from "./private_table_type"; import { type EventContext, type Reducer, RemoteReducers, RemoteTables } from "."; declare type __keep = [EventContext, Reducer, RemoteReducers, RemoteTables]; @@ -2708,7 +2708,7 @@ import { type EventContextInterface as __EventContextInterface, type ReducerEventContextInterface as __ReducerEventContextInterface, type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, -} from "@clockworklabs/spacetimedb-sdk"; +} from "spacetimedb"; export type PrivateTable = { name: string, @@ -2771,7 +2771,7 @@ import { type EventContextInterface as __EventContextInterface, type ReducerEventContextInterface as __ReducerEventContextInterface, type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, -} from "@clockworklabs/spacetimedb-sdk"; +} from "spacetimedb"; export type QueryPrivate = {}; /** @@ -2830,7 +2830,7 @@ import { type EventContextInterface as __EventContextInterface, type ReducerEventContextInterface as __ReducerEventContextInterface, type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, -} from "@clockworklabs/spacetimedb-sdk"; +} from "spacetimedb"; import { RepeatingTestArg } from "./repeating_test_arg_type"; import { type EventContext, type Reducer, RemoteReducers, RemoteTables } from "."; declare type __keep = [EventContext, Reducer, RemoteReducers, RemoteTables]; @@ -2935,7 +2935,7 @@ import { type EventContextInterface as __EventContextInterface, type ReducerEventContextInterface as __ReducerEventContextInterface, type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, -} from "@clockworklabs/spacetimedb-sdk"; +} from "spacetimedb"; export type RepeatingTestArg = { scheduledId: bigint, @@ -3002,7 +3002,7 @@ import { type EventContextInterface as __EventContextInterface, type ReducerEventContextInterface as __ReducerEventContextInterface, type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, -} from "@clockworklabs/spacetimedb-sdk"; +} from "spacetimedb"; import { RepeatingTestArg } from "./repeating_test_arg_type"; // Mark import as potentially unused @@ -3068,7 +3068,7 @@ import { type EventContextInterface as __EventContextInterface, type ReducerEventContextInterface as __ReducerEventContextInterface, type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, -} from "@clockworklabs/spacetimedb-sdk"; +} from "spacetimedb"; export type SayHello = {}; /** @@ -3127,7 +3127,7 @@ import { type EventContextInterface as __EventContextInterface, type ReducerEventContextInterface as __ReducerEventContextInterface, type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, -} from "@clockworklabs/spacetimedb-sdk"; +} from "spacetimedb"; import { TestA } from "./test_a_type"; import { type EventContext, type Reducer, RemoteReducers, RemoteTables } from "."; declare type __keep = [EventContext, Reducer, RemoteReducers, RemoteTables]; @@ -3202,7 +3202,7 @@ import { type EventContextInterface as __EventContextInterface, type ReducerEventContextInterface as __ReducerEventContextInterface, type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, -} from "@clockworklabs/spacetimedb-sdk"; +} from "spacetimedb"; export type TestA = { x: number, @@ -3269,7 +3269,7 @@ import { type EventContextInterface as __EventContextInterface, type ReducerEventContextInterface as __ReducerEventContextInterface, type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, -} from "@clockworklabs/spacetimedb-sdk"; +} from "spacetimedb"; export type TestB = { foo: string, @@ -3332,7 +3332,7 @@ import { type EventContextInterface as __EventContextInterface, type ReducerEventContextInterface as __ReducerEventContextInterface, type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, -} from "@clockworklabs/spacetimedb-sdk"; +} from "spacetimedb"; export type TestBtreeIndexArgs = {}; /** @@ -3391,7 +3391,7 @@ import { type EventContextInterface as __EventContextInterface, type ReducerEventContextInterface as __ReducerEventContextInterface, type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, -} from "@clockworklabs/spacetimedb-sdk"; +} from "spacetimedb"; import { TestD } from "./test_d_type"; import { NamespaceTestC } from "./namespace_test_c_type"; // Mark import as potentially unused @@ -3470,7 +3470,7 @@ import { type EventContextInterface as __EventContextInterface, type ReducerEventContextInterface as __ReducerEventContextInterface, type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, -} from "@clockworklabs/spacetimedb-sdk"; +} from "spacetimedb"; import { NamespaceTestC } from "./namespace_test_c_type"; // Mark import as potentially unused declare type __keep_NamespaceTestC = NamespaceTestC; @@ -3537,7 +3537,7 @@ import { type EventContextInterface as __EventContextInterface, type ReducerEventContextInterface as __ReducerEventContextInterface, type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, -} from "@clockworklabs/spacetimedb-sdk"; +} from "spacetimedb"; import { TestE } from "./test_e_type"; import { type EventContext, type Reducer, RemoteReducers, RemoteTables } from "."; declare type __keep = [EventContext, Reducer, RemoteReducers, RemoteTables]; @@ -3642,7 +3642,7 @@ import { type EventContextInterface as __EventContextInterface, type ReducerEventContextInterface as __ReducerEventContextInterface, type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, -} from "@clockworklabs/spacetimedb-sdk"; +} from "spacetimedb"; export type TestE = { id: bigint, @@ -3707,7 +3707,7 @@ import { type EventContextInterface as __EventContextInterface, type ReducerEventContextInterface as __ReducerEventContextInterface, type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, -} from "@clockworklabs/spacetimedb-sdk"; +} from "spacetimedb"; import { TestFoobar } from "./test_foobar_type"; import { Foobar } from "./foobar_type"; // Mark import as potentially unused @@ -3786,7 +3786,7 @@ import { type EventContextInterface as __EventContextInterface, type ReducerEventContextInterface as __ReducerEventContextInterface, type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, -} from "@clockworklabs/spacetimedb-sdk"; +} from "spacetimedb"; import { Foobar } from "./foobar_type"; // Mark import as potentially unused declare type __keep_Foobar = Foobar; @@ -3853,7 +3853,7 @@ import { type EventContextInterface as __EventContextInterface, type ReducerEventContextInterface as __ReducerEventContextInterface, type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, -} from "@clockworklabs/spacetimedb-sdk"; +} from "spacetimedb"; import { TestA } from "./test_a_type"; // Mark import as potentially unused diff --git a/docs/docs/sdks/typescript/index.md b/docs/docs/sdks/typescript/index.md index 279a9fdb4..22b32232b 100644 --- a/docs/docs/sdks/typescript/index.md +++ b/docs/docs/sdks/typescript/index.md @@ -34,9 +34,11 @@ Then add the SpacetimeDB SDK to your dependencies: ```bash cd client -npm install @clockworklabs/spacetimedb-sdk +npm install spacetimedb ``` +> WARNING! The `@clockworklabs/spacetimedb-sdk` package has been deprecated in favor of the `spacetimedb` package as of SpacetimeDB version 1.4.0. If you are using the old SDK package, you will need to switch to `spacetimedb`. You will also need a SpacetimeDB CLI version of 1.4.0+ to generate bindings for the new `spacetimedb` package. + You should have this folder layout starting from the root of your project: ```bash @@ -81,7 +83,7 @@ You may also need to import some definitions from the SDK library: ```typescript import { Identity, ConnectionId, Event, ReducerEvent -} from '@clockworklabs/spacetimedb-sdk'; +} from 'spacetimedb'; ``` ## Type `DbConnection` diff --git a/docs/docs/sdks/typescript/quickstart.md b/docs/docs/sdks/typescript/quickstart.md index b5292fa29..5d2328197 100644 --- a/docs/docs/sdks/typescript/quickstart.md +++ b/docs/docs/sdks/typescript/quickstart.md @@ -28,11 +28,13 @@ pnpm install We also need to install the `spacetime-client-sdk` package: ```bash -pnpm install @clockworklabs/spacetimedb-sdk +pnpm install spacetimedb ``` > If you are using another package manager like `yarn` or `npm`, the same steps should work with the appropriate commands for those tools. +> WARNING! The `@clockworklabs/spacetimedb-sdk` package has been deprecated in favor of the `spacetimedb` package as of SpacetimeDB version 1.4.0. If you are using the old SDK package, you will need to switch to `spacetimedb`. You will also need a SpacetimeDB CLI version of 1.4.0+ to generate bindings for the new `spacetimedb` package. + You can now `pnpm run dev` to see the Vite template app running at `http://localhost:5173`. ## Basic layout @@ -54,8 +56,8 @@ import { useTable, where, eq, -} from '@clockworklabs/spacetimedb-sdk/react'; -import { Identity, Timestamp } from '@clockworklabs/spacetimedb-sdk'; +} from 'spacetimedb/react'; +import { Identity, Timestamp } from 'spacetimedb'; import './App.css'; export type PrettyMessage = { @@ -484,8 +486,8 @@ import { StrictMode } from 'react'; import { createRoot } from 'react-dom/client'; import './index.css'; import App from './App.tsx'; -import { Identity } from '@clockworklabs/spacetimedb-sdk'; -import { SpacetimeDBProvider } from '@clockworklabs/spacetimedb-sdk/react'; +import { Identity } from 'spacetimedb'; +import { SpacetimeDBProvider } from 'spacetimedb/react'; import { DbConnection, ErrorContext } from './module_bindings/index.ts'; ``` diff --git a/docs/llms.md b/docs/llms.md index 27dee7d9b..d81d14726 100644 --- a/docs/llms.md +++ b/docs/llms.md @@ -2278,10 +2278,13 @@ Install the SDK package into your project: ```bash # Using npm -npm install @clockworklabs/spacetimedb-sdk +npm install spacetimedb + +# Or using pnpm +pnpm add spacetimedb # Or using yarn -yarn add @clockworklabs/spacetimedb-sdk +yarn add spacetimedb ``` #### 2. Generate Module Bindings @@ -2299,7 +2302,7 @@ Import the necessary generated types and SDK components: ```typescript // Import SDK core types -import { Identity, Status } from "@clockworklabs/spacetimedb-sdk"; +import { Identity, Status } from "spacetimedb"; // Import generated connection class, event contexts, and table types import { DbConnection, EventContext, ReducerEventContext, Message, User } from "./module_bindings"; // Reducer functions are accessed via conn.reducers @@ -2311,7 +2314,7 @@ Use the generated `DbConnection` class and its builder pattern to establish a co ```typescript import { DbConnection, EventContext, ReducerEventContext, Message, User } from './module_bindings'; -import { Identity, Status } from '@clockworklabs/spacetimedb-sdk'; +import { Identity, Status } from 'spacetimedb'; const HOST = "ws://localhost:3000"; const DB_NAME = "quickstart-chat"; diff --git a/eslint.config.js b/eslint.config.js index 0546a28c3..8399745dc 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -38,9 +38,8 @@ export default tseslint.config( './tsconfig.json', './crates/bindings-typescript/tsconfig.json', './crates/bindings-typescript/test-app/tsconfig.json', + './crates/bindings-typescript/examples/quickstart-chat/tsconfig.json', './docs/tsconfig.json', - './sdks/typescript/tsconfig.json', - './sdks/typescript/examples/quickstart-chat/tsconfig.json', ], projectService: true, tsconfigRootDir: __dirname, diff --git a/package.json b/package.json index 87a3a452a..e9d13f723 100644 --- a/package.json +++ b/package.json @@ -4,11 +4,11 @@ "engines": { "node": ">=18.0.0", "pnpm": ">=9.0.0" }, "type": "module", "scripts": { - "format": "pnpm --filter ./crates/bindings-typescript run format && pnpm --filter ./docs run format && pnpm --filter ./sdks/typescript run format", - "lint": "pnpm --filter ./crates/bindings-typescript run lint && pnpm --filter ./docs run lint && pnpm --filter ./sdks/typescript run lint", - "build": "pnpm --filter ./crates/bindings-typescript run build && pnpm --filter ./docs run build && pnpm --filter ./sdks/typescript run build", - "test": "pnpm --filter ./crates/bindings-typescript run test && pnpm --filter ./docs run test && pnpm --filter ./sdks/typescript run test", - "generate": "pnpm --filter ./crates/bindings-typescript run generate && pnpm --filter ./docs run generate && pnpm --filter ./sdks/typescript run generate", + "format": "pnpm --filter ./crates/bindings-typescript run format && pnpm --filter ./docs run format && pnpm --filter ./crates/bindings-typescript/examples/quickstart-chat run format && pnpm --filter ./crates/bindings-typescript/test-app run format", + "lint": "pnpm --filter ./crates/bindings-typescript run lint && pnpm --filter ./docs run lint && pnpm --filter ./crates/bindings-typescript/examples/quickstart-chat run lint && pnpm --filter ./crates/bindings-typescript/test-app run lint", + "build": "pnpm --filter ./crates/bindings-typescript run build && pnpm --filter ./docs run build && pnpm --filter ./crates/bindings-typescript/examples/quickstart-chat run build && pnpm --filter ./crates/bindings-typescript/test-app run build", + "test": "pnpm --filter ./crates/bindings-typescript run test && pnpm --filter ./docs run test && && pnpm --filter ./crates/bindings-typescript/examples/quickstart-chat run test && pnpm --filter ./crates/bindings-typescript/test-app run test", + "generate": "pnpm --filter ./crates/bindings-typescript run generate && pnpm --filter ./docs run generate && pnpm --filter ./crates/bindings-typescript/examples/quickstart-chat run generate && pnpm --filter ./crates/bindings-typescript/test-app run generate", "clean": "pnpm -r exec rimraf dist .tsbuildinfo coverage" }, "devDependencies": { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 0ce7b01f7..81ec33cd9 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -109,6 +109,70 @@ importers: specifier: ^3.2.4 version: 3.2.4(@types/debug@4.1.12)(@types/node@24.3.0)(jiti@2.5.1)(jsdom@26.1.0)(terser@5.43.1)(tsx@4.20.4) + crates/bindings-typescript/examples/quickstart-chat: + dependencies: + react: + specifier: ^18.3.1 + version: 18.3.1 + react-dom: + specifier: ^18.3.1 + version: 18.3.1(react@18.3.1) + spacetimedb: + specifier: workspace:* + version: link:../.. + devDependencies: + '@eslint/js': + specifier: ^9.17.0 + version: 9.33.0 + '@testing-library/jest-dom': + specifier: ^6.6.3 + version: 6.7.0 + '@testing-library/react': + specifier: ^16.2.0 + version: 16.3.0(@testing-library/dom@10.4.1)(@types/react-dom@18.3.7(@types/react@18.3.23))(@types/react@18.3.23)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + '@testing-library/user-event': + specifier: ^14.6.1 + version: 14.6.1(@testing-library/dom@10.4.1) + '@types/react': + specifier: ^18.3.18 + version: 18.3.23 + '@types/react-dom': + specifier: ^18.3.5 + version: 18.3.7(@types/react@18.3.23) + '@vitejs/plugin-react': + specifier: ^5.0.2 + version: 5.0.2(vite@7.1.5(@types/node@24.3.0)(jiti@2.5.1)(terser@5.43.1)(tsx@4.20.4)) + eslint: + specifier: ^9.17.0 + version: 9.33.0(jiti@2.5.1) + eslint-plugin-react-hooks: + specifier: ^5.0.0 + version: 5.2.0(eslint@9.33.0(jiti@2.5.1)) + eslint-plugin-react-refresh: + specifier: ^0.4.16 + version: 0.4.20(eslint@9.33.0(jiti@2.5.1)) + globals: + specifier: ^15.14.0 + version: 15.15.0 + jsdom: + specifier: ^26.0.0 + version: 26.1.0 + prettier: + specifier: ^3.3.3 + version: 3.6.2 + typescript: + specifier: ~5.6.2 + version: 5.6.3 + typescript-eslint: + specifier: ^8.18.2 + version: 8.40.0(eslint@9.33.0(jiti@2.5.1))(typescript@5.6.3) + vite: + specifier: ^7.1.5 + version: 7.1.5(@types/node@24.3.0)(jiti@2.5.1)(terser@5.43.1)(tsx@4.20.4) + vitest: + specifier: 3.2.4 + version: 3.2.4(@types/debug@4.1.12)(@types/node@24.3.0)(jiti@2.5.1)(jsdom@26.1.0)(terser@5.43.1)(tsx@4.20.4) + crates/bindings-typescript/test-app: dependencies: react: @@ -165,116 +229,6 @@ importers: specifier: ^5.0.0 version: 5.0.0 - sdks/typescript: - dependencies: - react: - specifier: ^18.0.0 || ^19.0.0-0 || ^19.0.0 - version: 18.3.1 - spacetimedb: - specifier: workspace:^ - version: link:../../crates/bindings-typescript - undici: - specifier: ^6.19.2 - version: 6.21.3 - devDependencies: - '@changesets/changelog-github': - specifier: ^0.5.0 - version: 0.5.1 - '@changesets/cli': - specifier: ^2.27.7 - version: 2.29.6(@types/node@24.3.0) - '@types/react': - specifier: ^19.1.13 - version: 19.1.13 - brotli-size-cli: - specifier: ^1.0.0 - version: 1.0.0 - prettier: - specifier: ^3.3.3 - version: 3.6.2 - terser: - specifier: ^5.31.2 - version: 5.43.1 - tsup: - specifier: ^8.1.0 - version: 8.5.0(jiti@2.5.1)(postcss@8.5.6)(tsx@4.20.4)(typescript@5.9.2) - tsx: - specifier: ^4.17.0 - version: 4.20.4 - typescript: - specifier: ^5.5.3 - version: 5.9.2 - vite: - specifier: ^7.1.5 - version: 7.1.5(@types/node@24.3.0)(jiti@2.5.1)(terser@5.43.1)(tsx@4.20.4) - vitest: - specifier: ^3.2.4 - version: 3.2.4(@types/debug@4.1.12)(@types/node@24.3.0)(jiti@2.5.1)(jsdom@26.1.0)(terser@5.43.1)(tsx@4.20.4) - - sdks/typescript/examples/quickstart-chat: - dependencies: - '@clockworklabs/spacetimedb-sdk': - specifier: workspace:* - version: link:../.. - react: - specifier: ^18.3.1 - version: 18.3.1 - react-dom: - specifier: ^18.3.1 - version: 18.3.1(react@18.3.1) - devDependencies: - '@eslint/js': - specifier: ^9.17.0 - version: 9.33.0 - '@testing-library/jest-dom': - specifier: ^6.6.3 - version: 6.7.0 - '@testing-library/react': - specifier: ^16.2.0 - version: 16.3.0(@testing-library/dom@10.4.1)(@types/react-dom@18.3.7(@types/react@18.3.23))(@types/react@18.3.23)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - '@testing-library/user-event': - specifier: ^14.6.1 - version: 14.6.1(@testing-library/dom@10.4.1) - '@types/react': - specifier: ^18.3.18 - version: 18.3.23 - '@types/react-dom': - specifier: ^18.3.5 - version: 18.3.7(@types/react@18.3.23) - '@vitejs/plugin-react': - specifier: ^5.0.2 - version: 5.0.2(vite@7.1.5(@types/node@24.3.0)(jiti@2.5.1)(terser@5.43.1)(tsx@4.20.4)) - eslint: - specifier: ^9.17.0 - version: 9.33.0(jiti@2.5.1) - eslint-plugin-react-hooks: - specifier: ^5.0.0 - version: 5.2.0(eslint@9.33.0(jiti@2.5.1)) - eslint-plugin-react-refresh: - specifier: ^0.4.16 - version: 0.4.20(eslint@9.33.0(jiti@2.5.1)) - globals: - specifier: ^15.14.0 - version: 15.15.0 - jsdom: - specifier: ^26.0.0 - version: 26.1.0 - prettier: - specifier: ^3.3.3 - version: 3.6.2 - typescript: - specifier: ~5.6.2 - version: 5.6.3 - typescript-eslint: - specifier: ^8.18.2 - version: 8.40.0(eslint@9.33.0(jiti@2.5.1))(typescript@5.6.3) - vite: - specifier: ^7.1.5 - version: 7.1.5(@types/node@24.3.0)(jiti@2.5.1)(terser@5.43.1)(tsx@4.20.4) - vitest: - specifier: 3.2.4 - version: 3.2.4(@types/debug@4.1.12)(@types/node@24.3.0)(jiti@2.5.1)(jsdom@26.1.0)(terser@5.43.1)(tsx@4.20.4) - packages: '@adobe/css-tools@4.4.4': @@ -378,67 +332,6 @@ packages: resolution: {integrity: sha512-6zABk/ECA/QYSCQ1NGiVwwbQerUCZ+TQbp64Q3AgmfNvurHH0j8TtXa1qbShXA6qqkpAj4V5W8pP6mLe1mcMqA==} engines: {node: '>=18'} - '@changesets/apply-release-plan@7.0.12': - resolution: {integrity: sha512-EaET7As5CeuhTzvXTQCRZeBUcisoYPDDcXvgTE/2jmmypKp0RC7LxKj/yzqeh/1qFTZI7oDGFcL1PHRuQuketQ==} - - '@changesets/assemble-release-plan@6.0.9': - resolution: {integrity: sha512-tPgeeqCHIwNo8sypKlS3gOPmsS3wP0zHt67JDuL20P4QcXiw/O4Hl7oXiuLnP9yg+rXLQ2sScdV1Kkzde61iSQ==} - - '@changesets/changelog-git@0.2.1': - resolution: {integrity: sha512-x/xEleCFLH28c3bQeQIyeZf8lFXyDFVn1SgcBiR2Tw/r4IAWlk1fzxCEZ6NxQAjF2Nwtczoen3OA2qR+UawQ8Q==} - - '@changesets/changelog-github@0.5.1': - resolution: {integrity: sha512-BVuHtF+hrhUScSoHnJwTELB4/INQxVFc+P/Qdt20BLiBFIHFJDDUaGsZw+8fQeJTRP5hJZrzpt3oZWh0G19rAQ==} - - '@changesets/cli@2.29.6': - resolution: {integrity: sha512-6qCcVsIG1KQLhpQ5zE8N0PckIx4+9QlHK3z6/lwKnw7Tir71Bjw8BeOZaxA/4Jt00pcgCnCSWZnyuZf5Il05QQ==} - hasBin: true - - '@changesets/config@3.1.1': - resolution: {integrity: sha512-bd+3Ap2TKXxljCggI0mKPfzCQKeV/TU4yO2h2C6vAihIo8tzseAn2e7klSuiyYYXvgu53zMN1OeYMIQkaQoWnA==} - - '@changesets/errors@0.2.0': - resolution: {integrity: sha512-6BLOQUscTpZeGljvyQXlWOItQyU71kCdGz7Pi8H8zdw6BI0g3m43iL4xKUVPWtG+qrrL9DTjpdn8eYuCQSRpow==} - - '@changesets/get-dependents-graph@2.1.3': - resolution: {integrity: sha512-gphr+v0mv2I3Oxt19VdWRRUxq3sseyUpX9DaHpTUmLj92Y10AGy+XOtV+kbM6L/fDcpx7/ISDFK6T8A/P3lOdQ==} - - '@changesets/get-github-info@0.6.0': - resolution: {integrity: sha512-v/TSnFVXI8vzX9/w3DU2Ol+UlTZcu3m0kXTjTT4KlAdwSvwutcByYwyYn9hwerPWfPkT2JfpoX0KgvCEi8Q/SA==} - - '@changesets/get-release-plan@4.0.13': - resolution: {integrity: sha512-DWG1pus72FcNeXkM12tx+xtExyH/c9I1z+2aXlObH3i9YA7+WZEVaiHzHl03thpvAgWTRaH64MpfHxozfF7Dvg==} - - '@changesets/get-version-range-type@0.4.0': - resolution: {integrity: sha512-hwawtob9DryoGTpixy1D3ZXbGgJu1Rhr+ySH2PvTLHvkZuQ7sRT4oQwMh0hbqZH1weAooedEjRsbrWcGLCeyVQ==} - - '@changesets/git@3.0.4': - resolution: {integrity: sha512-BXANzRFkX+XcC1q/d27NKvlJ1yf7PSAgi8JG6dt8EfbHFHi4neau7mufcSca5zRhwOL8j9s6EqsxmT+s+/E6Sw==} - - '@changesets/logger@0.1.1': - resolution: {integrity: sha512-OQtR36ZlnuTxKqoW4Sv6x5YIhOmClRd5pWsjZsddYxpWs517R0HkyiefQPIytCVh4ZcC5x9XaG8KTdd5iRQUfg==} - - '@changesets/parse@0.4.1': - resolution: {integrity: sha512-iwksMs5Bf/wUItfcg+OXrEpravm5rEd9Bf4oyIPL4kVTmJQ7PNDSd6MDYkpSJR1pn7tz/k8Zf2DhTCqX08Ou+Q==} - - '@changesets/pre@2.0.2': - resolution: {integrity: sha512-HaL/gEyFVvkf9KFg6484wR9s0qjAXlZ8qWPDkTyKF6+zqjBe/I2mygg3MbpZ++hdi0ToqNUF8cjj7fBy0dg8Ug==} - - '@changesets/read@0.6.5': - resolution: {integrity: sha512-UPzNGhsSjHD3Veb0xO/MwvasGe8eMyNrR/sT9gR8Q3DhOQZirgKhhXv/8hVsI0QpPjR004Z9iFxoJU6in3uGMg==} - - '@changesets/should-skip-package@0.1.2': - resolution: {integrity: sha512-qAK/WrqWLNCP22UDdBTMPH5f41elVDlsNyat180A33dWxuUDyNpg6fPi/FyTZwRriVjg0L8gnjJn2F9XAoF0qw==} - - '@changesets/types@4.1.0': - resolution: {integrity: sha512-LDQvVDv5Kb50ny2s25Fhm3d9QSZimsoUGBsUioj6MC3qbMUCuC8GPIvk/M6IvXx3lYhAs0lwWUQLb+VIEUCECw==} - - '@changesets/types@6.1.0': - resolution: {integrity: sha512-rKQcJ+o1nKNgeoYRHKOS07tAMNd3YSN0uHaJOZYjBAgxfV7TUE7JE+z4BzZdQwb5hKaYbayKN5KrYV7ODb2rAA==} - - '@changesets/write@0.4.0': - resolution: {integrity: sha512-CdTLvIOPiCNuH71pyDu3rA+Q0n65cmAbXnwWH84rKGiFumFzkmHNT8KHTMEchcxN+Kl8I54xGUhJ7l3E7X396Q==} - '@cspotcode/source-map-support@0.8.1': resolution: {integrity: sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==} engines: {node: '>=12'} @@ -685,15 +578,6 @@ packages: resolution: {integrity: sha512-bV0Tgo9K4hfPCek+aMAn81RppFKv2ySDQeMoSZuvTASywNTnVJCArCZE2FWqpvIatKu7VMRLWlR1EazvVhDyhQ==} engines: {node: '>=18.18'} - '@inquirer/external-editor@1.0.1': - resolution: {integrity: sha512-Oau4yL24d2B5IL4ma4UpbQigkVhzPDXLoqy1ggK4gnHg/stmkffJE4oOXHXF3uz0UEpywG68KcyXsyYpA1Re/Q==} - engines: {node: '>=18'} - peerDependencies: - '@types/node': '>=18' - peerDependenciesMeta: - '@types/node': - optional: true - '@isaacs/balanced-match@4.0.1': resolution: {integrity: sha512-yzMTt9lEb8Gv7zRioUilSglI0c0smZ9k5D65677DLWLtWJaXIS3CqcGyUFByYKlnUj6TkjLVs54fBl6+TiGQDQ==} engines: {node: 20 || >=22} @@ -729,12 +613,6 @@ packages: '@jridgewell/trace-mapping@0.3.9': resolution: {integrity: sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==} - '@manypkg/find-root@1.1.0': - resolution: {integrity: sha512-mki5uBvhHzO8kYYix/WRy2WX8S3B5wdVSc9D6KcU5lQNglP2yt58/VfLuAK49glRXChosY8ap2oJ1qgma3GUVA==} - - '@manypkg/get-packages@1.1.3': - resolution: {integrity: sha512-fo+QhuU3qE/2TQMQmbVMqaQ6EWbMhi4ABWP+O4AM1NqPBuy0OrApV5LO6BrrgnhtAHS2NH6RrVk9OL181tTi8A==} - '@nodelib/fs.scandir@2.1.5': resolution: {integrity: sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==} engines: {node: '>= 8'} @@ -945,9 +823,6 @@ packages: '@types/ms@2.1.0': resolution: {integrity: sha512-GsCCIZDE/p3i96vtEqx+7dBUGXrc7zeSK3wwPHIaRThS+9OhWIXRqzs4d6k1SVU8g91DrNRWxWUGhp5KXQb2VA==} - '@types/node@12.20.55': - resolution: {integrity: sha512-J8xLz7q2OFulZ2cyGTLE1TbbZcjpno7FaN6zdJNrgAdrJ+DZzh/uFR6YrTb4C+nXakvud8Q4+rbhoIWlYQbUFQ==} - '@types/node@22.18.0': resolution: {integrity: sha512-m5ObIqwsUp6BZzyiy4RdZpzWGub9bqLJMvZDD0QMXhxjqMHMENlj+SqF5QxoUwaQNFe+8kz8XM8ZQhqkQPTgMQ==} @@ -1101,10 +976,6 @@ packages: ajv@6.12.6: resolution: {integrity: sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==} - ansi-colors@4.1.3: - resolution: {integrity: sha512-/6w/C21Pm1A7aZitlI5Ni/2J6FFQN8i1Cvz3kHABAAbw93v/NlvKdVOqz7CCWz/3iv/JplRSEEZ83XION15ovw==} - engines: {node: '>=6'} - ansi-regex@5.0.1: resolution: {integrity: sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==} engines: {node: '>=8'} @@ -1131,9 +1002,6 @@ packages: arg@4.1.3: resolution: {integrity: sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==} - argparse@1.0.10: - resolution: {integrity: sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==} - argparse@2.0.1: resolution: {integrity: sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==} @@ -1144,10 +1012,6 @@ packages: resolution: {integrity: sha512-COROpnaoap1E2F000S62r6A60uHZnmlvomhfyT2DlTcrY1OrBKn2UhH7qn5wTC9zMvD0AY7csdPSNwKP+7WiQw==} engines: {node: '>= 0.4'} - array-union@2.1.0: - resolution: {integrity: sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==} - engines: {node: '>=8'} - assertion-error@2.0.1: resolution: {integrity: sha512-Izi8RQcffqCeNVgFigKli1ssklIbpHnCYc6AknXGYoB6grJqyeby7jv12JUQgmTAnIDnbck1uxksT4dzN3PWBA==} engines: {node: '>=12'} @@ -1164,10 +1028,6 @@ packages: base64-js@1.5.1: resolution: {integrity: sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==} - better-path-resolve@1.0.0: - resolution: {integrity: sha512-pbnl5XzGBdrFU/wT4jqmJVPn2B6UHPBOhzMQkY/SPUPB6QtUXtmBHBIwCbXJol93mOpGMnQyP/+BB19q04xj7g==} - engines: {node: '>=4'} - brace-expansion@1.1.12: resolution: {integrity: sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==} @@ -1227,9 +1087,6 @@ packages: character-entities@2.0.2: resolution: {integrity: sha512-shx7oQ0Awen/BRIdkjkvz54PnEEI/EjwXDSIZp86/KKdbafHh1Df/RYGBhn4hbe2+uKC9FnT5UCEdyPz3ai9hQ==} - chardet@2.1.0: - resolution: {integrity: sha512-bNFETTG/pM5ryzQ9Ad0lJOTa6HWD/YsScAR3EnCPZRPlQh77JocYktSHOUHelyhm8IARL+o4c4F1bP5KVOjiRA==} - check-error@2.1.1: resolution: {integrity: sha512-OAlb+T7V4Op9OwdkjmguYRqncdlx5JiofwOAUkmTF+jNdHwzTaTs4sRAGpzLF3oOz5xAyDGrPgeIDFQmDOTiJw==} engines: {node: '>= 16'} @@ -1238,10 +1095,6 @@ packages: resolution: {integrity: sha512-Qgzu8kfBvo+cA4962jnP1KkS6Dop5NS6g7R5LFYJr4b8Ub94PPQXUksCw9PvXoeXPRRddRNC5C1JQUR2SMGtnA==} engines: {node: '>= 14.16.0'} - ci-info@3.9.0: - resolution: {integrity: sha512-NIxF55hv4nSqQswkAeiOi1r83xy8JldOFDTWiug55KBu9Jnblncd2U6ViHmYgHf01TPZS77NJBhBMKdWj9HQMQ==} - engines: {node: '>=8'} - color-convert@2.0.1: resolution: {integrity: sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==} engines: {node: '>=7.0.0'} @@ -1290,9 +1143,6 @@ packages: resolution: {integrity: sha512-ZYP5VBHshaDAiVZxjbRVcFJpc+4xGgT0bK3vzy1HLN8jTO975HEbuYzZJcHoQEY5K1a0z8YayJkyVETa08eNTg==} engines: {node: '>=18'} - dataloader@1.4.0: - resolution: {integrity: sha512-68s5jYdlvasItOJnCuI2Q9s4q98g0pCyL3HrcKJu8KNugUl8ahgmZYg38ysLTgQjjXX3H8CJLkAvWrclWfcalw==} - debug@4.4.3: resolution: {integrity: sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==} engines: {node: '>=6.0'} @@ -1319,10 +1169,6 @@ packages: resolution: {integrity: sha512-0je+qPKHEMohvfRTCEo3CrPG6cAzAYgmzKyxRiYSSDkS6eGJdyVJm7WaYA5ECaAD9wLB2T4EEeymA5aFVcYXCA==} engines: {node: '>=6'} - detect-indent@6.1.0: - resolution: {integrity: sha512-reYkTUJAZb9gUuZ2RvVCNhVHdg62RHnJ7WJl8ftMi4diZ6NWlciOzQN88pUhSELEwflJht4oQDv0F0BMlwaYtA==} - engines: {node: '>=8'} - devlop@1.1.0: resolution: {integrity: sha512-RWmIqhcFf1lRYBvNmr7qTNuyCt/7/ns2jbpp1+PalgE/rDQcBT0fioSMUpJ93irlUhC5hrg4cYqe6U+0ImW0rA==} @@ -1330,20 +1176,12 @@ packages: resolution: {integrity: sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==} engines: {node: '>=0.3.1'} - dir-glob@3.0.1: - resolution: {integrity: sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==} - engines: {node: '>=8'} - dom-accessibility-api@0.5.16: resolution: {integrity: sha512-X7BJ2yElsnOJ30pZF4uIIDfBEVgF4XEBxL9Bxhy6dnrm5hkzqmsWHGTiHqRiITNhMyFLyAiWndIJP7Z1NTteDg==} dom-accessibility-api@0.6.3: resolution: {integrity: sha512-7ZgogeTnjuHbo+ct10G9Ffp0mif17idi0IyWNVA/wcwcm7NPOD/WEHVP3n7n3MhXqxoIYm8d6MuZohYWIZ4T3w==} - dotenv@8.6.0: - resolution: {integrity: sha512-IrPdXQsk2BbzvCBGBOTmmSH5SodmqZNt4ERAZDmW4CT+tL8VtvinqywuANaFu4bOMWki16nqf0e4oC0QIaDr/g==} - engines: {node: '>=10'} - duplexer@0.1.1: resolution: {integrity: sha512-sxNZ+ljy+RA1maXoUReeqBBpBC6RLKmg5ewzV+x+mSETmWNoKdZN6vcQjpFROemza23hGFskJtFNoUWUaQ+R4Q==} @@ -1359,10 +1197,6 @@ packages: emoji-regex@9.2.2: resolution: {integrity: sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==} - enquirer@2.4.1: - resolution: {integrity: sha512-rRqJg/6gd538VHvR3PSrdRBb/1Vy2YfzHqzvbhGIQpDRKIa4FgV/54b5Q1xYSxOOwKvjXweS26E0Q+nAMwp2pQ==} - engines: {node: '>=8.6'} - entities@6.0.1: resolution: {integrity: sha512-aN97NXWF6AWBTahfVOIrB/NShkzi5H7F9r1s9mD3cDj4Ko5f2qhhVoYMibXF7GlLveb/D2ioWay8lxI97Ven3g==} engines: {node: '>=0.12'} @@ -1420,11 +1254,6 @@ packages: resolution: {integrity: sha512-j6PAQ2uUr79PZhBjP5C5fhl8e39FmRnOjsD5lGnWrFU8i2G776tBK7+nP8KuQUTTyAZUwfQqXAgrVH5MbH9CYQ==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - esprima@4.0.1: - resolution: {integrity: sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==} - engines: {node: '>=4'} - hasBin: true - esquery@1.6.0: resolution: {integrity: sha512-ca9pw9fomFcKPvFLXhBKUK90ZvGibiGOvRJNbjljY7s7uq/5YO4BOzcYtJqExdx99rF6aAcnRxHmcUHcz6sQsg==} engines: {node: '>=0.10'} @@ -1451,9 +1280,6 @@ packages: extend@3.0.2: resolution: {integrity: sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==} - extendable-error@0.1.7: - resolution: {integrity: sha512-UOiS2in6/Q0FK0R0q6UY9vYpQ21mr/Qn1KOnte7vsACuNJf514WvCCUHSRCPcgjPT2bAhNIJdlE6bVap1GKmeg==} - fast-deep-equal@3.1.3: resolution: {integrity: sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==} @@ -1487,10 +1313,6 @@ packages: resolution: {integrity: sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==} engines: {node: '>=8'} - find-up@4.1.0: - resolution: {integrity: sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==} - engines: {node: '>=8'} - find-up@5.0.0: resolution: {integrity: sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==} engines: {node: '>=10'} @@ -1509,14 +1331,6 @@ packages: resolution: {integrity: sha512-gIXjKqtFuWEgzFRJA9WCQeSJLZDjgJUOMCMzxtvFq/37KojM1BFGufqsCy0r4qSQmYLsZYMeyRqzIWOMup03sw==} engines: {node: '>=14'} - fs-extra@7.0.1: - resolution: {integrity: sha512-YJDaCJZEnBmcbw13fvdAM9AwNOJwOzrE4pqMqBq5nFiEqXUqHwlK4B+3pUw6JNvfSPtX05xFHtYy/1ni01eGCw==} - engines: {node: '>=6 <7 || >=8'} - - fs-extra@8.1.0: - resolution: {integrity: sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==} - engines: {node: '>=6 <7 || >=8'} - fsevents@2.3.3: resolution: {integrity: sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==} engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0} @@ -1557,13 +1371,6 @@ packages: resolution: {integrity: sha512-7ACyT3wmyp3I61S4fG682L0VA2RGD9otkqGJIwNUMF1SWUombIIk+af1unuDYgMm082aHYwD+mzJvv9Iu8dsgg==} engines: {node: '>=18'} - globby@11.1.0: - resolution: {integrity: sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==} - engines: {node: '>=10'} - - graceful-fs@4.2.11: - resolution: {integrity: sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==} - graphemer@1.4.0: resolution: {integrity: sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==} @@ -1586,10 +1393,6 @@ packages: resolution: {integrity: sha512-vK9P5/iUfdl95AI+JVyUuIcVtd4ofvtrOr3HNtM2yxC9bnMbEdp3x01OhQNnjb8IJYi38VlTE3mBXwcfvywuSw==} engines: {node: '>= 14'} - human-id@4.1.1: - resolution: {integrity: sha512-3gKm/gCSUipeLsRYZbbdA1BD83lBoWUkZ7G9VFrhWPAU76KwYo5KR8V28bpoPm/ygy0x5/GCbpRQdY7VLYCoIg==} - hasBin: true - iconv-lite@0.6.3: resolution: {integrity: sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==} engines: {node: '>=0.10.0'} @@ -1637,14 +1440,6 @@ packages: is-potential-custom-element-name@1.0.1: resolution: {integrity: sha512-bCYeRA2rVibKZd+s2625gGnGF/t7DSqDs4dP7CrLA1m7jKWz6pps0LpYLJN8Q64HtmPKJ1hrN3nzPNKFEKOUiQ==} - is-subdir@1.2.0: - resolution: {integrity: sha512-2AT6j+gXe/1ueqbW6fLZJiIw3F8iXGJtt0yDrZaBhAZEG1raiTxKWU+IPqMCzQAXOUCKdA4UDMgacKH25XG2Cw==} - engines: {node: '>=4'} - - is-windows@1.0.2: - resolution: {integrity: sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==} - engines: {node: '>=0.10.0'} - isexe@2.0.0: resolution: {integrity: sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==} @@ -1685,10 +1480,6 @@ packages: js-tokens@9.0.1: resolution: {integrity: sha512-mxa9E9ITFOt0ban3j6L5MpjwegGz6lBQmM1IJkWeBZGcMxto50+eWdjC/52xDbS2vy0k7vIMK0Fe2wfL9OQSpQ==} - js-yaml@3.14.1: - resolution: {integrity: sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==} - hasBin: true - js-yaml@4.1.0: resolution: {integrity: sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==} hasBin: true @@ -1721,9 +1512,6 @@ packages: engines: {node: '>=6'} hasBin: true - jsonfile@4.0.0: - resolution: {integrity: sha512-m6F1R3z8jjlf2imQHS2Qez5sjKWQzbuuhuJ/FKYFRZvPE3PuHcSMVZzfsLhGVOkfd20obL5SWEBew5ShlquNxg==} - keyv@4.5.4: resolution: {integrity: sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==} @@ -1742,10 +1530,6 @@ packages: resolution: {integrity: sha512-IXO6OCs9yg8tMKzfPZ1YmheJbZCiEsnBdcB03l0OcfK9prKnJb96siuHCr5Fl37/yo9DnKU+TLpxzTUspw9shg==} engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - locate-path@5.0.0: - resolution: {integrity: sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==} - engines: {node: '>=8'} - locate-path@6.0.0: resolution: {integrity: sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==} engines: {node: '>=10'} @@ -1756,9 +1540,6 @@ packages: lodash.sortby@4.7.0: resolution: {integrity: sha512-HDWXG8isMntAyRF5vZ7xKuEvOhT4AhlRt/3czTSjvGUxjYCBVRQY48ViDHyfYz9VIoBkW4TMGQNapx+l3RUwdA==} - lodash.startcase@4.4.0: - resolution: {integrity: sha512-+WKqsK294HMSc2jEbNgpHpd0JfIBhp7rEV4aqXWqFr6AlXov+SlcgB1Fv01y2kGe3Gc8nMW7VA0SrGuSkRfIEg==} - longest-streak@3.1.0: resolution: {integrity: sha512-9Ri+o0JYgehTaVBBDoMqIl8GXtbWg711O3srftcHhZ0dqnETqLaoIK0x17fUw9rFSlK/0NlsKe0Ahhyl5pXE2g==} @@ -1922,15 +1703,6 @@ packages: natural-compare@1.4.0: resolution: {integrity: sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==} - node-fetch@2.7.0: - resolution: {integrity: sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==} - engines: {node: 4.x || >=6.0.0} - peerDependencies: - encoding: ^0.1.0 - peerDependenciesMeta: - encoding: - optional: true - node-releases@2.0.19: resolution: {integrity: sha512-xxOWJsBKtzAq7DY0J+DTzuz58K8e7sJbdgwkbMWQe8UYB6ekmsQ45q0M/tJDsGaZmbC+l7n57UV8Hl5tHxO9uw==} @@ -1945,43 +1717,17 @@ packages: resolution: {integrity: sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g==} engines: {node: '>= 0.8.0'} - outdent@0.5.0: - resolution: {integrity: sha512-/jHxFIzoMXdqPzTaCpFzAAWhpkSjZPF4Vsn6jAfNpmbH/ymsmd7Qc6VE9BGn0L6YMj6uwpQLxCECpus4ukKS9Q==} - - p-filter@2.1.0: - resolution: {integrity: sha512-ZBxxZ5sL2HghephhpGAQdoskxplTwr7ICaehZwLIlfL6acuVgZPm8yBNuRAFBGEqtD/hmUeq9eqLg2ys9Xr/yw==} - engines: {node: '>=8'} - - p-limit@2.3.0: - resolution: {integrity: sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==} - engines: {node: '>=6'} - p-limit@3.1.0: resolution: {integrity: sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==} engines: {node: '>=10'} - p-locate@4.1.0: - resolution: {integrity: sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==} - engines: {node: '>=8'} - p-locate@5.0.0: resolution: {integrity: sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==} engines: {node: '>=10'} - p-map@2.1.0: - resolution: {integrity: sha512-y3b8Kpd8OAN444hxfBbFfj1FY/RjtTd8tzYwhUqNYXx0fXx2iX4maP4Qr6qhIKbQXI02wTLAda4fYUbDagTUFw==} - engines: {node: '>=6'} - - p-try@2.2.0: - resolution: {integrity: sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==} - engines: {node: '>=6'} - package-json-from-dist@1.0.1: resolution: {integrity: sha512-UEZIS3/by4OC8vL3P2dTXRETpebLI2NiI5vIrjaD/5UtrkFX/tNbwjTSRAGC/+7CAo2pIcBaRgWmcBBHcsaCIw==} - package-manager-detector@0.2.11: - resolution: {integrity: sha512-BEnLolu+yuz22S56CU1SUKq3XC3PkwD5wv4ikR4MfGvnRVcmzXR9DwSlW2fEamyTPyXHomBJRzgapeuBvRNzJQ==} - parent-module@1.0.1: resolution: {integrity: sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==} engines: {node: '>=6'} @@ -2005,10 +1751,6 @@ packages: resolution: {integrity: sha512-ypGJsmGtdXUOeM5u93TyeIEfEhM6s+ljAhrk5vAvSx8uyY/02OvrZnA0YNGUrPXfpJMgI1ODd3nwz8Npx4O4cg==} engines: {node: 20 || >=22} - path-type@4.0.0: - resolution: {integrity: sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==} - engines: {node: '>=8'} - pathe@2.0.3: resolution: {integrity: sha512-WUjGcAqP1gQacoQe+OBJsFA7Ld4DyXuUIjZ5cc75cLHvJ7dtNsTugphxIADwspS+AraAUePCKrSVtPLFj/F88w==} @@ -2027,10 +1769,6 @@ packages: resolution: {integrity: sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==} engines: {node: '>=12'} - pify@4.0.1: - resolution: {integrity: sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==} - engines: {node: '>=6'} - pirates@4.0.7: resolution: {integrity: sha512-TfySrs/5nm8fQJDcBDuUng3VOUKsd7S+zqvbOTiGXHfxX4wK31ard+hoNuvkicM/2YFzlpDgABOevKSsB4G/FA==} engines: {node: '>= 6'} @@ -2064,11 +1802,6 @@ packages: resolution: {integrity: sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==} engines: {node: '>= 0.8.0'} - prettier@2.8.8: - resolution: {integrity: sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==} - engines: {node: '>=10.13.0'} - hasBin: true - prettier@3.6.2: resolution: {integrity: sha512-I7AIg5boAr5R0FFtJ6rCfD+LFsWHp81dolrFD8S79U9tb8Az2nGrJncnMSnys+bpQJfRUzqs9hnA81OAA3hCuQ==} engines: {node: '>=14'} @@ -2086,9 +1819,6 @@ packages: resolution: {integrity: sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==} engines: {node: '>=6'} - quansync@0.2.11: - resolution: {integrity: sha512-AifT7QEbW9Nri4tAwR5M/uzpBuqfZf+zwaEM/QkzEjj7NBuFD2rBuy0K3dE+8wltbezDV7JMA0WfnCPYRSYbXA==} - queue-microtask@1.2.3: resolution: {integrity: sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==} @@ -2108,10 +1838,6 @@ packages: resolution: {integrity: sha512-wS+hAgJShR0KhEvPJArfuPVN1+Hz1t0Y6n5jLrGQbkb4urgPE/0Rve+1kMB1v/oWgHgm4WIcV+i7F2pTVj+2iQ==} engines: {node: '>=0.10.0'} - read-yaml-file@1.1.0: - resolution: {integrity: sha512-VIMnQi/Z4HT2Fxuwg5KrY174U1VdUIASQVWXXyqtNRtxSr9IYkn1rsI6Tb6HsrHCmB7gVpNwX6JxPTHcH6IoTA==} - engines: {node: '>=6'} - readdirp@4.1.2: resolution: {integrity: sha512-GDhwkLfywWL2s6vEjyhri+eXmfH6j1L7JE27WhqLeYzoh/A3DBaYGEj2H/HFZCn/kMfim73FXxEJTw06WtxQwg==} engines: {node: '>= 14.18.0'} @@ -2200,10 +1926,6 @@ packages: engines: {node: ^18.0.0 || >=20.0.0} hasBin: true - slash@3.0.0: - resolution: {integrity: sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==} - engines: {node: '>=8'} - source-map-js@1.2.1: resolution: {integrity: sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==} engines: {node: '>=0.10.0'} @@ -2220,12 +1942,6 @@ packages: engines: {node: '>= 8'} deprecated: The work that was done in this beta branch won't be included in future versions - spawndamnit@3.0.1: - resolution: {integrity: sha512-MmnduQUuHCoFckZoWnXsTg7JaiLBJrKFj9UI2MbRPGaJeVpsLcVBu6P/IGZovziM/YBsellCmsprgNA+w0CzVg==} - - sprintf-js@1.0.3: - resolution: {integrity: sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==} - stackback@0.0.2: resolution: {integrity: sha512-1XMJE5fQo1jGH6Y/7ebnwPOBEkIEnT4QF32d5R1+VXdXveM0IBMJt8zfaxX1P3QhVwrYe+576+jkANtSS2mBbw==} @@ -2248,10 +1964,6 @@ packages: resolution: {integrity: sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==} engines: {node: '>=12'} - strip-bom@3.0.0: - resolution: {integrity: sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==} - engines: {node: '>=4'} - strip-indent@3.0.0: resolution: {integrity: sha512-laJTa3Jb+VQpaC6DseHhF7dXVqHTfJPCRDaEbid/drOhgitgYku/letMUqOXFoWV0zIIUbjpdH2t+tYj4bQMRQ==} engines: {node: '>=8'} @@ -2275,10 +1987,6 @@ packages: symbol-tree@3.2.4: resolution: {integrity: sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw==} - term-size@2.2.1: - resolution: {integrity: sha512-wK0Ri4fOGjv/XPy8SBHZChl8CM7uMc5VML7SqiQ0zG7+J5Vr+RMQDoHa2CNT6KHUnTGIXH34UDMkPzAUyapBZg==} - engines: {node: '>=8'} - terser@5.43.1: resolution: {integrity: sha512-+6erLbBm0+LROX2sPXlUYx/ux5PyE9K/a92Wrt6oA+WDAoFTdpHE5tCYCI5PNzq2y8df4rA+QgHLJuR4jNymsg==} engines: {node: '>=10'} @@ -2332,9 +2040,6 @@ packages: resolution: {integrity: sha512-FVDYdxtnj0G6Qm/DhNPSb8Ju59ULcup3tuJxkFb5K8Bv2pUXILbf0xZWU8PX8Ov19OXljbUyveOFwRMwkXzO+A==} engines: {node: '>=16'} - tr46@0.0.3: - resolution: {integrity: sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==} - tr46@1.0.1: resolution: {integrity: sha512-dTpowEjclQ7Kgx5SdBkqRzVhERQXov8/l9Ft9dVM9fmg0W0KQSVaXX9T4i6twCPNtYiZM53lpSSUAwJbFPOHxA==} @@ -2445,10 +2150,6 @@ packages: unist-util-visit@5.0.0: resolution: {integrity: sha512-MR04uvD+07cwl/yhVuVWAtw+3GOR/knlL55Nd/wAdblk27GCVt3lqpTivy/tkJcZoNPzTwS1Y+KMojlLDhoTzg==} - universalify@0.1.2: - resolution: {integrity: sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==} - engines: {node: '>= 4.0.0'} - update-browserslist-db@1.1.3: resolution: {integrity: sha512-UxhIZQ+QInVdunkDAaiazvvT/+fXL5Osr0JZlJulepYu6Jd7qJtDZjlur0emRlT71EN3ScPoE7gvsuIKKNavKw==} hasBin: true @@ -2544,9 +2245,6 @@ packages: resolution: {integrity: sha512-o8qghlI8NZHU1lLPrpi2+Uq7abh4GGPpYANlalzWxyWteJOCsr/P+oPBA49TOLu5FTZO4d3F9MnWJfiMo4BkmA==} engines: {node: '>=18'} - webidl-conversions@3.0.1: - resolution: {integrity: sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==} - webidl-conversions@4.0.2: resolution: {integrity: sha512-YQ+BmxuTgd6UXZW3+ICGfyqRyHXVlD5GtQr5+qjiNW7bF0cqrzX500HVXPBOvgXb5YnzDd+h0zqyv61KUD7+Sg==} @@ -2566,9 +2264,6 @@ packages: resolution: {integrity: sha512-De72GdQZzNTUBBChsXueQUnPKDkg/5A5zp7pFDuQAj5UFoENpiACU0wlCvzpAGnTkj++ihpKwKyYewn/XNUbKw==} engines: {node: '>=18'} - whatwg-url@5.0.0: - resolution: {integrity: sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==} - whatwg-url@7.1.0: resolution: {integrity: sha512-WUu7Rg1DroM7oQvGWfOiAK21n74Gg+T4elXEQYkOhtyLeWiJFoOGLXPKI/9gzIie9CtwVLm8wtw6YJdKyxSjeg==} @@ -2760,165 +2455,6 @@ snapshots: '@bcoe/v8-coverage@1.0.2': {} - '@changesets/apply-release-plan@7.0.12': - dependencies: - '@changesets/config': 3.1.1 - '@changesets/get-version-range-type': 0.4.0 - '@changesets/git': 3.0.4 - '@changesets/should-skip-package': 0.1.2 - '@changesets/types': 6.1.0 - '@manypkg/get-packages': 1.1.3 - detect-indent: 6.1.0 - fs-extra: 7.0.1 - lodash.startcase: 4.4.0 - outdent: 0.5.0 - prettier: 2.8.8 - resolve-from: 5.0.0 - semver: 7.7.2 - - '@changesets/assemble-release-plan@6.0.9': - dependencies: - '@changesets/errors': 0.2.0 - '@changesets/get-dependents-graph': 2.1.3 - '@changesets/should-skip-package': 0.1.2 - '@changesets/types': 6.1.0 - '@manypkg/get-packages': 1.1.3 - semver: 7.7.2 - - '@changesets/changelog-git@0.2.1': - dependencies: - '@changesets/types': 6.1.0 - - '@changesets/changelog-github@0.5.1': - dependencies: - '@changesets/get-github-info': 0.6.0 - '@changesets/types': 6.1.0 - dotenv: 8.6.0 - transitivePeerDependencies: - - encoding - - '@changesets/cli@2.29.6(@types/node@24.3.0)': - dependencies: - '@changesets/apply-release-plan': 7.0.12 - '@changesets/assemble-release-plan': 6.0.9 - '@changesets/changelog-git': 0.2.1 - '@changesets/config': 3.1.1 - '@changesets/errors': 0.2.0 - '@changesets/get-dependents-graph': 2.1.3 - '@changesets/get-release-plan': 4.0.13 - '@changesets/git': 3.0.4 - '@changesets/logger': 0.1.1 - '@changesets/pre': 2.0.2 - '@changesets/read': 0.6.5 - '@changesets/should-skip-package': 0.1.2 - '@changesets/types': 6.1.0 - '@changesets/write': 0.4.0 - '@inquirer/external-editor': 1.0.1(@types/node@24.3.0) - '@manypkg/get-packages': 1.1.3 - ansi-colors: 4.1.3 - ci-info: 3.9.0 - enquirer: 2.4.1 - fs-extra: 7.0.1 - mri: 1.2.0 - p-limit: 2.3.0 - package-manager-detector: 0.2.11 - picocolors: 1.1.1 - resolve-from: 5.0.0 - semver: 7.7.2 - spawndamnit: 3.0.1 - term-size: 2.2.1 - transitivePeerDependencies: - - '@types/node' - - '@changesets/config@3.1.1': - dependencies: - '@changesets/errors': 0.2.0 - '@changesets/get-dependents-graph': 2.1.3 - '@changesets/logger': 0.1.1 - '@changesets/types': 6.1.0 - '@manypkg/get-packages': 1.1.3 - fs-extra: 7.0.1 - micromatch: 4.0.8 - - '@changesets/errors@0.2.0': - dependencies: - extendable-error: 0.1.7 - - '@changesets/get-dependents-graph@2.1.3': - dependencies: - '@changesets/types': 6.1.0 - '@manypkg/get-packages': 1.1.3 - picocolors: 1.1.1 - semver: 7.7.2 - - '@changesets/get-github-info@0.6.0': - dependencies: - dataloader: 1.4.0 - node-fetch: 2.7.0 - transitivePeerDependencies: - - encoding - - '@changesets/get-release-plan@4.0.13': - dependencies: - '@changesets/assemble-release-plan': 6.0.9 - '@changesets/config': 3.1.1 - '@changesets/pre': 2.0.2 - '@changesets/read': 0.6.5 - '@changesets/types': 6.1.0 - '@manypkg/get-packages': 1.1.3 - - '@changesets/get-version-range-type@0.4.0': {} - - '@changesets/git@3.0.4': - dependencies: - '@changesets/errors': 0.2.0 - '@manypkg/get-packages': 1.1.3 - is-subdir: 1.2.0 - micromatch: 4.0.8 - spawndamnit: 3.0.1 - - '@changesets/logger@0.1.1': - dependencies: - picocolors: 1.1.1 - - '@changesets/parse@0.4.1': - dependencies: - '@changesets/types': 6.1.0 - js-yaml: 3.14.1 - - '@changesets/pre@2.0.2': - dependencies: - '@changesets/errors': 0.2.0 - '@changesets/types': 6.1.0 - '@manypkg/get-packages': 1.1.3 - fs-extra: 7.0.1 - - '@changesets/read@0.6.5': - dependencies: - '@changesets/git': 3.0.4 - '@changesets/logger': 0.1.1 - '@changesets/parse': 0.4.1 - '@changesets/types': 6.1.0 - fs-extra: 7.0.1 - p-filter: 2.1.0 - picocolors: 1.1.1 - - '@changesets/should-skip-package@0.1.2': - dependencies: - '@changesets/types': 6.1.0 - '@manypkg/get-packages': 1.1.3 - - '@changesets/types@4.1.0': {} - - '@changesets/types@6.1.0': {} - - '@changesets/write@0.4.0': - dependencies: - '@changesets/types': 6.1.0 - fs-extra: 7.0.1 - human-id: 4.1.1 - prettier: 2.8.8 - '@cspotcode/source-map-support@0.8.1': dependencies: '@jridgewell/trace-mapping': 0.3.9 @@ -3078,13 +2614,6 @@ snapshots: '@humanwhocodes/retry@0.4.3': {} - '@inquirer/external-editor@1.0.1(@types/node@24.3.0)': - dependencies: - chardet: 2.1.0 - iconv-lite: 0.6.3 - optionalDependencies: - '@types/node': 24.3.0 - '@isaacs/balanced-match@4.0.1': {} '@isaacs/brace-expansion@5.0.0': @@ -3113,6 +2642,7 @@ snapshots: dependencies: '@jridgewell/gen-mapping': 0.3.13 '@jridgewell/trace-mapping': 0.3.30 + optional: true '@jridgewell/sourcemap-codec@1.5.5': {} @@ -3126,22 +2656,6 @@ snapshots: '@jridgewell/resolve-uri': 3.1.2 '@jridgewell/sourcemap-codec': 1.5.5 - '@manypkg/find-root@1.1.0': - dependencies: - '@babel/runtime': 7.28.4 - '@types/node': 12.20.55 - find-up: 4.1.0 - fs-extra: 8.1.0 - - '@manypkg/get-packages@1.1.3': - dependencies: - '@babel/runtime': 7.28.4 - '@changesets/types': 4.1.0 - '@manypkg/find-root': 1.1.0 - fs-extra: 8.1.0 - globby: 11.1.0 - read-yaml-file: 1.1.0 - '@nodelib/fs.scandir@2.1.5': dependencies: '@nodelib/fs.stat': 2.0.5 @@ -3313,8 +2827,6 @@ snapshots: '@types/ms@2.1.0': {} - '@types/node@12.20.55': {} - '@types/node@22.18.0': dependencies: undici-types: 6.21.0 @@ -3626,8 +3138,6 @@ snapshots: json-schema-traverse: 0.4.1 uri-js: 4.4.1 - ansi-colors@4.1.3: {} - ansi-regex@5.0.1: {} ansi-regex@6.2.0: {} @@ -3644,10 +3154,6 @@ snapshots: arg@4.1.3: {} - argparse@1.0.10: - dependencies: - sprintf-js: 1.0.3 - argparse@2.0.1: {} aria-query@5.3.0: @@ -3656,8 +3162,6 @@ snapshots: aria-query@5.3.2: {} - array-union@2.1.0: {} - assertion-error@2.0.1: {} ast-v8-to-istanbul@0.3.5: @@ -3672,10 +3176,6 @@ snapshots: base64-js@1.5.1: {} - better-path-resolve@1.0.0: - dependencies: - is-windows: 1.0.2 - brace-expansion@1.1.12: dependencies: balanced-match: 1.0.2 @@ -3706,7 +3206,8 @@ snapshots: node-releases: 2.0.19 update-browserslist-db: 1.1.3(browserslist@4.25.2) - buffer-from@1.1.2: {} + buffer-from@1.1.2: + optional: true bundle-require@5.1.0(esbuild@0.25.9): dependencies: @@ -3736,23 +3237,20 @@ snapshots: character-entities@2.0.2: {} - chardet@2.1.0: {} - check-error@2.1.1: {} chokidar@4.0.3: dependencies: readdirp: 4.1.2 - ci-info@3.9.0: {} - color-convert@2.0.1: dependencies: color-name: 1.1.4 color-name@1.1.4: {} - commander@2.20.3: {} + commander@2.20.3: + optional: true commander@4.1.1: {} @@ -3786,8 +3284,6 @@ snapshots: whatwg-mimetype: 4.0.0 whatwg-url: 14.2.0 - dataloader@1.4.0: {} - debug@4.4.3: dependencies: ms: 2.1.3 @@ -3804,24 +3300,16 @@ snapshots: dequal@2.0.3: {} - detect-indent@6.1.0: {} - devlop@1.1.0: dependencies: dequal: 2.0.3 diff@4.0.2: {} - dir-glob@3.0.1: - dependencies: - path-type: 4.0.0 - dom-accessibility-api@0.5.16: {} dom-accessibility-api@0.6.3: {} - dotenv@8.6.0: {} - duplexer@0.1.1: {} eastasianwidth@0.2.0: {} @@ -3832,11 +3320,6 @@ snapshots: emoji-regex@9.2.2: {} - enquirer@2.4.1: - dependencies: - ansi-colors: 4.1.3 - strip-ansi: 6.0.1 - entities@6.0.1: {} es-module-lexer@1.7.0: {} @@ -3939,8 +3422,6 @@ snapshots: acorn-jsx: 5.3.2(acorn@8.15.0) eslint-visitor-keys: 4.2.1 - esprima@4.0.1: {} - esquery@1.6.0: dependencies: estraverse: 5.3.0 @@ -3961,8 +3442,6 @@ snapshots: extend@3.0.2: {} - extendable-error@0.1.7: {} - fast-deep-equal@3.1.3: {} fast-glob@3.3.3: @@ -3993,11 +3472,6 @@ snapshots: dependencies: to-regex-range: 5.0.1 - find-up@4.1.0: - dependencies: - locate-path: 5.0.0 - path-exists: 4.0.0 - find-up@5.0.0: dependencies: locate-path: 6.0.0 @@ -4021,18 +3495,6 @@ snapshots: cross-spawn: 7.0.6 signal-exit: 4.1.0 - fs-extra@7.0.1: - dependencies: - graceful-fs: 4.2.11 - jsonfile: 4.0.0 - universalify: 0.1.2 - - fs-extra@8.1.0: - dependencies: - graceful-fs: 4.2.11 - jsonfile: 4.0.0 - universalify: 0.1.2 - fsevents@2.3.3: optional: true @@ -4074,17 +3536,6 @@ snapshots: globals@15.15.0: {} - globby@11.1.0: - dependencies: - array-union: 2.1.0 - dir-glob: 3.0.1 - fast-glob: 3.3.3 - ignore: 5.3.2 - merge2: 1.4.1 - slash: 3.0.0 - - graceful-fs@4.2.11: {} - graphemer@1.4.0: {} has-flag@4.0.0: {} @@ -4109,8 +3560,6 @@ snapshots: transitivePeerDependencies: - supports-color - human-id@4.1.1: {} - iconv-lite@0.6.3: dependencies: safer-buffer: 2.1.2 @@ -4142,12 +3591,6 @@ snapshots: is-potential-custom-element-name@1.0.1: {} - is-subdir@1.2.0: - dependencies: - better-path-resolve: 1.0.0 - - is-windows@1.0.2: {} - isexe@2.0.0: {} istanbul-lib-coverage@3.2.2: {} @@ -4189,11 +3632,6 @@ snapshots: js-tokens@9.0.1: {} - js-yaml@3.14.1: - dependencies: - argparse: 1.0.10 - esprima: 4.0.1 - js-yaml@4.1.0: dependencies: argparse: 2.0.1 @@ -4235,10 +3673,6 @@ snapshots: json5@2.2.3: {} - jsonfile@4.0.0: - optionalDependencies: - graceful-fs: 4.2.11 - keyv@4.5.4: dependencies: json-buffer: 3.0.1 @@ -4254,10 +3688,6 @@ snapshots: load-tsconfig@0.2.5: {} - locate-path@5.0.0: - dependencies: - p-locate: 4.1.0 - locate-path@6.0.0: dependencies: p-locate: 5.0.0 @@ -4266,8 +3696,6 @@ snapshots: lodash.sortby@4.7.0: {} - lodash.startcase@4.4.0: {} - longest-streak@3.1.0: {} loose-envify@1.4.0: @@ -4521,10 +3949,6 @@ snapshots: natural-compare@1.4.0: {} - node-fetch@2.7.0: - dependencies: - whatwg-url: 5.0.0 - node-releases@2.0.19: {} nwsapi@2.2.21: {} @@ -4540,38 +3964,16 @@ snapshots: type-check: 0.4.0 word-wrap: 1.2.5 - outdent@0.5.0: {} - - p-filter@2.1.0: - dependencies: - p-map: 2.1.0 - - p-limit@2.3.0: - dependencies: - p-try: 2.2.0 - p-limit@3.1.0: dependencies: yocto-queue: 0.1.0 - p-locate@4.1.0: - dependencies: - p-limit: 2.3.0 - p-locate@5.0.0: dependencies: p-limit: 3.1.0 - p-map@2.1.0: {} - - p-try@2.2.0: {} - package-json-from-dist@1.0.1: {} - package-manager-detector@0.2.11: - dependencies: - quansync: 0.2.11 - parent-module@1.0.1: dependencies: callsites: 3.1.0 @@ -4594,8 +3996,6 @@ snapshots: lru-cache: 11.1.0 minipass: 7.1.2 - path-type@4.0.0: {} - pathe@2.0.3: {} pathval@2.0.1: {} @@ -4606,8 +4006,6 @@ snapshots: picomatch@4.0.3: {} - pify@4.0.1: {} - pirates@4.0.7: {} pkg-types@1.3.1: @@ -4632,8 +4030,6 @@ snapshots: prelude-ls@1.2.1: {} - prettier@2.8.8: {} - prettier@3.6.2: {} pretty-bytes@5.6.0: {} @@ -4646,8 +4042,6 @@ snapshots: punycode@2.3.1: {} - quansync@0.2.11: {} - queue-microtask@1.2.3: {} react-dom@18.3.1(react@18.3.1): @@ -4664,13 +4058,6 @@ snapshots: dependencies: loose-envify: 1.4.0 - read-yaml-file@1.1.0: - dependencies: - graceful-fs: 4.2.11 - js-yaml: 3.14.1 - pify: 4.0.1 - strip-bom: 3.0.0 - readdirp@4.1.2: {} redent@3.0.0: @@ -4777,28 +4164,21 @@ snapshots: picocolors: 1.1.1 tinyglobby: 0.2.15 - slash@3.0.0: {} - source-map-js@1.2.1: {} source-map-support@0.5.21: dependencies: buffer-from: 1.1.2 source-map: 0.6.1 + optional: true - source-map@0.6.1: {} + source-map@0.6.1: + optional: true source-map@0.8.0-beta.0: dependencies: whatwg-url: 7.1.0 - spawndamnit@3.0.1: - dependencies: - cross-spawn: 7.0.6 - signal-exit: 4.1.0 - - sprintf-js@1.0.3: {} - stackback@0.0.2: {} std-env@3.9.0: {} @@ -4823,8 +4203,6 @@ snapshots: dependencies: ansi-regex: 6.2.0 - strip-bom@3.0.0: {} - strip-indent@3.0.0: dependencies: min-indent: 1.0.1 @@ -4851,14 +4229,13 @@ snapshots: symbol-tree@3.2.4: {} - term-size@2.2.1: {} - terser@5.43.1: dependencies: '@jridgewell/source-map': 0.3.11 acorn: 8.15.0 commander: 2.20.3 source-map-support: 0.5.21 + optional: true test-exclude@7.0.1: dependencies: @@ -4903,8 +4280,6 @@ snapshots: dependencies: tldts: 6.1.86 - tr46@0.0.3: {} - tr46@1.0.1: dependencies: punycode: 2.3.1 @@ -5047,8 +4422,6 @@ snapshots: unist-util-is: 6.0.0 unist-util-visit-parents: 6.0.1 - universalify@0.1.2: {} - update-browserslist-db@1.1.3(browserslist@4.25.2): dependencies: browserslist: 4.25.2 @@ -5233,8 +4606,6 @@ snapshots: dependencies: xml-name-validator: 5.0.0 - webidl-conversions@3.0.1: {} - webidl-conversions@4.0.2: {} webidl-conversions@7.0.0: {} @@ -5250,11 +4621,6 @@ snapshots: tr46: 5.1.1 webidl-conversions: 7.0.0 - whatwg-url@5.0.0: - dependencies: - tr46: 0.0.3 - webidl-conversions: 3.0.1 - whatwg-url@7.1.0: dependencies: lodash.sortby: 4.7.0 diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index 94ec0fb30..b4ea2a3e8 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -1,6 +1,5 @@ packages: - 'crates/bindings-typescript' - 'crates/bindings-typescript/test-app' - - 'sdks/typescript' - - 'sdks/typescript/examples/quickstart-chat' + - 'crates/bindings-typescript/examples/quickstart-chat' - 'docs' \ No newline at end of file diff --git a/sdks/typescript b/sdks/typescript new file mode 120000 index 000000000..7493d661a --- /dev/null +++ b/sdks/typescript @@ -0,0 +1 @@ +../crates/bindings-typescript \ No newline at end of file diff --git a/sdks/typescript/.changeset/README.md b/sdks/typescript/.changeset/README.md deleted file mode 100644 index e5b6d8d6a..000000000 --- a/sdks/typescript/.changeset/README.md +++ /dev/null @@ -1,8 +0,0 @@ -# Changesets - -Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works -with multi-package repos, or single-package repos to help you version and publish your code. You can -find the full documentation for it [in our repository](https://github.com/changesets/changesets) - -We have a quick list of common questions to get you started engaging with this project in -[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md) diff --git a/sdks/typescript/.changeset/config.json b/sdks/typescript/.changeset/config.json deleted file mode 100644 index 1aa0b7611..000000000 --- a/sdks/typescript/.changeset/config.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "$schema": "https://unpkg.com/@changesets/config@3.0.2/schema.json", - "changelog": [ - "@changesets/changelog-github", - { "repo": "clockworklabs/SpacetimeDB" } - ], - "commit": false, - "fixed": [], - "linked": [], - "access": "public", - "baseBranch": "main", - "updateInternalDependencies": "patch", - "ignore": [] -} diff --git a/sdks/typescript/.gitattributes b/sdks/typescript/.gitattributes deleted file mode 100644 index 0046e615f..000000000 --- a/sdks/typescript/.gitattributes +++ /dev/null @@ -1,2 +0,0 @@ -src/client_api/*.ts linguist-generated=true -examples/quickstart/client/src/module_bindings/*.ts linguist-generated=true diff --git a/sdks/typescript/.github/workflows/cr.yml b/sdks/typescript/.github/workflows/cr.yml deleted file mode 100644 index 44c4c9884..000000000 --- a/sdks/typescript/.github/workflows/cr.yml +++ /dev/null @@ -1,24 +0,0 @@ -name: Continuous Releases - -on: [push, pull_request] - -jobs: - test: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-node@v4 - with: - node-version: 18 - - - uses: pnpm/action-setup@v4 - with: - version: 9.7 - run_install: true - - - name: Build - run: pnpm build - - - name: Release - run: cd packages/sdk && pnpm dlx pkg-pr-new publish --compact --pnpm diff --git a/sdks/typescript/.github/workflows/release.yml b/sdks/typescript/.github/workflows/release.yml deleted file mode 100644 index 951428896..000000000 --- a/sdks/typescript/.github/workflows/release.yml +++ /dev/null @@ -1,40 +0,0 @@ -name: Publish -on: - push: - branches: - - 'main' - -concurrency: ${{ github.workflow }}-${{ github.ref }} - -jobs: - publish: - runs-on: ubuntu-latest - permissions: - id-token: write - contents: write - packages: write - pull-requests: write - issues: read - steps: - - uses: actions/checkout@v4 - - - uses: pnpm/action-setup@v4 - with: - version: 9.7 - run_install: true - - - uses: actions/setup-node@v4 - with: - node-version: 18.x - cache: 'pnpm' - - - run: pnpm build - - - name: Create Release Pull Request or Publish - id: changesets - uses: changesets/action@v1 - with: - publish: pnpm run ci:release - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - NPM_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/sdks/typescript/.github/workflows/repo-migration-notice.yml b/sdks/typescript/.github/workflows/repo-migration-notice.yml deleted file mode 100644 index e15168008..000000000 --- a/sdks/typescript/.github/workflows/repo-migration-notice.yml +++ /dev/null @@ -1,60 +0,0 @@ -name: Repo migration notice - -on: - issues: - types: [opened] - pull_request: - types: [opened] - -jobs: - comment: - runs-on: ubuntu-latest - - steps: - - name: Add comment - uses: actions/github-script@v7 - env: - migrated_repo: https://github.com/ClockworkLabs/SpacetimeDB - migrated_path: sdks/typescript - default_branch: main - with: - script: | - const isPR = context.eventName === 'pull_request'; - const number = isPR ? context.payload.pull_request.number : context.payload.issue.number; - - let message; - if (isPR) { - message = ` - Thank you for submitting this! - - We are in the process of migrating this repository (see [DEVELOP.md](../blob/${process.env.default_branch}/DEVELOP.md)). - - To make sure we see your PR, please open it in the [SpacetimeDB](${process.env.migrated_repo}) repo, under [${process.env.migrated_path}](${process.env.migrated_repo}/tree/master/${process.env.migrated_path}). - - Apologies for the inconvenience, and thank you again! - `; - } else { - message = ` - Thank you for submitting this! - - We are in the process of migrating this repository (see [DEVELOP.md](../blob/${process.env.default_branch}/DEVELOP.md)). - - To make sure we actually see your issue, please open it here: [SpacetimeDB/issues/new](${process.env.migrated_repo}/issues/new). - - Apologies for the inconvenience, and thank you again! - `; - } - - await github.rest.issues.createComment({ - owner: context.repo.owner, - repo: context.repo.repo, - issue_number: number, - body: message - }); - - await github.rest.issues.update({ - owner: context.repo.owner, - repo: context.repo.repo, - issue_number: number, - state: 'closed' - }); diff --git a/sdks/typescript/.vscode/settings.json b/sdks/typescript/.vscode/settings.json deleted file mode 100644 index d9546cfe0..000000000 --- a/sdks/typescript/.vscode/settings.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "workbench.colorCustomizations": { - "[Material Theme Darker]": {}, - "minimap.background": "#00000000", - "scrollbar.shadow": "#00000000" - } -} diff --git a/sdks/typescript/CHANGELOG.md b/sdks/typescript/CHANGELOG.md deleted file mode 100644 index 787f1c646..000000000 --- a/sdks/typescript/CHANGELOG.md +++ /dev/null @@ -1,90 +0,0 @@ -# Changelog - -## 1.2.0 - -### Patch Changes - -- [#176](https://github.com/clockworklabs/spacetimedb-typescript-sdk/pull/176) [`941cf4e`](https://github.com/clockworklabs/spacetimedb-typescript-sdk/commit/941cf4eba6b7df934d74696b373b89cc62764673) Thanks [@BastianGanze](https://github.com/BastianGanze)! - Make ws connection fail when token is invalid - -## 1.0.0-rc1.0 - -### Major Changes - -- [#116](https://github.com/clockworklabs/spacetimedb-typescript-sdk/pull/116) [`9032269`](https://github.com/clockworklabs/spacetimedb-typescript-sdk/commit/9032269004d4dae587c39ccd85da0a32fb9a0114) Thanks [@PuruVJ](https://github.com/PuruVJ)! - Enter RC - -- [#117](https://github.com/clockworklabs/spacetimedb-typescript-sdk/pull/117) [`5d7304b`](https://github.com/clockworklabs/spacetimedb-typescript-sdk/commit/5d7304bd3e05dd7a032cfb7069aab97b881f0179) Thanks [@PuruVJ](https://github.com/PuruVJ)! - feat: Switch to GZIP compression by default - -### Minor Changes - -- [#110](https://github.com/clockworklabs/spacetimedb-typescript-sdk/pull/110) [`a501f5c`](https://github.com/clockworklabs/spacetimedb-typescript-sdk/commit/a501f5ccf9a0a926eb4f345ddeb01ffcb872d67e) Thanks [@Centril](https://github.com/Centril)! - Support light tx updates via builder.with*light_mode(*) and the call flag NoSuccessNotify - -- [#119](https://github.com/clockworklabs/spacetimedb-typescript-sdk/pull/119) [`6547882`](https://github.com/clockworklabs/spacetimedb-typescript-sdk/commit/6547882bb28ed9a1ca436335745e9997328026ff) Thanks [@kazimuth](https://github.com/kazimuth)! - Update Identity and Address to use bigints rather than byte arrays (see https://github.com/clockworklabs/SpacetimeDB/pull/1616) - -### Patch Changes - -- [#109](https://github.com/clockworklabs/spacetimedb-typescript-sdk/pull/109) [`cf7b7d8`](https://github.com/clockworklabs/spacetimedb-typescript-sdk/commit/cf7b7d89a1547fb3863f6641f5b2eb40a27c05d8) Thanks [@PuruVJ](https://github.com/PuruVJ)! - fix: websocket message handling, Buffer, onConnect - -## 0.12.1 - -### Patch Changes - -- [#107](https://github.com/clockworklabs/spacetimedb-typescript-sdk/pull/107) [`2f6c82c`](https://github.com/clockworklabs/spacetimedb-typescript-sdk/commit/2f6c82c724b9f9407c7bedee13252ca8ffab8f7d) Thanks [@PuruVJ](https://github.com/PuruVJ)! - fix: websocket message handling, Buffer, onConnect - -- [#108](https://github.com/clockworklabs/spacetimedb-typescript-sdk/pull/108) [`b9db9b6`](https://github.com/clockworklabs/spacetimedb-typescript-sdk/commit/b9db9b6e46d8c98b29327d97c12c07b7a2fc96bf) Thanks [@PuruVJ](https://github.com/PuruVJ)! - docs: Public facing docs for 0.12 - -- [#105](https://github.com/clockworklabs/spacetimedb-typescript-sdk/pull/105) [`79c278b`](https://github.com/clockworklabs/spacetimedb-typescript-sdk/commit/79c278be71b2dfd82106ada983fd81d395b1d912) Thanks [@PuruVJ](https://github.com/PuruVJ)! - fix: temporary token path invocation - -## 0.12.0 - -### Minor Changes - -- [#92](https://github.com/clockworklabs/spacetimedb-typescript-sdk/pull/92) [`ab1f463`](https://github.com/clockworklabs/spacetimedb-typescript-sdk/commit/ab1f463d7da6e530a6cd47e2433141bfd16addd1) Thanks [@PuruVJ](https://github.com/PuruVJ)! - breaking: Flatten AlgebraicType & Simplify some codegen - -- [#102](https://github.com/clockworklabs/spacetimedb-typescript-sdk/pull/102) [`b8c944c`](https://github.com/clockworklabs/spacetimedb-typescript-sdk/commit/b8c944cd23d3b53c72131803a775127bf0a95213) Thanks [@cloutiertyler](https://github.com/cloutiertyler)! - internal: Remove global instance, allow multiple connections - -### Patch Changes - -- [#91](https://github.com/clockworklabs/spacetimedb-typescript-sdk/pull/91) [`5adb557`](https://github.com/clockworklabs/spacetimedb-typescript-sdk/commit/5adb55776c81d0760cf0268df0fa5dee600f0ef8) Thanks [@PuruVJ](https://github.com/PuruVJ)! - types: Allow autocomplete in .on and .off types - -- [#96](https://github.com/clockworklabs/spacetimedb-typescript-sdk/pull/96) [`17227c0`](https://github.com/clockworklabs/spacetimedb-typescript-sdk/commit/17227c0f65def3a9d5e767756ccf46777210041a) Thanks [@PuruVJ](https://github.com/PuruVJ)! - (fix) Synchronous WS Processing - -## [0.8.0](https://github.com/clockworklabs/spacetimedb-typescript-sdk/compare/0.7.2...0.8.0) (2023-12-11) - -### Bug Fixes - -- Properly use BigInt for any numbers bigger than 32 bits -- Fix generating primary key names to be camel case - -### Features - -- Added ability to start multiple SpacetimeDB clients. New clients will have a separate ClientDB -- Changed the return type of functions returning table records - now they are arras instead of iterators -- Reducer callbacks have args passed in separately, which makes it easier to know what types they are - For example a reducer taking a single string argument will have a callback signature like `(reducerEvent: ReducerEvent, name: string)` - instead of `(reducerEvent: ReducerEvent, args: any[])` -- We now require explicitly registering any tables or reducers with `SpacetimeDBClient.registerReducers()` and `SpacetimeDBClient.registerTables()`. - This also allows to register child classes, which in turn allows to use customized table classes. We will add more info - on how to do it in the future. This makes it also harder to run into weird issues. If you only import a reducer, but not use - it to set any callbacks, Node.js will filter out the import. If you then subscribe to a table SpacetimeDBClient will be unable - to find the reducer. To ensure this is not happening people were adding a `console.log` statement listing and used classes to - stop Node.js from filtering out any imports, like `console.log(SayHelloReducer)`. Now with the reducer call it's more explicit -- In this release we have also moved some methods from generated types into the SDK, which should result in a smaller footprint from - generated classes -- Generated sum types are now easier to use. For sum types without any values you can use their type name as value, for example given an - enum in Rust: - - ```rust - enum UserRole { - Admin, - Moderator, - User, - Other(String) - } - ``` - - you can now use types itself as values. For example given a reducer for setting a role you could now do the following in TypeScript: - - ```typescript - SetRoleReducer.call(UserRole.Admin); - SetRoleReducer.call(UserRole.Other('another role')); - ``` diff --git a/sdks/typescript/DEVELOP.md b/sdks/typescript/DEVELOP.md deleted file mode 100644 index a533def1b..000000000 --- a/sdks/typescript/DEVELOP.md +++ /dev/null @@ -1,47 +0,0 @@ -# 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). -This is not automated. -Whenever the `client-api-messages` crate changes, you'll have to manually re-generate the definitions. -See that crate's DEVELOP.md for how to do this. - -The generated files must be manually modified to fix their imports from the rest of the SDK. - -Within each generated file: - -- Change the import from `"@clockworklabs/spacetimedb-sdk"` to `"../index"`. - -On a mac, you can do that by running this in the directory: `find . -type f -exec sed -i '' 's/"@clockworklabs\/spacetimedb-sdk"/"..\/index"/g' {} \;`. - -## Releases and publishing - -Every Pull Request with a public-facing change (Bug fix, perf, feature etc) must be accompanied by a changeset. Any person working on a patch or feature needs to run `pnpm -w changeset` command, which will prompt them to select packages changed. Choose `@clockworklabs/spacetimedb-sdk` - -![image](https://github.com/user-attachments/assets/3a69ff1f-c92b-459a-8dcc-d8fea53f77b4) - -Next it will ask whether you'd like to add a Major tag to it. Hit enter to go to minor tag. If its a minor change(In our case, minor is major until v1 comes out, as in every minor can have breaking changes). If its a patch change(Or minor for prerelease time), then again hit enter - -After selecting the correct tag, it will ask you for a message - -![image](https://github.com/user-attachments/assets/d05a338b-965d-4669-8155-542d0225b257) -![image](https://github.com/user-attachments/assets/7abc830e-4590-42e7-bce8-86155d86c672) -![image](https://github.com/user-attachments/assets/8f3b16bd-b01d-4117-8d02-3887f1d308dd) - -Once that is done, hit enter. It will generate a `.md` file which you can then push to github. This all has to be done in the PR with the feature/fix in it. - -We can merge it instantly to do a release, or we can merge PRs with their own Changesets. E.g. Any new feature or patch we work on for 1.0 now, should have a Changeset in it. All of these will accumulate in the "Version Packages" PR. Once all these are satisfactorily done, we merge this PR, which will - -- Release the package on npm -- Release on Github tags -- Update CHANGELOG.md - -**NOTE: It is very important that no one manually runs `npm publish`. We have provenance enabled on this package, means each version will be signed by github and traceable to the very commit associated to it** - -Publishing manually will breach the provenance contract, and alert security servcies like Snyk into investigating the package or issuing a warning. npm install of our package will also warn them of potential compromise to the package - -![image](https://github.com/user-attachments/assets/b56282b7-9055-48a0-8a49-3df9d75d481f) -![image](https://github.com/user-attachments/assets/99d023cf-31cc-48a0-93ed-a88c326425c5) diff --git a/sdks/typescript/LICENSE.txt b/sdks/typescript/LICENSE.txt deleted file mode 120000 index 51a4020f5..000000000 --- a/sdks/typescript/LICENSE.txt +++ /dev/null @@ -1 +0,0 @@ -../../../../licenses/apache2.txt \ No newline at end of file diff --git a/sdks/typescript/README.md b/sdks/typescript/README.md deleted file mode 100644 index 62068de7d..000000000 --- a/sdks/typescript/README.md +++ /dev/null @@ -1,73 +0,0 @@ -## SpacetimeDB SDK - -### Overview - -This repository contains the TypeScript SDK for SpacetimeDB. The SDK allows to interact with the database server and is prepared to work with code generated from a SpacetimeDB backend code. - -### Installation - -The SDK is an NPM package, thus you can use your package manager of choice like NPM or Yarn, for example: - -``` -npm install --save @clockworklabs/spacetimedb-sdk -``` - -You can use the package in the browser, using a bundler like vite/parcel/rsbuild, in server-side applications like NodeJS, Deno, Bun and in Cloudflare Workers. - -> NOTE: For usage in NodeJS 18-21, you need to install the `undici` package as a peer dependency: `npm install @clockworklabs/spacetimedb-sdk undici`. Node 22 and later are supported out of the box. - -### Usage - -In order to connect to a database you have to generate module bindings for your database. - -```ts -import { DbConnection } from './module_bindings'; - -const connection = DbConnection.builder() - .withUri('ws://localhost:3000') - .withModuleName('MODULE_NAME') - .onDisconnect(() => { - console.log('disconnected'); - }) - .onConnectError(() => { - console.log('client_error'); - }) - .onConnect((connection, identity, _token) => { - console.log( - 'Connected to SpacetimeDB with identity:', - identity.toHexString() - ); - - connection.subscriptionBuilder().subscribe('SELECT * FROM player'); - }) - .withToken('TOKEN') - .build(); -``` - -If for some reason you need to disconnect the client: - -```ts -connection.disconnect(); -``` - -Typically, you will use the SDK with types generated from a backend DB service. For example, given a table named `Player` you can subscribe to player updates like this: - -```ts -connection.db.player.onInsert((ctx, player) => { - console.log(player); -}); -``` - -Given a reducer called `CreatePlayer` you can call it using a call method: - -```ts -connection.reducers.createPlayer(); -``` - -### Developer notes - -To run the tests, do: - -```sh -pnpm build && pnpm test -``` diff --git a/sdks/typescript/examples/quickstart-chat/src/vite-env.d.ts b/sdks/typescript/examples/quickstart-chat/src/vite-env.d.ts deleted file mode 100644 index 11f02fe2a..000000000 --- a/sdks/typescript/examples/quickstart-chat/src/vite-env.d.ts +++ /dev/null @@ -1 +0,0 @@ -/// diff --git a/sdks/typescript/package.json b/sdks/typescript/package.json deleted file mode 100644 index daa1f5036..000000000 --- a/sdks/typescript/package.json +++ /dev/null @@ -1,93 +0,0 @@ -{ - "name": "@clockworklabs/spacetimedb-sdk", - "version": "1.3.1", - "description": "SDK for SpacetimeDB", - "author": { - "name": "Clockwork Labs", - "email": "no-reply@clockworklabs.io" - }, - "keywords": [ - "spacetime", - "spacetimedb", - "database", - "react", - "state", - "realtime", - "websocket", - "serverless" - ], - "types": "./src/index.ts", - "main": "./dist/index.js", - "module": "./dist/index.js", - "browser": "./dist/browser/index.js", - "type": "module", - "files": [ - "dist" - ], - "exports": { - ".": { - "types": "./src/index.ts", - "browser": "./dist/browser/index.js", - "import": "./dist/index.js", - "default": "./dist/index.js" - }, - "./react": { - "types": "./src/react/index.ts", - "browser": "./dist/browser/react/index.js", - "import": "./dist/react/index.js", - "default": "./dist/react/index.js" - }, - "./package.json": "./package.json" - }, - "sideEffects": false, - "scripts": { - "changeset": "changeset", - "ci:release": "changeset publish", - "ci:version": "changeset version", - "format": "prettier . --write --ignore-path ../../.prettierignore", - "build": "tsup", - "lint": "eslint . && prettier . --check --ignore-path ../../.prettierignore", - "test": "pnpm build && vitest run", - "generate": "cargo build -p spacetimedb-standalone && cargo run -p spacetimedb-client-api-messages --example get_ws_schema > ws_schema.json && cargo run -p spacetimedb-cli generate --lang typescript --out-dir src/client_api --module-def ws_schema.json && rm ws_schema.json && find src/client_api -type f -exec perl -pi -e 's#\\@clockworklabs/spacetimedb-sdk#../index#g' {} + && prettier --write src/client_api", - "size": "brotli-size dist/min/index.js" - }, - "repository": { - "type": "git", - "url": "https://github.com/clockworklabs/spacetimedb-typescript-sdk" - }, - "publishConfig": { - "provenance": true - }, - "engines": { - "node": ">=18.0.0", - "pnpm": ">=9.0.0" - }, - "peerDependencies": { - "react": "^18.0.0 || ^19.0.0-0 || ^19.0.0", - "undici": "^6.19.2" - }, - "peerDependenciesMeta": { - "react": { - "optional": true - }, - "undici": { - "optional": true - } - }, - "devDependencies": { - "@changesets/changelog-github": "^0.5.0", - "@changesets/cli": "^2.27.7", - "brotli-size-cli": "^1.0.0", - "terser": "^5.31.2", - "tsx": "^4.17.0", - "typescript": "^5.5.3", - "@types/react": "^19.1.13", - "prettier": "^3.3.3", - "tsup": "^8.1.0", - "vite": "^7.1.5", - "vitest": "^3.2.4" - }, - "dependencies": { - "spacetimedb": "workspace:^" - } -} diff --git a/sdks/typescript/src/index.ts b/sdks/typescript/src/index.ts deleted file mode 100644 index caf38140c..000000000 --- a/sdks/typescript/src/index.ts +++ /dev/null @@ -1,11 +0,0 @@ -export * from 'spacetimedb/sdk'; -export type * from 'spacetimedb/sdk'; -export { - AlgebraicType, - ConnectionId, - Identity, - TimeDuration, - Timestamp, - deepEqual, - type AlgebraicTypeVariants, -} from 'spacetimedb'; diff --git a/sdks/typescript/src/react/index.ts b/sdks/typescript/src/react/index.ts deleted file mode 100644 index a1eb0345f..000000000 --- a/sdks/typescript/src/react/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from 'spacetimedb/react'; -export type * from 'spacetimedb/react'; diff --git a/sdks/typescript/tests/index.test.ts b/sdks/typescript/tests/index.test.ts deleted file mode 100644 index 67babfaa6..000000000 --- a/sdks/typescript/tests/index.test.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { describe, it } from 'vitest'; -import type { IdentityTokenMessage } from 'spacetimedb/sdk'; -import { ConnectionId, Identity } from 'spacetimedb'; - -describe('spacetimedb', () => { - it('imports something from the spacetimedb sdk', () => { - const _msg: IdentityTokenMessage = { - tag: 'IdentityToken', - identity: Identity.fromString( - '0xc200000000000000000000000000000000000000000000000000000000000000' - ), - token: 'some-token', - connectionId: ConnectionId.fromString( - '0x00000000000000000000000000000000' - ), - }; - }); -}); diff --git a/sdks/typescript/tsconfig.json b/sdks/typescript/tsconfig.json deleted file mode 100644 index 27009e439..000000000 --- a/sdks/typescript/tsconfig.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "compilerOptions": { - "target": "ESNext", - "module": "ESNext", - "declaration": true, - "emitDeclarationOnly": false, - "noEmit": true, - "esModuleInterop": true, - "skipLibCheck": true, - "forceConsistentCasingInFileNames": true, - "verbatimModuleSyntax": true, - "allowImportingTsExtensions": true, - "strict": true, - "noImplicitAny": false, - "moduleResolution": "Bundler", - "allowSyntheticDefaultImports": true, - "isolatedDeclarations": true, - "isolatedModules": true, - "jsx": "react-jsx", - - "baseUrl": ".", - "paths": { - "spacetimedb": ["../../crates/bindings-typescript/src/index.ts"] - } - }, - "include": ["src/**/*", "tests/**/*", "tsup.config.ts", "vitest.config.ts"], - "exclude": ["node_modules", "**/__tests__/*", "dist/**/*"] -} diff --git a/sdks/typescript/tsup.config.ts b/sdks/typescript/tsup.config.ts deleted file mode 100644 index 57ca6299a..000000000 --- a/sdks/typescript/tsup.config.ts +++ /dev/null @@ -1,104 +0,0 @@ -import { defineConfig, type Options } from 'tsup'; - -function commonEsbuildTweaks() { - return (options: any) => { - // Prefer "exports"."source" when deps provide it; harmless otherwise. - options.conditions = ['source', 'import', 'default']; - options.mainFields = ['browser', 'module', 'main']; - }; -} - -export default defineConfig([ - // ESM wrapper -> dist/index.js - { - entry: { index: 'src/index.ts' }, - format: ['esm'], - target: 'es2022', - outDir: 'dist', - dts: false, // types come from ./src in package.json - sourcemap: true, - clean: true, - platform: 'neutral', - noExternal: ['spacetimedb'], - treeshake: 'smallest', - external: ['undici'], - esbuildOptions: commonEsbuildTweaks(), - }, - - // Browser-flavored wrapper -> dist/browser/index.js - { - entry: { index: 'src/index.ts' }, - format: ['esm'], - target: 'es2022', - outDir: 'dist/browser', - dts: false, - sourcemap: true, - clean: true, - platform: 'browser', - noExternal: ['spacetimedb'], - treeshake: 'smallest', - external: ['undici'], - esbuildOptions: commonEsbuildTweaks(), - }, - - // The below minified builds are not referenced in package.json and are - // just included in the build for measuring the size impact of minification. - // It is expected that consumers of the library will run their own - // minification as part of their app bundling process. - - // Minified browser build -> dist/min/index.js - { - entry: { index: 'src/index.ts' }, - format: ['esm'], - target: 'es2022', - outDir: 'dist/min', - dts: false, - sourcemap: true, - minify: 'terser', - platform: 'browser', - noExternal: ['spacetimedb'], - treeshake: 'smallest', - external: ['undici'], - esbuildOptions: commonEsbuildTweaks(), - }, - - // React subpath (SSR-friendly) -> dist/react/index.js - { - entry: { index: 'src/react/index.ts' }, - format: ['esm'], - target: 'es2022', - outDir: 'dist/react', - dts: false, // wrapper doesn't own .d.ts; package.json points to src - sourcemap: true, - clean: true, - platform: 'neutral', - noExternal: ['spacetimedb'], - treeshake: 'smallest', - esbuildOptions: commonEsbuildTweaks(), - }, - - // React subpath (browser) -> dist/browser/react/index.js - { - entry: { index: 'src/react/index.ts' }, - format: ['esm'], - target: 'es2022', - outDir: 'dist/browser/react', - dts: false, - sourcemap: true, - clean: true, - platform: 'browser', - noExternal: ['spacetimedb'], - treeshake: 'smallest', - esbuildOptions: commonEsbuildTweaks(), - }, -]) satisfies - | Options - | Options[] - | (( - overrideOptions: Options - ) => Options | Options[] | Promise) as - | Options - | Options[] - | (( - overrideOptions: Options - ) => Options | Options[] | Promise); diff --git a/sdks/typescript/vitest.config.ts b/sdks/typescript/vitest.config.ts deleted file mode 100644 index 9f06f6330..000000000 --- a/sdks/typescript/vitest.config.ts +++ /dev/null @@ -1,24 +0,0 @@ -import type { UserConfig } from 'vite'; -import { defineConfig } from 'vitest/config'; - -export default defineConfig({ - test: { - environment: 'node', - include: ['tests/**/*.test.ts'], - deps: { - external: ['spacetimedb'], - }, - }, - resolve: { - // Prefer source in dev *if your SDK exposes "source" in exports*. - // Otherwise omit "source". - conditions: ['source', 'development', 'node', 'import', 'default'], - mainFields: ['module', 'main', 'browser'], - preserveSymlinks: false, - extensions: ['.ts', '.tsx', '.mjs', '.js', '.json'], - }, - optimizeDeps: { - esbuildOptions: { conditions: ['source', 'import', 'module', 'default'] }, - exclude: ['spacetimedb'], - }, -}) satisfies UserConfig as UserConfig; diff --git a/tsconfig.json b/tsconfig.json index 632df90e9..4a6045f35 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -3,8 +3,7 @@ "references": [ { "path": "crates/bindings-typescript" }, { "path": "crates/bindings-typescript/test-app" }, + { "path": "crates/bindings-typescript/examples/quickstart-chat" }, { "path": "docs" }, - { "path": "sdks/typescript" }, - { "path": "sdks/typescript/examples/quickstart-chat" }, ] } \ No newline at end of file