Closed devalexandre closed 3 years ago
all corrections made :) @icebob
Did you test it? What is the command to generate typescript service?
Did you test it? What is the command to generate typescript service?
yes I did
./bin/moleculer.js create service --typescript
you can run and save file in ./test folder
The create
help is not correct:
The
create
help is not correct:
resolved, I add in options
Also
Can you please fix the grammatical error? Also, it would be nice to have the actual filename of the service in the info
Looking at the prompts I think that it should be possible to create a service with default params.
{
type: "input",
name: "serviceFolder",
message: "Service directory",
default: "./services",
validate(input) {
if (!fs.existsSync(path.resolve(input)))
return `The '${input}' directory is not exists! Full path: ${path.resolve(input)}`;
return true;
}
},
{
type: "input",
name: "serviceName",
message: "Service name",
default: "test"
}
However, it seem that there's an issue.
Also, there's a typo in The '${input}' directory is not exists!
. It should be The '${input}' directory doesn't exist!
. Same for the The file ${newServicePath} is exists!
. It should be The file ${newServicePath} already exists!
Looking at the prompts I think that it should be possible to create a service with default params.
{ type: "input", name: "serviceFolder", message: "Service directory", default: "./services", validate(input) { if (!fs.existsSync(path.resolve(input))) return `The '${input}' directory is not exists! Full path: ${path.resolve(input)}`; return true; } }, { type: "input", name: "serviceName", message: "Service name", default: "test" }
However, it seem that there's an issue.
Also, there's a typo in
The '${input}' directory is not exists!
. It should beThe '${input}' directory doesn't exist!
. Same for theThe file ${newServicePath} is exists!
. It should beThe file ${newServicePath} already exists!
I alter it, and now use a default, if don't input some value
Now I'm getting stuck after a warning
Please test your code before creating a commit.
Also, fix the typos The '${input}' directory is not exists!
should be The '${input}' directory doesn't exist!
Moreover, Do you wanna overwrite it?
. Please use formal English. Instead of wanna
it should be want to
.
I always test the commits, maybe I missed it this time, I'm sorry for the lack of attention
Thanks for solving the dir issue.
One last thing, the service name is starting with a capital letter (name:"Test"
) but it should be all in lowercase
Thanks for solving the dir issue. One last thing, the service name is starting with a capital letter (
name:"Test"
) but it should be all in lowercase
yes, alter it
@icebob resolved all changes