add cloudflare workers static assets example#14216
add cloudflare workers static assets example#14216alexanderniebuhr wants to merge 2 commits intomainfrom
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.
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. |
delucis
left a comment
There was a problem hiding this comment.
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-assetsDocs
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-assetsto the Cloudflare docs page itself?