How to use the ember-cli/lib/models/project.closestSync function in ember-cli

To help you get started, we’ve selected a few ember-cli 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 asakusuma / ember-rollup / src / prebuild.js View on Github external
return true;
  }
  // If addon has pre-built path set in it use that else use the default path
  if(!addonToBuild.PREBUILT_PATH) {
    addonToBuild.PREBUILT_PATH = `${addonPath}/pre-built`;
  }
  fs.removeSync(addonToBuild.PREBUILT_PATH);

  const ui = new UI({
    inputStream: process.stdin,
    outputStream: process.stdout,
    errorStream: process.stderr,
    writeLevel: 'DEBUG' | 'INFO' | 'WARNING' | 'ERROR',
    ci: true | false
  });
  const project = Project.closestSync(addonPath, ui);
  project.initializeAddons();
  // Extend the current addon from base Addon
  const CurrentAddon = Addon.extend(Object.assign({}, addonToBuild, {root: addonPath, pkg: project.pkg}));
  const currAddon  = new CurrentAddon(addonPath, project);

  // Get the tree for Addon and Vendor
  let addonTree = new Funnel (currAddon.treeFor('addon'), {
    destDir:  'addon'
  });

  let vendorTree = new Funnel (currAddon.treeFor('vendor'), {
    destDir:  'vendor'
  });

  // Merge, Build the resulting tree and store it in prebuild path
  return build(new Merge([addonTree, vendorTree], { annotation: '[ember-rollup] Merging prebuild addon and vendor tree' }), addonToBuild.PREBUILT_PATH);
github angular / angular-cli / lib / broccoli / angular2-app.js View on Github external
_initProject() {
    this.project = Project.closestSync(process.cwd());

    // project root dir env used on angular-cli side for including packages from project
    process.env.PROJECT_ROOT = process.env.PROJECT_ROOT || this.project.root;
  }
github ember-learn / ember-cli-addon-docs / ember-cli-build.js View on Github external
module.exports = function(defaults) {
  let project = Project.closestSync(process.cwd());

  project.pkg['ember-addon'].paths = ['sandbox'];

  defaults.project = project;

  var app = new EmberAddon(defaults, {
    project,
    vendorFiles: { 'jquery.js': null, 'app-shims.js': null },

    // Workaround for https://github.com/ember-cli/ember-cli/issues/8075
    'ember-cli-uglify': {
      uglify: {
        compress: {
          collapse_vars: false
        }
      }