-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
add cloudflare workers static assets example #14216
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
Conversation
|
Re: adding the template instructions to the Cloudflare adapter page, we don't really have a precedent for that yet! I'd probably be more inclined to consider it if this is basic setup that every Cloudflare user wants/needs. If this is an example of one specific thing that you might want to do with Cloudflare, then maybe less inclined. It's also thinking of who is in docs and when: if someone is mostly reading these docs to work on already existing projects, then the example is maybe a little less helpful for them at this point? (It could be helpful as a model for them to look at to see how it's done. But since these are typically fresh projects we mostly consider pointing people to them when we believe they are in a "getting started with a new project" state.) But it does raise maybe a bigger question re: should we be pointing out these examples that we have in appropriate places in docs. Also, I'm not sure what (if anything!) we need to add to this to get it to show up on https://astro.new in the right category (I guess we would consider this a "Template"?) so just making sure that you've done whatever is needed there, too! I think this is where the logic in that repo is: https://github.com/withastro/astro.new/blob/main/src/data/examples-shared.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.
It seems the only thing cloudflare-specific on this is the adapter and the wrangler.jsonc
. Is a full example needed for that?
We don't have an example for every adapter and their features. If this wrangler.jsonc
is the minimum requirement for Cloudflare perhaps we could just generate it on astro add cloudflare
like we do for Tailwind stuff.
I'm not against it, just seems like it would be best as codemod or as a recipe in Docs
@Fryuni totally agree. I remember @delucis told me in the past that it is not easy to add logic to ˋastro addˋ but if we can do that, I would prefer that way too. This example is just my workaround to help users get everything they need to run on Cloudflare without the need to manually create files. |
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.
Could you also PR here to skip the new example? https://github.com/withastro/preview.astro.new/blob/a8ef039271a9d889579610c826d87141c54006ba/src/build.mjs#L32
Those will build on Netlify as static sites so we can't deploy SSR examples.
Missed this when sharing a quick review previously, sorry. It’s not possible for third-party integrations, but should be do-able for the Cloudflare one potentially. You could check how we handle |
So what's the status of this PR? Looks like it shouldn't be an example but rather an update to |
That would be the best option IMO. This way users can use any of the existing templates that better fits their use case along with |
See #14564 |
Nice! Thanks @florian-lefebvre. I guess we can close this one then. |
Changes
Testing
pnpm create astro@latest -- --template cloudflare-workers-static-assets
Docs
Not really needed, since custom examples are already documented here: https://docs.astro.build/en/install-and-setup/#use-a-theme-or-starter-template
@sarah11918 we could discuss if we want to add this command
pnpm create astro@latest -- --template cloudflare-workers-static-assets
to the Cloudflare docs page itself?