hunk.code_window: const opn = require('opn');
   export const DocTask: any = Task.extend({
     run: function(keyword: string) {
       const searchUrl = `https://angular.io/docs/ts/latest/api/#!?query=${keyword}`;
       return opn(searchUrl, { wait: false });
     }
   });
hunk.labels: keep keep keep replace replace keep keep keep
hunk.after_edit:   run: function(keyword: string, search: boolean) {
       const searchUrl = search ? `https://angular.io/search/#stq=${keyword}&stp=1` :
        `https://angular.io/docs/ts/latest/api/#!?query=${keyword}`;
  
hunk.file_path: packages/@angular/cli/tasks/doc.ts
hunk.type: replace
file: import {ng} from '../../../utils/process';
  import {appendToFile, expectFileToMatch, prependToFile, replaceInFile} from '../../../utils/fs';
  import {expectToFail} from '../../../utils/utils';
  
  export default function() {
    return ng('generate', 'component', 'test-component', '--module', 'app.module.ts')
      .then(() => prependToFile('src/app/test-component/test-component.component.ts', `
        import { Optional, SkipSelf } from '@angular/core';
      `))
      .then(() => replaceInFile('src/app/test-component/test-component.component.ts',
        /constructor.*/, `
          constructor(@Optional() @SkipSelf() public test: TestComponentComponent) {
            console.log(test);
          }
        `))
      .then(() => appendToFile('src/app/app.component.html', `
        <app-test-component></app-test-component>
      `))
      .then(() => ng('build', '--aot'))
      .then(() => expectToFail(() => expectFileToMatch('dist/main.bundle.js', /\bComponent\b/)))
      // Check that the decorators are still kept.
      .then(() => expectFileToMatch('dist/main.bundle.js', /ctorParameters.*Optional.*SkipSelf/))
      .then(() => expectToFail(() => expectFileToMatch('dist/main.bundle.js', /\bNgModule\b/)));
  }
  