-
Notifications
You must be signed in to change notification settings - Fork 11
Fix Cloudflare Env type collision by adding worker-configuration.d.ts #62
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Conversation
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
Ignore MCP (Model Context Protocol) configuration file to keep it out of version control. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
Add project-specific documentation to guide Claude Code when working with this repository. This includes: - Common development commands (build, test, lint) - Architecture overview of core components - Development constraints and code style guidelines - Testing approach and patterns 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
- Update devDependency from ^4.20250417.0 to latest - Update peerDependency constraint from >=4.20240405.0 to latest 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
Configure built dependencies handling for pnpm workspace 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
🦋 Changeset detectedLatest commit: d119cec The changes in this PR will be included in the next version bump. Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
Generated files should not be formatted to avoid conflicts with tooling. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
Added watch mode for tests to improve development experience. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
- Applied Prettier formatting for consistent markdown style - Fixed list formatting and spacing issues - Added proper line endings 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
Added configuration for Serena AI development assistant: - Project definition and TypeScript language setup - Formatted configuration files according to project standards 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
…onfig Remove @cloudflare/workers-types/2023-07-01 and /experimental from the types array in tsconfig.json as these packages are not installed and cause CI type-checking failures. The worker-configuration.d.ts file generated by Wrangler already provides the necessary Cloudflare Workers type definitions. Fixes CI errors: - TS2688: Cannot find type definition file for '@cloudflare/workers-types/2023-07-01' - TS2688: Cannot find type definition file for '@cloudflare/workers-types/experimental' 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
Deploying yjs-worker with
|
| Latest commit: |
d119cec
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://77812efd.yjs-worker.pages.dev |
| Branch Preview URL: | https://issues-61.yjs-worker.pages.dev |
commit: |
Contributor
📊 Package size report 2%↑
Unchanged files
🤖 This report was automatically generated by pkg-size-action |
Add comprehensive troubleshooting documentation for the Cloudflare.Env type collision issue described in GitHub issue #61. The new section includes: - Problem description: Empty Cloudflare.Env interface from @cloudflare/workers-types overwriting custom environment types - Step-by-step solution: Check dependencies, clean install, and verify fix - Reference to PR #62 where the issue was addressed - Explanation of why residual dependencies may persist in lock files This helps users resolve TypeScript type resolution issues when using y-durableobjects with Cloudflare Workers and custom environment types. Resolves documentation part of #61 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
Update the troubleshooting section to recommend using `wrangler types` command (introduced in Wrangler v3) as the preferred approach for generating TypeScript types for Cloudflare Workers. Changes: - Add "Recommended Approach" subsection explaining wrangler types - Update reference from "wrangler@4" to "wrangler types" for accuracy - Provide clear instructions for generating types with example command - Emphasize that wrangler types generates accurate, up-to-date definitions This addresses the modern best practice for Cloudflare Workers type generation and helps users avoid type collision issues proactively. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
Update the changeset description to better reflect the comprehensive nature of the TypeScript support improvements in this patch release. The updated description now includes: - Detailed breakdown of all four major improvements made - Clear explanation of CI failure fixes and type collision resolution - Documentation of wrangler types adoption (introduced in Wrangler v3) - Emphasis on automatic benefits for users without code changes - Modern best practice guidance for Cloudflare Workers type generation This provides clearer context for the release notes and helps users understand the full scope of improvements included in this patch. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
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
worker-configuration.d.tsgenerated by Wrangler to fix Cloudflare Env type collision issueProblem
As reported in #61, when extending YDurableObjects and exporting the class, there's a type collision where the Env interface points to node_modules instead of the project-specific Cloudflare.Env definitions in worker-configuration.d.ts.
Solution
worker-configuration.d.tsusingwrangler typescommandTest plan
Fixes #61
🤖 Generated with Claude Code