UNPKG

@fontoxml/fontoxml-development-tools

Version:

Development tools for Fonto.

83 lines (70 loc) 2.78 kB
import path from 'path'; import commandAddons from '../editor-pre-7-7-0/src/command.addons.js'; import commandInit from '../editor-pre-7-7-0/src/command.init.js'; import commandSchemaCompile from '../editor-pre-7-7-0/src/command.schema.compile.js'; import commandUpgrade from '../editor-pre-7-7-0/src/command.upgrade.js'; import commandVersion from '../editor-pre-7-7-0/src/command.version.js'; import commandVersions from '../editor-pre-7-7-0/src/command.versions.js'; import commandBuild from './src/commands/command.build.js'; import commandConvertEditor from './src/commands/command.convert.editor.js'; import commandConvertPackage from './src/commands/command.convert.package.js'; import commandRun from './src/commands/command.run.js'; export default (moduleRegistration) => { const editorCommand = moduleRegistration .registerCommand('editor') .setDescription( 'Tools for creating, upgrading, building, and running Fonto Editor.' ) .addRequiredProductLicenses(['editor']) .setHideIfMissingRequiredProductLicenses() .setAsHelpCommand(); // The current ModuleRegistration could be either editor or editor-pre-7-7-0. But for some // commands the editor-pre-7-7-0 path is needed. const editorPre770ModulePath = path.resolve( moduleRegistration.getPath(), '..', 'editor-pre-7-7-0', ); commandAddons(moduleRegistration, editorCommand, editorPre770ModulePath); commandInit(moduleRegistration, editorCommand, editorPre770ModulePath); commandUpgrade(moduleRegistration, editorCommand, editorPre770ModulePath); commandBuild(moduleRegistration, editorCommand); commandRun(moduleRegistration, editorCommand); commandVersion(moduleRegistration, editorCommand, editorPre770ModulePath); commandVersions(moduleRegistration, editorCommand, editorPre770ModulePath); // Editor convert commands const convertCommand = editorCommand .addHiddenCommand('convert-for-770') .setDescription( 'Tools for converting from pre Fonto 7.7.0 to a Fonto 7.7.0 codebase.' ) .setAsHelpCommand(); commandConvertEditor(moduleRegistration, convertCommand); commandConvertPackage(moduleRegistration, convertCommand); // Editor schema commands const schemaCommand = editorCommand .addCommand('schema') .setDescription('Tools for compiling the schema.') .setAsHelpCommand(); commandSchemaCompile( moduleRegistration, schemaCommand, editorPre770ModulePath, ); // Register the exports for this module. moduleRegistration.registerExport( 'downloadEditorSDK', path.resolve( moduleRegistration.getPath(), '..', 'editor-pre-7-7-0', 'src', 'api', 'downloadEditorSDK.js', ), ); moduleRegistration.registerExport( 'getWebpackConfig', path.resolve(moduleRegistration.getPath(), 'src', 'getWebpackConfig.js'), ); };