"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
    function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
    return new (P || (P = Promise))(function (resolve, reject) {
        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
        function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
        function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
        step((generator = generator.apply(thisArg, _arguments || [])).next());
    });
};
Object.defineProperty(exports, "__esModule", { value: true });
const cli_core_1 = require("@igniteui/cli-core");
const fs = require("fs-extra");
const path = require("path");
class EmptyProject {
    constructor() {
        this.id = "jquery";
        this.name = "jquery with Javascript";
        this.description = "Ignite UI CLI project for jQuery";
        this.framework = "jquery";
        this.projectType = "js";
        this.hasExtraConfiguration = false;
        this.routesFile = "bs-routes.json";
        this.delimiters = cli_core_1.defaultDelimiters;
    }
    get templatePaths() {
        return [path.join(__dirname, "files")];
    }
    upgradeIgniteUIPackages(projectPath, packagePath) {
        return __awaiter(this, void 0, void 0, function* () {
            const filePath = path.join(projectPath, this.routesFile);
            const routes = fs.readFileSync(path.join(projectPath, this.routesFile), "utf8");
            const config = JSON.parse(routes);
            delete config.routes["/ignite-ui/js/infragistics.core.js"];
            delete config.routes["/ignite-ui/js/infragistics.lob.js"];
            config.routes["/ignite-ui"] = packagePath;
            fs.writeFileSync(filePath, JSON.stringify(config, null, 4));
            return true;
        });
    }
    generateConfig(name, theme, ...options) {
        let themePath = "";
        if (theme.indexOf(".less") !== -1 || theme.indexOf(".scss") !== -1) {
            themePath = ".themes/" + theme.split(".")[0] + "/infragistics.theme.css";
        }
        else {
            themePath = "$(igniteuiSource)/css/themes/" + theme + "/infragistics.theme.css";
        }
        return {
            name,
            theme,
            themePath,
            "cliVersion": cli_core_1.Util.version(),
            "dash-name": cli_core_1.Util.lowerDashed(name),
            "description": this.description,
            "dot": ".",
            "igniteuiSource": "./node_modules/ignite-ui"
        };
    }
    installModules() {
        throw new Error("Method not implemented.");
    }
    getExtraConfiguration() {
        return [];
    }
    setExtraConfiguration(extraConfigKeys) { }
}
module.exports = new EmptyProject();
