Skip to content

Commit cc47637

Browse files
fengmk2claude
andcommitted
docs: update vite gen to vite new in documentation
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent dbda4b9 commit cc47637

5 files changed

Lines changed: 69 additions & 69 deletions

File tree

docs/vite/guide/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ GITHUB_TOKEN=$(op read "op://YOUR_GITHUB_TOKEN_PATH") npm install -g @voidzero-d
4343
Create a Vite+ project:
4444

4545
```bash
46-
vite gen
46+
vite new
4747
```
4848

4949
Follow the prompts to select your preferred framework and configuration.

packages/global/templates/generator/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ From monorepo root:
88

99
```bash
1010
# run and select the generator
11-
vite gen
11+
vite new
1212
```
1313

1414
## Development

rfcs/code-generator.md

Lines changed: 64 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ Bingo offers several advantages:
3636

3737
## Integration Strategy: Dual-Mode Support
3838

39-
**Key Decision**: `vite gen` supports BOTH bingo templates AND any existing `create-*` template through intelligent migration:
39+
**Key Decision**: `vite new` supports BOTH bingo templates AND any existing `create-*` template through intelligent migration:
4040

4141
### Two Ways to Write Generators
4242

@@ -46,10 +46,10 @@ Best for creating **reusable local generators** within your monorepo:
4646

4747
```bash
4848
# Run workspace-local bingo generator
49-
vite gen @company/generator-ui-lib
49+
vite new @company/generator-ui-lib
5050

5151
# Or any bingo template from npm
52-
vite gen create-typescript-app
52+
vite new create-typescript-app
5353
```
5454

5555
**Why use bingo**:
@@ -66,9 +66,9 @@ Run **ANY** existing `create-*` template from the ecosystem:
6666

6767
```bash
6868
# Run any existing template
69-
vite gen create-vite
70-
vite gen create-next-app
71-
vite gen create-nuxt
69+
vite new create-vite
70+
vite new create-next-app
71+
vite new create-nuxt
7272
```
7373

7474
**Why use universal templates**:
@@ -113,7 +113,7 @@ Monorepo integration:
113113

114114
```
115115
┌──────────────────────────┐
116-
│ vite gen <name> │
116+
│ vite new <name> │
117117
└───────────┬──────────────┘
118118
119119
┌─────▼─────────┐
@@ -166,7 +166,7 @@ After any template runs, vite+ adds monorepo-specific features:
166166
**Purpose**: Simplify dependency management by consolidating vite, vitest, oxlint, and oxfmt into a single vite-plus package.
167167

168168
```bash
169-
$ vite gen create-vite --template react-ts
169+
$ vite new create-vite --template react-ts
170170

171171
# create-vite runs normally...
172172
✔ Project name: › my-app
@@ -239,10 +239,10 @@ This is a **dependency consolidation** feature, not a tool replacement feature.
239239

240240
### 2. Target Directory Selection (Monorepo)
241241

242-
When running `vite gen` in a monorepo workspace, vite+ prompts users to select which parent directory to create the new package in:
242+
When running `vite new` in a monorepo workspace, vite+ prompts users to select which parent directory to create the new package in:
243243

244244
```bash
245-
$ vite gen create-vite
245+
$ vite new create-vite
246246

247247
◆ Where should we create the new package?
248248
│ ○ apps/ (Applications)
@@ -273,14 +273,14 @@ $ vite gen create-vite
273273
- Clear organization in monorepo
274274
- Users don't need to remember directory structure
275275
- Consistent with workspace organization
276-
- Can be skipped with `--directory` flag: `vite gen create-vite --directory=packages`
276+
- Can be skipped with `--directory` flag: `vite new create-vite --directory=packages`
277277

278278
### 3. Workspace Dependency Prompts
279279

280280
Inspired by [Turbo's generator](https://turborepo.com/docs/guides/generating-code), vite+ prompts users to select existing workspace packages as dependencies:
281281

282282
```bash
283-
$ vite gen @company/generator-ui-lib --name=design-system
283+
$ vite new @company/generator-ui-lib --name=design-system
284284

285285
◇ Library name: design-system
286286
◇ Framework: React
@@ -524,14 +524,14 @@ const detectFramework = createInput({
524524

525525
## Interactive Mode
526526

527-
When running `vite gen` without specifying a template, users enter interactive mode with a beautiful template selection interface.
527+
When running `vite new` without specifying a template, users enter interactive mode with a beautiful template selection interface.
528528

529529
### Template Selection Menu
530530

531531
Interactive mode presents a curated list of known templates:
532532

533533
```bash
534-
$ vite gen
534+
$ vite new
535535

536536
┌ 🎨 Vite+ Code Generator
537537
@@ -583,64 +583,64 @@ When selecting "Other", users can input any npm template:
583583

584584
```bash
585585
# Interactive mode - prompts for template selection
586-
vite gen
586+
vite new
587587

588588
# Built-in vite+ templates
589-
vite gen vite:monorepo # Vite+ monorepo
590-
vite gen vite:generator # Vite+ generator scaffold
591-
vite gen vite:application # Vite+ application
592-
vite gen vite:library # Vite+ library
589+
vite new vite:monorepo # Vite+ monorepo
590+
vite new vite:generator # Vite+ generator scaffold
591+
vite new vite:application # Vite+ application
592+
vite new vite:library # Vite+ library
593593

594594
# Run known templates directly
595-
vite gen create-vite # Vite apps/libs
596-
vite gen @tanstack/create-start # TanStack apps/libs
595+
vite new create-vite # Vite apps/libs
596+
vite new @tanstack/create-start # TanStack apps/libs
597597

598598
# Run ANY template from npm
599-
vite gen create-next-app # Next.js
600-
vite gen create-nuxt # Nuxt
601-
vite gen create-typescript-app # TypeScript (bingo)
602-
vite gen @company/generator-api # Workspace-local bingo generator
599+
vite new create-next-app # Next.js
600+
vite new create-nuxt # Nuxt
601+
vite new create-typescript-app # TypeScript (bingo)
602+
vite new @company/generator-api # Workspace-local bingo generator
603603

604604
# Run built-in vite+ generators
605-
vite gen vite:monorepo
606-
vite gen vite:generator
607-
vite gen vite:application
608-
vite gen vite:library
605+
vite new vite:monorepo
606+
vite new vite:generator
607+
vite new vite:application
608+
vite new vite:library
609609

610610
# Pass through template options (use -- separator)
611-
vite gen create-vite -- --template react-ts
612-
vite gen create-next-app -- --typescript --app
611+
vite new create-vite -- --template react-ts
612+
vite new create-next-app -- --typescript --app
613613

614614
# Control migrations (vite+ options, before --)
615-
vite gen create-vite --no-migrate # Skip all migrations
616-
vite gen create-vite --migrate=vite-plus # Only migrate to vite-plus
615+
vite new create-vite --no-migrate # Skip all migrations
616+
vite new create-vite --migrate=vite-plus # Only migrate to vite-plus
617617

618618
# Control target directory (vite+ options, before --)
619-
vite gen create-vite --directory=packages # Skip directory selection
619+
vite new create-vite --directory=packages # Skip directory selection
620620

621621
# Control workspace dependencies (vite+ options, before --)
622-
vite gen create-vite --deps=@company/utils,@company/logger # Pre-select
623-
vite gen create-vite --no-prompt # Skip workspace dependency prompt
622+
vite new create-vite --deps=@company/utils,@company/logger # Pre-select
623+
vite new create-vite --no-prompt # Skip workspace dependency prompt
624624

625625
# Combine vite+ options and template options
626-
vite gen create-vite --directory=apps --no-migrate --deps=@company/utils -- --template react-ts
626+
vite new create-vite --directory=apps --no-migrate --deps=@company/utils -- --template react-ts
627627

628628
# List available templates
629-
vite gen --list # Shows built-in and popular templates
630-
vite gen --list --all # Shows all installed templates
629+
vite new --list # Shows built-in and popular templates
630+
vite new --list --all # Shows all installed templates
631631

632632
# Dry run (show what would be generated/migrated)
633-
vite gen create-vite --dry-run
633+
vite new create-vite --dry-run
634634

635635
# Combine with template options
636-
vite gen create-vite --dry-run -- --template vue-ts
636+
vite new create-vite --dry-run -- --template vue-ts
637637

638638
# Help
639-
vite gen --help
639+
vite new --help
640640

641641
# Aliases
642642
vite g
643-
vite generate
643+
vite newerate
644644
```
645645

646646
## @vite-plus/create-generator Scaffold
@@ -710,14 +710,14 @@ export default createTemplate({
710710

711711
```bash
712712
# Step 1: Create the generator scaffold
713-
vite gen @vite-plus/create-generator
713+
vite new @vite-plus/create-generator
714714

715715
# Step 2: Customize the template
716716
cd tools/generators/your-generator
717717
# Edit src/template.ts
718718

719719
# Step 3: Test your generator
720-
vite gen @company/your-generator
720+
vite new @company/your-generator
721721

722722
# Step 4: Run tests
723723
vite test
@@ -950,7 +950,7 @@ vite+ acts as an intelligent wrapper that:
950950
### Template Execution Flow
951951

952952
```
953-
1. User runs: vite gen [template-name] [vite-options] -- [template-options]
953+
1. User runs: vite new [template-name] [vite-options] -- [template-options]
954954
955955
2. vite+ parses CLI arguments (split on -- separator)
956956
@@ -1024,7 +1024,7 @@ This approach is **simple and robust**:
10241024
When a template is not installed locally, vite+ automatically uses the appropriate package manager runner:
10251025

10261026
```bash
1027-
$ vite gen create-vite -- --template react-ts
1027+
$ vite new create-vite -- --template react-ts
10281028

10291029
┌ 🎨 Vite+ Code Generator
10301030
@@ -1116,7 +1116,7 @@ This example shows the full monorepo integration with workspace dependency selec
11161116

11171117
```bash
11181118
$ cd my-monorepo
1119-
$ vite gen create-vite -- --template react-ts
1119+
$ vite new create-vite -- --template react-ts
11201120

11211121
┌ 🎨 Vite+ Code Generator
11221122
@@ -1199,7 +1199,7 @@ Next steps:
11991199
Use the built-in `vite:generator` to quickly scaffold a new generator:
12001200

12011201
```bash
1202-
$ vite gen vite:generator
1202+
$ vite new vite:generator
12031203

12041204
┌ 🎨 Vite+ Code Generator
12051205
@@ -1253,7 +1253,7 @@ Summary:
12531253
Next steps:
12541254
cd tools/generators/ui-lib
12551255
# Edit src/template.ts to customize your generator
1256-
# Then test it with: vite gen @company/generator-ui-lib
1256+
# Then test it with: vite new @company/generator-ui-lib
12571257
```
12581258
12591259
The generated scaffold includes:
@@ -1269,7 +1269,7 @@ The generated scaffold includes:
12691269
Use the built-in `vite:application` generator for a vite+ optimized project:
12701270
12711271
```bash
1272-
$ vite gen vite:application
1272+
$ vite new vite:application
12731273
12741274
┌ 🎨 Vite+ Code Generator
12751275
@@ -1327,9 +1327,9 @@ The generated project includes:
13271327
13281328
```bash
13291329
# Use create-typescript-app (a popular bingo template)
1330-
vite gen create-typescript-app
1330+
vite new create-typescript-app
13311331
1332-
┌ vite gen create-typescript-app
1332+
┌ vite new create-typescript-app
13331333
13341334
# vite+ prompts for target directory first
13351335
◆ Where should we create the new package?
@@ -1398,7 +1398,7 @@ Use the official scaffold to quickly create a new generator:
13981398

13991399
```bash
14001400
# Create a new generator in your monorepo
1401-
vite gen @vite-plus/create-generator
1401+
vite new @vite-plus/create-generator
14021402

14031403
┌ @vite-plus/create-generator
14041404
@@ -1423,7 +1423,7 @@ vite gen @vite-plus/create-generator
14231423
Next steps:
14241424
1. cd tools/generators/ui-lib
14251425
2. Edit src/template.ts to define your generator logic
1426-
3. Test with: vite gen @company/generator-ui-lib
1426+
3. Test with: vite new @company/generator-ui-lib
14271427
```
14281428

14291429
#### Generated Structure
@@ -1746,13 +1746,13 @@ Generate new UI component libraries for our monorepo.
17461746
From monorepo root:
17471747

17481748
\`\`\`bash
1749-
vite gen @company/generator-ui-lib
1749+
vite new @company/generator-ui-lib
17501750
\`\`\`
17511751

17521752
With options:
17531753

17541754
\`\`\`bash
1755-
vite gen @company/generator-ui-lib --name=design-system --framework=react
1755+
vite new @company/generator-ui-lib --name=design-system --framework=react
17561756
\`\`\`
17571757

17581758
## Development
@@ -1765,7 +1765,7 @@ vite test
17651765

17661766
# Test the generator
17671767

1768-
vite gen @company/generator-ui-lib
1768+
vite new @company/generator-ui-lib
17691769
\`\`\`
17701770

17711771
## Customization
@@ -1781,7 +1781,7 @@ Edit `src/template.ts` to customize:
17811781

17821782
```bash
17831783
# Run from monorepo root
1784-
vite gen @company/generator-ui-lib
1784+
vite new @company/generator-ui-lib
17851785

17861786
# Bingo generator prompts
17871787
┌ @company/generator-ui-lib
@@ -1839,13 +1839,13 @@ Next steps:
18391839
5. npm run storybook (view docs)
18401840

18411841
# CLI options
1842-
vite gen @company/generator-ui-lib --name=icons --no-migrate # Skip migrations
1843-
vite gen @company/generator-ui-lib --name=hooks --deps=@company/utils # Pre-select deps
1842+
vite new @company/generator-ui-lib --name=icons --no-migrate # Skip migrations
1843+
vite new @company/generator-ui-lib --name=hooks --deps=@company/utils # Pre-select deps
18441844
```
18451845

18461846
**Key Point**: Even your own bingo generators benefit from auto-migration! You can generate code using standalone vite/vitest/oxlint, and vite+ will automatically consolidate them into vite-plus.
18471847

1848-
**Tip**: Use `vite gen @vite-plus/create-generator` to quickly scaffold a new generator in your monorepo!
1848+
**Tip**: Use `vite new @vite-plus/create-generator` to quickly scaffold a new generator in your monorepo!
18491849

18501850
**Testing the Generator:**
18511851

@@ -1894,7 +1894,7 @@ For monorepo-specific needs, vite+ can provide thin wrappers:
18941894

18951895
```bash
18961896
# Built-in generator that configures vite-task.json automatically
1897-
vite gen vite:library --name=shared-utils
1897+
vite new vite:library --name=shared-utils
18981898

18991899
# This could wrap an existing bingo template and add:
19001900
# - vite-task.json with build/test/lint tasks
@@ -2169,7 +2169,7 @@ A successful implementation should:
21692169

21702170
- [migration-command.md](./migration-command.md) - `vite migration` command for migrating existing projects
21712171
- Shares the same migration engine and rules
2172-
- `vite gen` runs migrations after template generation
2172+
- `vite new` runs migrations after template generation
21732173
- `vite migration` runs migrations on existing projects
21742174

21752175
## References

rfcs/migration-command.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ When transitioning to vite+, projects typically use standalone tools like vite,
1515

1616
**Related Commands**:
1717

18-
- `vite gen` - Uses this same migration engine after generating code (see [code-generator.md](./code-generator.md))
18+
- `vite new` - Uses this same migration engine after generating code (see [code-generator.md](./code-generator.md))
1919
- `vite migration` - This command, for migrating existing projects
2020

2121
## Goals

0 commit comments

Comments
 (0)