@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.
- package/npm-shrinkwrap.json +3842 -8330
- package/package.json +13 -19
- package/src/App.js +1 -1
- package/src/FdtCommand.js +3 -3
- package/src/FdtLicense.js +95 -114
- package/src/ModuleRegistrationApi.js +44 -16
- package/src/addCoreModulesToApp.js +8 -0
- package/src/editorVersions.js +19 -5
- package/src/modules/connectors/index.js +109 -16
- package/src/modules/connectors/instanceBuild/Dockerfile.build +1 -1
- package/src/modules/connectors/instanceBuild/Dockerfile.run +1 -1
- package/src/modules/connectors/instanceDevBuild/docker-compose.yml +2 -2
- package/src/modules/content-quality/index.js +101 -20
- package/src/modules/content-quality/instanceBuild/Dockerfile +1 -1
- package/src/modules/content-quality/instanceDevBuild/docker-compose.yml +1 -1
- package/src/modules/core/src/precontroller.help.js +23 -26
- package/src/modules/document-history/index.js +101 -20
- package/src/modules/document-history/instanceBuild/Dockerfile +1 -1
- package/src/modules/document-history/instanceDevBuild/docker-compose.yml +1 -1
- package/src/modules/editor/dev-cms/connectors-cms-standard/configureConnectorsCmsStandardDocumentRouter.js +10 -0
- package/src/modules/editor/dev-cms/connectors-cms-standard/configureDocumentHistoryGetPostRouteHandler.js +51 -0
- package/src/modules/editor/dev-cms/connectors-cms-standard/configureDocumentPostRouteHandler.js +65 -76
- package/src/modules/editor/dev-cms/connectors-cms-standard/configureDocumentPresearchPostRouteHandler.js +10 -7
- package/src/modules/editor/dev-cms/connectors-cms-standard/configureDocumentPreviewRouteHandler.js +10 -0
- package/src/modules/editor/dev-cms/connectors-cms-standard/configureDocumentRevisionGetPostRouteHandler.js +69 -0
- package/src/modules/editor/src/commands/command.convert.editor.controller.js +11 -4
- package/src/modules/editor/src/commands/command.convert.package.controller.js +11 -4
- package/src/modules/editor/src/getAppManifest.js +3 -3
- package/src/modules/editor/src/getWebpackConfig.js +13 -0
- package/src/modules/editor/src/webpackPlugins/CheckDeepImportsResolvePlugin.js +4 -0
- package/src/modules/editor-pre-7-7-0/src/api/downloadEditorSDK.js +16 -12
- package/src/modules/editor-pre-7-7-0/src/api/executeAndLog.js +3 -2
- package/src/modules/editor-pre-7-7-0/src/api/init/createConfigConfiguration.js +86 -48
- package/src/modules/editor-pre-7-7-0/src/api/schema/compile.js +16 -22
- package/src/modules/editor-pre-7-7-0/src/api/schema/createSchemaPackages.js +8 -0
- package/src/modules/editor-pre-7-7-0/src/api/schema/getSchemaFontoJson.js +76 -48
- package/src/modules/editor-pre-7-7-0/src/api/schema/zipHelpers.js +6 -1
- package/src/modules/editor-pre-7-7-0/src/command.schema.compile.controller.js +51 -2
- package/src/modules/editor-pre-7-7-0/test/api/init/createConfigConfiguration.test.js +71 -33
- package/src/modules/editor-pre-7-7-0/test/api/init/fixtures/configjs-7160.js +45 -0
- package/src/modules/editor-pre-7-7-0/test/api/init/fixtures/configjs-800.js +45 -0
- package/src/modules/editor-pre-7-7-0/test/api/init/fixtures/configjs-810.js +32 -0
- package/src/modules/editor-pre-7-7-0/test/api/schema/buildSchemaExperienceConfigurationModel.test.js +70 -79
- package/src/modules/editor-pre-7-7-0/test/api/schema/fixtures/dita-example-schema-bundle/listOfFiles.json +1 -36
- package/src/modules/editor-pre-7-7-0/test/api/schema/fixtures/invalid-fonto-json/fonto.json +1 -0
- package/src/modules/editor-pre-7-7-0/test/api/schema/getSchemaFontoJson.test.js +174 -0
- package/src/modules/editor-pre-7-7-0/test/api/schema/zipSchemaSource.test.js +10 -4
- package/src/modules/editor-pre-7-7-0/test/schemaCompileController.test.js +205 -0
- package/src/modules/localization/index.js +2 -2
- package/src/modules/operations/src/api/getOperations.js +3 -3
- package/src/modules/review/index.js +103 -18
- package/src/modules/review/instanceBuild/Dockerfile +1 -1
- package/src/modules/review/instanceDevBuild/docker-compose.yml +1 -1
- package/src/modules/schema/src/api/getSchemaSummaries.js +2 -2
- package/src/modules/schema/test/getSchemaSummaries.test.js +14 -10
- package/src/modules/schema-compiler/index.js +99 -18
- package/src/modules/schema-compiler/instanceBuild/Dockerfile +1 -1
- package/src/modules/schema-compiler/instanceDevBuild/docker-compose.yml +1 -1
- package/src/modules/shared/index.js +3 -0
- package/src/modules/shared/package.json +14 -0
- package/src/modules/shared/src/addBackendDockerCommands.js +334 -0
- package/src/modules/shared/src/addBackendDownloadSelfContainedCommands.js +78 -0
- package/src/modules/shared/src/addBackendVersionsCommands.js +55 -0
- package/src/modules/shared/src/controller-templates/command.backend.build.controller.factory.js +273 -0
- package/src/modules/shared/src/controller-templates/command.backend.download-self-contained.controller.factory.js +131 -0
- package/src/modules/shared/src/controller-templates/command.backend.init.controller.factory.js +88 -0
- package/src/modules/shared/src/controller-templates/command.backend.run.controller.factory.js +420 -0
- package/src/modules/shared/src/controller-templates/command.backend.upgrade.controller.factory.js +79 -0
- package/src/modules/shared/src/controller-templates/command.backend.versions.controller.factory.js +23 -0
- package/src/modules/shared/src/controller-templates/docker/BackendManifest.js +42 -0
- package/src/modules/shared/src/controller-templates/docker/copyWhitelistedFiles.js +23 -0
- package/src/modules/shared/src/controller-templates/docker/dockerCleanup.js +146 -0
- package/src/modules/shared/src/controller-templates/docker/tryDockerLogout.js +31 -0
- package/src/modules/shared/src/controller-templates/docker/validateBackendInstance.js +48 -0
- package/src/modules/shared/src/ensureDockerCommands.js +61 -0
- package/src/modules/shared/src/executeAndLog.js +113 -0
- package/src/modules/{review/src/utilities/setEntryVisibility.js → shared/src/setFileVisibility.js} +8 -2
- package/src/modules/spell-checker/index.js +101 -18
- package/src/modules/spell-checker/instanceBuild/Dockerfile +1 -1
- package/src/modules/spell-checker/instanceDevBuild/docker-compose.yml +1 -1
- package/test/module.shared.test.js +81 -0
- package/src/modules/connectors/src/command.build.controller.js +0 -256
- package/src/modules/connectors/src/command.build.js +0 -54
- package/src/modules/connectors/src/command.download-self-contained.controller.js +0 -110
- package/src/modules/connectors/src/command.download-self-contained.js +0 -50
- package/src/modules/connectors/src/command.init.controller.js +0 -91
- package/src/modules/connectors/src/command.init.js +0 -42
- package/src/modules/connectors/src/command.run.controller.js +0 -462
- package/src/modules/connectors/src/command.run.js +0 -67
- package/src/modules/connectors/src/command.upgrade.controller.js +0 -52
- package/src/modules/connectors/src/command.upgrade.js +0 -42
- package/src/modules/connectors/src/command.versions.controller.js +0 -14
- package/src/modules/connectors/src/command.versions.js +0 -25
- package/src/modules/connectors/src/utilities/FontoxmlConnectorsManifest.js +0 -32
- package/src/modules/connectors/src/utilities/cleanup.js +0 -70
- package/src/modules/connectors/src/utilities/constants.js +0 -42
- package/src/modules/connectors/src/utilities/copyWhitelistedFiles.js +0 -22
- package/src/modules/connectors/src/utilities/executeAndLog.js +0 -63
- package/src/modules/connectors/src/utilities/getVerbosityLevel.js +0 -11
- package/src/modules/connectors/src/utilities/getWhitelist.js +0 -16
- package/src/modules/connectors/src/utilities/setEntryVisibility.js +0 -22
- package/src/modules/connectors/src/utilities/validateInstance.js +0 -29
- package/src/modules/content-quality/src/command.build.controller.js +0 -260
- package/src/modules/content-quality/src/command.build.js +0 -56
- package/src/modules/content-quality/src/command.download-self-contained.controller.js +0 -110
- package/src/modules/content-quality/src/command.download-self-contained.js +0 -52
- package/src/modules/content-quality/src/command.init.controller.js +0 -91
- package/src/modules/content-quality/src/command.init.js +0 -44
- package/src/modules/content-quality/src/command.run.controller.js +0 -444
- package/src/modules/content-quality/src/command.run.js +0 -64
- package/src/modules/content-quality/src/command.upgrade.controller.js +0 -52
- package/src/modules/content-quality/src/command.upgrade.js +0 -44
- package/src/modules/content-quality/src/command.versions.controller.js +0 -14
- package/src/modules/content-quality/src/command.versions.js +0 -25
- package/src/modules/content-quality/src/utilities/FontoxmlFcqManifest.js +0 -30
- package/src/modules/content-quality/src/utilities/cleanup.js +0 -70
- package/src/modules/content-quality/src/utilities/constants.js +0 -44
- package/src/modules/content-quality/src/utilities/copyWhitelistedFiles.js +0 -22
- package/src/modules/content-quality/src/utilities/executeAndLog.js +0 -63
- package/src/modules/content-quality/src/utilities/getVerbosityLevel.js +0 -11
- package/src/modules/content-quality/src/utilities/getWhitelist.js +0 -16
- package/src/modules/content-quality/src/utilities/setEntryVisibility.js +0 -22
- package/src/modules/content-quality/src/utilities/validateInstance.js +0 -29
- package/src/modules/document-history/src/command.build.controller.js +0 -260
- package/src/modules/document-history/src/command.build.js +0 -56
- package/src/modules/document-history/src/command.download-self-contained.controller.js +0 -110
- package/src/modules/document-history/src/command.download-self-contained.js +0 -50
- package/src/modules/document-history/src/command.init.controller.js +0 -91
- package/src/modules/document-history/src/command.init.js +0 -44
- package/src/modules/document-history/src/command.run.controller.js +0 -444
- package/src/modules/document-history/src/command.run.js +0 -64
- package/src/modules/document-history/src/command.upgrade.controller.js +0 -52
- package/src/modules/document-history/src/command.upgrade.js +0 -44
- package/src/modules/document-history/src/command.versions.controller.js +0 -14
- package/src/modules/document-history/src/command.versions.js +0 -25
- package/src/modules/document-history/src/utilities/FontoxmlFdhManifest.js +0 -30
- package/src/modules/document-history/src/utilities/cleanup.js +0 -70
- package/src/modules/document-history/src/utilities/constants.js +0 -44
- package/src/modules/document-history/src/utilities/copyWhitelistedFiles.js +0 -22
- package/src/modules/document-history/src/utilities/executeAndLog.js +0 -63
- package/src/modules/document-history/src/utilities/getVerbosityLevel.js +0 -11
- package/src/modules/document-history/src/utilities/getWhitelist.js +0 -16
- package/src/modules/document-history/src/utilities/setEntryVisibility.js +0 -22
- package/src/modules/document-history/src/utilities/validateInstance.js +0 -29
- package/src/modules/review/src/command.build.controller.js +0 -256
- package/src/modules/review/src/command.build.js +0 -54
- package/src/modules/review/src/command.download-self-contained.controller.js +0 -107
- package/src/modules/review/src/command.download-self-contained.js +0 -50
- package/src/modules/review/src/command.init.controller.js +0 -89
- package/src/modules/review/src/command.init.js +0 -42
- package/src/modules/review/src/command.run.controller.js +0 -428
- package/src/modules/review/src/command.run.js +0 -60
- package/src/modules/review/src/command.upgrade.controller.js +0 -59
- package/src/modules/review/src/command.upgrade.js +0 -42
- package/src/modules/review/src/command.versions.controller.js +0 -12
- package/src/modules/review/src/command.versions.js +0 -25
- package/src/modules/review/src/utilities/FontoxmlReviewManifest.js +0 -30
- package/src/modules/review/src/utilities/cleanup.js +0 -70
- package/src/modules/review/src/utilities/constants.js +0 -42
- package/src/modules/review/src/utilities/copyWhitelistedFiles.js +0 -22
- package/src/modules/review/src/utilities/executeAndLog.js +0 -63
- package/src/modules/review/src/utilities/getVerbosityLevel.js +0 -11
- package/src/modules/review/src/utilities/getWhitelist.js +0 -16
- package/src/modules/review/src/utilities/validateInstance.js +0 -45
- package/src/modules/schema-compiler/src/command.build.controller.js +0 -256
- package/src/modules/schema-compiler/src/command.build.js +0 -54
- package/src/modules/schema-compiler/src/command.download-self-contained.controller.js +0 -110
- package/src/modules/schema-compiler/src/command.download-self-contained.js +0 -50
- package/src/modules/schema-compiler/src/command.init.controller.js +0 -91
- package/src/modules/schema-compiler/src/command.init.js +0 -42
- package/src/modules/schema-compiler/src/command.run.controller.js +0 -430
- package/src/modules/schema-compiler/src/command.run.js +0 -60
- package/src/modules/schema-compiler/src/command.upgrade.controller.js +0 -64
- package/src/modules/schema-compiler/src/command.upgrade.js +0 -42
- package/src/modules/schema-compiler/src/command.versions.controller.js +0 -14
- package/src/modules/schema-compiler/src/command.versions.js +0 -25
- package/src/modules/schema-compiler/src/utilities/FontoxmlSchemaCompilerManifest.js +0 -32
- package/src/modules/schema-compiler/src/utilities/cleanup.js +0 -70
- package/src/modules/schema-compiler/src/utilities/constants.js +0 -43
- package/src/modules/schema-compiler/src/utilities/copyWhitelistedFiles.js +0 -22
- package/src/modules/schema-compiler/src/utilities/executeAndLog.js +0 -63
- package/src/modules/schema-compiler/src/utilities/getVerbosityLevel.js +0 -11
- package/src/modules/schema-compiler/src/utilities/getWhitelist.js +0 -16
- package/src/modules/schema-compiler/src/utilities/setEntryVisibility.js +0 -22
- package/src/modules/schema-compiler/src/utilities/validateInstance.js +0 -47
- package/src/modules/spell-checker/src/command.build.controller.js +0 -257
- package/src/modules/spell-checker/src/command.build.js +0 -54
- package/src/modules/spell-checker/src/command.download-self-contained.controller.js +0 -110
- package/src/modules/spell-checker/src/command.download-self-contained.js +0 -50
- package/src/modules/spell-checker/src/command.init.controller.js +0 -91
- package/src/modules/spell-checker/src/command.init.js +0 -42
- package/src/modules/spell-checker/src/command.run.controller.js +0 -430
- package/src/modules/spell-checker/src/command.run.js +0 -62
- package/src/modules/spell-checker/src/command.upgrade.controller.js +0 -61
- package/src/modules/spell-checker/src/command.upgrade.js +0 -42
- package/src/modules/spell-checker/src/command.versions.controller.js +0 -14
- package/src/modules/spell-checker/src/command.versions.js +0 -25
- package/src/modules/spell-checker/src/utilities/FontoxmlSpellCheckerManifest.js +0 -32
- package/src/modules/spell-checker/src/utilities/cleanup.js +0 -70
- package/src/modules/spell-checker/src/utilities/constants.js +0 -42
- package/src/modules/spell-checker/src/utilities/copyWhitelistedFiles.js +0 -22
- package/src/modules/spell-checker/src/utilities/executeAndLog.js +0 -63
- package/src/modules/spell-checker/src/utilities/getVerbosityLevel.js +0 -11
- package/src/modules/spell-checker/src/utilities/getWhitelist.js +0 -16
- package/src/modules/spell-checker/src/utilities/setEntryVisibility.js +0 -22
- 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 =
|
|
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
|
|
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
|
-
|
|
17
|
+
followSymbolicLinks: !ignoreSymlinks,
|
|
18
18
|
}
|
|
19
19
|
).then((operationsJsons) => {
|
|
20
20
|
return operationsJsons.reduce((allOps, operationsJson) => {
|
|
@@ -1,22 +1,107 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
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
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
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
|
-
import
|
|
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
|
|
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/
|
|
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(
|
|
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
|
|
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
|
|
85
|
+
'urn:packages.xsd',
|
|
86
|
+
'packages.dtd',
|
|
83
87
|
]);
|
|
84
88
|
});
|
|
85
89
|
|
|
@@ -1,24 +1,105 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
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
|
-
|
|
57
|
+
`Provides tools for working with ${options.productLabel}.`
|
|
13
58
|
)
|
|
14
|
-
|
|
59
|
+
|
|
60
|
+
.addRequiredProductLicenses(options.licensesRequired)
|
|
15
61
|
.setHideIfMissingRequiredProductLicenses()
|
|
16
62
|
.setAsHelpCommand();
|
|
17
63
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
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
|
};
|
|
@@ -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
|
+
}
|