Skip to content

chore(vitest): fix native config-loader compatibility warnings - #1338

Open
gabrielseco wants to merge 2 commits into
mainfrom
chore/vitest-native-config-loader
Open

gabrielseco wants to merge 2 commits into
mainfrom
chore/vitest-native-config-loader

Conversation

@gabrielseco

@gabrielseco gabrielseco commented Sep 18, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Vite's upcoming configLoader: 'native' mode loads vitest.config.ts through Node's real ESM resolver instead of bundling it first, and running the suite currently prints a compatibility warning about two things this config does that won't work once that becomes the default.
  • Adds the .ts extension to the relative import of scripts/coverage-utils — Node's ESM resolver doesn't infer extensions the way the current bundled loader does.
  • Replaces path.resolve(__dirname, './') with import.meta.dirname__dirname is a CJS global that doesn't exist in a real ESM module.

Changes

  • vitest.config.ts: import extension + __dirnameimport.meta.dirname, drops the now-unused path import.

Test plan

  • npx vitest run no longer prints the configLoader: 'native' warning.
  • npm run type-check and npm run lint pass with no new issues.
  • Full local test run still passes (100 files / 1007 tests).

🤖 Generated with Claude Code


Note

Low Risk
Changes are limited to Vitest config and dev-only test dependencies; production runtime is unaffected, with main risk being CI/local test behavior on older Node versions if engines are not met.

Overview
Prepares Vitest for Vite’s upcoming configLoader: 'native' by making vitest.config.ts valid under Node’s real ESM resolver: the coverage thresholds import now includes a .ts extension, the @ alias uses import.meta.dirname instead of path/__dirname, and the unused path import is removed.

Dev test stack is bumped in lockstep with the jsdom upgrade: jsdom 30, @types/jsdom 30, @testing-library/jest-dom 7, and a patch on @testing-library/user-event, with package-lock.json refreshed for the transitive dependency graph (including stricter Node engine ranges on jsdom/jest-dom-related packages).

Reviewed by Cursor Bugbot for commit fe48732. Bugbot is set up for automated code reviews on this repo. Configure here.

Vite's upcoming `configLoader: 'native'` mode loads config files
through Node's real ESM resolver instead of bundling them first, which
surfaced two issues in vitest.config.ts:

- relative import of scripts/coverage-utils had no extension, which
  Node's ESM resolver doesn't infer
- __dirname is a CJS global, unavailable under native ESM

Add the .ts extension and swap to import.meta.dirname.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Sep 18, 2026

Copy link
Copy Markdown
Contributor

Deploy preview for adp-cost-calculator ready!

Project:adp-cost-calculator
Status: ✅  Deploy successful!
Preview URL:https://adp-cost-calculator-c20j1b6ej-remotecom.vercel.app
Latest Commit:fe48732

Deployed with vercel-action

@github-actions

github-actions Bot commented Sep 18, 2026

Copy link
Copy Markdown
Contributor

Deploy preview for remote-flows ready!

Project:remote-flows
Status: ✅  Deploy successful!
Preview URL:https://remote-flows-f8qoqthq1-remotecom.vercel.app
Latest Commit:fe48732

Deployed with vercel-action

@github-actions

Copy link
Copy Markdown
Contributor

📊 Coverage Report

⚪ Coverage unchanged

Metric Current Previous Change Status
Lines 86.19% 86.19% 0%
Statements 85.77% 85.77% 0%
Functions 84.73% 84.73% 0%
Branches 77.66% 77.66% 0%

Detailed Breakdown

Lines Coverage
  • Covered: 4780 / 5546
  • Coverage: 86.19%
  • Change: 0% (0 lines)
Statements Coverage
  • Covered: 4864 / 5671
  • Coverage: 85.77%
  • Change: 0% (0 statements)
Functions Coverage
  • Covered: 1276 / 1506
  • Coverage: 84.73%
  • Change: 0% (0 functions)
Branches Coverage
  • Covered: 2962 / 3814
  • Coverage: 77.66%
  • Change: 0% (0 branches)

✅ Coverage check passed

@github-actions

Copy link
Copy Markdown
Contributor

📦 Bundle Size Report

Metric Current Previous Change Status
Total (gzip) 165.16 kB 165.16 kB 0 B (0%) 🟢
Total (raw) 550.29 kB 550.29 kB 0 B (0%) 🟢
CSS (gzip) 21.91 kB 21.91 kB 0 B (0%) 🟢
CSS (raw) 114.38 kB 114.38 kB 0 B (0%) 🟢

Size Limits

  • ✅ Total gzipped: 165.16 kB / 350 kB (47.2%)
  • ✅ Total raw: 550.29 kB / 850 kB (64.7%)
  • ✅ CSS gzipped: 21.91 kB / 25 kB (87.6%)

Largest Files (Top 5)

  1. CheckBoxField-DSq9Qf8u.js - 19.38 kB (0 B (0%))
  2. ContractorOnboarding-QSgRChZR.js - 14.69 kB (0 B (0%))
  3. Onboarding-axVT9XVh.js - 11.26 kB (0 B (0%))
  4. Termination-sjnHMs8m.js - 11.09 kB (0 B (0%))
  5. styles.css - 10.96 kB (0 B (0%))
View All Files (74 total)
File Size (gzip) Change
CheckBoxField-DSq9Qf8u.js 19.38 kB 0 B (0%)
ContractorOnboarding-QSgRChZR.js 14.69 kB 0 B (0%)
Onboarding-axVT9XVh.js 11.26 kB 0 B (0%)
Termination-sjnHMs8m.js 11.09 kB 0 B (0%)
styles.css 10.96 kB 0 B (0%)
index.css 10.96 kB 0 B (0%)
CostCalculator-CoUCw59l.js 10.7 kB 0 B (0%)
internals-CzDL30xI.js 8.25 kB 0 B (0%)
sdk.gen-C7MLoCMc.js 5.55 kB 0 B (0%)
JSONSchemaForm-DehMm5lM.js 5.03 kB 0 B (0%)

✅ Bundle size check passed

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.

1 participant