Repository: storybook
Issue: [Tracking]: Storybook Test onboarding via `storybook init`
Labels: feature request,cli,Tracking,addon: test

## 🧑‍🤝‍🧑 Who: @ghengeveld and @ndelangen

This is a tracking issue for the **Onboard to Storybook Test via init** project. Its purpose is to keep track of the overall status of the project and tasks and plan everything around it.

## 🏁 Goals

1. Simplify installation of Storybook Test by offering a zero-config setup in more complex projects. This includes Next.js users and custom Vite or Vitest setups. Right now the addon will fail to finish its postinstall step if it detects an unsupported scenario.
2. Improve visibility & awareness of Storybook Test. By making testing more prominent during initial Storybook setup, new users are more likely to adopt this capability, or at least be aware of its existence.
3. Gain insight into what users intend to use Storybook for, by explicitly asking this question during setup. Do they plan on using Storybook for testing, documentation, both, or just development?
4. Avoid installing unnecessary dependencies. Based on the intended use, we can intelligently install only the packages the user will need.
5. Improve the usability and maintainability of the Storybook CLI. Right now the CLI is poorly designed, hard to maintain, and not user-friendly. Its output is verbose, cluttered and inconsistent. This is an opportunity to address all those issues by completely reimplementing the `init` command of the CLI. We plan to use [Ink](https://github.com/vadimdemedes/ink) which allows us to provide a rich, interactive experience while being able to develop in Storybook and use known React patterns. 

## 🚩 Milestones

```[tasklist]
## New `init` CLI (Jan 21)
- [x] Setup Ink as subsystem under the `storybook ink` CLI command
- [x] Configure our Storybook to render stories for Ink components
- [x] Scaffold interactive `init` user flow (questions, fake compatibility checks and dependency installation, mock result)
- [x] Support selecting options through CLI flags
- [x] Track metrics for user choices
```

```[tasklist]
## Compatibility resolvers (Jan 28)
- [ ] https://github.com/storybookjs/storybook/issues/30226
- [ ] https://github.com/storybookjs/storybook/issues/30229
- [ ] https://github.com/storybookjs/storybook/issues/30228
- [ ] https://github.com/storybookjs/storybook/issues/30227
- [ ] https://github.com/storybookjs/storybook/issues/30327
- [ ] https://github.com/storybookjs/storybook/issues/30324
- [ ] https://github.com/storybookjs/storybook/issues/30325
- [ ] https://github.com/storybookjs/storybook/issues/30326
```

```[tasklist]
## Update Old CLI (Feb 4)
- [ ] Add dev/docs/test intent prompt to old CLI
- [ ] Add new compatibility checks to old CLI
- [ ] Trigger `storybook add addon-test` at the end of old CLI if test intent and compatible
- [ ] Update addon-test postinstall hook to update existing Vitest config rather than bail
```

```[tasklist]
## Showcase testing in template stories (Jan 28)
- [ ] Update `header` story with mocked auth logic and interaction assertions
```

```[tasklist]
## Documentation updates (Jan 28)
- [ ] https://github.com/storybookjs/storybook/issues/30230
```

```[tasklist]
### `create-storybook` optimizations
- [ ] Don't depend on `storybook` in `create-storybook`
- [ ] Don't depend on `prettier` to autoformat the main-config
- [ ] Prebundle dependencies in `create-storybook`
- [ ] Document `npm create storybook` instead of `npx storybook init` in docs
```

```[tasklist]
### Other expandable scope
- [ ] Re-design the "Configure Your Project" page to highlight testing
- [ ] CLI flag or option to skip generating template stories and omit addon-onboarding
- [ ] CLI command to add `test` or `docs` capabilities to existing Storybook
```