"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.updateTsConfig = void 0;
const schematics_1 = require("@angular-devkit/schematics");
const json_file_1 = require("./helpers/json-file");
const JSON5 = require('json5');
const updateTsConfig = (tree, _options) => {
    const tsConfig = new json_file_1.JSONFile(tree, "tsconfig.json");
    if (!tsConfig) {
        throw new schematics_1.SchematicsException("No typescrit config fie");
    }
    const pathString = [`${_options.sourceRoot}/app/dapp-injector/index.ts`];
    tsConfig.modify(['compilerOptions', 'paths', 'angular-web3'], pathString);
    tsConfig.modify(['compilerOptions', 'paths', "crypto"], ["./node_modules/crypto-browserify"]),
        tsConfig.modify(['compilerOptions', 'paths', "stream"], ["./node_modules/stream-browserify"]),
        tsConfig.modify(['compilerOptions', 'paths', "assert"], ["./node_modules/assert"]),
        tsConfig.modify(['compilerOptions', 'paths', "http"], ["./node_modules/stream-http"]),
        tsConfig.modify(['compilerOptions', 'paths', "https"], ["./node_modules/https-browserify"]),
        tsConfig.modify(['compilerOptions', 'paths', "os"], ["./node_modules/os-browserify"]),
        tsConfig.modify(['compilerOptions', 'paths', "url"], ["./node_modules/url"]);
    tsConfig.modify(['compilerOptions', 'skipLibCheck'], true);
    tsConfig.modify(['compilerOptions', 'noPropertyAccessFromIndexSignature'], false);
    return tree;
};
exports.updateTsConfig = updateTsConfig;
//# sourceMappingURL=updateTsConfig.js.map