UNPKG

@o3r/rules-engine

Version:

This module provides a rule engine that can be executed on your Otter application to customize your application (translations, placeholders and configs) based on a json file generated by your CMS.

35 lines 1.49 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.registerDevtools = void 0; const tslib_1 = require("tslib"); const node_fs_1 = require("node:fs"); const path = tslib_1.__importStar(require("node:path")); const schematics_1 = require("@angular-devkit/schematics"); const schematics_2 = require("@o3r/schematics"); const DEVTOOL_MODULE_NAME = 'RulesEngineDevtoolsModule'; const MESSAGE_DEVTOOL_SERVICE_NAME = 'RulesEngineDevtoolsMessageService'; const CONSOLE_DEVTOOL_SERVICE_NAME = 'RulesEngineDevtoolsConsoleService'; const PACKAGE_NAME = JSON.parse((0, node_fs_1.readFileSync)(path.resolve(__dirname, '..', '..', '..', 'package.json'), { encoding: 'utf8' })).name; /** * Register Devtools to the application * @param options * @param options.projectName */ const registerDevtools = (options) => { return (0, schematics_1.chain)([ (0, schematics_2.registerDevtoolsToApplication)({ moduleName: DEVTOOL_MODULE_NAME, packageName: PACKAGE_NAME, serviceName: MESSAGE_DEVTOOL_SERVICE_NAME, projectName: options.projectName }), (0, schematics_2.registerDevtoolsToApplication)({ moduleName: DEVTOOL_MODULE_NAME, packageName: PACKAGE_NAME, serviceName: CONSOLE_DEVTOOL_SERVICE_NAME, projectName: options.projectName }) ]); }; exports.registerDevtools = registerDevtools; //# sourceMappingURL=devtools-registration.js.map