-
-
Notifications
You must be signed in to change notification settings - Fork 111
Apply --depth and --compact flags to --tasks-json and --tasks #75
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
Conversation
|
npm install EPERM errors frequently occured on appveyor. |
|
Sorry. I forgot to rename the second argument of |
91e2de4 to
14d8855
Compare
|
I've reflected the change of PR #87 for undertaker v1.0.0 and added |
|
This will need to be rebased on top of the merged undertaker 1.0 fixes. |
14d8855 to
0e01cc9
Compare
|
I've rebased this on the current master branch. |
|
@sttk This will probably need many changes to support only through the config files. |
|
@phated O.K. I'm going to address this from now. |
0e01cc9 to
e2038b3
Compare
|
@phated I've finished reflecting the latest master branch. |
|
@sttk thanks for rebasing. However, I don't think we should expose the |
|
Sorry, I forgot that we shipped |
|
In his use case, gulp would be called from a program. So I think About About |
|
@phated Could you define config keys of compact, depth, sort/no-sort? |
|
@sttk if you are going to support |
|
I also think
|
|
Yeah, and actually I might even argue the default should be to respect the order of tasks in my gulpfile, where I tend to try and find some sensible structure and keep related tasks near one another. Then I'd like to see the same order when listing the tasks. But maybe that's just me? |
|
@erikkemperman I think that's a sane default, which I believe is equivalent to "no sort" because I just iterate over the object (it's not guaranteed to be in insert order, but highly likely). |
|
Maybe I misunderstand, I thought the proposal here is to do alphabetical sorting by default, and have a "no-sort" option to get file-order. I would prefer the other way around. But again, maybe that's just me and anyway it's not a big deal :-) |
|
@erikkemperman the original implementation sorted by default. This PR is adding the option to "disable" that but I'm suggesting we invert that assumption (remove sorting by default and add a |
|
Excellent, that's what I would expect :-) |
|
@sttk are you still planning to update this PR based on the discussion? |
|
@phated Sorry that I'm late to update. I implemented and I'm testing about this PR from now. I'm changing the flag names to: Please let me know if there are flags or configs that should be renamed or removed, |
|
@sttk I think all of those flags & configs are good. |
e2038b3 to
72c7757
Compare
|
@phated I've rebased and updated. |
docs/CLI.md
Outdated
| Print the task dependency tree, in JSON format, for the loaded gulpfile. The [path] argument is optional, and if given writes the JSON to the path. | ||
|
|
||
| **--depth** [number] | ||
| Specify the depth of the task dependency tree to print. This flag can be used with --tasks or --tasks-json. |
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 should be tasks-depth, right?
docs/CLI.md
Outdated
| **--depth** [number] | ||
| Specify the depth of the task dependency tree to print. This flag can be used with --tasks or --tasks-json. | ||
|
|
||
| **--compact** |
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 should be compact-tasks, right?
|
@tkellen Thanks! I've modified what you pointed out. |
phated
left a comment
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.
Few changes needed.
| desc: chalk.gray( | ||
| 'Print the task dependency tree for the loaded gulpfile.'), | ||
| }, | ||
| depth: { |
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 is a breaking change. Can we leave it in as an alias? Does yargs support aliases in the definition?
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 we alias this, it'll need to be documented and noted as deprecated.
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.
I rethought about flag names that --depth, --compact and --sort are better than --tasks-depth, --compact-tasks and --sort-tasks. When we use these flags, we type a command like gulp --tasks --tasks-depth. The word "tasks" is redundant for users, I think.
I think good about the config names, but it is possible to group these flags like flags.tasks.depth, flags.tasks.sort, flags.tasks.compact (in .gulp.json, { flags: { tasks: { depth: 3, sort: true, compact: true } } }).
What do you think?
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.
I'm fine with being verbose on the flag names but I think we just need to alias depth because we've previously defined it and removing it would be a breaking change (and I'd have to publish as 2.0.0)
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.
I got it. I'll add the alias depth.
lib/versioned/^3.7.0/index.js
Outdated
| return gulpInst.tasks[task].fn; | ||
| }); | ||
| } | ||
| if (opts.tasksJson) { |
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.
Can this addition be moved to a separate commit/PR? I'm glad we are adding it but I want it to show up in the changelog properly.
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.
I got it. I'll remove this part from this PR.
| └─┬ default | ||
| └─┬ <parallel> | ||
| ├─┬ taskC | ||
| │ └── <series> |
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.
Is this considered part of the depth?
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.
Yes. depth flag cuts deeper tasks forcely.
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.
Oh, okay
f311150 to
305b53d
Compare
|
I've rebased and modified. |
|
Looks good, great work again @sttk I'm going to squash this, feel free to submit the |
|
@phated Thank you for merging. |
|
@sttk No problem. I'm noticing some timeout problems (for a couple tests) on Appveyor. Did you run into that at all? |
|
@phated I sometimes encounter timeout problems on Appveyor, too. And in that case, I try test 2 or 3 times. I don't know this workaround. |
This is a PR about the issue #57