"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = default_1;
const tslib_1 = require("tslib");
const devkit_1 = require("@nx/devkit");
const path = require("path");
function default_1(tree, schema) {
    return tslib_1.__awaiter(this, void 0, void 0, function* () {
        const normalizedNames = (0, devkit_1.names)(schema.name);
        const targetDir = (0, devkit_1.joinPathFragments)('libs', 'modules');
        (0, devkit_1.generateFiles)(tree, path.join(__dirname, 'files'), targetDir, Object.assign(Object.assign(Object.assign({}, schema), normalizedNames), { tmpl: '' }));
        // Define the new path entry
        const newPath = `@acorex/modules/${normalizedNames.fileName}`;
        const newPathValue = [`libs/modules/${normalizedNames.fileName}/src/index.ts`];
        // Update tsconfig.base.json to include the new path
        (0, devkit_1.updateJson)(tree, 'tsconfig.base.json', (json) => {
            if (!json.compilerOptions.paths) {
                json.compilerOptions.paths = {};
            }
            json.compilerOptions.paths[newPath] = newPathValue;
            return json;
        });
    });
}
//# sourceMappingURL=generator.js.map