How to use undertaker - 3 common examples

To help you get started, we’ve selected a few undertaker examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github gulpjs / gulp / index.js View on Github external
function Gulp() {
  Undertaker.call(this);

  // Bind the functions for destructuring
  this.watch = this.watch.bind(this);
  this.task = this.task.bind(this);
  this.series = this.series.bind(this);
  this.parallel = this.parallel.bind(this);
  this.registry = this.registry.bind(this);
  this.tree = this.tree.bind(this);
  this.lastRun = this.lastRun.bind(this);
  this.src = this.src.bind(this);
  this.dest = this.dest.bind(this);
  this.symlink = this.symlink.bind(this);
}
util.inherits(Gulp, Undertaker);
github microsoft / just / packages / just-task / src / undertaker.ts View on Github external
import Undertaker from 'undertaker';
import { logger } from './logger';
import chalk from 'chalk';
import { wrapTask } from './wrapTask';
import { Task } from './interfaces';
import { clearCache } from './cache';

const undertaker = new Undertaker();
const NS_PER_SEC = 1e9;

let topLevelTask: string | undefined = undefined;
let errorReported = false;
const tasksInProgress: { [key: string]: boolean } = {};

const colors = [chalk.cyanBright, chalk.magentaBright, chalk.blueBright, chalk.greenBright, chalk.yellowBright];
const taskColor: { [taskName: string]: number } = {};
let colorIndex = 0;

function shouldLog(taskArgs: any) {
  return (
    !taskArgs.branch &&
    taskArgs.name !== '' &&
    !taskArgs.name.endsWith('?') &&
    taskArgs.name !== '_wrapFunction' &&
github LiskHQ / lisk-docs / gulp.d / lib / create-task.js View on Github external
module.exports = ({ name, desc, opts, call: fn, loop }) => {
  if (name) {
    const displayName = fn.displayName
    if (displayName === '' || displayName === '') {
      metadata.get(fn).tree.label = `${displayName} ${name}`
    }
    fn.displayName = name
  }
  if (loop) {
    const delegate = fn
    name = delegate.displayName
    delegate.displayName = `${name}:loop`
    fn = () => watch(loop, { ignoreInitial: false }, delegate)
    fn.displayName = name
  }
  if (desc) fn.description = desc
  if (opts) fn.flags = opts
  return fn
}

undertaker

Task registry that allows composition through series/parallel methods.

MIT
Latest version published 7 months ago

Package Health Score

79 / 100
Full package analysis