From 9e44d88ac047a021f86db851e926a14a5a01781c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Somhairle=20MacLe=C3=B2id?= Date: Mon, 23 Sep 2024 15:45:28 +0100 Subject: [PATCH] Remove `Env` from index.ts (#6790) --- .changeset/proud-hats-notice.md | 5 +++++ .../ts/src/index.ts | 20 ------------------ .../ts/worker-configuration.d.ts | 7 +++---- .../ts/src/index.ts | 21 ------------------- .../ts/worker-configuration.d.ts | 7 +++---- 5 files changed, 11 insertions(+), 49 deletions(-) create mode 100644 .changeset/proud-hats-notice.md diff --git a/.changeset/proud-hats-notice.md b/.changeset/proud-hats-notice.md new file mode 100644 index 000000000000..cd142dcb448d --- /dev/null +++ b/.changeset/proud-hats-notice.md @@ -0,0 +1,5 @@ +--- +"create-cloudflare": patch +--- + +fix: Remove `Env` from index.ts in the Hello World Durable Objects & Hello World Durable Objects w/ assets templates diff --git a/packages/create-cloudflare/templates-experimental/hello-world-durable-object-with-assets/ts/src/index.ts b/packages/create-cloudflare/templates-experimental/hello-world-durable-object-with-assets/ts/src/index.ts index 698bda26e54c..0ec3c88490da 100644 --- a/packages/create-cloudflare/templates-experimental/hello-world-durable-object-with-assets/ts/src/index.ts +++ b/packages/create-cloudflare/templates-experimental/hello-world-durable-object-with-assets/ts/src/index.ts @@ -14,26 +14,6 @@ import { DurableObject } from "cloudflare:workers"; */ -/** - * Associate bindings declared in wrangler.toml with the TypeScript type system - */ -export interface Env { - // Example binding to KV. Learn more at https://developers.cloudflare.com/workers/runtime-apis/kv/ - // MY_KV_NAMESPACE: KVNamespace; - // - // Example binding to Durable Object. Learn more at https://developers.cloudflare.com/workers/runtime-apis/durable-objects/ - MY_DURABLE_OBJECT: DurableObjectNamespace; - // - // Example binding to R2. Learn more at https://developers.cloudflare.com/workers/runtime-apis/r2/ - // MY_BUCKET: R2Bucket; - // - // Example binding to a Service. Learn more at https://developers.cloudflare.com/workers/runtime-apis/service-bindings/ - // MY_SERVICE: Fetcher; - // - // Example binding to a Queue. Learn more at https://developers.cloudflare.com/queues/javascript-apis/ - // MY_QUEUE: Queue; -} - /** A Durable Object's behavior is defined in an exported Javascript class */ export class MyDurableObject extends DurableObject { /** diff --git a/packages/create-cloudflare/templates-experimental/hello-world-durable-object-with-assets/ts/worker-configuration.d.ts b/packages/create-cloudflare/templates-experimental/hello-world-durable-object-with-assets/ts/worker-configuration.d.ts index b1d5a43d65c4..4c0ab5ed2f99 100644 --- a/packages/create-cloudflare/templates-experimental/hello-world-durable-object-with-assets/ts/worker-configuration.d.ts +++ b/packages/create-cloudflare/templates-experimental/hello-world-durable-object-with-assets/ts/worker-configuration.d.ts @@ -1,6 +1,5 @@ -// Generated by Wrangler -// After adding bindings to `wrangler.toml`, regenerate this interface via `npm run cf-typegen` +// Generated by Wrangler by running `wrangler types` + interface Env { - MY_DURABLE_OBJECT: DurableObjectNamespace; + MY_DURABLE_OBJECT: DurableObjectNamespace; } - diff --git a/packages/create-cloudflare/templates/hello-world-durable-object/ts/src/index.ts b/packages/create-cloudflare/templates/hello-world-durable-object/ts/src/index.ts index 698bda26e54c..7b95a88d1b0d 100644 --- a/packages/create-cloudflare/templates/hello-world-durable-object/ts/src/index.ts +++ b/packages/create-cloudflare/templates/hello-world-durable-object/ts/src/index.ts @@ -13,27 +13,6 @@ import { DurableObject } from "cloudflare:workers"; * Learn more at https://developers.cloudflare.com/durable-objects */ - -/** - * Associate bindings declared in wrangler.toml with the TypeScript type system - */ -export interface Env { - // Example binding to KV. Learn more at https://developers.cloudflare.com/workers/runtime-apis/kv/ - // MY_KV_NAMESPACE: KVNamespace; - // - // Example binding to Durable Object. Learn more at https://developers.cloudflare.com/workers/runtime-apis/durable-objects/ - MY_DURABLE_OBJECT: DurableObjectNamespace; - // - // Example binding to R2. Learn more at https://developers.cloudflare.com/workers/runtime-apis/r2/ - // MY_BUCKET: R2Bucket; - // - // Example binding to a Service. Learn more at https://developers.cloudflare.com/workers/runtime-apis/service-bindings/ - // MY_SERVICE: Fetcher; - // - // Example binding to a Queue. Learn more at https://developers.cloudflare.com/queues/javascript-apis/ - // MY_QUEUE: Queue; -} - /** A Durable Object's behavior is defined in an exported Javascript class */ export class MyDurableObject extends DurableObject { /** diff --git a/packages/create-cloudflare/templates/hello-world-durable-object/ts/worker-configuration.d.ts b/packages/create-cloudflare/templates/hello-world-durable-object/ts/worker-configuration.d.ts index b1d5a43d65c4..4c0ab5ed2f99 100644 --- a/packages/create-cloudflare/templates/hello-world-durable-object/ts/worker-configuration.d.ts +++ b/packages/create-cloudflare/templates/hello-world-durable-object/ts/worker-configuration.d.ts @@ -1,6 +1,5 @@ -// Generated by Wrangler -// After adding bindings to `wrangler.toml`, regenerate this interface via `npm run cf-typegen` +// Generated by Wrangler by running `wrangler types` + interface Env { - MY_DURABLE_OBJECT: DurableObjectNamespace; + MY_DURABLE_OBJECT: DurableObjectNamespace; } -