Skip to content

Conversation

alexanderniebuhr
Copy link
Member

Changes

  • this pr adds a new example which has the "minimal" setup needed for Cloudflare Workers Static Assets deployment
  • it does not include all the features or advanced Cloudflare usages

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?

Copy link

changeset-bot bot commented Aug 13, 2025

⚠️ No Changeset found

Latest commit: 4cacb14

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@github-actions github-actions bot added the pkg: example Related to an example package (scope) label Aug 13, 2025
@sarah11918
Copy link
Member

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

Copy link
Member

@Fryuni Fryuni left a 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

@alexanderniebuhr
Copy link
Member Author

@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.

Copy link
Member

@delucis delucis left a 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.

@delucis
Copy link
Member

delucis commented Sep 17, 2025

@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.

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 astro add tailwind.

@florian-lefebvre
Copy link
Member

So what's the status of this PR? Looks like it shouldn't be an example but rather an update to astro add?

@Fryuni
Copy link
Member

Fryuni commented Oct 15, 2025

So what's the status of this PR? Looks like it shouldn't be an example but rather an update to astro add?

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 astro add cloudflare.

@florian-lefebvre
Copy link
Member

See #14564

@delucis
Copy link
Member

delucis commented Oct 17, 2025

Nice! Thanks @florian-lefebvre. I guess we can close this one then.

@delucis delucis closed this Oct 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pkg: example Related to an example package (scope)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants