UNPKG

@fontoxml/fontoxml-development-tools

Version:

Development tools for Fonto.

104 lines (88 loc) 3.03 kB
import path from 'path'; /** @typedef {import('../shared/src/addBackendDockerCommands').AddBackendDockerCommandsOptions} AddBackendDockerCommandsOptions */ export default async (moduleRegistration) => { /** @type {AddBackendDockerCommandsOptions} */ const options = { licenseProductName: 'document-history', licensesRequired: ['document-history'], productLabel: 'Fonto Document History', commandPrefix: 'document-history', commandAlias: 'fdh', documentationConfigurationGuide: 'https://documentation.fontoxml.com/latest/fonto-document-history-5a117c375303', documentationExecuteError: 'https://documentation.fontoxml.com/latest/fonto-document-history-5a117c375303', documentationGettingStartedGuide: 'https://documentation.fontoxml.com/latest/fonto-document-history-5a117c375303', defaultHttpPort: 6030, defaultImageName: 'fonto-document-history', defaultImageTag: 'latest', manifestFileName: '.fontoxmlFdhManifest', manifestVersionPropertyName: 'fdhVersion', instanceBuildDockerfilePath: path.join( moduleRegistration.getPath(), 'assets', 'instanceBuild', 'Dockerfile', ), instanceDevBuildDirectoryPath: path.join( moduleRegistration.getPath(), 'assets', 'instanceDevBuild', ), instanceDevBuildDockerfilePath: path.join( moduleRegistration.getPath(), 'assets', 'instanceBuild', 'Dockerfile', ), instanceTemplateDirectoryPath: path.join( moduleRegistration.getPath(), 'assets', 'instanceTemplate', ), requiredConfiguration: ['Configuration'], temporaryDirectoryName: '.documentHistoryTmp', temporaryBuildDirectoryName: '.documentHistoryBuildTmp', whitelist: [ // Required. 'Configuration', // Optional. 'nlog.config', ], debugEnvEntries: { Logging__LogLevel__Default: 'Trace', }, }; const command = moduleRegistration .registerCommand(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); };