From d37d4646b63537a96b427651cc478f54b9a621dc Mon Sep 17 00:00:00 2001 From: Maxwell Brown Date: Mon, 17 Aug 2026 07:34:20 -0400 Subject: [PATCH 01/28] get website running on workerd --- .gitignore | 3 + AGENTS.md | 7 + alchemy.run.ts | 22 + apps/web/astro.config.ts | 5 +- apps/web/package.json | 9 +- .../landing/sections/Examples.astro | 2 +- .../components/navigation/Navigation.astro | 2 +- .../navigation/NavigationDesktopActions.astro | 2 +- .../components/ui/toc/TableOfContents.astro | 10 +- .../features/api-reference/ApiReference.ts | 12 +- apps/web/src/features/open-graph/Fonts.ts | 85 +- apps/web/src/features/open-graph/Http.ts | 10 +- apps/web/src/features/open-graph/Model.ts | 10 - apps/web/src/features/open-graph/Renderer.ts | 54 +- .../features/playground/domain/workspace.ts | 6 +- .../playground/services/webcontainer.ts | 2 +- .../visual-effect/runtime/SoundManager.ts | 2 +- .../src/features/visual-effect/state/atoms.ts | 47 +- .../visual-effect/state/sound-atoms.ts | 31 + apps/web/src/pages/blog/[...slug].astro | 2 + apps/web/src/pages/docs/[...slug].astro | 2 + .../[version]/api/[package]/[...module].astro | 2 + .../docs/[version]/api/[package]/index.astro | 2 + .../src/pages/docs/[version]/api/index.astro | 2 + apps/web/src/pages/og/[...slug].png.ts | 7 +- .../src/pages/podcast/episodes/[slug].astro | 2 + apps/web/src/services/OpenGraph.ts | 87 +- .../features/api-reference/open-graph.test.ts | 41 - .../features/playground/workspace.test.ts | 13 + package.json | 5 +- packages/api-reference/package.json | 4 +- packages/api-reference/src/Reflection.ts | 6 +- packages/mixedbread/package.json | 6 +- packages/open-graph/package.json | 23 + packages/open-graph/src/Fonts.ts | 85 + packages/open-graph/src/OpenGraph.ts | 89 + packages/open-graph/src/Resvg.ts | 51 + packages/open-graph/src/Satori.ts | 49 + packages/open-graph/src/index.ts | 4 + packages/open-graph/src/wasm.d.ts | 4 + packages/open-graph/tsconfig.json | 8 + ..._cloudflare-frameworks@2.0.0-beta.72.patch | 104 + patches/alchemy@2.0.0-beta.72.patch | 54 + pnpm-lock.yaml | 3631 +++++++++++++---- pnpm-workspace.yaml | 16 +- tsconfig.json | 2 +- tsconfig.package.json | 6 - tsconfig.tests.json | 3 +- ...g.packages.json => tsconfig.workspace.json | 1 + 49 files changed, 3480 insertions(+), 1152 deletions(-) create mode 100644 alchemy.run.ts create mode 100644 apps/web/src/features/visual-effect/state/sound-atoms.ts create mode 100644 packages/open-graph/package.json create mode 100644 packages/open-graph/src/Fonts.ts create mode 100644 packages/open-graph/src/OpenGraph.ts create mode 100644 packages/open-graph/src/Resvg.ts create mode 100644 packages/open-graph/src/Satori.ts create mode 100644 packages/open-graph/src/index.ts create mode 100644 packages/open-graph/src/wasm.d.ts create mode 100644 packages/open-graph/tsconfig.json create mode 100644 patches/@alchemy.run__cloudflare-frameworks@2.0.0-beta.72.patch create mode 100644 patches/alchemy@2.0.0-beta.72.patch delete mode 100644 tsconfig.package.json rename tsconfig.packages.json => tsconfig.workspace.json (88%) diff --git a/.gitignore b/.gitignore index 4d9a14b6d..8990e0119 100644 --- a/.gitignore +++ b/.gitignore @@ -30,6 +30,9 @@ pnpm-debug.log* # TypeScript *.tsbuildinfo +# Alchemy +.alchemy + # Vercel .vercel .env* diff --git a/AGENTS.md b/AGENTS.md index 9f2f5a474..970d0067c 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -18,6 +18,13 @@ Docs are local at `node_modules/vite-plus/docs` or online at https://viteplus.de `vp ` runs a built-in command. `vp run ` runs a `package.json` script or a `vite.config.ts` task. Scripts cannot overwrite built-ins, so `vp dev` and `vp run dev` may do different things. Check `package.json` and `vite.config.ts` first, and run `vp run ` when the project defines a script or task with that name. +## Tool Versions + +Run `vp toolchain` to show versions and relationships in the active Vite+ +release. Add a tool name to select part of the graph. For example, run +`vp toolchain vite`. Use `--global` to ignore the local `vite-plus` package. Use +`vp why ` to show the package-manager dependency graph. + ## Review Checklist - [ ] Run `vp install` after pulling remote changes and before getting started. diff --git a/alchemy.run.ts b/alchemy.run.ts new file mode 100644 index 000000000..ed0cd6a9f --- /dev/null +++ b/alchemy.run.ts @@ -0,0 +1,22 @@ +import * as Alchemy from "alchemy" +import * as Cloudflare from "alchemy/Cloudflare" +import * as Effect from "effect/Effect" + +export default Alchemy.Stack( + "EffectWebsite", + { + providers: Cloudflare.providers(), + state: Cloudflare.state(), + }, + Effect.gen(function* () { + const website = yield* Cloudflare.Website.Astro("WebsiteWorker", { + rootDir: "./apps/web", + sessionKVBindingName: false, + prerenderEnvironment: "node", + }) + + return { + websiteUrl: website.url, + } + }), +) diff --git a/apps/web/astro.config.ts b/apps/web/astro.config.ts index 732c55581..a1480bed6 100644 --- a/apps/web/astro.config.ts +++ b/apps/web/astro.config.ts @@ -1,6 +1,6 @@ import mdx from "@astrojs/mdx" import react from "@astrojs/react" -import vercel from "@astrojs/vercel" +// import vercel from "@astrojs/vercel" import tailwindcss from "@tailwindcss/vite" import expressiveCode from "astro-expressive-code" import icon from "astro-icon" @@ -22,7 +22,7 @@ const FontsourceProvider = fontProviders.fontsource() const config = defineConfig({ site: "https://effect.website", - adapter: vercel(), + // adapter: vercel(), trailingSlash: "never", @@ -47,6 +47,7 @@ const config = defineConfig({ ], envDir: fileURLToPath(new URL("../../", import.meta.url)), resolve: { + dedupe: ["react", "react-dom"], alias: { "@/": fileURLToPath(new URL("./src/", import.meta.url)), "@astrojs/starlight/components": fileURLToPath( diff --git a/apps/web/package.json b/apps/web/package.json index ec575402b..a315d4ea3 100644 --- a/apps/web/package.json +++ b/apps/web/package.json @@ -17,7 +17,6 @@ "@iconify-json/fa7-brands": "^1.2.4", "@lucide/astro": "^1.21.0", "@mixedbread/sdk": "^0.77.0", - "@resvg/resvg-js": "^2.6.2", "@shikijs/core": "4.2.0", "@shikijs/engine-javascript": "4.2.0", "@shikijs/langs": "4.2.0", @@ -25,12 +24,13 @@ "@tanstack/react-table": "^8.21.3", "@upstash/redis": "^1.38.0", "@webcontainer/api": "^1.6.4", - "@website/api-reference": "workspace:*", - "@website/domain": "workspace:*", + "@website/api-reference": "workspace:^", + "@website/domain": "workspace:^", + "@website/open-graph": "workspace:^", "@xterm/addon-fit": "^0.11.0", "@xterm/xterm": "^6.0.0", "@zip.js/zip.js": "^2.8.26", - "astro": "^7.0.3", + "astro": "^7.2.2", "astro-expressive-code": "^0.43.1", "astro-icon": "^1.1.5", "astro-seo": "^1.1.0", @@ -44,7 +44,6 @@ "react": "^19.2.7", "react-dom": "^19.2.7", "react-resizable-panels": "^4.12.1", - "satori": "^0.26.0", "sharp": "^0.35.1", "shiki": "^4.2.0", "srt-parser-2": "^1.2.3", diff --git a/apps/web/src/components/landing/sections/Examples.astro b/apps/web/src/components/landing/sections/Examples.astro index 6f7589864..87796d1ac 100644 --- a/apps/web/src/components/landing/sections/Examples.astro +++ b/apps/web/src/components/landing/sections/Examples.astro @@ -4,7 +4,7 @@ import VisualEffects from "@/features/visual-effect/components/VisualEffects"
- +

diff --git a/apps/web/src/components/navigation/Navigation.astro b/apps/web/src/components/navigation/Navigation.astro index fca8aa279..826f7a799 100644 --- a/apps/web/src/components/navigation/Navigation.astro +++ b/apps/web/src/components/navigation/Navigation.astro @@ -70,4 +70,4 @@ const mobileSocialLinks = getNavigationLinks("mobile", "social")

- + diff --git a/apps/web/src/components/navigation/NavigationDesktopActions.astro b/apps/web/src/components/navigation/NavigationDesktopActions.astro index 405dcb286..bb38824e4 100644 --- a/apps/web/src/components/navigation/NavigationDesktopActions.astro +++ b/apps/web/src/components/navigation/NavigationDesktopActions.astro @@ -10,7 +10,7 @@ interface Props { const { showThemeToggle = false } = Astro.props --- - + diff --git a/apps/web/src/components/ui/toc/TableOfContents.astro b/apps/web/src/components/ui/toc/TableOfContents.astro index 56329531b..d26607e96 100644 --- a/apps/web/src/components/ui/toc/TableOfContents.astro +++ b/apps/web/src/components/ui/toc/TableOfContents.astro @@ -2,14 +2,8 @@ import Eyebrow from "@/components/ui/Eyebrow.astro" import TocLink from "@/components/ui/toc/TocLink.astro" -/** - * "On this page" table of contents — the presentational container shared by - * Docs, API Reference and Blog. It renders the label, divider and the (flat or - * nested) list from a generic `items` prop, and hosts the single scroll-spy - * `