@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.
Files changed (477) hide show
  1. package/{.eslintrc.js → .eslintrc.cjs} +0 -0
  2. package/{.prettierrc.js → .prettierrc.cjs} +0 -0
  3. package/bin/development-tools.js +8 -8
  4. package/index.js +4 -6
  5. package/npm-shrinkwrap.json +4790 -8570
  6. package/package.json +2 -1
  7. package/src/App.js +60 -36
  8. package/src/AssertableWritableStream.js +4 -9
  9. package/src/ConfigManager.js +3 -7
  10. package/src/EditorRepository.js +15 -16
  11. package/src/FdtCommand.js +12 -33
  12. package/src/FdtLicense.js +8 -14
  13. package/src/FdtTable.js +4 -8
  14. package/src/ModuleRegistrationApi.js +14 -12
  15. package/src/addCoreModulesToApp.js +7 -5
  16. package/src/addModulesToApp.js +46 -28
  17. package/src/createConfigFileInHomedir.js +4 -6
  18. package/src/editorVersions.js +4 -10
  19. package/src/enrichRequestObject.js +11 -7
  20. package/src/getParentDirectoryContainingFileSync.js +4 -6
  21. package/src/modules/connectors/index.js +13 -10
  22. package/src/modules/connectors/package.json +2 -1
  23. package/src/modules/connectors/src/command.build.controller.js +13 -15
  24. package/src/modules/connectors/src/command.build.js +11 -4
  25. package/src/modules/connectors/src/command.download-self-contained.controller.js +6 -8
  26. package/src/modules/connectors/src/command.download-self-contained.js +10 -3
  27. package/src/modules/connectors/src/command.init.controller.js +7 -9
  28. package/src/modules/connectors/src/command.init.js +10 -3
  29. package/src/modules/connectors/src/command.run.controller.js +14 -16
  30. package/src/modules/connectors/src/command.run.js +8 -4
  31. package/src/modules/connectors/src/command.upgrade.controller.js +7 -9
  32. package/src/modules/connectors/src/command.upgrade.js +10 -3
  33. package/src/modules/connectors/src/command.versions.controller.js +2 -4
  34. package/src/modules/connectors/src/command.versions.js +10 -3
  35. package/src/modules/connectors/src/utilities/FontoxmlConnectorsManifest.js +2 -6
  36. package/src/modules/connectors/src/utilities/cleanup.js +6 -8
  37. package/src/modules/connectors/src/utilities/constants.js +5 -3
  38. package/src/modules/connectors/src/utilities/copyWhitelistedFiles.js +4 -6
  39. package/src/modules/connectors/src/utilities/executeAndLog.js +4 -5
  40. package/src/modules/connectors/src/utilities/getVerbosityLevel.js +3 -5
  41. package/src/modules/connectors/src/utilities/getWhitelist.js +5 -7
  42. package/src/modules/connectors/src/utilities/setEntryVisibility.js +3 -14
  43. package/src/modules/connectors/src/utilities/validateInstance.js +5 -7
  44. package/src/modules/content-quality/index.js +14 -11
  45. package/src/modules/content-quality/package.json +2 -1
  46. package/src/modules/content-quality/src/command.build.controller.js +13 -15
  47. package/src/modules/content-quality/src/command.build.js +11 -4
  48. package/src/modules/content-quality/src/command.download-self-contained.controller.js +6 -8
  49. package/src/modules/content-quality/src/command.download-self-contained.js +11 -4
  50. package/src/modules/content-quality/src/command.init.controller.js +7 -9
  51. package/src/modules/content-quality/src/command.init.js +11 -4
  52. package/src/modules/content-quality/src/command.run.controller.js +13 -15
  53. package/src/modules/content-quality/src/command.run.js +8 -4
  54. package/src/modules/content-quality/src/command.upgrade.controller.js +7 -9
  55. package/src/modules/content-quality/src/command.upgrade.js +11 -4
  56. package/src/modules/content-quality/src/command.versions.controller.js +2 -4
  57. package/src/modules/content-quality/src/command.versions.js +10 -3
  58. package/src/modules/content-quality/src/utilities/FontoxmlFcqManifest.js +2 -6
  59. package/src/modules/content-quality/src/utilities/cleanup.js +6 -8
  60. package/src/modules/content-quality/src/utilities/constants.js +5 -3
  61. package/src/modules/content-quality/src/utilities/copyWhitelistedFiles.js +4 -6
  62. package/src/modules/content-quality/src/utilities/executeAndLog.js +4 -5
  63. package/src/modules/content-quality/src/utilities/getVerbosityLevel.js +3 -5
  64. package/src/modules/content-quality/src/utilities/getWhitelist.js +5 -7
  65. package/src/modules/content-quality/src/utilities/setEntryVisibility.js +3 -14
  66. package/src/modules/content-quality/src/utilities/validateInstance.js +5 -7
  67. package/src/modules/core/index.js +14 -18
  68. package/src/modules/core/package.json +2 -1
  69. package/src/modules/core/src/command.fdt.js +1 -3
  70. package/src/modules/core/src/command.license.validate.js +1 -3
  71. package/src/modules/core/src/command.module.js +6 -8
  72. package/src/modules/core/src/command.who.js +6 -4
  73. package/src/modules/core/src/precontroller.debug.js +2 -3
  74. package/src/modules/core/src/precontroller.help.js +7 -5
  75. package/src/modules/document-history/index.js +17 -8
  76. package/src/modules/document-history/instanceBuild/Dockerfile +4 -0
  77. package/src/modules/document-history/instanceDevBuild/.env +2 -0
  78. package/src/modules/document-history/instanceDevBuild/docker-compose.yml +9 -0
  79. package/src/modules/document-history/instanceTemplate/.env +7 -0
  80. package/src/modules/document-history/instanceTemplate/Configuration/sx.xml +4 -0
  81. package/src/modules/document-history/package.json +2 -1
  82. package/src/modules/document-history/src/command.build.controller.js +260 -0
  83. package/src/modules/document-history/src/command.build.js +56 -0
  84. package/src/modules/document-history/src/command.download-self-contained.controller.js +6 -8
  85. package/src/modules/document-history/src/command.download-self-contained.js +10 -3
  86. package/src/modules/document-history/src/command.init.controller.js +91 -0
  87. package/src/modules/document-history/src/command.init.js +44 -0
  88. package/src/modules/document-history/src/command.run.controller.js +444 -0
  89. package/src/modules/document-history/src/command.run.js +64 -0
  90. package/src/modules/document-history/src/command.upgrade.controller.js +52 -0
  91. package/src/modules/document-history/src/command.upgrade.js +44 -0
  92. package/src/modules/document-history/src/command.versions.controller.js +2 -4
  93. package/src/modules/document-history/src/command.versions.js +10 -3
  94. package/src/modules/document-history/src/utilities/FontoxmlFdhManifest.js +30 -0
  95. package/src/modules/document-history/src/utilities/cleanup.js +70 -0
  96. package/src/modules/document-history/src/utilities/constants.js +44 -0
  97. package/src/modules/document-history/src/utilities/copyWhitelistedFiles.js +22 -0
  98. package/src/modules/document-history/src/utilities/executeAndLog.js +63 -0
  99. package/src/modules/document-history/src/utilities/getVerbosityLevel.js +11 -0
  100. package/src/modules/document-history/src/utilities/getWhitelist.js +16 -0
  101. package/src/modules/document-history/src/utilities/setEntryVisibility.js +22 -0
  102. package/src/modules/document-history/src/utilities/validateInstance.js +29 -0
  103. package/src/modules/editor/dev-cms/configureFontoSessionMiddleware.js +1 -5
  104. package/src/modules/editor/dev-cms/configureScopeMiddleware.js +3 -5
  105. package/src/modules/editor/dev-cms/connectors-cms-standard/configureAssetGetRouteHandler.js +1 -3
  106. package/src/modules/editor/dev-cms/connectors-cms-standard/configureAssetPostRouteHandler.js +3 -5
  107. package/src/modules/editor/dev-cms/connectors-cms-standard/configureAssetPreviewGetRouteHandler.js +1 -3
  108. package/src/modules/editor/dev-cms/connectors-cms-standard/configureBodyParserMiddleware.js +3 -5
  109. package/src/modules/editor/dev-cms/connectors-cms-standard/configureBrowsePostRouteHandler.js +1 -3
  110. package/src/modules/editor/dev-cms/connectors-cms-standard/configureConnectorsCmsStandardAssetRouter.js +5 -9
  111. package/src/modules/editor/dev-cms/connectors-cms-standard/configureConnectorsCmsStandardBrowseRouter.js +3 -5
  112. package/src/modules/editor/dev-cms/connectors-cms-standard/configureConnectorsCmsStandardDocumentRouter.js +13 -15
  113. package/src/modules/editor/dev-cms/connectors-cms-standard/configureConnectorsCmsStandardHeartbeatRouter.js +3 -5
  114. package/src/modules/editor/dev-cms/connectors-cms-standard/configureConnectorsCmsStandardProxyRouter.js +7 -10
  115. package/src/modules/editor/dev-cms/connectors-cms-standard/configureConnectorsCmsStandardReferenceRouter.js +5 -7
  116. package/src/modules/editor/dev-cms/connectors-cms-standard/configureConnectorsCmsStandardReviewRouter.js +10 -16
  117. package/src/modules/editor/dev-cms/connectors-cms-standard/configureConnectorsCmsStandardRouter.js +3 -5
  118. package/src/modules/editor/dev-cms/connectors-cms-standard/configureDebugRouteHandler.js +2 -4
  119. package/src/modules/editor/dev-cms/connectors-cms-standard/configureDevelopmentCmsMiddleware.js +3 -3
  120. package/src/modules/editor/dev-cms/connectors-cms-standard/configureDocumentCompareRouteHandler.js +2 -4
  121. package/src/modules/editor/dev-cms/connectors-cms-standard/configureDocumentGetRouteHandler.js +1 -3
  122. package/src/modules/editor/dev-cms/connectors-cms-standard/configureDocumentHistoryGetRouteHandler.js +2 -4
  123. package/src/modules/editor/dev-cms/connectors-cms-standard/configureDocumentLockPutRouteHandler.js +1 -5
  124. package/src/modules/editor/dev-cms/connectors-cms-standard/configureDocumentPostRouteHandler.js +4 -4
  125. package/src/modules/editor/dev-cms/connectors-cms-standard/configureDocumentPresearchPostRouteHandler.js +3 -7
  126. package/src/modules/editor/dev-cms/connectors-cms-standard/configureDocumentPreviewRouteHandler.js +2 -6
  127. package/src/modules/editor/dev-cms/connectors-cms-standard/configureDocumentPutRouteHandler.js +1 -5
  128. package/src/modules/editor/dev-cms/connectors-cms-standard/configureDocumentRevisionGetRouteHandler.js +2 -6
  129. package/src/modules/editor/dev-cms/connectors-cms-standard/configureDocumentStatePostRouteHandler.js +1 -5
  130. package/src/modules/editor/dev-cms/connectors-cms-standard/configureHeartbeatGetRouteHandler.js +1 -5
  131. package/src/modules/editor/dev-cms/connectors-cms-standard/configureReferenceCreatePostRouteHandler.js +2 -6
  132. package/src/modules/editor/dev-cms/connectors-cms-standard/configureReferenceGetPostRouteHandler.js +2 -6
  133. package/src/modules/editor/dev-cms/connectors-cms-standard/configureReferenceMetadataUpdatePatchRouteHandler.js +2 -4
  134. package/src/modules/editor/dev-cms/connectors-cms-standard/configureReviewAnnotationGetPostRouteHandler.js +4 -9
  135. package/src/modules/editor/dev-cms/connectors-cms-standard/configureReviewAnnotationPostRouteHandler.js +4 -8
  136. package/src/modules/editor/dev-cms/connectors-cms-standard/configureReviewAnnotationPutRouteHandler.js +7 -11
  137. package/src/modules/editor/dev-cms/connectors-cms-standard/configureReviewAnnotationReplyPostRouteHandler.js +3 -7
  138. package/src/modules/editor/dev-cms/connectors-cms-standard/configureReviewAnnotationReplyPutRouteHandler.js +5 -9
  139. package/src/modules/editor/dev-cms/connectors-cms-standard/configureReviewStatePostRouteHandler.js +3 -8
  140. package/src/modules/editor/dev-cms/connectors-cms-standard/configureSimulatedDelayMiddleware.js +1 -3
  141. package/src/modules/editor/dev-cms/connectors-cms-standard/configureUploadMiddleware.js +4 -6
  142. package/src/modules/editor/dev-cms/connectors-cms-standard/correlationIdRepository.js +2 -2
  143. package/src/modules/editor/dev-cms/connectors-cms-standard/createMiddleware.js +25 -18
  144. package/src/modules/editor/dev-cms/connectors-cms-standard/getFileHash.js +3 -3
  145. package/src/modules/editor/dev-cms/connectors-cms-standard/referenceRepository.js +10 -3
  146. package/src/modules/editor/dev-cms/connectors-cms-standard/review-annotations/AnnotationDatabase.js +24 -64
  147. package/src/modules/editor/dev-cms/connectors-cms-standard/review-annotations/DebuggingConfiguration.js +1 -3
  148. package/src/modules/editor/dev-cms/connectors-cms-standard/review-annotations/EarlyReturnSymbol.js +1 -1
  149. package/src/modules/editor/dev-cms/connectors-cms-standard/review-annotations/Result.js +6 -14
  150. package/src/modules/editor/dev-cms/connectors-cms-standard/review-annotations/httpStatusCodeHelpers.js +13 -7
  151. package/src/modules/editor/dev-cms/connectors-cms-standard/review-annotations/mapAnnotationResult.js +2 -4
  152. package/src/modules/editor/dev-cms/connectors-cms-standard/stores/DevelopmentCms.js +6 -6
  153. package/src/modules/editor/dev-cms/connectors-cms-standard/stores/FileSystemStore.js +6 -6
  154. package/src/modules/editor/dev-cms/connectors-cms-standard/stores/HistoryStore.js +7 -6
  155. package/src/modules/editor/dev-cms/connectors-cms-standard/stores/MemoryStore.js +3 -3
  156. package/src/modules/editor/dev-cms/connectors-cms-standard/stores/mergeItems.js +2 -2
  157. package/src/modules/editor/dev-cms/connectors-cms-standard/stores/unmergeableRevisionList.js +1 -1
  158. package/src/modules/editor/dev-cms/connectors-dist/configureAuthMiddleware.js +5 -7
  159. package/src/modules/editor/dev-cms/connectors-dist/createMiddleware.js +4 -8
  160. package/src/modules/editor/dev-cms/connectors-health/configureConnectorsHealthRouter.js +3 -7
  161. package/src/modules/editor/dev-cms/connectors-health/configureHealthGetRouteHandler.js +1 -5
  162. package/src/modules/editor/dev-cms/connectors-health/createMiddleware.js +2 -6
  163. package/src/modules/editor/dev-cms/setupDevCms.js +17 -18
  164. package/src/modules/editor/index.js +20 -24
  165. package/src/modules/editor/package.json +2 -1
  166. package/src/modules/editor/src/astHelpers/{addWarningsForRemovedComments.js → addWarningsForRemovedComments.cjs} +0 -0
  167. package/src/modules/editor/src/astHelpers/{getClosestNodeWithOffset.js → getClosestNodeWithOffset.cjs} +0 -0
  168. package/src/modules/editor/src/astHelpers/{getDescendantNodes.js → getDescendantNodes.cjs} +0 -0
  169. package/src/modules/editor/src/astHelpers/{hasMultipleReturnStatements.js → hasMultipleReturnStatements.cjs} +0 -0
  170. package/src/modules/editor/src/astHelpers/{isAmdDefineCallExpression.js → isAmdDefineCallExpression.cjs} +0 -0
  171. package/src/modules/editor/src/astHelpers/{isAmdFactoryReturnStatement.js → isAmdFactoryReturnStatement.cjs} +0 -0
  172. package/src/modules/editor/src/astHelpers/{isInteropDefaultExpressionStatement.js → isInteropDefaultExpressionStatement.cjs} +0 -0
  173. package/src/modules/editor/src/astHelpers/{isInvalidTextLoaderImportDeclaration.js → isInvalidTextLoaderImportDeclaration.cjs} +0 -0
  174. package/src/modules/editor/src/astHelpers/{isRequireToUrlCallExpression.js → isRequireToUrlCallExpression.cjs} +0 -0
  175. package/src/modules/editor/src/astHelpers/{moveComments.js → moveComments.cjs} +0 -0
  176. package/src/modules/editor/src/babelPlugins/{cleanupRegisterXQueryModulePlugin.js → cleanupRegisterXQueryModulePlugin.cjs} +0 -0
  177. package/src/modules/editor/src/babelPlugins/{convertAmdToEsmPlugin.js → convertAmdToEsmPlugin.cjs} +0 -0
  178. package/src/modules/editor/src/babelPlugins/{recastPlugin.js → recastPlugin.cjs} +0 -0
  179. package/src/modules/editor/src/babelPlugins/{rewriteConfigImportsPlugin.js → rewriteConfigImportsPlugin.cjs} +0 -0
  180. package/src/modules/editor/src/babelPlugins/{rewriteImportFileExtensionPlugin.js → rewriteImportFileExtensionPlugin.cjs} +0 -0
  181. package/src/modules/editor/src/babelPlugins/{rewriteInteropDefaultPlugin.js → rewriteInteropDefaultPlugin.cjs} +0 -0
  182. package/src/modules/editor/src/babelPlugins/{rewriteJsonLoaderPlugin.js → rewriteJsonLoaderPlugin.cjs} +0 -0
  183. package/src/modules/editor/src/babelPlugins/{rewriteMainJsImportsPlugin.js → rewriteMainJsImportsPlugin.cjs} +0 -0
  184. package/src/modules/editor/src/babelPlugins/{rewriteSrcPathPlugin.js → rewriteSrcPathPlugin.cjs} +0 -0
  185. package/src/modules/editor/src/babelPlugins/{rewriteSvgLoaderPlugin.js → rewriteSvgLoaderPlugin.cjs} +0 -0
  186. package/src/modules/editor/src/babelPlugins/{validatePlugin.js → validatePlugin.cjs} +0 -0
  187. package/src/modules/editor/src/commands/api/convertEditorWithOutput.js +13 -14
  188. package/src/modules/editor/src/commands/command.build.controller.js +7 -10
  189. package/src/modules/editor/src/commands/command.build.js +10 -3
  190. package/src/modules/editor/src/commands/command.convert.editor.controller.js +7 -9
  191. package/src/modules/editor/src/commands/command.convert.editor.js +10 -3
  192. package/src/modules/editor/src/commands/command.convert.package.controller.js +17 -20
  193. package/src/modules/editor/src/commands/command.convert.package.js +10 -3
  194. package/src/modules/editor/src/commands/command.run.controller.js +44 -55
  195. package/src/modules/editor/src/commands/command.run.js +10 -3
  196. package/src/modules/editor/src/config.js +112 -112
  197. package/src/modules/editor/src/convert.js +3 -9
  198. package/src/modules/editor/src/getAppConfig.js +27 -8
  199. package/src/modules/editor/src/getAppManifest.js +7 -7
  200. package/src/modules/editor/src/getDependenciesInLoadOrder.js +6 -14
  201. package/src/modules/editor/src/getImportsForPackages.js +5 -5
  202. package/src/modules/editor/src/getPatternsForSpecialFileType.js +2 -2
  203. package/src/modules/editor/src/getWebpackConfig.js +25 -23
  204. package/src/modules/editor/src/getWebpackDevMiddlewareConfig.js +2 -2
  205. package/src/modules/editor/src/helpers/WarningsByFilename.js +1 -1
  206. package/src/modules/editor/src/helpers/mergeIndexPageAndManifest.js +4 -4
  207. package/src/modules/editor/src/helpers/normalisePath.js +3 -3
  208. package/src/modules/editor/src/helpers/outputWarningsByFilename.js +4 -4
  209. package/src/modules/editor/src/helpers/prettifyJsFile.js +3 -6
  210. package/src/modules/editor/src/helpers/renameJsxFile.js +4 -4
  211. package/src/modules/editor/src/helpers/transformJsFile.js +24 -10
  212. package/src/modules/editor/src/helpers/updateEditorPackageJson.js +4 -4
  213. package/src/modules/editor/src/helpers/validateJsFile.js +11 -7
  214. package/src/modules/editor/src/helpers/writeJsFileToDisk.js +3 -3
  215. package/src/modules/editor/src/templates/{app-entry.js → app-entry.cjs} +0 -0
  216. package/src/modules/editor/src/webpackLoaders/{generatedLoader.js → generatedLoader.cjs} +12 -3
  217. package/src/modules/editor/src/webpackLoaders/{platformSourceMapLoader.js → platformSourceMapLoader.cjs} +2 -2
  218. package/src/modules/editor/src/webpackLoaders/{symbolLoader.js → symbolLoader.cjs} +0 -0
  219. package/src/modules/editor/src/webpackLoaders/{vendorsSourceMapLoader.js → vendorsSourceMapLoader.cjs} +0 -0
  220. package/src/modules/editor/src/webpackPlugins/CopyPlugin.js +177 -162
  221. package/src/modules/editor/src/webpackPlugins/DependenciesInLoadOrderPlugin.js +2 -6
  222. package/src/modules/editor/src/webpackPlugins/FdtOutputPlugin.js +4 -6
  223. package/src/modules/editor/src/webpackPlugins/RemoveExplicitExtensionResolvePlugin.js +3 -6
  224. package/src/modules/editor/src/webpackPlugins/ResolveImportAliasPlugin.js +2 -4
  225. package/src/modules/editor/src/webpackPlugins/UnitTestPlugin.js +5 -7
  226. package/src/modules/editor/test/dependecyWatching.test.js +11 -12
  227. package/src/modules/editor/test/fixtures.test.js +21 -16
  228. package/src/modules/editor/test/helpers/appMutations/addFilesToPackage.js +4 -4
  229. package/src/modules/editor/test/helpers/appMutations/addFontoManifestToPackage.js +4 -4
  230. package/src/modules/editor/test/helpers/appMutations/addPackage.js +7 -11
  231. package/src/modules/editor/test/helpers/appMutations/generateSpecialFiles.js +2 -2
  232. package/src/modules/editor/test/helpers/appMutations/mutateConfigFontoManifest.js +4 -4
  233. package/src/modules/editor/test/helpers/appMutations/mutatePackageFontoManifest.js +4 -4
  234. package/src/modules/editor/test/helpers/appMutations/removeFilesFromPackage.js +4 -4
  235. package/src/modules/editor/test/helpers/appMutations/removePackage.js +5 -5
  236. package/src/modules/editor/test/helpers/assertFixtureSnapshot.js +8 -6
  237. package/src/modules/editor/test/helpers/createAppStructure.js +8 -4
  238. package/src/modules/editor/test/helpers/createTempDirectory.js +3 -3
  239. package/src/modules/editor/test/helpers/createWebpackWatch.js +21 -22
  240. package/src/modules/editor/test/helpers/normaliseLineEndings.js +2 -2
  241. package/src/modules/editor-pre-7-7-0/index.js +19 -23
  242. package/src/modules/editor-pre-7-7-0/package.json +2 -1
  243. package/src/modules/editor-pre-7-7-0/src/api/addCommentToAstNode.js +6 -9
  244. package/src/modules/editor-pre-7-7-0/src/api/addonsAddDependencies.js +1 -3
  245. package/src/modules/editor-pre-7-7-0/src/api/createMessageTemplate.js +4 -6
  246. package/src/modules/editor-pre-7-7-0/src/api/createPackageDirectoryPath.js +4 -6
  247. package/src/modules/editor-pre-7-7-0/src/api/createPrettifiedCode.js +12 -8
  248. package/src/modules/editor-pre-7-7-0/src/api/downloadEditorSDK.js +3 -5
  249. package/src/modules/editor-pre-7-7-0/src/api/executeAndLog.js +4 -6
  250. package/src/modules/editor-pre-7-7-0/src/api/extractZip.js +4 -6
  251. package/src/modules/editor-pre-7-7-0/src/api/getAddonLabel.js +2 -4
  252. package/src/modules/editor-pre-7-7-0/src/api/getAddonLabels.js +3 -5
  253. package/src/modules/editor-pre-7-7-0/src/api/getAddonLabelsForChanges.js +4 -6
  254. package/src/modules/editor-pre-7-7-0/src/api/getAddonsFromEditorSDK.js +2 -4
  255. package/src/modules/editor-pre-7-7-0/src/api/init/checkEditorDestination.js +2 -4
  256. package/src/modules/editor-pre-7-7-0/src/api/init/createConfigConfiguration.js +13 -11
  257. package/src/modules/editor-pre-7-7-0/src/api/init/createConfigFontoManifest.js +3 -5
  258. package/src/modules/editor-pre-7-7-0/src/api/init/createSchemaExperienceResolver.js +11 -8
  259. package/src/modules/editor-pre-7-7-0/src/api/inquirerPrompts.js +20 -30
  260. package/src/modules/editor-pre-7-7-0/src/api/npmInstall.js +5 -7
  261. package/src/modules/editor-pre-7-7-0/src/api/promptForVersionAndDownloadEditorSDK.js +8 -11
  262. package/src/modules/editor-pre-7-7-0/src/api/schema/buildSchemaExperienceConfigurationModel.js +2 -6
  263. package/src/modules/editor-pre-7-7-0/src/api/schema/checkIfCompiledSchemaOverwritesFiles.js +3 -5
  264. package/src/modules/editor-pre-7-7-0/src/api/schema/compile.js +3 -5
  265. package/src/modules/editor-pre-7-7-0/src/api/schema/createCommentsForElement.js +6 -10
  266. package/src/modules/editor-pre-7-7-0/src/api/schema/createSchemaExperiencePackages.js +13 -15
  267. package/src/modules/editor-pre-7-7-0/src/api/schema/createSchemaPackages.js +7 -11
  268. package/src/modules/editor-pre-7-7-0/src/api/schema/getPrefixByNamespaceUri.js +4 -6
  269. package/src/modules/editor-pre-7-7-0/src/api/schema/getSchemaFontoJson.js +5 -7
  270. package/src/modules/editor-pre-7-7-0/src/api/schema/getVersionedSchemaCompilerBaseUrl.js +4 -5
  271. package/src/modules/editor-pre-7-7-0/src/api/schema/zipHelpers.js +6 -8
  272. package/src/modules/editor-pre-7-7-0/src/api/updateManifest.js +2 -4
  273. package/src/modules/editor-pre-7-7-0/src/api/upgrade/getMajorVersion.js +1 -5
  274. package/src/modules/editor-pre-7-7-0/src/api/upgrade/preprocessData.js +3 -5
  275. package/src/modules/editor-pre-7-7-0/src/api/upgrade/updateConfigFontoManifest.js +2 -4
  276. package/src/modules/editor-pre-7-7-0/src/api/validateAddons.js +1 -3
  277. package/src/modules/editor-pre-7-7-0/src/api/validateManifest.js +1 -3
  278. package/src/modules/editor-pre-7-7-0/src/api/writeAstProgramToFile.js +7 -6
  279. package/src/modules/editor-pre-7-7-0/src/command.addons.controller.js +18 -25
  280. package/src/modules/editor-pre-7-7-0/src/command.addons.js +10 -3
  281. package/src/modules/editor-pre-7-7-0/src/command.build.controller.js +6 -8
  282. package/src/modules/editor-pre-7-7-0/src/command.build.js +10 -3
  283. package/src/modules/editor-pre-7-7-0/src/command.init.controller.js +33 -36
  284. package/src/modules/editor-pre-7-7-0/src/command.init.js +10 -3
  285. package/src/modules/editor-pre-7-7-0/src/command.run.controller.js +6 -8
  286. package/src/modules/editor-pre-7-7-0/src/command.run.js +10 -3
  287. package/src/modules/editor-pre-7-7-0/src/command.schema.compile.controller.js +10 -12
  288. package/src/modules/editor-pre-7-7-0/src/command.schema.compile.js +10 -3
  289. package/src/modules/editor-pre-7-7-0/src/command.upgrade.controller.js +24 -31
  290. package/src/modules/editor-pre-7-7-0/src/command.upgrade.js +10 -3
  291. package/src/modules/editor-pre-7-7-0/src/command.versions.controller.js +2 -4
  292. package/src/modules/editor-pre-7-7-0/src/command.versions.js +10 -3
  293. package/src/modules/editor-pre-7-7-0/test/api/schema/buildSchemaExperienceConfigurationModel.test.js +19 -18
  294. package/src/modules/editor-pre-7-7-0/test/api/schema/createCommentsForElement.test.js +7 -10
  295. package/src/modules/editor-pre-7-7-0/test/api/schema/getPrefixByNamespaceUri.test.js +3 -6
  296. package/src/modules/editor-pre-7-7-0/test/api/schema/testHelpers.js +5 -14
  297. package/src/modules/editor-pre-7-7-0/test/api/schema/zipSchemaSource.test.js +9 -7
  298. package/src/modules/localization/index.js +13 -13
  299. package/src/modules/localization/package.json +2 -1
  300. package/src/modules/localization/src/api/Message.js +3 -3
  301. package/src/modules/localization/src/api/createMessagesTable.js +3 -5
  302. package/src/modules/localization/src/api/deduplicateMessages.js +2 -2
  303. package/src/modules/localization/src/api/extractMessages.js +5 -5
  304. package/src/modules/localization/src/api/getMessagesFromOperation.js +3 -3
  305. package/src/modules/localization/src/api/getMessagesFromSource.js +9 -4
  306. package/src/modules/localization/src/api/getOperationMessages.js +9 -9
  307. package/src/modules/localization/src/api/getSourceMessages.js +9 -8
  308. package/src/modules/localization/src/api/index.js +10 -5
  309. package/src/modules/localization/src/api/loadMessageBundle.js +6 -5
  310. package/src/modules/localization/src/api/{parser.js → parser.cjs} +0 -0
  311. package/src/modules/localization/src/api/promiseUtils.js +1 -1
  312. package/src/modules/localization/src/api/updateMessagesWithTemplate.js +2 -2
  313. package/src/modules/localization/src/command.extract.controller.js +7 -9
  314. package/src/modules/localization/src/command.extract.js +10 -3
  315. package/src/modules/localization/src/command.merge.controller.js +7 -9
  316. package/src/modules/localization/src/command.merge.js +10 -3
  317. package/src/modules/localization/src/command.messages.controller.js +5 -7
  318. package/src/modules/localization/src/command.messages.js +11 -4
  319. package/src/modules/localization/src/command.update.controller.js +8 -10
  320. package/src/modules/localization/src/command.update.js +10 -3
  321. package/src/modules/localization/test/api/Message.test.js +3 -3
  322. package/src/modules/localization/test/api/deduplicateMessages.test.js +4 -5
  323. package/src/modules/localization/test/api/getMessagesFromOperation.test.js +3 -4
  324. package/src/modules/localization/test/api/getMessagesFromSource.test.js +3 -4
  325. package/src/modules/localization/test/api/parser.test.js +3 -2
  326. package/src/modules/localization/test/api/promiseUtils.test.js +2 -2
  327. package/src/modules/localization/test/api/roundtripThroughJson.js +2 -2
  328. package/src/modules/localization/test/api/updateMessagesWithTemplate.test.js +4 -5
  329. package/src/modules/localization/test/command.extract.test.js +11 -10
  330. package/src/modules/localization/test/command.merge.test.js +11 -10
  331. package/src/modules/localization/test/command.messages.test.js +10 -9
  332. package/src/modules/localization/test/command.update.test.js +11 -10
  333. package/src/modules/localization/test/index.test.js +15 -14
  334. package/src/modules/localization/test/promiseUtils.test.js +2 -4
  335. package/src/modules/operations/index.js +5 -6
  336. package/src/modules/operations/package.json +2 -1
  337. package/src/modules/operations/src/api/createOperationsTable.js +3 -5
  338. package/src/modules/operations/src/api/getOperation.js +3 -5
  339. package/src/modules/operations/src/api/getOperations.js +12 -14
  340. package/src/modules/operations/src/command.operation.controller.js +3 -5
  341. package/src/modules/operations/src/command.operation.js +10 -3
  342. package/src/modules/operations/src/command.operations.controller.js +4 -6
  343. package/src/modules/operations/src/command.operations.js +11 -4
  344. package/src/modules/operations/test/command.operation.test.js +10 -9
  345. package/src/modules/operations/test/command.operations.test.js +11 -9
  346. package/src/modules/operations/test/getOperation.test.js +6 -4
  347. package/src/modules/operations/test/getOperations.test.js +6 -4
  348. package/src/modules/operations/test/index.test.js +11 -11
  349. package/src/modules/review/index.js +13 -10
  350. package/src/modules/review/package.json +2 -1
  351. package/src/modules/review/src/command.build.controller.js +13 -15
  352. package/src/modules/review/src/command.build.js +11 -4
  353. package/src/modules/review/src/command.download-self-contained.controller.js +6 -8
  354. package/src/modules/review/src/command.download-self-contained.js +10 -3
  355. package/src/modules/review/src/command.init.controller.js +7 -9
  356. package/src/modules/review/src/command.init.js +10 -3
  357. package/src/modules/review/src/command.run.controller.js +14 -16
  358. package/src/modules/review/src/command.run.js +8 -4
  359. package/src/modules/review/src/command.upgrade.controller.js +8 -10
  360. package/src/modules/review/src/command.upgrade.js +10 -3
  361. package/src/modules/review/src/command.versions.controller.js +2 -4
  362. package/src/modules/review/src/command.versions.js +10 -3
  363. package/src/modules/review/src/utilities/FontoxmlReviewManifest.js +2 -6
  364. package/src/modules/review/src/utilities/cleanup.js +6 -8
  365. package/src/modules/review/src/utilities/constants.js +5 -3
  366. package/src/modules/review/src/utilities/copyWhitelistedFiles.js +4 -6
  367. package/src/modules/review/src/utilities/executeAndLog.js +4 -5
  368. package/src/modules/review/src/utilities/getVerbosityLevel.js +3 -5
  369. package/src/modules/review/src/utilities/getWhitelist.js +5 -7
  370. package/src/modules/review/src/utilities/setEntryVisibility.js +3 -14
  371. package/src/modules/review/src/utilities/validateInstance.js +6 -8
  372. package/src/modules/schema/index.js +16 -24
  373. package/src/modules/schema/package.json +2 -1
  374. package/src/modules/schema/src/api/AttributeSummary.js +2 -4
  375. package/src/modules/schema/src/api/ElementSummary.js +2 -4
  376. package/src/modules/schema/src/api/SchemaSummary.js +11 -10
  377. package/src/modules/schema/src/api/SimpleTypeSummary.js +3 -5
  378. package/src/modules/schema/src/api/createAttributesTable.js +3 -5
  379. package/src/modules/schema/src/api/createElementsTable.js +3 -5
  380. package/src/modules/schema/src/api/createSchemasTable.js +4 -6
  381. package/src/modules/schema/src/api/createSimpleTypesTable.js +3 -5
  382. package/src/modules/schema/src/api/getClosestMatchingSchemaSummary.js +7 -9
  383. package/src/modules/schema/src/api/getSchemaSummaries.js +5 -7
  384. package/src/modules/schema/src/command.attribute.controller.js +3 -5
  385. package/src/modules/schema/src/command.attribute.js +10 -3
  386. package/src/modules/schema/src/command.attributes.controller.js +4 -6
  387. package/src/modules/schema/src/command.attributes.js +11 -4
  388. package/src/modules/schema/src/command.element.controller.js +4 -6
  389. package/src/modules/schema/src/command.element.js +10 -3
  390. package/src/modules/schema/src/command.elements.controller.js +4 -6
  391. package/src/modules/schema/src/command.elements.js +11 -4
  392. package/src/modules/schema/src/command.schemas.controller.js +4 -6
  393. package/src/modules/schema/src/command.schemas.js +11 -4
  394. package/src/modules/schema/src/command.simpletypes.controller.js +4 -6
  395. package/src/modules/schema/src/command.simpletypes.js +11 -4
  396. package/src/modules/schema/src/helpers/renderSimpleType.js +3 -5
  397. package/src/modules/schema/src/helpers/restrictionFormatter.js +2 -4
  398. package/src/modules/schema/test/AttributeSummary.test.js +3 -5
  399. package/src/modules/schema/test/ElementSummary.test.js +3 -5
  400. package/src/modules/schema/test/SchemaSummary.test.js +9 -7
  401. package/src/modules/schema/test/SimpleTypeSummary.test.js +3 -5
  402. package/src/modules/schema/test/command.attribute.test.js +14 -12
  403. package/src/modules/schema/test/command.attributes.test.js +14 -12
  404. package/src/modules/schema/test/command.element.test.js +14 -12
  405. package/src/modules/schema/test/command.elements.test.js +14 -12
  406. package/src/modules/schema/test/command.schemas.test.js +10 -9
  407. package/src/modules/schema/test/command.simpletypes.test.js +10 -9
  408. package/src/modules/schema/test/getClosestMatchingSchemaSummary.test.js +6 -4
  409. package/src/modules/schema/test/getSchemaSummaries.test.js +6 -4
  410. package/src/modules/schema/test/index.test.js +37 -37
  411. package/src/modules/schema/test/renderSimpleType.test.js +12 -13
  412. package/src/modules/schema/test/restrictionFormatter.test.js +3 -5
  413. package/src/modules/schema-compiler/index.js +13 -10
  414. package/src/modules/schema-compiler/package.json +2 -1
  415. package/src/modules/schema-compiler/src/command.build.controller.js +12 -15
  416. package/src/modules/schema-compiler/src/command.build.js +11 -4
  417. package/src/modules/schema-compiler/src/command.download-self-contained.controller.js +6 -8
  418. package/src/modules/schema-compiler/src/command.download-self-contained.js +10 -3
  419. package/src/modules/schema-compiler/src/command.init.controller.js +7 -9
  420. package/src/modules/schema-compiler/src/command.init.js +10 -3
  421. package/src/modules/schema-compiler/src/command.run.controller.js +14 -16
  422. package/src/modules/schema-compiler/src/command.run.js +6 -4
  423. package/src/modules/schema-compiler/src/command.upgrade.controller.js +8 -10
  424. package/src/modules/schema-compiler/src/command.upgrade.js +10 -3
  425. package/src/modules/schema-compiler/src/command.versions.controller.js +2 -4
  426. package/src/modules/schema-compiler/src/command.versions.js +10 -3
  427. package/src/modules/schema-compiler/src/utilities/FontoxmlSchemaCompilerManifest.js +2 -6
  428. package/src/modules/schema-compiler/src/utilities/cleanup.js +6 -8
  429. package/src/modules/schema-compiler/src/utilities/constants.js +5 -3
  430. package/src/modules/schema-compiler/src/utilities/copyWhitelistedFiles.js +4 -6
  431. package/src/modules/schema-compiler/src/utilities/executeAndLog.js +4 -5
  432. package/src/modules/schema-compiler/src/utilities/getVerbosityLevel.js +3 -5
  433. package/src/modules/schema-compiler/src/utilities/getWhitelist.js +5 -7
  434. package/src/modules/schema-compiler/src/utilities/setEntryVisibility.js +3 -14
  435. package/src/modules/schema-compiler/src/utilities/validateInstance.js +6 -8
  436. package/src/modules/spell-checker/index.js +13 -10
  437. package/src/modules/spell-checker/package.json +2 -1
  438. package/src/modules/spell-checker/src/command.build.controller.js +13 -15
  439. package/src/modules/spell-checker/src/command.build.js +11 -4
  440. package/src/modules/spell-checker/src/command.download-self-contained.controller.js +6 -8
  441. package/src/modules/spell-checker/src/command.download-self-contained.js +10 -3
  442. package/src/modules/spell-checker/src/command.init.controller.js +7 -9
  443. package/src/modules/spell-checker/src/command.init.js +10 -3
  444. package/src/modules/spell-checker/src/command.run.controller.js +13 -15
  445. package/src/modules/spell-checker/src/command.run.js +8 -4
  446. package/src/modules/spell-checker/src/command.upgrade.controller.js +8 -10
  447. package/src/modules/spell-checker/src/command.upgrade.js +10 -3
  448. package/src/modules/spell-checker/src/command.versions.controller.js +2 -4
  449. package/src/modules/spell-checker/src/command.versions.js +10 -3
  450. package/src/modules/spell-checker/src/utilities/FontoxmlSpellCheckerManifest.js +2 -6
  451. package/src/modules/spell-checker/src/utilities/cleanup.js +6 -8
  452. package/src/modules/spell-checker/src/utilities/constants.js +5 -3
  453. package/src/modules/spell-checker/src/utilities/copyWhitelistedFiles.js +4 -6
  454. package/src/modules/spell-checker/src/utilities/executeAndLog.js +4 -5
  455. package/src/modules/spell-checker/src/utilities/getVerbosityLevel.js +3 -5
  456. package/src/modules/spell-checker/src/utilities/getWhitelist.js +5 -7
  457. package/src/modules/spell-checker/src/utilities/setEntryVisibility.js +3 -14
  458. package/src/modules/spell-checker/src/utilities/validateInstance.js +6 -8
  459. package/src/response/FdtResponse.js +8 -13
  460. package/src/response/extras.js +3 -5
  461. package/src/response/primitives.js +4 -4
  462. package/test/App.test.js +113 -93
  463. package/test/AssertableWritableStream.test.js +3 -8
  464. package/test/FdtCommand.test.js +9 -7
  465. package/test/FdtTable.test.js +12 -11
  466. package/test/app/invalid-module-1/index.js +1 -1
  467. package/test/app/invalid-module-1/package.json +1 -0
  468. package/test/app/test-module-1/index.js +1 -1
  469. package/test/app/test-module-1/package.json +1 -0
  470. package/test/app/test-module-2/index.js +12 -7
  471. package/test/app/test-module-2/package.json +1 -0
  472. package/test/app/test-module-2/src/testLazyLoadCommand.js +2 -4
  473. package/test/app/test-module-2-duplicate/index.js +1 -3
  474. package/test/app/test-module-2-duplicate/package.json +1 -0
  475. package/test/app-pre-7-7-0/config.js +1 -1
  476. package/test/app-with-configjs/config.js +1 -1
  477. package/test/module.core.test.js +39 -29
@@ -1,14 +1,18 @@
1
1
  // @TODO: @TS: Remove file extensions from imports in generated files when
2
2
  // supporting TS configuration.
3
3
 
4
- const { types: t, template } = require('@babel/core');
5
- const os = require('os');
4
+ import babel from '@babel/core';
5
+ import os from 'os';
6
6
 
7
- const SchemaSummary = require('../../../../schema/src/api/SchemaSummary');
7
+ import SchemaSummary from '../../../../schema/src/api/SchemaSummary.js';
8
+ import addCommentToAstNode, {
9
+ trickRecastIntoKeepingStatementsTogether,
10
+ } from '../addCommentToAstNode.js';
11
+ import createPrettifiedCode from '../createPrettifiedCode.js';
12
+ import writeAstProgramToFile from '../writeAstProgramToFile.js';
8
13
 
9
- const addCommentToAstNode = require('../addCommentToAstNode');
10
- const createPrettifiedCode = require('../createPrettifiedCode');
11
- const writeAstProgramToFile = require('../writeAstProgramToFile');
14
+ const t = babel.types;
15
+ const template = babel.template;
12
16
 
13
17
  // Babel templates.
14
18
  const buildConfigurationManagerImport = template(
@@ -112,7 +116,7 @@ async function addUniqueIdGenerationConfigurations(
112
116
  *
113
117
  * @return {Promise}
114
118
  */
115
- async function createConfigConfiguration(
119
+ export default async function createConfigConfiguration(
116
120
  configConfigurationJsFilePath,
117
121
  prefixByNamespaceUri,
118
122
  addons,
@@ -133,7 +137,7 @@ async function createConfigConfiguration(
133
137
  'For more information:',
134
138
  'https://documentation.fontoxml.com/latest/configurationmanager-3e0d8dbacb90',
135
139
  ]);
136
- addCommentToAstNode.trickRecastIntoKeepingStatementsTogether(
140
+ trickRecastIntoKeepingStatementsTogether(
137
141
  configurationManagerImportStatement
138
142
  );
139
143
  importStatements.push(configurationManagerImportStatement);
@@ -249,7 +253,7 @@ async function createConfigConfiguration(
249
253
  'https://documentation.fontoxml.com/latest/namespacemanager-c80956c5d6d7',
250
254
  'https://documentation.fontoxml.com/latest/namespaces-2b1bbc7b4f79',
251
255
  ]);
252
- addCommentToAstNode.trickRecastIntoKeepingStatementsTogether(
256
+ trickRecastIntoKeepingStatementsTogether(
253
257
  namespaceConfigurationStatement
254
258
  );
255
259
  }
@@ -268,5 +272,3 @@ async function createConfigConfiguration(
268
272
  configConfigurationJsAst
269
273
  );
270
274
  }
271
-
272
- module.exports = createConfigConfiguration;
@@ -1,6 +1,4 @@
1
- 'use strict';
2
-
3
- const fs = require('fs-extra');
1
+ import fs from 'fs-extra';
4
2
 
5
3
  /**
6
4
  * Creates the config/fonto-manifest.js file.
@@ -11,7 +9,7 @@ const fs = require('fs-extra');
11
9
  *
12
10
  * @return {Promise}
13
11
  */
14
- module.exports = async function createConfigFontoManifest(
12
+ export default async function createConfigFontoManifest(
15
13
  manifestPath,
16
14
  addons,
17
15
  editorPackages
@@ -37,4 +35,4 @@ module.exports = async function createConfigFontoManifest(
37
35
 
38
36
  const configManifest = { dependencies };
39
37
  await fs.writeJson(manifestPath, configManifest, { spaces: '\t' });
40
- };
38
+ }
@@ -1,10 +1,15 @@
1
1
  // @TODO: @TS: Remove file extensions from imports in generated files when
2
2
  // supporting TS configuration.
3
3
 
4
- const { types: t, template } = require('@babel/core');
5
- const writeAstProgramToFile = require('../writeAstProgramToFile');
4
+ import babel from '@babel/core';
6
5
 
7
- const addCommentToAstNode = require('../addCommentToAstNode');
6
+ import addCommentToAstNode, {
7
+ trickRecastIntoKeepingStatementsTogether,
8
+ } from '../addCommentToAstNode.js';
9
+ import writeAstProgramToFile from '../writeAstProgramToFile.js';
10
+
11
+ const t = babel.types;
12
+ const template = babel.template;
8
13
 
9
14
  // Babel templates.
10
15
  const buildConfigurationManagerImport = template(
@@ -127,7 +132,7 @@ async function addStatementsForSchemaLocationToSchemaExperienceResolver(
127
132
  'For more information:',
128
133
  'https://documentation.fontoxml.com/latest/schemalocationtoschemaexperienceresolver-531427aaf9f1',
129
134
  ]);
130
- addCommentToAstNode.trickRecastIntoKeepingStatementsTogether(
135
+ trickRecastIntoKeepingStatementsTogether(
131
136
  schemaLocationToSchemaExperienceResolverInstance
132
137
  );
133
138
 
@@ -191,7 +196,7 @@ async function addStatementsForSchemaLocationToSchemaExperienceResolver(
191
196
  *
192
197
  * @return {Promise}
193
198
  */
194
- async function createSchemaExperienceResolver(
199
+ export default async function createSchemaExperienceResolver(
195
200
  configSchemaExperienceResolverJsFilePath,
196
201
  schemaPackagesByXsdPath
197
202
  ) {
@@ -206,7 +211,7 @@ async function createSchemaExperienceResolver(
206
211
  'https://documentation.fontoxml.com/latest/schema-experiences-7d818ffb9db5',
207
212
  'https://documentation.fontoxml.com/latest/sxmanager-5600d67cb175',
208
213
  ]);
209
- addCommentToAstNode.trickRecastIntoKeepingStatementsTogether(
214
+ trickRecastIntoKeepingStatementsTogether(
210
215
  configurationManagerImportStatement
211
216
  );
212
217
 
@@ -246,5 +251,3 @@ async function createSchemaExperienceResolver(
246
251
  configSchemaExperienceResolverJsAst
247
252
  );
248
253
  }
249
-
250
- module.exports = createSchemaExperienceResolver;
@@ -1,22 +1,14 @@
1
- 'use strict';
2
-
3
- const fs = require('fs');
4
- const path = require('path');
5
-
6
- const chalk = require('chalk');
7
- const compareVersions = require('compare-versions');
8
- const figures = require('figures');
9
- const wrapAnsi = require('wrap-ansi');
10
-
11
- const inquirer = require('inquirer');
12
- inquirer.registerPrompt(
13
- 'checkbox-plus',
14
- require('inquirer-checkbox-plus-prompt')
15
- );
16
-
17
- const addonsAddDependencies = require('./addonsAddDependencies');
18
- const getAddonLabels = require('./getAddonLabels');
19
- const getAddonLabelsForChanges = require('./getAddonLabelsForChanges');
1
+ import chalk from 'chalk';
2
+ import compareVersions from 'compare-versions';
3
+ import figures from 'figures';
4
+ import fs from 'fs';
5
+ import inquirer from 'inquirer';
6
+ import path from 'path';
7
+ import wrapAnsi from 'wrap-ansi';
8
+
9
+ import addonsAddDependencies from './addonsAddDependencies.js';
10
+ import getAddonLabels from './getAddonLabels.js';
11
+ import getAddonLabelsForChanges from './getAddonLabelsForChanges.js';
20
12
 
21
13
  const DEFAULT_STDOUT_COLUMNS = 30;
22
14
 
@@ -117,6 +109,11 @@ async function promptSchema({ data }) {
117
109
  }
118
110
 
119
111
  async function promptAddons({ data, sdkAddons, fdtLicense }) {
112
+ inquirer.registerPrompt(
113
+ 'checkbox-plus',
114
+ (await import('inquirer-checkbox-plus-prompt')).default
115
+ );
116
+
120
117
  const promptAnswers = await inquirer.prompt([
121
118
  {
122
119
  name: 'addons',
@@ -300,7 +297,7 @@ async function promptInitReview(options) {
300
297
  }
301
298
  }
302
299
 
303
- async function promptEditorInitFlow(options) {
300
+ export async function promptEditorInitFlow(options) {
304
301
  const steps = [
305
302
  {
306
303
  name: 'name',
@@ -405,7 +402,7 @@ async function promptUpgradeReview(options) {
405
402
  }
406
403
  }
407
404
 
408
- async function promptEditorUpgradeFlow(options) {
405
+ export async function promptEditorUpgradeFlow(options) {
409
406
  const reviewResult = await promptUpgradeReview(options);
410
407
  if (reviewResult === false) {
411
408
  return false;
@@ -481,7 +478,7 @@ async function promptChangeAddonsReview(options) {
481
478
  }
482
479
  }
483
480
 
484
- async function promptEditorChangeAddonsFlow(options) {
481
+ export async function promptEditorChangeAddonsFlow(options) {
485
482
  if (!options.skipAllSteps) {
486
483
  await promptAddons(options);
487
484
  }
@@ -534,7 +531,7 @@ async function promptEditorSDKVersionReview(options) {
534
531
  }
535
532
  }
536
533
 
537
- async function promptEditorSDKVersionFlow(options) {
534
+ export async function promptEditorSDKVersionFlow(options) {
538
535
  if (!options.skipAllSteps) {
539
536
  await promptEditorSDKVersion(options);
540
537
  if (options.skipReview) {
@@ -549,10 +546,3 @@ async function promptEditorSDKVersionFlow(options) {
549
546
 
550
547
  return options.data;
551
548
  }
552
-
553
- module.exports = {
554
- promptEditorInitFlow,
555
- promptEditorUpgradeFlow,
556
- promptEditorChangeAddonsFlow,
557
- promptEditorSDKVersionFlow,
558
- };
@@ -1,11 +1,9 @@
1
- 'use strict';
1
+ import fs from 'fs-extra';
2
+ import path from 'path';
2
3
 
3
- const fs = require('fs-extra');
4
- const path = require('path');
4
+ import executeAndLog from './executeAndLog.js';
5
5
 
6
- const executeAndLog = require('./executeAndLog');
7
-
8
- module.exports = async function npmInstall(currentWorkingDirectoryPath, res) {
6
+ export default async function npmInstall(currentWorkingDirectoryPath, res) {
9
7
  try {
10
8
  await fs.access(
11
9
  path.join(currentWorkingDirectoryPath, 'package.json'),
@@ -39,4 +37,4 @@ module.exports = async function npmInstall(currentWorkingDirectoryPath, res) {
39
37
  destroySpinner();
40
38
  }
41
39
  }
42
- };
40
+ }
@@ -1,7 +1,5 @@
1
- 'use strict';
2
-
3
- const downloadEditorSDK = require('./downloadEditorSDK');
4
- const inquirerPrompts = require('./inquirerPrompts');
1
+ import downloadEditorSDK from './downloadEditorSDK.js';
2
+ import { promptEditorSDKVersionFlow } from './inquirerPrompts.js';
5
3
 
6
4
  /**
7
5
  * Prompt for version and download the Fonto Editor SDK for that version, prompts for new input or
@@ -12,13 +10,13 @@ const inquirerPrompts = require('./inquirerPrompts');
12
10
  *
13
11
  * @return {Promise<{ downloadedSDK: any, sdkVersion: string }>}
14
12
  */
15
- module.exports = async function promptForVersionAndDownloadEditorSDK(req, res) {
13
+ export default async function promptForVersionAndDownloadEditorSDK(req, res) {
16
14
  const data = { sdkVersion: null };
17
15
  const options = {
18
16
  data,
19
17
  skipReview: true,
20
18
  };
21
- await inquirerPrompts.promptEditorSDKVersionFlow(options);
19
+ await promptEditorSDKVersionFlow(options);
22
20
 
23
21
  let downloadedSDK;
24
22
 
@@ -40,10 +38,9 @@ module.exports = async function promptForVersionAndDownloadEditorSDK(req, res) {
40
38
  data,
41
39
  skipAllSteps: true,
42
40
  };
43
- const promptResult =
44
- await inquirerPrompts.promptEditorSDKVersionFlow(
45
- reviewInputOptions
46
- );
41
+ const promptResult = await promptEditorSDKVersionFlow(
42
+ reviewInputOptions
43
+ );
47
44
 
48
45
  // User opted to quit.
49
46
  if (promptResult === false) {
@@ -59,4 +56,4 @@ module.exports = async function promptForVersionAndDownloadEditorSDK(req, res) {
59
56
  }
60
57
 
61
58
  return await downloadEditorSDKOrReviewInput();
62
- };
59
+ }
@@ -1,6 +1,4 @@
1
- 'use strict';
2
-
3
- const SchemaSummary = require('../../../../schema/src/api/SchemaSummary');
1
+ import SchemaSummary from '../../../../schema/src/api/SchemaSummary.js';
4
2
 
5
3
  /**
6
4
  * Creates a schema experience package name based on a schema package name.
@@ -48,7 +46,7 @@ function createSchemaExperiencePackageName(
48
46
  *
49
47
  * @return {SxPackage[]} The schema experience configuration model.
50
48
  */
51
- function buildSchemaExperienceConfigurationModel(
49
+ export default function buildSchemaExperienceConfigurationModel(
52
50
  schemaPackagesByXsdPath,
53
51
  compiledSchemaResultsByXsdPath,
54
52
  prefixByNamespaceUri
@@ -168,5 +166,3 @@ function buildSchemaExperienceConfigurationModel(
168
166
 
169
167
  return schemaExperiencePackages;
170
168
  }
171
-
172
- module.exports = buildSchemaExperienceConfigurationModel;
@@ -1,5 +1,5 @@
1
- const fs = require('fs-extra');
2
- const path = require('path');
1
+ import fs from 'fs-extra';
2
+ import path from 'path';
3
3
 
4
4
  /**
5
5
  * Check if the schema package already exists.
@@ -61,7 +61,7 @@ async function checkWhichPackageFilesExist(
61
61
  *
62
62
  * @return {Promise<Array<string>>}
63
63
  */
64
- async function checkIfCompiledSchemaOverwritesFiles(
64
+ export default async function checkIfCompiledSchemaOverwritesFiles(
65
65
  outputPath,
66
66
  schemaPackagesByXsdPath,
67
67
  includeManifestJson = false
@@ -79,5 +79,3 @@ async function checkIfCompiledSchemaOverwritesFiles(
79
79
 
80
80
  return existingPackagesFilePaths;
81
81
  }
82
-
83
- module.exports = checkIfCompiledSchemaOverwritesFiles;
@@ -1,7 +1,5 @@
1
- 'use strict';
2
-
3
- const requestPromise = require('request-promise-native');
4
- const url = require('url');
1
+ import requestPromise from 'request-promise-native';
2
+ import url from 'url';
5
3
 
6
4
  /**
7
5
  * Compile a schema zip archive using the schema compile service.
@@ -11,7 +9,7 @@ const url = require('url');
11
9
  *
12
10
  * @return {Promise<Object>} The response from the schema compile service.
13
11
  */
14
- module.exports = async (baseUrl, compressedSchema) => {
12
+ export default async (baseUrl, compressedSchema) => {
15
13
  let response;
16
14
  try {
17
15
  response = await requestPromise.post(
@@ -1,5 +1,3 @@
1
- 'use strict';
2
-
3
1
  /**
4
2
  * Compare the items of multiple arrays for equality.
5
3
  *
@@ -7,7 +5,7 @@
7
5
  *
8
6
  * @return {boolean}
9
7
  */
10
- function compareArrays(arrays) {
8
+ export function compareArrays(arrays) {
11
9
  const firstArray = arrays[0];
12
10
  return (
13
11
  arrays.every((array) => array.length === firstArray.length) &&
@@ -28,7 +26,7 @@ function compareArrays(arrays) {
28
26
  *
29
27
  * @return {string[]|null}
30
28
  */
31
- function convertStringsToWrappedLines(
29
+ export function convertStringsToWrappedLines(
32
30
  items,
33
31
  lineWidth = 93,
34
32
  seperator = ', ',
@@ -79,7 +77,10 @@ function convertStringsToWrappedLines(
79
77
  *
80
78
  * @return {string[]}
81
79
  */
82
- function createCommentsForElement(element, prefixByNamespaceUri) {
80
+ export default function createCommentsForElement(
81
+ element,
82
+ prefixByNamespaceUri
83
+ ) {
83
84
  const comments = [];
84
85
 
85
86
  // Element localName, optionally with prefix.
@@ -201,8 +202,3 @@ function createCommentsForElement(element, prefixByNamespaceUri) {
201
202
 
202
203
  return comments;
203
204
  }
204
-
205
- module.exports = createCommentsForElement;
206
-
207
- module.exports.compareArrays = compareArrays;
208
- module.exports.convertStringsToWrappedLines = convertStringsToWrappedLines;
@@ -1,20 +1,20 @@
1
1
  // @TODO: @TS: Remove file extensions from imports in generated files when
2
2
  // supporting TS configuration.
3
3
 
4
- 'use strict';
4
+ import babel from '@babel/core';
5
+ import fs from 'fs-extra';
6
+ import os from 'os';
7
+ import path from 'path';
5
8
 
6
- const { types: t, template } = require('@babel/core');
7
- const fs = require('fs-extra');
8
- const os = require('os');
9
- const path = require('path');
9
+ import addCommentToAstNode from '../addCommentToAstNode.js';
10
+ import createPackageDirectoryPath from '../createPackageDirectoryPath.js';
11
+ import createPrettifiedCode from '../createPrettifiedCode.js';
12
+ import writeAstProgramToFile from '../writeAstProgramToFile.js';
13
+ import buildSchemaExperienceConfigurationModel from './buildSchemaExperienceConfigurationModel.js';
14
+ import createCommentsForElement from './createCommentsForElement.js';
10
15
 
11
- const addCommentToAstNode = require('../addCommentToAstNode');
12
- const createPackageDirectoryPath = require('../createPackageDirectoryPath');
13
- const createPrettifiedCode = require('../createPrettifiedCode');
14
- const writeAstProgramToFile = require('../writeAstProgramToFile');
15
-
16
- const buildSchemaExperienceConfigurationModel = require('./buildSchemaExperienceConfigurationModel');
17
- const createCommentsForElement = require('./createCommentsForElement');
16
+ const t = babel.types;
17
+ const template = babel.template;
18
18
 
19
19
  // Babel templates.
20
20
  const buildConfigureAsRemoved = template(
@@ -342,7 +342,7 @@ async function createSchemaExperiencePivotModelTranslationPackage(
342
342
  *
343
343
  * @return {Promise}
344
344
  */
345
- async function createSchemaExperiencePackages(
345
+ export default async function createSchemaExperiencePackages(
346
346
  outputPath,
347
347
  schemaPackagesByXsdPath,
348
348
  compiledSchemaResultsByXsdPath,
@@ -376,5 +376,3 @@ async function createSchemaExperiencePackages(
376
376
  PIVOT_MODEL_TRANSLATION_PACKAGE_NAME,
377
377
  ];
378
378
  }
379
-
380
- module.exports = createSchemaExperiencePackages;
@@ -1,11 +1,9 @@
1
- 'use strict';
1
+ import babel from '@babel/core';
2
+ import fs from 'fs-extra';
3
+ import path from 'path';
2
4
 
3
- const babel = require('@babel/core');
4
- const fs = require('fs-extra');
5
- const path = require('path');
6
-
7
- const createPackageDirectoryPath = require('../createPackageDirectoryPath');
8
- const writeAstProgramToFile = require('../writeAstProgramToFile');
5
+ import createPackageDirectoryPath from '../createPackageDirectoryPath.js';
6
+ import writeAstProgramToFile from '../writeAstProgramToFile.js';
9
7
 
10
8
  /**
11
9
  * Create a package manifest called fonto-manifest.json for a specific package, if the package
@@ -71,7 +69,7 @@ async function createPackageSchemaLocationsJsFile(
71
69
  packageDirectoryPath,
72
70
  schemaLocations = []
73
71
  ) {
74
- const { types: t } = babel;
72
+ const t = babel.types;
75
73
  // @TODO: @TS: Remove file extensions from imports in generated imports when
76
74
  // supporting TS configuration.
77
75
  const schemaLocationsJsFilePath = path.join(
@@ -141,7 +139,7 @@ async function createSchemaPackageFromCompiledSchemaResults(
141
139
  *
142
140
  * @return {Promise}
143
141
  */
144
- async function createSchemaPackages(
142
+ export default async function createSchemaPackages(
145
143
  outputPath,
146
144
  schemaPackagesByXsdPath,
147
145
  compiledSchemaResultsByXsdPath
@@ -157,5 +155,3 @@ async function createSchemaPackages(
157
155
  })
158
156
  );
159
157
  }
160
-
161
- module.exports = createSchemaPackages;
@@ -1,6 +1,4 @@
1
- 'use strict';
2
-
3
- const SchemaSummary = require('../../../../schema/src/api/SchemaSummary');
1
+ import SchemaSummary from '../../../../schema/src/api/SchemaSummary.js';
4
2
 
5
3
  // Special namespaces for which to use the preferred prefix.
6
4
  const SPECIAL_NAMESPACES = {
@@ -25,7 +23,9 @@ const COMMON_NAMESPACES = {
25
23
  *
26
24
  * @return {Object.<string, string|null>} An object that holds the mapping between namespace URI's and their respective prefix.
27
25
  */
28
- function getPrefixByNamespaceUri(compiledSchemaResultsByXsdPath) {
26
+ export default function getPrefixByNamespaceUri(
27
+ compiledSchemaResultsByXsdPath
28
+ ) {
29
29
  let hasNullNamespaceElements = false;
30
30
 
31
31
  // Get all unique namespaces.
@@ -74,5 +74,3 @@ function getPrefixByNamespaceUri(compiledSchemaResultsByXsdPath) {
74
74
 
75
75
  return prefixesByNamespaceUri;
76
76
  }
77
-
78
- module.exports = getPrefixByNamespaceUri;
@@ -1,8 +1,6 @@
1
- 'use strict';
2
-
3
- const fs = require('fs-extra');
4
- const os = require('os');
5
- const path = require('path');
1
+ import fs from 'fs-extra';
2
+ import os from 'os';
3
+ import path from 'path';
6
4
 
7
5
  /**
8
6
  * Get the schema fonto.json file contents.
@@ -14,7 +12,7 @@ const path = require('path');
14
12
  * @async
15
13
  * @throws If the required directory or files do not exist.
16
14
  */
17
- module.exports = async function getSchemaFontoJson(inputPath) {
15
+ export default async function getSchemaFontoJson(inputPath) {
18
16
  if (!inputPath) {
19
17
  throw new Error('Schema source path is not set.');
20
18
  }
@@ -89,4 +87,4 @@ module.exports = async function getSchemaFontoJson(inputPath) {
89
87
  });
90
88
 
91
89
  return fontoJson;
92
- };
90
+ }
@@ -1,12 +1,13 @@
1
- 'use strict';
2
-
3
1
  /**
4
2
  * Retrieve the URL for the schema compiler for the given Fonto version.
5
3
  *
6
4
  * @param {Buffer} fdtLicense License information.
7
5
  * @param {string} sdkVersion The version of Fonto we are compiling for.
8
6
  */
9
- async function getVersionedSchemaCompilerBaseUrl(fdtLicense, sdkVersion) {
7
+ export default async function getVersionedSchemaCompilerBaseUrl(
8
+ fdtLicense,
9
+ sdkVersion
10
+ ) {
10
11
  const productData = await fdtLicense.getDataForProducts({
11
12
  'schema-compiler': {
12
13
  hosted: {
@@ -16,5 +17,3 @@ async function getVersionedSchemaCompilerBaseUrl(fdtLicense, sdkVersion) {
16
17
  });
17
18
  return productData.products['schema-compiler'].hosted.uri;
18
19
  }
19
-
20
- module.exports = getVersionedSchemaCompilerBaseUrl;
@@ -1,11 +1,9 @@
1
- 'use strict';
1
+ import archiver from 'archiver';
2
+ import fs from 'fs-extra';
3
+ import path from 'path';
4
+ import unzipper from 'unzipper';
2
5
 
3
- const archiver = require('archiver');
4
- const fs = require('fs-extra');
5
- const path = require('path');
6
- const unzipper = require('unzipper');
7
-
8
- const extractZip = require('../extractZip');
6
+ import extractZip from '../extractZip.js';
9
7
 
10
8
  /**
11
9
  * Create a Buffer containing the whole contents of the input path as a zip archive.
@@ -341,7 +339,7 @@ async function extractCompiledSchema(
341
339
  );
342
340
  }
343
341
 
344
- module.exports = {
342
+ export default {
345
343
  // Source schema zip archive
346
344
  zipSchemaSource,
347
345
 
@@ -1,8 +1,6 @@
1
- 'use strict';
1
+ import fs from 'fs-extra';
2
2
 
3
- const fs = require('fs-extra');
4
-
5
- module.exports = async (manifestPath, sdkManifest, addons) => {
3
+ export default async (manifestPath, sdkManifest, addons) => {
6
4
  // Read the file.
7
5
  const manifest = await fs.readJson(manifestPath);
8
6
 
@@ -1,5 +1,3 @@
1
- 'use strict';
2
-
3
1
  function getNightlyMajorVersion(version) {
4
2
  if (version.startsWith('Nightlies for ') || version === 'nightly') {
5
3
  return '7';
@@ -8,7 +6,7 @@ function getNightlyMajorVersion(version) {
8
6
  return null;
9
7
  }
10
8
 
11
- function getMajorVersion(version) {
9
+ export default function getMajorVersion(version) {
12
10
  if (!version || typeof version !== 'string') {
13
11
  throw new Error(
14
12
  `Could not get major version from version "${version}".`
@@ -22,5 +20,3 @@ function getMajorVersion(version) {
22
20
 
23
21
  return parseInt(version.split('.')[0], 10);
24
22
  }
25
-
26
- module.exports = getMajorVersion;
@@ -1,6 +1,4 @@
1
- 'use strict';
2
-
3
- const getMajorVersion = require('./getMajorVersion');
1
+ import getMajorVersion from './getMajorVersion.js';
4
2
 
5
3
  function addAddonIfNotIncluded(addons, addon) {
6
4
  if (!addons.includes(addon)) {
@@ -8,7 +6,7 @@ function addAddonIfNotIncluded(addons, addon) {
8
6
  }
9
7
  }
10
8
 
11
- module.exports = async function preprocessData(
9
+ export default async function preprocessData(
12
10
  data,
13
11
  currentVersion,
14
12
  sdkVersion,
@@ -71,4 +69,4 @@ module.exports = async function preprocessData(
71
69
  }
72
70
  }
73
71
  }
74
- };
72
+ }
@@ -1,8 +1,6 @@
1
- 'use strict';
1
+ import fs from 'fs-extra';
2
2
 
3
- const fs = require('fs-extra');
4
-
5
- module.exports = async (fontoManifestPath, addons) => {
3
+ export default async (fontoManifestPath, addons) => {
6
4
  // Read the file.
7
5
  const fontoManifest = await fs.readJson(fontoManifestPath);
8
6
 
@@ -1,6 +1,4 @@
1
- 'use strict';
2
-
3
- module.exports = (addons, sdkAddons, fdtLicense) => {
1
+ export default (addons, sdkAddons, fdtLicense) => {
4
2
  // Validate add-on names.
5
3
  const enabledAddons = addons.map((addonName) => {
6
4
  const addon = sdkAddons.find(