Skip to content

flue dev needs configurable watcher ignores for generated project directories #316

Description

@kalepail

Summary

flue dev recursively watches the project root and filters only a small built-in set of paths after events arrive:

  • build output directory (dist by default);
  • node_modules;
  • dotfiles / dot-directories, except selected .flue;
  • editor backup/swap files.

There does not appear to be a documented way to add project-specific ignored directories, and the watcher does not appear to consult .gitignore.

That means generated non-dot directories such as evals/results, local benchmark output, snapshots, reports, coverage-like custom folders, or tool-generated artifacts can be tracked by flue dev even when they are intentionally ignored by Git.

Why this matters

In downstream testing, an eval harness writes result files under:

evals/results/

That directory is ignored in .gitignore, but it is still under the Flue project root. Because flue dev watches the root recursively, writes under that directory can be seen as project changes and can trigger rebuild/restart churn.

This is a separate issue from #314:

Expected behavior

Flue should let projects exclude generated paths from the dev watcher.

Possible approaches:

  1. Add a watch.ignore / dev.ignore config option with glob patterns.
  2. Honor .gitignore for root-relative paths, perhaps with Flue’s required internal paths re-included.
  3. Add a documented CLI flag such as --ignore <glob> that can be repeated.

Any of these would be better than requiring app-specific patching of Flue's generated CLI bundle.

Current downstream workaround

We patched the installed CLI to ignore one project-specific path:

const EVAL_RESULTS_WATCH_IGNORE = "evals/results";
if (normalized === EVAL_RESULTS_WATCH_IGNORE || normalized.startsWith(`${EVAL_RESULTS_WATCH_IGNORE}/`)) return true;

That solved local rebuild churn for the eval harness, but it is not a general solution and should not be necessary for every project with generated output under the repo root.

Suggested scope

A focused upstream fix could live in packages/cli/src/lib/dev.ts around createWatcher() / isIgnoredPath():

  • extend WatcherOptions with additional ignore globs or paths;
  • derive those from flue.config.*, CLI args, and/or .gitignore;
  • add tests that writing under an ignored generated directory does not call onChange.

This should be independent from the config watcher fallback in #314.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions