From 69a532ab60a85d30c2395969593c4d38f9a2fbbe Mon Sep 17 00:00:00 2001 From: Matthew Phillips Date: Fri, 28 Oct 2022 10:20:20 -0400 Subject: [PATCH] Export Cloudflare runtime types (#5230) * Export Cloudflare runtime types * Adding a changeset --- .changeset/new-pumas-begin.md | 5 +++++ packages/integrations/cloudflare/package.json | 5 ++++- packages/integrations/cloudflare/runtime.d.ts | 8 ++++++++ 3 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 .changeset/new-pumas-begin.md create mode 100644 packages/integrations/cloudflare/runtime.d.ts diff --git a/.changeset/new-pumas-begin.md b/.changeset/new-pumas-begin.md new file mode 100644 index 0000000000..f7f1d558a2 --- /dev/null +++ b/.changeset/new-pumas-begin.md @@ -0,0 +1,5 @@ +--- +'@astrojs/cloudflare': patch +--- + +Exports new runtime entrypoint's types diff --git a/packages/integrations/cloudflare/package.json b/packages/integrations/cloudflare/package.json index 46f5889085..bdb1bb48d7 100644 --- a/packages/integrations/cloudflare/package.json +++ b/packages/integrations/cloudflare/package.json @@ -19,7 +19,10 @@ "homepage": "https://docs.astro.build/en/guides/integrations-guide/cloudflare/", "exports": { ".": "./dist/index.js", - "./runtime": "./dist/runtime.js", + "./runtime": { + "types": "./runtime.d.ts", + "default": "./dist/runtime.js" + }, "./server.advanced.js": "./dist/server.advanced.js", "./server.directory.js": "./dist/server.directory.js", "./package.json": "./package.json" diff --git a/packages/integrations/cloudflare/runtime.d.ts b/packages/integrations/cloudflare/runtime.d.ts new file mode 100644 index 0000000000..3b415153c0 --- /dev/null +++ b/packages/integrations/cloudflare/runtime.d.ts @@ -0,0 +1,8 @@ +export type { + WorkerRuntime, + PagesRuntime +} from './dist/runtime'; + +export { + getRuntime +} from './dist/runtime';