<commit_before>let gulp = require('gulp');
let plumber = require('gulp-plumber');
let notify = require('gulp-notify');
let changed = require('gulp-changed');
let sourcemaps = require('gulp-sourcemaps');
let typescript = require('gulp-tsb');
let rename = require('gulp-rename');
let project = require('../aurelia.json');
let {inject} = require('aurelia-dependency-injection');
let {CLIOptions} = require('aurelia-cli');

@inject(CLIOptions)
class ConfigureEnvironment {
  constructor(private options: CLIOptions) { }

  execute() {
    let env = this.options.getFlag('env') || process.env.NODE_ENV || 'dev';

    return gulp.src(`aurelia_project/environments/${env}.js`)
      .pipe(rename('environment.js'))
      .pipe(gulp.dest(project.paths.root));
  }
}

let typescriptCompiler = global.typescriptCompiler || null;

function buildJavaScript() {
  if (!typescriptCompiler) {
    typescriptCompiler = typescript.create(require('../../tsconfig.json').compilerOptions);
  }

  return gulp.src(project.paths.dtsSource.concat(project.paths.source))
    .pipe(plumber({errorHandler: notify.onError('Error: <%= error.message %>')}))
    .pipe(changed(project.paths.output, {extension: '.js'}))
    .pipe(sourcemaps.init({loadMaps: true}))
    .pipe(typescriptCompiler())<commit_msg>fix(tasks): incorrect file extension in ts build js task<commit_after>let gulp = require('gulp');
let plumber = require('gulp-plumber');
let notify = require('gulp-notify');
let changed = require('gulp-changed');
let sourcemaps = require('gulp-sourcemaps');
let typescript = require('gulp-tsb');
let rename = require('gulp-rename');
let project = require('../aurelia.json');
let {inject} = require('aurelia-dependency-injection');
let {CLIOptions} = require('aurelia-cli');

@inject(CLIOptions)
class ConfigureEnvironment {
  constructor(private options: CLIOptions) { }

  execute() {
    let env = this.options.getFlag('env') || process.env.NODE_ENV || 'dev';

    return gulp.src(`aurelia_project/environments/${env}.ts`)
      .pipe(rename('environment.js'))
      .pipe(gulp.dest(project.paths.root));
  }
}

let typescriptCompiler = global.typescriptCompiler || null;

function buildJavaScript() {
  if (!typescriptCompiler) {
    typescriptCompiler = typescript.create(require('../../tsconfig.json').compilerOptions);
  }

  return gulp.src(project.paths.dtsSource.concat(project.paths.source))
    .pipe(plumber({errorHandler: notify.onError('Error: <%= error.message %>')}))
    .pipe(changed(project.paths.output, {extension: '.js'}))
    .pipe(sourcemaps.init({loadMaps: true}))
    .pipe(typescriptCompiler())
{'fraction_non_alphanumeric': 0.17506733358984225, 'fraction_numerical': 0.0, 'mean_word_length': 5.235011990407674, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '4924952', 'n_tokens_mistral': 824, 'n_tokens_neox': 811, 'n_words': 141}