hunk.code_window:     },
       "skipInstall": {
         "description": "Skip installing dependency packages.",
         "type": "boolean",
         "default": false
       }
     },
     "required": [
       "name"
     ]
  
hunk.labels: keep keep keep keep add keep keep keep keep keep
hunk.after_edit:     },
       "lintFix": {
         "type": "boolean",
         "default": false,
         "description": "When true, applies lint fixes after generating the application."
  
hunk.file_path: packages/schematics/angular/application/schema.json
hunk.type: add
file: /**
  * @license
  * Copyright Google Inc. All Rights Reserved.
  *
  * Use of this source code is governed by an MIT-style license that can be
  * found in the LICENSE file at https://angular.io/license
  */
  import { normalize, strings } from '@angular-devkit/core';
  import {
    Rule,
    SchematicsException,
    Tree,
    apply,
    branchAndMerge,
    chain,
    filter,
    mergeWith,
    move,
    noop,
    template,
    url,
  } from '@angular-devkit/schematics';
  import * as ts from 'typescript';
  import { addImportToModule } from '../utility/ast-utils';
  import { InsertChange } from '../utility/change';
  import { buildRelativePath, findModuleFromOptions } from '../utility/find-module';
  import { parseName } from '../utility/parse-name';
  import { buildDefaultPath, getProject } from '../utility/project';
  import { Schema as ModuleOptions } from './schema';
  
  
  function addDeclarationToNgModule(options: ModuleOptions): Rule {
    return (host: Tree) => {
      if (!options.module) {
        return host;
      }
  
      const modulePath = options.module;
  
      const text = host.read(modulePath);
      if (text === null) {
        throw new SchematicsException(`File ${modulePath} does not exist.`);
      }
      const sourceText = text.toString('utf-8');
      const source = ts.createSourceFile(modulePath, sourceText, ts.ScriptTarget.Latest, true);
  
      const importModulePath = normalize(
        `/${options.path}/`
        + (options.flat ? '' : strings.dasherize(options.name) + '/')
        + strings.dasherize(options.name)
        + '.module',
      );
      const relativePath = buildRelativePath(modulePath, importModulePath);
      const changes = addImportToModule(source,
                                        modulePath,
                                        strings.classify(`${options.name}Module`),
                                        relativePath);
  
      const recorder = host.beginUpdate(modulePath);
      for (const change of changes) {
        if (change instanceof InsertChange) {
          recorder.insertLeft(change.pos, change.toAdd);
        }
      }
      host.commitUpdate(recorder);
  
      return host;
    };
  }
  
  export default function (options: ModuleOptions): Rule {
    return (host: Tree) => {
      if (!options.project) {
        throw new SchematicsException('Option (project) is required.');
      }
      const project = getProject(host, options.project);
  
      if (options.path === undefined) {
        options.path = buildDefaultPath(project);
      }
  
      if (options.module) {
        options.module = findModuleFromOptions(host, options);
      }
  
      const parsedPath = parseName(options.path, options.name);
      options.name = parsedPath.name;
      options.path = parsedPath.path;
  
      const templateSource = apply(url('./files'), [
        options.routing ? noop() : filter(path => !path.endsWith('-routing.module.ts')),
        template({
          ...strings,
          'if-flat': (s: string) => options.flat ? '' : s,
          ...options,
        }),
        move(parsedPath.path),
      ]);
  
      return chain([
        branchAndMerge(chain([
          addDeclarationToNgModule(options),
          mergeWith(templateSource),
        ])),
      ]);
    };
  }
  