Skip to content

feat(cli): validate deployment runtimes and tool requirements - #1110

Merged
AmanVarshney01 merged 6 commits into
aman/prisma-framework-deploymentsfrom
feat/alchemy-v2
Aug 12, 2026
Merged

AmanVarshney01 merged 6 commits into
aman/prisma-framework-deploymentsfrom
feat/alchemy-v2

Conversation

@AmanVarshney01

@AmanVarshney01 AmanVarshney01 commented Jul 9, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • Honor the selected Bun or Node runtime across Docker, Cloudflare, and Prisma deployment output instead of inferring it from the package manager.
  • Validate the local Node/Bun/package-manager requirements before scaffolding and recommend a modern Bun release for workspace catalogs and current tooling.
  • Consume the restacked beta.72 framework/provider work without the obsolete beta.70 Effect pin or npm rejection.
  • Keep the final graph on exact alchemy@2.0.0-beta.72 and Effect/platform beta.107 versions with no override, provider patch, hoisting rule, or linker workaround.
  • Harden generated PlanetScale MySQL + Drizzle infra and SolidStart Cloudflare production builds based on the fresh complete template audit.

Stack

Layer 8 of 8. Previous: #1152.

This is the top of native GitHub stack #1150. Merge the stack together so every feature PR contributes its own release-note entry.

Verification

  • bun run check
  • bun run build:cli
  • CLI suite: 652 passed, 29 skipped, 0 failed
  • Fresh 68-project inspection matrix: 68/68 structure, 68/68 typecheck, 68/68 production-build checks passed
  • All examples have dependencies installed with their selected Bun, npm, or pnpm package manager
  • Coverage includes every affected Cloudflare framework, D1/Neon/PlanetScale/Prisma Postgres path, Prisma deployment framework, Sentry integration, SolidStart v2 combination, runtime selection, Docker template, Nx, and Vite+
  • Both npx alchemy --help and bunx alchemy --help start with beta.72 + Effect beta.107
  • The docs-site build compiles and reaches Convex-backed prerendering, which requires the real deployment environment

The remaining generated compatibility code is narrow and documented in the local matrix README: generic StaticSite memo invalidation, Alchemy's injected-Vite guard pending #1183, the registered React Router Worker entry, and explicit typed Astro bindings. There are no dependency overrides, patches, hoisted-linker requirements, git dependencies, custom Alchemy wrappers, manually resolved Outputs, duplicate database files, or synthetic SPA servers.

The only current npm metadata rough edge is Alchemy's exact optional Drizzle RC peer: npm ls drizzle-orm reports it against the app's stable Drizzle, while install, typecheck, build, and Alchemy startup pass. The template intentionally does not change the application's ORM or package-manager layout to suppress that upstream metadata result.

Stack created with GitHub Stacks CLI • Give Feedback 💬

@vercel

vercel Bot commented Jul 9, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
create-better-t-stack-web Ready Ready Preview Aug 12, 2026 8:16pm

Request Review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 21104be00e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@coderabbitai

coderabbitai Bot commented Jul 9, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

Walkthrough

This PR updates Cloudflare deployment generation, D1 setup, frontend templates, dependency wiring, environment typing, and CLI guidance for Effect-based Alchemy stack output.

Changes

Cloudflare Alchemy migration

Layer / File(s) Summary
Alchemy stack and Cloudflare resource generation
packages/template-generator/templates/packages/infra/alchemy.run.ts.hbs, packages/template-generator/src/templates.generated.ts
Generates Effect-based Alchemy stacks with Cloudflare Workers, Websites, D1 bindings, typed environments, serialized build values, and returned resource URLs.
Cloudflare frontend and environment templates
packages/template-generator/templates/frontend/*, packages/template-generator/templates/extras/env.d.ts.hbs, packages/template-generator/templates/packages/env/*, packages/template-generator/src/templates.generated.ts
Updates Cloudflare adapters, SSR worker entry wiring, Nuxt configuration, environment typing, and dotenv loading.
Cloudflare generator wiring and dependencies
packages/template-generator/src/processors/*, packages/template-generator/src/post-process/package-configs.ts, packages/template-generator/src/utils/*, packages/template-generator/templates/backend/*
Refactors Cloudflare plugin generation, dependency selection, local D1 scripts, Prisma worker builds, dependency pins, and generated ignore rules.
D1 setup and CLI instructions
apps/cli/src/helpers/database-providers/d1-setup.ts, apps/cli/src/helpers/core/post-installation.ts, packages/template-generator/src/processors/readme-generator.ts
Uses a package-local Prisma SQLite database, adds local D1 migration guidance, and documents first-deploy Cloudflare login and staged deployments.
Cloudflare and D1 integration validation
apps/cli/test/*
Updates generated-project assertions for Cloudflare stack output, frontend configuration, D1 files, Prisma builds, and post-install command ordering.

Possibly related issues

Possibly related PRs

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 20.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title describes real CLI runtime and dependency changes, but it does not identify the main Alchemy v2 Cloudflare template migration.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🧹 Nitpick comments (1)
packages/template-generator/templates/packages/infra/alchemy.run.ts.hbs (1)

79-573: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚖️ Poor tradeoff

Consider reducing duplication between self-backend and non-self-backend web worker sections.

The self-backend web export block (lines 79–331) and the non-self-backend inline web worker block (lines 345–561) share near-identical StaticSite/Vite structures with Effect.gen wrappers, differing primarily in env var contents. This ~480-line span could benefit from a Handlebars partial or a shared env-var sub-template to reduce maintenance burden when adding frameworks or env vars.


ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: fe61af49-b6d0-497c-9fa4-4b021427f869

📥 Commits

Reviewing files that changed from the base of the PR and between e1bf536 and 21104be.

📒 Files selected for processing (19)
  • apps/cli/src/helpers/core/post-installation.ts
  • apps/cli/test/addons.test.ts
  • apps/cli/test/deployment.test.ts
  • packages/template-generator/src/processors/alchemy-plugins.ts
  • packages/template-generator/src/processors/deploy-deps.ts
  • packages/template-generator/src/processors/env-vars.ts
  • packages/template-generator/src/processors/infra-deps.ts
  • packages/template-generator/src/processors/readme-generator.ts
  • packages/template-generator/src/template-handlers/packages.ts
  • packages/template-generator/src/templates.generated.ts
  • packages/template-generator/src/utils/add-deps.ts
  • packages/template-generator/templates/extras/env.d.ts.hbs
  • packages/template-generator/templates/frontend/astro/astro.config.mjs.hbs
  • packages/template-generator/templates/frontend/nuxt/nuxt.config.ts.hbs
  • packages/template-generator/templates/frontend/react/react-router/vite.config.ts.hbs
  • packages/template-generator/templates/frontend/svelte/svelte.config.js.hbs
  • packages/template-generator/templates/packages/env/src/cloudflare-local.ts.hbs
  • packages/template-generator/templates/packages/env/src/server.ts.hbs
  • packages/template-generator/templates/packages/infra/alchemy.run.ts.hbs
💤 Files with no reviewable changes (3)
  • packages/template-generator/templates/packages/env/src/cloudflare-local.ts.hbs
  • packages/template-generator/src/processors/env-vars.ts
  • packages/template-generator/src/template-handlers/packages.ts

@AmanVarshney01

Copy link
Copy Markdown
Owner Author

Deep-review findings addressed (cb8a469)

A second review pass (Codex, run locally) reported 4 P1 + 4 P2 findings. Each was verified empirically before acting:

Confirmed and fixed:

  • nuxt/tanstack-start + backend: self builds failed resolving cloudflare:workers from packages/env — reproduced, fixed by externalizing it in the node-side builds (and dropping nitro prerender for self, which executes worker-only code in node). Both build clean now.
  • Local dev lost D1 for fullstack StaticSite frameworks (next/nuxt/svelte/astro + dbSetup: d1): fixed with a generated apps/web/wrangler.jsonc (d1 binding + migrations dir) feeding each framework's platform proxy (next: initOpenNextCloudflareForDev, nuxt: nitro-cloudflare-dev, svelte/astro: adapter-native), plus db:migrate:local scripts. All four verified with live sign-up requests writing to local D1 through the framework dev servers (HTTP 200).
  • svelte _worker.js/_routes.json uploaded as public assets — confirmed against alchemy's asset reader (only .assetsignore/_headers/_redirects are ignored by default); fixed by shipping static/.assetsignore, verified to land in the adapter output.
  • react-router + clerk missing worker credentials — added CLERK_SECRET_KEY + VITE_CLERK_PUBLISHABLE_KEY; entry.server now matches RR's official CF template (isbot-aware streaming).
  • OpenNext wrangler config stale — compatibility_date: 2025-05-05, added global_fetch_strictly_public.
  • README stage semantics — deploy default is dev_$USER (verified in alchemy CLI source); README now shows the explicit production command and no longer links the v1-era guide.

Refuted with evidence:

  • "serverWorker.url.as<string>() serializes as undefined in StaticSite env" — contradicted by the live smoke deploy: the deployed SPA bundle contained the real *.workers.dev server URL (grepped from dist/ after deploy), not the .env localhost fallback.
  • One reported dev failure (svelte 404) traced to a stray process from the review run itself occupying port 5173 — passes once the port is free.

Deferred as follow-ups: WORKER_SELF_REFERENCE service binding for Next ISR/res.revalidate() (needs upstream self-binding wiring), astro IMAGES binding (not required with the adapter's default imageService: "compile"), @cloudflare/workers-types v5 bump (pre-existing), and the cloudflare-alchemy web-guide rewrite.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 50c00395-0eec-4933-8a7f-bf8fdce12abd

📥 Commits

Reviewing files that changed from the base of the PR and between 1d9a2a7 and cb8a469.

📒 Files selected for processing (8)
  • packages/template-generator/src/post-process/package-configs.ts
  • packages/template-generator/src/processors/alchemy-plugins.ts
  • packages/template-generator/src/processors/deploy-deps.ts
  • packages/template-generator/src/processors/readme-generator.ts
  • packages/template-generator/src/templates.generated.ts
  • packages/template-generator/templates/frontend/nuxt/nuxt.config.ts.hbs
  • packages/template-generator/templates/frontend/react/tanstack-start/vite.config.ts.hbs
  • packages/template-generator/templates/packages/infra/alchemy.run.ts.hbs
🚧 Files skipped from review as they are similar to previous changes (2)
  • packages/template-generator/templates/packages/infra/alchemy.run.ts.hbs
  • packages/template-generator/src/templates.generated.ts

@AmanVarshney01

Copy link
Copy Markdown
Owner Author

Second review round addressed (c469036)

Verified each finding empirically again. Outcomes:

Confirmed → fixed:

  • Typecheck (TS2345 ×3) — real; the new frontend-array checks now use as const. bun run typecheck in template-generator is clean; the 5 remaining CLI errors are pre-existing in compatibility-rules.ts (untouched).
  • db:migrate:local filtered a nonexistent workspace — real; now filters web (the actual package name).
  • Nuxt dev page SSR 500 — real, and subtle: my earlier probe only hit the API route (200 via nitro-cloudflare-dev); the page path builds an in-process oRPC client under vite-node, which can't resolve cloudflare:workers. Fixed with a $development-scoped alias to a getPlatformProxy shim (shares miniflare state with nitro-cloudflare-dev). Verified: / renders 200 and a sign-up writes to local D1 in dev.
  • Prisma + D1 local migrations no-op — real; wrangler config now sets migrations_pattern: "*/migration.sql" for prisma's nested layout. Note: deploy-time prisma migrations hit an upstream regression — alchemy v1 discovered migrations with a recursive glob, v2 reads flat files only (reported to the alchemy repro list).
  • Astro IMAGES — conceded: adapter v14's default is cloudflare-binding (not compile as I'd claimed); IMAGES: Cloudflare.Images.Images() is now bound alongside SESSION.
  • global_fetch_strictly_public on the wrong config — correct catch; now set in the infra compatibility flags (the config alchemy actually deploys), kept in wrangler.jsonc for the build-time tooling.
  • README/post-install ordering — local-migration step now follows generation, and the CLI prints it.
  • Also fixed the flagged pre-existing oRPC context bug (_env destructure vs env return → ReferenceError for auth=none + cloudflare).

Refuted (again), now with a third live artifact: "StaticSite builds bake localhost:3000 into production." A fresh both-Cloudflare deploy of the current template inlined the real outputtest-server-…workers.dev URL into dist/ — even though that particular run failed partway on an unrelated account limit. The localhost:3000 strings visible in bundles are the dead fallback branch of env.VITE_SERVER_URL ?? "http://localhost:3000" — unreachable code, not the resolved value. Three independent deploys have now confirmed Outputs resolve through StaticSite env.

Deferred: WORKER_SELF_REFERENCE (needs upstream self-binding wiring), TanStack Start dev:bare page-SSR without alchemy (primary dev flow has full bindings via Website.Vite).

Suite: 550 tests, 0 fail; lint clean; generator typecheck clean.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
apps/cli/src/helpers/core/post-installation.ts (1)

626-633: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚖️ Poor tradeoff

Duplicated hasLocalD1 logic across two files.

The hasLocalD1 computation and framework list ["next", "nuxt", "svelte", "astro"] is duplicated verbatim in packages/template-generator/src/post-process/package-configs.ts:200-208. If the supported framework set changes, both locations must be updated in lockstep. Consider extracting this predicate into a shared utility (e.g., in packages/types or a shared helpers module) to keep a single source of truth.


ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 41081fec-310d-4a57-9cd3-aa7cbdd7d5b6

📥 Commits

Reviewing files that changed from the base of the PR and between cb8a469 and c469036.

📒 Files selected for processing (9)
  • apps/cli/src/helpers/core/post-installation.ts
  • packages/template-generator/src/post-process/package-configs.ts
  • packages/template-generator/src/processors/alchemy-plugins.ts
  • packages/template-generator/src/processors/deploy-deps.ts
  • packages/template-generator/src/processors/readme-generator.ts
  • packages/template-generator/src/templates.generated.ts
  • packages/template-generator/templates/api/orpc/server/src/context.ts.hbs
  • packages/template-generator/templates/frontend/nuxt/nuxt.config.ts.hbs
  • packages/template-generator/templates/packages/infra/alchemy.run.ts.hbs
🚧 Files skipped from review as they are similar to previous changes (7)
  • packages/template-generator/templates/frontend/nuxt/nuxt.config.ts.hbs
  • packages/template-generator/src/post-process/package-configs.ts
  • packages/template-generator/src/processors/readme-generator.ts
  • packages/template-generator/src/processors/deploy-deps.ts
  • packages/template-generator/templates/packages/infra/alchemy.run.ts.hbs
  • packages/template-generator/src/processors/alchemy-plugins.ts
  • packages/template-generator/src/templates.generated.ts

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: e76e0c93-04d7-4e02-99fd-184b759ce71d

📥 Commits

Reviewing files that changed from the base of the PR and between c469036 and 7a36ca6.

📒 Files selected for processing (15)
  • apps/cli/src/helpers/core/post-installation.ts
  • apps/cli/src/helpers/database-providers/d1-setup.ts
  • apps/cli/src/utils/compatibility-rules.ts
  • apps/cli/test/cloudflare-db-clients.test.ts
  • apps/cli/test/database-setup.test.ts
  • apps/cli/test/deployment.test.ts
  • apps/cli/test/post-installation.test.ts
  • apps/cli/test/vite-plus-generator.test.ts
  • packages/template-generator/src/processors/alchemy-plugins.ts
  • packages/template-generator/src/processors/workspace-deps.ts
  • packages/template-generator/src/templates.generated.ts
  • packages/template-generator/src/utils/add-deps.ts
  • packages/template-generator/src/utils/generated-ignore-patterns.ts
  • packages/template-generator/templates/backend/server/base/tsdown.config.ts.hbs
  • packages/template-generator/templates/packages/infra/alchemy.run.ts.hbs
✅ Files skipped from review due to trivial changes (1)
  • apps/cli/src/utils/compatibility-rules.ts
🚧 Files skipped from review as they are similar to previous changes (4)
  • packages/template-generator/src/utils/add-deps.ts
  • packages/template-generator/src/processors/alchemy-plugins.ts
  • packages/template-generator/templates/packages/infra/alchemy.run.ts.hbs
  • packages/template-generator/src/templates.generated.ts

@AmanVarshney01

Copy link
Copy Markdown
Owner Author

Alchemy v2 / Astro follow-up status — 2026-07-13

I re-audited the current PR head (de07d42) against the exact published
alchemy@2.0.0-beta.61, current Alchemy main (a644c85), the current Astro Cloudflare adapter
(@astrojs/cloudflare@14.1.2), and live Cloudflare deployments. The canonical runnable evidence is
now in alchemy-v2-beta-repros@31b7a35.

Important reconciliation: the Output tests are not contradictory

The earlier three live deployments of this template were valid: the generated production bundle
received the real deployed *.workers.dev server URL, and the visible localhost:3000 text was only
the dead ?? fallback. StaticSite remains the right deployment foundation and should not be
removed.

There is nevertheless a real beta.61 bug in raw upstream StaticSite: it serializes an unresolved
Output before creating Command.Build. The new direct-upstream repro logged
SERVER_URL = <missing> and deployed that missing value. Our outputAwareStaticSite wrapper is why
the template succeeds. In other words: the template mechanism is vindicated, and it is currently
working around a confirmed upstream defect.

Upstream PR/release status

Area Current status What this PR should do
StaticSite Output and Config serialization Fixed by open, mergeable, green alchemy-effect#796 Keep outputAwareStaticSite and explicit Config resolution until a published exact release contains the fix and the combined live gate passes without them.
Pure-client Website.Vite output Fixed by merged alchemy-effect#795, but not released Keep the StaticSite fallback for TanStack Router/Solid until the containing release is pinned and a root + deep-link deploy passes.
Website.Vite.main escape hatch Added by merged alchemy-effect#779, but not released The explicit React Router handler remains required; after release we can pass it through main instead of relying on the beta workaround.
Relative custom Worker entry and external-Worker compatibility default Fixed by open alchemy-effect#796 Keep explicit compatibility flags and current path handling until the fix is released and live-reverified.
Rolldown Worker-entry resolution / silent {} handler fallback Open, mergeable cloudflare-tools#62, but its CI is currently failing This improves path resolution and fails loudly; it does not synthesize a React Router handler, so our registered custom entry is still needed.
Workspace memoization #796 documents/tests external include globs and fixes path normalization; it does not make the default workspace-aware Keep memo: false. A generic generator cannot safely infer every transitive workspace/root input.
alchemy logs authorization beta.61 already requests workers_observability:read; #796 improves the old-token error Reauthenticate before calling this an Alchemy permission bug. alchemy tail continuing to work is not proof that the telemetry token is fresh.

So the actual upstream wait is:

  1. Merge alchemy-effect#796.
  2. Fix CI and merge cloudflare-tools#62 where its plugin changes are needed.
  3. Publish an exact Alchemy release containing already-merged #779/#795 plus #796; merged main
    code alone cannot be consumed by generated projects pinned to beta.61.
  4. Re-run each removal gate independently before deleting a workaround. Exact version pinning remains
    permanent even after these fixes.

Newly confirmed Alchemy defects with no upstream PR yet

These are independent of Astro and remain present on current Alchemy main:

  • _headers / _redirects are dropped. Alchemy reads and hashes both files and excludes them
    from the ordinary asset manifest, but WorkerProvider never forwards their contents in Cloudflare's
    asset configuration. The live repro served /asset.txt without its configured header and returned
    404 for the configured redirect.
  • Asset MIME detection is incomplete. The uploader's small hardcoded table sends AVIF, JPEG,
    WebP, WOFF2, and other common files as application/octet-stream. The live repro confirmed the
    wrong type for all four fixtures.

There is currently no issue/PR fixing either defect, so the existing upstream PRs are not the entire
Alchemy cleanup story. Repros:
10-assets-headers-redirects and
11-assets-mime-types.

Astro: what works and what is still missing

The basic Astro SSR shape is sound: StaticSite can deploy dist/client with
dist/server/entry.mjs, bundle: false, and the ASSETS binding. Alchemy's own
#621 spike live-deployed that exact
shape. The old framework-specific Astro PR #57
was closed and is obsolete; maintainers have preferred a generic framework-build path.

What Alchemy still does not consume is Astro's generated Wrangler/deploy contract:

  • compatibility date/flags and custom entrypoint;
  • client asset configuration;
  • conditional SESSION, IMAGES, and custom binding names;
  • custom user bindings and auxiliary workers;
  • environment-specific builds via CLOUDFLARE_ENV;
  • asset _headers/_redirects behavior and correct MIME types.

There is no active Astro implementation PR for that contract. The general framework-adapter problem
also remains open in alchemy-effect#772.
Therefore, even after the currently open PRs merge and release, Astro will still be a manually mapped,
experimental integration rather than first-class adapter parity.

Better-T-Stack work that is ours, not upstream's

The current PR still has a few independent follow-ups:

  • The self-backend Astro branch binds both SESSION and IMAGES, but the separate-backend/web branch
    binds only SESSION. Astro 14's default image mode is cloudflare-binding, so the split branch
    also needs IMAGES unless the template explicitly selects another image service.
  • Compatibility dates drift: Astro 14.1.2 defaults to 2026-04-15, Alchemy beta.61 defaults to
    2026-03-17, and the generated D1 development Wrangler config uses 2025-05-05. Production and
    development should intentionally agree instead of inheriting three different dates.
  • Split Cloudflare environment typing currently selects ServerEnv for the web app, so web-only
    bindings such as Astro SESSION/IMAGES are not represented by the generated CloudflareEnv.
  • The deployment test loops prove generation succeeds but have no Astro-specific assertions for
    entrypoint, assets, SESSION, IMAGES, compatibility settings, SSR/action behavior, or runtime
    image/session use.

These should not be deferred behind Alchemy releases because they are generator correctness gaps.

Verification evidence

  • All three new beta.61 repro projects typecheck against the exact package.
  • Live Output repro: upstream build received <missing> instead of the deployed API URL.
  • Live asset-rules repro: custom header absent; configured redirect returned 404.
  • Live MIME repro: .avif, .jpg, .webp, and .woff2 returned
    application/octet-stream.
  • Every temporary Worker/repro stage was destroyed successfully.
  • PR feat(cli): validate deployment runtimes and tool requirements #1110's current GitHub Test Suite check is green at de07d42.

Bottom line: keep StaticSite and the targeted workarounds. #779, #795, and #796 will let us
remove or simplify specific pieces only after a published release and focused re-verification.
cloudflare-tools#62 is a separate plugin dependency, while asset rules, MIME parity, and full Astro
metadata consumption still have no upstream fix to wait for.

@AmanVarshney01

Copy link
Copy Markdown
Owner Author

Alchemy beta.64 refresh (8ec796e6) — 2026-07-25

This branch is now merged with current main and reverified against the latest published Alchemy v2 beta.

Updated in this push

  • bumped generated infra to exact alchemy@2.0.0-beta.64
  • aligned Effect packages on exact 4.0.0-beta.101 so fresh projects do not resolve a mixed Effect beta graph
  • replaced stale alchemy-run/alchemy-effect and v2.alchemy.run references with alchemy-run/alchemy and alchemy.run
  • retained the StaticSite-based paths and outputAwareStaticSite; beta.64 does not contain the serialization fix needed to remove that wrapper
  • retained explicit compatibility/path handling and memo: false
  • reconciled the PR with current CLI changes on main, including post-install output/tests
  • refreshed the findings document and OpenSpec release/removal gates

What changed upstream

  • Alchemy #779, #795, and cloudflare-tools#62 are represented in beta.64.
  • alchemy#928 fixes _headers/_redirects on main, but it is not released yet.
  • alchemy#796, covering StaticSite Output/Config serialization and related external-worker behavior, is still open and conflicting.
  • alchemy#886 (Astro/SvelteKit/Waku) and alchemy#923 (Next) remain draft/conflicting, so the template still needs its explicit adapter-output mappings.
  • Asset MIME coverage remains incomplete on current Alchemy main.
  • Newly documented: beta.64 installs @distilled.cloud/cloudflare@0.30.1 beside Cloudflare runtime/plugin packages that declare peer ^0.29.0. Bun warns, but generated installs and typechecks succeed. I did not find a matching upstream issue/PR.

Runnable evidence remains in alchemy-v2-beta-repros.

Verification

  • bun run check ✅
  • bun run build ✅
  • template-generator typecheck ✅
  • CLI suite: 568 pass, 9 skip, 0 fail ✅
  • OpenSpec strict validation ✅
  • fresh combined Cloudflare and Astro project installs ✅
  • generated app and direct infra typechecks ✅
  • Astro IMAGES binding present ✅

No Cloudflare resources were created or changed in this refresh. The earlier live deployments remain the runtime evidence; this pass specifically verifies current generation and dependency compatibility on beta.64.

Copy link
Copy Markdown
Owner Author

Progress update — 2026-07-25

The beta.64 refresh is complete on 8ec796e6.

Completed

  • merged the latest main into this branch and resolved the generator/test conflicts
  • bumped generated infra to exact alchemy@2.0.0-beta.64 and aligned Effect packages on 4.0.0-beta.101
  • updated links for the renamed alchemy-run/alchemy repository and current alchemy.run docs
  • refreshed the Alchemy findings document, repro references, and OpenSpec release/removal gates
  • verified fresh combined-Cloudflare and Astro generation, installation, app typechecks, direct infra typechecks, and the Astro IMAGES binding
  • verified the full CLI suite: 568 passed, 9 skipped, 0 failed
  • verified bun run check, bun run build, generator typecheck, and strict OpenSpec validation

Current PR state

  • Merge state: clean
  • Test Suite: passed
  • Vercel: passed
  • Vercel Preview Comments: passed

Remaining upstream gates

  • Alchemy #779, #795, and cloudflare-tools#62 are included in beta.64.
  • alchemy#928 is merged and fixes _headers/_redirects, but is not released yet.
  • alchemy#796 is still open/conflicting, so outputAwareStaticSite and the explicit compatibility/path workarounds must remain.
  • alchemy#886 and alchemy#923 remain draft/conflicting, so Astro/SvelteKit/Waku and Next still need explicit adapter-output mappings.
  • asset MIME coverage remains unresolved on current Alchemy main.
  • beta.64 still produces a non-fatal @distilled.cloud/cloudflare peer-range warning; generated installs and typechecks succeed.

The PR itself is ready from the template/repository side. The next cleanup is release-gated: after the relevant Alchemy fixes are published, bump the exact version and remove each workaround only after its focused generated-project and live-deploy test passes.

@waptik

waptik commented Jul 25, 2026

Copy link
Copy Markdown

Thanks for this pr. I'm following it up closely as I intend to migrate my current project from v1 to v1. It's using hono orpc and tanstack-start.

@AmanVarshney01

Copy link
Copy Markdown
Owner Author

Alchemy beta.66 evaluation and Cloudflare update (6319d205)

I evaluated the latest published candidate rather than moving the pin on source inspection alone.

Safe fix shipped

  • The split-backend Astro Cloudflare path now binds both adapter-required resources: SESSION and IMAGES.
  • Added an Astro-specific generation regression test and regenerated the embedded templates.

Why the Alchemy pin stays on beta.64

Beta.66 does contain the fixes we were waiting for:

  • alchemy#796: native StaticSite Output/Config build-env serialization
  • alchemy#928: _headers / _redirects forwarding

The direct beta.66 StaticSite path typechecks for generated Next and Astro infrastructure. However, beta.66 also regresses local D1 migrations. A generated Prisma D1 project with a real nested SQL migration fails during alchemy dev with:

Service not found: cloudflare-runtime/Runtime

Alchemy fixed that in merged alchemy#1009 at 5001713, but the fix landed after the beta.66 tag and no containing npm release exists yet.

I did not replace this with a template hack. Removing migrationsDir would break production migration application; a git SHA or conditional Alchemy versions would violate the exact-release policy. Therefore beta.66 is recorded as a rejected candidate, beta.64 remains the accepted pin, and outputAwareStaticSite stays until a release containing #1009 passes the complete gate.

Verification

  • formatting + lint: passed
  • root build: passed
  • template-generator build + typecheck: passed
  • CLI suite: 569 passed, 9 skipped, 0 failed
  • focused deployment generation: 46 passed, 0 failed
  • OpenSpec strict validation: passed
  • beta.66 D1 failure reproduced with a real migration; no remote Cloudflare resources were created or changed

The findings ledger and OpenSpec now include A10 and the precise release/removal gate. The next Alchemy release containing #1009 can be evaluated immediately; if its D1 gate passes, #796/#928 cleanup can proceed in the same bump.

@AmanVarshney01

Copy link
Copy Markdown
Owner Author

Alchemy beta.67 upgrade verified and pushed

Updated in 48e3bfba after merging current main into the branch.

What changed

  • Pinned generated Cloudflare projects to exact alchemy@2.0.0-beta.67.
  • Removed the A1/A2 compatibility code now fixed by released alchemy#796:
    • deleted outputAwareStaticSite and the duplicated Command.Build -> Worker implementation;
    • removed caller-side yield* Config.* / Effect.orDie props builders;
    • generated Next, Nuxt, SvelteKit, and Astro paths now call native Cloudflare.Website.StaticSite with Output and Config Inputs directly.
  • Kept the safeguards that are still justified: exact pinning, memo: false for generic StaticSite workspace builds, explicit React Router entry/rendering, external-Worker compatibility flags, the Nuxt development proxy, Prisma local Wrangler migration pattern, and Astro SESSION/IMAGES bindings.
  • Updated the Alchemy findings ledger and OpenSpec with beta.67 evidence and the current upstream repository name/status.

Release gates run

  • Confirmed npm next is beta.67 at tag commit da667f7.
  • Fresh generated Next, Nuxt, SvelteKit, and Astro projects installed, built, and directly typechecked their real beta.67 infrastructure.
  • A fresh Nuxt + Prisma D1 project ran alchemy dev with a real nested SQL migration: D1 creation/migration succeeded and the Nuxt page returned 200. This verifies released #1009.
  • A fresh web-only SvelteKit deploy passed Config.string directly to StaticSite; deployed Cloudflare metadata contained the concrete configured string, not a Config descriptor, and the route returned 200.
  • A fresh combined SvelteKit + Hono deploy passed native Output wiring: both Workers returned 200 and the built frontend contained the exact deployed server Worker URL.
  • A generated Next/OpenNext build also embedded its exact deployed server URL. Its upload then hit this account free-plan 3 MiB Worker limit; this is an account-size limit, not an Output regression.
  • Every owned verification stage, including the partial Next stage, was destroyed from its originating directory; Cloudflare inventory/URLs confirmed cleanup.
  • 573 passed, 13 skipped, 0 failed.
  • bun run check, template-generator typecheck, full monorepo build, and strict OpenSpec validation passed.

Remaining upstream work

  • #822, #796, #928, and #1009 are merged and present in the accepted release.
  • #886 and #923 are still draft, conflicting, and unreleased. They may eventually replace custom framework output mappings, but they do not block the current beta.67 template.
  • Full static-asset parity is not claimed yet: the canonical _headers/_redirects repro still needs a beta.67 live recheck, and incomplete MIME resolution remains open.
  • The non-fatal Distilled/Effect peer warnings remain upstream.
  • OpenNext self-binding/on-demand ISR remains an explicit limitation until its own live gate passes.

No new actionable review comments were present; old comments were already addressed or evidence-backed false positives.

@AmanVarshney01

Copy link
Copy Markdown
Owner Author

Fresh full-template audit is complete and pushed through the stack.

I regenerated 68 install-ready projects from the current CLI with Bun, npm, and pnpm. The matrix covers every combination affected by this stack: all changed Cloudflare framework paths, standalone Workers, D1, Neon, PlanetScale Postgres/MySQL, Prisma Postgres, Drizzle/Prisma, all supported Prisma deployment frameworks and mixed planes, every changed Sentry integration, SolidStart v2, Bun/Node runtime selection, Docker, Nx, and Vite+.

Final result:

  • structure and installed dependencies: 68/68
  • workspace typecheck: 68/68
  • production-build verification: 68/68
  • CLI suite: 652 passed, 29 skipped, 0 failed
  • lint/format and CLI build: passed

The audit caught and fixed two real generator defects:

  1. PlanetScale MySQL + Drizzle imported Prisma-only Effect Redacted helpers, producing an unused import under strict typechecking.
  2. SolidStart's local cloudflare:workers development alias was also active during ordinary production builds. It is now serve-only, while the runtime module stays external for workerd. Direct SolidStart Cloudflare builds now pass without pretending Alchemy injected its plugin.

No new workaround was added. Remaining compatibility code is limited to the documented upstream gates: memo: false for generic Next/Svelte workspace invalidation, injected-Vite guards pending alchemy-run/alchemy#1183, the explicit registered React Router Worker entry, and explicit typed Astro SESSION/IMAGES bindings. There are no overrides, patches, hoisting/linker requirements, git dependencies, custom Alchemy wrappers, manually resolved Outputs, duplicate infra database files, or synthetic SPA servers.

The local inspection matrix is at /Users/aman/dev/test/cbts-pr1110-template-matrix; every project keeps its dependencies installed and includes its exact reproducible command in bts.jsonc.

@AmanVarshney01

Copy link
Copy Markdown
Owner Author

Fresh Cloudflare infrastructure verification

Tested from projects generated by the current branch, using the released Alchemy beta.72 packages:

  • Passed live deploy, route/API probes, repeat deploy, and destroy: standalone Hono Worker, Nuxt, Astro, SvelteKit, SolidStart v2, TanStack Start, TanStack Router SPA + Hono Worker, and React Router SSR + Hono Worker.
  • Exercised Bun, npm, and pnpm plus plain workspaces, Turbo, Nx, and Vite+.
  • Verified Drizzle and Prisma D1 migrations, including Prisma nested migration directories; Better Auth signup returned 200 and wrote a user to D1; oRPC references and expected 404/redirect behavior passed.
  • Verified Astro KV and Images bindings, TanStack Router deep-link SPA fallback, and generated server URLs in deployed frontend bundles.
  • Repeat deploys preserved resource identity and did not recreate D1/KV. Every stage was destroyed; the Worker URLs returned 404 after propagation and the account inventory returned exactly to its pre-test four D1 databases and one KV namespace.

The live run exposed and this push fixes three DX issues:

  • Root npm/Turbo scripts now forward --stage, --yes, and other child arguments normally. A real TTY deployment also confirmed the Alchemy confirmation prompt is interactive through Turbo.
  • Cloudflare Better Auth now binds BETTER_AUTH_URL to Cloudflare.Worker.URL; a fresh SvelteKit deployment signed up successfully without a production URL override.
  • React Router uses Vite 8 native resolve.tsconfigPaths instead of the obsolete vite-tsconfig-paths plugin. A fresh generated project installed, built, and typechecked.

Next.js reached a successful OpenNext production build, but this Cloudflare free account rejected the upload because the compressed Worker exceeds its 3 MiB plan limit. Partial resources were successfully destroyed. This is an account-plan limit, not a template or Alchemy failure.

Verification after the fixes:

  • bun run check — passed
  • full monorepo build with the docs apps existing Convex env — passed
  • CLI suite — 650 passed, 29 gated generated-build samples skipped, 0 failed
  • targeted generated React Router install/build/typecheck — passed
  • git diff checks and pre-commit hooks — passed

Commit: 8c1e6a91

This branch was successfully deployed

1 active deployment
Preview — 91d5db26 Deployed Aug 12, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants