@fontoxml/fontoxml-development-tools 3.10.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 (206) hide show
  1. package/npm-shrinkwrap.json +3842 -8330
  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/editorVersions.js +19 -5
  9. package/src/modules/connectors/index.js +109 -16
  10. package/src/modules/connectors/instanceBuild/Dockerfile.build +1 -1
  11. package/src/modules/connectors/instanceBuild/Dockerfile.run +1 -1
  12. package/src/modules/connectors/instanceDevBuild/docker-compose.yml +2 -2
  13. package/src/modules/content-quality/index.js +101 -20
  14. package/src/modules/content-quality/instanceBuild/Dockerfile +1 -1
  15. package/src/modules/content-quality/instanceDevBuild/docker-compose.yml +1 -1
  16. package/src/modules/core/src/precontroller.help.js +23 -26
  17. package/src/modules/document-history/index.js +101 -20
  18. package/src/modules/document-history/instanceBuild/Dockerfile +1 -1
  19. package/src/modules/document-history/instanceDevBuild/docker-compose.yml +1 -1
  20. package/src/modules/editor/dev-cms/connectors-cms-standard/configureConnectorsCmsStandardDocumentRouter.js +10 -0
  21. package/src/modules/editor/dev-cms/connectors-cms-standard/configureDocumentHistoryGetPostRouteHandler.js +51 -0
  22. package/src/modules/editor/dev-cms/connectors-cms-standard/configureDocumentPostRouteHandler.js +65 -76
  23. package/src/modules/editor/dev-cms/connectors-cms-standard/configureDocumentPresearchPostRouteHandler.js +10 -7
  24. package/src/modules/editor/dev-cms/connectors-cms-standard/configureDocumentPreviewRouteHandler.js +10 -0
  25. package/src/modules/editor/dev-cms/connectors-cms-standard/configureDocumentRevisionGetPostRouteHandler.js +69 -0
  26. package/src/modules/editor/src/commands/command.convert.editor.controller.js +11 -4
  27. package/src/modules/editor/src/commands/command.convert.package.controller.js +11 -4
  28. package/src/modules/editor/src/getAppManifest.js +3 -3
  29. package/src/modules/editor/src/getWebpackConfig.js +13 -0
  30. package/src/modules/editor/src/webpackPlugins/CheckDeepImportsResolvePlugin.js +4 -0
  31. package/src/modules/editor-pre-7-7-0/src/api/downloadEditorSDK.js +16 -12
  32. package/src/modules/editor-pre-7-7-0/src/api/executeAndLog.js +3 -2
  33. package/src/modules/editor-pre-7-7-0/src/api/init/createConfigConfiguration.js +86 -48
  34. package/src/modules/editor-pre-7-7-0/src/api/schema/compile.js +16 -22
  35. package/src/modules/editor-pre-7-7-0/src/api/schema/createSchemaPackages.js +8 -0
  36. package/src/modules/editor-pre-7-7-0/src/api/schema/getSchemaFontoJson.js +76 -48
  37. package/src/modules/editor-pre-7-7-0/src/api/schema/zipHelpers.js +6 -1
  38. package/src/modules/editor-pre-7-7-0/src/command.schema.compile.controller.js +51 -2
  39. package/src/modules/editor-pre-7-7-0/test/api/init/createConfigConfiguration.test.js +71 -33
  40. package/src/modules/editor-pre-7-7-0/test/api/init/fixtures/configjs-7160.js +45 -0
  41. package/src/modules/editor-pre-7-7-0/test/api/init/fixtures/configjs-800.js +45 -0
  42. package/src/modules/editor-pre-7-7-0/test/api/init/fixtures/configjs-810.js +32 -0
  43. package/src/modules/editor-pre-7-7-0/test/api/schema/buildSchemaExperienceConfigurationModel.test.js +70 -79
  44. package/src/modules/editor-pre-7-7-0/test/api/schema/fixtures/dita-example-schema-bundle/listOfFiles.json +1 -36
  45. package/src/modules/editor-pre-7-7-0/test/api/schema/fixtures/invalid-fonto-json/fonto.json +1 -0
  46. package/src/modules/editor-pre-7-7-0/test/api/schema/getSchemaFontoJson.test.js +174 -0
  47. package/src/modules/editor-pre-7-7-0/test/api/schema/zipSchemaSource.test.js +10 -4
  48. package/src/modules/editor-pre-7-7-0/test/schemaCompileController.test.js +205 -0
  49. package/src/modules/localization/index.js +2 -2
  50. package/src/modules/operations/src/api/getOperations.js +3 -3
  51. package/src/modules/review/index.js +103 -18
  52. package/src/modules/review/instanceBuild/Dockerfile +1 -1
  53. package/src/modules/review/instanceDevBuild/docker-compose.yml +1 -1
  54. package/src/modules/schema/src/api/getSchemaSummaries.js +2 -2
  55. package/src/modules/schema/test/getSchemaSummaries.test.js +14 -10
  56. package/src/modules/schema-compiler/index.js +99 -18
  57. package/src/modules/schema-compiler/instanceBuild/Dockerfile +1 -1
  58. package/src/modules/schema-compiler/instanceDevBuild/docker-compose.yml +1 -1
  59. package/src/modules/shared/index.js +3 -0
  60. package/src/modules/shared/package.json +14 -0
  61. package/src/modules/shared/src/addBackendDockerCommands.js +334 -0
  62. package/src/modules/shared/src/addBackendDownloadSelfContainedCommands.js +78 -0
  63. package/src/modules/shared/src/addBackendVersionsCommands.js +55 -0
  64. package/src/modules/shared/src/controller-templates/command.backend.build.controller.factory.js +273 -0
  65. package/src/modules/shared/src/controller-templates/command.backend.download-self-contained.controller.factory.js +131 -0
  66. package/src/modules/shared/src/controller-templates/command.backend.init.controller.factory.js +88 -0
  67. package/src/modules/shared/src/controller-templates/command.backend.run.controller.factory.js +420 -0
  68. package/src/modules/shared/src/controller-templates/command.backend.upgrade.controller.factory.js +79 -0
  69. package/src/modules/shared/src/controller-templates/command.backend.versions.controller.factory.js +23 -0
  70. package/src/modules/shared/src/controller-templates/docker/BackendManifest.js +42 -0
  71. package/src/modules/shared/src/controller-templates/docker/copyWhitelistedFiles.js +23 -0
  72. package/src/modules/shared/src/controller-templates/docker/dockerCleanup.js +146 -0
  73. package/src/modules/shared/src/controller-templates/docker/tryDockerLogout.js +31 -0
  74. package/src/modules/shared/src/controller-templates/docker/validateBackendInstance.js +48 -0
  75. package/src/modules/shared/src/ensureDockerCommands.js +61 -0
  76. package/src/modules/shared/src/executeAndLog.js +113 -0
  77. package/src/modules/{review/src/utilities/setEntryVisibility.js → shared/src/setFileVisibility.js} +8 -2
  78. package/src/modules/spell-checker/index.js +101 -18
  79. package/src/modules/spell-checker/instanceBuild/Dockerfile +1 -1
  80. package/src/modules/spell-checker/instanceDevBuild/docker-compose.yml +1 -1
  81. package/test/module.shared.test.js +81 -0
  82. package/src/modules/connectors/src/command.build.controller.js +0 -256
  83. package/src/modules/connectors/src/command.build.js +0 -54
  84. package/src/modules/connectors/src/command.download-self-contained.controller.js +0 -110
  85. package/src/modules/connectors/src/command.download-self-contained.js +0 -50
  86. package/src/modules/connectors/src/command.init.controller.js +0 -91
  87. package/src/modules/connectors/src/command.init.js +0 -42
  88. package/src/modules/connectors/src/command.run.controller.js +0 -462
  89. package/src/modules/connectors/src/command.run.js +0 -67
  90. package/src/modules/connectors/src/command.upgrade.controller.js +0 -52
  91. package/src/modules/connectors/src/command.upgrade.js +0 -42
  92. package/src/modules/connectors/src/command.versions.controller.js +0 -14
  93. package/src/modules/connectors/src/command.versions.js +0 -25
  94. package/src/modules/connectors/src/utilities/FontoxmlConnectorsManifest.js +0 -32
  95. package/src/modules/connectors/src/utilities/cleanup.js +0 -70
  96. package/src/modules/connectors/src/utilities/constants.js +0 -42
  97. package/src/modules/connectors/src/utilities/copyWhitelistedFiles.js +0 -22
  98. package/src/modules/connectors/src/utilities/executeAndLog.js +0 -63
  99. package/src/modules/connectors/src/utilities/getVerbosityLevel.js +0 -11
  100. package/src/modules/connectors/src/utilities/getWhitelist.js +0 -16
  101. package/src/modules/connectors/src/utilities/setEntryVisibility.js +0 -22
  102. package/src/modules/connectors/src/utilities/validateInstance.js +0 -29
  103. package/src/modules/content-quality/src/command.build.controller.js +0 -260
  104. package/src/modules/content-quality/src/command.build.js +0 -56
  105. package/src/modules/content-quality/src/command.download-self-contained.controller.js +0 -110
  106. package/src/modules/content-quality/src/command.download-self-contained.js +0 -52
  107. package/src/modules/content-quality/src/command.init.controller.js +0 -91
  108. package/src/modules/content-quality/src/command.init.js +0 -44
  109. package/src/modules/content-quality/src/command.run.controller.js +0 -444
  110. package/src/modules/content-quality/src/command.run.js +0 -64
  111. package/src/modules/content-quality/src/command.upgrade.controller.js +0 -52
  112. package/src/modules/content-quality/src/command.upgrade.js +0 -44
  113. package/src/modules/content-quality/src/command.versions.controller.js +0 -14
  114. package/src/modules/content-quality/src/command.versions.js +0 -25
  115. package/src/modules/content-quality/src/utilities/FontoxmlFcqManifest.js +0 -30
  116. package/src/modules/content-quality/src/utilities/cleanup.js +0 -70
  117. package/src/modules/content-quality/src/utilities/constants.js +0 -44
  118. package/src/modules/content-quality/src/utilities/copyWhitelistedFiles.js +0 -22
  119. package/src/modules/content-quality/src/utilities/executeAndLog.js +0 -63
  120. package/src/modules/content-quality/src/utilities/getVerbosityLevel.js +0 -11
  121. package/src/modules/content-quality/src/utilities/getWhitelist.js +0 -16
  122. package/src/modules/content-quality/src/utilities/setEntryVisibility.js +0 -22
  123. package/src/modules/content-quality/src/utilities/validateInstance.js +0 -29
  124. package/src/modules/document-history/src/command.build.controller.js +0 -260
  125. package/src/modules/document-history/src/command.build.js +0 -56
  126. package/src/modules/document-history/src/command.download-self-contained.controller.js +0 -110
  127. package/src/modules/document-history/src/command.download-self-contained.js +0 -50
  128. package/src/modules/document-history/src/command.init.controller.js +0 -91
  129. package/src/modules/document-history/src/command.init.js +0 -44
  130. package/src/modules/document-history/src/command.run.controller.js +0 -444
  131. package/src/modules/document-history/src/command.run.js +0 -64
  132. package/src/modules/document-history/src/command.upgrade.controller.js +0 -52
  133. package/src/modules/document-history/src/command.upgrade.js +0 -44
  134. package/src/modules/document-history/src/command.versions.controller.js +0 -14
  135. package/src/modules/document-history/src/command.versions.js +0 -25
  136. package/src/modules/document-history/src/utilities/FontoxmlFdhManifest.js +0 -30
  137. package/src/modules/document-history/src/utilities/cleanup.js +0 -70
  138. package/src/modules/document-history/src/utilities/constants.js +0 -44
  139. package/src/modules/document-history/src/utilities/copyWhitelistedFiles.js +0 -22
  140. package/src/modules/document-history/src/utilities/executeAndLog.js +0 -63
  141. package/src/modules/document-history/src/utilities/getVerbosityLevel.js +0 -11
  142. package/src/modules/document-history/src/utilities/getWhitelist.js +0 -16
  143. package/src/modules/document-history/src/utilities/setEntryVisibility.js +0 -22
  144. package/src/modules/document-history/src/utilities/validateInstance.js +0 -29
  145. package/src/modules/review/src/command.build.controller.js +0 -256
  146. package/src/modules/review/src/command.build.js +0 -54
  147. package/src/modules/review/src/command.download-self-contained.controller.js +0 -107
  148. package/src/modules/review/src/command.download-self-contained.js +0 -50
  149. package/src/modules/review/src/command.init.controller.js +0 -89
  150. package/src/modules/review/src/command.init.js +0 -42
  151. package/src/modules/review/src/command.run.controller.js +0 -428
  152. package/src/modules/review/src/command.run.js +0 -60
  153. package/src/modules/review/src/command.upgrade.controller.js +0 -59
  154. package/src/modules/review/src/command.upgrade.js +0 -42
  155. package/src/modules/review/src/command.versions.controller.js +0 -12
  156. package/src/modules/review/src/command.versions.js +0 -25
  157. package/src/modules/review/src/utilities/FontoxmlReviewManifest.js +0 -30
  158. package/src/modules/review/src/utilities/cleanup.js +0 -70
  159. package/src/modules/review/src/utilities/constants.js +0 -42
  160. package/src/modules/review/src/utilities/copyWhitelistedFiles.js +0 -22
  161. package/src/modules/review/src/utilities/executeAndLog.js +0 -63
  162. package/src/modules/review/src/utilities/getVerbosityLevel.js +0 -11
  163. package/src/modules/review/src/utilities/getWhitelist.js +0 -16
  164. package/src/modules/review/src/utilities/validateInstance.js +0 -45
  165. package/src/modules/schema-compiler/src/command.build.controller.js +0 -256
  166. package/src/modules/schema-compiler/src/command.build.js +0 -54
  167. package/src/modules/schema-compiler/src/command.download-self-contained.controller.js +0 -110
  168. package/src/modules/schema-compiler/src/command.download-self-contained.js +0 -50
  169. package/src/modules/schema-compiler/src/command.init.controller.js +0 -91
  170. package/src/modules/schema-compiler/src/command.init.js +0 -42
  171. package/src/modules/schema-compiler/src/command.run.controller.js +0 -430
  172. package/src/modules/schema-compiler/src/command.run.js +0 -60
  173. package/src/modules/schema-compiler/src/command.upgrade.controller.js +0 -64
  174. package/src/modules/schema-compiler/src/command.upgrade.js +0 -42
  175. package/src/modules/schema-compiler/src/command.versions.controller.js +0 -14
  176. package/src/modules/schema-compiler/src/command.versions.js +0 -25
  177. package/src/modules/schema-compiler/src/utilities/FontoxmlSchemaCompilerManifest.js +0 -32
  178. package/src/modules/schema-compiler/src/utilities/cleanup.js +0 -70
  179. package/src/modules/schema-compiler/src/utilities/constants.js +0 -43
  180. package/src/modules/schema-compiler/src/utilities/copyWhitelistedFiles.js +0 -22
  181. package/src/modules/schema-compiler/src/utilities/executeAndLog.js +0 -63
  182. package/src/modules/schema-compiler/src/utilities/getVerbosityLevel.js +0 -11
  183. package/src/modules/schema-compiler/src/utilities/getWhitelist.js +0 -16
  184. package/src/modules/schema-compiler/src/utilities/setEntryVisibility.js +0 -22
  185. package/src/modules/schema-compiler/src/utilities/validateInstance.js +0 -47
  186. package/src/modules/spell-checker/src/command.build.controller.js +0 -257
  187. package/src/modules/spell-checker/src/command.build.js +0 -54
  188. package/src/modules/spell-checker/src/command.download-self-contained.controller.js +0 -110
  189. package/src/modules/spell-checker/src/command.download-self-contained.js +0 -50
  190. package/src/modules/spell-checker/src/command.init.controller.js +0 -91
  191. package/src/modules/spell-checker/src/command.init.js +0 -42
  192. package/src/modules/spell-checker/src/command.run.controller.js +0 -430
  193. package/src/modules/spell-checker/src/command.run.js +0 -62
  194. package/src/modules/spell-checker/src/command.upgrade.controller.js +0 -61
  195. package/src/modules/spell-checker/src/command.upgrade.js +0 -42
  196. package/src/modules/spell-checker/src/command.versions.controller.js +0 -14
  197. package/src/modules/spell-checker/src/command.versions.js +0 -25
  198. package/src/modules/spell-checker/src/utilities/FontoxmlSpellCheckerManifest.js +0 -32
  199. package/src/modules/spell-checker/src/utilities/cleanup.js +0 -70
  200. package/src/modules/spell-checker/src/utilities/constants.js +0 -42
  201. package/src/modules/spell-checker/src/utilities/copyWhitelistedFiles.js +0 -22
  202. package/src/modules/spell-checker/src/utilities/executeAndLog.js +0 -63
  203. package/src/modules/spell-checker/src/utilities/getVerbosityLevel.js +0 -11
  204. package/src/modules/spell-checker/src/utilities/getWhitelist.js +0 -16
  205. package/src/modules/spell-checker/src/utilities/setEntryVisibility.js +0 -22
  206. package/src/modules/spell-checker/src/utilities/validateInstance.js +0 -47
@@ -0,0 +1,205 @@
1
+ import assert from 'assert';
2
+
3
+ import { shouldUseTypeScriptForSchemaPackages } from '../src/command.schema.compile.controller.js';
4
+
5
+ describe('src/modules/editor-pre-7-7-0/src/command.schema.compile.controller.js', () => {
6
+ describe('shouldUseTypeScriptForSchemaPackages', () => {
7
+ describe('for editors that support TypeScript', () => {
8
+ it('uses TypeScript when there are no pre-existing SCHEMA_LOCATIONS file(s)', () => {
9
+ const isEditorRepositoryPath = true;
10
+ const editorSupportsTypeScript = true;
11
+ const hasSchemaLocationsJs = false;
12
+ const hasSchemaLocationsTs = false;
13
+
14
+ const result = shouldUseTypeScriptForSchemaPackages(
15
+ isEditorRepositoryPath,
16
+ editorSupportsTypeScript,
17
+ hasSchemaLocationsJs,
18
+ hasSchemaLocationsTs
19
+ );
20
+
21
+ assert.strictEqual(result, true);
22
+ });
23
+
24
+ it('uses TypeScript when there are both pre-existing SCHEMA_LOCATIONS.js and SCHEMA_LOCATIONS.ts file(s)', () => {
25
+ const isEditorRepositoryPath = true;
26
+ const editorSupportsTypeScript = true;
27
+ const hasSchemaLocationsJs = true;
28
+ const hasSchemaLocationsTs = true;
29
+
30
+ const result = shouldUseTypeScriptForSchemaPackages(
31
+ isEditorRepositoryPath,
32
+ editorSupportsTypeScript,
33
+ hasSchemaLocationsJs,
34
+ hasSchemaLocationsTs
35
+ );
36
+
37
+ assert.strictEqual(result, true);
38
+ });
39
+
40
+ it('does not use TypeScript when there are only pre-existing SCHEMA_LOCATIONS.js file(s)', () => {
41
+ const isEditorRepositoryPath = true;
42
+ const editorSupportsTypeScript = true;
43
+ const hasSchemaLocationsJs = true;
44
+ const hasSchemaLocationsTs = false;
45
+
46
+ const result = shouldUseTypeScriptForSchemaPackages(
47
+ isEditorRepositoryPath,
48
+ editorSupportsTypeScript,
49
+ hasSchemaLocationsJs,
50
+ hasSchemaLocationsTs
51
+ );
52
+
53
+ assert.strictEqual(result, false);
54
+ });
55
+
56
+ it('uses TypeScript when there are only pre-existing SCHEMA_LOCATIONS.ts file(s)', () => {
57
+ const isEditorRepositoryPath = true;
58
+ const editorSupportsTypeScript = true;
59
+ const hasSchemaLocationsJs = false;
60
+ const hasSchemaLocationsTs = true;
61
+
62
+ const result = shouldUseTypeScriptForSchemaPackages(
63
+ isEditorRepositoryPath,
64
+ editorSupportsTypeScript,
65
+ hasSchemaLocationsJs,
66
+ hasSchemaLocationsTs
67
+ );
68
+
69
+ assert.strictEqual(result, true);
70
+ });
71
+ });
72
+
73
+ describe('for editors that do not support TypeScript', () => {
74
+ it('does not use TypeScript when there are no pre-existing SCHEMA_LOCATIONS file(s)', () => {
75
+ const isEditorRepositoryPath = true;
76
+ const editorSupportsTypeScript = false;
77
+ const hasSchemaLocationsJs = false;
78
+ const hasSchemaLocationsTs = false;
79
+
80
+ const result = shouldUseTypeScriptForSchemaPackages(
81
+ isEditorRepositoryPath,
82
+ editorSupportsTypeScript,
83
+ hasSchemaLocationsJs,
84
+ hasSchemaLocationsTs
85
+ );
86
+
87
+ assert.strictEqual(result, false);
88
+ });
89
+
90
+ it('does not use TypeScript when there are both pre-existing SCHEMA_LOCATIONS.js and SCHEMA_LOCATIONS.ts file(s)', () => {
91
+ const isEditorRepositoryPath = true;
92
+ const editorSupportsTypeScript = false;
93
+ const hasSchemaLocationsJs = true;
94
+ const hasSchemaLocationsTs = true;
95
+
96
+ const result = shouldUseTypeScriptForSchemaPackages(
97
+ isEditorRepositoryPath,
98
+ editorSupportsTypeScript,
99
+ hasSchemaLocationsJs,
100
+ hasSchemaLocationsTs
101
+ );
102
+
103
+ assert.strictEqual(result, false);
104
+ });
105
+
106
+ it('does not use TypeScript when there are only pre-existing SCHEMA_LOCATIONS.js file(s)', () => {
107
+ const isEditorRepositoryPath = true;
108
+ const editorSupportsTypeScript = false;
109
+ const hasSchemaLocationsJs = true;
110
+ const hasSchemaLocationsTs = false;
111
+
112
+ const result = shouldUseTypeScriptForSchemaPackages(
113
+ isEditorRepositoryPath,
114
+ editorSupportsTypeScript,
115
+ hasSchemaLocationsJs,
116
+ hasSchemaLocationsTs
117
+ );
118
+
119
+ assert.strictEqual(result, false);
120
+ });
121
+
122
+ it('does not use TypeScript when there are only pre-existing SCHEMA_LOCATIONS.ts file(s)', () => {
123
+ const isEditorRepositoryPath = true;
124
+ const editorSupportsTypeScript = false;
125
+ const hasSchemaLocationsJs = false;
126
+ const hasSchemaLocationsTs = true;
127
+
128
+ const result = shouldUseTypeScriptForSchemaPackages(
129
+ isEditorRepositoryPath,
130
+ editorSupportsTypeScript,
131
+ hasSchemaLocationsJs,
132
+ hasSchemaLocationsTs
133
+ );
134
+
135
+ assert.strictEqual(result, false);
136
+ });
137
+ });
138
+
139
+ describe('when running outside of an editor or editor repo', () => {
140
+ it('uses TypeScript when there are no pre-existing SCHEMA_LOCATIONS file(s)', () => {
141
+ const isEditorRepositoryPath = false;
142
+ const editorSupportsTypeScript = false;
143
+ const hasSchemaLocationsJs = false;
144
+ const hasSchemaLocationsTs = false;
145
+
146
+ const result = shouldUseTypeScriptForSchemaPackages(
147
+ isEditorRepositoryPath,
148
+ editorSupportsTypeScript,
149
+ hasSchemaLocationsJs,
150
+ hasSchemaLocationsTs
151
+ );
152
+
153
+ assert.strictEqual(result, true);
154
+ });
155
+
156
+ it('uses TypeScript when there are both pre-existing SCHEMA_LOCATIONS.js and SCHEMA_LOCATIONS.ts file(s)', () => {
157
+ const isEditorRepositoryPath = false;
158
+ const editorSupportsTypeScript = false;
159
+ const hasSchemaLocationsJs = true;
160
+ const hasSchemaLocationsTs = true;
161
+
162
+ const result = shouldUseTypeScriptForSchemaPackages(
163
+ isEditorRepositoryPath,
164
+ editorSupportsTypeScript,
165
+ hasSchemaLocationsJs,
166
+ hasSchemaLocationsTs
167
+ );
168
+
169
+ assert.strictEqual(result, true);
170
+ });
171
+
172
+ it('does not use TypeScript when there are only pre-existing SCHEMA_LOCATIONS.js file(s)', () => {
173
+ const isEditorRepositoryPath = false;
174
+ const editorSupportsTypeScript = false;
175
+ const hasSchemaLocationsJs = true;
176
+ const hasSchemaLocationsTs = false;
177
+
178
+ const result = shouldUseTypeScriptForSchemaPackages(
179
+ isEditorRepositoryPath,
180
+ editorSupportsTypeScript,
181
+ hasSchemaLocationsJs,
182
+ hasSchemaLocationsTs
183
+ );
184
+
185
+ assert.strictEqual(result, false);
186
+ });
187
+
188
+ it('uses TypeScript when there are only pre-existing SCHEMA_LOCATIONS.ts file(s)', () => {
189
+ const isEditorRepositoryPath = false;
190
+ const editorSupportsTypeScript = false;
191
+ const hasSchemaLocationsJs = false;
192
+ const hasSchemaLocationsTs = true;
193
+
194
+ const result = shouldUseTypeScriptForSchemaPackages(
195
+ isEditorRepositoryPath,
196
+ editorSupportsTypeScript,
197
+ hasSchemaLocationsJs,
198
+ hasSchemaLocationsTs
199
+ );
200
+
201
+ assert.strictEqual(result, true);
202
+ });
203
+ });
204
+ });
205
+ });
@@ -1,5 +1,5 @@
1
+ import fastGlob from 'fast-glob';
1
2
  import fs from 'fs';
2
- import glob from 'globby';
3
3
  import path from 'path';
4
4
 
5
5
  import commandExtract from './src/command.extract.js';
@@ -14,7 +14,7 @@ export default (moduleRegistration) => {
14
14
  let messageBundles;
15
15
 
16
16
  if (req.fdt.editorRepository.path) {
17
- messageBundles = glob.sync(
17
+ messageBundles = fastGlob.sync(
18
18
  [
19
19
  'packages/**/messages.*.json',
20
20
  'packages-shared/**/messages.*.json',
@@ -1,9 +1,9 @@
1
+ import fastGlob from 'fast-glob';
1
2
  import fs from 'fs';
2
- import glob from 'globby';
3
3
  import path from 'path';
4
4
 
5
5
  export default function getOperations(workingDirectory, roots, ignoreSymlinks) {
6
- return glob(
6
+ return fastGlob(
7
7
  Array.isArray(roots)
8
8
  ? roots.map((root) => path.join(root, '**', 'operations?(-*).json'))
9
9
  : [
@@ -14,7 +14,7 @@ export default function getOperations(workingDirectory, roots, ignoreSymlinks) {
14
14
  ],
15
15
  {
16
16
  cwd: workingDirectory,
17
- follow: !ignoreSymlinks,
17
+ followSymbolicLinks: !ignoreSymlinks,
18
18
  }
19
19
  ).then((operationsJsons) => {
20
20
  return operationsJsons.reduce((allOps, operationsJson) => {
@@ -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
+ }