Skip to content

Add Cloudflare Artifacts binding - #1435

Merged
sam-goodwin merged 2 commits into
alchemy-run:mainfrom
oiwa-coder:codex/cloudflare-artifacts-binding
Jul 8, 2026
Merged

Add Cloudflare Artifacts binding#1435
sam-goodwin merged 2 commits into
alchemy-run:mainfrom
oiwa-coder:codex/cloudflare-artifacts-binding

Conversation

@oiwa-coder

Copy link
Copy Markdown
Contributor

Summary

Adds first-class Cloudflare Artifacts binding support to Alchemy.

This introduces an Artifacts(...) helper that can be used in Worker bindings, emits the binding into Worker upload metadata, includes it in generated Wrangler config, and maps the bound Worker env type to Cloudflare Workers' Artifacts runtime type.

Why

Cloudflare Artifacts can be bound to Workers, but Alchemy did not know how to serialize that binding during Worker deployment. As a result, projects could add Artifacts to generated Wrangler config manually, but the binding could disappear or fail to deploy correctly when Alchemy uploaded the Worker metadata.

Changes

  • Add Artifacts(...) binding helper under alchemy/cloudflare

  • Add Artifacts to the Cloudflare binding union and Worker binding spec

  • Serialize Artifacts bindings into Worker metadata as:

    {
      type: "artifacts",
      name,
      namespace
    }
  • Emit artifacts in generated Wrangler config with remote local-dev behavior by default

  • Map Bound<Artifacts> to the Workers runtime Artifacts type

  • Add a focused Wrangler config test for Artifacts bindings

  • Fail fast in Alchemy local dev for Artifacts bindings until local/remote dev support is implemented

Notes

This is binding support only. Artifacts namespaces are implicit on Cloudflare and are created when the first repository is created in the namespace, so this PR does not add a separate namespace lifecycle resource with adopt / delete.

Validation

bun vitest run ./alchemy/test/cloudflare/wrangler-json.test.ts -t "with Artifacts binding"

Passes.

@sam-goodwin

Copy link
Copy Markdown
Collaborator

Please add test in worker.test.ts that exercises creating a worker and ensuring the worker deploys and the bining is accessible

@oiwa-coder

Copy link
Copy Markdown
Contributor Author

@sam-goodwin done!

@sam-goodwin
sam-goodwin merged commit 4f82afd into alchemy-run:main Jul 8, 2026
1 check passed
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