Release 0.9.1: fix literal directory watch matcher#7
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
GlobSetfrom the raw pattern, andglobsettreatscontent/as a literal that does not matchcontent/foo.md. Result: directory watched, event arrives,classify_eventsdrops 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 matcherGlobSet(used bycompile()andfor_test()).literal_directory_pattern_matches_nested_files,literal_file_pattern_matches_only_that_file.CHANGELOG.md: finalize[0.9.1];Cargo.toml/Cargo.lockbumped to 0.9.1.Validation
cargo fmt --check,cargo clippy --all-targets -- -D warnings,cargo test(132 pass)🤖 Generated with Claude Code