Skip to content

Conversation

@codercatdev
Copy link
Contributor

in the bottom how to deploy section it has deploy:worker I think this should match.

in the bottom how to deploy section it has `deploy:worker` I think this should match.
Copy link
Contributor

@vicb vicb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dario-piotrowicz what do you think?
C3 template uses deploy.
We should pick either one, maybe :worker everywhere and we update here, c3, and the adapter repo?

@dario-piotrowicz
Copy link
Contributor

@dario-piotrowicz what do you think? C3 template uses deploy. We should pick either one, maybe :worker everywhere and we update here, c3, and the adapter repo?

@vicb if you look at the c3.ts files for all the various types of projects you will see that all of them use "deploy" (without ":worker" or any other suffix/prefix) and I am a big fan of consistency, so if I had to chose I would go for that, I'm not against deploy:worker anyways if that's your preference


PS: Thanks for spotting the issue @codercatdev 🫶

@vicb
Copy link
Contributor

vicb commented Feb 4, 2025

What I mean is consistency can be 2 two things:

  1. everything worker related ends with i.e. use preview:worker and deploy:worker to match build:worker and dev:worker
  2. or use deploy and preview to be consistent with the c3 template

I updated (some of) the docs in #50 to use deploy and preview to match the template.

But now I'm wondering if we shouldn't got the 1 way (in docs + templates)

@dario-piotrowicz
Copy link
Contributor

What I mean is consistency can be 2 two things:

  1. everything worker related ends with i.e. use preview:worker and deploy:worker to match build:worker and dev:worker
  2. or use deploy and preview to be consistent with the c3 template

I updated (some of) the docs in #50 to use deploy and preview to match the template.

But now I'm wondering if we shouldn't got the 1 way (in docs + templates)

my preference as I mentioned is to be consistent with the c3 template (2.) and remove the :worker to all the scripts that don't need it (note: the only one from which we can't remove the suffix is build:worker as we can't simply use build)

but again, I'm ok to go with 1. if that's your preference

@vicb
Copy link
Contributor

vicb commented Feb 4, 2025

my preference as I mentioned is to be consistent with the c3 template (2.) and remove the :worker to all the scripts that don't need it (note: the only one from which we can't remove the suffix is build:worker as we can't simply use build)

Ok, let's do that, which means:

  • build:worker
  • dev:worker
  • preview
  • deploy

I'll update the adapter to reflect that.

@dario-piotrowicz
Copy link
Contributor

my preference as I mentioned is to be consistent with the c3 template (2.) and remove the :worker to all the scripts that don't need it (note: the only one from which we can't remove the suffix is build:worker as we can't simply use build)

Ok, let's do that, which means:

  • build:worker
  • dev:worker
  • preview
  • deploy

I'll update the adapter to reflect that.

why dev:worker and not just dev?

@vicb
Copy link
Contributor

vicb commented Feb 4, 2025

why dev:worker and not just dev?

Because it has been like that since day 1 and probably too similar to next dev

@vicb
Copy link
Contributor

vicb commented Feb 4, 2025

and there is not even a question because pnpm dev is already taken by next dev :)

@dario-piotrowicz
Copy link
Contributor

dario-piotrowicz commented Feb 4, 2025

@vicb sorry, I just realized now that I asked my question wrongly, I was asking why we need have dev:worker in the first place and why not just have dev

and there is not even a question because pnpm dev is already taken by next dev :)

👆 That's exactly what I was saying, there already is a dev script, so having an extra one just for the worker is not 100% necessary

that's exactly what we have in C3, there is no dev:worker and wrangler dev is directly inlined in the preview script: https://github.com/cloudflare/workers-sdk/blob/6abe69c3fe1fb2e762153a3094119ed83038a50b/packages/create-cloudflare/templates-experimental/next/c3.ts#L76

I feel like this is clearer than having dev and dev:worker, but dev:worker might still be useful if someone wants to preview the worker without rebuilding it (maybe the script could be renamed to serve:worker? 🤔)

anyways if you want to keep dev:worker around that's also fine by me 🙂👍

@vicb
Copy link
Contributor

vicb commented Feb 4, 2025

I'm ok to drop dev:worker.
Meaning we can also drop build:worker to keep only preview and deploy, right?

@dario-piotrowicz
Copy link
Contributor

I'm ok to drop dev:worker. Meaning we can also drop build:worker to keep only preview and deploy, right?

oh yeah, I didn't consider dropping build:worker too 🤔

(actually the C3 template already doesn't have that)

sounds good to me 👍

@vicb
Copy link
Contributor

vicb commented Feb 5, 2025

@codercatdev the change was made in #68. You are a co-author of this change as this was suggested by you. Thanks!

@vicb vicb closed this Feb 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants