Skip to content

Conversation

@sttk
Copy link
Contributor

@sttk sttk commented Apr 5, 2016

This is a PR about the issue #57

@sttk
Copy link
Contributor Author

sttk commented Apr 6, 2016

npm install EPERM errors frequently occured on appveyor.
It seems that this error can be fixed by using npm3.
So I modified appveyor.yml to install latest npm.

npm/npm#9696

@sttk sttk changed the title Add --depth and --compact flags to --tasks-json and --tasks Apply --depth and --compact flags to --tasks-json and --tasks Apr 7, 2016
@sttk
Copy link
Contributor Author

sttk commented Apr 7, 2016

Sorry. I forgot to rename the second argument of logTasks.

@sttk
Copy link
Contributor Author

sttk commented Jul 11, 2016

I've reflected the change of PR #87 for undertaker v1.0.0 and added --no-sort flag.

@phated
Copy link
Member

phated commented Jul 15, 2016

This will need to be rebased on top of the merged undertaker 1.0 fixes.

@sttk sttk force-pushed the modify_for_tasks_json_norcr branch from 14d8855 to 0e01cc9 Compare July 16, 2016 08:30
@sttk
Copy link
Contributor Author

sttk commented Jul 16, 2016

I've rebased this on the current master branch.

@phated
Copy link
Member

phated commented Apr 22, 2017

@sttk This will probably need many changes to support only through the config files.

@sttk
Copy link
Contributor Author

sttk commented Apr 23, 2017

@phated O.K. I'm going to address this from now.

@sttk sttk force-pushed the modify_for_tasks_json_norcr branch from 0e01cc9 to e2038b3 Compare April 23, 2017 12:21
@sttk
Copy link
Contributor Author

sttk commented Apr 23, 2017

@phated I've finished reflecting the latest master branch.

@phated
Copy link
Member

phated commented Apr 23, 2017

@sttk thanks for rebasing. However, I don't think we should expose the --compact, --depth or --no-sort options as command line flags. Instead, could you implement this to only be configurable from .gulp.* files?

@phated
Copy link
Member

phated commented Apr 23, 2017

Sorry, I forgot that we shipped --depth but it looks like --compact and --no-sort are being added. I'm not sure I want to keep expanding the flags but maybe those are a must-have for @segrey's use case?

@sttk
Copy link
Contributor Author

sttk commented Apr 24, 2017

In his use case, gulp would be called from a program. So I think --compact flag is needed rather than config.

About --depth flag, I suppose users want to use both flag and config. For example, they usually specify depth=3 with config, and sometimes show full depth tree with the flag.

About --no-sort flag, I think it may be good to be config only.

@sttk
Copy link
Contributor Author

sttk commented Apr 24, 2017

@phated Could you define config keys of compact, depth, sort/no-sort?

@phated
Copy link
Member

phated commented Apr 25, 2017

@sttk if you are going to support --compact and --depth as flags, they should just be flags.compact and flags.depth; however, do we want to make them more descriptive (e.g. --compact-tasks and --tasks-depth)? Do we really need the sort/no-sort option? I'm not sure who would want to turn sorting off.

@sttk
Copy link
Contributor Author

sttk commented Apr 26, 2017

I also think --compact-tasks and --tasks-depth are better. These names make more clear what the flags is for.

no-sort was requested by @erikkemperman in the issue #50.

@erikkemperman
Copy link
Member

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?

@phated
Copy link
Member

phated commented Apr 26, 2017

@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).

@erikkemperman
Copy link
Member

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 :-)

@phated
Copy link
Member

phated commented Apr 26, 2017

@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 --sort-tasks flag).

@erikkemperman
Copy link
Member

Excellent, that's what I would expect :-)

@phated
Copy link
Member

phated commented May 12, 2017

@sttk are you still planning to update this PR based on the discussion?

@sttk
Copy link
Contributor Author

sttk commented May 12, 2017

@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: --compact-tasks, --tasks-depth, --sort-tasks, and adding the configs: flags.compactTasks, flags.tasksDepth, flags.sortTasks in accordance with the flag names.

Please let me know if there are flags or configs that should be renamed or removed,

@phated
Copy link
Member

phated commented May 12, 2017

@sttk I think all of those flags & configs are good.

@sttk sttk force-pushed the modify_for_tasks_json_norcr branch from e2038b3 to 72c7757 Compare May 13, 2017 09:39
@sttk
Copy link
Contributor Author

sttk commented May 13, 2017

@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.
Copy link

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**
Copy link

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?

@sttk
Copy link
Contributor Author

sttk commented May 13, 2017

@tkellen Thanks! I've modified what you pointed out.

Copy link
Member

@phated phated left a 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: {
Copy link
Member

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?

Copy link
Member

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.

Copy link
Contributor Author

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?

Copy link
Member

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)

Copy link
Contributor Author

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.

return gulpInst.tasks[task].fn;
});
}
if (opts.tasksJson) {
Copy link
Member

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.

Copy link
Contributor Author

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>
Copy link
Member

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?

Copy link
Contributor Author

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.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, okay

@sttk sttk force-pushed the modify_for_tasks_json_norcr branch from f311150 to 305b53d Compare June 10, 2017 06:44
@sttk
Copy link
Contributor Author

sttk commented Jun 10, 2017

I've rebased and modified.

@phated
Copy link
Member

phated commented Jun 12, 2017

Looks good, great work again @sttk

I'm going to squash this, feel free to submit the --tasks-json feature for V3 afterwards.

@phated phated merged commit 86f5df8 into gulpjs:master Jun 12, 2017
@sttk
Copy link
Contributor Author

sttk commented Jun 12, 2017

@phated Thank you for merging.

@sttk sttk deleted the modify_for_tasks_json_norcr branch June 12, 2017 19:28
@phated
Copy link
Member

phated commented Jun 12, 2017

@sttk No problem. I'm noticing some timeout problems (for a couple tests) on Appveyor. Did you run into that at all?

@sttk
Copy link
Contributor Author

sttk commented Jun 13, 2017

@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.

phated pushed a commit that referenced this pull request Dec 21, 2017
phated pushed a commit that referenced this pull request Dec 21, 2017
phated pushed a commit that referenced this pull request Dec 21, 2017
phated pushed a commit that referenced this pull request Dec 21, 2017
phated pushed a commit that referenced this pull request Dec 21, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants