feathersjs / feathers

The API and real-time application framework
https://feathersjs.com
MIT License
15.08k stars 752 forks source link

A next generation CLI #2414

Closed daffl closed 2 years ago

daffl commented 4 years ago

Maintaining a fully featured single application generator has proven very difficult and time consuming. Every new feature or prompt adds an exponential growth in code and test complexity. Templates are difficult to customize since they are buried in a third party module and difficult to maintain, especially when having to account for all kinds of customizations somebody would want to do.

A more flexible approach is used by hygen.io which puts generator templates right into your application. If you want to change it, edit it to what you need and all future generator calls will reflect it.

To further improve modularity, each Feathers module will ship with the templates that can be used to generate its integration in a standard JavaScript/TypeScript Feathers setup. You can either just run it or eject the templates into your own application to customize.

For example

feathers generate authentication

Will look for templates that can be generated in the following modules:

Templates can be ejected into your application with

feathers customize authentication

This will allow any third party module to provide templates to generate its integration into a standard Feathers application setup and any user to customize what is being being generated to fit their own application needs (like creating templates that initialize a common set of protection hooks when generating a new service).

MauriceArikoglu commented 4 years ago

@daffl we should define a clear action plan for migration and rewrite. As I said in the other issue, I'll try to come up with something in the morning.

Is there a project board for feathers somewhere?

On a semi-related note: Are you planning to merge my CLI enhancements, or would you rather keep things as-is and add this functionality indirectly through use of hygen templates?

MauriceArikoglu commented 4 years ago

Some observations I made already:

List is not final

daffl commented 3 years ago

New CLI will be moved to the main repo and is currently being worked on in https://github.com/feathersjs/feathers/tree/hygen-cli

In general, the templates will provide a very minimal setup that can be fully customized to anything you want by running something like feathers customize app (or feathers customize authentication etc.) and ejecting the module specific templates into your local project.

daffl commented 2 years ago

This is now available in the v5 prerelease and can be used following the new guide at https://dove.feathersjs.com/guides. Closing this main issue, bugs and new features can be follow up with specific issues.

pkyeck-bling commented 4 months ago

@daffl sorry to dig this up but was this somehow even possible in v4? or do we need to update to v5 to customize the templates?

daffl commented 4 months ago

It is not but you can create your own templates with https://github.com/featherscloud/pinion