UNPKG

@fontoxml/fontoxml-development-tools

Version:

Development tools for Fonto.

112 lines (96 loc) 3.1 kB
import path from 'path'; /** @typedef {import('../shared/src/addBackendDockerCommands').AddBackendDockerCommandsOptions} AddBackendDockerCommandsOptions */ export default async (moduleRegistration) => { /** @type {AddBackendDockerCommandsOptions} */ const options = { licenseProductName: 'connectors', licensesRequired: ['connectors'], productLabel: 'Fonto Connectors', commandPrefix: 'connectors', documentationConfigurationGuide: 'http://documentation.fontoxml.com/display/FC/Connectors+configuration', documentationExecuteError: 'http://documentation.fontoxml.com/display/FC/Troubleshooting', documentationGettingStartedGuide: 'http://documentation.fontoxml.com/display/FC/Getting+started', defaultHttpPort: 6010, defaultHttpsPort: 6011, defaultImageName: 'fonto-connectors', defaultImageTag: 'latest', manifestFileName: '.fontoxmlConnectorsManifest', manifestVersionPropertyName: 'connectorsVersion', instanceBuildDockerfilePath: path.join( moduleRegistration.getPath(), 'assets', 'instanceBuild', 'Dockerfile.build' ), instanceDevBuildDirectoryPath: path.join( moduleRegistration.getPath(), 'assets', 'instanceDevBuild' ), instanceDevBuildDockerfilePath: path.join( moduleRegistration.getPath(), 'assets', 'instanceBuild', 'Dockerfile.run' ), instanceTemplateDirectoryPath: path.join( moduleRegistration.getPath(), 'assets', 'instanceTemplate' ), requiredConfiguration: [ 'editor', 'templates', 'documentProcessing.xml', ], temporaryDirectoryName: '.connectorsTmp', temporaryBuildDirectoryName: '.connectorsBuildTmp', whitelist: [ // Required. 'documentProcessing.xml', 'editor', 'processing', 'templates', // Optional 'initializer-files', 'nlog.config', ], debugEnvEntries: { fc__logging__logLevel: 'Trace', }, }; const command = moduleRegistration .registerHiddenCommand(options.commandPrefix) .setDescription( `Provides tools for working with ${options.productLabel}.` ) .addRequiredProductLicenses(options.licensesRequired) .setHideIfMissingRequiredProductLicenses() .setAsHelpCommand(); if (options.commandAlias) { command.addAlias(options.commandAlias); } const sharedModuleName = '@fontoxml/fontoxml-development-tools-module-shared'; // Add the docker based commands. const addBackendDockerCommands = await moduleRegistration.getExportFromModule( sharedModuleName, 'addBackendDockerCommands', ); addBackendDockerCommands(moduleRegistration, command, options); // Add the version commands. const addBackendVersionsCommands = await moduleRegistration.getExportFromModule( sharedModuleName, 'addBackendVersionsCommands', ); addBackendVersionsCommands(moduleRegistration, command, options); // Add the download-self-contained command. const addBackendDownloadSelfContainedCommands = await moduleRegistration.getExportFromModule( sharedModuleName, 'addBackendDownloadSelfContainedCommands', ); addBackendDownloadSelfContainedCommands(moduleRegistration, command, options); };