Fix autoconfig package installation always failing at workspace roots#12676
Fix autoconfig package installation always failing at workspace roots#12676dario-piotrowicz wants to merge 1 commit intomainfrom
Conversation
🦋 Changeset detectedLatest commit: f83ab21 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 encountered an error —— View job Changeset Review
|
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: |
b3c3c29 to
7430698
Compare
7430698 to
f83ab21
Compare
There was a problem hiding this comment.
Devin Review found 1 new potential issue.
🐛 1 issue in files not directly in the diff
🐛 react-router framework missing isWorkspaceRoot in installPackages calls (packages/wrangler/src/autoconfig/frameworks/react-router.ts:146-157)
The ReactRouter.configure() method does not destructure isWorkspaceRoot from ConfigurationOptions and does not pass it to its two installPackages calls (lines 153 and 190). Every other framework that calls installPackages was updated in this PR to pass isWorkspaceRoot, but react-router.ts was missed.
Detailed Explanation
At packages/wrangler/src/autoconfig/frameworks/react-router.ts:146-149, the destructuring only extracts dryRun, projectPath, and packageManager:
async configure({
dryRun,
projectPath,
packageManager,
}: ConfigurationOptions)But isWorkspaceRoot is now a required field on ConfigurationOptions (packages/wrangler/src/autoconfig/frameworks/index.ts:11). The two installPackages calls at lines 153 and 190 don't include isWorkspaceRoot in their config objects.
Impact: When running autoconfig for a React Router project at the root of a monorepo workspace, the installPackages calls will not include workspace root flags (--workspace-root for pnpm, -W for yarn), causing the same "Running this command will add the dependency to the workspace root" errors that this PR is supposed to fix.
View 7 additional findings in Devin Review.

When running autoconfig at the root of a monorepo workspace, package installation commands now include the appropriate workspace root flags (
--workspace-rootfor pnpm,-Wfor yarn). This prevents errors like "Running this command will add the dependency to the workspace root" that previously occurred when configuring projects at the workspace root.Additionally, autoconfig now allows running at the workspace root if the root directory itself is listed as a workspace package (e.g.,
workspaces: ["packages/*", "."]).A picture of a cute animal (not mandatory, but encouraged)