@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
18 lines • 1.45 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.AssertNestProject = AssertNestProject;
const schematics_1 = require("@angular-devkit/schematics");
require("colors");
const workspace_utilities_1 = require("@rxap/workspace-utilities");
function AssertNestProject(options) {
const { project, feature, shared, backend } = options;
return tree => {
if (!(0, workspace_utilities_1.HasNestServiceProject)(tree, { project, feature, shared, backend })) {
// TODO : run the commands on the fly instead of throwing an error
console.log('Use the command: ' + `nx g @nx/nest:application --projectNameAndRootFormat as-provided --name ${(0, workspace_utilities_1.buildNestProjectName)({ project, feature, shared, backend })} --directory ${(0, workspace_utilities_1.buildNestProjectDirectoryPath)({ project, feature, shared, backend })}`.blue + ' to create the required nest project');
console.log('Use the command: ' + `nx g @rxap/plugin-nestjs:init-application --project ${(0, workspace_utilities_1.buildNestProjectName)({ project, feature, shared, backend })} --generateMain --overwrite`.blue + ' to initialize the nest project');
throw new schematics_1.SchematicsException(`The project ${(0, workspace_utilities_1.buildNestProjectName)({ project, feature, shared, backend })} does not exists!`);
}
};
}
//# sourceMappingURL=assert-nest-project.js.map