From b869f974c0dd7c8e77a624aaa63ea7d9051fcced Mon Sep 17 00:00:00 2001 From: rossrobino Date: Thu, 5 Sep 2024 14:10:34 -0400 Subject: [PATCH] docs: cloudflare adapter --- apps/cloudflare/public/public.html | 12 ------------ apps/cloudflare/src/+page.html | 8 +------- apps/cloudflare/src/style.css | 3 +++ apps/docs/src/content/deploy.md | 13 +++++++++++-- apps/docs/src/style.css | 4 ++++ packages/domco/src/adapter/cloudflare/index.ts | 12 ------------ 6 files changed, 19 insertions(+), 33 deletions(-) delete mode 100644 apps/cloudflare/public/public.html diff --git a/apps/cloudflare/public/public.html b/apps/cloudflare/public/public.html deleted file mode 100644 index f5bed6e..0000000 --- a/apps/cloudflare/public/public.html +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - Public Static Page - - -

Not processed by Vite

- Home - - diff --git a/apps/cloudflare/src/+page.html b/apps/cloudflare/src/+page.html index 852bf9e..bd9c7ab 100644 --- a/apps/cloudflare/src/+page.html +++ b/apps/cloudflare/src/+page.html @@ -5,21 +5,15 @@ - Title + Cloudflare Tester

Hello Cloudflare

-

Static - Public

diff --git a/apps/cloudflare/src/style.css b/apps/cloudflare/src/style.css index e69de29..ad77708 100644 --- a/apps/cloudflare/src/style.css +++ b/apps/cloudflare/src/style.css @@ -0,0 +1,3 @@ +body { + font-family: "Times New Roman", Times, serif; +} diff --git a/apps/docs/src/content/deploy.md b/apps/docs/src/content/deploy.md index 9d543e7..e63fa14 100644 --- a/apps/docs/src/content/deploy.md +++ b/apps/docs/src/content/deploy.md @@ -62,11 +62,20 @@ export default defineConfig({ }); ``` +### Cloudflare + +The [Cloudflare](https://cloudflare.com) adapter outputs your app to work on Cloudflare Pages. + +![A screenshot of the Cloudflare Build Settings UI. Set the Framework Preset field to "None", set the build command to "npm run build", and the build output directory to ".cloudflare".](/cloudflare/build-settings.webp) + +- Functions run on the [Workers Runtime](https://developers.cloudflare.com/workers/runtime-apis/). +- Outputs public assets to be served on Cloudflare's CDN. + ### Vercel The [Vercel](https://vercel.com) adapter outputs your app to the [Build Output API](https://vercel.com/docs/build-output-api/v3) specification. ![A screenshot of the Vercel Build and Development Settings UI. Set the Framework Preset field to "Other" and leave all of the other options blank.](/vercel/build-settings.webp) -- Supports Serverless (+ ISR), and Edge Runtime. -- Outputs public assets to be served on Vercel's CDN. Since your application will not be serving these assets, if you want to protect a page, you need to serve it from an endpoint instead. +- Supports [Node.js](https://vercel.com/docs/functions/runtimes#node.js), [Node.js with ISR](https://vercel.com/docs/incremental-static-regeneration), and [Edge Runtime](https://vercel.com/docs/functions/runtimes/edge-runtime). +- Outputs public assets to be served on Vercel's [Edge Network](https://vercel.com/docs/edge-network/overview). diff --git a/apps/docs/src/style.css b/apps/docs/src/style.css index 2cff283..de10925 100644 --- a/apps/docs/src/style.css +++ b/apps/docs/src/style.css @@ -70,6 +70,10 @@ cursor: default; } } + + img { + border: var(--border); + } } @layer components { diff --git a/packages/domco/src/adapter/cloudflare/index.ts b/packages/domco/src/adapter/cloudflare/index.ts index e492d72..da23cbc 100644 --- a/packages/domco/src/adapter/cloudflare/index.ts +++ b/packages/domco/src/adapter/cloudflare/index.ts @@ -55,14 +55,6 @@ export const adapter: AdapterBuilder = async () => { run: async () => { const outDir = ".cloudflare"; - // const packageJson = await fs.readFile("package.json", "utf-8"); - // const { name } = JSON.parse(packageJson); - - // const wranglerToml = { - // filePath: path.join(process.cwd(), "wrangler.toml"), - // toml: `name = "${name}"\ncompatibility_date = "2024-09-05"\npages_build_output_dir= "./${outDir}"\n`, - // }; - const routes = { version: 1, description: "Generated by `domco/adapter/cloudflare`.", @@ -124,10 +116,6 @@ export const adapter: AdapterBuilder = async () => { await fs.mkdir(outDir, { recursive: true }); - // if (!(await fileExists(wranglerToml.filePath))) { - // await fs.writeFile(wranglerToml.filePath, wranglerToml.toml); - // } - await Promise.all([ copyClient(outDir), copyServer(outDir),