<commit_before>GruntVTEX = require 'grunt-vtex'

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

  replaceMap = {}

  config = GruntVTEX.generateConfig grunt, pkg,
    relativePath: '/'
    replaceMap: replaceMap

  config.coffee.main.files = [
    expand: true
    cwd: 'src'
    src: ['**/*.coffee']
    dest: "build/"
    rename: (path, filename) ->
      path + filename.replace("coffee", "js")
  ]

  config.concat =
    main:
      files:
        'build/vtex.js': ['build/*.js']

  config.uglify =
    main:
      files: [
        expand: true
        cwd: 'build/'
        src: '*.js'
        dest: 'build'
        rename: (dest, src) -> dest + '/' + src.replace('.js', '.min.js')
      ]
      options:
        sourceMap: true

  tasks =
  # Building block tasks
    build: ['clean', 'copy:pkg', 'coffee', 'concat']
    min: ['uglify'] # minifies files
  # Deploy tasks
    dist: ['build', 'min', 'copy:deploy'] # Dist - minifies files
    test: []
    vtex_deploy: ['shell:cp', 'shell:cp_br']
  # Development tasks
    default: ['build', 'watch']

  # 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 dev task to grunt<commit_after>GruntVTEX = require 'grunt-vtex'

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

  replaceMap = {}

  config = GruntVTEX.generateConfig grunt, pkg,
    replaceMap: replaceMap

  config.coffee.main.files = [
    expand: true
    cwd: 'src'
    src: ['**/*.coffee']
    dest: "build/<%= relativePath %>/"
    rename: (path, filename) ->
      path + filename.replace("coffee", "js")
  ]

  config.concat =
    main:
      files:
        'build/<%=relativePath%>/vtex.js': [
          'build/<%= relativePath %>/extended-ajax.js'
          'build/<%= relativePath %>/catalog.js'
          'build/<%= relativePath %>/checkout.js'
        ]

  config.uglify =
    main:
      files: [
        expand: true
        cwd: 'build/<%=relativePath%>/'
        src: '*.js'
        dest: 'build/<%=relativePath%>/'
        rename: (dest, src) -> dest + '/' + src.replace('.js', '.min.js')
      ]
      options:
        sourceMap: true

  config.watch.coffee.files = ['src/*.coffee']

  tasks =
  # Building block tasks
    build: ['clean', 'copy:pkg', 'coffee', 'concat']
    min: ['uglify'] # minifies files
  # Deploy tasks
    dist: ['build', 'min', 'copy:deploy'] # Dist - minifies files
    test: []
    vtex_deploy: ['shell:cp', 'shell:cp_br']
  # Development tasks
    dev: ['nolr', 'build', 'watch']
    default: ['dev']

  # 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.16276703967446593, 'fraction_numerical': 0.0013563919972872161, 'mean_word_length': 2.6374845869297165, 'pattern_counts': {'":': 0, '<': 10, '<?xml version=': 0, '>': 16, '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': '5278943', 'n_tokens_mistral': 1053, 'n_tokens_neox': 1003, 'n_words': 242}