moleculerjs / moleculer-cli

:herb: Command line tool for Moleculer
http://moleculer.services/docs/moleculer-cli.html
MIT License
48 stars 28 forks source link

feat: update struct for add others types on create method #60

Closed devalexandre closed 2 years ago

devalexandre commented 2 years ago

Modify the structure of the create method, to facilitate the creation of other types, like Mixin. This structure is also reflected in the organization of tests, so that each type added for creation will have its source and tests totally separately. This PR refers to the PR where the creation of Mixin was included, but because there are many changes, it decides to close the old one and create a new smaller one, in 2 steps, this is the first one that deals with the reorganization of directories and files related to creation.

AndreMaz commented 2 years ago

Hey @devalexandre

How can I create a service with a different name?

I'm trying npm run dev create service MY-SERVICE but it doesn't seem to work. It always creates a service called create.service.js

image

Also, how to create a TS template? The --typescript flag doesn't seem to work

devalexandre commented 2 years ago

did you test in branch?

AndreMaz commented 2 years ago

Ups! My bad. I was on master.

JS service creation works as expected 👍

Regarding TS. This is the correct command?

npm run dev create service ts --typscript

Side note: your GIF if very low res. so it's not possible to see what you're typing

devalexandre commented 2 years ago

npm run dev create service ts --typscript

@AndreMaz the command is

image

devalexandre commented 2 years ago

did you test in branch?

sorry for the resolution, I ended up losing the link where it records with a better quality

devalexandre commented 2 years ago

@AndreMaz any news about a PR ?

AndreMaz commented 2 years ago

Sorry for delay @devalexandre

Tested here and things seems to be working 👍

One question: What the purpose of javascript.template and service.template? Both of them seem to be identical. Same question for the typescript.service and typescript.template

image

devalexandre commented 2 years ago

sorry, @AndreMaz I ended up leaving the files, but they were already removed and renamed to make it easier to understand.