"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const schematics_1 = require("@angular-devkit/schematics");
const angular_utility_1 = require("../../lib/angular-utility");
const core_1 = require("@angular-devkit/core");
// import { ScopedTree } from '@angular-devkit/schematics/src/tree/scoped';
// options?: WorkspaceOptions
function default_1(_options) {
    if (!_options.overwrite)
        _options.overwrite = true;
    let appName = _options.name;
    return schematics_1.chain([
        // async (_: Tree, _co: any) => await runIonicStart(_options.name, _options.id || 'com.iotize.myapp'),
        angular_utility_1.applyWithOverwriteRule(schematics_1.url('./files'), [
            schematics_1.template(Object.assign({ appName }, core_1.strings)),
            schematics_1.move(_options.name)
        ], _options.overwrite)
        // applyToSubtree(_options.name, [
        //   schematic('init', _options),
        //   schematic('app', _options),
        //   schematic('pwa', _options),
        //   schematic('add-cordova', _options),
        //   schematic('update-cordova-config', _options),
        //   schematic('tap-connect', _options),
        //   schematic('monitoring', _options),
        // ])
    ]);
}
exports.default = default_1;
/**
 * It creates a new ionic project with cordova integration
 * @param appName
 * @param appId
 */
// async function runIonicStart(appName: string, appId: string) {
//   let cmdinputs: CommandLineInputs = [
//     appName,
//     'blank'
//   ];
//   let cmdoptions: CommandLineOptions = {
//     'package-id': appId,
//     git: true,
//     cordova: false
//   };
//   return runIonicCommand((namespace) => new StartCommand(namespace), cmdinputs, cmdoptions);
// }
//# sourceMappingURL=index.js.map