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

Group tasks with headers #28

Closed
abraverm opened this Issue Jul 9, 2018 · 6 comments

Comments

Projects
None yet
2 participants
@abraverm
Copy link

abraverm commented Jul 9, 2018

Use headers levels for grouping multiple tasks. For example:

# My project
## Setup
### a
### b

Will be used as:

saku Setup
[saku] Run Setup
[saku]   Run a
[saku]   ✨  Finish a
[saku]   Run b
[saku]   ✨  Finish b
[saku] ✨  Finish Setup
@kt3k

This comment has been minimized.

Copy link
Owner

kt3k commented Jul 9, 2018

Thanks for the idea!

I would use this feature like:

# build

## js

```
browserify app.js
```
## css

```
sass blah blah
```
saku build

hmm... seems interesting...!

@kt3k

This comment has been minimized.

Copy link
Owner

kt3k commented Jul 10, 2018

Probably we need a way to specify whether child nodes should be executed in serial or in parallel.

@abraverm

This comment has been minimized.

Copy link
Author

abraverm commented Jul 10, 2018

I think by default it should be serial and with same order as in the document, and that is true for every level. Parallel can be enabled with -p option or by adding comment <!-- saku parallel -->. Parallel should only work on high level tasks unless specified differently in the comment. For example:

# My project
## Setup
### a
<!-- saku parallel -->
#### 1
#### 2
### b

The execution results will be:

$ saku Setup
[saku] Run Setup
[saku]   Run a (Parallel)
[saku]      Run 1 .... ✨  Finish
[saku]      Run 2 .... ✨  Finish
[saku]   ✨  Finish a
[saku]   Run b
[saku]   ✨  Finish b
[saku] ✨  Finish Setup

$ saku -p Setup
[saku] Run Setup (Parallel)
[saku]   Run a (Parallel) .. ✨  Finish
[saku]      Run 1 .... ✨  Finish
[saku]      Run 2 .... ✨  Finish
[saku]   Run b ... ✨  Finish
[saku] ✨  Finish Setup

The reason for .... ✨ Finish is for visualizing all the tasks that are being executed and their state.

@kt3k

This comment has been minimized.

Copy link
Owner

kt3k commented Jul 28, 2018

I started prototyping this feature. For grouping and <!-- saku parallel --> directive, I'm basically following your suggestion.

I'm aiming a little different goal about logging. My current plan is like the below:

saku.md

# foo
## js
<!-- saku parallel -->
### js:build
### js:lint
## css
# bar
$ saku foo bar
[saku] Run foo, bar in sequence
[saku] foo > Run js, css in sequence
[saku] foo > js > Run js:build, js:lint in parallel
[saku] foo > js > Finish js:build, js:lint in parallel
[saku] foo > Finish js, css in sequence
[saku] Finish foo, bar in sequence
✨ Done.

I prefer not intending lines because saku redirects the internal commands output to saku's output. So actual output looks like the below, and indentation probably doesn't work well among those many log messages.

$ saku foo bar
[saku] Run foo, bar in sequence
blah blah blah
blah blah blah
blah blah blah
[saku] foo > Run js, css in sequence
[saku] foo > js > Run js:build, js:lint in parallel
blah blah blah
blah blah blah
blah blah blah
[saku] foo > js > Finish js:build, js:lint in parallel
blah blah blah
blah blah blah
blah blah blah
[saku] foo > Finish js, css in sequence
[saku] Finish foo, bar in sequence
✨ Done.

@kt3k kt3k referenced this issue Jul 28, 2018

Merged

Task grouping #31

11 of 11 tasks complete

@kt3k kt3k closed this in 5f6dbe2 Jul 30, 2018

@abraverm

This comment has been minimized.

Copy link
Author

abraverm commented Jul 30, 2018

looks great! thank you 🎉

@kt3k

This comment has been minimized.

Copy link
Owner

kt3k commented Jul 30, 2018

I hope the feature fits your use case! 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment