<commit_before>var fs = require('fs');
var replace = require('broccoli-replace');
var broccoli = require('broccoli');
var uglify = require('broccoli-uglify-js');
var mergeTrees = require('broccoli-merge-trees');
var moveFile = require('broccoli-file-mover');
var stringify = require('stringify-object');

var build = function(broccoli) {

  var config = 'var config = ' + stringify(require('./config/bluebird.js')).replace(/\n/g, '\n    ');
  var core = fs.readFileSync('./source/core.js', 'utf8').replace(/\n/g, '\n  ').replace('//@@config', config);
  var statik = fs.readFileSync('./source/static.js', 'utf8').replace(/\n/g, '\n  ');

  var source = core + '\n' + statik;

  var dev = replace('templates', {
    files: [
      '**/*.js'
    ],
    patterns: [
      {
        match: 'include',
        replacement: source
      }
    ]
  });

  var main = moveFile(dev, {
    srcFile: 'common.js',
    destFile: '../../main.js',
    copy: true
  })

/*
  //Attempting to create /prod directory for minified artifacts
  var prod = uglify(moveFile(dev, {
    srcFile: '/',
    destFile: 'prod',
    copy: true
  }));
  //https://github.com/rjackson/broccoli-file-mover/issues/6
*/
  return mergeTrees([dev, main], {
    overwrite: true
  });
};

module.exports = build(broccoli);<commit_msg>Setup build for when file-mover is fixed<commit_after>var fs = require('fs');
var replace = require('broccoli-replace');
var broccoli = require('broccoli');
var uglify = require('broccoli-uglify-js');
var mergeTrees = require('broccoli-merge-trees');
var moveFile = require('broccoli-file-mover');
var stringify = require('stringify-object');

var build = function() {

  var config = 'var config = ' + stringify(require('./config/bluebird.js')).replace(/\n/g, '\n    ');
  var core = fs.readFileSync('./source/core.js', 'utf8').replace(/\n/g, '\n  ').replace('//@@config', config);
  var statik = fs.readFileSync('./source/static.js', 'utf8').replace(/\n/g, '\n  ');

  var source = core + '\n' + statik;

  var dev = replace('templates', {
    files: [
      '**/*.js'
    ],
    patterns: [
      {
        match: 'include',
        replacement: source
      }
    ]
  });

  var main = moveFile(dev, {
    srcFile: 'common.js',
    destFile: '../../main.js',
    copy: true
  })


  /*
  //Attempting to create /prod directory for minified artifacts
  var prod = uglify(moveFile(dev, {
    files: {
      '': '/prod'
    },
    copy: true
  }));
  //https://github.com/rjackson/broccoli-file-mover/issues/6
  */

  return mergeTrees([dev, main, prod], {
    overwrite: true
  });
};

module.exports = build(broccoli);
{'fraction_non_alphanumeric': 0.19709146574818218, 'fraction_numerical': 0.002296211251435132, 'mean_word_length': 2.972644376899696, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, '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': '4061145', 'n_tokens_mistral': 920, 'n_tokens_neox': 887, 'n_words': 185}