UNPKG

@fontoxml/fontoxml-development-tools

Version:

Development tools for Fonto.

101 lines (85 loc) 2.95 kB
import path from 'path'; /** @typedef {import('../shared/src/addBackendDockerCommands').AddBackendDockerCommandsOptions} AddBackendDockerCommandsOptions */ export default async (moduleRegistration) => { /** @type {AddBackendDockerCommandsOptions} */ const options = { licenseProductName: 'spell-checker', licensesRequired: ['editor'], productLabel: 'Fonto Spell Checker', commandPrefix: 'spell-checker', documentationConfigurationGuide: 'https://documentation.fontoxml.com/latest/fontoxml-spell-checker-4428b1080ce1', documentationExecuteError: 'https://documentation.fontoxml.com/latest/fontoxml-spell-checker-4428b1080ce1', documentationGettingStartedGuide: 'https://documentation.fontoxml.com/latest/fontoxml-spell-checker-4428b1080ce1', defaultHttpPort: 6050, defaultImageName: 'fonto-spell-checker', defaultImageTag: 'latest', manifestFileName: '.fontoxmlSpellCheckerManifest', manifestVersionPropertyName: 'spellCheckerVersion', 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: '.spellCheckerTmp', temporaryBuildDirectoryName: '.spellCheckerBuildTmp', whitelist: [ // 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); };