Enhanced directory watch in mdl serve
- Dominant language
- Go
- Stars
- 467
- Forks
- 23
- Avg merge
- 6m
- Merged PRs (30d)
- 8
Description
A pattern that we're using for sharing the design objects between different repositories without also sharing the views is to use the following pattern:
* `diagram/model.go` contains all of the design object definitions
* `diagram/views/views.go` contains the views specific to the repository
* Run `mdl serve -dir diagram/views` to build and edit diagrams from the views
However, this means that the file system watch for changes that the current implementation of `mdl serve` sets up only looks at `diagram/views` and any subdirectories, so design object changes are not noticed and neither the livereload or a page refresh of the editor will bring in those changes.
One solution would be to invert the pattern so that the views live in the shallower directory while the design objects move down to a deeper directory:
* `diagram/views.go`
* `diagram/model/model.go`
* Run `mdl serve -dir diagram`
But, I'm also wondering if we might want to allow for more flexibility by either allowing the specification of extra directories to watch or looking at the package imports and watching the directories that are found from them that are also in the same Go module.
Contributor guide
Assessment
This issue has not been assessed yet.