-
Notifications
You must be signed in to change notification settings - Fork 862
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[docfx] adding --watch option to build command #10010
base: main
Are you sure you want to change the base?
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #10010 +/- ##
==========================================
+ Coverage 74.31% 78.48% +4.16%
==========================================
Files 536 543 +7
Lines 23189 23590 +401
Branches 4056 4078 +22
==========================================
+ Hits 17234 18514 +1280
+ Misses 4853 3934 -919
- Partials 1102 1142 +40 ☔ View full report in Codecov by Sentry. |
@@ -13,7 +13,7 @@ namespace Docfx; | |||
/// BuildJsonConfig. | |||
/// </summary> | |||
/// <see href="https://dotnet.github.io/docfx/reference/docfx-json-reference.html#12-properties-for-build"/> | |||
internal class BuildJsonConfig |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change seems no behavior differences.
Access to this class from docfx
is already allowed by InternalsVisibleTo
attribute.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right but it helps #9986 too and makes this PR more "readable" since it does not need to check the InternalsVisibleTo
so think it is worth it to include it - but if blocking I can remove it, trying to explain the rational.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Default class visibility is internal
when declared under namespace.
It thought it need to specify public
for consistency with PR comments. (or wait #8872 is resolved)
Classes and structs declared directly within a namespace (aren't nested within other classes or structs) can be either public or internal. internal is the default if no access modifier is specified.
In my personal opinion. Because For example.
|
Hmm, it has serve capabilities so adding watch which is a serve companion or concurrent is not shocking to me.
Kind of requires serve to be there as well no?
+1 (it is the last |
Thank you for confirming my PR comments I'm expecting following behaviors by When
And by adding
If basic |
ae33416
to
61d2a6a
Compare
@filzrev I'm in the process of moving build to watch command (restoring old build command), hope I got it right |
Anything I can do to help getting this on board? |
To supporting
And for
Currently it inherited @yufeih |
Yes addcommand is needed but was awaiting to ensure solution was ok. About build command i guess it would be neat to extract settings in a shared base setting class to ensure it is consistent accross command and not duplicated, wdyt? edit: created a shared build command options class to host what is shared, moved watch/serve/openbrowser to command specific option classes and set watch/serve to true by default on watch command (not openbrowser since this one is more bothering than helping if you restart the command from time to time). Not sure the intent of |
cb175c8
to
74b6c34
Compare
await Task.Delay(100, token.Token); | ||
if (!token.IsCancellationRequested) | ||
{ | ||
onChange(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if the build invoked by onChange
method takes a minute to finish and files changes each second, would we trigger multiple build or wait for the last build to complete before triggering the next?
Implemented as a standalone |
NotifyFilters.DirectoryName | NotifyFilters.LastWrite | ||
}; | ||
|
||
if (WatchAll(config)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can start with a simple deterministic watch implementation that watches all files changes in the docfx.json
directory, except for the output directory (_site
)
…can be disabled instead of enabled (better default)
Follow-up of my tests (#9986) and #9992
Not 100% sure of the following so happy to get a feedback on all these points: