[wrangler] Fix init --from-dash with Yarn Classic#12280
[wrangler] Fix init --from-dash with Yarn Classic#12280petebacondarwin merged 4 commits intomainfrom
Conversation
🦋 Changeset detectedLatest commit: de4cd06 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 |
|
Claude finished @penalosa's task —— View job Changeset Review✅ All changesets look good The changeset
The changeset provides excellent detail about both the problem (Yarn Classic's handling of version specifiers) and the solution (removing the version specifier since C3 has auto-update behavior). |
create-cloudflare
@cloudflare/kv-asset-handler
miniflare
@cloudflare/pages-shared
@cloudflare/unenv-preset
@cloudflare/vite-plugin
@cloudflare/vitest-pool-workers
@cloudflare/workers-editor-shared
@cloudflare/workers-utils
wrangler
commit: |
|
@claude this is a pretty complex fix. Instead, I'd like to change the default C3 command in Wrangler to not include a version specifier. C3 has had auto-update behaviour for over two years now, and so specifying a version is no longer needed. |
|
Claude finished @penalosa's task —— View job Simplifying C3 Command Approach ✅Good point! Since C3 has auto-update behavior, we can simplify this significantly by just removing the version specifier entirely. Todo List:
Changes implemented:
This approach is much cleaner than the original complex detection logic and resolves the Yarn Classic issue by simply removing the problematic version specifier entirely. Since C3 has had auto-update behavior for over two years, the version specifier was no longer necessary anyway. Files modified:
✅ Changes have been committed and pushed to the PR branch. |
|
@claude fix CI checks |
|
Claude finished @penalosa's task —— View job Fix CI Checks ✅
Issues found and fixed:
The core logic of your PR was correct - these were just documentation and formatting inconsistencies that would cause linting failures. The CI checks should now pass. Changes committed and pushed:
|
Yarn Classic (v1.x) doesn't properly handle version specifiers with special characters like ^ in yarn create commands. It installs the package correctly but fails to find the binary because it looks for a path like .yarn/bin/create-cloudflare@^2.5.0 instead of .yarn/bin/create-cloudflare. This fix strips version specifiers from the C3 command when using Yarn, allowing Yarn to install and run the latest compatible version of create-cloudflare. Fixes #8269
Remove version specifier from default C3 command since C3 has auto-update behavior. This resolves Yarn Classic compatibility issues without complex package manager detection logic. Co-authored-by: Somhairle MacLeòid <penalosa@users.noreply.github.com>
- Update comment in factory.ts to reflect new default command - Update comment in misc-variables.ts to reflect new default command - Remove extra blank line in init.ts Co-authored-by: Somhairle MacLeòid <penalosa@users.noreply.github.com>
35384d5 to
de4cd06
Compare
Fixes #8269.
When using Yarn Classic (v1.x), running
wrangler initorwrangler init --from-dashwould fail because Yarn Classic doesn't properly handle version specifiers with special characters like^inyarn createcommands. Yarn would install the package correctly but then fail to find the binary because it would look for a path like.yarn/bin/create-cloudflare@^2.5.0instead of.yarn/bin/create-cloudflare.This fix removes the version specifier from the default C3 command entirely. Since C3 has had auto-update behavior for over two years, specifying a minimum version is no longer necessary and removing it resolves the Yarn Classic compatibility issue.