UNPKG

@fontoxml/fontoxml-development-tools

Version:

Development tools for Fonto.

112 lines (95 loc) 3.18 kB
import path from 'path'; /** @typedef {import('../shared/src/addBackendDockerCommands').AddBackendDockerCommandsOptions} AddBackendDockerCommandsOptions */ export default async (moduleRegistration) => { /** @type {AddBackendDockerCommandsOptions} */ const options = { licenseProductName: 'review', licensesRequired: ['review'], productLabel: 'Fonto Review', commandPrefix: 'review', documentationConfigurationGuide: 'https://documentation.fontoxml.com/latest/configuration-13d2d631668c', documentationExecuteError: 'https://documentation.fontoxml.com/latest/review-9c9f35e6d1bf', documentationGettingStartedGuide: 'https://documentation.fontoxml.com/latest/getting-started-8ca615260377', defaultHttpPort: 6020, defaultImageName: 'fonto-review', defaultImageTag: 'latest', manifestFileName: '.fontoxmlReviewManifest', manifestVersionPropertyName: 'reviewVersion', 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: (version) => { if (version.isPre8_15_0) { return []; } // DEP-??? Backward compatible, change to `return ['Configuration'];` after removal. return []; }, temporaryDirectoryName: '.reviewTmp', temporaryBuildDirectoryName: '.reviewBuildTmp', whitelist: [ // Required. 'Configuration', // DEV-24968 Keep backward compatible. File has been moved into the Configuration directory. 'exports.xml', // 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); };