@fontoxml/fontoxml-development-tools 3.10.0-beta.3 → 3.11.0

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.
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@fontoxml/fontoxml-development-tools",
3
- "version": "3.10.0-beta.3",
3
+ "version": "3.11.0",
4
4
  "lockfileVersion": 2,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "@fontoxml/fontoxml-development-tools",
9
- "version": "3.10.0-beta.3",
9
+ "version": "3.11.0",
10
10
  "license": "MIT",
11
11
  "dependencies": {
12
12
  "@babel/core": "7.14.6",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@fontoxml/fontoxml-development-tools",
3
3
  "description": "Development tools for Fonto.",
4
- "version": "3.10.0-beta.3",
4
+ "version": "3.11.0",
5
5
  "author": "The Fonto Team",
6
6
  "license": "MIT",
7
7
  "keywords": [
@@ -6,9 +6,25 @@ export function isNightly(version) {
6
6
  );
7
7
  }
8
8
 
9
- /**
10
- * Returns true IFF the editor is pre-7.17.0
11
- */
9
+ export function isPre810Editor(version) {
10
+ if (!version) {
11
+ return false;
12
+ }
13
+
14
+ try {
15
+ version = String(version);
16
+
17
+ if (isNightly(version)) {
18
+ const nightlyDate = new Date(version.split(' ')[2]);
19
+ return nightlyDate < new Date('2022-05-30T12:00:00.000Z');
20
+ }
21
+
22
+ return compareVersions(version, '8.0.x') !== 1;
23
+ } catch (_error) {
24
+ return false;
25
+ }
26
+ }
27
+
12
28
  export function isPre7170Editor(version) {
13
29
  if (!version) {
14
30
  return false;
@@ -22,7 +38,6 @@ export function isPre7170Editor(version) {
22
38
  return nightlyDate < new Date('2021-12-23T12:00:00.000Z');
23
39
  }
24
40
 
25
- // 7.17.0-rc.1 or higher.
26
41
  return compareVersions(version, '7.16.x') !== 1;
27
42
  } catch (_error) {
28
43
  return false;
@@ -42,7 +57,6 @@ export function isPre770Editor(version) {
42
57
  return nightlyDate < new Date('2019-05-17T12:00:00.000Z');
43
58
  }
44
59
 
45
- // 7.7.0-rc.1 or higher.
46
60
  return compareVersions(version, '7.6.x') !== 1;
47
61
  } catch (_error) {
48
62
  return false;
@@ -8,9 +8,9 @@ export default async function getAppManifest(editorPath) {
8
8
  appManifest.favicon = appManifest.favicon || 'assets/images/favicon.ico';
9
9
  appManifest.name = appManifest.name || 'Fonto Editor';
10
10
  appManifest.supportedBrowsers = appManifest.supportedBrowsers || {
11
- chrome: '98',
12
- edge: '98',
13
- firefox: '97',
11
+ chrome: '101',
12
+ edge: '101',
13
+ firefox: '100',
14
14
  safari: '15',
15
15
  };
16
16
  return appManifest;
@@ -1,7 +1,10 @@
1
1
  import babel from '@babel/core';
2
2
  import os from 'os';
3
3
 
4
- import { isPre7170Editor } from '../../../../../editorVersions.js';
4
+ import {
5
+ isPre810Editor,
6
+ isPre7170Editor,
7
+ } from '../../../../../editorVersions.js';
5
8
  import SchemaSummary from '../../../../schema/src/api/SchemaSummary.js';
6
9
  import addCommentToAstNode, {
7
10
  trickRecastIntoKeepingStatementsTogether,
@@ -49,7 +52,7 @@ const buildParagraphNodeNameForPastingConfiguration = template(
49
52
  // Configuration constants.
50
53
  const PARAGRAPH_COUTERPART_ELEMENT_NAME = 'p';
51
54
 
52
- export function buildConfigurationSetUniqueIdConfigurationStatement(version) {
55
+ function buildConfigurationSetUniqueIdConfigurationStatement(version) {
53
56
  return buildConfigurationSetUniqueIdConfigurations({
54
57
  CONFIGURATION_VALUE: t.arrayExpression([
55
58
  isPre7170Editor(version)
@@ -65,13 +68,15 @@ export function buildConfigurationSetUniqueIdConfigurationStatement(version) {
65
68
  * @param {Object} compiledSchemaResultsByXsdPath The compiled schema for a package by xsd path.
66
69
  * @param {ASTNode[]} statements The statements node array to add the configuration and/or comments to.
67
70
  * @param {string} version The sdk version used to configure.
71
+ * @param {ASTNode} lastStatement The statement to add the comment to in case no new statement is created.
68
72
  *
69
- * @return {Promise}
73
+ * @return {Promise<void>}
70
74
  */
71
75
  async function addUniqueIdGenerationConfigurations(
72
76
  compiledSchemaResultsByXsdPath,
73
77
  statements,
74
- version
78
+ version,
79
+ lastStatement
75
80
  ) {
76
81
  // Check if an id attribute exists in one of the schemas.
77
82
  const idAttributeExists = Object.values(
@@ -110,7 +115,7 @@ async function addUniqueIdGenerationConfigurations(
110
115
  configurationSetUniqueIdConfigurationStatement
111
116
  );
112
117
  addCommentToAstNode(
113
- statements[statements.length - 1],
118
+ lastStatement,
114
119
  [
115
120
  ...comments,
116
121
  'Example:',
@@ -123,18 +128,16 @@ async function addUniqueIdGenerationConfigurations(
123
128
  }
124
129
 
125
130
  /**
126
- * Creates the config/configuration.ts/js file for the Editor.
131
+ * Generates the config/configuration.ts/js file for the Editor.
127
132
  *
128
- * @param {string} configConfigurationJsFilePath The path to the configuration file.
129
133
  * @param {Object} prefixByNamespaceUri The namespace URIs with their prefix.
130
134
  * @param {Array} addons The selected addons for this editor instance.
131
135
  * @param {Object} compiledSchemaResultsByXsdPath The compiled schema for a package by xsd path.
132
136
  * @param {string} version The sdk version used to configure.
133
137
  *
134
- * @return {Promise}
138
+ * @return {Promise<Program>}
135
139
  */
136
- export default async function createConfigConfiguration(
137
- configConfigurationJsFilePath,
140
+ export async function generateConfigConfiguration(
138
141
  prefixByNamespaceUri,
139
142
  addons,
140
143
  compiledSchemaResultsByXsdPath,
@@ -160,16 +163,47 @@ export default async function createConfigConfiguration(
160
163
  );
161
164
  importStatements.push(configurationManagerImportStatement);
162
165
 
163
- // Enable the 'correct selection after enter' experiment.
164
- const correctSelectionAfterEnterConfigurationStatement =
165
- buildCorrectSelectionAfterEnterConfiguration();
166
- addCommentToAstNode(correctSelectionAfterEnterConfigurationStatement, [
167
- 'Enable an experiment where, when pressing enter at the edges of elements, the cursor is prevented',
168
- 'from ending up in positions that are not reachable using the cursor keys.',
169
- 'For more information:',
170
- 'https://documentation.fontoxml.com/latest/enable-experiment-correct-selection-after-enter-8d2ce78e26b8',
171
- ]);
172
- statements.push(correctSelectionAfterEnterConfigurationStatement);
166
+ // Get all prefix and namespace entries, sorted naturally by prefix.
167
+ const prefixByNamespaceUriEntries = Object.entries(
168
+ prefixByNamespaceUri
169
+ ).sort(([_nsA, prefixA], [_nsB, prefixB]) =>
170
+ prefixA === prefixB
171
+ ? 0
172
+ : prefixA === null
173
+ ? 1
174
+ : prefixB === null
175
+ ? -1
176
+ : prefixA.localeCompare(prefixB, undefined, {
177
+ numeric: true,
178
+ sensitivity: 'base',
179
+ })
180
+ );
181
+ if (prefixByNamespaceUriEntries.length) {
182
+ const namespaceManagerImport = buildNamespaceManagerImport();
183
+ trickRecastIntoKeepingStatementsTogether(namespaceManagerImport);
184
+ importStatements.push(namespaceManagerImport);
185
+ }
186
+
187
+ // Import xq for editor versions 7.17 or higher.
188
+ if (!isPre7170Editor(version)) {
189
+ const xqImportStatement = buildXqImport();
190
+ trickRecastIntoKeepingStatementsTogether(xqImportStatement);
191
+ importStatements.push(xqImportStatement);
192
+ }
193
+
194
+ // Set an experimental flag for editor versions 8.0.x or lower.
195
+ if (isPre810Editor(version)) {
196
+ const correctSelectionAfterEnterConfigurationStatement =
197
+ buildCorrectSelectionAfterEnterConfiguration();
198
+ // Enable the 'correct selection after enter' experiment.
199
+ addCommentToAstNode(correctSelectionAfterEnterConfigurationStatement, [
200
+ 'Enable an experiment where, when pressing enter at the edges of elements, the cursor is prevented',
201
+ 'from ending up in positions that are not reachable using the cursor keys.',
202
+ 'For more information:',
203
+ 'https://documentation.fontoxml.com/latest/enable-experiment-correct-selection-after-enter-8d2ce78e26b8',
204
+ ]);
205
+ statements.push(correctSelectionAfterEnterConfigurationStatement);
206
+ }
173
207
 
174
208
  // Configures the clipboard configuration option 'paragraph-node-name-for-pasting'.
175
209
  // Skips this configuration when the 'fontoxml-dita' add-on is enabled, since that add-on already configures this option.
@@ -219,7 +253,8 @@ export default async function createConfigConfiguration(
219
253
  comments.push('Example:');
220
254
  comments.push(...exampleCode.split(os.EOL).filter(Boolean));
221
255
  addCommentToAstNode(
222
- correctSelectionAfterEnterConfigurationStatement,
256
+ statements[statements.length - 1] ||
257
+ importStatements[importStatements.length - 1],
223
258
  comments,
224
259
  true,
225
260
  true
@@ -231,28 +266,13 @@ export default async function createConfigConfiguration(
231
266
  await addUniqueIdGenerationConfigurations(
232
267
  compiledSchemaResultsByXsdPath,
233
268
  statements,
234
- version
235
- );
236
-
237
- // Get all prefix and namespace entries, sorted naturally by prefix.
238
- const prefixByNamespaceUriEntries = Object.entries(
239
- prefixByNamespaceUri
240
- ).sort(([_nsA, prefixA], [_nsB, prefixB]) =>
241
- prefixA === prefixB
242
- ? 0
243
- : prefixA === null
244
- ? 1
245
- : prefixB === null
246
- ? -1
247
- : prefixA.localeCompare(prefixB, undefined, {
248
- numeric: true,
249
- sensitivity: 'base',
250
- })
269
+ version,
270
+ statements[statements.length - 1] ||
271
+ importStatements[importStatements.length - 1]
251
272
  );
252
273
 
253
274
  // Register all namespaces.
254
275
  if (prefixByNamespaceUriEntries.length) {
255
- importStatements.push(buildNamespaceManagerImport());
256
276
  let isFirstAddedNamespaceStatement = true;
257
277
  for (const [namespaceUri, prefix] of prefixByNamespaceUriEntries) {
258
278
  const namespaceConfigurationStatement =
@@ -281,16 +301,34 @@ export default async function createConfigConfiguration(
281
301
  }
282
302
  }
283
303
 
284
- // Import xq for editor versions 7.17 or higher.
285
- if (!isPre7170Editor(version)) {
286
- importStatements.push(buildXqImport());
287
- }
288
-
289
304
  // Generate the AST for the config/configuration.ts/js file.
290
- const configConfigurationJsAst = t.program([
291
- ...importStatements,
292
- ...statements,
293
- ]);
305
+ return t.program([...importStatements, ...statements]);
306
+ }
307
+
308
+ /**
309
+ * Creates the config/configuration.ts/js file for the Editor.
310
+ *
311
+ * @param {string} configConfigurationJsFilePath The path to the configuration file.
312
+ * @param {Object} prefixByNamespaceUri The namespace URIs with their prefix.
313
+ * @param {Array} addons The selected addons for this editor instance.
314
+ * @param {Object} compiledSchemaResultsByXsdPath The compiled schema for a package by xsd path.
315
+ * @param {string} version The sdk version used to configure.
316
+ *
317
+ * @return {Promise}
318
+ */
319
+ export default async function createConfigConfiguration(
320
+ configConfigurationJsFilePath,
321
+ prefixByNamespaceUri,
322
+ addons,
323
+ compiledSchemaResultsByXsdPath,
324
+ version
325
+ ) {
326
+ const configConfigurationJsAst = await generateConfigConfiguration(
327
+ prefixByNamespaceUri,
328
+ addons,
329
+ compiledSchemaResultsByXsdPath,
330
+ version
331
+ );
294
332
  await writeAstProgramToFile(
295
333
  configConfigurationJsFilePath,
296
334
  configConfigurationJsAst
@@ -31,7 +31,12 @@ function zipSchemaSource(inputPath) {
31
31
  resolve(Buffer.concat(buffers));
32
32
  });
33
33
 
34
- zipArchive.glob('**/*', {
34
+ // Use .glob here, instead of .file, to properly handle symlinked fonto.json files
35
+ zipArchive.glob('fonto.json', {
36
+ cwd: inputPath,
37
+ follow: true,
38
+ });
39
+ zipArchive.glob('**/*.@(xml|xsd)', {
35
40
  cwd: inputPath,
36
41
  follow: true,
37
42
  });
@@ -1,47 +1,85 @@
1
- import babel from '@babel/core';
2
1
  import assert from 'assert';
2
+ import fs from 'fs-extra';
3
+ import path from 'path';
4
+ import { fileURLToPath } from 'url';
3
5
 
4
6
  import createPrettifiedCode from '../../../src/api/createPrettifiedCode.js';
5
- import { buildConfigurationSetUniqueIdConfigurationStatement } from '../../../src/api/init/createConfigConfiguration.js';
7
+ import { generateConfigConfiguration } from '../../../src/api/init/createConfigConfiguration.js';
8
+ import getPrefixByNamespaceUri from '../../../src/api/schema/getPrefixByNamespaceUri.js';
6
9
 
7
- const t = babel.types;
10
+ const __filename = fileURLToPath(import.meta.url);
11
+ const __dirname = path.dirname(__filename);
8
12
 
9
13
  describe('createConfigConfiguration', () => {
10
- it('works for pre 7.17 versions', async () => {
11
- const configStatement =
12
- buildConfigurationSetUniqueIdConfigurationStatement('7.16');
13
- const program = t.program([configStatement]);
14
+ it('works for versions pre 7.17.x', async () => {
15
+ // < 7.17.x (+experiment, -xq, -dita, -p, -namespaces, -id)
16
+ const abstractSchema = await fs.readJSON(
17
+ path.resolve(
18
+ __dirname,
19
+ '../schema/fixtures/abstract-test/compiledSchema.json'
20
+ )
21
+ );
22
+ const program = await generateConfigConfiguration(
23
+ getPrefixByNamespaceUri(abstractSchema),
24
+ [],
25
+ abstractSchema,
26
+ '7.16.0'
27
+ );
28
+ const stringOutcome = await createPrettifiedCode(program);
29
+
30
+ const fixture = await fs.readFile(
31
+ path.join(__dirname, 'fixtures/configjs-7160.js'),
32
+ 'utf8'
33
+ );
34
+
35
+ assert.strictEqual(stringOutcome, fixture);
36
+ });
37
+
38
+ it('works for versions 8.0.0 to 8.1.0', async () => {
39
+ // 8.0.0 - 8.1.0 (+experiment, +xq, -dita, +p, ?namespaces, ?id)
40
+ const abstractSchema = await fs.readJSON(
41
+ path.resolve(
42
+ __dirname,
43
+ '../schema/fixtures/training-schema-bundle/compiledSchema.json'
44
+ )
45
+ );
46
+ const program = await generateConfigConfiguration(
47
+ getPrefixByNamespaceUri(abstractSchema),
48
+ [],
49
+ abstractSchema,
50
+ '8.0.0'
51
+ );
14
52
  const stringOutcome = await createPrettifiedCode(program);
15
- assert.strictEqual(
16
- stringOutcome,
17
- `configurationManager.set('unique-id-configurations', [
18
- {
19
- selector: 'self::*',
20
- namespaceURI: null,
21
- localName: 'id',
22
- strategy: 'unique-for-document',
23
- },
24
- ]);
25
- `
53
+
54
+ const fixture = await fs.readFile(
55
+ path.join(__dirname, 'fixtures/configjs-800.js'),
56
+ 'utf8'
26
57
  );
58
+
59
+ assert.strictEqual(stringOutcome, fixture);
27
60
  });
28
61
 
29
- it('works for 7.17 and up', async () => {
30
- const configStatement =
31
- buildConfigurationSetUniqueIdConfigurationStatement('7.17');
32
- const program = t.program([configStatement]);
62
+ it('works for versions 8.1.x and up', async () => {
63
+ // > 8.1.x (-experiment, +xq, +dita, -p, +namespaces, +id)
64
+ const abstractSchema = await fs.readJSON(
65
+ path.resolve(
66
+ __dirname,
67
+ '../schema/fixtures/dita-example-schema-bundle/compiledSchema.json'
68
+ )
69
+ );
70
+ const program = await generateConfigConfiguration(
71
+ getPrefixByNamespaceUri(abstractSchema),
72
+ ['fontoxml-dita'],
73
+ abstractSchema,
74
+ '8.1.0'
75
+ );
33
76
  const stringOutcome = await createPrettifiedCode(program);
34
- assert.strictEqual(
35
- stringOutcome,
36
- `configurationManager.set('unique-id-configurations', [
37
- {
38
- selector: xq\`self::*\`,
39
- namespaceURI: null,
40
- localName: 'id',
41
- strategy: 'unique-for-document',
42
- },
43
- ]);
44
- `
77
+
78
+ const fixture = await fs.readFile(
79
+ path.join(__dirname, 'fixtures/configjs-810.js'),
80
+ 'utf8'
45
81
  );
82
+
83
+ assert.strictEqual(stringOutcome, fixture);
46
84
  });
47
85
  });
@@ -0,0 +1,45 @@
1
+ // This configuration file defines constants that can be used throughout the rest of your FontoXML
2
+ // Editor configuration. You can configure existing product options, or create custom configuration
3
+ // options. Values that you set here may be either a value or an asynchronous promise to a value,
4
+ // and can be used in other files by importing the configurationManager and using
5
+ // configurationManager.get().
6
+ // For more information:
7
+ // https://documentation.fontoxml.com/latest/configurationmanager-3e0d8dbacb90
8
+ import configurationManager from 'fontoxml-configuration/src/configurationManager';
9
+
10
+ // Enable an experiment where, when pressing enter at the edges of elements, the cursor is prevented
11
+ // from ending up in positions that are not reachable using the cursor keys.
12
+ // For more information:
13
+ // https://documentation.fontoxml.com/latest/enable-experiment-correct-selection-after-enter-8d2ce78e26b8
14
+ configurationManager.set(
15
+ 'enable-experiment/correct-selection-after-enter',
16
+ true
17
+ );
18
+
19
+ // The node name of the element that will be created for paragraphs in pasted plain-text content.
20
+ // The configuration value is the paragraph counterpart element name.
21
+ // Additional clipboard configuration can be found in the editor-clipboard-configuration package.
22
+ // For more information:
23
+ // https://documentation.fontoxml.com/latest/configure-clipboard-behavior-bc607964d3f5
24
+ // https://documentation.fontoxml.com/latest/paragraph-node-name-for-pasting-94d4327c8363
25
+ //
26
+ // TODO 👉: Verify that "p" is a sensible default text container.
27
+ // Example:
28
+ // configurationManager.set('paragraph-node-name-for-pasting', 'p');
29
+
30
+ // Set to an array of objects to determine the identifying attributes for which a GUID will be
31
+ // generated automatically.
32
+ // For more information:
33
+ // https://documentation.fontoxml.com/latest/unique-id-configurations-94fe53ca7bfb
34
+ //
35
+ // TODO 👉: If identifier attributes are missing, add them.
36
+ // TODO 👉: Adjust the selector to exclude elements where identifiers are not desired.
37
+ // Example:
38
+ // configurationManager.set('unique-id-configurations', [
39
+ // {
40
+ // selector: 'self::*',
41
+ // namespaceURI: null,
42
+ // localName: 'id',
43
+ // strategy: 'unique-for-document',
44
+ // },
45
+ // ]);
@@ -0,0 +1,45 @@
1
+ // This configuration file defines constants that can be used throughout the rest of your FontoXML
2
+ // Editor configuration. You can configure existing product options, or create custom configuration
3
+ // options. Values that you set here may be either a value or an asynchronous promise to a value,
4
+ // and can be used in other files by importing the configurationManager and using
5
+ // configurationManager.get().
6
+ // For more information:
7
+ // https://documentation.fontoxml.com/latest/configurationmanager-3e0d8dbacb90
8
+ import configurationManager from 'fontoxml-configuration/src/configurationManager';
9
+ import xq from 'fontoxml-selectors/src/xq';
10
+
11
+ // Enable an experiment where, when pressing enter at the edges of elements, the cursor is prevented
12
+ // from ending up in positions that are not reachable using the cursor keys.
13
+ // For more information:
14
+ // https://documentation.fontoxml.com/latest/enable-experiment-correct-selection-after-enter-8d2ce78e26b8
15
+ configurationManager.set(
16
+ 'enable-experiment/correct-selection-after-enter',
17
+ true
18
+ );
19
+
20
+ // The node name of the element that will be created for paragraphs in pasted plain-text content.
21
+ // The configuration value is the paragraph counterpart element name.
22
+ // Additional clipboard configuration can be found in the editor-clipboard-configuration package.
23
+ // For more information:
24
+ // https://documentation.fontoxml.com/latest/configure-clipboard-behavior-bc607964d3f5
25
+ // https://documentation.fontoxml.com/latest/paragraph-node-name-for-pasting-94d4327c8363
26
+ //
27
+ // TODO 👉: Verify that "p" is a sensible default text container.
28
+ configurationManager.set('paragraph-node-name-for-pasting', 'p');
29
+
30
+ // Set to an array of objects to determine the identifying attributes for which a GUID will be
31
+ // generated automatically.
32
+ // For more information:
33
+ // https://documentation.fontoxml.com/latest/unique-id-configurations-94fe53ca7bfb
34
+ //
35
+ // TODO 👉: If identifier attributes are missing, add them.
36
+ // TODO 👉: Adjust the selector to exclude elements where identifiers are not desired.
37
+ // Example:
38
+ // configurationManager.set('unique-id-configurations', [
39
+ // {
40
+ // selector: xq`self::*`,
41
+ // namespaceURI: null,
42
+ // localName: 'id',
43
+ // strategy: 'unique-for-document',
44
+ // },
45
+ // ]);
@@ -0,0 +1,32 @@
1
+ // This configuration file defines constants that can be used throughout the rest of your FontoXML
2
+ // Editor configuration. You can configure existing product options, or create custom configuration
3
+ // options. Values that you set here may be either a value or an asynchronous promise to a value,
4
+ // and can be used in other files by importing the configurationManager and using
5
+ // configurationManager.get().
6
+ // For more information:
7
+ // https://documentation.fontoxml.com/latest/configurationmanager-3e0d8dbacb90
8
+ import configurationManager from 'fontoxml-configuration/src/configurationManager';
9
+ import namespaceManager from 'fontoxml-dom-namespaces/src/namespaceManager';
10
+ import xq from 'fontoxml-selectors/src/xq';
11
+
12
+ // Set to an array of objects to determine the identifying attributes for which a GUID will be
13
+ // generated automatically.
14
+ // For more information:
15
+ // https://documentation.fontoxml.com/latest/unique-id-configurations-94fe53ca7bfb
16
+ //
17
+ // TODO 👉: If identifier attributes are missing, add them.
18
+ // TODO 👉: Adjust the selector to exclude elements where identifiers are not desired.
19
+ configurationManager.set('unique-id-configurations', [
20
+ {
21
+ selector: xq`self::*`,
22
+ namespaceURI: null,
23
+ localName: 'id',
24
+ strategy: 'unique-for-document',
25
+ },
26
+ ]);
27
+
28
+ // Register namespaces with prefixes.
29
+ // For more information:
30
+ // https://documentation.fontoxml.com/latest/namespacemanager-c80956c5d6d7
31
+ // https://documentation.fontoxml.com/latest/namespaces-2b1bbc7b4f79
32
+ namespaceManager.addNamespace('mml', 'http://www.w3.org/1998/Math/MathML');
@@ -1,15 +1,7 @@
1
1
  [
2
- "LICENSE.md",
3
- "README.md",
4
2
  "catalog.xml",
5
- "compiledSchema.json",
6
3
  "fonto.json",
7
- "listOfFiles.json",
8
- "model.out.json",
9
- "schema/",
10
- "schema/base/",
11
4
  "schema/base/catalog.xml",
12
- "schema/base/xsd/",
13
5
  "schema/base/xsd/basemap.xsd",
14
6
  "schema/base/xsd/basetopic.xsd",
15
7
  "schema/base/xsd/commonElementGrp.xsd",
@@ -32,20 +24,14 @@
32
24
  "schema/base/xsd/topicMod.xsd",
33
25
  "schema/base/xsd/utilitiesDomain.xsd",
34
26
  "schema/base/xsd/xml.xsd",
35
- "schema/bookmap/",
36
27
  "schema/bookmap/catalog.xml",
37
- "schema/bookmap/xsd/",
38
28
  "schema/bookmap/xsd/bookmap.xsd",
39
29
  "schema/bookmap/xsd/bookmapGrp.xsd",
40
30
  "schema/bookmap/xsd/bookmapMod.xsd",
41
31
  "schema/catalog.xml",
42
- "schema/ditaval/",
43
32
  "schema/ditaval/catalog.xml",
44
- "schema/ditaval/xsd/",
45
33
  "schema/ditaval/xsd/ditaval.xsd",
46
- "schema/fontoxml/",
47
34
  "schema/fontoxml/catalog.xml",
48
- "schema/fontoxml/constraints/",
49
35
  "schema/fontoxml/constraints/machineryTaskbodyConstraintMod.xsd",
50
36
  "schema/fontoxml/constraints/strictCommonElementConstraint.xsd",
51
37
  "schema/fontoxml/constraints/strictCommonElementConstraintInt.xsd",
@@ -62,7 +48,6 @@
62
48
  "schema/fontoxml/constraints/strictTblDeclConstraint.xsd",
63
49
  "schema/fontoxml/constraints/strictTopicConstraint.xsd",
64
50
  "schema/fontoxml/constraints/strictTroubleshootingConstraint.xsd",
65
- "schema/fontoxml/shells/",
66
51
  "schema/fontoxml/shells/basemap.xsd",
67
52
  "schema/fontoxml/shells/basetopic.xsd",
68
53
  "schema/fontoxml/shells/bookmap.xsd",
@@ -89,9 +74,7 @@
89
74
  "schema/fontoxml/shells/task.xsd",
90
75
  "schema/fontoxml/shells/topic.xsd",
91
76
  "schema/fontoxml/shells/troubleshooting.xsd",
92
- "schema/learning/",
93
77
  "schema/learning/catalog.xml",
94
- "schema/learning/xsd/",
95
78
  "schema/learning/xsd/learning2Domain.xsd",
96
79
  "schema/learning/xsd/learningAggregationsTopicrefConstraintMod.xsd",
97
80
  "schema/learning/xsd/learningAssessment.xsd",
@@ -126,23 +109,17 @@
126
109
  "schema/learning/xsd/learningSummary.xsd",
127
110
  "schema/learning/xsd/learningSummaryGrp.xsd",
128
111
  "schema/learning/xsd/learningSummaryMod.xsd",
129
- "schema/machineryIndustry/",
130
112
  "schema/machineryIndustry/catalog.xml",
131
- "schema/machineryIndustry/xsd/",
132
113
  "schema/machineryIndustry/xsd/machineryTask.xsd",
133
114
  "schema/machineryIndustry/xsd/machineryTaskbodyConstraintIntMod.xsd",
134
115
  "schema/machineryIndustry/xsd/machineryTaskbodyConstraintMod.xsd",
135
- "schema/subjectScheme/",
136
116
  "schema/subjectScheme/catalog.xml",
137
- "schema/subjectScheme/xsd/",
138
117
  "schema/subjectScheme/xsd/classifyDomain.xsd",
139
118
  "schema/subjectScheme/xsd/classifyMap.xsd",
140
119
  "schema/subjectScheme/xsd/subjectScheme.xsd",
141
120
  "schema/subjectScheme/xsd/subjectSchemeGrp.xsd",
142
121
  "schema/subjectScheme/xsd/subjectSchemeMod.xsd",
143
- "schema/technicalContent/",
144
122
  "schema/technicalContent/catalog.xml",
145
- "schema/technicalContent/xsd/",
146
123
  "schema/technicalContent/xsd/abbreviateDomain.xsd",
147
124
  "schema/technicalContent/xsd/concept.xsd",
148
125
  "schema/technicalContent/xsd/conceptGrp.xsd",
@@ -163,8 +140,6 @@
163
140
  "schema/technicalContent/xsd/glossrefDomain.xsd",
164
141
  "schema/technicalContent/xsd/map.xsd",
165
142
  "schema/technicalContent/xsd/markupDomain.xsd",
166
- "schema/technicalContent/xsd/mathml/",
167
- "schema/technicalContent/xsd/mathml/mathml3/",
168
143
  "schema/technicalContent/xsd/mathml/mathml3/mathml3-common.xsd",
169
144
  "schema/technicalContent/xsd/mathml/mathml3/mathml3-content.xsd",
170
145
  "schema/technicalContent/xsd/mathml/mathml3/mathml3-presentation.xsd",
@@ -178,8 +153,6 @@
178
153
  "schema/technicalContent/xsd/releaseManagementDomain.xsd",
179
154
  "schema/technicalContent/xsd/softwareDomain.xsd",
180
155
  "schema/technicalContent/xsd/strictTaskbodyConstraintMod.xsd",
181
- "schema/technicalContent/xsd/svg/",
182
- "schema/technicalContent/xsd/svg/svg11/",
183
156
  "schema/technicalContent/xsd/svg/svg11/local.xsd",
184
157
  "schema/technicalContent/xsd/svg/svg11/svg-animation.xsd",
185
158
  "schema/technicalContent/xsd/svg/svg11/svg-animevents-attrib.xsd",
@@ -231,19 +204,11 @@
231
204
  "schema/technicalContent/xsd/troubleshootingMod.xsd",
232
205
  "schema/technicalContent/xsd/uiDomain.xsd",
233
206
  "schema/technicalContent/xsd/xmlDomain.xsd",
234
- "schema/xnal/",
235
207
  "schema/xnal/catalog.xml",
236
- "schema/xnal/xsd/",
237
208
  "schema/xnal/xsd/xnalDomain.xsd",
238
- "xslt/",
239
- "xslt/unit test/",
240
209
  "xslt/unit test/TestBrokenFileXslt.xml",
241
- "xslt/unit test/TestMixedContent-result.html",
242
- "xslt/unit test/TestMixedContent.xspec",
243
210
  "xslt/unit test/inputFuleFileTest.xml",
244
211
  "xslt/unit test/inputFuleFileTest2.xml",
245
212
  "xslt/unit test/outputFuleFileTest.xml",
246
- "xslt/unit test/outputFuleFileTest2.xml",
247
- "xslt/xsltFixBrokenContent.xsl",
248
- "xslt/xsltMixedContent.xsl"
213
+ "xslt/unit test/outputFuleFileTest2.xml"
249
214
  ]
@@ -43,10 +43,8 @@ describe('api/schema/schemaZipHelpers', () => {
43
43
  );
44
44
 
45
45
  const directory = await unzipper.Open.buffer(zipBuffer);
46
- const listOfFiles = [];
47
- directory.files.forEach((file) => {
48
- listOfFiles.push(file.path);
49
- });
46
+ // Sort this list to guarrantee that the order is always the same
47
+ const listOfFiles = directory.files.map((file) => file.path).sort();
50
48
 
51
49
  const listOfFilesInJson = await fs.readJson(
52
50
  path.join(fixturePath, 'listOfFiles.json')
@@ -82,6 +80,14 @@ describe('api/schema/schemaZipHelpers', () => {
82
80
  path.join(tmpDir.path, 'schema/learning')
83
81
  );
84
82
 
83
+ // Remove fonto.json
84
+ await fs.remove(path.join(tmpDir.path, 'fonto.json'));
85
+ // Link fonto.json
86
+ await fs.ensureSymlink(
87
+ path.join(fixturePath, 'fonto.json'),
88
+ path.join(tmpDir.path, 'fonto.json')
89
+ );
90
+
85
91
  try {
86
92
  await testSchemaBundle(tmpDir.path);
87
93
  } finally {