Skip to content

Commit b4e091c

Browse files
jong-kyungfengmk2
andauthored
fix(create): suggest vp run for all templates (#1127)
## Summary - Fix `vp create` to suggest `vp run` instead of `vp dev` for non-Vite-native templates (Astro, Nuxt, etc.) - Also fix the monorepo path: non-builtin templates now suggest `cd <dir> && vp run` instead of `vp dev <dir>` - Extract `getCreateNextCommand` and `getNextCommand` to `utils.ts` for testability - Add unit tests covering all template type × environment (standalone/monorepo) combinations - Add snap tests for monorepo next command verification Closes #1123 --------- Co-authored-by: MK (fengmk2) <fengmk2@gmail.com>
1 parent 2ce7af3 commit b4e091c

File tree

13 files changed

+76
-8
lines changed

13 files changed

+76
-8
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
> vp create vite:application --no-interactive # verify next command suggests vp run
2+
3+
Using default package name: vite-plus-application
4+
◇ Scaffolded vite-plus-application with Vite application
5+
• Node <semver> pnpm <semver>
6+
→ Next: cd vite-plus-application && vp run
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"commands": [
3+
{
4+
"command": "vp create vite:application --no-interactive # verify next command suggests vp run",
5+
"ignoreOutput": false
6+
}
7+
]
8+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
> vp create vite:library --no-interactive # verify next command suggests vp run
2+
3+
Using default package name: vite-plus-library
4+
◇ Scaffolded vite-plus-library with TypeScript library
5+
• Node <semver> pnpm <semver>
6+
→ Next: cd vite-plus-library && vp run
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"commands": [
3+
{
4+
"command": "vp create vite:library --no-interactive # verify next command suggests vp run",
5+
"ignoreOutput": false
6+
}
7+
]
8+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"name": "existing-app"
3+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"name": "test-monorepo",
3+
"workspaces": [
4+
"apps/*"
5+
]
6+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
> vp create vite:application --no-interactive # monorepo: next command should suggest vp run
2+
3+
Using default package name: vite-plus-application
4+
◇ Scaffolded apps/vite-plus-application with Vite application
5+
• Node <semver> pnpm <semver>
6+
→ Next: cd apps/vite-plus-application && vp run
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"commands": [
3+
{
4+
"command": "vp create vite:application --no-interactive # monorepo: next command should suggest vp run",
5+
"ignoreOutput": false
6+
}
7+
]
8+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"name": "test-monorepo",
3+
"workspaces": [
4+
"packages/*"
5+
]
6+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"name": "existing-lib"
3+
}

0 commit comments

Comments
 (0)