dyo-tools 0.4.0 → 0.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (157) hide show
  1. package/{dist/index.d.ts → index.d.ts} +1 -0
  2. package/{dist/index.d.ts.map → index.d.ts.map} +1 -1
  3. package/{dist/index.js → index.js} +1 -0
  4. package/package.json +6 -56
  5. package/.c8rc.json +0 -4
  6. package/.eslintignore +0 -2
  7. package/.eslintrc.json +0 -47
  8. package/Makefile +0 -34
  9. package/README.md +0 -0
  10. package/babel.config.js +0 -1
  11. package/docs/.nojekyll +0 -1
  12. package/docs/assets/highlight.css +0 -29
  13. package/docs/assets/main.js +0 -59
  14. package/docs/assets/search.js +0 -1
  15. package/docs/assets/style.css +0 -1414
  16. package/docs/index.html +0 -1
  17. package/integration/data/components/DTHero.ts +0 -42
  18. package/integration/data/components/DTHeroManager.ts +0 -11
  19. package/integration/data/components/DTHeroPlayZone.ts +0 -6
  20. package/integration/data/components/DTHeroPlayerHand.ts +0 -11
  21. package/integration/data/components/index.ts +0 -5
  22. package/integration/data/in/heroIn.helper.ts +0 -8
  23. package/integration/data/in/playerIn.helper.ts +0 -13
  24. package/integration/data/out/heroOut.helper.ts +0 -48
  25. package/integration/endings/synchronisation.ending.ts +0 -25
  26. package/integration/scenes/drawCard.scene.ts +0 -31
  27. package/integration/scenes/empty.scene.ts +0 -6
  28. package/integration/scenes/playCard.scene.ts +0 -23
  29. package/integration/scenes/playerLeave.scene.ts +0 -33
  30. package/integration/stages/baseDix.stage.ts +0 -137
  31. package/integration/stages/syncDix.stage.ts +0 -36
  32. package/integration/tests/scenario1.spec.ts +0 -55
  33. package/integration/types/index.ts +0 -24
  34. package/jest-integration.config.ts +0 -25
  35. package/jest.config.ts +0 -26
  36. package/src/constants.ts +0 -87
  37. package/src/core/DTAction.ts +0 -54
  38. package/src/core/DTBunch.ts +0 -531
  39. package/src/core/DTComponent.ts +0 -258
  40. package/src/core/DTComponentPhysical.ts +0 -88
  41. package/src/core/DTComponentWithMeta.ts +0 -98
  42. package/src/core/DTElement.ts +0 -111
  43. package/src/core/DTError.ts +0 -78
  44. package/src/core/DTManager.ts +0 -555
  45. package/src/core/DTMaster.ts +0 -366
  46. package/src/core/DTModule.ts +0 -96
  47. package/src/index.ts +0 -17
  48. package/src/libs/DYOFinder.ts +0 -175
  49. package/src/libs/dix/DIXModule.module.ts +0 -98
  50. package/src/libs/player/DTPlayer.element.ts +0 -9
  51. package/src/libs/player/DTPlayer.manager.ts +0 -70
  52. package/src/types/core.ts +0 -204
  53. package/src/types/index.ts +0 -2
  54. package/src/types/player.ts +0 -5
  55. package/test/core/DTAction.double.ts +0 -62
  56. package/test/core/DTAction.spec.ts +0 -68
  57. package/test/core/DTBunch.double.ts +0 -175
  58. package/test/core/DTBunch.spec.ts +0 -822
  59. package/test/core/DTComponent.double.ts +0 -179
  60. package/test/core/DTComponent.spec.ts +0 -297
  61. package/test/core/DTComponentPhysical.double.ts +0 -62
  62. package/test/core/DTComponentPhysical.spec.ts +0 -81
  63. package/test/core/DTComponentWithMeta.double.ts +0 -122
  64. package/test/core/DTComponentWithMeta.spec.ts +0 -129
  65. package/test/core/DTElement.double.ts +0 -142
  66. package/test/core/DTElement.spec.ts +0 -123
  67. package/test/core/DTError.double.ts +0 -57
  68. package/test/core/DTError.spec.ts +0 -78
  69. package/test/core/DTManager.double.ts +0 -149
  70. package/test/core/DTManager.spec.ts +0 -874
  71. package/test/core/DTMaster.double.ts +0 -117
  72. package/test/core/DTMaster.spec.ts +0 -537
  73. package/test/core/DTModule.double.ts +0 -67
  74. package/test/core/DTModule.spec.ts +0 -124
  75. package/test/core/copy.spec.ts +0 -222
  76. package/test/libs/DYOFinder.double.ts +0 -152
  77. package/test/libs/DYOFinder.spec.ts +0 -194
  78. package/test/libs/player/DTPlayer.element.double.ts +0 -55
  79. package/test/libs/player/DTPlayer.element.spec.ts +0 -28
  80. package/test/libs/player/DTPlayer.manager.double.ts +0 -92
  81. package/test/libs/player/DTPlayer.manager.spec.ts +0 -178
  82. package/tsconfig.dev.json +0 -19
  83. package/tsconfig.json +0 -18
  84. /package/{dist/constants.d.ts → constants.d.ts} +0 -0
  85. /package/{dist/constants.d.ts.map → constants.d.ts.map} +0 -0
  86. /package/{dist/constants.js → constants.js} +0 -0
  87. /package/{dist/constants.js.map → constants.js.map} +0 -0
  88. /package/{dist/core → core}/DTAction.d.ts +0 -0
  89. /package/{dist/core → core}/DTAction.d.ts.map +0 -0
  90. /package/{dist/core → core}/DTAction.js +0 -0
  91. /package/{dist/core → core}/DTAction.js.map +0 -0
  92. /package/{dist/core → core}/DTBunch.d.ts +0 -0
  93. /package/{dist/core → core}/DTBunch.d.ts.map +0 -0
  94. /package/{dist/core → core}/DTBunch.js +0 -0
  95. /package/{dist/core → core}/DTBunch.js.map +0 -0
  96. /package/{dist/core → core}/DTComponent.d.ts +0 -0
  97. /package/{dist/core → core}/DTComponent.d.ts.map +0 -0
  98. /package/{dist/core → core}/DTComponent.js +0 -0
  99. /package/{dist/core → core}/DTComponent.js.map +0 -0
  100. /package/{dist/core → core}/DTComponentPhysical.d.ts +0 -0
  101. /package/{dist/core → core}/DTComponentPhysical.d.ts.map +0 -0
  102. /package/{dist/core → core}/DTComponentPhysical.js +0 -0
  103. /package/{dist/core → core}/DTComponentPhysical.js.map +0 -0
  104. /package/{dist/core → core}/DTComponentWithMeta.d.ts +0 -0
  105. /package/{dist/core → core}/DTComponentWithMeta.d.ts.map +0 -0
  106. /package/{dist/core → core}/DTComponentWithMeta.js +0 -0
  107. /package/{dist/core → core}/DTComponentWithMeta.js.map +0 -0
  108. /package/{dist/core → core}/DTElement.d.ts +0 -0
  109. /package/{dist/core → core}/DTElement.d.ts.map +0 -0
  110. /package/{dist/core → core}/DTElement.js +0 -0
  111. /package/{dist/core → core}/DTElement.js.map +0 -0
  112. /package/{dist/core → core}/DTError.d.ts +0 -0
  113. /package/{dist/core → core}/DTError.d.ts.map +0 -0
  114. /package/{dist/core → core}/DTError.js +0 -0
  115. /package/{dist/core → core}/DTError.js.map +0 -0
  116. /package/{dist/core → core}/DTManager.d.ts +0 -0
  117. /package/{dist/core → core}/DTManager.d.ts.map +0 -0
  118. /package/{dist/core → core}/DTManager.js +0 -0
  119. /package/{dist/core → core}/DTManager.js.map +0 -0
  120. /package/{dist/core → core}/DTMaster.d.ts +0 -0
  121. /package/{dist/core → core}/DTMaster.d.ts.map +0 -0
  122. /package/{dist/core → core}/DTMaster.js +0 -0
  123. /package/{dist/core → core}/DTMaster.js.map +0 -0
  124. /package/{dist/core → core}/DTModule.d.ts +0 -0
  125. /package/{dist/core → core}/DTModule.d.ts.map +0 -0
  126. /package/{dist/core → core}/DTModule.js +0 -0
  127. /package/{dist/core → core}/DTModule.js.map +0 -0
  128. /package/{dist/index.js.map → index.js.map} +0 -0
  129. /package/{dist/libs → libs}/DYOFinder.d.ts +0 -0
  130. /package/{dist/libs → libs}/DYOFinder.d.ts.map +0 -0
  131. /package/{dist/libs → libs}/DYOFinder.js +0 -0
  132. /package/{dist/libs → libs}/DYOFinder.js.map +0 -0
  133. /package/{dist/libs → libs}/dix/DIXModule.module.d.ts +0 -0
  134. /package/{dist/libs → libs}/dix/DIXModule.module.d.ts.map +0 -0
  135. /package/{dist/libs → libs}/dix/DIXModule.module.js +0 -0
  136. /package/{dist/libs → libs}/player/DTPlayer.element.d.ts +0 -0
  137. /package/{dist/libs → libs}/player/DTPlayer.element.d.ts.map +0 -0
  138. /package/{dist/libs → libs}/player/DTPlayer.element.js +0 -0
  139. /package/{dist/libs → libs}/player/DTPlayer.element.js.map +0 -0
  140. /package/{dist/libs → libs}/player/DTPlayer.manager.d.ts +0 -0
  141. /package/{dist/libs → libs}/player/DTPlayer.manager.d.ts.map +0 -0
  142. /package/{dist/libs → libs}/player/DTPlayer.manager.js +0 -0
  143. /package/{dist/libs → libs}/player/DTPlayer.manager.js.map +0 -0
  144. /package/{dist/tsconfig.dev.tsbuildinfo → tsconfig.dev.tsbuildinfo} +0 -0
  145. /package/{dist/tsconfig.tsbuildinfo → tsconfig.tsbuildinfo} +0 -0
  146. /package/{dist/types → types}/core.d.ts +0 -0
  147. /package/{dist/types → types}/core.d.ts.map +0 -0
  148. /package/{dist/types → types}/core.js +0 -0
  149. /package/{dist/types → types}/core.js.map +0 -0
  150. /package/{dist/types → types}/index.d.ts +0 -0
  151. /package/{dist/types → types}/index.d.ts.map +0 -0
  152. /package/{dist/types → types}/index.js +0 -0
  153. /package/{dist/types → types}/index.js.map +0 -0
  154. /package/{dist/types → types}/player.d.ts +0 -0
  155. /package/{dist/types → types}/player.d.ts.map +0 -0
  156. /package/{dist/types → types}/player.js +0 -0
  157. /package/{dist/types → types}/player.js.map +0 -0
@@ -1,149 +0,0 @@
1
- import {expect} from '@jest/globals';
2
- import {DTBunch, DTManager} from '../../src';
3
- import {
4
- bunch1toObjectTest,
5
- DTBunchStub,
6
- DTBunchStubLibrary,
7
- generateStubElements,
8
- IDTest as IDTestBunch,
9
- } from './DTBunch.double';
10
- import {DTManagerItemsType, DTManagerItemType, DTManagerOptions, DTManagerToObject} from '../../src/types';
11
- import {DTElementStub,} from "./DTElement.double";
12
- import {managerDefaultOptions} from "../../src/constants";
13
-
14
- /** ****************** STUB PROPERTIES CONSTANTS
15
- * Fixed properties to use with double classes, avoid auto generated and easy checking on test
16
- * **** */
17
- export const IDTest = 'DTManager-id-1234567';
18
- export const KeyTest = 'DTManager-key-1234567';
19
- export const DomainTest = 'DTManager-domain-test';
20
- export const ScopesTest = ['DTManager-scope-test1', 'DTManager-scope-test2'];
21
-
22
- // Specific Manager constants
23
- export const manager1IDTest = `${IDTest}_1`;
24
- export const manager1KeyTest = `${KeyTest}_1`;
25
-
26
- export const manager1ToObject: DTManagerToObject = {
27
- id: manager1IDTest,
28
- key: manager1KeyTest,
29
- type: 'manager',
30
- items: [
31
- {
32
- scope: 'default',
33
- ...bunch1toObjectTest
34
- }
35
- ]
36
- }
37
-
38
- /** ****************** HELPER TEST CLASS
39
- * Helper test class, inherits the main component
40
- * Providing methods to property access and other facilities, in order to avoid using class methods
41
- * **** */
42
- export class DTManagerTest extends DTManager<DTElementStub> {
43
- constructor(
44
- id: string = IDTest,
45
- key: string | undefined = undefined,
46
- elements: DTElementStub[] = [],
47
- scopes: string[] = [],
48
- options: Partial<DTManagerOptions> = managerDefaultOptions,
49
- stubLibrary: boolean = true,
50
- ) {
51
- super(key, elements, scopes, options);
52
- this._id = id;
53
- if (stubLibrary) {
54
- this._library = new DTBunchStubLibrary(elements);
55
- }
56
- }
57
-
58
- _getItems(): DTManagerItemsType<DTElementStub> {
59
- return this._items;
60
- }
61
-
62
- _getItem(id: string): DTManagerItemType<DTElementStub> | undefined {
63
- return this._items[id];
64
- }
65
-
66
- _getFinder() {
67
- return this._finder;
68
- }
69
-
70
- populate() {
71
- const stubElements = generateStubElements(5);
72
-
73
- // Library
74
- this._library = new DTBunchStubLibrary(stubElements);
75
- this._library.setContext<DTManagerTest>(this);
76
-
77
- // Bunches
78
- const bunch1 = new DTBunchStub();
79
- bunch1._setId(`${IDTestBunch}_1`);
80
- bunch1.setContext<DTManagerTest>(this);
81
- const bunch2 = new DTBunchStub();
82
- bunch2._setId(`${IDTestBunch}_2`);
83
- bunch2.setContext<DTManagerTest>(this);
84
- const bunch3 = new DTBunchStub([], { virtualContainer: true });
85
- bunch3._setId(`${IDTestBunch}_3`);
86
- bunch3.setContext<DTManagerTest>(this);
87
- this._items = {
88
- [bunch1.getId()]: {
89
- scope: 'default',
90
- item: bunch1 as DTBunch<DTElementStub>,
91
- },
92
- [bunch2.getId()]: {
93
- scope: ScopesTest[0],
94
- item: bunch2 as DTBunch<DTElementStub>,
95
- },
96
- [bunch3.getId()]: {
97
- scope: 'virtual',
98
- item: bunch3 as DTBunch<DTElementStub>,
99
- },
100
- };
101
-
102
- // Add items in Bunch
103
- bunch1.addMany(stubElements);
104
- }
105
- }
106
-
107
- export class DTManagerTestDomain extends DTManagerTest {
108
- protected _domain = DomainTest;
109
-
110
- constructor(
111
- id: string = IDTest,
112
- key: string | undefined = undefined,
113
- ) {
114
- super(id, key);
115
- }
116
- }
117
-
118
- /** ****************** STUB CLASS
119
- * Stub class, for using in other component
120
- * **** */
121
- export class DTManagerStub extends DTManager<DTElementStub> {
122
- constructor() {
123
- super();
124
- this._id = IDTest;
125
- this._key = KeyTest;
126
- this._errors = [];
127
- this._library = new DTBunchStubLibrary();
128
- this._scopes = [
129
- 'default',
130
- 'virtual',
131
- ...ScopesTest,
132
- ];
133
- }
134
-
135
- _setId(id: string) {
136
- this._id = id;
137
- }
138
-
139
- _setKey(key: string) {
140
- this._key = key;
141
- }
142
- }
143
-
144
- export const checkManagerItem = (managerTest: DTManagerTest, bunchId: string, scope: string): void => {
145
- expect(managerTest._getItem(bunchId)).toBeDefined();
146
- expect(Object.keys(managerTest._getItem(bunchId))).toStrictEqual(['scope', 'item']);
147
- expect(managerTest._getItem(bunchId)?.scope).toBe(scope);
148
- expect(managerTest._getItem(bunchId)?.item?.getId()).toBe(bunchId);
149
- };