definition-generator-framework 1.12.4 → 1.12.6

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 (185) hide show
  1. package/dist/framework/definition-component.d.ts +11 -9
  2. package/dist/framework/definition-component.js +18 -18
  3. package/dist/framework/definition-generator.d.ts +6 -5
  4. package/dist/framework/definition-generator.js +16 -18
  5. package/dist/framework/file-content-generator/file-content-generator.js +1 -1
  6. package/dist/framework/file-content-generator/file-content-generator.test.js +49 -49
  7. package/dist/framework/framework.d.ts +14 -13
  8. package/dist/framework/framework.data.d.ts +3 -3
  9. package/dist/framework/framework.data.js +13 -7
  10. package/dist/framework/framework.js +36 -33
  11. package/dist/framework/framework.model.d.ts +15 -15
  12. package/dist/framework/framework.model.js +3 -3
  13. package/dist/helpers/common-functions/common-functions.js +1 -1
  14. package/dist/helpers/common-functions/common-functions.spec.d.ts +1 -0
  15. package/dist/helpers/common-functions/common-functions.spec.js +50 -0
  16. package/dist/helpers/duplicate-helper/duplicate-helper.spec.d.ts +1 -0
  17. package/dist/helpers/duplicate-helper/duplicate-helper.spec.js +54 -0
  18. package/dist/helpers/output-helper/output-helper.d.ts +26 -26
  19. package/dist/helpers/output-helper/output-helper.js +127 -107
  20. package/dist/helpers/output-helper/output-helper.spec.d.ts +24 -0
  21. package/dist/helpers/output-helper/output-helper.spec.js +261 -0
  22. package/dist/helpers/output-helper/output-helper.test.d.ts +22 -22
  23. package/dist/helpers/output-helper/output-helper.test.js +224 -212
  24. package/dist/helpers/raw-definition-helper/raw-definition.helper.spec.d.ts +1 -0
  25. package/dist/helpers/raw-definition-helper/raw-definition.helper.spec.js +143 -0
  26. package/dist/helpers/validator/custom-validator-helper/custom-validator.helper.spec.d.ts +1 -0
  27. package/dist/helpers/validator/custom-validator-helper/custom-validator.helper.spec.js +191 -0
  28. package/dist/helpers/validator/custom-validators/image.custom-validator.d.ts +6 -6
  29. package/dist/helpers/validator/custom-validators/image.custom-validator.js +40 -39
  30. package/dist/helpers/validator/custom-validators/unique-name-group.custom-validator.d.ts +4 -4
  31. package/dist/helpers/validator/custom-validators/unique-name-group.custom-validator.js +29 -29
  32. package/dist/helpers/validator/joi-custom-validators.spec.d.ts +1 -0
  33. package/dist/helpers/validator/joi-custom-validators.spec.js +304 -0
  34. package/dist/helpers/validator/validator.spec.d.ts +1 -0
  35. package/dist/helpers/validator/validator.spec.js +332 -0
  36. package/dist/pipeline/1-select-definitions-helper.d.ts +13 -13
  37. package/dist/pipeline/1-select-definitions-helper.js +68 -72
  38. package/dist/pipeline/1-select-definitions.helper.test.js +40 -40
  39. package/dist/pipeline/1-select-definitions.spec.d.ts +1 -0
  40. package/dist/pipeline/1-select-definitions.spec.js +140 -0
  41. package/dist/pipeline/2-structure-parser.helper.spec.d.ts +1 -0
  42. package/dist/pipeline/2-structure-parser.helper.spec.js +280 -0
  43. package/dist/pipeline/parsers/array-parser.spec.d.ts +1 -0
  44. package/dist/pipeline/parsers/array-parser.spec.js +128 -0
  45. package/dist/pipeline/parsers/object-parser.spec.d.ts +1 -0
  46. package/dist/pipeline/parsers/object-parser.spec.js +179 -0
  47. package/dist/pipeline/parsers/primitive-parser.spec.d.ts +1 -0
  48. package/dist/pipeline/parsers/primitive-parser.spec.js +79 -0
  49. package/dist/pre-made-components/assets/3-font.js +4 -4
  50. package/dist/pre-made-components/events/1-event.d.ts +1 -1
  51. package/dist/pre-made-components/events/1-event.js +157 -125
  52. package/dist/pre-made-components/events/2-event-test.d.ts +8 -8
  53. package/dist/pre-made-components/events/2-event-test.js +156 -119
  54. package/dist/pre-made-components/events/2-script-test.js +0 -1
  55. package/dist/pre-made-components/events/event-setup.d.ts +10 -5
  56. package/dist/pre-made-components/events/event-setup.js +15 -15
  57. package/dist/pre-made-components/events/script-setup.d.ts +5 -3
  58. package/dist/pre-made-components/events/script-setup.js +11 -11
  59. package/package.json +11 -11
  60. package/.eslintrc.js +0 -212
  61. package/.vscode/launch.json +0 -15
  62. package/.vscode/settings.json +0 -25
  63. package/coverage/clover.xml +0 -503
  64. package/coverage/coverage-final.json +0 -16
  65. package/coverage/lcov-report/_mocks/index.html +0 -116
  66. package/coverage/lcov-report/_mocks/mocks.ts.html +0 -223
  67. package/coverage/lcov-report/base.css +0 -224
  68. package/coverage/lcov-report/block-navigation.js +0 -87
  69. package/coverage/lcov-report/favicon.png +0 -0
  70. package/coverage/lcov-report/framework/framework.data.ts.html +0 -109
  71. package/coverage/lcov-report/framework/index.html +0 -116
  72. package/coverage/lcov-report/helpers/common-functions/common-functions.ts.html +0 -178
  73. package/coverage/lcov-report/helpers/common-functions/index.html +0 -116
  74. package/coverage/lcov-report/helpers/duplicate-helper/duplicate-helper.ts.html +0 -196
  75. package/coverage/lcov-report/helpers/duplicate-helper/index.html +0 -116
  76. package/coverage/lcov-report/helpers/output-helper/index.html +0 -116
  77. package/coverage/lcov-report/helpers/output-helper/output-helper.ts.html +0 -277
  78. package/coverage/lcov-report/helpers/raw-definition-helper/index.html +0 -116
  79. package/coverage/lcov-report/helpers/raw-definition-helper/raw-definition.helper.ts.html +0 -256
  80. package/coverage/lcov-report/helpers/validator/index.html +0 -131
  81. package/coverage/lcov-report/helpers/validator/joi-custom-validators.ts.html +0 -643
  82. package/coverage/lcov-report/helpers/validator/validator.ts.html +0 -310
  83. package/coverage/lcov-report/index.html +0 -251
  84. package/coverage/lcov-report/pipeline/1-select-definitions-helper.ts.html +0 -358
  85. package/coverage/lcov-report/pipeline/2-structure-parser.helper.ts.html +0 -301
  86. package/coverage/lcov-report/pipeline/3-config.ts.html +0 -178
  87. package/coverage/lcov-report/pipeline/_mocks/index.html +0 -116
  88. package/coverage/lcov-report/pipeline/_mocks/index.ts.html +0 -229
  89. package/coverage/lcov-report/pipeline/index.html +0 -146
  90. package/coverage/lcov-report/pipeline/parsers/array-parser.ts.html +0 -271
  91. package/coverage/lcov-report/pipeline/parsers/index.html +0 -146
  92. package/coverage/lcov-report/pipeline/parsers/object-parser.ts.html +0 -439
  93. package/coverage/lcov-report/pipeline/parsers/primitive-parser.ts.html +0 -370
  94. package/coverage/lcov-report/prettify.css +0 -1
  95. package/coverage/lcov-report/prettify.js +0 -2
  96. package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
  97. package/coverage/lcov-report/sorter.js +0 -196
  98. package/coverage/lcov.info +0 -911
  99. package/dist/_mocks/mocks.js.map +0 -1
  100. package/dist/decorators/definition-component.js.map +0 -1
  101. package/dist/decorators/definition-generator.js.map +0 -1
  102. package/dist/framework/context.js.map +0 -1
  103. package/dist/framework/definition-component.js.map +0 -1
  104. package/dist/framework/definition-generator.js.map +0 -1
  105. package/dist/framework/definition-store.js.map +0 -1
  106. package/dist/framework/file-content-generator/file-content-generator.js.map +0 -1
  107. package/dist/framework/file-content-generator/file-content-generator.test.js.map +0 -1
  108. package/dist/framework/framework.data.js.map +0 -1
  109. package/dist/framework/framework.js.map +0 -1
  110. package/dist/framework/framework.model.js.map +0 -1
  111. package/dist/framework/index-file-generator/index-file-generator.js.map +0 -1
  112. package/dist/framework/interfaces.js.map +0 -1
  113. package/dist/framework/kernel.js.map +0 -1
  114. package/dist/helpers/common-functions/common-functions.js.map +0 -1
  115. package/dist/helpers/common-functions/common-functions.spec.js.map +0 -1
  116. package/dist/helpers/common-functions/common-functions.test.js.map +0 -1
  117. package/dist/helpers/duplicate-helper/duplicate-helper.js.map +0 -1
  118. package/dist/helpers/duplicate-helper/duplicate-helper.spec.js.map +0 -1
  119. package/dist/helpers/duplicate-helper/duplicate-helper.test.js.map +0 -1
  120. package/dist/helpers/output-helper/output-helper.js.map +0 -1
  121. package/dist/helpers/output-helper/output-helper.spec.js.map +0 -1
  122. package/dist/helpers/output-helper/output-helper.test.js.map +0 -1
  123. package/dist/helpers/raw-definition-helper/raw-definition.helper.js.map +0 -1
  124. package/dist/helpers/raw-definition-helper/raw-definition.helper.spec.js.map +0 -1
  125. package/dist/helpers/raw-definition-helper/raw-definition.helper.test.js.map +0 -1
  126. package/dist/helpers/validator/custom-validator-helper/custom-validator.helper.js.map +0 -1
  127. package/dist/helpers/validator/custom-validator-helper/custom-validator.helper.spec.js.map +0 -1
  128. package/dist/helpers/validator/custom-validator-helper/custom-validator.helper.test.js.map +0 -1
  129. package/dist/helpers/validator/custom-validators/helpers/sprite-validation.helper.js.map +0 -1
  130. package/dist/helpers/validator/custom-validators/helpers/sprite-validation.helper.test.js.map +0 -1
  131. package/dist/helpers/validator/custom-validators/image.custom-validator.js.map +0 -1
  132. package/dist/helpers/validator/custom-validators/path.custom-validator.js.map +0 -1
  133. package/dist/helpers/validator/custom-validators/position-on-sprite.js.map +0 -1
  134. package/dist/helpers/validator/custom-validators/reference.custom-validator.js.map +0 -1
  135. package/dist/helpers/validator/custom-validators/sprite.custom-validator.js.map +0 -1
  136. package/dist/helpers/validator/custom-validators/unique-name-group.custom-validator.js.map +0 -1
  137. package/dist/helpers/validator/custom-validators/unique.custom-validator.js.map +0 -1
  138. package/dist/helpers/validator/joi-custom-validators.js.map +0 -1
  139. package/dist/helpers/validator/joi-custom-validators.spec.js.map +0 -1
  140. package/dist/helpers/validator/validator.js.map +0 -1
  141. package/dist/helpers/validator/validator.spec.js.map +0 -1
  142. package/dist/helpers/validator/validator.test.js.map +0 -1
  143. package/dist/index.js.map +0 -1
  144. package/dist/pipeline/1-select-definitions-helper.js.map +0 -1
  145. package/dist/pipeline/1-select-definitions.helper.js.map +0 -1
  146. package/dist/pipeline/1-select-definitions.helper.test.js.map +0 -1
  147. package/dist/pipeline/1-select-definitions.spec.js.map +0 -1
  148. package/dist/pipeline/2-structure-parser.helper.js.map +0 -1
  149. package/dist/pipeline/2-structure-parser.helper.spec.js.map +0 -1
  150. package/dist/pipeline/2-structure-parser.helper.test.js.map +0 -1
  151. package/dist/pipeline/3-config.js.map +0 -1
  152. package/dist/pipeline/_mocks/index.js.map +0 -1
  153. package/dist/pipeline/parsers/array-parser.js.map +0 -1
  154. package/dist/pipeline/parsers/array-parser.spec.js.map +0 -1
  155. package/dist/pipeline/parsers/array-parser.test.js.map +0 -1
  156. package/dist/pipeline/parsers/object-parser.js.map +0 -1
  157. package/dist/pipeline/parsers/object-parser.spec.js.map +0 -1
  158. package/dist/pipeline/parsers/object-parser.test.js.map +0 -1
  159. package/dist/pipeline/parsers/primitive-parser.js.map +0 -1
  160. package/dist/pipeline/parsers/primitive-parser.spec.js.map +0 -1
  161. package/dist/pipeline/parsers/primitive-parser.test.js.map +0 -1
  162. package/dist/pipeline/raw-data-parser.js.map +0 -1
  163. package/dist/pre-made-components/_validators/shape-validators.js.map +0 -1
  164. package/dist/pre-made-components/_validators/sprite-validators.js.map +0 -1
  165. package/dist/pre-made-components/assets/1-sprite.js.map +0 -1
  166. package/dist/pre-made-components/assets/2-sprite-group.js.map +0 -1
  167. package/dist/pre-made-components/assets/3-font.js.map +0 -1
  168. package/dist/pre-made-components/events/1-event.js.map +0 -1
  169. package/dist/pre-made-components/events/1-script.js.map +0 -1
  170. package/dist/pre-made-components/events/2-event-test.js.map +0 -1
  171. package/dist/pre-made-components/events/2-script-test.js.map +0 -1
  172. package/dist/pre-made-components/events/3-event.js.map +0 -1
  173. package/dist/pre-made-components/events/4-event-test.js.map +0 -1
  174. package/dist/pre-made-components/events/event-setup.js.map +0 -1
  175. package/dist/pre-made-components/events/helpers/quotes-to-tags.helper.js.map +0 -1
  176. package/dist/pre-made-components/events/helpers/quotes-to-tags.helper.test.js.map +0 -1
  177. package/dist/pre-made-components/events/helpers/script-testing.helper.js.map +0 -1
  178. package/dist/pre-made-components/events/script-setup.js.map +0 -1
  179. package/dist/pre-made-components/events/scripting-setup.js.map +0 -1
  180. package/dist/pre-made-components/events/validators.js.map +0 -1
  181. package/dist/setup.js.map +0 -1
  182. package/package.json.bak +0 -60
  183. package/scripts/prepare-package-json.ts +0 -23
  184. package/tsconfig.json +0 -24
  185. package/vitest.config.ts +0 -1
@@ -1,135 +1,172 @@
1
- "use strict";
2
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
1
+ 'use strict';
2
+ var __decorate =
3
+ (this && this.__decorate) ||
4
+ function (decorators, target, key, desc) {
5
+ var c = arguments.length,
6
+ r = c < 3 ? target : desc === null ? (desc = Object.getOwnPropertyDescriptor(target, key)) : desc,
7
+ d;
8
+ if (typeof Reflect === 'object' && typeof Reflect.decorate === 'function')
9
+ r = Reflect.decorate(decorators, target, key, desc);
10
+ else
11
+ for (var i = decorators.length - 1; i >= 0; i--)
12
+ if ((d = decorators[i])) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
13
  return c > 3 && r && Object.defineProperty(target, key, r), r;
7
- };
8
- var __importDefault = (this && this.__importDefault) || function (mod) {
9
- return (mod && mod.__esModule) ? mod : { "default": mod };
10
- };
14
+ };
15
+ var __importDefault =
16
+ (this && this.__importDefault) ||
17
+ function (mod) {
18
+ return mod && mod.__esModule ? mod : { default: mod };
19
+ };
11
20
  var EventTestComponent_1;
12
- Object.defineProperty(exports, "__esModule", { value: true });
21
+ Object.defineProperty(exports, '__esModule', { value: true });
13
22
  exports.EventTestComponent = void 0;
14
- const helpers_lib_1 = require("helpers-lib");
15
- const joi_1 = __importDefault(require("joi"));
16
- const script_engine_lib_1 = require("script-engine-lib");
17
- const definition_component_1 = require("../../decorators/definition-component");
18
- const definition_store_1 = require("../../framework/definition-store");
19
- const _1_event_1 = require("./1-event");
20
- const event_setup_1 = require("./event-setup");
23
+ const helpers_lib_1 = require('helpers-lib');
24
+ const joi_1 = __importDefault(require('joi'));
25
+ const script_engine_lib_1 = require('script-engine-lib');
26
+ const definition_component_1 = require('../../decorators/definition-component');
27
+ const definition_store_1 = require('../../framework/definition-store');
28
+ const _1_event_1 = require('./1-event');
29
+ const event_setup_1 = require('./event-setup');
21
30
  const CommandEventSchema = joi_1.default.string().custom(value => ({
22
- type: 'command',
23
- value: value
31
+ type: 'command',
32
+ value: value
24
33
  }));
25
- const RunEventSchema = joi_1.default.object()
26
- .keys({
34
+ const RunEventSchema = joi_1.default
35
+ .object()
36
+ .keys({
27
37
  runEvent: joi_1.default.string().reference(_1_event_1.EventComponent).required()
28
- })
29
- .custom(value => ({
38
+ })
39
+ .custom(value => ({
30
40
  type: 'runEvent',
31
41
  value: value.runEvent
32
- }));
33
- const EventTestActionSchema = () => joi_1.default.array()
34
- .items(joi_1.default.alternatives()
35
- .conditional(joi_1.default.string(), {
36
- then: CommandEventSchema
37
- })
38
- .conditional(joi_1.default.object({ runEvent: joi_1.default.exist() }).unknown(), {
39
- then: RunEventSchema
40
- }))
42
+ }));
43
+ const EventTestActionSchema = () =>
44
+ joi_1.default
45
+ .array()
46
+ .items(
47
+ joi_1.default
48
+ .alternatives()
49
+ .conditional(joi_1.default.string(), {
50
+ then: CommandEventSchema
51
+ })
52
+ .conditional(joi_1.default.object({ runEvent: joi_1.default.exist() }).unknown(), {
53
+ then: RunEventSchema
54
+ })
55
+ )
41
56
  .min(1);
42
- let EventTestComponent = EventTestComponent_1 = class EventTestComponent extends definition_component_1.DefinitionComponent {
43
- async process(definitions, output) {
44
- let eventTestSimulator = this.createEventTestSimulator();
45
- let runtimeErrors = this.runTests(definitions, eventTestSimulator, output);
46
- this.printErrors(runtimeErrors, eventTestSimulator, output);
47
- }
48
- createEventTestSimulator() {
49
- let allScripts = definition_store_1.DefinitionStore.getDefinitions(_1_event_1.EventComponent);
50
- return new script_engine_lib_1.ScriptTestSimulator(allScripts);
51
- }
52
- runTests(testDefinitions, eventTestSimulator, output) {
53
- let errorLogs = [];
54
- testDefinitions.forEach(testDefinition => {
55
- let event = definition_store_1.DefinitionStore.getDefinitionOrFail(_1_event_1.EventComponent, testDefinition.event);
56
- let errorEncountered = false;
57
- testDefinition.cases.forEach((testCase, testCaseIndex) => {
58
- if (!errorEncountered) {
59
- let jsEngine = new helpers_lib_1.JSEngine(new event_setup_1.EventSetup.EventSimulatorFunctionsConstructor(), {});
60
- try {
61
- eventTestSimulator.simulateScript(event, jsEngine, testCase.actionsBeforeTesting);
62
- }
63
- catch (e) {
64
- let errorLog = this.prepareErrorLog(e, testDefinition, testCaseIndex, output);
65
- errorLogs.push(errorLog);
66
- errorEncountered = true;
67
- }
68
- }
69
- });
70
- });
71
- return errorLogs;
72
- }
73
- prepareErrorLog(e, testDefinition, testCaseIndex, output) {
74
- if (e instanceof script_engine_lib_1.SimulationError) {
75
- return {
76
- description: e.message,
77
- location: definition_store_1.DefinitionStore.getLocationInFileById(_1_event_1.EventComponent, e.location.scriptId, e.location.path)
78
- };
79
- }
80
- else if (e instanceof script_engine_lib_1.ActionsBeforeTestingError) {
81
- let executedActionLocation = definition_store_1.DefinitionStore.getLocationInFile(EventTestComponent_1, testDefinition, [
82
- 'cases',
83
- `${testCaseIndex}`,
84
- 'actionsBeforeTesting',
85
- `${e.actionIndex}`
86
- ]);
87
- return {
88
- description: e.message,
89
- location: executedActionLocation
90
- };
91
- }
92
- else if (e instanceof script_engine_lib_1.BranchingBeforeTestingError) {
93
- let testLocation = definition_store_1.DefinitionStore.getLocationInFile(EventTestComponent_1, testDefinition, []);
94
- let executionHistoryAddition = `Running the test: ${output.convertLocationInFileToLink(testLocation)}\n\n`;
95
- let executionHistoryStart = e.message.indexOf('\n', e.message.indexOf('Execution history')) + 1;
96
- let fullMessage = e.message.slice(0, executionHistoryStart) + executionHistoryAddition + e.message.slice(executionHistoryStart);
97
- return {
98
- description: fullMessage,
99
- location: definition_store_1.DefinitionStore.getLocationInFileById(_1_event_1.EventComponent, e.location.scriptId, e.location.path)
100
- };
101
- }
102
- else {
103
- throw e;
57
+ let EventTestComponent = (EventTestComponent_1 = class EventTestComponent extends definition_component_1.DefinitionComponent {
58
+ async process(definitions, output) {
59
+ let eventTestSimulator = this.createEventTestSimulator();
60
+ let runtimeErrors = this.runTests(definitions, eventTestSimulator, output);
61
+ this.printErrors(runtimeErrors, eventTestSimulator, output);
62
+ }
63
+ createEventTestSimulator() {
64
+ let allScripts = definition_store_1.DefinitionStore.getDefinitions(_1_event_1.EventComponent);
65
+ return new script_engine_lib_1.ScriptTestSimulator(allScripts);
66
+ }
67
+ runTests(testDefinitions, eventTestSimulator, output) {
68
+ let errorLogs = [];
69
+ testDefinitions.forEach(testDefinition => {
70
+ let event = definition_store_1.DefinitionStore.getDefinitionOrFail(_1_event_1.EventComponent, testDefinition.event);
71
+ let errorEncountered = false;
72
+ testDefinition.cases.forEach((testCase, testCaseIndex) => {
73
+ if (!errorEncountered) {
74
+ let jsEngine = new helpers_lib_1.JSEngine(new event_setup_1.EventSetup.EventSimulatorFunctionsConstructor(), {});
75
+ try {
76
+ eventTestSimulator.simulateScript(event, jsEngine, testCase.actionsBeforeTesting);
77
+ } catch (e) {
78
+ let errorLog = this.prepareErrorLog(e, testDefinition, testCaseIndex, output);
79
+ errorLogs.push(errorLog);
80
+ errorEncountered = true;
81
+ }
104
82
  }
83
+ });
84
+ });
85
+ return errorLogs;
86
+ }
87
+ prepareErrorLog(e, testDefinition, testCaseIndex, output) {
88
+ if (e instanceof script_engine_lib_1.SimulationError) {
89
+ return {
90
+ description: e.message,
91
+ location: definition_store_1.DefinitionStore.getLocationInFileById(
92
+ _1_event_1.EventComponent,
93
+ e.location.scriptId,
94
+ e.location.path
95
+ )
96
+ };
97
+ } else if (e instanceof script_engine_lib_1.ActionsBeforeTestingError) {
98
+ let executedActionLocation = definition_store_1.DefinitionStore.getLocationInFile(EventTestComponent_1, testDefinition, [
99
+ 'cases',
100
+ `${testCaseIndex}`,
101
+ 'actionsBeforeTesting',
102
+ `${e.actionIndex}`
103
+ ]);
104
+ return {
105
+ description: e.message,
106
+ location: executedActionLocation
107
+ };
108
+ } else if (e instanceof script_engine_lib_1.BranchingBeforeTestingError) {
109
+ let testLocation = definition_store_1.DefinitionStore.getLocationInFile(EventTestComponent_1, testDefinition, []);
110
+ let executionHistoryAddition = `Running the test: ${output.convertLocationInFileToLink(testLocation)}\n\n`;
111
+ let executionHistoryStart = e.message.indexOf('\n', e.message.indexOf('Execution history')) + 1;
112
+ let fullMessage =
113
+ e.message.slice(0, executionHistoryStart) + executionHistoryAddition + e.message.slice(executionHistoryStart);
114
+ return {
115
+ description: fullMessage,
116
+ location: definition_store_1.DefinitionStore.getLocationInFileById(
117
+ _1_event_1.EventComponent,
118
+ e.location.scriptId,
119
+ e.location.path
120
+ )
121
+ };
122
+ } else {
123
+ throw e;
105
124
  }
106
- printErrors(runtimeErrors, scriptTestSimulator, output) {
107
- if (runtimeErrors.length === 0) {
108
- scriptTestSimulator.getUnvisitedBranchLocations().forEach(location => output.addError({
109
- description: `Event branch is not reaced by any of the combinations during the tests.`,
110
- location: definition_store_1.DefinitionStore.getLocationInFileById(_1_event_1.EventComponent, location.scriptId, location.path)
111
- }));
112
- }
113
- runtimeErrors.forEach(error => output.addError(error));
125
+ }
126
+ printErrors(runtimeErrors, scriptTestSimulator, output) {
127
+ if (runtimeErrors.length === 0) {
128
+ scriptTestSimulator.getUnvisitedBranchLocations().forEach(location =>
129
+ output.addError({
130
+ description: `Event branch is not reaced by any of the combinations during the tests.`,
131
+ location: definition_store_1.DefinitionStore.getLocationInFileById(
132
+ _1_event_1.EventComponent,
133
+ location.scriptId,
134
+ location.path
135
+ )
136
+ })
137
+ );
114
138
  }
115
- };
139
+ runtimeErrors.forEach(error => output.addError(error));
140
+ }
141
+ });
116
142
  exports.EventTestComponent = EventTestComponent;
117
- exports.EventTestComponent = EventTestComponent = EventTestComponent_1 = __decorate([
118
- (0, definition_component_1.DefinitionComponentDecorator)({
119
- componentName: 'EVENT-TEST',
120
- keyName: 'id',
121
- validationSchema: joi_1.default.object()
143
+ exports.EventTestComponent =
144
+ EventTestComponent =
145
+ EventTestComponent_1 =
146
+ __decorate(
147
+ [
148
+ (0, definition_component_1.DefinitionComponentDecorator)({
149
+ componentName: 'EVENT-TEST',
150
+ keyName: 'id',
151
+ validationSchema: joi_1.default
152
+ .object()
122
153
  .keys({
123
- event: joi_1.default.string().reference(_1_event_1.EventComponent).required(),
124
- cases: joi_1.default.array()
125
- .items(joi_1.default.object()
126
- .keys({
127
- actionsBeforeTesting: EventTestActionSchema().default([]).optional()
128
- })
129
- .required())
154
+ event: joi_1.default.string().reference(_1_event_1.EventComponent).required(),
155
+ cases: joi_1.default
156
+ .array()
157
+ .items(
158
+ joi_1.default
159
+ .object()
160
+ .keys({
161
+ actionsBeforeTesting: EventTestActionSchema().default([]).optional()
162
+ })
163
+ .required()
164
+ )
130
165
  .required()
131
- })
166
+ })
132
167
  .required()
133
- })
134
- ], EventTestComponent);
135
- //# sourceMappingURL=2-event-test.js.map
168
+ })
169
+ ],
170
+ EventTestComponent
171
+ );
172
+ //# sourceMappingURL=2-event-test.js.map
@@ -80,7 +80,6 @@ let ScriptTestComponent = ScriptTestComponent_1 = class ScriptTestComponent exte
80
80
  }
81
81
  };
82
82
  }
83
- ;
84
83
  };
85
84
  exports.ScriptTestComponent = ScriptTestComponent;
86
85
  exports.ScriptTestComponent = ScriptTestComponent = ScriptTestComponent_1 = __decorate([
@@ -1,8 +1,13 @@
1
1
  import { ScriptEngineSimulatorFunctions } from 'script-engine-lib';
2
2
  export declare class EventSetup {
3
- private static _eventSimulatorFunctionsConstructor;
4
- private static _richTextTags;
5
- static get EventSimulatorFunctionsConstructor(): new (...args: any[]) => ScriptEngineSimulatorFunctions;
6
- static get RichTextTags(): Set<string> | undefined;
7
- static set(eventSimulatorFunctionsConstructor: new (...args: any[]) => ScriptEngineSimulatorFunctions, richTextTags: Set<string> | undefined): void;
3
+ private static _eventSimulatorFunctionsConstructor;
4
+ private static _richTextTags;
5
+ static get EventSimulatorFunctionsConstructor(): new (
6
+ ...args: any[]
7
+ ) => ScriptEngineSimulatorFunctions;
8
+ static get RichTextTags(): Set<string> | undefined;
9
+ static set(
10
+ eventSimulatorFunctionsConstructor: new (...args: any[]) => ScriptEngineSimulatorFunctions,
11
+ richTextTags: Set<string> | undefined
12
+ ): void;
8
13
  }
@@ -1,20 +1,20 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ 'use strict';
2
+ Object.defineProperty(exports, '__esModule', { value: true });
3
3
  exports.EventSetup = void 0;
4
4
  class EventSetup {
5
- static get EventSimulatorFunctionsConstructor() {
6
- if (!this._eventSimulatorFunctionsConstructor) {
7
- throw new Error('EventSimulatorFunctionsConstructor is not set');
8
- }
9
- return this._eventSimulatorFunctionsConstructor;
10
- }
11
- static get RichTextTags() {
12
- return this._richTextTags;
13
- }
14
- static set(eventSimulatorFunctionsConstructor, richTextTags) {
15
- this._eventSimulatorFunctionsConstructor = eventSimulatorFunctionsConstructor;
16
- this._richTextTags = richTextTags;
5
+ static get EventSimulatorFunctionsConstructor() {
6
+ if (!this._eventSimulatorFunctionsConstructor) {
7
+ throw new Error('EventSimulatorFunctionsConstructor is not set');
17
8
  }
9
+ return this._eventSimulatorFunctionsConstructor;
10
+ }
11
+ static get RichTextTags() {
12
+ return this._richTextTags;
13
+ }
14
+ static set(eventSimulatorFunctionsConstructor, richTextTags) {
15
+ this._eventSimulatorFunctionsConstructor = eventSimulatorFunctionsConstructor;
16
+ this._richTextTags = richTextTags;
17
+ }
18
18
  }
19
19
  exports.EventSetup = EventSetup;
20
- //# sourceMappingURL=event-setup.js.map
20
+ //# sourceMappingURL=event-setup.js.map
@@ -1,6 +1,8 @@
1
1
  import { ScriptEngineSimulatorFunctions } from 'script-engine-lib';
2
2
  export declare class ScriptSetup {
3
- private static _scriptSimulatorFunctionsConstructor;
4
- static get ScriptSimulatorFunctionsConstructor(): new (...args: any[]) => ScriptEngineSimulatorFunctions;
5
- static set(scriptSimulatorFunctionsConstructor: new (...args: any[]) => ScriptEngineSimulatorFunctions): void;
3
+ private static _scriptSimulatorFunctionsConstructor;
4
+ static get ScriptSimulatorFunctionsConstructor(): new (
5
+ ...args: any[]
6
+ ) => ScriptEngineSimulatorFunctions;
7
+ static set(scriptSimulatorFunctionsConstructor: new (...args: any[]) => ScriptEngineSimulatorFunctions): void;
6
8
  }
@@ -1,16 +1,16 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ 'use strict';
2
+ Object.defineProperty(exports, '__esModule', { value: true });
3
3
  exports.ScriptSetup = void 0;
4
4
  class ScriptSetup {
5
- static get ScriptSimulatorFunctionsConstructor() {
6
- if (!this._scriptSimulatorFunctionsConstructor) {
7
- throw new Error('ScriptSimulatorFunctionsConstructor is not set');
8
- }
9
- return this._scriptSimulatorFunctionsConstructor;
10
- }
11
- static set(scriptSimulatorFunctionsConstructor) {
12
- this._scriptSimulatorFunctionsConstructor = scriptSimulatorFunctionsConstructor;
5
+ static get ScriptSimulatorFunctionsConstructor() {
6
+ if (!this._scriptSimulatorFunctionsConstructor) {
7
+ throw new Error('ScriptSimulatorFunctionsConstructor is not set');
13
8
  }
9
+ return this._scriptSimulatorFunctionsConstructor;
10
+ }
11
+ static set(scriptSimulatorFunctionsConstructor) {
12
+ this._scriptSimulatorFunctionsConstructor = scriptSimulatorFunctionsConstructor;
13
+ }
14
14
  }
15
15
  exports.ScriptSetup = ScriptSetup;
16
- //# sourceMappingURL=script-setup.js.map
16
+ //# sourceMappingURL=script-setup.js.map
package/package.json CHANGED
@@ -1,8 +1,13 @@
1
1
  {
2
2
  "name": "definition-generator-framework",
3
- "version": "1.12.4",
3
+ "version": "1.12.6",
4
4
  "description": "Definition Generator Framework",
5
5
  "main": "dist/index.js",
6
+ "types": "dist/index.d.ts",
7
+ "files": [
8
+ "dist/**/*.js",
9
+ "dist/**/*.d.ts"
10
+ ],
6
11
  "publishConfig": {
7
12
  "main": "dist/index.js"
8
13
  },
@@ -29,30 +34,25 @@
29
34
  "test": "vitest",
30
35
  "start": "npm run build && node dist",
31
36
  "build": "tsc",
32
- "lint": "eslint \"src/**/*.ts\" --fix",
37
+ "lint": "biome check . --write --max-diagnostics=1",
33
38
  "deploy": "vitest run && npm run build && npm publish",
34
39
  "prepack": "cp package.json package.json.bak && ts-node scripts/prepare-package-json.ts",
35
40
  "postpack": "mv package.json.bak package.json"
36
41
  },
37
42
  "dependencies": {
38
- "helpers-lib": "1.13.9",
43
+ "helpers-lib": "1.13.10",
39
44
  "image-size": "1.1.1",
40
45
  "joi": "17.11.0",
41
46
  "prettier": "3.3.3",
42
47
  "jsonpath-plus": "8.1.0",
43
- "script-engine-lib": "0.4.2"
48
+ "script-engine-lib": "0.4.3",
49
+ "glob": "10.3.14"
44
50
  },
45
51
  "devDependencies": {
52
+ "@biomejs/biome": "2.2.4",
46
53
  "@types/glob": "8.1.0",
47
54
  "@types/node": "20.10.5",
48
55
  "@types/rimraf": "4.0.5",
49
- "@typescript-eslint/eslint-plugin": "6.16.0",
50
- "@typescript-eslint/parser": "6.16.0",
51
- "eslint": "8.56.0",
52
- "eslint-config-prettier": "9.1.0",
53
- "eslint-plugin-import": "2.29.1",
54
- "eslint-plugin-no-null": "1.0.2",
55
- "eslint-plugin-simple-import-sort": "12.1.1",
56
56
  "ts-node": "10.9.2",
57
57
  "typescript": "5.3.3",
58
58
  "vitest": "1.6.0"
package/.eslintrc.js DELETED
@@ -1,212 +0,0 @@
1
- module.exports = {
2
- env: {
3
- browser: true,
4
- es6: true,
5
- node: true
6
- },
7
- extends: [
8
- 'eslint:recommended',
9
- 'plugin:@typescript-eslint/eslint-recommended',
10
- 'plugin:@typescript-eslint/recommended',
11
- 'plugin:import/recommended',
12
- 'plugin:import/electron',
13
- 'plugin:import/typescript',
14
- 'plugin:@typescript-eslint/eslint-recommended',
15
- 'plugin:@typescript-eslint/recommended',
16
- 'prettier'
17
- ],
18
- parser: '@typescript-eslint/parser',
19
- parserOptions: {
20
- sourceType: 'module'
21
- },
22
- root: true,
23
- env: {
24
- node: true,
25
- jest: true
26
- },
27
- plugins: ['@typescript-eslint', '@typescript-eslint/eslint-plugin', 'no-null', 'simple-import-sort'],
28
- ignorePatterns: ['**/*.js', 'vite.config.ts', 'out/**/*', 'dist/**/*', 'node_modules/**/*'],
29
- rules: {
30
- 'simple-import-sort/imports': [
31
- 'error',
32
- {
33
- groups: [
34
- // External libraries (node_modules packages)
35
- ['^[a-z]'],
36
- // Local imports (relative imports starting with .)
37
- ['^\\.\\.', '^\\./']
38
- ]
39
- }
40
- ],
41
- 'simple-import-sort/exports': 'error',
42
- 'no-null/no-null': 2,
43
- 'comma-dangle': ['error', 'never'],
44
- '@typescript-eslint/adjacent-overload-signatures': 'error',
45
- '@typescript-eslint/ban-ts-comment': 'off',
46
- '@typescript-eslint/ban-types': 'error',
47
- '@typescript-eslint/consistent-type-definitions': 'error',
48
- '@typescript-eslint/dot-notation': 'off',
49
- '@typescript-eslint/explicit-function-return-type': [
50
- "warn",
51
- { "allowExpressions": true }
52
- ],
53
- '@typescript-eslint/explicit-member-accessibility': [
54
- 'off',
55
- {
56
- accessibility: 'explicit'
57
- }
58
- ],
59
- '@typescript-eslint/explicit-module-boundary-types': 'warn',
60
- '@typescript-eslint/indent': ['error', 2],
61
- '@typescript-eslint/interface-name-prefix': 'off',
62
- '@typescript-eslint/member-delimiter-style': [
63
- 'error',
64
- {
65
- multiline: {
66
- delimiter: 'semi',
67
- requireLast: true
68
- },
69
- singleline: {
70
- delimiter: 'semi',
71
- requireLast: false
72
- }
73
- }
74
- ],
75
- '@typescript-eslint/naming-convention': [
76
- 'error',
77
- {
78
- selector: 'variable',
79
- modifiers: ['const'],
80
- format: ['PascalCase', 'UPPER_CASE']
81
- },
82
- {
83
- selector: 'variable',
84
- modifiers: [],
85
- format: ['camelCase'],
86
- leadingUnderscore: 'allow',
87
- trailingUnderscore: 'forbid'
88
- }
89
- ],
90
- '@typescript-eslint/no-array-constructor': 'error',
91
- '@typescript-eslint/no-empty-function': 'off',
92
- '@typescript-eslint/no-empty-interface': 'error',
93
- '@typescript-eslint/no-explicit-any': 'off',
94
- '@typescript-eslint/no-extra-non-null-assertion': 'error',
95
- '@typescript-eslint/no-inferrable-types': [
96
- 'error',
97
- {
98
- ignoreParameters: true,
99
- ignoreProperties: true
100
- }
101
- ],
102
- '@typescript-eslint/no-misused-new': 'error',
103
- '@typescript-eslint/no-namespace': 'error',
104
- '@typescript-eslint/no-non-null-asserted-optional-chain': 'error',
105
- '@typescript-eslint/no-non-null-assertion': 'off',
106
- '@typescript-eslint/no-this-alias': 'error',
107
- '@typescript-eslint/no-unused-expressions': 'off',
108
- '@typescript-eslint/no-unused-vars': [
109
- 'error',
110
- {
111
- args: 'none',
112
- vars: 'all',
113
- varsIgnorePattern: '^_',
114
- caughtErrors: 'all',
115
- caughtErrorsIgnorePattern: '^_',
116
- ignoreRestSiblings: true
117
- }
118
- ],
119
- '@typescript-eslint/no-var-requires': 'error',
120
- '@typescript-eslint/prefer-as-const': 'error',
121
- '@typescript-eslint/prefer-function-type': 'error',
122
- '@typescript-eslint/prefer-namespace-keyword': 'error',
123
- '@typescript-eslint/quotes': ['error', 'single', { allowTemplateLiterals: true }],
124
- '@typescript-eslint/semi': ['error', 'always'],
125
- '@typescript-eslint/triple-slash-reference': 'error',
126
- '@typescript-eslint/type-annotation-spacing': 'error',
127
- '@typescript-eslint/unified-signatures': 'error',
128
- '@typescript-eslint/no-shadow': 'warn',
129
- 'arrow-body-style': 'error',
130
- 'arrow-parens': [2, 'as-needed'],
131
- 'brace-style': ['error', '1tbs'],
132
- 'constructor-super': 'error',
133
- curly: 'error',
134
- 'eol-last': 'error',
135
- eqeqeq: ['error', 'smart'],
136
- 'guard-for-in': 'off',
137
- 'id-blacklist': 'off',
138
- 'id-match': 'off',
139
- 'max-len': [
140
- 'error',
141
- {
142
- code: 130,
143
- ignoreUrls: true,
144
- ignoreRegExpLiterals: true,
145
- ignoreStrings: true,
146
- ignoreTemplateLiterals: true,
147
- ignoreComments: true
148
- }
149
- ],
150
- 'no-array-constructor': 'off',
151
- 'no-bitwise': 'error',
152
- 'no-caller': 'error',
153
- 'no-console': [
154
- 'error',
155
- {
156
- allow: [
157
- 'log',
158
- 'warn',
159
- 'dir',
160
- 'timeLog',
161
- 'assert',
162
- 'clear',
163
- 'count',
164
- 'countReset',
165
- 'group',
166
- 'groupEnd',
167
- 'table',
168
- 'info',
169
- 'dirxml',
170
- 'error',
171
- 'groupCollapsed',
172
- 'Console',
173
- 'profile',
174
- 'profileEnd',
175
- 'timeStamp',
176
- 'context'
177
- ]
178
- }
179
- ],
180
- 'no-debugger': 'error',
181
- 'no-empty': 'off',
182
- 'no-empty-function': 'off',
183
- 'no-eval': 'error',
184
- 'no-fallthrough': 'error',
185
- 'no-new-wrappers': 'error',
186
- 'no-restricted-imports': 'error',
187
- 'no-shadow': 'off',
188
- 'no-throw-literal': 'error',
189
- 'no-trailing-spaces': 'error',
190
- 'no-undef-init': 'error',
191
- 'no-underscore-dangle': 'off',
192
- 'no-unused-labels': 'error',
193
- 'no-unused-vars': 'off',
194
- 'no-var': 'error',
195
- 'prefer-const': 'off',
196
- radix: 'off',
197
- semi: [
198
- 'error',
199
- 'always',
200
- {
201
- omitLastInOneLineBlock: true
202
- }
203
- ],
204
- 'spaced-comment': [
205
- 'error',
206
- 'always',
207
- {
208
- markers: ['/']
209
- }
210
- ]
211
- }
212
- };