-
-
Notifications
You must be signed in to change notification settings - Fork 134
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
feat(create-waku): --project-name option #1232
feat(create-waku): --project-name option #1232
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 1 Skipped Deployment
|
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. |
packages/create-waku/src/index.ts
Outdated
onState: (state: any) => (targetDir = String(state.value).trim()), | ||
onState: (state: any) => | ||
(targetDir = | ||
String(values['project-name']).trim() || |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This might be unnecessary... checking...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, removed the change from there.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we still need this?
let targetDir = values['project-name'] || '';
Or,
let targetDir = '';
works?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, we still need that. Otherwise, it prompts for package name because targetDir
is empty.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for confirming. Then, I hope this works.
packages/create-waku/src/index.ts
Outdated
@@ -98,14 +101,14 @@ async function doPrompts() { | |||
const templateNames = await getTemplateNames(templateRoot); | |||
|
|||
const defaultProjectName = 'waku-project'; | |||
let targetDir = ''; | |||
let targetDir = values['project-name'] || ''; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let targetDir = values['project-name'] || ''; | |
let targetDir = values['project-name'] || defaultProjectName; |
and the change L119
- message: `${targetDir || defaultProjectName} is not empty. Remove existing files and continue?`,
+ message: `${targetDir} is not empty. Remove existing files and continue?`,
work?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. I made this update and tested it. Looks good.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Fixes #1208