-
-
Notifications
You must be signed in to change notification settings - Fork 31
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
Edit documentation to register tasks to gulp alongside taker. #36
Comments
This doesn't make any sense and I don't see what you are trying to achieve that isn't already functional. Gulp is just an instance of undertaker and undertaker forwards all task registration to the custom registry. |
This must be a defect then, because every task I register with undertaker is not usable through the command line. For instance, if I define an undertaker task like so (where each function in gulp.parallel is already defined and returns a stream):
Then when I run |
Did you register an instance of the registry with the |
Ahh, that just may be it, I am exporting the CommonRegistry at the end of my file.
Do I instead?:
Thank you very much for the quick replies :D |
Yes, the last example you posted is how to register your custom registry within undertaker. However, for series/parallel, it is recommended you use the undertaker instance that is passed to If you are using gulp, it works the same way var gulp = require('gulp');
...
CommonRegistry.prototype.init = function (gulpInst) {
gulpInst.task('clean', gulpInst.parallel(cleanBuild, cleanProd, cleanPublic));
};
gulp.registry(new CommonRegistry()); |
That's it! Sorry for the confusion and thanks a bunch!! 👍 |
No problem. Do you think there is anything that can be added to the documentation to clear this up? The information about |
I ended up having to make these changes due to gulp-hub not being updated. Our project utilizes 10 separate JS files (I included some in the example below) that all have many tasks inside of them and then we pull all of the tasks in our Gulpfile.js (now using Undertaker). It ends up looking something like this:
Whereas with gulp-hub it was more straightforward as it just pulls tasks registered with gulp.task, then registers them directly with gulp.registry(). I was confused on when to use gulp.registry and when to use taker.registry and the sample above was not allowing me to access my tasks via gulp. For example:
Would it be more clear to register the tasks in the individual files or in the Gulpfile? Or maybe only use the gulp module in the Gulpfile? Sorry for the long reply, just wanted to fully convey how I came to where I was and possibly shed some light on where I ran into problems trying to sync up with the documentation. Hopefully this gives you some type of insight on what to add to the documentation. |
You don't want to create an undertaker instance in this file, you want to use the |
You are correct, the startup performance is horrible sometimes 👍 Usually on the first run it takes awhile to load all of the JS files. I picked this up from one of my co-workers that left the company and was wondering why that was happening. I tried the new gulp-hub branch and failed to get it working, but with the new information you've just given me, I think I might be able to get it work. Thanks again for all of the help! |
On the "Sharing Functionalities" section of the documentation, it goes through an example on how to collaborate tasks into the main file for usage in default.
Most people will want to be able to run individual gulp tasks from the command line. Since gulp-hub is not up to date with the latest undertaker functionality, we now have to register undertaker tasks instead of gulp tasks to properly share them through the registry.
I've found that by editing the example set function to register the gulp task, it saves a lot of headache and lines of code to register the gulp task at the same time we are setting the taker task (obviously requiring the gulp module in order to do so).
What I did was this:
We run CI that use SSH commands for gulp (i.e. gulp test, gulp deploy:rebuild, etc.)
Am I doing something wrong, leading me to have to insert this code? Or is this future functionality that is not completed yet?
The text was updated successfully, but these errors were encountered: