Skip to content

Conversation

james-elicx
Copy link
Collaborator

@james-elicx james-elicx commented Aug 31, 2025

Changes

  • adds a --openNextConfigPath cli flag that lets you use a custom config path (e.g. if you had a cli that internally called opennext, you could have your own build dir have the config path instead of it leaking out).
  • deprecates the --configPath flag for wrangler configs, in favour of --config.
  • renames the variable passed around internally to wranglerConfigPath for clarity.

depends on opennextjs/opennextjs-aws#972 for absolute paths.

Note: both --openNextConfigPath and --config treat path starting with / as absolute paths.

outcome of #853

Copy link

changeset-bot bot commented Aug 31, 2025

🦋 Changeset detected

Latest commit: 2da636d

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

This PR includes changesets to release 1 package
Name Type
@opennextjs/cloudflare Minor

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

Copy link

pkg-pr-new bot commented Aug 31, 2025

Open in StackBlitz

npm i https://pkg.pr.new/@opennextjs/cloudflare@862

commit: 2da636d

@james-elicx james-elicx marked this pull request as ready for review August 31, 2025 19:59
@james-elicx james-elicx requested a review from vicb August 31, 2025 19:59
Copy link
Contributor

@vicb vicb left a comment

Choose a reason for hiding this comment

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

Changes look good to me. Thanks!

One question: This PR uses a relative path. Quickly looking at the code, it looks like an absolute path would work. If that is the case, can you please update the code (and maybe aws). If absolute paths do not work, we probably should add a check to fail early.

Copy link
Contributor

@vicb vicb left a comment

Choose a reason for hiding this comment

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

Let's discuss the open point in opennextjs/opennextjs-aws#972 before we merge this

@james-elicx james-elicx force-pushed the james/custom-config-path branch from d44ce85 to afd7dc2 Compare September 2, 2025 19:01
@james-elicx james-elicx linked an issue Sep 3, 2025 that may be closed by this pull request
@vicb
Copy link
Contributor

vicb commented Sep 3, 2025

@james-elicx could you please update the PR description to include:

We can keep #871 around until we remove --configPath in a coming major release (or close it and create a separate issue)

Thanks!

@james-elicx
Copy link
Collaborator Author

Yes, that's a dependency for absolute paths to work with the cloudflare cli. Updated the PR desc.

@vicb vicb force-pushed the james/custom-config-path branch from 078e979 to f08b19f Compare September 4, 2025 19:49
@vicb vicb force-pushed the james/custom-config-path branch from f08b19f to 4c798da Compare September 4, 2025 19:53
@vicb
Copy link
Contributor

vicb commented Sep 4, 2025

@james-elicx I have added a proposal as a fixup commit.

Main changes:

  • Added a hack to avoid having to wait for the aws PR to be merged
  • Do not offer to create a config file when a custom path is used (assuming it's user error then)

Looking at the comments/changes in compileConfig is probably the best way grasp the changes.

What do you think?

@james-elicx
Copy link
Collaborator Author

  • Added a hack to avoid having to wait for the aws PR to be merged

This is why I used to keep asking when we'd get a monorepo :(

Personally, I prefer not adding hacks simply because we're using polyrepos, even if that means it might take longer to ship something.

  • Do not offer to create a config file when a custom path is used (assuming it's user error then)

Makes sense, looks fine.

@vicb
Copy link
Contributor

vicb commented Sep 5, 2025

Thanks for working on this James!

This is why I used to keep asking when we'd get a monorepo :(

Personally, I prefer not adding hacks simply because we're using polyrepos, even if that means it might take longer to ship something.

It's not always easy to balance priority across features, fixes, customer wishes, and resources.

The hack is tested and should not be here for long so I think it's safe to merge this for now.

As for the mono-repo, definitely something we should think about before jumping into the Adapters API effort.
It might be the right time.

@vicb vicb merged commit 728ad99 into main Sep 5, 2025
7 checks passed
@vicb vicb deleted the james/custom-config-path branch September 5, 2025 11:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove --configPath CLI option in the next major release
2 participants