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

docs: add commands in code groups to enhance clarity and ease of use #17396

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 60 additions & 6 deletions docs/guide/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,27 +67,81 @@ $ bun create vite

:::


You can use `.` to scaffold inside an existing directory.

::: code-group

```bash [NPM]
$ npm create vite@latest .
```

```bash [Yarn]
$ yarn create vite .
```

```bash [PNPM]
$ pnpm create vite .
```

```bash [Bun]
$ bun create vite .
```

:::


Then follow the prompts!

You can also directly specify the project name and the template you want to use via additional command line options. For example, to scaffold a Vite + Vue project, run:

```bash
::: code-group

```bash [NPM]
# npm 7+, extra double-dash is needed:
npm create vite@latest my-vue-app -- --template vue
```

# yarn
```bash [Yarn]
yarn create vite my-vue-app --template vue
```

# pnpm
```bash [PNPM]
pnpm create vite my-vue-app --template vue
```

# bun
```bash [Bun]
bun create vite my-vue-app --template vue
```

Comment on lines +98 to 116
Copy link
Member

Choose a reason for hiding this comment

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

Can we keep this change only and revert the rest? I don't think the others need to be added/changed.

Copy link
Author

Choose a reason for hiding this comment

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

Okay. That sounds good. If I see a need for any further changes, I will make a new PR.

Copy link
Author

Choose a reason for hiding this comment

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

Please let me know if there is anything else I must do. Thank you.

Copy link
Member

Choose a reason for hiding this comment

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

@BhanuVikram as @bluwy explained, we'd like to merge only the change to add the code-group here, and leave the rest as it was before.

Copy link
Author

Choose a reason for hiding this comment

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

@patak-dev Do I need to do anything to accomplish that?

Copy link
Member

Choose a reason for hiding this comment

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

Yes, do the changes as explained in my comment. Please update this PR to change it.

See [create-vite](https://github.com/vitejs/vite/tree/main/packages/create-vite) for more details on each supported template: `vanilla`, `vanilla-ts`, `vue`, `vue-ts`, `react`, `react-ts`, `react-swc`, `react-swc-ts`, `preact`, `preact-ts`, `lit`, `lit-ts`, `svelte`, `svelte-ts`, `solid`, `solid-ts`, `qwik`, `qwik-ts`.
:::


You can use `.` for the project name to scaffold in the current directory.

::: code-group

```bash [NPM]
# npm 7+, extra double-dash is needed:
npm create vite@latest . -- --template vue
```

You can use `.` for the project name to scaffold in the current directory.
```bash [Yarn]
yarn create vite . --template vue
```

```bash [PNPM]
pnpm create vite . --template vue
```

```bash [Bun]
bun create vite . --template vue
```

:::


See [create-vite](https://github.com/vitejs/vite/tree/main/packages/create-vite) for more details on each supported template: `vanilla`, `vanilla-ts`, `vue`, `vue-ts`, `react`, `react-ts`, `react-swc`, `react-swc-ts`, `preact`, `preact-ts`, `lit`, `lit-ts`, `svelte`, `svelte-ts`, `solid`, `solid-ts`, `qwik`, `qwik-ts`.

## Community Templates

Expand Down
Loading