4a3d9d407d
This PR replaces the extendable TLServer class with an instantiatable wrapper for the TLSyncRoom called TLSocketRoom. The goal is to provide an API where you pretty much just 1. create a room from some (optional) snapshot 2. pass websockets into it when they connect And then lifecycle stuff and persistence stuff is left to the consumer, since that all seems to be much more context dependent. One thing remaining here is to work on observability. We had a slightly messy situation regarding logging and error handling and analytics and I want to clean that all up. ### Change Type <!-- ❗ Please select a 'Scope' label ❗️ --> - [ ] `sdk` — Changes the tldraw SDK - [ ] `dotcom` — Changes the tldraw.com web app - [ ] `docs` — Changes to the documentation, examples, or templates. - [ ] `vs code` — Changes to the vscode plugin - [x] `internal` — Does not affect user-facing stuff <!-- ❗ Please select a 'Type' label ❗️ --> - [ ] `bugfix` — Bug fix - [ ] `feature` — New feature - [ ] `improvement` — Improving existing features - [ ] `chore` — Updating dependencies, other boring stuff - [x] `galaxy brain` — Architectural changes - [ ] `tests` — Changes to any test code - [ ] `tools` — Changes to infrastructure, CI, internal scripts, debugging tools, etc. - [ ] `dunno` — I don't know ### Test Plan 1. Add a step-by-step description of how to test your PR here. 4. - [ ] Unit Tests - [ ] End to end tests ### Release Notes - Add a brief release note for your PR here.
37 lines
986 B
JSON
37 lines
986 B
JSON
{
|
|
"name": "dotcom-asset-upload",
|
|
"description": "A Cloudflare Worker to upload and serve images",
|
|
"version": "2.0.0-alpha.8",
|
|
"private": true,
|
|
"author": {
|
|
"name": "tldraw GB Ltd.",
|
|
"email": "hello@tldraw.com"
|
|
},
|
|
"main": "src/index.ts",
|
|
"scripts": {
|
|
"dev": "cross-env NODE_ENV=development wrangler dev --log-level info --persist-to tmp-assets",
|
|
"test-ci": "lazy inherit --passWithNoTests",
|
|
"test": "yarn run -T jest --passWithNoTests",
|
|
"test-coverage": "lazy inherit --passWithNoTests",
|
|
"lint": "yarn run -T tsx ../../scripts/lint.ts"
|
|
},
|
|
"dependencies": {
|
|
"itty-cors": "^0.3.4",
|
|
"itty-router": "^4.0.13"
|
|
},
|
|
"devDependencies": {
|
|
"@cloudflare/workers-types": "^4.20240620.0",
|
|
"@types/ws": "^8.5.9",
|
|
"lazyrepo": "0.0.0-alpha.27",
|
|
"wrangler": "3.61.0"
|
|
},
|
|
"jest": {
|
|
"preset": "config/jest/node",
|
|
"moduleNameMapper": {
|
|
"^~(.*)": "<rootDir>/src/$1"
|
|
},
|
|
"transformIgnorePatterns": [
|
|
"node_modules/(?!(nanoid|escape-string-regexp)/)"
|
|
]
|
|
}
|
|
}
|