-
-
Notifications
You must be signed in to change notification settings - Fork 107
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
add displayName support to exported tasks #53
Conversation
I can't find the exact place with the documentation, but I read somewhere that the task name can be be set using the displayName property on the function. The description property is already working correctly. And displayName is handled correctly elsewhere, (e.g. gulp.parallel) This small change should fix this.
You're probably looking for this in the docs: https://github.com/gulpjs/gulp/blob/4.0/docs/API.md#name |
Yup! |
Can you give me a real world scenario for this? I'm also including @thejameskyle to see if there is anything I might be missing on this. |
I'm not aware of any reason you'd want to do this. I can see the case for |
@thejameskyle can you do something like |
Ah, no you cannot. The export name needs to be an identifier just like a function name. |
The idea is pretty simple. gulp-cli already shows the displayName in many cases. This mostly just makes everything more consistent. In general, I believe using function.name for the name of the task is a great solution, but as mentioned above often you wanna use hyphens or colons in your task names, and displayName would come in handy in that case. Also, just to make it clear, this PR has nothing to do with dynamic exports or anything like that. Just slightly more consistent self documentation. |
add displayName support to exported tasks
Backing out this change due to it breaking |
tricky... |
add displayName support to exported tasks
I can't find the exact place with the documentation, but I read somewhere that the task name can be be set using the displayName property on the function. The description property is already working correctly. And displayName is handled correctly elsewhere, (e.g. gulp.parallel)
This small change should fix this.