@nestjs-mod/schematics
Version:
The Nx Plugin for NestJS that contains executors and generators for allowing your workspace to create NestJS-mod applications
34 lines • 1.62 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.libraryGenerator = libraryGenerator;
exports.libraryGeneratorInternal = libraryGeneratorInternal;
const devkit_1 = require("@nx/devkit");
const js_1 = require("@nx/js");
const add_dependencies_1 = require("../init/lib/add-dependencies");
const add_exports_to_barrel_1 = require("./lib/add-exports-to-barrel");
const add_project_1 = require("./lib/add-project");
const create_files_1 = require("./lib/create-files");
const delete_files_1 = require("./lib/delete-files");
const normalize_options_1 = require("./lib/normalize-options");
const update_tsconfig_1 = require("./lib/update-tsconfig");
async function libraryGenerator(tree, rawOptions) {
return await libraryGeneratorInternal(tree, {
...rawOptions,
});
}
async function libraryGeneratorInternal(tree, rawOptions) {
const options = await (0, normalize_options_1.normalizeOptionsLib)(tree, rawOptions);
await (0, js_1.libraryGenerator)(tree, (0, normalize_options_1.toJsLibraryGeneratorOptions)(options));
const installDepsTask = (0, add_dependencies_1.addDependencies)(tree);
(0, delete_files_1.deleteFiles)(tree, options);
(0, create_files_1.createFilesLib)(tree, options);
(0, add_exports_to_barrel_1.addExportsToBarrelFile)(tree, options);
(0, update_tsconfig_1.updateTsConfigLib)(tree, options);
(0, add_project_1.addProjectLib)(tree, options);
if (!options.skipFormat) {
await (0, devkit_1.formatFiles)(tree);
}
return installDepsTask;
}
exports.default = libraryGenerator;
//# sourceMappingURL=library.js.map