@o3r/configuration
Version:
This module contains configuration-related features such as CMS compatibility, Configuration override, store and debugging. It enables your application runtime configuration and comes with an integrated ng builder to help you generate configurations suppo
33 lines • 1.41 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.registerDevtools = void 0;
const node_fs_1 = require("node:fs");
const path = require("node:path");
const schematics_1 = require("@angular-devkit/schematics");
const schematics_2 = require("@o3r/schematics");
const DEVTOOL_MODULE_NAME = 'ConfigurationDevtoolsModule';
const MESSAGE_DEVTOOL_SERVICE_NAME = 'ConfigurationDevtoolsMessageService';
const CONSOLE_DEVTOOL_SERVICE_NAME = 'ConfigurationDevtoolsConsoleService';
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
*/
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