Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
98 commits
Select commit Hold shift + click to select a range
e210fe9
Merge pull request #1 from clockworklabs/drogus/readme
NateTheDev1 Mar 29, 2023
c263342
:Merge branch 'main' into client-additions
NateTheDev1 Mar 29, 2023
c95b153
Added a disconnect method
NateTheDev1 Mar 30, 2023
29ca21c
Fixed module to also work with react modules
NateTheDev1 Mar 30, 2023
a2a974f
Finished upA
NateTheDev1 Mar 30, 2023
e7fa46e
Merge pull request #2 from clockworklabs/client-additions
NateTheDev1 Mar 31, 2023
1c43f32
Updating documentation
NateTheDev1 Mar 31, 2023
9d0db17
Merge pull request #3 from clockworklabs/docs-update-1
NateTheDev1 Mar 31, 2023
2bcfbb3
Change package name to spacetimedb-sdk
drogus Apr 11, 2023
1b9f30b
Change package name to spacetimedb-sdk and bump to 0.2.0
drogus Apr 11, 2023
036797e
Add client.subscribe() method
drogus Apr 12, 2023
ae4422f
Bump to 0.3.0
drogus Apr 13, 2023
3360dd6
Add some client tests (#5)
drogus Apr 13, 2023
096a306
Prettier + husky + pretty-quick (#6)
drogus Apr 13, 2023
6c1afdd
Add test workflow (#7)
drogus Apr 13, 2023
32998d5
New address for subscribing
drogus May 16, 2023
81bc5de
Bump version to 0.4.0
drogus May 16, 2023
2d3ea0f
Change version to 0.4.0-alpha
drogus May 23, 2023
de17ae3
0.4.0-next.0
drogus Jun 1, 2023
07a93fe
Fix reducers callbacks
drogus Jun 20, 2023
ac97ec2
Fix identity deserialize (#8)
dbrinkmanncw Jun 26, 2023
aa7e577
Add support for update (#9)
drogus Jun 29, 2023
1bb17e0
Add reducer event to callbacks (#10)
drogus Jun 29, 2023
f11314c
Changed sdk to commonjs target to work with node and react
NateTheDev1 Jul 5, 2023
b1e261b
Fixed external package problems with this configuration
NateTheDev1 Jul 6, 2023
8adf53c
Added manual ws table connectors
NateTheDev1 Jul 7, 2023
9d56015
Merge pull request #12 from clockworklabs/ws-manual
NateTheDev1 Jul 10, 2023
5f743c1
Added PR template (#13)
jdetter Jul 13, 2023
3d632f2
Allow to use binary format (#11)
drogus Jul 13, 2023
975af20
Bump to 0.5.0
drogus Jul 18, 2023
f7da92c
Fix issue with modules
drogus Jul 18, 2023
9a56f61
Change debug use of the reducer name
drogus Jul 19, 2023
a8632b9
Bump to 0.5.2
drogus Jul 19, 2023
c54aa4b
Change Identity from UInt8Array to Identity to match other SDKs (#14)
dbrinkmanncw Aug 1, 2023
3a4d783
Bump version to 0.6.0
drogus Aug 3, 2023
997de7a
Mamcx/typescript sdk reference (#17)
mamcx Aug 3, 2023
ac8ae9e
Fix reducer event argument being undefined if the reducer fails. (#18)
dbrinkmanncw Aug 8, 2023
763afe8
Fix bsatn serialization. It was adding an extra 0 to the end of the b…
dbrinkmanncw Aug 16, 2023
ab0a3f2
Bump version to 0.6.1
drogus Aug 8, 2023
de1fe12
Fix auth in the browser (#20)
drogus Aug 17, 2023
033d9f7
Remove protobufjs from devDependencies
jkbz64 Sep 2, 2023
1d31b07
TypescriptSDK quickstart example (#15)
dbrinkmanncw Sep 21, 2023
4e225f8
Add LICENSE.txt (#22)
dbrinkmanncw Oct 2, 2023
c3e342e
Bump package version to 0.6.2
drogus Sep 5, 2023
a99c6eb
Fix onUpdate when PK is of type Identity (#25)
drogus Oct 6, 2023
f22b6fd
Client address support for TypeScript SDK (#23)
gefjon Oct 12, 2023
b1c04c4
Fix Identity serialization/deserialization (#26)
drogus Oct 12, 2023
d12218e
Bump version to 0.7.0
drogus Nov 7, 2023
e73c694
Fix identity constructor (#28)
drogus Nov 7, 2023
ffc7d50
Bump version to 0.7.1
drogus Nov 7, 2023
0d319df
Bump to 0.7.2
drogus Nov 7, 2023
39b8a2f
Changes required for SpacetimeDB 0.8 + improvements (#29)
drogus Dec 11, 2023
edb2206
Bump version to 0.8.0
drogus Dec 11, 2023
b6cb681
Add changelog
drogus Dec 11, 2023
95abb83
Fix type returned by DatabaseTable.with method (#30)
drogus Dec 15, 2023
a6951f7
Bump version to 0.8.1
drogus Dec 15, 2023
a149e44
Merge pull request #21 from jkbz64/fix/protobuf-dev
NateTheDev1 Feb 16, 2024
b1488a0
Remove row_pk from the client API (#34)
gefjon Feb 28, 2024
c0836c3
Cleaned up code and added better error handling and responses for inv…
NateTheDev1 Mar 12, 2024
ef1c725
Bump to 0.8.2
drogus Mar 12, 2024
5698991
Fix issue where some Typescript based project transpiler might mangle…
hsreina Mar 12, 2024
390c933
brotli-decompress received binary websocket messages (#41)
gefjon Mar 29, 2024
a8d5863
Drogus/big int to bigint (#37)
drogus May 2, 2024
a988c6c
Bump to 0.9.0
drogus May 2, 2024
d95c0c3
Bump version to 0.10.0 (#44)
bfops Jun 13, 2024
0e1ce88
Nuke protobuf and also JSON in favor of BSATN (#47)
gefjon Jul 15, 2024
a2a3f66
Bump version to 0.11.0
Jul 19, 2024
671bbe3
Merge pull request #60 from clockworklabs/version/0.11.0
bfops Aug 1, 2024
4b042e5
flatten AlgebraicType & simplify some codegen
Centril Aug 6, 2024
f485d1f
0.11.0 release changes
drogus Aug 7, 2024
99c8f78
Fix: synchronous ws processing (#66)
tcardlab Aug 14, 2024
e5cc57e
Merge branch 'main' into centril/flatten-at
PuruVJ Aug 19, 2024
4e1bb07
Merge pull request #62 from clockworklabs/centril/flatten-at
Centril Aug 19, 2024
87ab7c2
Modernize (#52)
PuruVJ Aug 21, 2024
ce3a462
fix: Release action (#89)
PuruVJ Aug 21, 2024
cbfe271
fix: Remove registry (#90)
PuruVJ Aug 21, 2024
5adb557
fix: .on and .off types (#91)
PuruVJ Aug 21, 2024
a600ad9
docs: Publishing and release (#94)
PuruVJ Aug 21, 2024
ab1f463
Add changeset for #62 (#92)
PuruVJ Aug 21, 2024
8c4cc75
feat: changelog-github (#95)
PuruVJ Aug 21, 2024
17227c0
chore: Changeset #66 (#96)
PuruVJ Aug 22, 2024
b8c944c
Tyler's Stable SDK API implementation (#102)
cloutiertyler Oct 3, 2024
fa03b0d
Small change to API
cloutiertyler Oct 4, 2024
3c63d5e
Merge pull request #103 from clockworklabs/tyler/stable-sdk/fix-1
bfops Oct 4, 2024
cfa9211
Version Packages (#93)
github-actions[bot] Oct 4, 2024
79c278b
fix: temporary token path invocation (#105)
PuruVJ Oct 8, 2024
b9db9b6
docs: 0.12 public facing docs (#108)
PuruVJ Oct 8, 2024
2f6c82c
fix: websocket message handling, Buffer, onConnect (#107)
PuruVJ Oct 8, 2024
3bc40e3
Version Packages (#106)
github-actions[bot] Oct 8, 2024
221ac62
Update DEVELOP.md (#111)
cloutiertyler Oct 16, 2024
cf7b7d8
feat: GZIP (#109)
PuruVJ Oct 23, 2024
9032269
Enter prerelease mode (#116)
PuruVJ Oct 23, 2024
5d7304b
Add gzip for #109 (#117)
PuruVJ Oct 23, 2024
6547882
Update Identity and Address to use bigints rather than byte arrays (#…
kazimuth Nov 4, 2024
6cee7f4
Update readme for rc1.0 (#123)
PuruVJ Nov 6, 2024
a501f5c
Companion to SpacetimeDB#1812 (light tx, ts) (#110)
Centril Nov 6, 2024
93dea53
Version Packages (rc1) (#115)
github-actions[bot] Nov 6, 2024
a374814
websocket: receive ids, not names
Centril Oct 23, 2024
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 .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 .changeset/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json",
"changelog": [
"@changesets/changelog-github",
{ "repo": "clockworklabs/spacetimedb-typescript-sdk" }
],
"commit": false,
"fixed": [],
"linked": [],
"access": "public",
"baseBranch": "main",
"updateInternalDependencies": "patch",
"ignore": []
}
5 changes: 5 additions & 0 deletions .changeset/dull-mangos-appear.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@clockworklabs/spacetimedb-sdk': patch
---

fix: websocket message handling, Buffer, onConnect
5 changes: 5 additions & 0 deletions .changeset/long-laws-mix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@clockworklabs/spacetimedb-sdk': minor
---

Support light tx updates via builder.with*light_mode(*) and the call flag NoSuccessNotify
16 changes: 16 additions & 0 deletions .changeset/pre.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"mode": "pre",
"tag": "rc1",
"initialVersions": {
"client-vite": "0.0.2",
"@clockworklabs/spacetimedb-sdk": "0.12.1",
"@clockworklabs/test-app": "0.0.2"
},
"changesets": [
"dull-mangos-appear",
"long-laws-mix",
"smart-dogs-listen",
"three-cats-listen",
"two-garlics-sin"
]
}
5 changes: 5 additions & 0 deletions .changeset/smart-dogs-listen.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@clockworklabs/spacetimedb-sdk': major
---

Enter RC
5 changes: 5 additions & 0 deletions .changeset/three-cats-listen.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@clockworklabs/spacetimedb-sdk': minor
---

Update Identity and Address to use bigints rather than byte arrays (see https://github.com/clockworklabs/SpacetimeDB/pull/1616)
5 changes: 5 additions & 0 deletions .changeset/two-garlics-sin.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@clockworklabs/spacetimedb-sdk': major
---

feat: Switch to GZIP compression by default
2 changes: 2 additions & 0 deletions .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
13 changes: 13 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
## 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_
24 changes: 24 additions & 0 deletions .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
38 changes: 38 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Lint

on:
push:

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

on:
push:
pull_request:

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: Build
run: pnpm compile

- name: Run tests
run: pnpm test
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
node_modules/
.envrc
dist/
.DS_Store
1 change: 0 additions & 1 deletion .npmignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
tests
jest.config.js
.envrc
node_modules
4 changes: 4 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
node_modules
pnpm-lock.yaml
dist
target
11 changes: 11 additions & 0 deletions .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 .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"
}
}
40 changes: 40 additions & 0 deletions DEVELOP.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Notes for maintainers

The directory `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"`.

## Releases and publishing

Every Pull Request with 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. For eg, any new feature or patch we work on for 0.12 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)
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
`@clockworklabs/spacetimedb-sdk` is a TypeScript SDK for SpacetimeDB.

Source code can be found here on [GitHub](https://github.com/clockworklabs/spacetimedb-typescript-sdk/blob/main/packages/sdk).
26 changes: 26 additions & 0 deletions examples/quickstart/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

node_modules
dist
dist-ssr
*.local

# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?

server
22 changes: 22 additions & 0 deletions examples/quickstart/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# client-vite

## 0.0.3-rc1.0

### Patch Changes

- Updated dependencies [[`cf7b7d8`](https://github.com/clockworklabs/spacetimedb-typescript-sdk/commit/cf7b7d89a1547fb3863f6641f5b2eb40a27c05d8), [`a501f5c`](https://github.com/clockworklabs/spacetimedb-typescript-sdk/commit/a501f5ccf9a0a926eb4f345ddeb01ffcb872d67e), [`9032269`](https://github.com/clockworklabs/spacetimedb-typescript-sdk/commit/9032269004d4dae587c39ccd85da0a32fb9a0114), [`6547882`](https://github.com/clockworklabs/spacetimedb-typescript-sdk/commit/6547882bb28ed9a1ca436335745e9997328026ff), [`5d7304b`](https://github.com/clockworklabs/spacetimedb-typescript-sdk/commit/5d7304bd3e05dd7a032cfb7069aab97b881f0179)]:
- @clockworklabs/[email protected]

## 0.0.2

### Patch Changes

- Updated dependencies [[`2f6c82c`](https://github.com/clockworklabs/spacetimedb-typescript-sdk/commit/2f6c82c724b9f9407c7bedee13252ca8ffab8f7d), [`b9db9b6`](https://github.com/clockworklabs/spacetimedb-typescript-sdk/commit/b9db9b6e46d8c98b29327d97c12c07b7a2fc96bf), [`79c278b`](https://github.com/clockworklabs/spacetimedb-typescript-sdk/commit/79c278be71b2dfd82106ada983fd81d395b1d912)]:
- @clockworklabs/[email protected]

## 0.0.1

### Patch Changes

- Updated dependencies [[`5adb557`](https://github.com/clockworklabs/spacetimedb-typescript-sdk/commit/5adb55776c81d0760cf0268df0fa5dee600f0ef8), [`ab1f463`](https://github.com/clockworklabs/spacetimedb-typescript-sdk/commit/ab1f463d7da6e530a6cd47e2433141bfd16addd1), [`b8c944c`](https://github.com/clockworklabs/spacetimedb-typescript-sdk/commit/b8c944cd23d3b53c72131803a775127bf0a95213), [`17227c0`](https://github.com/clockworklabs/spacetimedb-typescript-sdk/commit/17227c0f65def3a9d5e767756ccf46777210041a)]:
- @clockworklabs/[email protected]
8 changes: 8 additions & 0 deletions examples/quickstart/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# React + TypeScript + Vite

This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.

Currently, two official plugins are available:

- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react/README.md) uses [Babel](https://babeljs.io/) for Fast Refresh
- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh
13 changes: 13 additions & 0 deletions examples/quickstart/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Vite + React + TS</title>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>
Loading
Loading