<commit_before>'use strict';

const crypto = require('crypto'),
      neat = require('node-neat');

module.exports = manifest => {
  /* TODO refactor this */
  if (!process.env.NODE_ENV) {
    manifest.connections[0].host = 'localhost';
  }

  if (process.env.NODE_ENV !== 'production') {
    process.env.tokenSecret = crypto.randomBytes(16)
                                    .toString('base64');
    process.env.keySecret = crypto.randomBytes(16)
                                    .toString('base64');

    manifest.registrations.push({
      "plugin": {
        "register": "blipp"
      }
    });

    let good = manifest.registrations.find(p => p.plugin.register === 'good');
    if (good) {
      good.plugin.options.reporters[0].events['request'] = "*";
      good.plugin.options.reporters[0].events['log'] = null;
    }
  }

  manifest.connections[0].routes.files = {
    relativeTo: __dirname + '/../public'
  };
  manifest.connections[0].port = process.env.PORT || 3000;

  let sassOptions = {
    src: __dirname + '/../public/assets/sass',
    dest: __dirname + '/../public/assets/css',
    force: true,
    debug: true,
    routePath: '/css/{file}.css',
    includePaths: neat.includePaths
  };

  console.log(sassOptions);

  let hapiSass = manifest.registrations.find(p => p.plugin.register === 'hapi-sass');
  if (hapiSass) {
    hapiSass.plugin.options = sassOptions;
  }
};<commit_msg>(fix) remove node-sass debug<commit_after>'use strict';

const crypto = require('crypto'),
      neat = require('node-neat');

module.exports = manifest => {
  /* TODO refactor this */
  if (!process.env.NODE_ENV) {
    manifest.connections[0].host = 'localhost';
  }

  if (process.env.NODE_ENV !== 'production') {
    process.env.tokenSecret = crypto.randomBytes(16)
                                    .toString('base64');
    process.env.keySecret = crypto.randomBytes(16)
                                    .toString('base64');

    manifest.registrations.push({
      "plugin": {
        "register": "blipp"
      }
    });

    let good = manifest.registrations.find(p => p.plugin.register === 'good');
    if (good) {
      good.plugin.options.reporters[0].events['request'] = "*";
      good.plugin.options.reporters[0].events['log'] = null;
    }
  }

  manifest.connections[0].routes.files = {
    relativeTo: __dirname + '/../public'
  };
  manifest.connections[0].port = process.env.PORT || 3000;

  let sassOptions = {
    src: __dirname + '/../public/assets/sass',
    dest: __dirname + '/../public/assets/css',
    routePath: '/css/{file}.css',
    includePaths: neat.includePaths
  };

  console.log(sassOptions);

  let hapiSass = manifest.registrations.find(p => p.plugin.register === 'hapi-sass');
  if (hapiSass) {
    hapiSass.plugin.options = sassOptions;
  }
};
{'fraction_non_alphanumeric': 0.1709064851307775, 'fraction_numerical': 0.012182013615191688, 'mean_word_length': 2.5840821566110397, 'pattern_counts': {'":': 4, '<': 3, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3182205', 'n_tokens_mistral': 926, 'n_tokens_neox': 887, 'n_words': 143}