dai-shi / waku

⛩️ The minimal React framework
https://waku.gg
MIT License
3.91k stars 102 forks source link

feat(create-waku): recover choose option #647

Closed dai-shi closed 1 month ago

dai-shi commented 1 month ago

I had thought it would be nice to have a single --example option, but changed my mind. This introduces --choose option again.

https://github.com/dai-shi/waku/discussions/315#discussioncomment-8990718

closes #625 along with #641

vercel[bot] commented 1 month ago

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

1 Ignored Deployment | Name | Status | Preview | Updated (UTC) | | :--- | :----- | :------ | :------ | | **waku** | ⬜️ Ignored ([Inspect](https://vercel.com/daishis-projects/waku/BMrtsAKXPaACD6SMeAwBAoGniuTe)) | [Visit Preview](https://waku-git-create-with-local-template-daishis-projects.vercel.app) | Apr 3, 2024 1:01am |
codesandbox-ci[bot] commented 1 month ago

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.

ojj1123 commented 1 month ago

but it comes with a hack DEFAULT_REF. https://github.com/dai-shi/waku/discussions/315#discussioncomment-8990718

I agree with you. But I don't think it is necessary to use --choose option. Because even if we don't write --choose option, we can select the template by default. So, how about choosing one of the templates without --choose option?

I think it's easier to choose a template without --choose than to choose it with --choose. Like this:

> pnpm create waku
✔ Project name: … waku-project
✔ Select a framework: › 
  > template-js
     template-ts
     tailwind-js
     tailwind-ts
     ...

Scaffolding project in /Users/jeongjin/GitHub/waku-project...

Above the example, We could select template-js by default. create-next-app and create-vite use this way. Try it!

pnpm create vite
pnpm create next-app
ojj1123 commented 1 month ago

And --example option is just used to download the other repo?

dai-shi commented 1 month ago

we can select the template by default.

We used to have it. It's intentional for now. This is an advanced option, because not all examples are well described. Eventually, if we improve some templates so that we can recommend them, we can enable the selector again.