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

adopt prompt based user experience for the init experience #1279

Open
thescientist13 opened this issue Sep 11, 2024 · 0 comments
Open

adopt prompt based user experience for the init experience #1279

thescientist13 opened this issue Sep 11, 2024 · 0 comments
Labels
breaking feature New feature or request Init
Milestone

Comments

@thescientist13
Copy link
Member

thescientist13 commented Sep 11, 2024

Summary

Currently the init package is very flag heavy, and a little clunky in its execution

```bash
# example
npx @greenwood/init@latest --template=blog 
```

```bash
# npm install
npx @greenwood/init@latest --install

# To automatically run `yarn install` after scaffolding, pass the `--yarn` flag.
npx @greenwood/init@latest --yarn
```

I like the experience a lot of other meta-frameworks take where it is is just a series of prompts you can enter through, and I think Greenwood would benefit from this approach as well.

astro-init.mov
next-init.mov
svelte-init.mov

Details

In particular to address these issues

  1. Flags can get long and hard to remember and chain together, and can be hard to express, especially in the context of more features we want to add (expand package manager options for init scaffolding #1272, init scaffolding should prompt for installing common plugins (TypeScript and markdown) #1270)
  2. Adding / updating features would require adding new flags. With prompts, we can extend / update the experience a lot more efficiently without directly impacting the user experience

I can see the new flow being presented as such

  1. Project Name (> input) - default is current directory
  2. Package Manager (options)
    • npm (default)
    • yarn
    • pnpm
  3. Install Dependencies (options)
    • yes (default)
    • no
  4. Template (options)
    • None (default)
    • blog
  5. Next steps
    • cd {MY_APP}
    • npm run dev (or yarn, pnpm, etc)

(I'm also OK dropping the flags support as well unless its trivial to implement / maintain)


I think once we do this, we can probably shorten the recommended Init script on the website to be able to drop the my-app param, since it will now be the default
Screenshot 2024-09-20 at 12 50 50 PM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking feature New feature or request Init
Projects
Status: 📋 Backlog
Development

No branches or pull requests

1 participant