open-next icon indicating copy to clipboard operation
open-next copied to clipboard

add command to build and run OpenNext locally with dev overrides

Open sommeeeer opened this issue 8 months ago • 5 comments

For #541

I'll open this in draft mode for now. It wont work in a monorepo as of now. Im open for suggestions.

sommeeeer avatar May 04 '25 22:05 sommeeeer

🦋 Changeset detected

Latest commit: 3ac2fbac7d10bc57519a9f938d547879e1e14a52

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

This PR includes changesets to release 3 packages
Name Type
@opennextjs/aws Patch
app-pages-router Patch
app-router 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

changeset-bot[bot] avatar May 04 '25 22:05 changeset-bot[bot]

Open in StackBlitz

pnpm add https://pkg.pr.new/@opennextjs/aws@853

commit: 3ac2fba

pkg-pr-new[bot] avatar May 04 '25 22:05 pkg-pr-new[bot]

@sommeeeer Honestly i'm not sure what to do with this. The only point right now of such a command is for people contributing to OpenNext, and you'll likely end up with your own config (at least to test things out). dev is not a good name either, it will be misleading. It's also not like preview in cloudflare (which use the exact same things as deployed), here every overrides are dev ones.

Best things to do would probably just be to make it work for monorepo, and if we really want to have a dev command (with a different name) it should just call build with another config path (i.e. open-next.config.dev.ts for example) and run the server right away

conico974 avatar May 05 '25 07:05 conico974

dev is not a good name either, it will be misleading.

Yeah the name should not be dev. local could perhaps be a better fit?

Best things to do would probably just be to make it work for monorepo, and if we really want to have a dev command (with a different name) it should just call build with another config path (i.e. open-next.config.dev.ts for example) and run the server right away

Should I continue on this one (im trying to make it work in monorepos) or perhaps close it? This was mainly for people working on OpenNext as it can be a bit cumbersone to copy and make config files each time you need to test something quick locally. Like features in the routingHandler or similar.

sommeeeer avatar May 05 '25 07:05 sommeeeer

Why not just a command to generate the base "dev" config instead. I feel like this will give us enough

conico974 avatar May 05 '25 07:05 conico974