<commit_before>var b = require('substance-bundler');

b.task('clean', function() {
  b.rm('./dist')
})

// copy assets
b.task('assets', function() {
  b.copy('examples/index.html', './dist/')
  b.copy('texture.css', './dist/')
  b.copy('packages/**/*.css', './dist/')
  b.copy('examples/data', './dist/data')
  b.copy('node_modules/font-awesome', './dist/font-awesome')
})

// this optional task makes it easier to work on Substance core
b.task('substance', function() {
  b.make('substance', 'clean', 'css', 'browser:umd')
  b.copy('node_modules/substance/dist', './dist/substance')
})

function buildExample(example) {
  return function() {
    b.copy('examples/'+example+'/index.html', './dist/'+example+'/')
    b.copy('examples/'+example+'/*.css', './dist/'+example+'/', { root: 'examples/'+example })
    b.js('examples/'+example+'/app.js', {
      // need buble if we want to minify later
      // buble: true,
      external: ['substance'],
      commonjs: { include: ['node_modules/lodash/**'] },
      dest: './dist/'+example+'/app.js',
      format: 'umd',
      moduleName: example
    })
  }
}

b.task('author', ['clean', 'substance', 'assets'], buildExample('author'))
b.task('publisher', ['clean', 'substance', 'assets'], buildExample('publisher'))
b.task('tagging', ['author'], buildExample('tagging'))

b.task('examples', ['author', 'publisher', 'tagging'])

// build all
b.task('default', ['examples'])

// starts a server when CLI argument '-s' is set
b.setServerPort(5555)
b.serve({
  static: true, route: '/', folder: 'dist'
})<commit_msg>Substance bundle target has changed.<commit_after>var b = require('substance-bundler');

b.task('clean', function() {
  b.rm('./dist')
})

// copy assets
b.task('assets', function() {
  b.copy('examples/index.html', './dist/')
  b.copy('texture.css', './dist/')
  b.copy('packages/**/*.css', './dist/')
  b.copy('examples/data', './dist/data')
  b.copy('node_modules/font-awesome', './dist/font-awesome')
})

// this optional task makes it easier to work on Substance core
b.task('substance', function() {
  b.make('substance', 'clean', 'css', 'browser')
  b.copy('node_modules/substance/dist', './dist/substance')
})

function buildExample(example) {
  return function() {
    b.copy('examples/'+example+'/index.html', './dist/'+example+'/')
    b.copy('examples/'+example+'/*.css', './dist/'+example+'/', { root: 'examples/'+example })
    b.js('examples/'+example+'/app.js', {
      // need buble if we want to minify later
      // buble: true,
      external: ['substance'],
      commonjs: { include: ['node_modules/lodash/**'] },
      dest: './dist/'+example+'/app.js',
      format: 'umd',
      moduleName: example
    })
  }
}

b.task('author', ['clean', 'substance', 'assets'], buildExample('author'))
b.task('publisher', ['clean', 'substance', 'assets'], buildExample('publisher'))
b.task('tagging', ['author'], buildExample('tagging'))
b.task('examples', ['author', 'publisher', 'tagging'])

// build all
b.task('default', ['examples'])

// starts a server when CLI argument '-s' is set
b.setServerPort(5555)
b.serve({
  static: true, route: '/', folder: 'dist'
})
{'fraction_non_alphanumeric': 0.23964308476736776, 'fraction_numerical': 0.0025493945188017845, 'mean_word_length': 3.974643423137876, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, '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': '3880230', 'n_tokens_mistral': 1080, 'n_tokens_neox': 1055, 'n_words': 220}