You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
this file erela.cli.ts is just a simple typescript code that uses inquirer and some built-in node modules to ask the user some questions and generate some files ( controller - service - entity )
notes
to run this script run the following command on the root directory in the terminal npm run erela ( I know that you can run it manually but this command saves you a lot of hassle and downloading stuff )
when the user answers everything the CLI will take one of the files in the templates directory and replace the __NAME__ and some other stuff (you can read the code)
But I think using a library will shorten the code and make it more scalable to generate more stuff in the future.
So I think switching to a library will do that and I recommend that you use plopjs, however, feel free to use any library you find I just liked this one
plopjs can give us a lot of customization and shortcuts for example running npm run erela controller will immediately ask the user about the controller name
plopjs uses handlebarsjs for the templates now I'm using .txt files with VAR token to replace :) and handlebarsjs is more scalable
plz install tslint in your text editor so it can read the tslint.json and guide you throw the mess ( tslint.json is the current convection for writing code in Erela )
this file
erela.cli.ts
is just a simple typescript code that uses inquirer and some built-in node modules to ask the user some questions and generate some files ( controller - service - entity )notes
npm run erela
( I know that you can run it manually but this command saves you a lot of hassle and downloading stuff )when the user answers everything the CLI will take one of the files in the
templates
directory and replace the__NAME__
and some other stuff (you can read the code)But I think using a library will shorten the code and make it more scalable to generate more stuff in the future.
So I think switching to a library will do that and I recommend that you use plopjs, however, feel free to use any library you find I just liked this one
good things we can have using plopjs
plopjs can give us a lot of customization and shortcuts for example running
npm run erela controller
will immediately ask the user about the controller nameplopjs uses handlebarsjs for the templates now I'm using .txt files with VAR token to replace :) and handlebarsjs is more scalable
you can learn about it here
still, if you find a better library feel free to use it.
when you write the code just create a new branch push it then create a PR into master
plz refer the read.me if you are wondering about something or just talk with me
happy coding
The text was updated successfully, but these errors were encountered: