Commit 895581e
authored
fix(test): patch vitest resolver (#356)
<!-- CURSOR_SUMMARY -->
> [!NOTE]
> Patches Vitest resolver and test build to resolve package aliases directly, aligns browser context/provider exports, and fixes type/module augmentations.
>
> - **Test build (`packages/test/build.ts`)**:
> - Patch `VitestCoreResolver` to resolve `@voidzero-dev/vite-plus/test` and `@voidzero-dev/vite-plus-test` directly to `dist/index.js`, with subpath routing to `vitest/*`.
> - Add patches for module augmentations (`global.d.*.d.ts` -> relative paths), Chai type reference in `@vitest/expect/index.d.ts`, and mocker `hoistedModule` to accept package aliases.
> - Expand optimizeDeps exclude list and inject vendor-aliases handling for vitest/browser and aliases.
> - Create browser entry files and context/type wiring; copy/update browser client files and vendor stubs.
> - **Exports and shims**:
> - Route `./context` and `./browser/context` to `./dist/@vitest/browser/context.js` (preserve single module identity).
> - Add `./browser/providers/{playwright,webdriverio,preview}` subpath exports in both `packages/test` and `packages/cli`.
> - CLI `build.ts`: `.d.ts` shims now include side-effect import before `export *` to keep module augmentations.
> - **Dependencies**:
> - Add `@types/chai` to test package; add `playwright` as a root devDependency.
>
> <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit caf4aca. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->1 parent b9acebf commit 895581e
7 files changed
Lines changed: 334 additions & 31 deletions
File tree
- packages
- cli
- test
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| 29 | + | |
29 | 30 | | |
30 | 31 | | |
31 | 32 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
156 | 156 | | |
157 | 157 | | |
158 | 158 | | |
159 | | - | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
160 | 164 | | |
161 | 165 | | |
162 | 166 | | |
| |||
184 | 188 | | |
185 | 189 | | |
186 | 190 | | |
187 | | - | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
188 | 196 | | |
189 | 197 | | |
190 | 198 | | |
| |||
220 | 228 | | |
221 | 229 | | |
222 | 230 | | |
223 | | - | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
224 | 236 | | |
225 | 237 | | |
226 | 238 | | |
| |||
244 | 256 | | |
245 | 257 | | |
246 | 258 | | |
247 | | - | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
248 | 264 | | |
249 | 265 | | |
250 | 266 | | |
| |||
276 | 292 | | |
277 | 293 | | |
278 | 294 | | |
279 | | - | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
280 | 300 | | |
281 | 301 | | |
282 | 302 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
155 | 155 | | |
156 | 156 | | |
157 | 157 | | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
158 | 162 | | |
159 | 163 | | |
160 | 164 | | |
| |||
176 | 180 | | |
177 | 181 | | |
178 | 182 | | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
179 | 195 | | |
180 | 196 | | |
181 | 197 | | |
| |||
0 commit comments