question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Edit documentation to register tasks to gulp alongside taker.

See original GitHub issue

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:

    ConfigRegistry.prototype.set = function set(name, fn) {
      var task = this._tasks[name] = fn.bind();
      gulp.task(name, fn);
      return task;
    };

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?

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:10 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
phatedcommented, Aug 24, 2015

You don’t want to create an undertaker instance in this file, you want to use the .registry() API available on gulp in your gulpfile. Also, registry’s are made to share a bunch of common tasks, not 1 per registry, so I am guessing this is going to have really bad startup performance. gulp-hub has a branch where they support the new API. The custom registry API is an advanced feature and I think you are using it where you probably shouldn’t be.

0reactions
tmcgee123commented, Aug 24, 2015

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!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Getting Started with Gulp.js - Semaphore Tutorial
Learn how to set up and use Gulp.js, a task runner for Node.js based on Node streams. We'll introduce main concepts of Gulp...
Read more >
Creating Tasks | gulp.js
To register a task publicly, export it from your gulpfile. ... The `build` function is exported so it is public and can be...
Read more >
Building a Gulp API Compatible Task Automation Tool - Toptal
We will start with plug.task API. It should let us register tasks, and tasks should be executed if the task name is passed...
Read more >
Building Documentation with Gulp, Docco and LiveReload
In this post I discuss how to "modernize" a Docco workflow by adding a development server with live-reload.
Read more >
Run/Debug Configuration: Gulp.js | AppCode Documentation
Arguments. In this text box, specify the arguments for tasks to be executed with. Use the format --<parameter_name> <parameter_value> , for ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found