Skip to content

Commit 679fc56

Browse files
author
duowenbo
committed
fix(ui): add viteplus to prehydrate and tests
1 parent 5b29e80 commit 679fc56

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

app/utils/prehydrate.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export function initPreferencesOnPrehydrate() {
2121
] satisfies typeof ACCENT_COLOR_IDS)
2222

2323
// Valid package manager IDs
24-
const validPMs = new Set(['npm', 'pnpm', 'yarn', 'bun', 'deno', 'vlt'])
24+
const validPMs = new Set(['npm', 'pnpm', 'yarn', 'bun', 'deno', 'vlt', 'vp'])
2525

2626
// Read settings from localStorage
2727
const settings = JSON.parse(

test/unit/app/utils/install-command.spec.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ describe('install command generation', () => {
3535
['bun', 'lodash'],
3636
['deno', 'npm:lodash'],
3737
['vlt', 'lodash'],
38+
['vp', 'lodash'],
3839
] as const)('%s → %s', (pm, expected) => {
3940
expect(
4041
getPackageSpecifier({
@@ -54,6 +55,7 @@ describe('install command generation', () => {
5455
['bun', '@trpc/server'],
5556
['deno', 'jsr:@trpc/server'], // Native JSR specifier preferred
5657
['vlt', '@trpc/server'],
58+
['vp', '@trpc/server'],
5759
] as const)('%s → %s', (pm, expected) => {
5860
expect(
5961
getPackageSpecifier({
@@ -73,6 +75,7 @@ describe('install command generation', () => {
7375
['bun', '@vue/shared'],
7476
['deno', 'npm:@vue/shared'], // Falls back to npm: compat
7577
['vlt', '@vue/shared'],
78+
['vp', '@vue/shared'],
7679
] as const)('%s → %s', (pm, expected) => {
7780
expect(
7881
getPackageSpecifier({
@@ -94,6 +97,7 @@ describe('install command generation', () => {
9497
['bun', 'bun add lodash'],
9598
['deno', 'deno add npm:lodash'],
9699
['vlt', 'vlt install lodash'],
100+
['vp', 'vp add lodash'],
97101
] as const)('%s → %s', (pm, expected) => {
98102
expect(
99103
getInstallCommand({
@@ -113,6 +117,7 @@ describe('install command generation', () => {
113117
['bun', 'bun add lodash@4.17.21'],
114118
['deno', 'deno add npm:lodash@4.17.21'],
115119
['vlt', 'vlt install lodash@4.17.21'],
120+
['vp', 'vp add lodash@4.17.21'],
116121
] as const)('%s → %s', (pm, expected) => {
117122
expect(
118123
getInstallCommand({
@@ -133,6 +138,7 @@ describe('install command generation', () => {
133138
['bun', 'bun add -d eslint'],
134139
['deno', 'deno add -D npm:eslint'],
135140
['vlt', 'vlt install -D eslint'],
141+
['vp', 'vp add -D eslint'],
136142
] as const)('%s → %s', (pm, expected) => {
137143
expect(
138144
getInstallCommand({
@@ -153,6 +159,7 @@ describe('install command generation', () => {
153159
['bun', 'bun add @trpc/server'],
154160
['deno', 'deno add jsr:@trpc/server'], // Native JSR preferred
155161
['vlt', 'vlt install @trpc/server'],
162+
['vp', 'vp add @trpc/server'],
156163
] as const)('%s → %s', (pm, expected) => {
157164
expect(
158165
getInstallCommand({
@@ -172,6 +179,7 @@ describe('install command generation', () => {
172179
['bun', 'bun add @trpc/server@10.0.0'],
173180
['deno', 'deno add jsr:@trpc/server@10.0.0'], // Native JSR with version
174181
['vlt', 'vlt install @trpc/server@10.0.0'],
182+
['vp', 'vp add @trpc/server@10.0.0'],
175183
] as const)('%s → %s', (pm, expected) => {
176184
expect(
177185
getInstallCommand({
@@ -192,6 +200,7 @@ describe('install command generation', () => {
192200
['bun', 'bun add @vue/shared'],
193201
['deno', 'deno add npm:@vue/shared'], // Falls back to npm: compat
194202
['vlt', 'vlt install @vue/shared'],
203+
['vp', 'vp add @vue/shared'],
195204
] as const)('%s → %s', (pm, expected) => {
196205
expect(
197206
getInstallCommand({
@@ -345,6 +354,7 @@ describe('install command generation', () => {
345354
['bun', ['bunx', 'eslint']],
346355
['deno', ['deno', 'run', 'npm:eslint']],
347356
['vlt', ['vlx', 'eslint']],
357+
['vp', ['vp', 'exec', 'eslint']],
348358
] as const)('%s → %s', (pm, expected) => {
349359
expect(
350360
getExecuteCommandParts({
@@ -364,6 +374,7 @@ describe('install command generation', () => {
364374
['bun', ['bunx', 'degit']],
365375
['deno', ['deno', 'run', 'npm:degit']],
366376
['vlt', ['vlx', 'degit']],
377+
['vp', ['vp', 'dlx', 'degit']],
367378
] as const)('%s → %s', (pm, expected) => {
368379
expect(
369380
getExecuteCommandParts({
@@ -383,6 +394,7 @@ describe('install command generation', () => {
383394
['bun', ['bun', 'create', 'vite']],
384395
['deno', ['deno', 'create', 'npm:vite']],
385396
['vlt', ['vlx', 'vite']],
397+
['vp', ['vp', 'create', 'vite']],
386398
] as const)('%s → %s', (pm, expected) => {
387399
expect(
388400
getExecuteCommandParts({

0 commit comments

Comments
 (0)