@fontoxml/fontoxml-development-tools 3.11.0 → 3.12.0-beta.1

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 (196) hide show
  1. package/npm-shrinkwrap.json +3841 -8329
  2. package/package.json +13 -19
  3. package/src/App.js +1 -1
  4. package/src/FdtCommand.js +3 -3
  5. package/src/FdtLicense.js +95 -114
  6. package/src/ModuleRegistrationApi.js +44 -16
  7. package/src/addCoreModulesToApp.js +8 -0
  8. package/src/modules/connectors/index.js +109 -16
  9. package/src/modules/connectors/instanceBuild/Dockerfile.build +1 -1
  10. package/src/modules/connectors/instanceBuild/Dockerfile.run +1 -1
  11. package/src/modules/connectors/instanceDevBuild/docker-compose.yml +2 -2
  12. package/src/modules/content-quality/index.js +101 -20
  13. package/src/modules/content-quality/instanceBuild/Dockerfile +1 -1
  14. package/src/modules/content-quality/instanceDevBuild/docker-compose.yml +1 -1
  15. package/src/modules/core/src/precontroller.help.js +23 -26
  16. package/src/modules/document-history/index.js +101 -20
  17. package/src/modules/document-history/instanceBuild/Dockerfile +1 -1
  18. package/src/modules/document-history/instanceDevBuild/docker-compose.yml +1 -1
  19. package/src/modules/editor/dev-cms/connectors-cms-standard/configureConnectorsCmsStandardDocumentRouter.js +10 -0
  20. package/src/modules/editor/dev-cms/connectors-cms-standard/configureDocumentHistoryGetPostRouteHandler.js +51 -0
  21. package/src/modules/editor/dev-cms/connectors-cms-standard/configureDocumentPostRouteHandler.js +65 -76
  22. package/src/modules/editor/dev-cms/connectors-cms-standard/configureDocumentPresearchPostRouteHandler.js +10 -7
  23. package/src/modules/editor/dev-cms/connectors-cms-standard/configureDocumentPreviewRouteHandler.js +10 -0
  24. package/src/modules/editor/dev-cms/connectors-cms-standard/configureDocumentRevisionGetPostRouteHandler.js +69 -0
  25. package/src/modules/editor/src/commands/command.convert.editor.controller.js +11 -4
  26. package/src/modules/editor/src/commands/command.convert.package.controller.js +11 -4
  27. package/src/modules/editor/src/getWebpackConfig.js +13 -0
  28. package/src/modules/editor/src/webpackPlugins/CheckDeepImportsResolvePlugin.js +4 -0
  29. package/src/modules/editor-pre-7-7-0/src/api/downloadEditorSDK.js +16 -12
  30. package/src/modules/editor-pre-7-7-0/src/api/executeAndLog.js +3 -2
  31. package/src/modules/editor-pre-7-7-0/src/api/schema/compile.js +16 -22
  32. package/src/modules/editor-pre-7-7-0/src/api/schema/createSchemaPackages.js +8 -0
  33. package/src/modules/editor-pre-7-7-0/src/api/schema/getSchemaFontoJson.js +76 -48
  34. package/src/modules/editor-pre-7-7-0/src/command.schema.compile.controller.js +51 -2
  35. package/src/modules/editor-pre-7-7-0/test/api/schema/buildSchemaExperienceConfigurationModel.test.js +70 -79
  36. package/src/modules/editor-pre-7-7-0/test/api/schema/fixtures/invalid-fonto-json/fonto.json +1 -0
  37. package/src/modules/editor-pre-7-7-0/test/api/schema/getSchemaFontoJson.test.js +174 -0
  38. package/src/modules/editor-pre-7-7-0/test/schemaCompileController.test.js +205 -0
  39. package/src/modules/localization/index.js +2 -2
  40. package/src/modules/operations/src/api/getOperations.js +3 -3
  41. package/src/modules/review/index.js +103 -18
  42. package/src/modules/review/instanceBuild/Dockerfile +1 -1
  43. package/src/modules/review/instanceDevBuild/docker-compose.yml +1 -1
  44. package/src/modules/schema/src/api/getSchemaSummaries.js +2 -2
  45. package/src/modules/schema/test/getSchemaSummaries.test.js +14 -10
  46. package/src/modules/schema-compiler/index.js +99 -18
  47. package/src/modules/schema-compiler/instanceBuild/Dockerfile +1 -1
  48. package/src/modules/schema-compiler/instanceDevBuild/docker-compose.yml +1 -1
  49. package/src/modules/shared/index.js +3 -0
  50. package/src/modules/shared/package.json +14 -0
  51. package/src/modules/shared/src/addBackendDockerCommands.js +334 -0
  52. package/src/modules/shared/src/addBackendDownloadSelfContainedCommands.js +78 -0
  53. package/src/modules/shared/src/addBackendVersionsCommands.js +55 -0
  54. package/src/modules/shared/src/controller-templates/command.backend.build.controller.factory.js +273 -0
  55. package/src/modules/shared/src/controller-templates/command.backend.download-self-contained.controller.factory.js +131 -0
  56. package/src/modules/shared/src/controller-templates/command.backend.init.controller.factory.js +88 -0
  57. package/src/modules/shared/src/controller-templates/command.backend.run.controller.factory.js +420 -0
  58. package/src/modules/shared/src/controller-templates/command.backend.upgrade.controller.factory.js +79 -0
  59. package/src/modules/shared/src/controller-templates/command.backend.versions.controller.factory.js +23 -0
  60. package/src/modules/shared/src/controller-templates/docker/BackendManifest.js +42 -0
  61. package/src/modules/shared/src/controller-templates/docker/copyWhitelistedFiles.js +23 -0
  62. package/src/modules/shared/src/controller-templates/docker/dockerCleanup.js +146 -0
  63. package/src/modules/shared/src/controller-templates/docker/tryDockerLogout.js +31 -0
  64. package/src/modules/shared/src/controller-templates/docker/validateBackendInstance.js +48 -0
  65. package/src/modules/shared/src/ensureDockerCommands.js +61 -0
  66. package/src/modules/shared/src/executeAndLog.js +113 -0
  67. package/src/modules/{review/src/utilities/setEntryVisibility.js → shared/src/setFileVisibility.js} +8 -2
  68. package/src/modules/spell-checker/index.js +101 -18
  69. package/src/modules/spell-checker/instanceBuild/Dockerfile +1 -1
  70. package/src/modules/spell-checker/instanceDevBuild/docker-compose.yml +1 -1
  71. package/test/module.shared.test.js +81 -0
  72. package/src/modules/connectors/src/command.build.controller.js +0 -256
  73. package/src/modules/connectors/src/command.build.js +0 -54
  74. package/src/modules/connectors/src/command.download-self-contained.controller.js +0 -110
  75. package/src/modules/connectors/src/command.download-self-contained.js +0 -50
  76. package/src/modules/connectors/src/command.init.controller.js +0 -91
  77. package/src/modules/connectors/src/command.init.js +0 -42
  78. package/src/modules/connectors/src/command.run.controller.js +0 -462
  79. package/src/modules/connectors/src/command.run.js +0 -67
  80. package/src/modules/connectors/src/command.upgrade.controller.js +0 -52
  81. package/src/modules/connectors/src/command.upgrade.js +0 -42
  82. package/src/modules/connectors/src/command.versions.controller.js +0 -14
  83. package/src/modules/connectors/src/command.versions.js +0 -25
  84. package/src/modules/connectors/src/utilities/FontoxmlConnectorsManifest.js +0 -32
  85. package/src/modules/connectors/src/utilities/cleanup.js +0 -70
  86. package/src/modules/connectors/src/utilities/constants.js +0 -42
  87. package/src/modules/connectors/src/utilities/copyWhitelistedFiles.js +0 -22
  88. package/src/modules/connectors/src/utilities/executeAndLog.js +0 -63
  89. package/src/modules/connectors/src/utilities/getVerbosityLevel.js +0 -11
  90. package/src/modules/connectors/src/utilities/getWhitelist.js +0 -16
  91. package/src/modules/connectors/src/utilities/setEntryVisibility.js +0 -22
  92. package/src/modules/connectors/src/utilities/validateInstance.js +0 -29
  93. package/src/modules/content-quality/src/command.build.controller.js +0 -260
  94. package/src/modules/content-quality/src/command.build.js +0 -56
  95. package/src/modules/content-quality/src/command.download-self-contained.controller.js +0 -110
  96. package/src/modules/content-quality/src/command.download-self-contained.js +0 -52
  97. package/src/modules/content-quality/src/command.init.controller.js +0 -91
  98. package/src/modules/content-quality/src/command.init.js +0 -44
  99. package/src/modules/content-quality/src/command.run.controller.js +0 -444
  100. package/src/modules/content-quality/src/command.run.js +0 -64
  101. package/src/modules/content-quality/src/command.upgrade.controller.js +0 -52
  102. package/src/modules/content-quality/src/command.upgrade.js +0 -44
  103. package/src/modules/content-quality/src/command.versions.controller.js +0 -14
  104. package/src/modules/content-quality/src/command.versions.js +0 -25
  105. package/src/modules/content-quality/src/utilities/FontoxmlFcqManifest.js +0 -30
  106. package/src/modules/content-quality/src/utilities/cleanup.js +0 -70
  107. package/src/modules/content-quality/src/utilities/constants.js +0 -44
  108. package/src/modules/content-quality/src/utilities/copyWhitelistedFiles.js +0 -22
  109. package/src/modules/content-quality/src/utilities/executeAndLog.js +0 -63
  110. package/src/modules/content-quality/src/utilities/getVerbosityLevel.js +0 -11
  111. package/src/modules/content-quality/src/utilities/getWhitelist.js +0 -16
  112. package/src/modules/content-quality/src/utilities/setEntryVisibility.js +0 -22
  113. package/src/modules/content-quality/src/utilities/validateInstance.js +0 -29
  114. package/src/modules/document-history/src/command.build.controller.js +0 -260
  115. package/src/modules/document-history/src/command.build.js +0 -56
  116. package/src/modules/document-history/src/command.download-self-contained.controller.js +0 -110
  117. package/src/modules/document-history/src/command.download-self-contained.js +0 -50
  118. package/src/modules/document-history/src/command.init.controller.js +0 -91
  119. package/src/modules/document-history/src/command.init.js +0 -44
  120. package/src/modules/document-history/src/command.run.controller.js +0 -444
  121. package/src/modules/document-history/src/command.run.js +0 -64
  122. package/src/modules/document-history/src/command.upgrade.controller.js +0 -52
  123. package/src/modules/document-history/src/command.upgrade.js +0 -44
  124. package/src/modules/document-history/src/command.versions.controller.js +0 -14
  125. package/src/modules/document-history/src/command.versions.js +0 -25
  126. package/src/modules/document-history/src/utilities/FontoxmlFdhManifest.js +0 -30
  127. package/src/modules/document-history/src/utilities/cleanup.js +0 -70
  128. package/src/modules/document-history/src/utilities/constants.js +0 -44
  129. package/src/modules/document-history/src/utilities/copyWhitelistedFiles.js +0 -22
  130. package/src/modules/document-history/src/utilities/executeAndLog.js +0 -63
  131. package/src/modules/document-history/src/utilities/getVerbosityLevel.js +0 -11
  132. package/src/modules/document-history/src/utilities/getWhitelist.js +0 -16
  133. package/src/modules/document-history/src/utilities/setEntryVisibility.js +0 -22
  134. package/src/modules/document-history/src/utilities/validateInstance.js +0 -29
  135. package/src/modules/review/src/command.build.controller.js +0 -256
  136. package/src/modules/review/src/command.build.js +0 -54
  137. package/src/modules/review/src/command.download-self-contained.controller.js +0 -107
  138. package/src/modules/review/src/command.download-self-contained.js +0 -50
  139. package/src/modules/review/src/command.init.controller.js +0 -89
  140. package/src/modules/review/src/command.init.js +0 -42
  141. package/src/modules/review/src/command.run.controller.js +0 -428
  142. package/src/modules/review/src/command.run.js +0 -60
  143. package/src/modules/review/src/command.upgrade.controller.js +0 -59
  144. package/src/modules/review/src/command.upgrade.js +0 -42
  145. package/src/modules/review/src/command.versions.controller.js +0 -12
  146. package/src/modules/review/src/command.versions.js +0 -25
  147. package/src/modules/review/src/utilities/FontoxmlReviewManifest.js +0 -30
  148. package/src/modules/review/src/utilities/cleanup.js +0 -70
  149. package/src/modules/review/src/utilities/constants.js +0 -42
  150. package/src/modules/review/src/utilities/copyWhitelistedFiles.js +0 -22
  151. package/src/modules/review/src/utilities/executeAndLog.js +0 -63
  152. package/src/modules/review/src/utilities/getVerbosityLevel.js +0 -11
  153. package/src/modules/review/src/utilities/getWhitelist.js +0 -16
  154. package/src/modules/review/src/utilities/validateInstance.js +0 -45
  155. package/src/modules/schema-compiler/src/command.build.controller.js +0 -256
  156. package/src/modules/schema-compiler/src/command.build.js +0 -54
  157. package/src/modules/schema-compiler/src/command.download-self-contained.controller.js +0 -110
  158. package/src/modules/schema-compiler/src/command.download-self-contained.js +0 -50
  159. package/src/modules/schema-compiler/src/command.init.controller.js +0 -91
  160. package/src/modules/schema-compiler/src/command.init.js +0 -42
  161. package/src/modules/schema-compiler/src/command.run.controller.js +0 -430
  162. package/src/modules/schema-compiler/src/command.run.js +0 -60
  163. package/src/modules/schema-compiler/src/command.upgrade.controller.js +0 -64
  164. package/src/modules/schema-compiler/src/command.upgrade.js +0 -42
  165. package/src/modules/schema-compiler/src/command.versions.controller.js +0 -14
  166. package/src/modules/schema-compiler/src/command.versions.js +0 -25
  167. package/src/modules/schema-compiler/src/utilities/FontoxmlSchemaCompilerManifest.js +0 -32
  168. package/src/modules/schema-compiler/src/utilities/cleanup.js +0 -70
  169. package/src/modules/schema-compiler/src/utilities/constants.js +0 -43
  170. package/src/modules/schema-compiler/src/utilities/copyWhitelistedFiles.js +0 -22
  171. package/src/modules/schema-compiler/src/utilities/executeAndLog.js +0 -63
  172. package/src/modules/schema-compiler/src/utilities/getVerbosityLevel.js +0 -11
  173. package/src/modules/schema-compiler/src/utilities/getWhitelist.js +0 -16
  174. package/src/modules/schema-compiler/src/utilities/setEntryVisibility.js +0 -22
  175. package/src/modules/schema-compiler/src/utilities/validateInstance.js +0 -47
  176. package/src/modules/spell-checker/src/command.build.controller.js +0 -257
  177. package/src/modules/spell-checker/src/command.build.js +0 -54
  178. package/src/modules/spell-checker/src/command.download-self-contained.controller.js +0 -110
  179. package/src/modules/spell-checker/src/command.download-self-contained.js +0 -50
  180. package/src/modules/spell-checker/src/command.init.controller.js +0 -91
  181. package/src/modules/spell-checker/src/command.init.js +0 -42
  182. package/src/modules/spell-checker/src/command.run.controller.js +0 -430
  183. package/src/modules/spell-checker/src/command.run.js +0 -62
  184. package/src/modules/spell-checker/src/command.upgrade.controller.js +0 -61
  185. package/src/modules/spell-checker/src/command.upgrade.js +0 -42
  186. package/src/modules/spell-checker/src/command.versions.controller.js +0 -14
  187. package/src/modules/spell-checker/src/command.versions.js +0 -25
  188. package/src/modules/spell-checker/src/utilities/FontoxmlSpellCheckerManifest.js +0 -32
  189. package/src/modules/spell-checker/src/utilities/cleanup.js +0 -70
  190. package/src/modules/spell-checker/src/utilities/constants.js +0 -42
  191. package/src/modules/spell-checker/src/utilities/copyWhitelistedFiles.js +0 -22
  192. package/src/modules/spell-checker/src/utilities/executeAndLog.js +0 -63
  193. package/src/modules/spell-checker/src/utilities/getVerbosityLevel.js +0 -11
  194. package/src/modules/spell-checker/src/utilities/getWhitelist.js +0 -16
  195. package/src/modules/spell-checker/src/utilities/setEntryVisibility.js +0 -22
  196. package/src/modules/spell-checker/src/utilities/validateInstance.js +0 -47
@@ -1,22 +1,107 @@
1
- import commandBuild from './src/command.build.js';
2
- import commandDownloadSelfContained from './src/command.download-self-contained.js';
3
- import commandInit from './src/command.init.js';
4
- import commandRun from './src/command.run.js';
5
- import commandUpgrade from './src/command.upgrade.js';
6
- import commandVersions from './src/command.versions.js';
7
-
8
- export default (moduleRegistration) => {
9
- const reviewCommand = moduleRegistration
10
- .registerCommand('review')
11
- .setDescription('Provides tools for working with Fonto Review.')
12
- .addRequiredProductLicenses(['review'])
1
+ import path from 'path';
2
+ import { fileURLToPath, pathToFileURL } from 'url';
3
+
4
+ const __filename = fileURLToPath(import.meta.url);
5
+ const __dirname = path.dirname(__filename);
6
+
7
+ export default async (moduleRegistration) => {
8
+ const options = {
9
+ licenseProductName: 'review',
10
+ licensesRequired: ['review'],
11
+ productLabel: 'Fonto Review',
12
+ commandPrefix: 'review',
13
+
14
+ documentationConfigurationGuide:
15
+ 'https://documentation.fontoxml.com/latest/configuration-13d2d631668c',
16
+ documentationExecuteError:
17
+ 'https://documentation.fontoxml.com/latest/review-9c9f35e6d1bf',
18
+ documentationGettingStartedGuide:
19
+ 'https://documentation.fontoxml.com/latest/getting-started-8ca615260377',
20
+
21
+ defaultHttpPort: 6020,
22
+ defaultImageName: 'fonto-review',
23
+ defaultImageTag: 'latest',
24
+
25
+ manifestFileName: '.fontoxmlReviewManifest',
26
+ manifestVersionPropertyName: 'reviewVersion',
27
+
28
+ instanceBuildDockerfilePath: path.join(
29
+ __dirname,
30
+ 'instanceBuild',
31
+ 'Dockerfile'
32
+ ),
33
+ instanceDevBuildDirectoryPath: path.join(__dirname, 'instanceDevBuild'),
34
+ instanceDevBuildDockerfilePath: path.join(
35
+ __dirname,
36
+ 'instanceBuild',
37
+ 'Dockerfile'
38
+ ),
39
+ instanceTemplateDirectoryPath: path.join(__dirname, 'instanceTemplate'),
40
+
41
+ requiredConfiguration: [],
42
+ temporaryDirectoryName: '.reviewTmp',
43
+ temporaryBuildDirectoryName: '.reviewBuildTmp',
44
+ whitelist: [
45
+ // Required.
46
+ 'exports.xml',
47
+ // Optional.
48
+ 'nlog.config',
49
+ ],
50
+
51
+ debugEnvEntries: {
52
+ Logging__LogLevel__Default: 'Trace',
53
+ },
54
+ };
55
+
56
+ const command = moduleRegistration
57
+ .registerCommand(options.commandPrefix)
58
+ .setDescription(
59
+ `Provides tools for working with ${options.productLabel}.`
60
+ )
61
+
62
+ .addRequiredProductLicenses(options.licensesRequired)
13
63
  .setHideIfMissingRequiredProductLicenses()
14
64
  .setAsHelpCommand();
15
65
 
16
- commandBuild(moduleRegistration, reviewCommand);
17
- commandDownloadSelfContained(moduleRegistration, reviewCommand);
18
- commandInit(moduleRegistration, reviewCommand);
19
- commandRun(moduleRegistration, reviewCommand);
20
- commandUpgrade(moduleRegistration, reviewCommand);
21
- commandVersions(moduleRegistration, reviewCommand);
66
+ if (options.commandAlias) {
67
+ command.addAlias(options.commandAlias);
68
+ }
69
+
70
+ const sharedModulePath = moduleRegistration.getPathToModule(
71
+ '@fontoxml/fontoxml-development-tools-module-shared'
72
+ );
73
+
74
+ // Add the docker based commands.
75
+ const addBackendDockerCommandsPath = pathToFileURL(
76
+ path.resolve(sharedModulePath, 'src/addBackendDockerCommands.js')
77
+ );
78
+ const addBackendDockerCommands = (
79
+ await import(addBackendDockerCommandsPath)
80
+ ).default;
81
+ addBackendDockerCommands(moduleRegistration, command, options);
82
+
83
+ // Add the version commands.
84
+ const addBackendVersionsCommandsPath = pathToFileURL(
85
+ path.resolve(sharedModulePath, 'src/addBackendVersionsCommands.js')
86
+ );
87
+ const addBackendVersionsCommands = (
88
+ await import(addBackendVersionsCommandsPath)
89
+ ).default;
90
+ addBackendVersionsCommands(moduleRegistration, command, options);
91
+
92
+ // Add the download-self-contained command.
93
+ const addBackendDownloadSelfContainedCommandsPath = pathToFileURL(
94
+ path.resolve(
95
+ sharedModulePath,
96
+ 'src/addBackendDownloadSelfContainedCommands.js'
97
+ )
98
+ );
99
+ const addBackendDownloadSelfContainedCommands = (
100
+ await import(addBackendDownloadSelfContainedCommandsPath)
101
+ ).default;
102
+ addBackendDownloadSelfContainedCommands(
103
+ moduleRegistration,
104
+ command,
105
+ options
106
+ );
22
107
  };
@@ -1,4 +1,4 @@
1
- FROM ${reviewImage}
1
+ FROM ${image}
2
2
 
3
3
  # copy files
4
4
  COPY ./instance .
@@ -6,4 +6,4 @@ services:
6
6
  env_file:
7
7
  - .env
8
8
  ports:
9
- - '${reviewPort}:80'
9
+ - '${httpPort}:80'
@@ -1,4 +1,4 @@
1
- import glob from 'globby';
1
+ import fastGlob from 'fast-glob';
2
2
  import path from 'path';
3
3
 
4
4
  import SchemaSummary from './SchemaSummary.js';
@@ -6,7 +6,7 @@ import SchemaSummary from './SchemaSummary.js';
6
6
  export default function getSchemaSummaries(p) {
7
7
  const basePath = path.resolve(p);
8
8
 
9
- return glob
9
+ return fastGlob
10
10
  .sync(
11
11
  [
12
12
  // Traditional schema files compiled in a build
@@ -22,18 +22,24 @@ describe('fontoxml-development-tools-module-schema/api/getSchemaSummaries', () =
22
22
  assert.ok(schemaSummaries);
23
23
  assert.strictEqual(schemaSummaries.length, 4);
24
24
 
25
+ schemaSummaries.sort((a, b) => {
26
+ return a.path.localeCompare(b.path);
27
+ });
28
+
25
29
  assert.ok(schemaSummaries[0]);
26
30
  assert.ok(
27
31
  schemaSummaries[0].path.indexOf(
28
32
  formatPath(
29
- 'test/app/packages/test-packages-schema/src/schema.json'
33
+ 'test/app/packages-shared/test-packages-shared-lazy-schema/src/assets/schemas/test-packages-shared-lazy-shell.json'
30
34
  )
31
35
  ) !== -1
32
36
  );
33
- assert.strictEqual(schemaSummaries[0].package, 'test-packages-schema');
37
+ assert.strictEqual(
38
+ schemaSummaries[0].package,
39
+ 'test-packages-shared-lazy-schema'
40
+ );
34
41
  assert.deepStrictEqual(schemaSummaries[0].locations, [
35
- 'urn:packages.xsd',
36
- 'packages.dtd',
42
+ 'urn:packages-shared-lazy.xsd',
37
43
  ]);
38
44
 
39
45
  assert.ok(schemaSummaries[1]);
@@ -70,16 +76,14 @@ describe('fontoxml-development-tools-module-schema/api/getSchemaSummaries', () =
70
76
  assert.ok(
71
77
  schemaSummaries[3].path.indexOf(
72
78
  formatPath(
73
- 'test/app/packages-shared/test-packages-shared-lazy-schema/src/assets/schemas/test-packages-shared-lazy-shell.json'
79
+ 'test/app/packages/test-packages-schema/src/schema.json'
74
80
  )
75
81
  ) !== -1
76
82
  );
77
- assert.strictEqual(
78
- schemaSummaries[3].package,
79
- 'test-packages-shared-lazy-schema'
80
- );
83
+ assert.strictEqual(schemaSummaries[3].package, 'test-packages-schema');
81
84
  assert.deepStrictEqual(schemaSummaries[3].locations, [
82
- 'urn:packages-shared-lazy.xsd',
85
+ 'urn:packages.xsd',
86
+ 'packages.dtd',
83
87
  ]);
84
88
  });
85
89
 
@@ -1,24 +1,105 @@
1
- import commandBuild from './src/command.build.js';
2
- import commandDownloadSelfContained from './src/command.download-self-contained.js';
3
- import commandInit from './src/command.init.js';
4
- import commandRun from './src/command.run.js';
5
- import commandUpgrade from './src/command.upgrade.js';
6
- import commandVersions from './src/command.versions.js';
7
-
8
- export default (moduleRegistration) => {
9
- const schemaCompilerCommand = moduleRegistration
10
- .registerHiddenCommand('schema-compiler')
1
+ import path from 'path';
2
+ import { fileURLToPath, pathToFileURL } from 'url';
3
+
4
+ const __filename = fileURLToPath(import.meta.url);
5
+ const __dirname = path.dirname(__filename);
6
+
7
+ export default async (moduleRegistration) => {
8
+ const options = {
9
+ licenseProductName: 'schema-compiler',
10
+ licensesRequired: ['editor'],
11
+ productLabel: 'Fonto Schema Compiler',
12
+ commandPrefix: 'schema-compiler',
13
+
14
+ documentationConfigurationGuide:
15
+ 'https://documentation.fontoxml.com/latest/editor-b4ee7cad8e30',
16
+ documentationExecuteError:
17
+ 'https://documentation.fontoxml.com/latest/editor-b4ee7cad8e30',
18
+ documentationGettingStartedGuide:
19
+ 'https://documentation.fontoxml.com/latest/editor-b4ee7cad8e30',
20
+
21
+ defaultHttpPort: 6040,
22
+ defaultImageName: 'fonto-schema-compiler',
23
+ defaultImageTag: 'latest',
24
+
25
+ manifestFileName: '.fontoxmlSchemaCompilerManifest',
26
+ manifestVersionPropertyName: 'schemaCompilerVersion',
27
+
28
+ instanceBuildDockerfilePath: path.join(
29
+ __dirname,
30
+ 'instanceBuild',
31
+ 'Dockerfile'
32
+ ),
33
+ instanceDevBuildDirectoryPath: path.join(__dirname, 'instanceDevBuild'),
34
+ instanceDevBuildDockerfilePath: path.join(
35
+ __dirname,
36
+ 'instanceBuild',
37
+ 'Dockerfile'
38
+ ),
39
+ instanceTemplateDirectoryPath: path.join(__dirname, 'instanceTemplate'),
40
+
41
+ requiredConfiguration: [],
42
+ temporaryDirectoryName: '.schemaCompilerTmp',
43
+ temporaryBuildDirectoryName: '.schemaCompilerBuildTmp',
44
+ whitelist: [
45
+ // Optional.
46
+ 'nlog.config',
47
+ ],
48
+
49
+ debugEnvEntries: {
50
+ Logging__LogLevel__Default: 'Trace',
51
+ },
52
+ };
53
+
54
+ const command = moduleRegistration
55
+ .registerHiddenCommand(options.commandPrefix)
11
56
  .setDescription(
12
- 'Provides tools for working with Fonto Schema Compiler.'
57
+ `Provides tools for working with ${options.productLabel}.`
13
58
  )
14
- .addRequiredProductLicenses(['editor'])
59
+
60
+ .addRequiredProductLicenses(options.licensesRequired)
15
61
  .setHideIfMissingRequiredProductLicenses()
16
62
  .setAsHelpCommand();
17
63
 
18
- commandBuild(moduleRegistration, schemaCompilerCommand);
19
- commandDownloadSelfContained(moduleRegistration, schemaCompilerCommand);
20
- commandInit(moduleRegistration, schemaCompilerCommand);
21
- commandRun(moduleRegistration, schemaCompilerCommand);
22
- commandUpgrade(moduleRegistration, schemaCompilerCommand);
23
- commandVersions(moduleRegistration, schemaCompilerCommand);
64
+ if (options.commandAlias) {
65
+ command.addAlias(options.commandAlias);
66
+ }
67
+
68
+ const sharedModulePath = moduleRegistration.getPathToModule(
69
+ '@fontoxml/fontoxml-development-tools-module-shared'
70
+ );
71
+
72
+ // Add the docker based commands.
73
+ const addBackendDockerCommandsPath = pathToFileURL(
74
+ path.resolve(sharedModulePath, 'src/addBackendDockerCommands.js')
75
+ );
76
+ const addBackendDockerCommands = (
77
+ await import(addBackendDockerCommandsPath)
78
+ ).default;
79
+ addBackendDockerCommands(moduleRegistration, command, options);
80
+
81
+ // Add the version commands.
82
+ const addBackendVersionsCommandsPath = pathToFileURL(
83
+ path.resolve(sharedModulePath, 'src/addBackendVersionsCommands.js')
84
+ );
85
+ const addBackendVersionsCommands = (
86
+ await import(addBackendVersionsCommandsPath)
87
+ ).default;
88
+ addBackendVersionsCommands(moduleRegistration, command, options);
89
+
90
+ // Add the download-self-contained command.
91
+ const addBackendDownloadSelfContainedCommandsPath = pathToFileURL(
92
+ path.resolve(
93
+ sharedModulePath,
94
+ 'src/addBackendDownloadSelfContainedCommands.js'
95
+ )
96
+ );
97
+ const addBackendDownloadSelfContainedCommands = (
98
+ await import(addBackendDownloadSelfContainedCommandsPath)
99
+ ).default;
100
+ addBackendDownloadSelfContainedCommands(
101
+ moduleRegistration,
102
+ command,
103
+ options
104
+ );
24
105
  };
@@ -1,4 +1,4 @@
1
- FROM ${schemaCompilerImage}
1
+ FROM ${image}
2
2
 
3
3
  # copy files
4
4
  COPY ./instance .
@@ -6,4 +6,4 @@ services:
6
6
  env_file:
7
7
  - .env
8
8
  ports:
9
- - '${schemaCompilerPort}:80'
9
+ - '${httpPort}:80'
@@ -0,0 +1,3 @@
1
+ export default (_moduleRegistration, _app, _options) => {
2
+ // Nothing to do for the shared module.
3
+ };
@@ -0,0 +1,14 @@
1
+ {
2
+ "name": "@fontoxml/fontoxml-development-tools-module-shared",
3
+ "description": "Provides shared functionality for FontoXML Development Tools.",
4
+ "version": "1.0.0",
5
+ "author": "The Fonto Team",
6
+ "license": "MIT",
7
+ "keywords": [
8
+ "fdt",
9
+ "fonto",
10
+ "fontoxml"
11
+ ],
12
+ "main": "index.js",
13
+ "type": "module"
14
+ }