Closed dominicporteous closed 5 years ago
@dominicporteous Actually, when I implement the loading part of Foy, I thought of this kind of interface, too. Then quickly I give up it because of the trouble. But since you proposed, I think we can give a try. Here are some ideas that I can give:
We don't need to wait for Ora to implement indent, I think we can extend Ora class and override frames options
and stopAndPersist
to append spaces between loading and state via options.
To show the dependency graph, perhaps we need to refactor a resolveDependencyTree
method, so we can keep the code dry and clean.
I know loading is great, but if we running Foy in a ci/cd server, I think disabling loading makes more sense. Perhaps we can print a no state dependency graph on the beginning, and then log the normal logs.
The loading spinner might conflict with normal logs, after looking into Ora's code, I find Ora would write to stderr, perhaps we can provide an option to redirect an option to redirect the stdout to a log file. e.g.
var logStream = fs.createWriteStream('./foy.log')
process.stdout.write = logStream.write.bind(access)
But since Ora would write to stderr, we can simply disable normal logs via foy build > foy.log
. Therefore, I'm not sure this option is useful.
This might be a log of work. If you don't have enough time, I think I can implement this these days by myself. Thanks for your proposal and previous work.
@dominicporteous The dependency graph that you proposed is implemented in https://github.com/zaaack/foy/commit/f98c2d390c2dab9ad125ee1fb5370491b7cc3518 and published at v0.1.9, I'll close the issue for now, if you still have any problems, feel free to reopen it or create a new one, thanks!
Tracking in #6
Just wondering if you had an opinion on this, my previous PR (#4) added a flag to hide 'sub tasks' when called from within a parent context.
I get that the function of this message in the console is to indicate that a particular task has been called from the parent - I thought that perhaps a better way of displaying this would be for each subtask to have a spinner indicating the progress just as the top-level tasks do? The bottom most task/spinner would always be the top most task, with the children indented depending on the sub task level
I think this would be better for seeing progress of the subtasks and the hierarchy of tasks when there are multiple dependancies and subtasks.
Any thoughts? I've given a quick illustration below
Current Behaviour:
Desired Behaviour: