<commit_before>/*
 * holonomy-website
 * https://github.com/holonomy/website
 * licensed under the AGPLv3 license.
 */

'use strict';

var _ = require('lodash');

var banner = '/* <%= pkg.name %> <%= pkg.version %> <%= grunt.template.today("yyyy-mm-dd") %> */\n';
var lessPaths = [
  'node_modules/semantic/src',
  'node_modules/font-awesome/less',
  'styles',
];
var fontFiles = [
  'node_modules/font-awesome/fonts/*',
  'node_modules/semantic/src/fonts/*',
];

module.exports = function(grunt) {

  // project configuration.
  grunt.initConfig({
    pkg: grunt.file.readJSON('package.json'),

    // lint JavaScript
    jshint: {
      all: ['Gruntfile.js', 'helpers/*.js'],
      options: {
        jshintrc: '.jshintrc',
      },
    },

    // build HTML from templates and data
    assemble: {
      options: {
        pkg: '<%= pkg %>',
        flatten: true,
        assets: 'static/assets',
        partials: ['templates/includes/*.hbs'],
        helpers: ['templates/helpers/*.js'],
        layout: 'templates/layouts/layout.hbs',
        data: ['data/*.{json,yml}'],
      },
      build: {
        files: {'build/': ['templates/*.hbs']},
      },
    },

    // compile LESS to CSS
    less: {
      options: {
        banner: banner,
        paths: lessPaths,
      },
      develop: {
        files: {
          'build/index.css': 'styles/index.less',
        },
      },
      deploy: {
        options: {
          cleancss: true,
          report: 'min',
          sourceMap: true,
        },
        files: {
          'build/index.css': 'styles/index.less',
        },
      },
    },

    // compile JS
    browserify: {
      develop: {
        files: {
          'build/index.js': 'scripts/index.js',
        },
      },
      deploy: {
        files: {
          'build/index.js': 'scripts/index.js',
        },
        options: {
          transform: ['uglifyify'],
        }
      },
    },

    // before generating any new files,
    // remove any previously-created files.
    clean: {
      build: ['build/**/*']
    },

    copy: {
      assets: {
        expand: true,
        cwd: 'assets',
        src: ['**'],
        dest: 'build/',
      },
      fonts: {
        src: fontFiles,
        dest: 'build/fonts/',
        expand: true,
        flatten: true,
        filter: 'isFile',
      },
    },

    connect: {
      options: {
        port: 5000,
        base: 'build',
      },
      develop: {
        options: {
          livereload: true,<commit_msg>copy CNAME file to build in Gruntfile<commit_after>/*
 * holonomy-website
 * https://github.com/holonomy/website
 * licensed under the AGPLv3 license.
 */

'use strict';

var _ = require('lodash');

var banner = '/* <%= pkg.name %> <%= pkg.version %> <%= grunt.template.today("yyyy-mm-dd") %> */\n';
var lessPaths = [
  'node_modules/semantic/src',
  'node_modules/font-awesome/less',
  'styles',
];
var fontFiles = [
  'node_modules/font-awesome/fonts/*',
  'node_modules/semantic/src/fonts/*',
];

module.exports = function(grunt) {

  // project configuration.
  grunt.initConfig({
    pkg: grunt.file.readJSON('package.json'),

    // lint JavaScript
    jshint: {
      all: ['Gruntfile.js', 'helpers/*.js'],
      options: {
        jshintrc: '.jshintrc',
      },
    },

    // build HTML from templates and data
    assemble: {
      options: {
        pkg: '<%= pkg %>',
        flatten: true,
        assets: 'static/assets',
        partials: ['templates/includes/*.hbs'],
        helpers: ['templates/helpers/*.js'],
        layout: 'templates/layouts/layout.hbs',
        data: ['data/*.{json,yml}'],
      },
      build: {
        files: {'build/': ['templates/*.hbs']},
      },
    },

    // compile LESS to CSS
    less: {
      options: {
        banner: banner,
        paths: lessPaths,
      },
      develop: {
        files: {
          'build/index.css': 'styles/index.less',
        },
      },
      deploy: {
        options: {
          cleancss: true,
          report: 'min',
          sourceMap: true,
        },
        files: {
          'build/index.css': 'styles/index.less',
        },
      },
    },

    // compile JS
    browserify: {
      develop: {
        files: {
          'build/index.js': 'scripts/index.js',
        },
      },
      deploy: {
        files: {
          'build/index.js': 'scripts/index.js',
        },
        options: {
          transform: ['uglifyify'],
        }
      },
    },

    // before generating any new files,
    // remove any previously-created files.
    clean: {
      build: ['build/**/*']
    },

    copy: {
      assets: {
        expand: true,
        cwd: 'assets',
        src: ['**'],
        dest: 'build/',
      },
      fonts: {
        src: fontFiles,
        dest: 'build/fonts/',
        expand: true,
        flatten: true,
        filter: 'isFile',
      },
      cname: {
        src: 'CNAME',
        dest: 'build/',
      },
    },

    connect: {
      options: {
        port: 5000,
        base: 'build',
      },
      develop: {
        options: {
          livereload: true,
{'fraction_non_alphanumeric': 0.1717827626918536, 'fraction_numerical': 0.0019677292404565133, 'mean_word_length': 1.608004104669061, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, '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': '168785', 'n_tokens_mistral': 1703, 'n_tokens_neox': 1628, 'n_words': 310}