-
Notifications
You must be signed in to change notification settings - Fork 77
Add standard Next template generated from create-next-app that will be used by create-cloudflare going forward #973
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
…e used by create-cloudflare going forward
🦋 Changeset detectedLatest commit: 92a69e6 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
commit: |
create-cloudflare/next/.gitignore
Outdated
|
|
||
| # wrangler files | ||
| .wrangler | ||
| !.dev.vars* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think .dev.vars* should be excluded (we might not do this in all examples for testing purposes)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah the project generated by C3 had it ignored in .gitignore but then in the docs for Open Next Cloudflare, I saw that it suggested you add this so that Next runs in dev mode locally...
https://opennext.js.org/cloudflare/get-started#5-add-a-devvars-file
So I thought it might be nice to include that...
But perhaps what we should do is include that in the template (by hard adding it) but then exclude it in the .gitignore file of the template so that it doesn't get git commited?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rename to .dev.vars.example and exclude in .gitignore
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about we leave it in the template but then ignore it in .gitignore?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wouldn't that be a pain if we want to update the file at any point?
| "$schema": "node_modules/wrangler/config-schema.json", | ||
| "name": "next", | ||
| "main": ".open-next/worker.js", | ||
| "compatibility_date": "2025-03-01", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could probably bump to the latest supported date in the installed wrangler
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can change C3 to update this when it instantiates the template.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A fixed date should be good for now IMO
|
Thanks Pete, |
|
|
||
| # typescript | ||
| *.tsbuildinfo | ||
| next-env.d.ts |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should move this to the next.js section
| .wrangler | ||
| .dev.vars* | ||
| !.dev.vars.example | ||
| !.env.example |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should also move this to the next.js section (wrangler is setup to not process .env files with the adapter)
This setup was tested locally by running the following commands:
cd templates/next npm i npm run previewNotes:
npm run previewdoes the open next build and then runs the project with wrangler - the project can also be run withnpm run devto use the classic Next.js dev server