Repository navigation
Add --help, --version and --watch - #17
Open
Demonstrandum wants to merge 1 commit into
Open
Demonstrandum wants to merge 1 commit into
Demonstrandum wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 1a76f93. Configure here.
| let Some(source) = source.atomic() else { | ||
| return Err(ExpansionError::new("`:from` expects paths.", source.site())); | ||
| }; | ||
| self.context.record_read(std::path::Path::new(source.value.as_ref())); |
There was a problem hiding this comment.
Watch misses write dependency sources
Medium Severity
%write :from sources are recorded only when the destination already exists, and record_read drops paths that are not currently files. --watch therefore never sees those sources on a first build, and never sees a missing source appear, so output can stay stale until some other watched file happens to change.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit 1a76f93. Configure here.
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.


seam --help/-hlists the formats and options.--versionworks as well as-v, and both now print to STDOUT. Unknown arguments point to--help.seam --watch/-wrebuilds the given files whenever something they were made from changes. It works forseam runbuild scripts and for printing a format.What's watched: whatever the last build read. The expander's
Contextnow records:%includes, and%embeds, literate or not%write ... :from%globpattern; these are re-run on each poll, so new and deleted files are noticed%write, which are excluded so a build never sets itself off againDetection polls modification times every 250 ms, so there are no new dependencies and it behaves the same on every OS. A failing build is reported, and the watch continues until the next change.
--watchwith STDIN is an error.Context::files_read,globs_searchedandfiles_writtenare public, so a library user can do the same.I tested it by hand on a small site: editing an included footer rebuilt every page, adding a post that a glob matches built it and updated the index, and the build's own writes caused no rebuilds.
Note
Low Risk
CLI and bookkeeping changes only; watch uses read-only mtime polling and does not alter expansion semantics beyond recording dependency paths.
Overview
Adds
seam --watch/-w, which rebuilds or re-expands the given inputs in a loop whenever dependencies change, until Ctrl-C. The watch set comes from what the last expansion actually used: entry files, reads from%include/%embed,%write ... :fromsources, and live results of%globpatterns; outputs from%writeare excluded so builds do not trigger themselves. Changes are detected by polling file metadata every 250ms; failed builds are reported and retried on the next change.--watchwith STDIN is rejected.The expander
Contextnow tracksfiles_read,globs_searched, andfiles_written(public accessors) so the CLI—and library callers—can mirror that dependency graph.Also adds
seam --help/-hand makes--version/-vprint to stdout; unknown flags point users at--help. The binary is refactored around sharedbuild/build_filepaths and a documented help string. README and USAGE.md document watch mode and the new help entrypoint.Reviewed by Cursor Bugbot for commit 1a76f93. Bugbot is set up for automated code reviews on this repo. Configure here.