Skip to content

Commit d4381ae

Browse files
authored
docs: Update migration docs to include Vitest. (#932)
Fixes #894 I don't really like adding these sections since users should just use `vp migrate`, but it's better to document than confuse users.
1 parent 8b632f5 commit d4381ae

1 file changed

Lines changed: 21 additions & 5 deletions

File tree

docs/guide/migrate.md

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,25 @@ Finally, verify the migration by running: `vp install`, `vp check`, `vp test`, a
9292
Summarize the migration at the end and report any manual follow-up still required.
9393
```
9494

95-
## tsdown
95+
## Tool-Specific Migrations
96+
97+
### Vitest
98+
99+
Vitest is automatically migrated through `vp migrate`. If you are migrating manually, you have to update all the imports to `vite-plus/test` instead:
100+
101+
```ts
102+
// before
103+
import { describe, expect, it, vi } from 'vitest';
104+
105+
const { page } = await import('@vitest/browser/context');
106+
107+
// after
108+
import { describe, expect, it, vi } from 'vite-plus/test';
109+
110+
const { page } = await import('vite-plus/test/browser/context');
111+
```
112+
113+
### tsdown
96114

97115
If your project uses a `tsdown.config.ts`, move its options into the `pack` block in `vite.config.ts`:
98116

@@ -105,9 +123,7 @@ export default defineConfig({
105123
dts: true,
106124
format: ['esm', 'cjs'],
107125
});
108-
```
109126

110-
```ts
111127
// after — vite.config.ts
112128
import { defineConfig } from 'vite-plus';
113129

@@ -122,9 +138,9 @@ export default defineConfig({
122138

123139
After merging, delete `tsdown.config.ts`. See the [Pack guide](/guide/pack) for the full configuration reference.
124140

125-
## lint-staged
141+
### lint-staged
126142

127-
Vite+ replaces lint-staged with its own `staged` block in `vite.config.ts`. Only the `staged` config format is supported — standalone `.lintstagedrc` in non-JSON format and `lint-staged.config.*` are not migrated automatically.
143+
Vite+ replaces lint-staged with its own `staged` block in `vite.config.ts`. Only the `staged` config format is supported. Standalone `.lintstagedrc` in non-JSON format and `lint-staged.config.*` are not migrated automatically.
128144

129145
Move your lint-staged rules into the `staged` block:
130146

0 commit comments

Comments
 (0)