Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A next generation CLI #2414

Closed
daffl opened this issue Nov 8, 2020 · 6 comments
Closed

A next generation CLI #2414

daffl opened this issue Nov 8, 2020 · 6 comments

Comments

@daffl
Copy link
Member

daffl commented Nov 8, 2020

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/authentication (locally)
  • @feathersjs/authentication/_templates
  • feathers-authentication/_templates
  • authentication/_templates

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

@daffl daffl changed the title A next generation CLI for Feather 5 A next generation CLI for Feathers 5 Nov 8, 2020
@MauriceArikoglu
Copy link

MauriceArikoglu commented Nov 8, 2020

@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
Copy link

Some observations I made already:

  • Feathers generator (:any) does not respect settings in eslintrc files
  • Feathers generator (:app) automatically adds static files like .gitignore, .editorconfig which might be unwanted
  • Feathers generator (:service) does not differentiate between collections and entities correctly
    • Example: Generating a service "users" results in the collection resource users being registered correctly, the corresponding model and class should be called User though (capitalized singular form)

List is not final

@daffl daffl changed the title A next generation CLI for Feathers 5 A next generation CLI Dec 15, 2020
@daffl
Copy link
Member Author

daffl commented Jul 8, 2021

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
Copy link
Member Author

daffl commented Aug 3, 2022

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.

@daffl daffl closed this as completed Aug 3, 2022
@pkyeck-bling
Copy link

@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
Copy link
Member Author

daffl commented Jul 17, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants