Refactor & overhaul moonc and watchers #380
Open
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.
I've tried to split this up across commits to make it a bit easier to follow, but most of the changes are in the last few, as they're fairly heavily intertwined. Intermediate commits do pass the test suites and some brief manual testing.
Main changes/improvements:
--output-to
has been unified acrossmoonc
and the watchers, previously the behaviour differed with/without-w
, and various issues have been resolved with--output-to
, including:rsync
-like handling of exclusive/inclusive directory path behaviour made in issue moonc adds directory to output paths #342 is added (and can probably be considered enough to close that issue).lua
output files, if and when their corresponding.moon
source files are deleted.lua
files that had no corresponding.moon
file to begin with; this prevents it from doing things like inadvertantly removing vendored Lua modulesmoonc
was migrated to Moonscript and broken up into smaller functions, which should hopefully render it more readable -- and also testable, although not yet actually testedDownsides: