Skip to content

🐛/🚀 BUG/Feature Request: C3 type Cli arguments handling could/should be improved #4183

@dario-piotrowicz

Description

@dario-piotrowicz

C3 2.5.0

Bug

If an invalid type is provided to the C3 as a cli argument C3 threats it as if nothing/undefined was passed saying that a type needs to be specified.

For example:
Screenshot 2023-10-16 at 10 09 00

I think this is a bug and that C3 should say that the type is invalid instead of acting as if none was provided

Feature Request

As a user I don't really get any information about what types are allowed, if I run C3 with --help, the type indicated there is simply string which is not much help:
Screenshot 2023-10-16 at 10 12 32

Note that if I run C3 interactively I get a human-readable representation of the type chosen, so not even there I ever get the actual type I can provide to C3.

For example if I create a hello world worker I get "Hello World" Worker as the type which gives me almost zero indication that the type to pass in this case is hello-world:
Screenshot 2023-10-16 at 10 15 35

Note: above we do get a Copying files from "hello-world" template, but that's accidental more then anything, does not clearly inform that the type is hello-world and is not applicable for example for the webFramework type which doesn't rely on templates

Basically I think that the only way to know what types are allowed is to read the C3 source code, and I think C3 should provide list of the available types so that users can know what's available.

It could be done:

  • as part of the bug fix: if the user provides an invalid type C3 says that it is invalid and provides a list of the valid ones
  • in the help message: instead of [string] we provide the list of available types (this feels to me like the proper solution)
  • in the C3 docs: we add a section regarding the cli arguments and there add the list of available types, and maybe the help message we refer users to the C3 docs for more information (not a clean solution in my opinion but I figured I could mention it)

Metadata

Metadata

Labels

bugSomething that isn't workingc3Relating to C3 (create-cloudflare) package

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions