<commit_before>/* jshint node: true */
'use strict';

var path = require('path');
var Funnel = require('broccoli-funnel');
var intersection = require('./lib/intersection');
var difference = require('./lib/difference');

module.exports = {
  name: 'ember-bulma',

  init: function(app) {
    this._super.init && this._super.init.apply(this, arguments);

    this.options = this.options || {};
    this.options.babel = this.options.babel || {};
    this.options.babel.optional = this.options.babel.optional || [];

    if (this.options.babel.optional.indexOf('es7.decorators') === -1) {
      this.options.babel.optional.push('es7.decorators');
    }
  },

  included: function(app, parentAddon) {
     // see: https://github.com/ember-cli/ember-cli/issues/3718
    if (typeof app.import !== 'function' && app.app) {
      this.app = app = app.app;
    }

    this._super.included(app);

    // see: http://ember-cli.com/extending/#broccoli-build-options-for-in-repo-addons
    var target = (parentAddon || app);
    target.options = target.options || {};


    // Build all paths
    var bulmaPath = path.join(app.bowerDirectory, 'bulma');

    target.options.sassOptions = target.options.sassOptions || {};
    target.options.sassOptions.includePaths = target.options.sassOptions.includePaths || [];

    // Import sass dependencies
    target.options.sassOptions.includePaths.push(bulmaPath);
    // target.options.sassOptions.extension = 'sass';

    var config = app.project.config(app.env) || {};
    var addonConfig = config[this.name] || {};

    // console.log('addon config: ', addonConfig);

    this.whitelist = this.generateWhitelist(addonConfig);
    this.blacklist = this.generateBlacklist(addonConfig);
  },

  /*
    Tree Shaking borrowed from DockYard
    https://github.com/DockYard/ember-composable-components/
    https://github.com/DockYard/ember-composable-components#configuration
  */
  treeForAddon: function() {
    // see: https://github.com/ember-cli/ember-cli/issues/4463
    var tree = this._super.treeForAddon.apply(this, arguments);

    return this.filterComponents(tree, new RegExp('^modules\/' + this.name + '\/components\/', 'i'));<commit_msg>Allows addon to be used as a nested addon<commit_after>/* jshint node: true */
'use strict';

var path = require('path');
var Funnel = require('broccoli-funnel');
var intersection = require('./lib/intersection');
var difference = require('./lib/difference');

module.exports = {
  name: 'ember-bulma',

  init: function(app) {
    this._super.init && this._super.init.apply(this, arguments);

    this.options = this.options || {};
    this.options.babel = this.options.babel || {};
    this.options.babel.optional = this.options.babel.optional || [];

    if (this.options.babel.optional.indexOf('es7.decorators') === -1) {
      this.options.babel.optional.push('es7.decorators');
    }
  },

  included: function(app, parentAddon) {
    this._super.included.apply(this, arguments);

    var target = parentAddon || app;

    // allow addon to be nested - see: https://github.com/ember-cli/ember-cli/issues/3718
    if (target.app) {
      target = target.app;
    }

    // see: http://ember-cli.com/extending/#broccoli-build-options-for-in-repo-addons
    target.options = target.options || {};

    // Build all paths
    var bulmaPath = path.join(target.bowerDirectory, 'bulma');

    target.options.sassOptions = target.options.sassOptions || {};
    target.options.sassOptions.includePaths = target.options.sassOptions.includePaths || [];

    // Import sass dependencies
    target.options.sassOptions.includePaths.push(bulmaPath);
    // target.options.sassOptions.extension = 'sass';

    var config = target.project.config(target.env) || {};
    var addonConfig = config[this.name] || {};

    // console.log('addon config: ', addonConfig);

    this.whitelist = this.generateWhitelist(addonConfig);
    this.blacklist = this.generateBlacklist(addonConfig);
  },

  /*
    Tree Shaking borrowed from DockYard
    https://github.com/DockYard/ember-composable-components/
    https://github.com/DockYard/ember-composable-components#configuration
  */
  treeForAddon: function() {
    // see: https://github.com/ember-cli/ember-cli/issues/4463
    var tree = this._super.treeForAddon.apply(this, arguments);

    return this.filterComponents(tree, new RegExp('^modules\/' + this.name + '\/components\/', 'i'));
{'fraction_non_alphanumeric': 0.16261087104844213, 'fraction_numerical': 0.005003411416875142, 'mean_word_length': 3.4424242424242424, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 8, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4052996', 'n_tokens_mistral': 1433, 'n_tokens_neox': 1364, 'n_words': 229}