Skip to content

fix(test): patch more paths in test build#353

Merged
Brooooooklyn merged 9 commits intomainfrom
12-17-fix_test_patch_more_paths_in_test_build
Dec 18, 2025
Merged

fix(test): patch more paths in test build#353
Brooooooklyn merged 9 commits intomainfrom
12-17-fix_test_patch_more_paths_in_test_build

Conversation

@Brooooooklyn
Copy link
Copy Markdown
Member

@Brooooooklyn Brooooooklyn commented Dec 17, 2025

Note

Adds WebdriverIO and Preview providers to the bundled test package, generalizes build patches (imports, types, locators), extends exports, and updates docs and blocklists.

  • Test build system:
    • Generalize locator patching to all browser providers (browser-playwright, browser-webdriverio, browser-preview).
    • Rewrite imports in both .js and .d.ts; add creation of browser/ entry files (context.js/.d.ts).
    • Copy root *.d.ts from @vitest/* (e.g., context.d.ts, matchers.d.ts, jest-dom.d.ts).
    • Strengthen vendor-aliases plugin: handle vitest/* and package aliases; add virtual vitest/browser; throw on missing patch points.
    • Expand EXTERNAL_BLOCKLIST to include webdriverio.
  • Exports and packaging:
    • Add subpath exports for browser-webdriverio and browser-preview in both test and CLI packages.
    • Replace old browser-playwright-context plugin export with browser-webdriverio and browser-preview.
    • Remove @vitest/browser-* providers from peer deps (now bundled); keep @vitest/ui optional.
  • Docs (BUNDLING.md):
    • Increase copied packages to include @vitest/browser-webdriverio and @vitest/browser-preview.
    • Update import rewrite table, pnpm overrides, config examples, blocklist, and aliasing details.

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

Copilot AI review requested due to automatic review settings December 17, 2025 10:31
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 enhances the test build script to handle additional import path mappings for the @voidzero-dev/vite-plus-test package. The changes enable the package to work as a drop-in replacement for vitest by mapping both vitest/* and @voidzero-dev/vite-plus-test/* imports to the appropriate bundled files.

Key changes:

  • Added comprehensive subpath mapping for vitest/* imports (node, config, internal/browser, runners, suite, etc.) to resolve to dist files
  • Added support for @voidzero-dev/vite-plus-test/* subpaths to be treated as equivalent to vitest/* imports
  • Patched BrowserContext plugin to recognize @voidzero-dev/vite-plus-test/browser as an alias for the vitest browser context

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

Brooooooklyn and others added 3 commits December 17, 2025 19:09
Document the enhanced vendor-aliases plugin capabilities:
- vitest/browser-playwright now works when vitest is overridden
- @voidzero-dev/vite-plus-test/* subpaths are supported
- Clarify the two config file import options

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Added support for `@voidzero-dev/vite-plus/test/*` subpath imports in addition
to existing `vitest/*` and `@voidzero-dev/vite-plus-test/*` patterns.

All three import patterns now work:
- `vitest/browser-playwright` (Recommended, requires vitest override)
- `@voidzero-dev/vite-plus-test/browser-playwright` (direct test package)
- `@voidzero-dev/vite-plus/test/browser-playwright` (direct CLI package)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@Brooooooklyn
Copy link
Copy Markdown
Member Author

cursor review

Comment thread packages/test/build.ts
Comment thread packages/test/build.ts Outdated
@Brooooooklyn
Copy link
Copy Markdown
Member Author

@codex review

Convert warnings to errors for critical patches in patchVitestBrowserPackage:
- vendor-aliases plugin injection
- exclude list patching
- BrowserContext alias patching

This ensures build fails immediately if vitest code changes break our patches,
rather than producing confusing runtime errors for users.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Copy link
Copy Markdown
Member Author

@Brooooooklyn Brooooooklyn left a comment

Choose a reason for hiding this comment

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

Re: cursor bot comment about missing vitest/browser-playwright - This is a false positive.

The vitestSubpathMap is for browser-side resolution in the vendor-aliases plugin. But vitest/browser-playwright is ONLY imported in vite.config.ts files (Node.js context), not in browser code.

The tester chunk only imports vitest/browser:

import { userEvent, page, server } from 'vitest/browser';

Config-time imports are resolved by Node.js via pnpm overrides and package.json exports, not by the vendor-aliases plugin.


Re: @fengmk2 comment - Fixed! Changed warnings to throw errors for all critical patches in patchVitestBrowserPackage. Now the build will fail immediately if vitest code changes break our patches, rather than producing confusing runtime errors.

Copilot AI review requested due to automatic review settings December 17, 2025 11:49
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 2 out of 2 changed files in this pull request and generated 4 comments.


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

Comment thread packages/test/build.ts
Comment thread packages/test/BUNDLING.md
Comment thread packages/test/BUNDLING.md
Comment thread packages/test/build.ts Outdated
@chatgpt-codex-connector
Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Hooray!

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Copilot AI review requested due to automatic review settings December 18, 2025 03:11
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 4 out of 5 changed files in this pull request and generated 1 comment.

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
@Brooooooklyn
Copy link
Copy Markdown
Member Author

cursor review

Comment thread packages/test/build.ts
Copilot AI review requested due to automatic review settings December 18, 2025 05:06
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 4 out of 5 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
Copy link
Copy Markdown
Member Author

Brooooooklyn commented Dec 18, 2025

Merge activity

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

@Brooooooklyn Brooooooklyn merged commit 7153ea3 into main Dec 18, 2025
18 checks passed
@Brooooooklyn Brooooooklyn deleted the 12-17-fix_test_patch_more_paths_in_test_build branch December 18, 2025 06:03
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