Skip to content

Conversation

@dario-piotrowicz
Copy link
Member

Fixes https://jira.cfdata.org/browse/DEVX-2321


  • Tests
    • Tests included
    • Tests not necessary because:
  • Public documentation
    • Cloudflare docs PR(s):
    • Documentation not necessary because: tracked elsewhere
  • Wrangler V3 Backport
    • Wrangler PR:
    • Not necessary because: not in v3

@changeset-bot
Copy link

changeset-bot bot commented Nov 16, 2025

🦋 Changeset detected

Latest commit: 38859dc

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

@github-project-automation github-project-automation bot moved this to Untriaged in workers-sdk Nov 16, 2025
@dario-piotrowicz dario-piotrowicz force-pushed the dario/DEVX-2321/autoconfig-nextjs branch from e1a384a to 31e5296 Compare November 16, 2025 18:13
@pkg-pr-new
Copy link

pkg-pr-new bot commented Nov 16, 2025

create-cloudflare

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

@cloudflare/kv-asset-handler

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

miniflare

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

@cloudflare/pages-shared

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

@cloudflare/unenv-preset

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

@cloudflare/vite-plugin

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

@cloudflare/vitest-pool-workers

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

@cloudflare/workers-editor-shared

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

@cloudflare/workers-utils

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

wrangler

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

commit: b88b00f

@dario-piotrowicz dario-piotrowicz force-pushed the dario/DEVX-2321/autoconfig-nextjs branch from 31e5296 to 20d1242 Compare November 16, 2025 18:49
@dario-piotrowicz dario-piotrowicz force-pushed the dario/DEVX-2321/autoconfig-nextjs branch from 20d1242 to a2f24b5 Compare November 17, 2025 10:37
@dario-piotrowicz dario-piotrowicz force-pushed the penalosa/autoconfig-sveltekit branch from b1d0f1b to ba94707 Compare November 17, 2025 11:27
@dario-piotrowicz dario-piotrowicz force-pushed the dario/DEVX-2321/autoconfig-nextjs branch from a2f24b5 to a087f96 Compare November 17, 2025 11:28
Base automatically changed from penalosa/autoconfig-sveltekit to main November 17, 2025 14:06
@dario-piotrowicz dario-piotrowicz force-pushed the dario/DEVX-2321/autoconfig-nextjs branch from a087f96 to db411f0 Compare November 17, 2025 14:09
@dario-piotrowicz dario-piotrowicz marked this pull request as ready for review November 17, 2025 14:09
@dario-piotrowicz dario-piotrowicz requested a review from a team as a code owner November 17, 2025 14:09
@dario-piotrowicz
Copy link
Member Author

Converting to draft since the C3 e2es don't currently run in CI and we should enable them before merging and new C3 autoconfig PR

@dario-piotrowicz dario-piotrowicz marked this pull request as draft November 17, 2025 16:25
@dario-piotrowicz dario-piotrowicz force-pushed the dario/DEVX-2321/autoconfig-nextjs branch from db411f0 to 9845bde Compare November 17, 2025 23:07
@dario-piotrowicz dario-piotrowicz marked this pull request as ready for review November 18, 2025 17:30
@ascorbic
Copy link
Contributor

When I tried this locally, with a new project, I got "✘ [ERROR] The entry-point file at ".open-next/worker.js" was not found.". I needed to do another npm run deploy manually

@ascorbic
Copy link
Contributor

The issue is that it doesn't run opennextjs-cloudflare build. I'm not sure what the best workaround is here.

@ascorbic
Copy link
Contributor

Should it change the build command?

@dario-piotrowicz dario-piotrowicz force-pushed the dario/DEVX-2321/autoconfig-nextjs branch 2 times, most recently from 69a48af to 73871b5 Compare November 27, 2025 11:28
@dario-piotrowicz
Copy link
Member Author

Should it change the build command?

oh... yeah I see the issue.... that's annoying.... I don't think we could change the build command since that's for example used by the Vercel CLI and changing it can have some unexpected consequences... 🤔 I think we should ideally let wrangler deploy know the build command that it needs to run? 🤔

@dario-piotrowicz dario-piotrowicz force-pushed the dario/DEVX-2321/autoconfig-nextjs branch from 73871b5 to 0927724 Compare November 27, 2025 18:43
@dario-piotrowicz
Copy link
Member Author

@ascorbic WDYT?

0927724

@ascorbic
Copy link
Contributor

0927724

I think these changes should be in a separate PR. Will they then override the package.json build command too?

@dario-piotrowicz dario-piotrowicz force-pushed the dario/DEVX-2321/autoconfig-nextjs branch 2 times, most recently from 0d9a598 to b88b00f Compare December 10, 2025 12:26
Comment on lines 7 to 18
* Checks whether a project is an OpenNext one and in such case delegates the deployment to `@opennextjs/cloudflare`.
* If the project is not an OpenNext one, or the `OPEN_NEXT_DEPLOY` environment variable is set (meaning that `wrangler
* deploy` has been called from OpenNext itself), then no delegation happens.
*
* Why?
* `wrangler deploy` shouldn't be run on an open-next project, since open-next has its own deploy command,
* in the interest in having things "just work" we updated `wrangler deploy` to delegate to the open-next
* deploy command, so that, if a developer runs `npx wrangler deploy` (e.g. like in Workers Builds) on an
* open-next project that will work just fine.
*
* @param projectRoot The path to the project's root
* @returns true is the deployment has been delegated to open-next, false otherwise
Copy link
Contributor

Choose a reason for hiding this comment

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

This is very verbose. Can we simplify to make it clearer what's going on here?

Copy link
Member Author

Choose a reason for hiding this comment

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

I've simplified this comment: 38859dc

please let me know what you think

}
}

export async function appendToGitIgnore(
Copy link
Contributor

Choose a reason for hiding this comment

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

This doesn't do quite the same thing as the existing functions, which check to make sure we're not adding something to the gitignore twice. Is there a reason we no longer need to check that?

Copy link
Member Author

Choose a reason for hiding this comment

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

If you see the TODO comment I've added at the top of the file I do think that there's some cleanup to do here and code to consolidate 👍

Specifically in regards of the check here, I skipped it to keep things simple, I can add one but I am just using this function for open-next, there I think we'll always end up adding this section anyways because if .open-next as already in the gitignore file then open-next was already being used by the project, but in that case then the app wouldn't require the auto-configuration.

@dario-piotrowicz dario-piotrowicz requested review from a team as code owners December 11, 2025 17:23
@dario-piotrowicz dario-piotrowicz force-pushed the dario/DEVX-2321/autoconfig-nextjs branch from 541281c to 3e2729c Compare December 11, 2025 17:25
@dario-piotrowicz dario-piotrowicz merged commit 6c590a0 into main Dec 15, 2025
33 checks passed
@dario-piotrowicz dario-piotrowicz deleted the dario/DEVX-2321/autoconfig-nextjs branch December 15, 2025 11:32
@github-project-automation github-project-automation bot moved this from Approved to Done in workers-sdk Dec 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip-v3-pr Skip validation of presence of a v3 backport PR

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants