Skip to content

Fix autoconfig package installation always failing at workspace roots#12676

Merged
dario-piotrowicz merged 5 commits intomainfrom
dario/autoconfig-monorepo-root-improvement
Mar 15, 2026
Merged

Fix autoconfig package installation always failing at workspace roots#12676
dario-piotrowicz merged 5 commits intomainfrom
dario/autoconfig-monorepo-root-improvement

Conversation

@dario-piotrowicz
Copy link
Copy Markdown
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
Copy Markdown

changeset-bot bot commented Feb 25, 2026

🦋 Changeset detected

Latest commit: 7b476e1

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
Copy Markdown
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
Copy Markdown

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

wrangler

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

commit: 2c90eb0

@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
Copy Markdown
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

@dario-piotrowicz dario-piotrowicz force-pushed the dario/autoconfig-monorepo-root-improvement branch from f83ab21 to dbcf13e Compare March 2, 2026 11:51
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 2, 2026

✅ All changesets look good

Copy link
Copy Markdown
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

@github-project-automation github-project-automation bot moved this from Untriaged to Approved in workers-sdk Mar 4, 2026
@petebacondarwin
Copy link
Copy Markdown
Contributor

Probably worth addressing the Devin issue too?

dario-piotrowicz and others added 2 commits March 5, 2026 11:12
Co-authored-by: Pete Bacon Darwin <pete@bacondarwin.com>
Co-authored-by: Pete Bacon Darwin <pete@bacondarwin.com>
Copy link
Copy Markdown
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 8 additional findings in Devin Review.

Open in Devin Review

@dario-piotrowicz
Copy link
Copy Markdown
Member Author

Probably worth addressing the Devin issue too?

good call, addressed! 🙂

devin-ai-integration[bot]

This comment was marked as resolved.

@dario-piotrowicz dario-piotrowicz merged commit 65f1092 into main Mar 15, 2026
58 of 64 checks passed
@dario-piotrowicz dario-piotrowicz deleted the dario/autoconfig-monorepo-root-improvement branch March 15, 2026 23:00
@github-project-automation github-project-automation bot moved this from Approved to Done in workers-sdk Mar 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants