<commit_before>import BaseGulp from './baseGulp'
import Preset from './preset'
import extend from 'extend'
import Util from 'gulp-util'
import stringify from 'stringify-object'

export const Default = {
  watch: true,
  debug: false
}

const BaseRecipe = class extends BaseGulp {

  /**
   *
   * @param gulp - gulp instance
   * @param preset - base preset configuration - either one from preset.js or a custom hash
   * @param configs - customized overrides for this recipe
   */
  constructor(gulp, preset, ...configs) {

    super(gulp,
      extend(true, {},  // extend presets here since BaseGulp doesn't use preset.
        Default,
        {baseDirectories: preset.baseDirectories},
        Preset.resolveConfig(preset, ...configs)
      )
    )

    // in case someone needs to inspect it later i.e. buildControl
    this.preset = preset
    this.registerTask()
    this.registerWatchTask()
  }

  registerWatchTask() {
    if (this.config.watch) {
      // generate watch task e.g. sass:watch
      let name = this.watchTaskName()
      this.debug(`Registering task: ${Util.colors.green(name)}`)
      this.watchFn = () => {
        this.log(`[${Util.colors.green(name)}] watching ${this.config.watch.glob} ${stringify(this.config.watch.options)}...`)

        return this.gulp.watch(this.config.watch.glob, this.config.watch.options, (event) => {
          this.log(`File ${event.path} was ${event.type}, running ${this.taskName()}...`);
          return Promise<commit_msg>watch events no longer contain file path info<commit_after>import BaseGulp from './baseGulp'
import Preset from './preset'
import extend from 'extend'
import Util from 'gulp-util'
import stringify from 'stringify-object'

export const Default = {
  watch: true,
  debug: false
}

const BaseRecipe = class extends BaseGulp {

  /**
   *
   * @param gulp - gulp instance
   * @param preset - base preset configuration - either one from preset.js or a custom hash
   * @param configs - customized overrides for this recipe
   */
  constructor(gulp, preset, ...configs) {

    super(gulp,
      extend(true, {},  // extend presets here since BaseGulp doesn't use preset.
        Default,
        {baseDirectories: preset.baseDirectories},
        Preset.resolveConfig(preset, ...configs)
      )
    )

    // in case someone needs to inspect it later i.e. buildControl
    this.preset = preset
    this.registerTask()
    this.registerWatchTask()
  }

  registerWatchTask() {
    if (this.config.watch) {
      // generate watch task e.g. sass:watch
      let name = this.watchTaskName()
      this.debug(`Registering task: ${Util.colors.green(name)}`)
      this.watchFn = () => {
        this.log(`[${Util.colors.green(name)}] watching ${this.config.watch.glob} ${stringify(this.config.watch.options)}...`)

        return this.gulp.watch(this.config.watch.glob, this.config.watch.options, (event) => {
          //this.log(`event: ${this.dump(event)}`)
          //this.log(`File ${event.path} was ${event.type}, running ${this.taskName()}...`);
          this.log(`Watched file changed, running ${this.taskName()}...`);
          return Promise
{'fraction_non_alphanumeric': 0.13738019169329074, 'fraction_numerical': 0.0, 'mean_word_length': 2.894278606965174, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '5478129', 'n_tokens_mistral': 956, 'n_tokens_neox': 947, 'n_words': 251}