Closed mikehaas763 closed 8 years ago
yea, pass {deep: true}
to have json tree like
[ { label: 'should throw TypeError when `name` is not a string',
type: 'task',
nodes: [] },
{ label: 'should throw TypeError when `callback` is not a function',
type: 'task',
nodes: [] },
{ label: 'should return false if given `name` exist in npm registry',
type: 'task',
nodes: [] },
{ label: 'should return true if given `name` not exist in npm registry',
type: 'task',
nodes: [] },
{ label: 'should return false when repository already exists',
type: 'task',
nodes: [] },
{ label: 'should return true when repository not exists',
type: 'task',
nodes: [] } ]
this is copy-pasta from my test runner based on undertaker.
@tunnckoCore Thanks, I missed that. I saw the documentation about deep and tried passing a bool directly rather than an object with the deep property.
Anyway, what an intuitive API. Ask for a tree and get something else.
@mikehaas763 no need to be a sarcastic asshole about it. I actually agree that it is not intuitive and I am looking into switching it over to a tree. It seems like I can make it work with gulp's CLI for 4.0 without too much trouble.
@phated maybe its a good idea Undertaker to have also .tasks()
method which will just return array with task names. and tree to be just as .tree({deep: true})
@tunnckoCore that API is too close to task
, the main API, and I know it would cause more issues than it would solve.
hmm.. nope, it would be intuitive.
.task(name)
- get a task with specified name.tasks()
- get all tasks.tree()
- archey listthere's no place for confusion.
there is plenty of room for confusion when someone typos task
as tasks
. I've already considered this and am not going to do that
@mikehaas763 be aware that I am looking into this, but I am going to lock this for my sanity.
I'm consuming the tree() function from the gulp implementation and I get an array of task names returned. The documentation indicates that an object graph should be returned. Can someone clarify how this is supposed to work?