old_contents: // @ts-check
  /* eslint-env node */
  
  const child_process = require('child_process');
  const fs = require('fs');
  
  const Serve = require('ember-cli/lib/commands/serve');
  const Builder = require('ember-cli/lib/models/builder');
  const Watcher = require('ember-cli/lib/models/watcher');
  
  const OUT_DIR = '.e-c-ts';
  
  /**
   * Exclude .ts files from being watched
   */
  function filterTS(name) {
    if (name.startsWith('.')) {
      // these files are filtered by default
      return false;
    }
  
    // typescript sources are watched by `tsc --watch` instead
    return !name.endsWith('.ts');
  }
  
  class WatcherNonTS extends Watcher {
    buildOptions() {
      let options = super.buildOptions();
      options.filter = filterTS;
      return options;
    }
  }
  
  module.exports = Serve.extend({
    name: 'serve-ts',
    aliases: [],
  
    run(options) {
      this.project._isRunningServeTS = true;
  
      const builder = new Builder({
        ui: this.ui,
        outputPath: options.outputPath,
        project: this.project,
        environment: options.environment,
      });
  
      const watcher = new WatcherNonTS({
        ui: this.ui,
        builder,
        analytics: this.analytics,
        options,
        serving: true,
      });
  
      options._builder = builder;
      options._watcher = watcher;
  
      // TODO: typescript might be installed globally?
      const tsc = child_process.fork('node_modules/typescript/bin/tsc', [
        '--watch',
        '--outDir', '.e-c-ts',
        '--allowJs', 'false',
        '--noEmit', 'false',
        '--sourceMap', 'false', // TODO: enable if sourcemaps=true
      ], {
        silent: true, // TODO: stdout is messy
        execArgv: []
      });
  
      // TODO: clean up child process
  
      return Serve.prototype.run.call(this, options);
    }
  });
  
new_contents: // @ts-check
  /* eslint-env node */
  
  const child_process = require('child_process');
  const fs = require('fs');
  
  const Serve = require('ember-cli/lib/commands/serve');
  const Builder = require('ember-cli/lib/models/builder');
  const Watcher = require('ember-cli/lib/models/watcher');
  
  const OUT_DIR = '.e-c-ts';
  
  /**
   * Exclude .ts files from being watched
   */
  function filterTS(name) {
    if (name.startsWith('.')) {
      // these files are filtered by default
      return false;
    }
  
    // typescript sources are watched by `tsc --watch` instead
    return !name.endsWith('.ts');
  }
  
  class WatcherNonTS extends Watcher {
    buildOptions() {
      let options = super.buildOptions();
      options.filter = filterTS;
      return options;
    }
  }
  
  module.exports = Serve.extend({
    name: 'serve-ts',
    aliases: [],
  
    run(options) {
      this.project._isRunningServeTS = true;
  
      const builder = new Builder({
        ui: this.ui,
        outputPath: options.outputPath,
        project: this.project,
        environment: options.environment,
      });
  
      const watcher = new WatcherNonTS({
        ui: this.ui,
        builder,
        analytics: this.analytics,
        options,
        serving: true,
      });
  
      options._builder = builder;
      options._watcher = watcher;
  
      // TODO: typescript might be installed globally?
      // argument sequence here is meaningful; don't apply prettier.
      // prettier-ignore
      const tsc = child_process.fork(
        'node_modules/typescript/bin/tsc',
        [
          '--watch',
          '--outDir', OUT_DIR,
          '--allowJs', 'false',
          '--noEmit', 'false',
          '--sourceMap', 'false', // TODO: enable if sourcemaps=true
        ],
        {
          silent: true, // TODO: stdout is messy
          execArgv: [],
        }
      );
  
      // TODO: clean up child process
  
      return Serve.prototype.run.call(this, options);
    },
  
    onInterrupt() {
      if (fs.existsSync(OUT_DIR)) fs.rmdirSync(OUT_DIR);
    },
  });
  
subject: Implement cleanup of `.e-c-ts` dir.