How to use broccoli-funnel - 10 common examples

To help you get started, we’ve selected a few broccoli-funnel 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 embroider-build / embroider / packages / compat / src / v1-addon.ts View on Github external
protected treeForTestSupport(): Tree | undefined {
    if (this.customizes('treeForTestSupport')) {
      todo(`${this.name} has customized the test support tree`);
    } else if (this.hasStockTree('test-support')) {
      // this one doesn't go through transpile yet because it gets handled as
      // part of the consuming app. For example, imports should be relative to
      // the consuming app, not our own package. That is some of what is lame
      // about app trees and why they will go away once everyone is all MU.
      return new Funnel(this.stockTree('test-support'), {
        destDir: `${appPublicationDir}/tests`,
      });
    }
  }
github embroider-build / embroider / packages / compat / src / v1-addon.ts View on Github external
// This does need to go through parseImports here, because by the time
      // these files have been merged into the app we can't tell what their
      // allowed dependencies are anymore and would get false positive
      // externals.
      appTree = this.maybeSetAppJS(built, appTree);
      built.trees.push(appTree);
    }

    if (
      typeof this.addonInstance.isDevelopingAddon === 'function' &&
      this.addonInstance.isDevelopingAddon() &&
      this.addonInstance.hintingEnabled()
    ) {
      let hintTree = this.addonInstance.jshintAddonTree();
      if (hintTree) {
        hintTree = this.maybeSetAppJS(built, new Funnel(hintTree, { destDir: appPublicationDir }));
        built.trees.push(hintTree);
      }
    }
  }
github ember-engines / ember-engines / lib / rollup-funnel.js View on Github external
// An array and FSTree, respectively, representing the dependency graph of the
  // entry point or the non-dependency graph.
  this._depGraph = undefined;
  this._depGraphTree = undefined;
  this._nonDepGraph = undefined;
  this._nonDepGraphTree = undefined;

  Plugin.call(this, [inputNodes], {
    annotation: options.annotation,
    persistentOutput: true
  });
  this.options = options;
}

RollupFunnel.prototype._copy = Funnel.prototype._copy;

/**
 * Constructs an FSTree from the passed in paths.
 *
 * @param {Array} paths
 * @return {FSTree}
 */
RollupFunnel.prototype._getFSTree = function(paths) {
  var inputPath = this.inputPaths[0];
  var entries = paths.map(function(entryPath) {
    var absolutePath = path.join(inputPath, entryPath);
    var stat = existsStat(absolutePath);

    if (!stat) {
      return;
    }
github embroider-build / embroider / packages / compat / src / v1-app.ts View on Github external
get indexTree() {
    let indexFilePath = this.app.options.outputPaths.app.html;

    let index: Tree = new Funnel(this.app.trees.app, {
      allowEmpty: true,
      include: [`index.html`],
      getDestinationPath: () => indexFilePath,
      annotation: 'app/index.html',
    });

    if (this.isModuleUnification) {
      let srcIndex = new Funnel(new WatchedDir(join(this.root, 'src')), {
        files: ['ui/index.html'],
        getDestinationPath: () => indexFilePath,
        annotation: 'src/ui/index.html',
      });

      index = mergeTrees([index, srcIndex], {
        overwrite: true,
        annotation: 'merge classic and MU index.html',
github denali-js / core / lib / cli / builder.js View on Github external
let sourceTrees = dirs.map((dir) => {
      let treeFor = this[`treeFor${ upperFirst(dir) }`] || this.treeFor;
      let tree = treeFor.call(this, path.join(this.dir, dir));
      if (typeof tree !== 'string' || fs.existsSync(tree)) {
        return new Funnel(tree, { annotation: dir, destDir: dir });
      }
      return false;
    }).filter(Boolean);
github embroider-build / embroider / packages / compat / src / build-compat-addon.ts View on Github external
function withoutNodeModules(root: string): Tree {
  return new Funnel(new UnwatchedDir(root), {
    exclude: ['node_modules'],
  });
}
github denali-js / core / lib / cli / project.js View on Github external
buildDummyTree(rootTree) {
    debug(`building ${ this.pkg.name }'s dummy app`);
    let dummyBuilder = Builder.createFor(path.join(this.dir, 'test', 'dummy'), this, [ this.dir ]);
    let dummyTree = dummyBuilder.toTree();
    let addonTests = new Funnel(rootTree, {
      include: [ 'test/**/*' ],
      exclude: [ 'test/dummy/**/*' ]
    });
    rootTree = new Funnel(rootTree, {
      exclude: [ 'test/**/*' ],
      destDir: path.join('node_modules', this.pkg.name)
    });
    return new MergeTree([ rootTree, dummyTree, addonTests ], { overwrite: true });
  }
github embroider-build / embroider / packages / compat / src / v1-addon.ts View on Github external
return this.throughTreeCache(treeName, 'stock', () => {
      let opts = Object.assign(
        {
          srcDir: this.addonInstance.treePaths[treeName],
        },
        this.stockTreeFunnelOptions(treeName)
      );
      return new Funnel(this.rootTree, opts);
    })!;
  }
github denali-js / core / lib / cli / project.js View on Github external
buildDummyTree(rootTree) {
    debug(`building ${ this.pkg.name }'s dummy app`);
    let dummyBuilder = Builder.createFor(path.join(this.dir, 'test', 'dummy'), this, [ this.dir ]);
    let dummyTree = dummyBuilder.toTree();
    let addonTests = new Funnel(rootTree, {
      include: [ 'test/**/*' ],
      exclude: [ 'test/dummy/**/*' ]
    });
    rootTree = new Funnel(rootTree, {
      exclude: [ 'test/**/*' ],
      destDir: path.join('node_modules', this.pkg.name)
    });
    return new MergeTree([ rootTree, dummyTree, addonTests ], { overwrite: true });
  }
github embroider-build / embroider / ts / app-package.ts View on Github external
    return [...pkgs.values()].map((pkg, index) => new Funnel(pkg.tree, { destDir: `out-${index}` }));
  }

broccoli-funnel

Broccoli plugin that allows you to filter files selected from an input node down based on regular expressions.

MIT
Latest version published 4 years ago

Package Health Score

65 / 100
Full package analysis

Popular broccoli-funnel functions