Skip to content
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

Merged
merged 5 commits into from
Feb 17, 2025

Conversation

rmarscher
Copy link
Contributor

Fixes #1208

Copy link

vercel bot commented Feb 16, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Skipped Deployment
Name Status Preview Updated (UTC)
waku ⬜️ Ignored (Inspect) Visit Preview Feb 17, 2025 6:34am

Copy link

codesandbox-ci bot commented Feb 16, 2025

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.

onState: (state: any) => (targetDir = String(state.value).trim()),
onState: (state: any) =>
(targetDir =
String(values['project-name']).trim() ||
Copy link
Contributor Author

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...

Copy link
Contributor Author

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.

Copy link
Owner

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?

Copy link
Contributor Author

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.

Copy link
Owner

@dai-shi dai-shi left a 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.

@@ -98,14 +101,14 @@ async function doPrompts() {
const templateNames = await getTemplateNames(templateRoot);

const defaultProjectName = 'waku-project';
let targetDir = '';
let targetDir = values['project-name'] || '';
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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?

Copy link
Contributor Author

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.

@dai-shi dai-shi mentioned this pull request Feb 17, 2025
@dai-shi dai-shi changed the title feat: --project-name option for create-waku feat(create-waku): --project-name option Feb 17, 2025
Copy link
Owner

@dai-shi dai-shi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@dai-shi dai-shi merged commit ff9c9ef into dai-shi:main Feb 17, 2025
26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

create-waku non-interactive
2 participants