dcfc6da604
Adds an assets server to the demo worker, and reworks the existing asset server to use the same code. There are a few simplifications to the code due to some DX improvements working with R2 and caches. I also removed the `HEAD` request from the assets server: i took a look at our logs and it's not actually used at all. This also fixes an issue where users could overwrite the contents of the asset uploads bucket. ### Change type - [x] `other`
38 lines
1,012 B
JSON
38 lines
1,012 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": "yarn run -T tsx ../../scripts/workers/dev.ts --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": {
|
|
"@tldraw/worker-shared": "workspace:*",
|
|
"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.62.0"
|
|
},
|
|
"jest": {
|
|
"preset": "config/jest/node",
|
|
"moduleNameMapper": {
|
|
"^~(.*)": "<rootDir>/src/$1"
|
|
},
|
|
"transformIgnorePatterns": [
|
|
"node_modules/(?!(nanoid|escape-string-regexp)/)"
|
|
]
|
|
}
|
|
}
|