Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
166 commits
Select commit Hold shift + click to select a range
8e5887d
initial commit
drogus Mar 10, 2023
a1f6284
Make arrays work
drogus Mar 10, 2023
f5ba82d
Add tests for AlgebraicValue
drogus Mar 13, 2023
a362a2c
Implement deserializing byte arrays and deserialize data for cache
drogus Mar 14, 2023
ae6d097
Add reducer events, add globals
drogus Mar 15, 2023
8e2cd50
Set package name to spacetimedb-typescript-sdk
drogus Mar 15, 2023
b87c11e
Properly export stuff
drogus Mar 16, 2023
c45efb5
Remove unneeded file
drogus Mar 16, 2023
6a4b547
Export ProductValue
drogus Mar 16, 2023
c608939
Lots of changes
drogus Mar 22, 2023
5545b94
Fix registering components and fix for in-browser
drogus Mar 22, 2023
7e3403f
Delete main.ts
drogus Mar 22, 2023
3bbab24
Add dist/ to .gitignore
drogus Mar 22, 2023
63b3152
Add .npmignore
drogus Mar 22, 2023
1359206
Add onConnect event
drogus Mar 23, 2023
c20250a
Bump to 0.1.0
drogus Mar 23, 2023
8d277e2
Bump to 0.1.1
drogus Mar 23, 2023
fc1224a
Rework window/global, simplify config
drogus Mar 23, 2023
1c3678e
Remove unneeded file
drogus Mar 24, 2023
682f869
Updatre description and repo settings
drogus Mar 27, 2023
6fd722e
Add README.md
drogus Mar 27, 2023
1020601
Fixing small typos
jdetter Mar 28, 2023
337316b
Add asBoolean methods working the same as asBool
drogus Mar 29, 2023
658ee19
Allow to include protocol in the host
drogus Mar 29, 2023
6a53016
Bump version
drogus Mar 29, 2023
cfa4532
Changed connection to connect()
NateTheDev1 Mar 29, 2023
818e15a
Added helper text for users
NateTheDev1 Mar 29, 2023
93feb5c
Merge pull request #1 from clockworklabs/drogus/readme
NateTheDev1 Mar 29, 2023
8be8787
:Merge branch 'main' into client-additions
NateTheDev1 Mar 29, 2023
843d810
Added a disconnect method
NateTheDev1 Mar 30, 2023
c9d5e43
Fixed module to also work with react modules
NateTheDev1 Mar 30, 2023
63e5060
Finished upA
NateTheDev1 Mar 30, 2023
02cf96c
Merge pull request #2 from clockworklabs/client-additions
NateTheDev1 Mar 31, 2023
41d9542
Updating documentation
NateTheDev1 Mar 31, 2023
f592a4c
Merge pull request #3 from clockworklabs/docs-update-1
NateTheDev1 Mar 31, 2023
5be8254
Change package name to spacetimedb-sdk
drogus Apr 11, 2023
00d7aec
Change package name to spacetimedb-sdk and bump to 0.2.0
drogus Apr 11, 2023
9092f77
Add client.subscribe() method
drogus Apr 12, 2023
535ae3d
Bump to 0.3.0
drogus Apr 13, 2023
1e52e71
Add some client tests (#5)
drogus Apr 13, 2023
9e22228
Prettier + husky + pretty-quick (#6)
drogus Apr 13, 2023
84ccf87
Add test workflow (#7)
drogus Apr 13, 2023
7b1eb1b
New address for subscribing
drogus May 16, 2023
00782f2
Bump version to 0.4.0
drogus May 16, 2023
9372209
Change version to 0.4.0-alpha
drogus May 23, 2023
3b46880
0.4.0-next.0
drogus Jun 1, 2023
db88ced
Fix reducers callbacks
drogus Jun 20, 2023
7635d8b
Fix identity deserialize (#8)
dbrinkmanncw Jun 26, 2023
44ac415
Add support for update (#9)
drogus Jun 29, 2023
04885fe
Add reducer event to callbacks (#10)
drogus Jun 29, 2023
a2c966a
Changed sdk to commonjs target to work with node and react
NateTheDev1 Jul 5, 2023
4983859
Fixed external package problems with this configuration
NateTheDev1 Jul 6, 2023
fa12415
Added manual ws table connectors
NateTheDev1 Jul 7, 2023
fe2688c
Merge pull request #12 from clockworklabs/ws-manual
NateTheDev1 Jul 10, 2023
e5b0ebf
Added PR template (#13)
jdetter Jul 13, 2023
a6ec96e
Allow to use binary format (#11)
drogus Jul 13, 2023
395c0a0
Bump to 0.5.0
drogus Jul 18, 2023
e2e64ed
Fix issue with modules
drogus Jul 18, 2023
139844d
Change debug use of the reducer name
drogus Jul 19, 2023
07f78ba
Bump to 0.5.2
drogus Jul 19, 2023
bf7c9f7
Change Identity from UInt8Array to Identity to match other SDKs (#14)
dbrinkmanncw Aug 1, 2023
4bb7d18
Bump version to 0.6.0
drogus Aug 3, 2023
820e3a4
Mamcx/typescript sdk reference (#17)
mamcx Aug 3, 2023
be95229
Fix reducer event argument being undefined if the reducer fails. (#18)
dbrinkmanncw Aug 8, 2023
24ed99b
Fix bsatn serialization. It was adding an extra 0 to the end of the b…
dbrinkmanncw Aug 16, 2023
1436609
Bump version to 0.6.1
drogus Aug 8, 2023
219c3b6
Fix auth in the browser (#20)
drogus Aug 17, 2023
a56ea25
Remove protobufjs from devDependencies
jkbz64 Sep 2, 2023
9a4e8f1
TypescriptSDK quickstart example (#15)
dbrinkmanncw Sep 21, 2023
0980659
Add LICENSE.txt (#22)
dbrinkmanncw Oct 2, 2023
a0c5fa4
Bump package version to 0.6.2
drogus Sep 5, 2023
09eb7e4
Fix onUpdate when PK is of type Identity (#25)
drogus Oct 6, 2023
13d9ed9
Client address support for TypeScript SDK (#23)
gefjon Oct 12, 2023
6bd0e2d
Fix Identity serialization/deserialization (#26)
drogus Oct 12, 2023
a7a4db3
Bump version to 0.7.0
drogus Nov 7, 2023
7514724
Fix identity constructor (#28)
drogus Nov 7, 2023
ff988ac
Bump version to 0.7.1
drogus Nov 7, 2023
d63621d
Bump to 0.7.2
drogus Nov 7, 2023
8f83692
Changes required for SpacetimeDB 0.8 + improvements (#29)
drogus Dec 11, 2023
16f4d9c
Bump version to 0.8.0
drogus Dec 11, 2023
329174a
Add changelog
drogus Dec 11, 2023
0297abe
Fix type returned by DatabaseTable.with method (#30)
drogus Dec 15, 2023
bd32a4e
Bump version to 0.8.1
drogus Dec 15, 2023
41d679b
Merge pull request #21 from jkbz64/fix/protobuf-dev
NateTheDev1 Feb 16, 2024
d7a7586
Remove row_pk from the client API (#34)
gefjon Feb 28, 2024
bc5f4c9
Cleaned up code and added better error handling and responses for inv…
NateTheDev1 Mar 12, 2024
5a39592
Bump to 0.8.2
drogus Mar 12, 2024
f02c3bd
Fix issue where some Typescript based project transpiler might mangle…
hsreina Mar 12, 2024
acecc52
brotli-decompress received binary websocket messages (#41)
gefjon Mar 29, 2024
3a1dd4c
Drogus/big int to bigint (#37)
drogus May 2, 2024
51509aa
Bump to 0.9.0
drogus May 2, 2024
af01eff
Bump version to 0.10.0 (#44)
bfops Jun 13, 2024
5a780eb
Nuke protobuf and also JSON in favor of BSATN (#47)
gefjon Jul 15, 2024
1e1025c
Bump version to 0.11.0
Jul 19, 2024
585cbb6
Merge pull request #60 from clockworklabs/version/0.11.0
bfops Aug 1, 2024
08c2e8d
flatten AlgebraicType & simplify some codegen
Centril Aug 6, 2024
eb3d52d
0.11.0 release changes
drogus Aug 7, 2024
d6daef8
Fix: synchronous ws processing (#66)
tcardlab Aug 14, 2024
a7b9810
Merge branch 'main' into centril/flatten-at
PuruVJ Aug 19, 2024
e730b53
Merge pull request #62 from clockworklabs/centril/flatten-at
Centril Aug 19, 2024
e4fc463
Modernize (#52)
PuruVJ Aug 21, 2024
19dcf58
fix: Release action (#89)
PuruVJ Aug 21, 2024
4071c3b
fix: Remove registry (#90)
PuruVJ Aug 21, 2024
ec24641
fix: .on and .off types (#91)
PuruVJ Aug 21, 2024
07eb12c
docs: Publishing and release (#94)
PuruVJ Aug 21, 2024
8d664fd
Add changeset for #62 (#92)
PuruVJ Aug 21, 2024
ea461c7
feat: changelog-github (#95)
PuruVJ Aug 21, 2024
5ae2742
chore: Changeset #66 (#96)
PuruVJ Aug 22, 2024
d64a5db
Tyler's Stable SDK API implementation (#102)
cloutiertyler Oct 3, 2024
2ece7b3
Small change to API
cloutiertyler Oct 4, 2024
9082301
Merge pull request #103 from clockworklabs/tyler/stable-sdk/fix-1
bfops Oct 4, 2024
a7abfc5
Version Packages (#93)
github-actions[bot] Oct 4, 2024
dfea67d
fix: temporary token path invocation (#105)
PuruVJ Oct 8, 2024
0668ba0
docs: 0.12 public facing docs (#108)
PuruVJ Oct 8, 2024
684ba04
fix: websocket message handling, Buffer, onConnect (#107)
PuruVJ Oct 8, 2024
06e461b
Version Packages (#106)
github-actions[bot] Oct 8, 2024
49b9522
Update DEVELOP.md (#111)
cloutiertyler Oct 16, 2024
a46522e
feat: GZIP (#109)
PuruVJ Oct 23, 2024
8295119
Enter prerelease mode (#116)
PuruVJ Oct 23, 2024
e64d29e
Add gzip for #109 (#117)
PuruVJ Oct 23, 2024
7e111bc
Update Identity and Address to use bigints rather than byte arrays (#…
kazimuth Nov 4, 2024
bdc147e
Update readme for rc1.0 (#123)
PuruVJ Nov 6, 2024
9fc6abf
Companion to SpacetimeDB#1812 (light tx, ts) (#110)
Centril Nov 6, 2024
172d992
Version Packages (rc1) (#115)
github-actions[bot] Nov 6, 2024
5195a24
Amend `withCredentials` to `withToken` (#128)
gefjon Jan 22, 2025
d6147b0
Add `subscribeToAllTables` method (#129)
gefjon Jan 24, 2025
fa25bed
Updated the quickstart to use the new 1.0 API (#130)
cloutiertyler Feb 8, 2025
b882aee
Updates the TypesScript SDK to use the new EventContext variants (#136)
cloutiertyler Feb 8, 2025
f86104f
Add `Timestamp` to the SDK, moving it out of `client_api` (#114)
gefjon Feb 8, 2025
cc0747c
Add shared `ScheduleAt` type (#88)
kazimuth Feb 8, 2025
8163131
TypeScript SDK: Rename address to connection ID (#133)
gefjon Feb 10, 2025
d16e2d6
Now emitting UnknownTransaction (#138)
cloutiertyler Feb 10, 2025
61c1f0e
Implemented the new mutable subscriptions API (#135)
cloutiertyler Feb 11, 2025
204d43c
DBConnection -> DbConnection + some comments (#137)
cloutiertyler Feb 11, 2025
a344b5e
Switch to Bearer auth (#131)
coolreader18 Feb 11, 2025
086a239
Reimplemented/rebased the changes Noa submitted (#134)
coolreader18 Feb 11, 2025
4d9cc59
Import timestamp and duration by file, not from root (#139)
gefjon Feb 11, 2025
fdc8c25
bump versions to 1.0.0 (#126)
bfops Feb 19, 2025
8e0ed66
Disable SpacetimeDB integration test for now (#145)
cloutiertyler Feb 19, 2025
83da8dd
Handle duplicate rows and delay callbacks (#146)
jsdt Feb 26, 2025
01adcc7
Bump version for release (#148)
jdetter Feb 28, 2025
47dd62a
Set other url params even if we dont have an authToken. (#151)
jsdt Mar 4, 2025
2a7d05d
Version 1.0.2 (#152)
jdetter Mar 4, 2025
a072e8c
Fix some subscription lifecycle issues. (#158)
jsdt Mar 14, 2025
76329e9
Reverse byte order when converting to/from hex strings (#161)
jsdt Mar 14, 2025
d3aa26e
Version upgrade to 1.0.3 (#162)
jdetter Mar 15, 2025
2a1cc4d
License Apache2 (#172)
jdetter Apr 14, 2025
edc68cb
1.1.0 release (#170)
bfops Apr 16, 2025
9565b2f
Remove `.changeset/pre.json` (#177)
bfops Apr 21, 2025
be38694
Make ws connection fail when token is invalid (#176)
BastianGanze Apr 22, 2025
1eb2dbd
Subscribe to all the subscriptions together in the quickstart example…
jsdt Apr 23, 2025
930e7a2
Fix so spacetimedb can be hosted with a pathname (#183)
ChaseLewis May 1, 2025
c99b56f
Run lint for PRs. (#184)
jsdt May 6, 2025
16b6b75
Handle falsy option values (#188)
jsdt Jun 16, 2025
56fc56f
Release 1.2.0 (#187)
bfops Jun 17, 2025
179b666
Release 1.2.0 (#190)
github-actions[bot] Jun 18, 2025
de7fb8a
Update db_connection_impl.ts (#194)
Lethalchip Jun 25, 2025
8a202b0
Use the temporary auth token. (#195)
jsdt Jun 25, 2025
e97d72d
Bump version to 1.2.1 for release (#196)
bfops Jun 25, 2025
bcb9f3d
Require a minimum code gen version (#186)
jsdt Jul 7, 2025
93874ac
CI - Test that quickstart-chat builds (#197)
bfops Jul 9, 2025
591d083
Improve performance of row ids (#180)
jsdt Jul 14, 2025
a388670
Use toString() instead of an instance of Url when opening the websock…
JulienLavocat Jul 15, 2025
eef737f
Release 1.2.2 (#200)
bfops Jul 15, 2025
741208c
[bfops/import-typescript-sdk]: Merge remote-tracking branch 'temp-typ…
bfops Jul 16, 2025
5ab01b2
Merge branch 'master' into bfops/import-typescript-sdk
bfops Jul 16, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions sdks/typescript/.changeset/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# 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)
14 changes: 14 additions & 0 deletions sdks/typescript/.changeset/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"$schema": "https://unpkg.com/@changesets/config@3.0.2/schema.json",
"changelog": [
"@changesets/changelog-github",
{ "repo": "clockworklabs/spacetimedb-typescript-sdk" }
],
"commit": false,
"fixed": [],
"linked": [],
"access": "public",
"baseBranch": "main",
"updateInternalDependencies": "patch",
"ignore": []
}
2 changes: 2 additions & 0 deletions sdks/typescript/.gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
src/client_api/*.ts linguist-generated=true
examples/quickstart/client/src/module_bindings/*.ts linguist-generated=true
19 changes: 19 additions & 0 deletions sdks/typescript/.github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
## Description of Changes

_Describe what has been changed, any new features or bug fixes_

## API

- [ ] This is an API breaking change to the SDK

_If the API is breaking, please state below what will break_

## Requires SpacetimeDB PRs

_List any PRs here that are required for this SDK change to work_

## Testing

_Write instructions for a test that you performed for this PR_

- [ ] Describe a test for this PR that you have completed
1 change: 1 addition & 0 deletions sdks/typescript/.github/spacetimedb-version.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
master
24 changes: 24 additions & 0 deletions sdks/typescript/.github/workflows/cr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
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 compile

- name: Release
run: cd packages/sdk && pnpm dlx pkg-pr-new publish --compact --pnpm
41 changes: 41 additions & 0 deletions sdks/typescript/.github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Lint

on:
pull_request:
push:
branches:
- main

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 18

- uses: pnpm/action-setup@v4
with:
version: 9.7
run_install: true

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

- uses: actions/cache@v4
name: Setup pnpm cache
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-

- name: Lint
run: pnpm lint
40 changes: 40 additions & 0 deletions sdks/typescript/.github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
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 compile

- 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 }}
146 changes: 146 additions & 0 deletions sdks/typescript/.github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,146 @@
name: Tests

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

jobs:
compile-and-test:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 18

- uses: pnpm/action-setup@v4
with:
version: 9.7
run_install: true

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

- uses: actions/cache@v4
name: Setup pnpm cache
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-

- name: Compile
run: pnpm compile

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

# - name: Extract SpacetimeDB branch name from file
# id: extract-branch
# run: |
# # Define the path to the branch file
# BRANCH_FILE=".github/spacetimedb-branch.txt"

# # Default to master if file doesn't exist
# if [ ! -f "$BRANCH_FILE" ]; then
# echo "::notice::No SpacetimeDB branch file found, using 'master'"
# echo "branch=master" >> $GITHUB_OUTPUT
# exit 0
# fi

# # Read and trim whitespace from the file
# branch=$(cat "$BRANCH_FILE" | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//')

# # Fallback to master if empty
# if [ -z "$branch" ]; then
# echo "::warning::SpacetimeDB branch file is empty, using 'master'"
# branch="master"
# fi

# echo "branch=$branch" >> $GITHUB_OUTPUT
# echo "Using SpacetimeDB branch from file: $branch"

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

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

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

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

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

- name: Check for changes
run: |
# This was copied from SpacetimeDB/tools/check-diff.sh.
# It's required because `spacetime generate` creates lines with the SpacetimeDB commit
# version, which would make this `git diff` check very brittle if included.
PATTERN='^// This was generated using spacetimedb cli version.*'
if ! git diff --exit-code --ignore-matching-lines="$PATTERN" -- examples/quickstart-chat/src/module_bindings; then
echo "Error: Bindings are dirty. Please generate bindings again and commit them to this branch."
exit 1
fi

# - name: Start SpacetimeDB
# run: |
# spacetime start &
# disown

# - name: Publish module to SpacetimeDB
# working-directory: SpacetimeDB/modules/quickstart-chat
# run: |
# spacetime logout && spacetime login --server-issued-login local
# spacetime publish -s local quickstart-chat -c -y

# - name: Publish module to SpacetimeDB
# working-directory: SpacetimeDB/modules/quickstart-chat
# run: |
# spacetime logs quickstart-chat

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

# - name: Run quickstart-chat tests
# working-directory: examples/quickstart-chat
# run: pnpm test
#
# # Run this step always, even if the previous steps fail
# - name: Print rows in the user table
# if: always()
# run: spacetime sql quickstart-chat "SELECT * FROM user"
4 changes: 4 additions & 0 deletions sdks/typescript/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
node_modules/
.envrc
dist/
.DS_Store
3 changes: 3 additions & 0 deletions sdks/typescript/.npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
tests
.envrc
node_modules
5 changes: 5 additions & 0 deletions sdks/typescript/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
node_modules
pnpm-lock.yaml
dist
target
/.github
11 changes: 11 additions & 0 deletions sdks/typescript/.prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"tabWidth": 2,
"useTabs": false,
"semi": true,
"singleQuote": true,
"arrowParens": "avoid",
"jsxSingleQuote": false,
"trailingComma": "es5",
"endOfLine": "auto",
"printWidth": 80
}
7 changes: 7 additions & 0 deletions sdks/typescript/.vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"workbench.colorCustomizations": {
"[Material Theme Darker]": {},
"minimap.background": "#00000000",
"scrollbar.shadow": "#00000000"
}
}
43 changes: 43 additions & 0 deletions sdks/typescript/DEVELOP.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# 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)
Loading
Loading