Skip to content

Release 0.9.1: fix literal directory watch matcher#7

Merged
pasunboneleve merged 2 commits into
mainfrom
fix/literal-dir-matcher-nested-files
Jun 23, 2026
Merged

Release 0.9.1: fix literal directory watch matcher#7
pasunboneleve merged 2 commits into
mainfrom
fix/literal-dir-matcher-nested-files

Conversation

@pasunboneleve

Copy link
Copy Markdown
Owner

Summary

Fixes a watch bug where editing a file inside a literal trailing-slash directory pattern (e.g. content/, apps/api/src/) did not trigger its workflow.

A trailing-slash directory is compiled into a recursive watch target, so the OS backend watches the directory and delivers events for nested files. But the change→workflow matcher built its GlobSet from the raw pattern, and globset treats content/ as a literal that does not match content/foo.md. Result: directory watched, event arrives, classify_events drops it, workflow never fires.

The matcher now expands a literal trailing-slash directory to <dir>/**, consistent with the recursive watch target and the documented behaviour.

Changes

  • src/config.rs: matcher_pattern() expands literal trailing-slash dirs for the matcher GlobSet (used by compile() and for_test()).
  • Regression tests: literal_directory_pattern_matches_nested_files, literal_file_pattern_matches_only_that_file.
  • CHANGELOG.md: finalize [0.9.1]; Cargo.toml/Cargo.lock bumped to 0.9.1.

Validation

  • cargo fmt --check, cargo clippy --all-targets -- -D warnings, cargo test (132 pass)
  • Validated end-to-end against a real project: editing a watched dir now auto-restarts the process.

🤖 Generated with Claude Code

pasunboneleve and others added 2 commits June 24, 2026 06:26
A trailing-slash directory pattern (e.g. `apps/api/src/`) is compiled into a
*recursive* watch target, so the OS backend watches the directory and delivers
events for files inside it. But the change→workflow matcher built the GlobSet
from the raw pattern, and globset treats `apps/api/src/` as a literal that does
not match `apps/api/src/foo.ts`. Result: the directory is watched, events
arrive, classify_events drops them, and the workflow never fires — edits to a
watched directory silently failed to restart the process.

Expand a literal trailing-slash directory to `<dir>/**` when building the
matcher, so it matches nested files — consistent with the recursive watch
target and the documented behaviour. Adds regression tests.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Finalize CHANGELOG [0.9.1] (literal trailing-slash directory watch fix +
the gh-release action update) and bump the package version 0.9.0 -> 0.9.1.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@pasunboneleve pasunboneleve merged commit e28d848 into main Jun 23, 2026
2 checks passed
@pasunboneleve pasunboneleve deleted the fix/literal-dir-matcher-nested-files branch June 23, 2026 21:15
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