UNPKG

@rxap/schematics-ts-morph

Version:

This package provides utilities for manipulating TypeScript code using ts-morph, particularly for Angular and NestJS projects. It offers functions to add, coerce, and modify code elements like classes, methods, decorators, and imports. The package also in

37 lines 1.53 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.CoerceNestServiceProject = CoerceNestServiceProject; const schematics_1 = require("@angular-devkit/schematics"); const schematics_utilities_1 = require("@rxap/schematics-utilities"); const workspace_utilities_1 = require("@rxap/workspace-utilities"); /** * @deprecated removed use the AssertNestProject function Rule */ function CoerceNestServiceProject(options) { const { project, feature, shared, } = options; return tree => { if (!(0, workspace_utilities_1.HasNestServiceProject)(tree, options)) { console.log(`The nest service project '${(0, workspace_utilities_1.buildNestProjectName)(options)}' does not exists. Project will now be created ...`); if (feature) { if (shared) { return (0, schematics_utilities_1.ExecuteSchematic)('feature-microservice', { feature, }); } else { return (0, schematics_utilities_1.ExecuteSchematic)('frontend-microservice', { frontend: project, feature, }); } } else { return (0, schematics_utilities_1.ExecuteSchematic)('microservice', { project, }); } } return (0, schematics_1.noop)(); }; } //# sourceMappingURL=coerce-nest-service-project.js.map