-
Notifications
You must be signed in to change notification settings - Fork 58
feat: Support .env files by default via dotenv/config #243
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
- Add dotenv as a dependency - Create env-setup-file module that imports dotenv/config - Export env-setup-file as 'evalite/env-setup-file' - Automatically prepend env-setup-file to setupFiles array - Update documentation to reflect automatic .env loading - Update example config to remove manual dotenv setup Fixes #234 🤖 Generated with [Claude Code](https://claude.ai/code) Co-authored-by: Matt Pocock <[email protected]>
🦋 Changeset detectedLatest commit: 1ba5a23 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
💡 Enable Vercel Agent with $100 free credit for automated AI reviews |
|
@claude Setup files from vitest.config.ts should also be supported, and added to the array. However - evalite.config.ts setupFiles should take precedence. Add tests to this effect. |
|
Claude finished @mattpocock's task —— View job Setup files support implementation complete!I've successfully added support for setupFiles from vitest.config.ts with evalite.config.ts taking precedence. Changes MadeCore Implementation:
Test Coverage:
The implementation ensures that when both configs define setupFiles, they all run in order, with evalite.config.ts files running after vitest.config.ts files. This means if both set the same environment variable, the evalite.config.ts value wins (as demonstrated by the precedence test). Files Changed
Committed and pushed to the PR branch! |
commit: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the final PR Bugbot will review for you during this billing cycle
Your free Bugbot reviews will reset on November 18
Details
You are on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle.
To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.
| const setupFiles = [ | ||
| "evalite/env-setup-file", | ||
| ...(config?.setupFiles || []), | ||
| ]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: Vitest Setup Files Override Vite Configuration
The setupFiles array is now always initialized with "evalite/env-setup-file", even when not specified in evalite.config.ts. This unconditionally sets Vitest's setupFiles, overriding any values configured in vite.config.ts that would otherwise apply.
… precedence - Add loadVitestSetupFiles() to load setupFiles from vitest.config.ts - Merge setupFiles from both configs with evalite.config.ts taking precedence - Add tests for vitest.config.ts setupFiles support and precedence - setupFiles execution order: env-setup-file -> vitest -> evalite Co-authored-by: Matt Pocock <[email protected]>
|
Closed, cherrypicked into #240 |
Fixes #234
This PR adds automatic .env file support to Evalite. Users no longer need to manually configure dotenv in their evalite.config.ts.
Changes
Testing
After merging, users can simply:
.envfile in their project rootOPENAI_API_KEY=your-key)evalite- no configuration needed!🤖 Generated with Claude Code