<commit_before>'use strict'

let gulp = require('gulp')

gulp.task('clean', () => {
  let del = require('del')
  return del(['build/', 'lib/*.js'])
})

// Build

gulp.task('compile', () => {
  let sourcemaps = require('gulp-sourcemaps')
  let changed = require('gulp-changed')
  let babel = require('gulp-babel')
  return gulp.src('lib/*.es6')
    .pipe(changed('lib', { extension: '.js' }))
    .pipe(sourcemaps.init())
    .pipe(babel())
    .pipe(sourcemaps.write())
    .pipe(gulp.dest('lib'))
})

gulp.task('build:lib', gulp.series('compile', () => {
  return gulp.src('lib/*.js').pipe(gulp.dest('build/lib'))
}))

gulp.task('build:package', () => {
  let editor = require('gulp-json-editor')
  return gulp.src('./package.json')
    .pipe(editor(json => {
      delete json.babel
      delete json.scripts
      delete json.jest
      delete json.eslintConfig
      delete json['pre-commit']
      delete json['lint-staged']
      delete json.browserslist
      delete json.devDependencies
      return json
    }))
    .pipe(gulp.dest('build'))
})

gulp.task('build:docs', () => {
  let ignore = require('fs').readFileSync('.npmignore').toString()
    .trim().split(/\n+/)
    .concat(['.npmignore', 'package.json'])
    .map(i => '!' + i)
  return gulp.src(['*'].concat(ignore))
    .pipe(gulp.dest('build'))
})

gulp.task('build', gulp.series('compile',
  gulp.parallel('build:lib', 'build:docs', 'build:package')
))

// Test

gulp.task('test', gulp.series('compile', () => {
  let jest = require('gulp-jest').default
  return gulp.src('test/').pipe(jest())
}))<commit_msg>FIx build script fot types<commit_after>'use strict'

let gulp = require('gulp')

gulp.task('clean', () => {
  let del = require('del')
  return del(['build/', 'lib/*.js'])
})

// Build

gulp.task('compile', () => {
  let sourcemaps = require('gulp-sourcemaps')
  let changed = require('gulp-changed')
  let babel = require('gulp-babel')
  return gulp.src('lib/*.es6')
    .pipe(changed('lib', { extension: '.js' }))
    .pipe(sourcemaps.init())
    .pipe(babel())
    .pipe(sourcemaps.write())
    .pipe(gulp.dest('lib'))
})

gulp.task('build:lib', gulp.series('compile', () => {
  return gulp.src('lib/*.js').pipe(gulp.dest('build/lib'))
}))

gulp.task('build:package', () => {
  let editor = require('gulp-json-editor')
  return gulp.src('./package.json')
    .pipe(editor(json => {
      delete json.babel
      delete json.scripts
      delete json.jest
      delete json.eslintConfig
      delete json['pre-commit']
      delete json['lint-staged']
      delete json.browserslist
      delete json.devDependencies
      return json
    }))
    .pipe(gulp.dest('build'))
})

gulp.task('build:types', () => {
  return gulp.src(['lib/*.d.ts'])
    .pipe(gulp.dest('build/lib'))
})

gulp.task('build:docs', () => {
  let ignore = require('fs').readFileSync('.npmignore').toString()
    .trim().split(/\n+/)
    .concat(['.npmignore', 'package.json'])
    .map(i => '!' + i)
  return gulp.src(['*'].concat(ignore))
    .pipe(gulp.dest('build'))
})

gulp.task('build', gulp.series('compile',
  gulp.parallel('build:lib', 'build:docs', 'build:package', 'build:types')
))

// Test

gulp.task('test', gulp.series('compile', () => {
  let jest = require('gulp-jest').default
  return gulp.src('test/').pipe(jest())
}))
{'fraction_non_alphanumeric': 0.22792109256449167, 'fraction_numerical': 0.0006069802731411229, 'mean_word_length': 3.5714285714285716, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 20, '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': '5949767', 'n_tokens_mistral': 1184, 'n_tokens_neox': 1164, 'n_words': 183}