feat: support extra watch file globs in Evalite#351
feat: support extra watch file globs in Evalite#351mattpocock merged 4 commits intomattpocock:v1from
Conversation
🦋 Changeset detectedLatest commit: 802fece The changes in this PR will be included in the next version bump. 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 |
|
@gmickel is attempting to deploy a commit to the Skill Recordings Team on Vercel. A member of the Team first needs to authorize it. |
|
@gmickel Let's match the Vitest naming on this: make it |
|
Should be good now |
|
@gmickel The docs updates need to be re-done |
|
Serves me right for doing this while in a meeting |
|
Looking good, cleaned things up a little bit and changed the behavior to match Vitest's. Merging soon! |
Awesome, thanks @mattpocock |
Summary
This PR adds first-class support for watching additional files in Evalite watch mode, so evals can rerun when dependent files (e.g. prompts, data, helper code) change, not just
*.eval.tsfiles.Changes
Config API
watchFiles?: string[]toEvalite.Config.defineConfigJSDoc example to showwatchFilesusage.test.forceRerunTriggers(relative to the Evalite working directory / Vitestroot).Node API
runEvalitewith a newwatchFiles?: string[]option.watchFilesoverridesevalite.config.ts(even when set to[]).watchFilesinto the Vitest plugin by merging them intoconfig.test.forceRerunTriggers, preserving Vitest defaults viaconfigDefaults.forceRerunTriggers.configDebugModedebug output that logsroot,testTimeout,maxConcurrency, and effectiveforceRerunTriggers.Tests
watch-files.test.tsto verify:watchFilesfromevalite.config.tsare applied to VitestforceRerunTriggers.watchFilesoverrides the config values.watchFilesarray results in only Vitest defaults.loadFixturehelper to forwardwatchFilesintorunEvalite.Docs
watchFilesexamples.evalite(Vitestroot).watchFilesto the list of available options and link to the CLI guide for details.watchFilesoption on the Node API.cwd(orprocess.cwd()).Motivation
Eval files often depend on prompts, model/helper code, or external data that Vitest can't automatically detect as dependencies. Previously,
evalite watchonly retriggered when*.eval.tsfiles changed.With this change, users can:
evalite.config.ts, and/orThis makes watch mode much more ergonomic for real-world LLM eval setups.
Behaviour and compatibility
watchFilesis not set, Evalite falls back to Vitest's defaultforceRerunTriggers.watchFiles: []via the Node API disables extra triggers fromevalite.config.tswhile retaining Vitest defaults.watchFilesonly affects watch/serve workflows:run-once-and-exitmode is unaffected.