Skip to content

Commit

Permalink
✨feat: supprot default pkg name for cli (#42)
Browse files Browse the repository at this point in the history
* fix:设置npm包默认名称

* fix:设置npm包默认名称

* feat:support default pkg name for cli

* feat:support default pkg name for cli

* chore: update

---------

Co-authored-by: 洋 <[email protected]>
  • Loading branch information
yetToBeTested and BoyYangzai committed Jun 30, 2023
1 parent 56f844d commit 50296b5
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions packages/create-doctor/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const questions: prompts.PromptObject[] = [
{
name: "packageName",
type: "text",
message: "请输入 npm 包名(请以 doctors 或@doctors开头)",
message: "请输入 npm 包名(请以 doctors 或 @doctors 开头)",
},
{
name: "description",
Expand Down Expand Up @@ -54,9 +54,14 @@ export default async ({ cwd, args }: IGeneratorOpts) => {
message:
template === ETemplate.preset
? "请输入 doctor 命令(例如:web-tools)"
: "请输入预设名称(例如:web-tools)",
: "请输入 feature 名称(例如:web-tools)",
});
const command = commandAnswer.command;
questions.forEach((item) => {
if (item.name === "packageName") {
item.initial = "doctors-" + template + "-" + command;
}
});
const commandCamelCased = isKebabCase(command)
? kebabToCamelCase(command)
: "";
Expand Down

0 comments on commit 50296b5

Please sign in to comment.