diff --git a/.gitignore b/.gitignore index 0003fda..6de611a 100644 --- a/.gitignore +++ b/.gitignore @@ -36,3 +36,5 @@ yarn-error.log* $ CloudFlare worker .mf/ tsconfig.tsbuildinfo +.env + diff --git a/package-lock.json b/package-lock.json index 5ee6464..86588da 100644 --- a/package-lock.json +++ b/package-lock.json @@ -26,7 +26,7 @@ "replicache": "^9.0.0-beta.0", "replicache-react": "^2.5.0", "reps-client": "file:reps-client-0.0.1.tgz", - "reps-do": "file:reps-do-0.0.1.tgz", + "reps-do": "file:reps-do-0.1.0.tgz", "typescript": "^4.5.5", "zod": "^3.11.6" } @@ -1983,9 +1983,9 @@ } }, "node_modules/reps-do": { - "version": "0.0.1", - "resolved": "file:reps-do-0.0.1.tgz", - "integrity": "sha512-TYmZjSA6+pOs9g70isvOZ9Ns3jti51PIWwQG/RTye3iigFg0qwRZ67ivNJFVURB9vsX8KZs/wYPIVxTPrJOj6w==", + "version": "0.1.0", + "resolved": "file:reps-do-0.1.0.tgz", + "integrity": "sha512-NUS2UcjMzRWHLGpfkv6nAQNARf8NnJ1FrSY7ugANDF5uVX9SPGE9dOmGG+5ecej4ptgRq1vogbadr4/ikLOIkg==", "dependencies": { "replicache": "^9.0.0-beta.0" }, @@ -3659,8 +3659,8 @@ } }, "reps-do": { - "version": "file:reps-do-0.0.1.tgz", - "integrity": "sha512-TYmZjSA6+pOs9g70isvOZ9Ns3jti51PIWwQG/RTye3iigFg0qwRZ67ivNJFVURB9vsX8KZs/wYPIVxTPrJOj6w==", + "version": "file:reps-do-0.1.0.tgz", + "integrity": "sha512-NUS2UcjMzRWHLGpfkv6nAQNARf8NnJ1FrSY7ugANDF5uVX9SPGE9dOmGG+5ecej4ptgRq1vogbadr4/ikLOIkg==", "requires": { "replicache": "^9.0.0-beta.0" } diff --git a/package.json b/package.json index 7f716f1..6717e85 100644 --- a/package.json +++ b/package.json @@ -30,7 +30,7 @@ "replicache": "^9.0.0-beta.0", "replicache-react": "^2.5.0", "reps-client": "file:reps-client-0.0.1.tgz", - "reps-do": "file:reps-do-0.0.1.tgz", + "reps-do": "file:reps-do-0.1.0.tgz", "typescript": "^4.5.5", "zod": "^3.11.6" } diff --git a/reps-do-0.0.1.tgz b/reps-do-0.0.1.tgz deleted file mode 100644 index 26a8770..0000000 Binary files a/reps-do-0.0.1.tgz and /dev/null differ diff --git a/reps-do-0.1.0.tgz b/reps-do-0.1.0.tgz new file mode 100644 index 0000000..6542461 Binary files /dev/null and b/reps-do-0.1.0.tgz differ diff --git a/src/pages/d/[id].tsx b/src/pages/d/[id].tsx index 3c09a29..0923efa 100644 --- a/src/pages/d/[id].tsx +++ b/src/pages/d/[id].tsx @@ -33,7 +33,7 @@ export default function Home() { const workerHost = process.env.NEXT_PUBLIC_WORKER_HOST ?? - "wss://reps.replicache.workers.dev"; + "wss://replidraw.replicache.workers.dev"; const workerURL = `${workerHost}/connect`; console.info(`Connecting to worker at ${workerURL}`); new Client(r, roomID, workerURL); diff --git a/worker/index.ts b/worker/index.ts index 051293f..5700d9e 100644 --- a/worker/index.ts +++ b/worker/index.ts @@ -1,9 +1,18 @@ -import { Server as BaseServer } from "reps-do"; +import { DatadogLogger, Server as BaseServer } from "reps-do"; export { worker as default } from "reps-do"; import { mutators, type M } from "../src/datamodel/mutators.js"; export class Server extends BaseServer { - constructor(state: DurableObjectState) { - super(mutators, state); + constructor(state: DurableObjectState, env: Record) { + const logger = new DatadogLogger({ + apiKey: env.DATADOG_API_KEY, + service: "replidraw", + }); + + super({ + mutators, + state, + logger, + }); } } diff --git a/wrangler.toml b/wrangler.toml index 2155725..3328119 100644 --- a/wrangler.toml +++ b/wrangler.toml @@ -1,4 +1,4 @@ -name = "replidraw-do" +name = "replidraw" type = "javascript" account_id = "" @@ -28,3 +28,6 @@ main = "./index.mjs" [miniflare] durable_objects_persist = true + +#[secrets] +#DATADOG_API_KEY