Skip to content

feat(website): serve alchemy.run, redirect v2.alchemy.run to it - #806

Merged
sam-goodwin merged 4 commits into
mainfrom
claude/alchemy-domain-migration-a03196
Jul 15, 2026
Merged

feat(website): serve alchemy.run, redirect v2.alchemy.run to it#806
sam-goodwin merged 4 commits into
mainfrom
claude/alchemy-domain-migration-a03196

Conversation

@sam-goodwin

@sam-goodwin sam-goodwin commented Jul 11, 2026

Copy link
Copy Markdown
Contributor

The v2 website takes over the apex domain. In prod the Worker attaches both hostnames, and a Single Redirect ruleset 301s v2.alchemy.run to alchemy.run at the edge (path + query preserved), so requests never reach the Worker:

domain: stack.stage === "prod" ? ["alchemy.run", "v2.alchemy.run"] : undefined,
const zone = yield* Cloudflare.Zone.Zone("Zone", { name: "alchemy.run" })
  .pipe(AdoptPolicy.adopt(true), RemovalPolicy.retain());

yield* Cloudflare.Ruleset.Ruleset("V2Redirect", {
  zone,
  phase: "http_request_dynamic_redirect",
  rules: [{
    expression: 'http.host eq "v2.alchemy.run"',
    action: "redirect",
    actionParameters: {
      fromValue: {
        targetUrl: { expression: 'concat("https://alchemy.run", http.request.uri.path)' },
        preserveQueryString: true,
        statusCode: 301,
      },
    },
  }],
});
  • The zone is adopted (it predates this stack) and retained on destroy.
  • Canonical site URL moves from v2.alchemy.run to alchemy.run: astro site, worker CANONICAL_HOST, llms.txt (regenerated), agent prompt, README, docs example.

Deploy order: https://github.com/alchemy-run/alchemy/pull/1448 must merge/deploy first — the Worker provider refuses to attach a hostname that is still attached to another Worker, and alchemy.run is currently on the v1 router Worker.

Also in this PR:

  • Sweeps the remaining v2.alchemy.run references: Stack error message, AUTH_LANDING_HOST (/auth/success / /auth/error), migration-guide links to v1.alchemy.run, stale tutorial URLs in test comments.
  • Preview-aware site URLs: the copy-for-agent prompt is built from window.location.origin after hydration, and the Worker rewrites llms.txt's baked canonical origin to the request origin on non-canonical hosts — PR previews now reference themselves instead of prod.
  • Bumps distilled for fix(cloudflare/rulesets): putPhas redirect status_code is a number distilled#380 (putPhas redirect status_code is a number, not a string) — required for the V2Redirect ruleset to encode/decode. Merge that PR first so the submodule pointer lands on distilled main.

🤖 Generated with Claude Code

The v2 website takes over the apex domain. The prod Worker now attaches
both alchemy.run and v2.alchemy.run, and a http_request_dynamic_redirect
Ruleset 301s v2.alchemy.run to alchemy.run (path + query preserved).
Canonical site URL references move from v2.alchemy.run to alchemy.run.

Requires the v1 website deploy (alchemy-run/alchemy) to land first so the
apex custom domain is detached from the v1 router Worker.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@alchemy-version-bot

alchemy-version-bot Bot commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Install the packages built from this commit:

alchemy

bun add alchemy@https://pkg.ing/alchemy/51f36f1

@alchemy.run/better-auth

bun add @alchemy.run/better-auth@https://pkg.ing/@alchemy.run/better-auth/51f36f1

@alchemy.run/pr-package

bun add @alchemy.run/pr-package@https://pkg.ing/@alchemy.run/pr-package/51f36f1

sam-goodwin and others added 2 commits July 15, 2026 13:59
…view-aware

- Stack error message and AUTH_LANDING_HOST (/auth/success, /auth/error
  landing pages) move to alchemy.run; stale tutorial URLs in test
  comments updated
- agent prompt is now built from the page's own origin after hydration,
  so PR previews produce prompts that point at themselves
- the Worker rewrites llms.txt's baked canonical origin to the request
  origin on non-canonical hosts (same treatment as HTML canonical tags)
- blog homepage link is relative
- distilled: putPhas redirect status_code patched to number
  (alchemy-run/distilled#380) — required for the V2Redirect ruleset to
  encode and decode

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@sam-goodwin
sam-goodwin merged commit 85ed5e3 into main Jul 15, 2026
4 checks passed
@sam-goodwin
sam-goodwin deleted the claude/alchemy-domain-migration-a03196 branch July 15, 2026 21:07
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.

1 participant