Skip to content

fix(test): patch vitest resolver#356

Merged
Brooooooklyn merged 7 commits intomainfrom
patch-vitest-resolver
Dec 22, 2025
Merged

fix(test): patch vitest resolver#356
Brooooooklyn merged 7 commits intomainfrom
patch-vitest-resolver

Conversation

@Brooooooklyn
Copy link
Copy Markdown
Member

@Brooooooklyn Brooooooklyn commented Dec 18, 2025

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.

Written by Cursor Bugbot for commit caf4aca. This will update automatically on new commits. Configure here.

Copilot AI review requested due to automatic review settings December 18, 2025 09:20
Copy link
Copy Markdown
Member Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds a patch to the vitest resolver to ensure proper module identity when using package aliases. The patch resolves both @voidzero-dev/vite-plus/test and @voidzero-dev/vite-plus-test directly to the bundled vitest distribution, bypassing re-export chains that break module identity in Vite's SSR transform, particularly affecting expect.extend() mutations.

Key Changes:

  • Introduces patchVitestCoreResolver() function to patch the VitestCoreResolver's resolveId method
  • Adds direct resolution for CLI test package aliases and their subpaths
  • Integrates the new patch into the post-processing step of the build flow

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread packages/test/build.ts Outdated
Comment thread packages/test/build.ts
Comment thread packages/test/build.ts
Copilot AI review requested due to automatic review settings December 19, 2025 01:18
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 4 changed files in this pull request and generated no new comments.

Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copilot AI review requested due to automatic review settings December 19, 2025 10:01
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 6 out of 7 changed files in this pull request and generated 2 comments.

Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread packages/test/build.ts
Comment thread packages/test/build.ts
Comment thread packages/test/build.ts
Copilot AI review requested due to automatic review settings December 22, 2025 08:04
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 6 out of 7 changed files in this pull request and generated 3 comments.

Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread packages/test/build.ts Outdated
Comment thread packages/test/build.ts Outdated
@Brooooooklyn Brooooooklyn requested a review from fengmk2 December 22, 2025 08:11
Copy link
Copy Markdown
Member Author

Brooooooklyn commented Dec 22, 2025

Merge activity

  • Dec 22, 8:29 AM UTC: A user started a stack merge that includes this pull request via Graphite.
  • Dec 22, 8:29 AM UTC: @Brooooooklyn merged this pull request with Graphite.

@Brooooooklyn Brooooooklyn merged commit 895581e into main Dec 22, 2025
13 checks passed
@Brooooooklyn Brooooooklyn deleted the patch-vitest-resolver branch December 22, 2025 08:29
@Brooooooklyn Brooooooklyn review requested due to automatic review settings March 23, 2026 23:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants