fix(check): exclude test-runner files from app compatibility scans#2596
Open
NathanDrake2406 wants to merge 1 commit into
Open
fix(check): exclude test-runner files from app compatibility scans#2596NathanDrake2406 wants to merge 1 commit into
NathanDrake2406 wants to merge 1 commit into
Conversation
vinext check scans test modules and test-runner configuration as though they are bundled into the migrated application. Apps using CommonJS globals only in Vitest files therefore receive unsupported migration issues even when the vinext build succeeds. Separate the application compatibility candidate set from the general recursive file finder. Exclude test and spec modules plus conventional Jest, Playwright, and Vitest config files, while keeping ordinary runtime config modules visible to import and convention checks.
commit: |
Contributor
Performance benchmarksCompared 0 improved · 2 regressed · 4 within ±1.5%
View detailed results and traces 🟢 improvement · 🔴 regression · ⚫ change below 1.5% · paired base/head |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
vinext checkrecursively treated every JavaScript and TypeScript file as possible app runtime source.Why
vinext checkshould report compatibility for files that can contribute to the application bundle. Test modules and test-runner configuration execute under their own runners, so treating them as vinext runtime source creates migration work that does not exist.This was reproduced in a real Next.js to vinext migration of the movies-ranking app. The report marked CommonJS globals unsupported in exactly these files:
Both files are outside the vinext application runtime. The same checkout completed
vinext build, and its targeted Vitest file passed. With this PR's CLI, the app reports:*.test.*,*.spec.*, and conventional Jest, Playwright, and Vitest config files.config.site.config.tsand other non-test-runner configs in both scans.next/*imports do not constrain the deployed app.What changed
__dirnamein a Vitest test/confignext/*import used only by tests__dirnameor unsupported import insite.config.tsValidation
vp test run tests/check.test.ts: 145 tests passed.vp check: all 2,430 files formatted; no warnings, lint errors, or type errors across 1,080 files.vp run vinext#build: package build passed.vinext checkagainstmovies-ranking/.worktrees/nathan-vinext-jsonc-install: 98% compatible, 0 issues.bun run build:vinextin that movies-ranking worktree: all five build environments passed.bunx vitest run src/app/mobile-layout-alignment.test.ts: 4 tests passed.Risk / compatibility
Non-goals
config.References