fix(vitest): discover named config files - #36471
Open
harshmathurx wants to merge 1 commit into
Open
Conversation
👷 Deploy request for nx-docs pending review.Visit the deploys page to approve it
|
👷 Deploy request for nx-dev pending review.Visit the deploys page to approve it
|
Author
|
@FrozenPandaz could you take a look when you get a chance? This is the small |
4 tasks
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.
Current Behavior
The
@nx/vitestinferred plugin only discoversvite.config.*andvitest.config.*files. That misses valid Vitest 4 migration patterns where one Nx project has multiple named Vitest configs such asvitest.unit.config.tsandvitest.integration.config.tsfor different test groups.Expected Behavior
Nx should discover named Vite/Vitest config files for the Vitest inferred plugin, so a workspace can expose separate targets/includes/excludes from the same Nx project without falling back to manual target wiring.
Related Issue(s)
Fixes #36438
This PR
Root cause: the discovery glob was restricted to the canonical
vite.config.*/vitest.config.*filenames, so named config files were invisible before plugin target inference ran.The fix is intentionally small:
Validation
Local checks run:
git diff --checknodeglob intent smoke check forvitest.unit.config.ts,vitest.integration.config.mts, and standardvitest.config.tsLocal full dependency install was blocked by disk space in this checkout:
pnpm install --frozen-lockfilefailed withERR_PNPM_ENOSPCNODE_OPTIONS=--max-old-space-size=4096 pnpm install --filter @nx/vitest --frozen-lockfile --ignore-scriptsalso failed withERR_PNPM_ENOSPCCI evidence currently visible on the PR:
Socket Security: Project ReportpassedSocket Security: Pull Request AlertspassedRisk / compatibility
This only broadens discovery to additional existing config-file names. Standard
vite.config.*andvitest.config.*projects keep the same behavior; the main risk is surfacing additional Vitest targets that users intentionally named but Nx previously skipped.cc @FrozenPandaz for the
@nx/vitestinferred-plugin path.