Repository navigation
fix(types): add ASSETS to the env types - #496
Conversation
Void always binds ASSETS, but CloudBindings and Cloudflare.Env do not declare it, so c.env.ASSETS has type unknown. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CZxFCFRcYc9ojkUsSvuz5j
…tput Also list ASSETS with the other binding types in the docs. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
|
@codex review |
|
Thanks! I pushed f49841a on top:
|
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f49841a78c
ℹ️ 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".
…rget has Node, Bun and Deno targets inject an ASSETS object whose fetch takes only a Request, so the full Fetcher let handlers type-check calls that fail there. Cloudflare.Env keeps Fetcher to merge with wrangler types output. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
|
@codex review |
|
Codex Review: Didn't find any major issues. Keep them coming! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
Problem
Void always binds
ASSETS, butCloudBindingsandCloudflare.Envdo not declare it. A route that reads a static file fails the type check:What this PR changes
ASSETS: Fetcheris added toCloudBindingsandCloudflare.Env.Decisions
On Node, the
ASSETSstand-in has onlyfetch.Fetcherfollows the other bindings, which use the Cloudflare types as they are. If you preferPick<Fetcher, 'fetch'>, I can change it.Testing
env-types-typecheck.test.tsnow callsc.env.ASSETS.fetch(). It fails onmainand passes with this change.🤖 Generated with Claude Code