UNPKG

@fontoxml/fontoxml-development-tools

Version:

Development tools for Fonto.

100 lines (85 loc) 2.72 kB
import path from 'path'; export default async (moduleRegistration) => { 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: [], temporaryDirectoryName: '.reviewTmp', temporaryBuildDirectoryName: '.reviewBuildTmp', whitelist: [ // Required. '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); };