"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const schematics_1 = require("@angular-devkit/schematics");
const schema_1 = require("@schematics/angular/ng-new/schema");
const lib_1 = require("../../lib");
const strings_1 = require("@angular-devkit/core/src/utils/strings");
// You don't have to export the function as default. You can also have more than one rule factory
// per file.
// This is the factory function 
function default_1(_options) {
    _options.style = _options.style || schema_1.Style.Scss;
    _options.routing = _options.routing || (_options.routing === undefined);
    if (!_options.name) {
        let tapConfig = lib_1.loadTapConfigFromFilePath(_options.tapConfig);
        _options.name = strings_1.dasherize(tapConfig.config.application.name);
    }
    // let generateTapLibOptions: GenerateTapLibOptions = {
    //     name: 'pages/monitoring-page'
    // }
    // console.log('generateTapLibOptions', generateTapLibOptions);
    // Here we returns the rule
    // The tree is then virtual representation of every file in the workspace. 
    // Using a virtual tree instead of manipulating files directly comes with a couple of big advantages.
    // let newSource = apply(empty(), [
    //     externalSchematic('@schematics/angular', 'ng-new', _options)
    // ]);
    return schematics_1.chain([
        schematics_1.externalSchematic('@schematics/angular', 'ng-new', _options),
    ]);
}
exports.default = default_1;
//# sourceMappingURL=index.js.map