@fontoxml/fontoxml-development-tools 3.7.0-beta.6 → 3.8.0-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/{.eslintrc.js → .eslintrc.cjs} +0 -0
- package/{.prettierrc.js → .prettierrc.cjs} +0 -0
- package/bin/development-tools.js +8 -8
- package/index.js +4 -6
- package/npm-shrinkwrap.json +4790 -8570
- package/package.json +2 -1
- package/src/App.js +60 -36
- package/src/AssertableWritableStream.js +4 -9
- package/src/ConfigManager.js +3 -7
- package/src/EditorRepository.js +15 -16
- package/src/FdtCommand.js +12 -33
- package/src/FdtLicense.js +8 -14
- package/src/FdtTable.js +4 -8
- package/src/ModuleRegistrationApi.js +14 -12
- package/src/addCoreModulesToApp.js +7 -5
- package/src/addModulesToApp.js +46 -28
- package/src/createConfigFileInHomedir.js +4 -6
- package/src/editorVersions.js +4 -10
- package/src/enrichRequestObject.js +11 -7
- package/src/getParentDirectoryContainingFileSync.js +4 -6
- package/src/modules/connectors/index.js +13 -10
- package/src/modules/connectors/package.json +2 -1
- package/src/modules/connectors/src/command.build.controller.js +13 -15
- package/src/modules/connectors/src/command.build.js +11 -4
- package/src/modules/connectors/src/command.download-self-contained.controller.js +6 -8
- package/src/modules/connectors/src/command.download-self-contained.js +10 -3
- package/src/modules/connectors/src/command.init.controller.js +7 -9
- package/src/modules/connectors/src/command.init.js +10 -3
- package/src/modules/connectors/src/command.run.controller.js +14 -16
- package/src/modules/connectors/src/command.run.js +8 -4
- package/src/modules/connectors/src/command.upgrade.controller.js +7 -9
- package/src/modules/connectors/src/command.upgrade.js +10 -3
- package/src/modules/connectors/src/command.versions.controller.js +2 -4
- package/src/modules/connectors/src/command.versions.js +10 -3
- package/src/modules/connectors/src/utilities/FontoxmlConnectorsManifest.js +2 -6
- package/src/modules/connectors/src/utilities/cleanup.js +6 -8
- package/src/modules/connectors/src/utilities/constants.js +5 -3
- package/src/modules/connectors/src/utilities/copyWhitelistedFiles.js +4 -6
- package/src/modules/connectors/src/utilities/executeAndLog.js +4 -5
- package/src/modules/connectors/src/utilities/getVerbosityLevel.js +3 -5
- package/src/modules/connectors/src/utilities/getWhitelist.js +5 -7
- package/src/modules/connectors/src/utilities/setEntryVisibility.js +3 -14
- package/src/modules/connectors/src/utilities/validateInstance.js +5 -7
- package/src/modules/content-quality/index.js +14 -11
- package/src/modules/content-quality/package.json +2 -1
- package/src/modules/content-quality/src/command.build.controller.js +13 -15
- package/src/modules/content-quality/src/command.build.js +11 -4
- package/src/modules/content-quality/src/command.download-self-contained.controller.js +6 -8
- package/src/modules/content-quality/src/command.download-self-contained.js +11 -4
- package/src/modules/content-quality/src/command.init.controller.js +7 -9
- package/src/modules/content-quality/src/command.init.js +11 -4
- package/src/modules/content-quality/src/command.run.controller.js +13 -15
- package/src/modules/content-quality/src/command.run.js +8 -4
- package/src/modules/content-quality/src/command.upgrade.controller.js +7 -9
- package/src/modules/content-quality/src/command.upgrade.js +11 -4
- package/src/modules/content-quality/src/command.versions.controller.js +2 -4
- package/src/modules/content-quality/src/command.versions.js +10 -3
- package/src/modules/content-quality/src/utilities/FontoxmlFcqManifest.js +2 -6
- package/src/modules/content-quality/src/utilities/cleanup.js +6 -8
- package/src/modules/content-quality/src/utilities/constants.js +5 -3
- package/src/modules/content-quality/src/utilities/copyWhitelistedFiles.js +4 -6
- package/src/modules/content-quality/src/utilities/executeAndLog.js +4 -5
- package/src/modules/content-quality/src/utilities/getVerbosityLevel.js +3 -5
- package/src/modules/content-quality/src/utilities/getWhitelist.js +5 -7
- package/src/modules/content-quality/src/utilities/setEntryVisibility.js +3 -14
- package/src/modules/content-quality/src/utilities/validateInstance.js +5 -7
- package/src/modules/core/index.js +14 -18
- package/src/modules/core/package.json +2 -1
- package/src/modules/core/src/command.fdt.js +1 -3
- package/src/modules/core/src/command.license.validate.js +1 -3
- package/src/modules/core/src/command.module.js +6 -8
- package/src/modules/core/src/command.who.js +6 -4
- package/src/modules/core/src/precontroller.debug.js +2 -3
- package/src/modules/core/src/precontroller.help.js +7 -5
- package/src/modules/document-history/index.js +17 -8
- package/src/modules/document-history/instanceBuild/Dockerfile +4 -0
- package/src/modules/document-history/instanceDevBuild/.env +2 -0
- package/src/modules/document-history/instanceDevBuild/docker-compose.yml +9 -0
- package/src/modules/document-history/instanceTemplate/.env +7 -0
- package/src/modules/document-history/instanceTemplate/Configuration/sx.xml +4 -0
- package/src/modules/document-history/package.json +2 -1
- package/src/modules/document-history/src/command.build.controller.js +260 -0
- package/src/modules/document-history/src/command.build.js +56 -0
- package/src/modules/document-history/src/command.download-self-contained.controller.js +6 -8
- package/src/modules/document-history/src/command.download-self-contained.js +10 -3
- package/src/modules/document-history/src/command.init.controller.js +91 -0
- package/src/modules/document-history/src/command.init.js +44 -0
- package/src/modules/document-history/src/command.run.controller.js +444 -0
- package/src/modules/document-history/src/command.run.js +64 -0
- package/src/modules/document-history/src/command.upgrade.controller.js +52 -0
- package/src/modules/document-history/src/command.upgrade.js +44 -0
- package/src/modules/document-history/src/command.versions.controller.js +2 -4
- package/src/modules/document-history/src/command.versions.js +10 -3
- package/src/modules/document-history/src/utilities/FontoxmlFdhManifest.js +30 -0
- package/src/modules/document-history/src/utilities/cleanup.js +70 -0
- package/src/modules/document-history/src/utilities/constants.js +44 -0
- package/src/modules/document-history/src/utilities/copyWhitelistedFiles.js +22 -0
- package/src/modules/document-history/src/utilities/executeAndLog.js +63 -0
- package/src/modules/document-history/src/utilities/getVerbosityLevel.js +11 -0
- package/src/modules/document-history/src/utilities/getWhitelist.js +16 -0
- package/src/modules/document-history/src/utilities/setEntryVisibility.js +22 -0
- package/src/modules/document-history/src/utilities/validateInstance.js +29 -0
- package/src/modules/editor/dev-cms/configureFontoSessionMiddleware.js +1 -5
- package/src/modules/editor/dev-cms/configureScopeMiddleware.js +3 -5
- package/src/modules/editor/dev-cms/connectors-cms-standard/configureAssetGetRouteHandler.js +1 -3
- package/src/modules/editor/dev-cms/connectors-cms-standard/configureAssetPostRouteHandler.js +3 -5
- package/src/modules/editor/dev-cms/connectors-cms-standard/configureAssetPreviewGetRouteHandler.js +1 -3
- package/src/modules/editor/dev-cms/connectors-cms-standard/configureBodyParserMiddleware.js +3 -5
- package/src/modules/editor/dev-cms/connectors-cms-standard/configureBrowsePostRouteHandler.js +1 -3
- package/src/modules/editor/dev-cms/connectors-cms-standard/configureConnectorsCmsStandardAssetRouter.js +5 -9
- package/src/modules/editor/dev-cms/connectors-cms-standard/configureConnectorsCmsStandardBrowseRouter.js +3 -5
- package/src/modules/editor/dev-cms/connectors-cms-standard/configureConnectorsCmsStandardDocumentRouter.js +13 -15
- package/src/modules/editor/dev-cms/connectors-cms-standard/configureConnectorsCmsStandardHeartbeatRouter.js +3 -5
- package/src/modules/editor/dev-cms/connectors-cms-standard/configureConnectorsCmsStandardProxyRouter.js +7 -10
- package/src/modules/editor/dev-cms/connectors-cms-standard/configureConnectorsCmsStandardReferenceRouter.js +5 -7
- package/src/modules/editor/dev-cms/connectors-cms-standard/configureConnectorsCmsStandardReviewRouter.js +10 -16
- package/src/modules/editor/dev-cms/connectors-cms-standard/configureConnectorsCmsStandardRouter.js +3 -5
- package/src/modules/editor/dev-cms/connectors-cms-standard/configureDebugRouteHandler.js +2 -4
- package/src/modules/editor/dev-cms/connectors-cms-standard/configureDevelopmentCmsMiddleware.js +3 -3
- package/src/modules/editor/dev-cms/connectors-cms-standard/configureDocumentCompareRouteHandler.js +2 -4
- package/src/modules/editor/dev-cms/connectors-cms-standard/configureDocumentGetRouteHandler.js +1 -3
- package/src/modules/editor/dev-cms/connectors-cms-standard/configureDocumentHistoryGetRouteHandler.js +2 -4
- package/src/modules/editor/dev-cms/connectors-cms-standard/configureDocumentLockPutRouteHandler.js +1 -5
- package/src/modules/editor/dev-cms/connectors-cms-standard/configureDocumentPostRouteHandler.js +4 -4
- package/src/modules/editor/dev-cms/connectors-cms-standard/configureDocumentPresearchPostRouteHandler.js +3 -7
- package/src/modules/editor/dev-cms/connectors-cms-standard/configureDocumentPreviewRouteHandler.js +2 -6
- package/src/modules/editor/dev-cms/connectors-cms-standard/configureDocumentPutRouteHandler.js +1 -5
- package/src/modules/editor/dev-cms/connectors-cms-standard/configureDocumentRevisionGetRouteHandler.js +2 -6
- package/src/modules/editor/dev-cms/connectors-cms-standard/configureDocumentStatePostRouteHandler.js +1 -5
- package/src/modules/editor/dev-cms/connectors-cms-standard/configureHeartbeatGetRouteHandler.js +1 -5
- package/src/modules/editor/dev-cms/connectors-cms-standard/configureReferenceCreatePostRouteHandler.js +2 -6
- package/src/modules/editor/dev-cms/connectors-cms-standard/configureReferenceGetPostRouteHandler.js +2 -6
- package/src/modules/editor/dev-cms/connectors-cms-standard/configureReferenceMetadataUpdatePatchRouteHandler.js +2 -4
- package/src/modules/editor/dev-cms/connectors-cms-standard/configureReviewAnnotationGetPostRouteHandler.js +4 -9
- package/src/modules/editor/dev-cms/connectors-cms-standard/configureReviewAnnotationPostRouteHandler.js +4 -8
- package/src/modules/editor/dev-cms/connectors-cms-standard/configureReviewAnnotationPutRouteHandler.js +7 -11
- package/src/modules/editor/dev-cms/connectors-cms-standard/configureReviewAnnotationReplyPostRouteHandler.js +3 -7
- package/src/modules/editor/dev-cms/connectors-cms-standard/configureReviewAnnotationReplyPutRouteHandler.js +5 -9
- package/src/modules/editor/dev-cms/connectors-cms-standard/configureReviewStatePostRouteHandler.js +3 -8
- package/src/modules/editor/dev-cms/connectors-cms-standard/configureSimulatedDelayMiddleware.js +1 -3
- package/src/modules/editor/dev-cms/connectors-cms-standard/configureUploadMiddleware.js +4 -6
- package/src/modules/editor/dev-cms/connectors-cms-standard/correlationIdRepository.js +2 -2
- package/src/modules/editor/dev-cms/connectors-cms-standard/createMiddleware.js +25 -18
- package/src/modules/editor/dev-cms/connectors-cms-standard/getFileHash.js +3 -3
- package/src/modules/editor/dev-cms/connectors-cms-standard/referenceRepository.js +10 -3
- package/src/modules/editor/dev-cms/connectors-cms-standard/review-annotations/AnnotationDatabase.js +24 -64
- package/src/modules/editor/dev-cms/connectors-cms-standard/review-annotations/DebuggingConfiguration.js +1 -3
- package/src/modules/editor/dev-cms/connectors-cms-standard/review-annotations/EarlyReturnSymbol.js +1 -1
- package/src/modules/editor/dev-cms/connectors-cms-standard/review-annotations/Result.js +6 -14
- package/src/modules/editor/dev-cms/connectors-cms-standard/review-annotations/httpStatusCodeHelpers.js +13 -7
- package/src/modules/editor/dev-cms/connectors-cms-standard/review-annotations/mapAnnotationResult.js +2 -4
- package/src/modules/editor/dev-cms/connectors-cms-standard/stores/DevelopmentCms.js +6 -6
- package/src/modules/editor/dev-cms/connectors-cms-standard/stores/FileSystemStore.js +6 -6
- package/src/modules/editor/dev-cms/connectors-cms-standard/stores/HistoryStore.js +7 -6
- package/src/modules/editor/dev-cms/connectors-cms-standard/stores/MemoryStore.js +3 -3
- package/src/modules/editor/dev-cms/connectors-cms-standard/stores/mergeItems.js +2 -2
- package/src/modules/editor/dev-cms/connectors-cms-standard/stores/unmergeableRevisionList.js +1 -1
- package/src/modules/editor/dev-cms/connectors-dist/configureAuthMiddleware.js +5 -7
- package/src/modules/editor/dev-cms/connectors-dist/createMiddleware.js +4 -8
- package/src/modules/editor/dev-cms/connectors-health/configureConnectorsHealthRouter.js +3 -7
- package/src/modules/editor/dev-cms/connectors-health/configureHealthGetRouteHandler.js +1 -5
- package/src/modules/editor/dev-cms/connectors-health/createMiddleware.js +2 -6
- package/src/modules/editor/dev-cms/setupDevCms.js +17 -18
- package/src/modules/editor/index.js +20 -24
- package/src/modules/editor/package.json +2 -1
- package/src/modules/editor/src/astHelpers/{addWarningsForRemovedComments.js → addWarningsForRemovedComments.cjs} +0 -0
- package/src/modules/editor/src/astHelpers/{getClosestNodeWithOffset.js → getClosestNodeWithOffset.cjs} +0 -0
- package/src/modules/editor/src/astHelpers/{getDescendantNodes.js → getDescendantNodes.cjs} +0 -0
- package/src/modules/editor/src/astHelpers/{hasMultipleReturnStatements.js → hasMultipleReturnStatements.cjs} +0 -0
- package/src/modules/editor/src/astHelpers/{isAmdDefineCallExpression.js → isAmdDefineCallExpression.cjs} +0 -0
- package/src/modules/editor/src/astHelpers/{isAmdFactoryReturnStatement.js → isAmdFactoryReturnStatement.cjs} +0 -0
- package/src/modules/editor/src/astHelpers/{isInteropDefaultExpressionStatement.js → isInteropDefaultExpressionStatement.cjs} +0 -0
- package/src/modules/editor/src/astHelpers/{isInvalidTextLoaderImportDeclaration.js → isInvalidTextLoaderImportDeclaration.cjs} +0 -0
- package/src/modules/editor/src/astHelpers/{isRequireToUrlCallExpression.js → isRequireToUrlCallExpression.cjs} +0 -0
- package/src/modules/editor/src/astHelpers/{moveComments.js → moveComments.cjs} +0 -0
- package/src/modules/editor/src/babelPlugins/{cleanupRegisterXQueryModulePlugin.js → cleanupRegisterXQueryModulePlugin.cjs} +0 -0
- package/src/modules/editor/src/babelPlugins/{convertAmdToEsmPlugin.js → convertAmdToEsmPlugin.cjs} +0 -0
- package/src/modules/editor/src/babelPlugins/{recastPlugin.js → recastPlugin.cjs} +0 -0
- package/src/modules/editor/src/babelPlugins/{rewriteConfigImportsPlugin.js → rewriteConfigImportsPlugin.cjs} +0 -0
- package/src/modules/editor/src/babelPlugins/{rewriteImportFileExtensionPlugin.js → rewriteImportFileExtensionPlugin.cjs} +0 -0
- package/src/modules/editor/src/babelPlugins/{rewriteInteropDefaultPlugin.js → rewriteInteropDefaultPlugin.cjs} +0 -0
- package/src/modules/editor/src/babelPlugins/{rewriteJsonLoaderPlugin.js → rewriteJsonLoaderPlugin.cjs} +0 -0
- package/src/modules/editor/src/babelPlugins/{rewriteMainJsImportsPlugin.js → rewriteMainJsImportsPlugin.cjs} +0 -0
- package/src/modules/editor/src/babelPlugins/{rewriteSrcPathPlugin.js → rewriteSrcPathPlugin.cjs} +0 -0
- package/src/modules/editor/src/babelPlugins/{rewriteSvgLoaderPlugin.js → rewriteSvgLoaderPlugin.cjs} +0 -0
- package/src/modules/editor/src/babelPlugins/{validatePlugin.js → validatePlugin.cjs} +0 -0
- package/src/modules/editor/src/commands/api/convertEditorWithOutput.js +13 -14
- package/src/modules/editor/src/commands/command.build.controller.js +7 -10
- package/src/modules/editor/src/commands/command.build.js +10 -3
- package/src/modules/editor/src/commands/command.convert.editor.controller.js +7 -9
- package/src/modules/editor/src/commands/command.convert.editor.js +10 -3
- package/src/modules/editor/src/commands/command.convert.package.controller.js +17 -20
- package/src/modules/editor/src/commands/command.convert.package.js +10 -3
- package/src/modules/editor/src/commands/command.run.controller.js +44 -55
- package/src/modules/editor/src/commands/command.run.js +10 -3
- package/src/modules/editor/src/config.js +112 -112
- package/src/modules/editor/src/convert.js +3 -9
- package/src/modules/editor/src/getAppConfig.js +27 -8
- package/src/modules/editor/src/getAppManifest.js +7 -7
- package/src/modules/editor/src/getDependenciesInLoadOrder.js +6 -14
- package/src/modules/editor/src/getImportsForPackages.js +5 -5
- package/src/modules/editor/src/getPatternsForSpecialFileType.js +2 -2
- package/src/modules/editor/src/getWebpackConfig.js +25 -23
- package/src/modules/editor/src/getWebpackDevMiddlewareConfig.js +2 -2
- package/src/modules/editor/src/helpers/WarningsByFilename.js +1 -1
- package/src/modules/editor/src/helpers/mergeIndexPageAndManifest.js +4 -4
- package/src/modules/editor/src/helpers/normalisePath.js +3 -3
- package/src/modules/editor/src/helpers/outputWarningsByFilename.js +4 -4
- package/src/modules/editor/src/helpers/prettifyJsFile.js +3 -6
- package/src/modules/editor/src/helpers/renameJsxFile.js +4 -4
- package/src/modules/editor/src/helpers/transformJsFile.js +24 -10
- package/src/modules/editor/src/helpers/updateEditorPackageJson.js +4 -4
- package/src/modules/editor/src/helpers/validateJsFile.js +11 -7
- package/src/modules/editor/src/helpers/writeJsFileToDisk.js +3 -3
- package/src/modules/editor/src/templates/{app-entry.js → app-entry.cjs} +0 -0
- package/src/modules/editor/src/webpackLoaders/{generatedLoader.js → generatedLoader.cjs} +12 -3
- package/src/modules/editor/src/webpackLoaders/{platformSourceMapLoader.js → platformSourceMapLoader.cjs} +2 -2
- package/src/modules/editor/src/webpackLoaders/{symbolLoader.js → symbolLoader.cjs} +0 -0
- package/src/modules/editor/src/webpackLoaders/{vendorsSourceMapLoader.js → vendorsSourceMapLoader.cjs} +0 -0
- package/src/modules/editor/src/webpackPlugins/CopyPlugin.js +177 -162
- package/src/modules/editor/src/webpackPlugins/DependenciesInLoadOrderPlugin.js +2 -6
- package/src/modules/editor/src/webpackPlugins/FdtOutputPlugin.js +4 -6
- package/src/modules/editor/src/webpackPlugins/RemoveExplicitExtensionResolvePlugin.js +3 -6
- package/src/modules/editor/src/webpackPlugins/ResolveImportAliasPlugin.js +2 -4
- package/src/modules/editor/src/webpackPlugins/UnitTestPlugin.js +5 -7
- package/src/modules/editor/test/dependecyWatching.test.js +11 -12
- package/src/modules/editor/test/fixtures.test.js +21 -16
- package/src/modules/editor/test/helpers/appMutations/addFilesToPackage.js +4 -4
- package/src/modules/editor/test/helpers/appMutations/addFontoManifestToPackage.js +4 -4
- package/src/modules/editor/test/helpers/appMutations/addPackage.js +7 -11
- package/src/modules/editor/test/helpers/appMutations/generateSpecialFiles.js +2 -2
- package/src/modules/editor/test/helpers/appMutations/mutateConfigFontoManifest.js +4 -4
- package/src/modules/editor/test/helpers/appMutations/mutatePackageFontoManifest.js +4 -4
- package/src/modules/editor/test/helpers/appMutations/removeFilesFromPackage.js +4 -4
- package/src/modules/editor/test/helpers/appMutations/removePackage.js +5 -5
- package/src/modules/editor/test/helpers/assertFixtureSnapshot.js +8 -6
- package/src/modules/editor/test/helpers/createAppStructure.js +8 -4
- package/src/modules/editor/test/helpers/createTempDirectory.js +3 -3
- package/src/modules/editor/test/helpers/createWebpackWatch.js +21 -22
- package/src/modules/editor/test/helpers/normaliseLineEndings.js +2 -2
- package/src/modules/editor-pre-7-7-0/index.js +19 -23
- package/src/modules/editor-pre-7-7-0/package.json +2 -1
- package/src/modules/editor-pre-7-7-0/src/api/addCommentToAstNode.js +6 -9
- package/src/modules/editor-pre-7-7-0/src/api/addonsAddDependencies.js +1 -3
- package/src/modules/editor-pre-7-7-0/src/api/createMessageTemplate.js +4 -6
- package/src/modules/editor-pre-7-7-0/src/api/createPackageDirectoryPath.js +4 -6
- package/src/modules/editor-pre-7-7-0/src/api/createPrettifiedCode.js +12 -8
- package/src/modules/editor-pre-7-7-0/src/api/downloadEditorSDK.js +3 -5
- package/src/modules/editor-pre-7-7-0/src/api/executeAndLog.js +4 -6
- package/src/modules/editor-pre-7-7-0/src/api/extractZip.js +4 -6
- package/src/modules/editor-pre-7-7-0/src/api/getAddonLabel.js +2 -4
- package/src/modules/editor-pre-7-7-0/src/api/getAddonLabels.js +3 -5
- package/src/modules/editor-pre-7-7-0/src/api/getAddonLabelsForChanges.js +4 -6
- package/src/modules/editor-pre-7-7-0/src/api/getAddonsFromEditorSDK.js +2 -4
- package/src/modules/editor-pre-7-7-0/src/api/init/checkEditorDestination.js +2 -4
- package/src/modules/editor-pre-7-7-0/src/api/init/createConfigConfiguration.js +13 -11
- package/src/modules/editor-pre-7-7-0/src/api/init/createConfigFontoManifest.js +3 -5
- package/src/modules/editor-pre-7-7-0/src/api/init/createSchemaExperienceResolver.js +11 -8
- package/src/modules/editor-pre-7-7-0/src/api/inquirerPrompts.js +20 -30
- package/src/modules/editor-pre-7-7-0/src/api/npmInstall.js +5 -7
- package/src/modules/editor-pre-7-7-0/src/api/promptForVersionAndDownloadEditorSDK.js +8 -11
- package/src/modules/editor-pre-7-7-0/src/api/schema/buildSchemaExperienceConfigurationModel.js +2 -6
- package/src/modules/editor-pre-7-7-0/src/api/schema/checkIfCompiledSchemaOverwritesFiles.js +3 -5
- package/src/modules/editor-pre-7-7-0/src/api/schema/compile.js +3 -5
- package/src/modules/editor-pre-7-7-0/src/api/schema/createCommentsForElement.js +6 -10
- package/src/modules/editor-pre-7-7-0/src/api/schema/createSchemaExperiencePackages.js +13 -15
- package/src/modules/editor-pre-7-7-0/src/api/schema/createSchemaPackages.js +7 -11
- package/src/modules/editor-pre-7-7-0/src/api/schema/getPrefixByNamespaceUri.js +4 -6
- package/src/modules/editor-pre-7-7-0/src/api/schema/getSchemaFontoJson.js +5 -7
- package/src/modules/editor-pre-7-7-0/src/api/schema/getVersionedSchemaCompilerBaseUrl.js +4 -5
- package/src/modules/editor-pre-7-7-0/src/api/schema/zipHelpers.js +6 -8
- package/src/modules/editor-pre-7-7-0/src/api/updateManifest.js +2 -4
- package/src/modules/editor-pre-7-7-0/src/api/upgrade/getMajorVersion.js +1 -5
- package/src/modules/editor-pre-7-7-0/src/api/upgrade/preprocessData.js +3 -5
- package/src/modules/editor-pre-7-7-0/src/api/upgrade/updateConfigFontoManifest.js +2 -4
- package/src/modules/editor-pre-7-7-0/src/api/validateAddons.js +1 -3
- package/src/modules/editor-pre-7-7-0/src/api/validateManifest.js +1 -3
- package/src/modules/editor-pre-7-7-0/src/api/writeAstProgramToFile.js +7 -6
- package/src/modules/editor-pre-7-7-0/src/command.addons.controller.js +18 -25
- package/src/modules/editor-pre-7-7-0/src/command.addons.js +10 -3
- package/src/modules/editor-pre-7-7-0/src/command.build.controller.js +6 -8
- package/src/modules/editor-pre-7-7-0/src/command.build.js +10 -3
- package/src/modules/editor-pre-7-7-0/src/command.init.controller.js +33 -36
- package/src/modules/editor-pre-7-7-0/src/command.init.js +10 -3
- package/src/modules/editor-pre-7-7-0/src/command.run.controller.js +6 -8
- package/src/modules/editor-pre-7-7-0/src/command.run.js +10 -3
- package/src/modules/editor-pre-7-7-0/src/command.schema.compile.controller.js +10 -12
- package/src/modules/editor-pre-7-7-0/src/command.schema.compile.js +10 -3
- package/src/modules/editor-pre-7-7-0/src/command.upgrade.controller.js +24 -31
- package/src/modules/editor-pre-7-7-0/src/command.upgrade.js +10 -3
- package/src/modules/editor-pre-7-7-0/src/command.versions.controller.js +2 -4
- package/src/modules/editor-pre-7-7-0/src/command.versions.js +10 -3
- package/src/modules/editor-pre-7-7-0/test/api/schema/buildSchemaExperienceConfigurationModel.test.js +19 -18
- package/src/modules/editor-pre-7-7-0/test/api/schema/createCommentsForElement.test.js +7 -10
- package/src/modules/editor-pre-7-7-0/test/api/schema/getPrefixByNamespaceUri.test.js +3 -6
- package/src/modules/editor-pre-7-7-0/test/api/schema/testHelpers.js +5 -14
- package/src/modules/editor-pre-7-7-0/test/api/schema/zipSchemaSource.test.js +9 -7
- package/src/modules/localization/index.js +13 -13
- package/src/modules/localization/package.json +2 -1
- package/src/modules/localization/src/api/Message.js +3 -3
- package/src/modules/localization/src/api/createMessagesTable.js +3 -5
- package/src/modules/localization/src/api/deduplicateMessages.js +2 -2
- package/src/modules/localization/src/api/extractMessages.js +5 -5
- package/src/modules/localization/src/api/getMessagesFromOperation.js +3 -3
- package/src/modules/localization/src/api/getMessagesFromSource.js +9 -4
- package/src/modules/localization/src/api/getOperationMessages.js +9 -9
- package/src/modules/localization/src/api/getSourceMessages.js +9 -8
- package/src/modules/localization/src/api/index.js +10 -5
- package/src/modules/localization/src/api/loadMessageBundle.js +6 -5
- package/src/modules/localization/src/api/{parser.js → parser.cjs} +0 -0
- package/src/modules/localization/src/api/promiseUtils.js +1 -1
- package/src/modules/localization/src/api/updateMessagesWithTemplate.js +2 -2
- package/src/modules/localization/src/command.extract.controller.js +7 -9
- package/src/modules/localization/src/command.extract.js +10 -3
- package/src/modules/localization/src/command.merge.controller.js +7 -9
- package/src/modules/localization/src/command.merge.js +10 -3
- package/src/modules/localization/src/command.messages.controller.js +5 -7
- package/src/modules/localization/src/command.messages.js +11 -4
- package/src/modules/localization/src/command.update.controller.js +8 -10
- package/src/modules/localization/src/command.update.js +10 -3
- package/src/modules/localization/test/api/Message.test.js +3 -3
- package/src/modules/localization/test/api/deduplicateMessages.test.js +4 -5
- package/src/modules/localization/test/api/getMessagesFromOperation.test.js +3 -4
- package/src/modules/localization/test/api/getMessagesFromSource.test.js +3 -4
- package/src/modules/localization/test/api/parser.test.js +3 -2
- package/src/modules/localization/test/api/promiseUtils.test.js +2 -2
- package/src/modules/localization/test/api/roundtripThroughJson.js +2 -2
- package/src/modules/localization/test/api/updateMessagesWithTemplate.test.js +4 -5
- package/src/modules/localization/test/command.extract.test.js +11 -10
- package/src/modules/localization/test/command.merge.test.js +11 -10
- package/src/modules/localization/test/command.messages.test.js +10 -9
- package/src/modules/localization/test/command.update.test.js +11 -10
- package/src/modules/localization/test/index.test.js +15 -14
- package/src/modules/localization/test/promiseUtils.test.js +2 -4
- package/src/modules/operations/index.js +5 -6
- package/src/modules/operations/package.json +2 -1
- package/src/modules/operations/src/api/createOperationsTable.js +3 -5
- package/src/modules/operations/src/api/getOperation.js +3 -5
- package/src/modules/operations/src/api/getOperations.js +12 -14
- package/src/modules/operations/src/command.operation.controller.js +3 -5
- package/src/modules/operations/src/command.operation.js +10 -3
- package/src/modules/operations/src/command.operations.controller.js +4 -6
- package/src/modules/operations/src/command.operations.js +11 -4
- package/src/modules/operations/test/command.operation.test.js +10 -9
- package/src/modules/operations/test/command.operations.test.js +11 -9
- package/src/modules/operations/test/getOperation.test.js +6 -4
- package/src/modules/operations/test/getOperations.test.js +6 -4
- package/src/modules/operations/test/index.test.js +11 -11
- package/src/modules/review/index.js +13 -10
- package/src/modules/review/package.json +2 -1
- package/src/modules/review/src/command.build.controller.js +13 -15
- package/src/modules/review/src/command.build.js +11 -4
- package/src/modules/review/src/command.download-self-contained.controller.js +6 -8
- package/src/modules/review/src/command.download-self-contained.js +10 -3
- package/src/modules/review/src/command.init.controller.js +7 -9
- package/src/modules/review/src/command.init.js +10 -3
- package/src/modules/review/src/command.run.controller.js +14 -16
- package/src/modules/review/src/command.run.js +8 -4
- package/src/modules/review/src/command.upgrade.controller.js +8 -10
- package/src/modules/review/src/command.upgrade.js +10 -3
- package/src/modules/review/src/command.versions.controller.js +2 -4
- package/src/modules/review/src/command.versions.js +10 -3
- package/src/modules/review/src/utilities/FontoxmlReviewManifest.js +2 -6
- package/src/modules/review/src/utilities/cleanup.js +6 -8
- package/src/modules/review/src/utilities/constants.js +5 -3
- package/src/modules/review/src/utilities/copyWhitelistedFiles.js +4 -6
- package/src/modules/review/src/utilities/executeAndLog.js +4 -5
- package/src/modules/review/src/utilities/getVerbosityLevel.js +3 -5
- package/src/modules/review/src/utilities/getWhitelist.js +5 -7
- package/src/modules/review/src/utilities/setEntryVisibility.js +3 -14
- package/src/modules/review/src/utilities/validateInstance.js +6 -8
- package/src/modules/schema/index.js +16 -24
- package/src/modules/schema/package.json +2 -1
- package/src/modules/schema/src/api/AttributeSummary.js +2 -4
- package/src/modules/schema/src/api/ElementSummary.js +2 -4
- package/src/modules/schema/src/api/SchemaSummary.js +11 -10
- package/src/modules/schema/src/api/SimpleTypeSummary.js +3 -5
- package/src/modules/schema/src/api/createAttributesTable.js +3 -5
- package/src/modules/schema/src/api/createElementsTable.js +3 -5
- package/src/modules/schema/src/api/createSchemasTable.js +4 -6
- package/src/modules/schema/src/api/createSimpleTypesTable.js +3 -5
- package/src/modules/schema/src/api/getClosestMatchingSchemaSummary.js +7 -9
- package/src/modules/schema/src/api/getSchemaSummaries.js +5 -7
- package/src/modules/schema/src/command.attribute.controller.js +3 -5
- package/src/modules/schema/src/command.attribute.js +10 -3
- package/src/modules/schema/src/command.attributes.controller.js +4 -6
- package/src/modules/schema/src/command.attributes.js +11 -4
- package/src/modules/schema/src/command.element.controller.js +4 -6
- package/src/modules/schema/src/command.element.js +10 -3
- package/src/modules/schema/src/command.elements.controller.js +4 -6
- package/src/modules/schema/src/command.elements.js +11 -4
- package/src/modules/schema/src/command.schemas.controller.js +4 -6
- package/src/modules/schema/src/command.schemas.js +11 -4
- package/src/modules/schema/src/command.simpletypes.controller.js +4 -6
- package/src/modules/schema/src/command.simpletypes.js +11 -4
- package/src/modules/schema/src/helpers/renderSimpleType.js +3 -5
- package/src/modules/schema/src/helpers/restrictionFormatter.js +2 -4
- package/src/modules/schema/test/AttributeSummary.test.js +3 -5
- package/src/modules/schema/test/ElementSummary.test.js +3 -5
- package/src/modules/schema/test/SchemaSummary.test.js +9 -7
- package/src/modules/schema/test/SimpleTypeSummary.test.js +3 -5
- package/src/modules/schema/test/command.attribute.test.js +14 -12
- package/src/modules/schema/test/command.attributes.test.js +14 -12
- package/src/modules/schema/test/command.element.test.js +14 -12
- package/src/modules/schema/test/command.elements.test.js +14 -12
- package/src/modules/schema/test/command.schemas.test.js +10 -9
- package/src/modules/schema/test/command.simpletypes.test.js +10 -9
- package/src/modules/schema/test/getClosestMatchingSchemaSummary.test.js +6 -4
- package/src/modules/schema/test/getSchemaSummaries.test.js +6 -4
- package/src/modules/schema/test/index.test.js +37 -37
- package/src/modules/schema/test/renderSimpleType.test.js +12 -13
- package/src/modules/schema/test/restrictionFormatter.test.js +3 -5
- package/src/modules/schema-compiler/index.js +13 -10
- package/src/modules/schema-compiler/package.json +2 -1
- package/src/modules/schema-compiler/src/command.build.controller.js +12 -15
- package/src/modules/schema-compiler/src/command.build.js +11 -4
- package/src/modules/schema-compiler/src/command.download-self-contained.controller.js +6 -8
- package/src/modules/schema-compiler/src/command.download-self-contained.js +10 -3
- package/src/modules/schema-compiler/src/command.init.controller.js +7 -9
- package/src/modules/schema-compiler/src/command.init.js +10 -3
- package/src/modules/schema-compiler/src/command.run.controller.js +14 -16
- package/src/modules/schema-compiler/src/command.run.js +6 -4
- package/src/modules/schema-compiler/src/command.upgrade.controller.js +8 -10
- package/src/modules/schema-compiler/src/command.upgrade.js +10 -3
- package/src/modules/schema-compiler/src/command.versions.controller.js +2 -4
- package/src/modules/schema-compiler/src/command.versions.js +10 -3
- package/src/modules/schema-compiler/src/utilities/FontoxmlSchemaCompilerManifest.js +2 -6
- package/src/modules/schema-compiler/src/utilities/cleanup.js +6 -8
- package/src/modules/schema-compiler/src/utilities/constants.js +5 -3
- package/src/modules/schema-compiler/src/utilities/copyWhitelistedFiles.js +4 -6
- package/src/modules/schema-compiler/src/utilities/executeAndLog.js +4 -5
- package/src/modules/schema-compiler/src/utilities/getVerbosityLevel.js +3 -5
- package/src/modules/schema-compiler/src/utilities/getWhitelist.js +5 -7
- package/src/modules/schema-compiler/src/utilities/setEntryVisibility.js +3 -14
- package/src/modules/schema-compiler/src/utilities/validateInstance.js +6 -8
- package/src/modules/spell-checker/index.js +13 -10
- package/src/modules/spell-checker/package.json +2 -1
- package/src/modules/spell-checker/src/command.build.controller.js +13 -15
- package/src/modules/spell-checker/src/command.build.js +11 -4
- package/src/modules/spell-checker/src/command.download-self-contained.controller.js +6 -8
- package/src/modules/spell-checker/src/command.download-self-contained.js +10 -3
- package/src/modules/spell-checker/src/command.init.controller.js +7 -9
- package/src/modules/spell-checker/src/command.init.js +10 -3
- package/src/modules/spell-checker/src/command.run.controller.js +13 -15
- package/src/modules/spell-checker/src/command.run.js +8 -4
- package/src/modules/spell-checker/src/command.upgrade.controller.js +8 -10
- package/src/modules/spell-checker/src/command.upgrade.js +10 -3
- package/src/modules/spell-checker/src/command.versions.controller.js +2 -4
- package/src/modules/spell-checker/src/command.versions.js +10 -3
- package/src/modules/spell-checker/src/utilities/FontoxmlSpellCheckerManifest.js +2 -6
- package/src/modules/spell-checker/src/utilities/cleanup.js +6 -8
- package/src/modules/spell-checker/src/utilities/constants.js +5 -3
- package/src/modules/spell-checker/src/utilities/copyWhitelistedFiles.js +4 -6
- package/src/modules/spell-checker/src/utilities/executeAndLog.js +4 -5
- package/src/modules/spell-checker/src/utilities/getVerbosityLevel.js +3 -5
- package/src/modules/spell-checker/src/utilities/getWhitelist.js +5 -7
- package/src/modules/spell-checker/src/utilities/setEntryVisibility.js +3 -14
- package/src/modules/spell-checker/src/utilities/validateInstance.js +6 -8
- package/src/response/FdtResponse.js +8 -13
- package/src/response/extras.js +3 -5
- package/src/response/primitives.js +4 -4
- package/test/App.test.js +113 -93
- package/test/AssertableWritableStream.test.js +3 -8
- package/test/FdtCommand.test.js +9 -7
- package/test/FdtTable.test.js +12 -11
- package/test/app/invalid-module-1/index.js +1 -1
- package/test/app/invalid-module-1/package.json +1 -0
- package/test/app/test-module-1/index.js +1 -1
- package/test/app/test-module-1/package.json +1 -0
- package/test/app/test-module-2/index.js +12 -7
- package/test/app/test-module-2/package.json +1 -0
- package/test/app/test-module-2/src/testLazyLoadCommand.js +2 -4
- package/test/app/test-module-2-duplicate/index.js +1 -3
- package/test/app/test-module-2-duplicate/package.json +1 -0
- package/test/app-pre-7-7-0/config.js +1 -1
- package/test/app-with-configjs/config.js +1 -1
- package/test/module.core.test.js +39 -29
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
1
|
const INDEX = Symbol();
|
|
4
2
|
const SCHEMAFILE = Symbol();
|
|
5
3
|
const SIMPLETYPE_REF = Symbol();
|
|
6
4
|
|
|
7
|
-
|
|
5
|
+
export default class AttributeSummary {
|
|
8
6
|
constructor(schemaFile, attributeDefinition) {
|
|
9
7
|
this[SCHEMAFILE] = schemaFile;
|
|
10
8
|
|
|
@@ -49,4 +47,4 @@ module.exports = class AttributeSummary {
|
|
|
49
47
|
getSimpleType() {
|
|
50
48
|
return this[SCHEMAFILE].getSimpleTypeByIndex(this[SIMPLETYPE_REF]);
|
|
51
49
|
}
|
|
52
|
-
}
|
|
50
|
+
}
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
1
|
const ATTRIBUTE_REFS = Symbol();
|
|
4
2
|
const CONTENTMODEL_REF = Symbol();
|
|
5
3
|
const INDEX = Symbol();
|
|
@@ -76,7 +74,7 @@ function getElementsReferringToElement(schemaFile, elementSummary) {
|
|
|
76
74
|
});
|
|
77
75
|
}
|
|
78
76
|
|
|
79
|
-
|
|
77
|
+
export default class ElementSummary {
|
|
80
78
|
constructor(schemaFile, elementDefinition) {
|
|
81
79
|
this[SCHEMAFILE] = schemaFile;
|
|
82
80
|
|
|
@@ -161,4 +159,4 @@ module.exports = class ElementSummary {
|
|
|
161
159
|
return this.namespaceURI;
|
|
162
160
|
}
|
|
163
161
|
}
|
|
164
|
-
}
|
|
162
|
+
}
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
import { readFileSync } from 'fs';
|
|
2
|
+
import path from 'path';
|
|
3
|
+
import requireJs from 'requirejs';
|
|
2
4
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
const AttributeSummary = require('./AttributeSummary');
|
|
7
|
-
const ElementSummary = require('./ElementSummary');
|
|
8
|
-
const SimpleTypeSummary = require('./SimpleTypeSummary');
|
|
5
|
+
import AttributeSummary from './AttributeSummary.js';
|
|
6
|
+
import ElementSummary from './ElementSummary.js';
|
|
7
|
+
import SimpleTypeSummary from './SimpleTypeSummary.js';
|
|
9
8
|
|
|
10
9
|
function findConfigurationSettings(instance) {
|
|
11
10
|
const pathPieces = instance.path.split(path.sep);
|
|
@@ -70,7 +69,7 @@ const ELEMENTS = Symbol();
|
|
|
70
69
|
const LOCAL_ELEMENTS = Symbol();
|
|
71
70
|
const SIMPLETYPES = Symbol();
|
|
72
71
|
|
|
73
|
-
|
|
72
|
+
export default class SchemaSummary {
|
|
74
73
|
constructor(schemaPathOrData) {
|
|
75
74
|
const isInitializedWithData = typeof schemaPathOrData === 'object';
|
|
76
75
|
this.path = !isInitializedWithData ? schemaPathOrData : undefined;
|
|
@@ -83,7 +82,9 @@ module.exports = class SchemaSummary {
|
|
|
83
82
|
findConfigurationSettings(this);
|
|
84
83
|
|
|
85
84
|
try {
|
|
86
|
-
this[DATA] =
|
|
85
|
+
this[DATA] = JSON.parse(
|
|
86
|
+
readFileSync(path.resolve(this.path), 'utf8')
|
|
87
|
+
);
|
|
87
88
|
} catch (_error) {
|
|
88
89
|
throw new Error('Could not read schema file.');
|
|
89
90
|
}
|
|
@@ -264,4 +265,4 @@ module.exports = class SchemaSummary {
|
|
|
264
265
|
|
|
265
266
|
return false;
|
|
266
267
|
}
|
|
267
|
-
}
|
|
268
|
+
}
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
const restrictionFormatter = require('../helpers/restrictionFormatter');
|
|
1
|
+
import restrictionFormatter from '../helpers/restrictionFormatter.js';
|
|
4
2
|
|
|
5
3
|
const BASE = Symbol();
|
|
6
4
|
const ITEM_TYPE = Symbol();
|
|
@@ -25,7 +23,7 @@ function getSimpleTypeRestrictionsString(simpleType) {
|
|
|
25
23
|
.join(', ')} }`;
|
|
26
24
|
}
|
|
27
25
|
|
|
28
|
-
|
|
26
|
+
export default class SimpleTypeSummary {
|
|
29
27
|
constructor(schemaFile, simpleTypeDefinition) {
|
|
30
28
|
this[SCHEMAFILE] = schemaFile;
|
|
31
29
|
|
|
@@ -137,4 +135,4 @@ module.exports = class SimpleTypeSummary {
|
|
|
137
135
|
}
|
|
138
136
|
}
|
|
139
137
|
}
|
|
140
|
-
}
|
|
138
|
+
}
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
import FdtTable from '../../../../../src/FdtTable.js';
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
module.exports = function createAttributesTable(moduleRegistration) {
|
|
3
|
+
export default function createAttributesTable(moduleRegistration) {
|
|
6
4
|
return new FdtTable(moduleRegistration, [
|
|
7
5
|
{
|
|
8
6
|
name: 'name',
|
|
@@ -53,4 +51,4 @@ module.exports = function createAttributesTable(moduleRegistration) {
|
|
|
53
51
|
},
|
|
54
52
|
},
|
|
55
53
|
]);
|
|
56
|
-
}
|
|
54
|
+
}
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
import FdtTable from '../../../../../src/FdtTable.js';
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
module.exports = function createElementsTable(moduleRegistration) {
|
|
3
|
+
export default function createElementsTable(moduleRegistration) {
|
|
6
4
|
return new FdtTable(moduleRegistration, [
|
|
7
5
|
{
|
|
8
6
|
name: 'name',
|
|
@@ -99,4 +97,4 @@ module.exports = function createElementsTable(moduleRegistration) {
|
|
|
99
97
|
.join(', '),
|
|
100
98
|
},
|
|
101
99
|
]);
|
|
102
|
-
}
|
|
100
|
+
}
|
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
import path from 'path';
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
import FdtTable from '../../../../../src/FdtTable.js';
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
module.exports = function createSchemasTable(moduleRegistration) {
|
|
5
|
+
export default function createSchemasTable(moduleRegistration) {
|
|
8
6
|
return new FdtTable(moduleRegistration, [
|
|
9
7
|
{
|
|
10
8
|
name: 'package',
|
|
@@ -30,4 +28,4 @@ module.exports = function createSchemasTable(moduleRegistration) {
|
|
|
30
28
|
value: (schema) => schema.getSchemaVersionString(),
|
|
31
29
|
},
|
|
32
30
|
]);
|
|
33
|
-
}
|
|
31
|
+
}
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
import FdtTable from '../../../../../src/FdtTable.js';
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
module.exports = function createSimpleTypesTable(moduleRegistration) {
|
|
3
|
+
export default function createSimpleTypesTable(moduleRegistration) {
|
|
6
4
|
return new FdtTable(moduleRegistration, [
|
|
7
5
|
{
|
|
8
6
|
name: 'name',
|
|
@@ -23,4 +21,4 @@ module.exports = function createSimpleTypesTable(moduleRegistration) {
|
|
|
23
21
|
value: (element) => element.getSimpleTypeString(),
|
|
24
22
|
},
|
|
25
23
|
]);
|
|
26
|
-
}
|
|
24
|
+
}
|
|
@@ -1,13 +1,11 @@
|
|
|
1
|
-
|
|
1
|
+
import fs from 'fs';
|
|
2
|
+
import os from 'os';
|
|
3
|
+
import path from 'path';
|
|
2
4
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
const path = require('path');
|
|
5
|
+
import getSchemaSummaries from './getSchemaSummaries.js';
|
|
6
|
+
import SchemaSummary from './SchemaSummary.js';
|
|
6
7
|
|
|
7
|
-
|
|
8
|
-
const getSchemaSummaries = require('./getSchemaSummaries');
|
|
9
|
-
|
|
10
|
-
module.exports = function getClosestMatchingSchema(p, searchString) {
|
|
8
|
+
export default function getClosestMatchingSchema(p, searchString) {
|
|
11
9
|
try {
|
|
12
10
|
fs.statSync(path.resolve(process.cwd(), searchString));
|
|
13
11
|
return new SchemaSummary(path.resolve(process.cwd(), searchString));
|
|
@@ -68,4 +66,4 @@ module.exports = function getClosestMatchingSchema(p, searchString) {
|
|
|
68
66
|
}
|
|
69
67
|
|
|
70
68
|
return results[0];
|
|
71
|
-
}
|
|
69
|
+
}
|
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
import glob from 'globby';
|
|
2
|
+
import path from 'path';
|
|
2
3
|
|
|
3
|
-
|
|
4
|
-
const path = require('path');
|
|
4
|
+
import SchemaSummary from './SchemaSummary.js';
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
module.exports = function getSchemaSummaries(p) {
|
|
6
|
+
export default function getSchemaSummaries(p) {
|
|
9
7
|
const basePath = path.resolve(p);
|
|
10
8
|
|
|
11
9
|
return glob
|
|
@@ -34,4 +32,4 @@ module.exports = function getSchemaSummaries(p) {
|
|
|
34
32
|
.map(
|
|
35
33
|
(schemaPath) => new SchemaSummary(path.join(basePath, schemaPath))
|
|
36
34
|
);
|
|
37
|
-
}
|
|
35
|
+
}
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
import getClosestMatchingSchemaSummary from './api/getClosestMatchingSchemaSummary.js';
|
|
2
|
+
import renderSimpleType from './helpers/renderSimpleType.js';
|
|
2
3
|
|
|
3
|
-
|
|
4
|
-
const renderSimpleType = require('./helpers/renderSimpleType');
|
|
5
|
-
|
|
6
|
-
module.exports = function attributeCommand(req, res) {
|
|
4
|
+
export default function attributeCommand(req, res) {
|
|
7
5
|
res.caption(req.command.getLongName());
|
|
8
6
|
|
|
9
7
|
const destroySpinner = res.spinner('Looking up schemas...');
|
|
@@ -1,8 +1,15 @@
|
|
|
1
|
-
|
|
1
|
+
import path from 'path';
|
|
2
|
+
import { fileURLToPath } from 'url';
|
|
2
3
|
|
|
3
|
-
|
|
4
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
5
|
+
const __dirname = path.dirname(__filename);
|
|
6
|
+
|
|
7
|
+
export default (moduleRegistration) => {
|
|
4
8
|
moduleRegistration
|
|
5
|
-
.registerCommand(
|
|
9
|
+
.registerCommand(
|
|
10
|
+
'attribute',
|
|
11
|
+
path.resolve(__dirname, 'command.attribute.controller.js')
|
|
12
|
+
)
|
|
6
13
|
.setDescription(
|
|
7
14
|
'Output schema information about a specific attribute. An attribute may have different definitions in the same schema, this command summarizes them all.'
|
|
8
15
|
)
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
import createAttributesTable from './api/createAttributesTable.js';
|
|
2
|
+
import getClosestMatchingSchemaSummary from './api/getClosestMatchingSchemaSummary.js';
|
|
2
3
|
|
|
3
|
-
|
|
4
|
-
const getClosestMatchingSchemaSummary = require('./api/getClosestMatchingSchemaSummary');
|
|
5
|
-
|
|
6
|
-
module.exports = function attributesCommand(req, res) {
|
|
4
|
+
export default function attributesCommand(req, res) {
|
|
7
5
|
res.caption(req.command.getLongName());
|
|
8
6
|
|
|
9
7
|
const destroySpinner = res.spinner('Looking up schemas...');
|
|
@@ -36,4 +34,4 @@ module.exports = function attributesCommand(req, res) {
|
|
|
36
34
|
req.options.sort,
|
|
37
35
|
req.options.export
|
|
38
36
|
);
|
|
39
|
-
}
|
|
37
|
+
}
|
|
@@ -1,12 +1,19 @@
|
|
|
1
|
-
|
|
1
|
+
import path from 'path';
|
|
2
|
+
import { fileURLToPath } from 'url';
|
|
2
3
|
|
|
3
|
-
|
|
4
|
+
import createAttributesTable from './api/createAttributesTable.js';
|
|
4
5
|
|
|
5
|
-
|
|
6
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
7
|
+
const __dirname = path.dirname(__filename);
|
|
8
|
+
|
|
9
|
+
export default (moduleRegistration) => {
|
|
6
10
|
const table = createAttributesTable(moduleRegistration);
|
|
7
11
|
|
|
8
12
|
moduleRegistration
|
|
9
|
-
.registerCommand(
|
|
13
|
+
.registerCommand(
|
|
14
|
+
'attributes',
|
|
15
|
+
path.resolve(__dirname, 'command.attributes.controller.js')
|
|
16
|
+
)
|
|
10
17
|
.addAlias('list-attributes')
|
|
11
18
|
.setDescription(
|
|
12
19
|
'Output a table with information about all attributes in a schema.'
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
const getClosestMatchingSchemaSummary = require('./api/getClosestMatchingSchemaSummary');
|
|
4
|
-
const renderSimpleType = require('./helpers/renderSimpleType');
|
|
1
|
+
import getClosestMatchingSchemaSummary from './api/getClosestMatchingSchemaSummary.js';
|
|
2
|
+
import renderSimpleType from './helpers/renderSimpleType.js';
|
|
5
3
|
|
|
6
4
|
function stringForEmptyOrMixed(empty, mixed) {
|
|
7
5
|
return mixed
|
|
@@ -17,7 +15,7 @@ function percentualize(ratio) {
|
|
|
17
15
|
return `${Math.round(ratio * 1000) / 10}%`;
|
|
18
16
|
}
|
|
19
17
|
|
|
20
|
-
|
|
18
|
+
export default function elementCommand(req, res) {
|
|
21
19
|
res.caption(req.command.getLongName());
|
|
22
20
|
|
|
23
21
|
const destroySpinner = res.spinner('Looking up schemas...');
|
|
@@ -136,4 +134,4 @@ module.exports = function elementCommand(req, res) {
|
|
|
136
134
|
|
|
137
135
|
res.outdent();
|
|
138
136
|
});
|
|
139
|
-
}
|
|
137
|
+
}
|
|
@@ -1,8 +1,15 @@
|
|
|
1
|
-
|
|
1
|
+
import path from 'path';
|
|
2
|
+
import { fileURLToPath } from 'url';
|
|
2
3
|
|
|
3
|
-
|
|
4
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
5
|
+
const __dirname = path.dirname(__filename);
|
|
6
|
+
|
|
7
|
+
export default (moduleRegistration) => {
|
|
4
8
|
moduleRegistration
|
|
5
|
-
.registerCommand(
|
|
9
|
+
.registerCommand(
|
|
10
|
+
'element',
|
|
11
|
+
path.resolve(__dirname, 'command.element.controller.js')
|
|
12
|
+
)
|
|
6
13
|
.setDescription(
|
|
7
14
|
'Output schema information about a specific element, including detailed content model info.'
|
|
8
15
|
)
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
import createElementsTable from './api/createElementsTable.js';
|
|
2
|
+
import getClosestMatchingSchemaSummary from './api/getClosestMatchingSchemaSummary.js';
|
|
2
3
|
|
|
3
|
-
|
|
4
|
-
const getClosestMatchingSchemaSummary = require('./api/getClosestMatchingSchemaSummary');
|
|
5
|
-
|
|
6
|
-
module.exports = function elementCommand(req, res) {
|
|
4
|
+
export default function elementCommand(req, res) {
|
|
7
5
|
res.caption(req.command.getLongName());
|
|
8
6
|
|
|
9
7
|
req.fdt.editorRepository.throwIfNotInsideEditorRepository();
|
|
@@ -38,4 +36,4 @@ module.exports = function elementCommand(req, res) {
|
|
|
38
36
|
req.options.sort,
|
|
39
37
|
req.options.export
|
|
40
38
|
);
|
|
41
|
-
}
|
|
39
|
+
}
|
|
@@ -1,12 +1,19 @@
|
|
|
1
|
-
|
|
1
|
+
import path from 'path';
|
|
2
|
+
import { fileURLToPath } from 'url';
|
|
2
3
|
|
|
3
|
-
|
|
4
|
+
import createElementsTable from './api/createElementsTable.js';
|
|
4
5
|
|
|
5
|
-
|
|
6
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
7
|
+
const __dirname = path.dirname(__filename);
|
|
8
|
+
|
|
9
|
+
export default (moduleRegistration) => {
|
|
6
10
|
const table = createElementsTable(moduleRegistration);
|
|
7
11
|
|
|
8
12
|
moduleRegistration
|
|
9
|
-
.registerCommand(
|
|
13
|
+
.registerCommand(
|
|
14
|
+
'elements',
|
|
15
|
+
path.resolve(__dirname, 'command.elements.controller.js')
|
|
16
|
+
)
|
|
10
17
|
.addAlias('list-elements')
|
|
11
18
|
.setDescription(
|
|
12
19
|
'Output a table with information about all elements in a schema.'
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
import createSchemasTable from './api/createSchemasTable.js';
|
|
2
|
+
import getSchemaSummaries from './api/getSchemaSummaries.js';
|
|
2
3
|
|
|
3
|
-
|
|
4
|
-
const getSchemaSummaries = require('./api/getSchemaSummaries');
|
|
5
|
-
|
|
6
|
-
module.exports = function schemasCommand(req, res) {
|
|
4
|
+
export default function schemasCommand(req, res) {
|
|
7
5
|
res.caption(req.command.getLongName());
|
|
8
6
|
|
|
9
7
|
const destroySpinner = res.spinner('Looking up schemas...');
|
|
@@ -21,4 +19,4 @@ module.exports = function schemasCommand(req, res) {
|
|
|
21
19
|
req.options.sort,
|
|
22
20
|
req.options.export
|
|
23
21
|
);
|
|
24
|
-
}
|
|
22
|
+
}
|
|
@@ -1,12 +1,19 @@
|
|
|
1
|
-
|
|
1
|
+
import path from 'path';
|
|
2
|
+
import { fileURLToPath } from 'url';
|
|
2
3
|
|
|
3
|
-
|
|
4
|
+
import createSchemasTable from './api/createSchemasTable.js';
|
|
4
5
|
|
|
5
|
-
|
|
6
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
7
|
+
const __dirname = path.dirname(__filename);
|
|
8
|
+
|
|
9
|
+
export default (moduleRegistration) => {
|
|
6
10
|
const table = createSchemasTable(moduleRegistration);
|
|
7
11
|
|
|
8
12
|
moduleRegistration
|
|
9
|
-
.registerCommand(
|
|
13
|
+
.registerCommand(
|
|
14
|
+
'schemas',
|
|
15
|
+
path.resolve(__dirname, 'command.schemas.controller.js')
|
|
16
|
+
)
|
|
10
17
|
.addAlias('list-schemas')
|
|
11
18
|
.setDescription('Output a table with information about all schemas.')
|
|
12
19
|
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
import createSimpleTypesTable from './api/createSimpleTypesTable.js';
|
|
2
|
+
import getClosestMatchingSchemaSummary from './api/getClosestMatchingSchemaSummary.js';
|
|
2
3
|
|
|
3
|
-
|
|
4
|
-
const getClosestMatchingSchemaSummary = require('./api/getClosestMatchingSchemaSummary');
|
|
5
|
-
|
|
6
|
-
module.exports = function simpleTypesCommand(req, res) {
|
|
4
|
+
export default function simpleTypesCommand(req, res) {
|
|
7
5
|
res.caption(req.command.getLongName());
|
|
8
6
|
|
|
9
7
|
const destroySpinner = res.spinner('Looking up schemas...');
|
|
@@ -24,4 +22,4 @@ module.exports = function simpleTypesCommand(req, res) {
|
|
|
24
22
|
req.options.sort,
|
|
25
23
|
req.options.export
|
|
26
24
|
);
|
|
27
|
-
}
|
|
25
|
+
}
|
|
@@ -1,12 +1,19 @@
|
|
|
1
|
-
|
|
1
|
+
import path from 'path';
|
|
2
|
+
import { fileURLToPath } from 'url';
|
|
2
3
|
|
|
3
|
-
|
|
4
|
+
import createSimpleTypesTable from './api/createSimpleTypesTable.js';
|
|
4
5
|
|
|
5
|
-
|
|
6
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
7
|
+
const __dirname = path.dirname(__filename);
|
|
8
|
+
|
|
9
|
+
export default (moduleRegistration) => {
|
|
6
10
|
const table = createSimpleTypesTable(moduleRegistration);
|
|
7
11
|
|
|
8
12
|
moduleRegistration
|
|
9
|
-
.registerCommand(
|
|
13
|
+
.registerCommand(
|
|
14
|
+
'simpletypes',
|
|
15
|
+
path.resolve(__dirname, 'command.simpletypes.controller.js')
|
|
16
|
+
)
|
|
10
17
|
.addAlias('list-simpletypes')
|
|
11
18
|
.setDescription(
|
|
12
19
|
'Output a table with information about all simple types in a schema.'
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
const restrictionFormatter = require('./restrictionFormatter');
|
|
1
|
+
import restrictionFormatter from './restrictionFormatter.js';
|
|
4
2
|
|
|
5
3
|
const keyLength = 14;
|
|
6
4
|
|
|
@@ -22,7 +20,7 @@ function renderRestrictions(res, simpleType) {
|
|
|
22
20
|
}
|
|
23
21
|
}
|
|
24
22
|
|
|
25
|
-
|
|
23
|
+
export default function renderSimpleType(res, simpleType) {
|
|
26
24
|
if (simpleType.isBuiltIn()) {
|
|
27
25
|
res.property('Built-in:', simpleType.localName || '-', keyLength);
|
|
28
26
|
|
|
@@ -79,4 +77,4 @@ module.exports = function renderSimpleType(res, simpleType) {
|
|
|
79
77
|
} else {
|
|
80
78
|
res.log(`Unknown simple type "${simpleType.variety}"`);
|
|
81
79
|
}
|
|
82
|
-
}
|
|
80
|
+
}
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
const os = require('os');
|
|
1
|
+
import os from 'os';
|
|
4
2
|
|
|
5
3
|
const formatterPerRestrictionType = {
|
|
6
4
|
enumeration: (value) => value.join(os.EOL),
|
|
@@ -31,7 +29,7 @@ function formatValue(restrictionType, value) {
|
|
|
31
29
|
: value;
|
|
32
30
|
}
|
|
33
31
|
|
|
34
|
-
|
|
32
|
+
export default {
|
|
35
33
|
formatType,
|
|
36
34
|
formatValue,
|
|
37
35
|
};
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
import assert from 'assert';
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
const AttributeSummary = require('../src/api/AttributeSummary');
|
|
6
|
-
const SchemaSummary = require('../src/api/SchemaSummary');
|
|
3
|
+
import AttributeSummary from '../src/api/AttributeSummary.js';
|
|
4
|
+
import SchemaSummary from '../src/api/SchemaSummary.js';
|
|
7
5
|
|
|
8
6
|
function createStubbedAttribute() {
|
|
9
7
|
return {
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
import assert from 'assert';
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
const ElementSummary = require('../src/api/ElementSummary');
|
|
6
|
-
const SchemaSummary = require('../src/api/SchemaSummary');
|
|
3
|
+
import ElementSummary from '../src/api/ElementSummary.js';
|
|
4
|
+
import SchemaSummary from '../src/api/SchemaSummary.js';
|
|
7
5
|
|
|
8
6
|
function createStubbedData() {
|
|
9
7
|
return {
|
|
@@ -1,12 +1,14 @@
|
|
|
1
|
-
|
|
1
|
+
import assert from 'assert';
|
|
2
|
+
import path from 'path';
|
|
3
|
+
import { fileURLToPath } from 'url';
|
|
2
4
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
+
import AttributeSummary from '../src/api/AttributeSummary.js';
|
|
6
|
+
import ElementSummary from '../src/api/ElementSummary.js';
|
|
7
|
+
import SchemaSummary from '../src/api/SchemaSummary.js';
|
|
8
|
+
import SimpleTypeSummary from '../src/api/SimpleTypeSummary.js';
|
|
5
9
|
|
|
6
|
-
const
|
|
7
|
-
const
|
|
8
|
-
const SchemaSummary = require('../src/api/SchemaSummary');
|
|
9
|
-
const SimpleTypeSummary = require('../src/api/SimpleTypeSummary');
|
|
10
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
11
|
+
const __dirname = path.dirname(__filename);
|
|
10
12
|
|
|
11
13
|
function createStubbedData(isEmpty) {
|
|
12
14
|
if (isEmpty) {
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
import assert from 'assert';
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
const SimpleTypeSummary = require('../src/api/SimpleTypeSummary');
|
|
6
|
-
const SchemaSummary = require('../src/api/SchemaSummary');
|
|
3
|
+
import SchemaSummary from '../src/api/SchemaSummary.js';
|
|
4
|
+
import SimpleTypeSummary from '../src/api/SimpleTypeSummary.js';
|
|
7
5
|
|
|
8
6
|
function createStubbedData() {
|
|
9
7
|
return {
|