Skip to content

[autoconfig] Run the Astro beta's astro add without installing the Astro beta for cf - #16995

Merged
edmundhung merged 5 commits into
autoconfig-solid-start-223from
edmundhung/autoconfig-astro-beta-add
Nov 18, 2026
Merged

edmundhung merged 5 commits into
autoconfig-solid-start-223from
edmundhung/autoconfig-astro-beta-add

Conversation

@edmundhung

@edmundhung edmundhung commented Nov 17, 2026 •

Copy link
Copy Markdown
Member

Part of RM-31810.

For cf, autoconfig installed astro@beta to get the astro add that writes cloudflare.config.ts. pnpm kept the project's locked stable Astro, because 7.4.12 satisfies the saved ^7.4.4-beta.0. So stable's astro add wrote wrangler.jsonc instead, and astro build failed in the Cloudflare adapter beta. Autoconfig now runs the beta's astro add once through the package manager's dlx command and keeps the project's Astro version. The beta differs from stable 7.4.4 only in astro add.


  • 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: the frameworks and versions cf supports are documented separately, as part of the cf GA docs

@changeset-bot

changeset-bot Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 56a0b89

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@cloudflare/autoconfig Patch

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

ask-bonk[bot]

This comment was marked as resolved.

@ask-bonk

ask-bonk Bot commented Nov 17, 2026

Copy link
Copy Markdown
Contributor

I'm Bonk, and I've done a quick review of your PR.

Runs Astro beta’s add command without upgrading the project’s Astro dependency.

  1. P1: Posted 1 actionable inline suggestion.

github run

@pkg-pr-new

pkg-pr-new Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
@cloudflare/autoconfig

npm i https://pkg.pr.new/@cloudflare/autoconfig@16995

@cloudflare/build-output-utils

npm i https://pkg.pr.new/@cloudflare/build-output-utils@16995

@cloudflare/codemods

npm i https://pkg.pr.new/@cloudflare/codemods@16995

@cloudflare/config

npm i https://pkg.pr.new/@cloudflare/config@16995

@cloudflare/containers-shared

npm i https://pkg.pr.new/@cloudflare/containers-shared@16995

create-cloudflare

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

@cloudflare/deploy-helpers

npm i https://pkg.pr.new/@cloudflare/deploy-helpers@16995

@cloudflare/kv-asset-handler

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

miniflare

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

@cloudflare/pages-functions

npm i https://pkg.pr.new/@cloudflare/pages-functions@16995

@cloudflare/pages-shared

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

@cloudflare/runtime-types

npm i https://pkg.pr.new/@cloudflare/runtime-types@16995

@cloudflare/unenv-preset

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

@cloudflare/vite-plugin

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

@cloudflare/vitest-plugin

npm i https://pkg.pr.new/@cloudflare/vitest-plugin@16995

@cloudflare/workers-auth

npm i https://pkg.pr.new/@cloudflare/workers-auth@16995

@cloudflare/workers-editor-shared

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

@cloudflare/workers-utils

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

wrangler

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

commit: 56a0b89

@edmundhung
edmundhung force-pushed the edmundhung/autoconfig-astro-beta-add branch from a2f816c to 6d66047 Compare November 17, 2026 23:52
@edmundhung
edmundhung changed the base branch from main to autoconfig-solid-start-223 November 17, 2026 23:52
@edmundhung
edmundhung added this pull request to stack #16996 November 17, 2026 23:56
@edmundhung
edmundhung removed this pull request from stack #16996 November 18, 2026 10:35
@edmundhung
edmundhung added this pull request to stack #17007 November 18, 2026 10:35
@edmundhung
edmundhung force-pushed the edmundhung/autoconfig-astro-beta-add branch 2 times, most recently from 03eb143 to e7ad67d Compare November 18, 2026 11:59
@edmundhung
edmundhung force-pushed the edmundhung/autoconfig-astro-beta-add branch from e7ad67d to be8e1df Compare November 18, 2026 12:03
@edmundhung
edmundhung marked this pull request as ready for review November 18, 2026 12:40
@workers-devprod
workers-devprod requested review from a team and petebacondarwin and removed request for a team November 18, 2026 12:41
@workers-devprod

workers-devprod commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

Codeowners approval required for this PR:

  • ✅ @cloudflare/wrangler
Show detailed file reviewers

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Devin Review found 1 potential issue.

Devin Review

@clanky-the-clanker clanky-the-clanker Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

💬 Approved with comments — The approach is sound. One WARNING remains: projects detected as Yarn Classic (v1) now go through yarn dlx, which Yarn Classic does not have. The author has chosen to fix that in the shared package manager definition instead.

Findings: 1 warning · 1 info (2 are inline comments on the diff)

The decision is advisory: this review is a comment and never approves, blocks or requests changes on the pull request.

🔧 Fix with your agent

Paste the following into your coding agent to investigate and fix these issues.

Fix the following code review issues found in pull request #16995.

Before making changes, review each issue and present a brief summary table:
- For each finding, state whether you agree, disagree, or need clarification
- If you disagree (e.g., the fix would require disproportionate changes
  for minimal ROI, or the finding is factually incorrect), explain why
- If you need to clarify something before deciding, ask those questions
- Then share your plan for which issues to tackle and in what order

## WARNING (1)

### [Code Quality] Yarn Classic (v1) projects now run `yarn dlx astro@beta add …`, but Yarn Classic has no `dlx`, so the cf Astro setup fails where `yarn astro add` used to work. Kept at WARNING despite @edmundhung [author]'s reply: the gap is shared with other `dlx` callers, but this pull request is what moves the Astro path onto `dlx`.
- **File:** packages/autoconfig/src/frameworks/astro.ts:108

## INFO (1)

### [Code Quality] The test covers only npm (single-segment `dlx`). The two-segment pnpm prefix this pull request fixes isn't exercised.
- **File:** packages/autoconfig/tests/frameworks/astro.test.ts:58

📋 Code Quality: ⚠️ 1 warning · 1 info

Running the beta's astro add through dlx fixes the pnpm version-resolution problem. Yarn Classic projects now hit yarn dlx, which they lack, and the test covers only npm.

Recommendation: 📝 Minor Comments

  • [WARNING] Yarn Classic (v1) projects now run yarn dlx astro@beta add …, but Yarn Classic has no dlx, so the cf Astro setup fails where yarn astro add used to work. Kept at WARNING despite @​edmundhung [author]'s reply: the gap is shared with other dlx callers, but this pull request is what moves the Astro path onto dlx. (packages/autoconfig/src/frameworks/astro.ts:108)
  • [INFO] The test covers only npm (single-segment dlx). The two-segment pnpm prefix this pull request fixes isn't exercised. (packages/autoconfig/tests/frameworks/astro.test.ts:58)
View full review

Running the beta's astro add once through the package manager's dlx command fixes the pnpm problem: pnpm kept the locked stable Astro, so the stable astro add wrote wrangler.jsonc instead of cloudflare.config.ts. This change also keeps the project's Astro version.

Yarn Classic (astro.ts:108)

  • YarnPackageManager.dlx is ["yarn", "dlx"] (packages/workers-utils/src/package-manager.ts:42), and Yarn Classic has no dlx command.
  • Before this change, Yarn projects ran yarn astro add … against the locally installed astro. That works on Yarn Classic. The new command, yarn dlx astro@beta add …, does not.
  • The author's point stands: the other dlx callers have the same gap, so the proper fix belongs in the shared Yarn definition. Still, this pull request is what moves the Astro cf path onto dlx. Until that shared fix lands, this is a behaviour change for Yarn Classic users, so the finding stays a WARNING.
  • Mentioning the limitation in the changeset, or landing the shared fix first, would cover it.

Tests

  • The updated test asserts only the npm command, where dlx is the single segment ["npx"].
  • Adding a pnpm case that asserts ["pnpm", "dlx", "astro@beta", "add", …] would exercise the two-segment prefix. That is the case this pull request fixes.

✅ All other checks passed

📝 Documentation: ✅ LGTM

The changeset accurately describes the problem and the fix.


Reviewed commit: 56a0b893

@workers-devprod workers-devprod left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Codeowners reviews satisfied

@github-project-automation github-project-automation Bot moved this from Untriaged to Approved in workers-sdk Nov 18, 2026
@edmundhung
edmundhung merged commit c79c1fc into main Nov 18, 2026
105 of 108 checks passed
@edmundhung
edmundhung deleted the edmundhung/autoconfig-astro-beta-add branch November 18, 2026 16:10
@github-project-automation github-project-automation Bot moved this from Approved to Done in workers-sdk Nov 18, 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