feathers-plus / cli

FeathersJS CLI supporting both REST and GraphQL architectural concepts and their query languages.
https://generator.feathers-plus.com/
Other
43 stars 7 forks source link

[Feature request] service name in "feathers-plus generate service" command #10

Closed iva2k closed 6 years ago

iva2k commented 6 years ago

Steps to reproduce

Would be nice to have a quicker way to re-generate:

$ feathers-plus generate service users -y

Expected behavior

Regenerates service "users" (or whatever the given name is) without prompts & keeping defaults. If service does not exist yet, should generate the service with all defaults.

Actual behavior

What happens instead:

$ feathers-plus generate service users -y
error: unknown option `-y'

Without '-y':

$ feathers-plus generate service users
  What is the name of the service?
eddyystop commented 6 years ago
  1. You can regenerate the entire app with generate all. The "prompts" in feathers-gen-specs.json are used.

  2. Nothing prevents you, at your own risk, from manually modifying the feathers-gen-specs.json file. You could for example add multiple services that way, and then run generate all.

The generator does not delete files on regeneration which are no longer require'd because of a change in prompts. That is one reason I'd rather not create multiple services with default prompt values.

Feel free to comment and ro reopen this issue if this is not satisfactory.

eddyystop commented 6 years ago

p.s. You app can read feathers-gen-specs.json to find out about itself.

iva2k commented 6 years ago

@eddyystop Thanks! I will explore that path, sounds promising. Makes sense to use generate all, especially that typings.d.ts is updated in generate all, so need to run it after almost always.

Thinking out loud - it is almost like there should be another command, maybe generate options --add-sevice <name> that will only edit the feathers-gen-specs.json file...

eddyystop commented 6 years ago

typings.d.ts is now regenerated whenever it needs to be. There is no need to run a spurious generate all anymore.

I'd rather people use their IDE to edit feathers-gen-specs.json. There is less chance of syntax errors.