<commit_before>GruntVTEX = require 'grunt-vtex'

module.exports = (grunt) ->
  pkg = grunt.file.readJSON 'package.json'

  lang = grunt.option('lang') or 'en-US'

  config = GruntVTEX.generateConfig grunt, pkg

  config.clean.main.push 'dist/'
  config.clean.deploy = ["dist/#{pkg.version}/{i18n/,templates/,script/main.js,index.*,style/includes/}"]

  config.browserify =
    main:
      src: ['build/<%= relativePath %>/script/main.js']
      dest: "build/<%= relativePath %>/script/#{pkg.name}.js"
      options:
        transform: ['brfs']

  config.less =
    main:
      files: [
        src: ['src/style/style.less']
        dest: "build/<%= relativePath %>/style/#{pkg.name}.css"
      ]

  config['compile-handlebars'] =
    index:
      template: 'src/index.hbs'
      templateData: {pkg: pkg}
      output: 'build/<%= relativePath %>/index.html'
    main:
      template: 'src/templates/main.hbs'
      templateData: "src/i18n/#{lang}.json"
      output: 'build/<%= relativePath %>/templates/main.html'

  config.watch.main.files.push 'src/**/*.hbs'
  config.watch.main.tasks.push 'compile-handlebars', 'browserify'

  tasks =
    # Building block tasks
    build: ['clean:main', 'copy:main', 'compile-handlebars', 'coffee', 'browserify', 'less']
    min: ['useminPrepare', 'uglify', 'usemin'] # minifies files
    # Deploy tasks
    dist: ['build', 'min', 'copy:deploy', 'clean:deploy'] # Dist - minifies files
    # Development tasks
    default: ['build', 'connect', 'watch']
    devmin: ['build', 'min', 'connect:http:keepalive'] # Minifies files and serve

  # Project configuration.
  grunt.initConfig config
  grunt.loadNpmTasks name for name of pkg.devDependencies when name[0..5] is 'grunt-' and name isnt 'grunt-vtex'
  grunt.registerTask taskName, taskArray for taskName, taskArray of tasks<commit_msg>Add browserify to watch<commit_after>GruntVTEX = require 'grunt-vtex'

module.exports = (grunt) ->
  pkg = grunt.file.readJSON 'package.json'

  lang = grunt.option('lang') or 'en-US'

  config = GruntVTEX.generateConfig grunt, pkg

  config.clean.main.push 'dist/'
  config.clean.deploy = ["dist/#{pkg.version}/{i18n/,templates/,script/main.js,index.*,style/includes/}"]

  config.browserify =
    main:
      src: ['build/<%= relativePath %>/script/main.js']
      dest: "build/<%= relativePath %>/script/#{pkg.name}.js"
      options:
        transform: ['brfs']

  config.less =
    main:
      files: [
        src: ['src/style/style.less']
        dest: "build/<%= relativePath %>/style/#{pkg.name}.css"
      ]

  config['compile-handlebars'] =
    index:
      template: 'src/index.hbs'
      templateData: {pkg: pkg}
      output: 'build/<%= relativePath %>/index.html'
    main:
      template: 'src/templates/main.hbs'
      templateData: "src/i18n/#{lang}.json"
      output: 'build/<%= relativePath %>/templates/main.html'

  config.watch.main.files.push 'src/**/*.hbs'
  config.watch.main.tasks.push 'compile-handlebars', 'browserify'
  config.watch.coffee.tasks.push 'browserify'

  tasks =
    # Building block tasks
    build: ['clean:main', 'copy:main', 'compile-handlebars', 'coffee', 'browserify', 'less']
    min: ['useminPrepare', 'uglify', 'usemin'] # minifies files
    # Deploy tasks
    dist: ['build', 'min', 'copy:deploy', 'clean:deploy'] # Dist - minifies files
    # Development tasks
    default: ['build', 'connect', 'watch']
    devmin: ['build', 'min', 'connect:http:keepalive'] # Minifies files and serve

  # Project configuration.
  grunt.initConfig config
  grunt.loadNpmTasks name for name of pkg.devDependencies when name[0..5] is 'grunt-' and name isnt 'grunt-vtex'
  grunt.registerTask taskName, taskArray for taskName, taskArray of tasks
{'fraction_non_alphanumeric': 0.16900647948164146, 'fraction_numerical': 0.0032397408207343412, 'mean_word_length': 3.4002375296912115, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7271901', 'n_tokens_mistral': 1290, 'n_tokens_neox': 1234, 'n_words': 272}