"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const schematics_1 = require("@angular-devkit/schematics");
function default_1(options) {
    if (!options.overwrite)
        options.overwrite = false;
    return schematics_1.chain([
        // (tree, context) => {
        //   if (!options.dryRun) {
        //     // We need to remove package.json files before starting new generation
        //     // as if npm install is perform during schematics rules, it will perform install
        //     // against the old package.json file, not the new one
        //     const filesToClean = ['package.json', 'package-lock.json'];
        //     for (const fileToClean of filesToClean) {
        //       if (existsSync(fileToClean)) {
        //         context.logger.warn(`Cleaning existing file: ${fileToClean}`)
        //         unlinkSync(fileToClean);
        //       }
        //       // if (tree.exists(fileToClean)) { tree.delete(fileToClean); }
        //     }
        //   }
        // },
        schematics_1.schematic('app-config', {
            // TODO app name 
            // options.appName
            overwrite: options.overwrite,
            appConfig: options.appConfig,
            tapConfig: options.tapConfig,
            config: options.config,
            configJson: options.configJson,
            rebuild: options.rebuild
        }),
        schematics_1.schematic('generate', {
            overwrite: options.overwrite,
            dryRun: options.dryRun,
            skipInstall: options.skipInstall
        }),
        schematics_1.schematic('pwa', {
            overwrite: true,
            skipInstall: options.skipInstall
        })
    ]);
}
exports.default = default_1;
//# sourceMappingURL=index.js.map