Skip to content

Fix autoconfig package installation always failing at workspace roots#12676

Open
dario-piotrowicz wants to merge 1 commit intomainfrom
dario/autoconfig-monorepo-root-improvement
Open

Fix autoconfig package installation always failing at workspace roots#12676
dario-piotrowicz wants to merge 1 commit intomainfrom
dario/autoconfig-monorepo-root-improvement

Conversation

@dario-piotrowicz
Copy link
Member

@dario-piotrowicz dario-piotrowicz commented Feb 25, 2026

When running autoconfig at the root of a monorepo workspace, package installation commands now include the appropriate workspace root flags (--workspace-root for pnpm, -W for 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/*", "."]).


  • Tests
    • Tests included/updated
    • Automated tests not possible - manual testing has been completed as follows:
    • Additional testing not necessary because:
  • Public documentation
    • Cloudflare docs PR(s):
    • Documentation not necessary because: expected behavior

A picture of a cute animal (not mandatory, but encouraged)


Open with Devin

@dario-piotrowicz dario-piotrowicz requested a review from a team as a code owner February 25, 2026 16:19
@changeset-bot
Copy link

changeset-bot bot commented Feb 25, 2026

🦋 Changeset detected

Latest 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
Copy link
Contributor

claude bot commented Feb 25, 2026

Claude encountered an error —— View job


Changeset Review

Todo List:

  • Read changeset guidelines
  • Review changeset file
  • Check for cute animal images
  • Provide final assessment

devin-ai-integration[bot]

This comment was marked as resolved.

@pkg-pr-new
Copy link

pkg-pr-new bot commented Feb 25, 2026

create-cloudflare

npm i https://pkg.pr.new/create-cloudflare@12676

@cloudflare/kv-asset-handler

npm i https://pkg.pr.new/@cloudflare/kv-asset-handler@12676

miniflare

npm i https://pkg.pr.new/miniflare@12676

@cloudflare/pages-shared

npm i https://pkg.pr.new/@cloudflare/pages-shared@12676

@cloudflare/unenv-preset

npm i https://pkg.pr.new/@cloudflare/unenv-preset@12676

@cloudflare/vite-plugin

npm i https://pkg.pr.new/@cloudflare/vite-plugin@12676

@cloudflare/vitest-pool-workers

npm i https://pkg.pr.new/@cloudflare/vitest-pool-workers@12676

@cloudflare/workers-editor-shared

npm i https://pkg.pr.new/@cloudflare/workers-editor-shared@12676

@cloudflare/workers-utils

npm i https://pkg.pr.new/@cloudflare/workers-utils@12676

wrangler

npm i https://pkg.pr.new/wrangler@12676

commit: f83ab21

@dario-piotrowicz dario-piotrowicz force-pushed the dario/autoconfig-monorepo-root-improvement branch 3 times, most recently from b3c3c29 to 7430698 Compare February 25, 2026 18:03
devin-ai-integration[bot]

This comment was marked as resolved.

@dario-piotrowicz dario-piotrowicz force-pushed the dario/autoconfig-monorepo-root-improvement branch from 7430698 to f83ab21 Compare February 26, 2026 18:40
Copy link
Contributor

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Open in Devin Review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Untriaged

Development

Successfully merging this pull request may close these issues.

1 participant