Add Cloudflare Artifacts binding - #1435
Merged
sam-goodwin merged 2 commits intoJul 8, 2026
Merged
Conversation
Collaborator
|
Please add test in worker.test.ts that exercises creating a worker and ensuring the worker deploys and the bining is accessible |
Contributor
Author
|
@sam-goodwin done! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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'Artifactsruntime 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 underalchemy/cloudflareAdd Artifacts to the Cloudflare binding union and Worker binding spec
Serialize Artifacts bindings into Worker metadata as:
Emit
artifactsin generated Wrangler config with remote local-dev behavior by defaultMap
Bound<Artifacts>to the Workers runtimeArtifactstypeAdd 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.