@adaas/a-concept 0.2.14 → 0.3.2

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 (144) hide show
  1. package/.conf/tsconfig.base.json +91 -0
  2. package/.conf/tsconfig.browser.json +36 -0
  3. package/.conf/tsconfig.node.json +40 -0
  4. package/dist/browser/index.d.mts +4188 -212
  5. package/dist/browser/index.mjs +2 -67
  6. package/dist/browser/index.mjs.map +1 -1
  7. package/dist/node/index.cjs +5810 -383
  8. package/dist/node/index.cjs.map +1 -1
  9. package/dist/node/index.d.mts +4215 -212
  10. package/dist/node/index.d.ts +4215 -212
  11. package/dist/node/index.mjs +5751 -66
  12. package/dist/node/index.mjs.map +1 -1
  13. package/jest.config.ts +30 -15
  14. package/package.json +19 -16
  15. package/src/env/env-browser.ts +38 -1
  16. package/src/env/env-node.ts +26 -2
  17. package/src/env/env.base.ts +21 -2
  18. package/src/env/global.browser.d.ts +1 -1
  19. package/src/helpers/A_BasicTypeGuards.helper.ts +81 -0
  20. package/src/helpers/A_Common.helper.ts +2 -2
  21. package/src/helpers/A_Identity.helper.ts +2 -4
  22. package/src/helpers/A_TypeGuards.helper.ts +45 -30
  23. package/src/helpers/index.ts +5 -0
  24. package/src/index.ts +21 -94
  25. package/src/{global → lib}/A-Abstraction/A-Abstraction-Extend.decorator.ts +18 -13
  26. package/src/{global → lib}/A-Abstraction/A-Abstraction.class.ts +5 -5
  27. package/src/{global → lib}/A-Abstraction/A-Abstraction.error.ts +1 -1
  28. package/src/{global → lib}/A-Abstraction/A-Abstraction.types.ts +5 -5
  29. package/src/lib/A-Abstraction/index.ts +8 -0
  30. package/src/{global → lib}/A-Caller/A_Caller.class.ts +3 -4
  31. package/src/{global → lib}/A-Caller/A_Caller.error.ts +1 -4
  32. package/src/{global → lib}/A-Caller/A_Caller.types.ts +4 -4
  33. package/src/lib/A-Caller/index.ts +3 -0
  34. package/src/{global → lib}/A-Component/A-Component.class.ts +2 -3
  35. package/src/{global → lib}/A-Component/A-Component.meta.ts +5 -5
  36. package/src/{global → lib}/A-Component/A-Component.types.ts +5 -5
  37. package/src/lib/A-Component/index.ts +5 -0
  38. package/src/{global → lib}/A-Concept/A-Concept.class.ts +9 -7
  39. package/src/{global → lib}/A-Concept/A-Concept.meta.ts +2 -2
  40. package/src/{global → lib}/A-Concept/A-Concept.types.ts +7 -7
  41. package/src/lib/A-Concept/index.ts +4 -0
  42. package/src/{global → lib}/A-Container/A-Container.class.ts +3 -3
  43. package/src/{global → lib}/A-Container/A-Container.meta.ts +11 -6
  44. package/src/{global → lib}/A-Container/A-Container.types.ts +9 -6
  45. package/src/lib/A-Container/index.ts +5 -0
  46. package/src/{global → lib}/A-Context/A-Context.class.ts +53 -42
  47. package/src/{global → lib}/A-Context/A-Context.error.ts +1 -1
  48. package/src/lib/A-Context/A-Context.types.ts +14 -0
  49. package/src/lib/A-Context/index.ts +5 -0
  50. package/src/{global → lib}/A-Dependency/A-Dependency-All.decorator.ts +11 -11
  51. package/src/{global → lib}/A-Dependency/A-Dependency-Default.decorator.ts +11 -9
  52. package/src/{global → lib}/A-Dependency/A-Dependency-Flat.decorator.ts +11 -8
  53. package/src/{global → lib}/A-Dependency/A-Dependency-Load.decorator.ts +11 -9
  54. package/src/{global → lib}/A-Dependency/A-Dependency-Parent.decorator.ts +11 -9
  55. package/src/lib/A-Dependency/A-Dependency-Query.decorator.ts +90 -0
  56. package/src/{global → lib}/A-Dependency/A-Dependency-Require.decorator.ts +11 -9
  57. package/src/{global → lib}/A-Dependency/A-Dependency.class.ts +20 -3
  58. package/src/{global → lib}/A-Dependency/A-Dependency.error.ts +1 -1
  59. package/src/{global → lib}/A-Dependency/A-Dependency.types.ts +20 -9
  60. package/src/lib/A-Dependency/index.ts +18 -0
  61. package/src/{global → lib}/A-Entity/A-Entity.class.ts +11 -9
  62. package/src/{global → lib}/A-Entity/A-Entity.error.ts +1 -1
  63. package/src/{global → lib}/A-Entity/A-Entity.meta.ts +3 -3
  64. package/src/{global → lib}/A-Entity/A-Entity.types.ts +5 -5
  65. package/src/lib/A-Entity/index.ts +5 -0
  66. package/src/{global → lib}/A-Error/A_Error.class.ts +13 -13
  67. package/src/{global → lib}/A-Error/A_Error.types.ts +2 -2
  68. package/src/lib/A-Error/index.ts +3 -0
  69. package/src/{global → lib}/A-Feature/A-Feature-Define.decorator.ts +16 -10
  70. package/src/{global → lib}/A-Feature/A-Feature-Extend.decorator.ts +13 -9
  71. package/src/{global → lib}/A-Feature/A-Feature.class.ts +15 -13
  72. package/src/{global → lib}/A-Feature/A-Feature.error.ts +2 -2
  73. package/src/{global → lib}/A-Feature/A-Feature.types.ts +21 -12
  74. package/src/lib/A-Feature/index.ts +13 -0
  75. package/src/{global → lib}/A-Fragment/A-Fragment.class.ts +0 -2
  76. package/src/{global → lib}/A-Fragment/A-Fragment.types.ts +1 -1
  77. package/src/lib/A-Fragment/index.ts +5 -0
  78. package/src/{global → lib}/A-Inject/A-Inject.decorator.ts +42 -24
  79. package/src/{global → lib}/A-Inject/A-Inject.error.ts +1 -1
  80. package/src/{global → lib}/A-Inject/A-Inject.types.ts +3 -9
  81. package/src/lib/A-Inject/index.ts +3 -0
  82. package/src/{global → lib}/A-Meta/A-Meta.decorator.ts +2 -2
  83. package/src/{global → lib}/A-Meta/A-Meta.types.ts +18 -10
  84. package/src/lib/A-Meta/index.ts +11 -0
  85. package/src/{global → lib}/A-Scope/A-Scope.class.ts +37 -25
  86. package/src/{global → lib}/A-Scope/A-Scope.error.ts +1 -1
  87. package/src/{global → lib}/A-Scope/A-Scope.types.ts +23 -15
  88. package/src/lib/A-Scope/index.ts +5 -0
  89. package/src/{global → lib}/A-Stage/A-Stage.class.ts +9 -10
  90. package/src/{global → lib}/A-Stage/A-Stage.error.ts +1 -1
  91. package/src/{global → lib}/A-Stage/A-Stage.types.ts +1 -4
  92. package/src/lib/A-Stage/index.ts +5 -0
  93. package/src/{global → lib}/A-StepManager/A-StepManager.class.ts +8 -4
  94. package/src/{global → lib}/A-StepManager/A-StepManager.error.ts +1 -1
  95. package/src/lib/A-StepManager/index.ts +4 -0
  96. package/src/{global → lib}/ASEID/ASEID.class.ts +20 -23
  97. package/src/lib/ASEID/ASEID.error.ts +12 -0
  98. package/src/lib/ASEID/index.ts +4 -0
  99. package/src/types/A_identity.types.ts +4 -0
  100. package/src/types/index.ts +2 -0
  101. package/tests/A-Abstraction.test.ts +6 -6
  102. package/tests/A-Common.test.ts +6 -4
  103. package/tests/A-Component.test.ts +7 -5
  104. package/tests/A-Concept.test.ts +13 -11
  105. package/tests/A-Container.test.ts +4 -3
  106. package/tests/A-Dependency.test.ts +73 -1
  107. package/tests/A-Entity.test.ts +108 -5
  108. package/tests/A-Error.test.ts +7 -4
  109. package/tests/A-Feature.test.ts +12 -8
  110. package/tests/A-Fragment.test.ts +1 -2
  111. package/tests/A-Inject.test.ts +4 -1
  112. package/tests/A-Meta.test.ts +12 -10
  113. package/tests/A-Scope.test.ts +11 -10
  114. package/tests/A-StepManager.test.ts +3 -3
  115. package/tests/ASEID.test.ts +2 -2
  116. package/tests/jest.setup.ts +23 -23
  117. package/tsconfig.json +59 -97
  118. package/tsup.config.ts +18 -13
  119. package/dist/browser/A-Context.types-BtR_HJ0j.d.mts +0 -3828
  120. package/dist/browser/env.d.mts +0 -64
  121. package/dist/browser/env.mjs +0 -3
  122. package/dist/browser/env.mjs.map +0 -1
  123. package/dist/node/A-Context.types-BtR_HJ0j.d.mts +0 -3828
  124. package/dist/node/A-Context.types-BtR_HJ0j.d.ts +0 -3828
  125. package/dist/node/env.cjs +0 -12
  126. package/dist/node/env.cjs.map +0 -1
  127. package/dist/node/env.d.mts +0 -91
  128. package/dist/node/env.d.ts +0 -91
  129. package/dist/node/env.js +0 -12
  130. package/dist/node/env.js.map +0 -1
  131. package/dist/node/env.mjs +0 -3
  132. package/dist/node/env.mjs.map +0 -1
  133. package/dist/node/index.js +0 -387
  134. package/dist/node/index.js.map +0 -1
  135. package/src/global/A-Context/A-Context.types.ts +0 -14
  136. package/src/global/ASEID/ASEID.error.ts +0 -12
  137. /package/src/{global → lib}/A-Component/A-Component.constants.ts +0 -0
  138. /package/src/{global → lib}/A-Concept/A-Concept.constants.ts +0 -0
  139. /package/src/{global → lib}/A-Container/A-Container.constants.ts +0 -0
  140. /package/src/{global → lib}/A-Entity/A-Entity.constants.ts +0 -0
  141. /package/src/{global → lib}/A-Error/A_Error.constants.ts +0 -0
  142. /package/src/{global → lib}/A-Meta/A-Meta.class.ts +0 -0
  143. /package/src/{global → lib}/ASEID/ASEID.constants.ts +0 -0
  144. /package/src/{global → lib}/ASEID/ASEID.types.ts +0 -0
@@ -1,6 +1,7 @@
1
- import { A_Container } from '@adaas/a-concept/global/A-Container/A-Container.class';
2
- import { A_Scope } from '@adaas/a-concept/global/A-Scope/A-Scope.class';
3
- import { A_Concept, A_Feature } from '../src';
1
+ import { A_Concept } from '@adaas/a-concept/a-concept';
2
+ import { A_Container } from '@adaas/a-concept/a-container';
3
+ import { A_Feature } from '@adaas/a-concept/a-feature';
4
+ import { A_Scope } from '@adaas/a-concept/a-scope';
4
5
 
5
6
 
6
7
  describe('A-Container tests', () => {
@@ -1,4 +1,9 @@
1
- import { A_Component, A_Dependency, A_Entity, A_Error, A_Feature, A_FeatureError, A_Inject, A_Scope, A_ScopeError } from "../src";
1
+ import { A_Component } from "@adaas/a-concept/a-component";
2
+ import { A_Dependency } from "@adaas/a-concept/a-dependency";
3
+ import { A_Entity } from "@adaas/a-concept/a-entity";
4
+ import { A_Feature, A_FeatureError } from "@adaas/a-concept/a-feature";
5
+ import { A_Inject } from "@adaas/a-concept/a-inject";
6
+ import { A_Scope, A_ScopeError } from "@adaas/a-concept/a-scope";
2
7
 
3
8
 
4
9
 
@@ -450,4 +455,71 @@ describe('A-Dependency tests', () => {
450
455
 
451
456
  });
452
457
 
458
+ it('Should be possible to use query decorator for A_Entities in scope', async () => {
459
+
460
+ class MyEntity_A extends A_Entity<{ name: string, group: string }> {
461
+ name!: string;
462
+ group!: string;
463
+
464
+ fromNew(newEntity: { name: string; group: string }): void {
465
+ super.fromNew(newEntity);
466
+ this.name = newEntity.name;
467
+ this.group = newEntity.group;
468
+ }
469
+ }
470
+
471
+ class MyComponent extends A_Component {
472
+ @A_Feature.Extend()
473
+ async simpleQuery(
474
+ @A_Dependency.Query<MyEntity_A>({ name: 'Entity 1' })
475
+ @A_Inject(MyEntity_A) entity: MyEntity_A,
476
+ ) {
477
+ expect(entity.name).toBe('Entity 1');
478
+ }
479
+
480
+ @A_Feature.Extend()
481
+ async andQuery(
482
+ @A_Dependency.Query<MyEntity_A>({ name: 'Entity 1', group: 'Group 1' })
483
+ @A_Inject(MyEntity_A) entity: MyEntity_A,
484
+ ) {
485
+ expect(entity.name).toBe('Entity 1');
486
+ expect(entity.group).toBe('Group 1');
487
+ }
488
+
489
+ @A_Feature.Extend()
490
+ async paginationQuery(
491
+ @A_Dependency.Query<MyEntity_A>({ name: 'Entity 1' }, { count: 2 })
492
+ @A_Inject(MyEntity_A) entities: MyEntity_A[],
493
+ ) {
494
+
495
+ expect(entities.length).toBe(2);
496
+ expect(entities[0].name).toBe('Entity 1');
497
+ expect(entities[0].group).toBe('Group 1');
498
+ expect(entities[1].name).toBe('Entity 1');
499
+ expect(entities[1].group).toBe('Group 2');
500
+ }
501
+ }
502
+
503
+ const scope = new A_Scope({
504
+ name: 'Test Scope',
505
+ components: [MyComponent],
506
+ entities: [
507
+ new MyEntity_A({ name: 'Entity 1', group: 'Group 1' }),
508
+ new MyEntity_A({ name: 'Entity 2', group: 'Group 1' }),
509
+ new MyEntity_A({ name: 'Entity 1', group: 'Group 2' }),
510
+ new MyEntity_A({ name: 'Entity 2', group: 'Group 2' }),
511
+ new MyEntity_A({ name: 'Entity 3', group: 'Group 2' }),
512
+ new MyEntity_A({ name: 'Entity 1', group: 'Group 3' }),
513
+ new MyEntity_A({ name: 'Entity 2', group: 'Group 3' }),
514
+ ]
515
+ });
516
+
517
+ const componentInstance = scope.resolve(MyComponent);
518
+
519
+ await componentInstance?.call('simpleQuery');
520
+ await componentInstance?.call('andQuery');
521
+ await componentInstance?.call('paginationQuery');
522
+
523
+ });
524
+
453
525
  });
@@ -1,9 +1,12 @@
1
1
  import { A_CONSTANTS__DEFAULT_ENV_VARIABLES } from "@adaas/a-concept/constants/env.constants";
2
- import { A_Context } from "@adaas/a-concept/global/A-Context/A-Context.class";
3
- import { A_Entity } from "@adaas/a-concept/global/A-Entity/A-Entity.class";
4
- import { A_TYPES__Entity_Serialized } from '@adaas/a-concept/global/A-Entity/A-Entity.types';
5
- import { A_Feature } from "@adaas/a-concept/global/A-Feature/A-Feature.class";
6
- import { ASEID } from '@adaas/a-concept/global/ASEID/ASEID.class';
2
+ import { A_Context } from "@adaas/a-concept/a-context";
3
+ import {
4
+ A_Entity,
5
+ A_TYPES__Entity_Serialized
6
+ } from "@adaas/a-concept/a-entity";
7
+ import { A_Feature } from "@adaas/a-concept/a-feature";
8
+ import { ASEID } from '@adaas/a-concept/aseid';
9
+ import { A_Scope } from "@adaas/a-concept/a-scope";
7
10
 
8
11
  jest.retryTimes(0);
9
12
 
@@ -19,6 +22,106 @@ describe('A-Entity tests', () => {
19
22
  expect(entity.aseid.concept).toBe('a-concept');
20
23
 
21
24
  });
25
+ it('Should handle proper types declaration', async () => {
26
+ type MyInitType = {
27
+ name: string;
28
+ customId: number;
29
+ }
30
+
31
+ type mySerializedType = {
32
+ name: string;
33
+ serializedFlag: boolean;
34
+ customId: number;
35
+ } & A_TYPES__Entity_Serialized;
36
+
37
+ class MyEntity extends A_Entity<MyInitType, mySerializedType> {
38
+ public name!: string;
39
+ public customId!: number;
40
+
41
+ fromNew(newEntity: MyInitType): void {
42
+ super.fromNew(newEntity);
43
+ this.name = newEntity.name;
44
+ this.customId = newEntity.customId;
45
+ }
46
+
47
+ fromJSON(serialized: mySerializedType): void {
48
+ this.aseid = new ASEID(serialized.aseid);
49
+ this.name = serialized.name;
50
+ this.customId = serialized.customId;
51
+ return;
52
+ }
53
+
54
+
55
+ toJSON(): mySerializedType {
56
+ return {
57
+ ...super.toJSON(),
58
+ name: this.name,
59
+ customId: this.customId,
60
+ serializedFlag: true,
61
+ };
62
+ }
63
+ }
64
+
65
+
66
+ const entityInstance = new MyEntity({
67
+ name: 'Test Entity',
68
+ customId: 42,
69
+ });
70
+
71
+ expect(entityInstance.name).toBe('Test Entity');
72
+ expect(entityInstance.customId).toBe(42);
73
+
74
+ const serialized = entityInstance.toJSON();
75
+ expect(serialized.name).toBe('Test Entity');
76
+ expect(serialized.customId).toBe(42);
77
+ expect(serialized.serializedFlag).toBe(true);
78
+
79
+ const deserializedEntity = new MyEntity(serialized);
80
+ expect(deserializedEntity.name).toBe('Test Entity');
81
+ expect(deserializedEntity.customId).toBe(42);
82
+ expect(deserializedEntity.aseid.toString()).toBe(entityInstance.aseid.toString());
83
+ });
84
+ it('Should be possible to allocate a scope for entity', async () => {
85
+
86
+ let resultScope: A_Scope | undefined = undefined;
87
+
88
+
89
+ class MyEntity extends A_Entity {
90
+
91
+ scope!: A_Scope;
92
+
93
+ fromNew(newEntity: any): void {
94
+ super.fromNew(newEntity);
95
+
96
+ resultScope = new A_Scope({ name: 'entity-scope' });
97
+
98
+ this.scope = A_Context.allocate(this, resultScope);
99
+ }
100
+
101
+ fromUndefined(): void {
102
+ super.fromUndefined();
103
+
104
+ resultScope = new A_Scope({ name: 'entity-scope' });
105
+
106
+ this.scope = A_Context.allocate(this, resultScope);
107
+ }
108
+
109
+ }
110
+
111
+
112
+ const entityInstance = new MyEntity();
113
+
114
+
115
+ const ParentScope = new A_Scope({
116
+ name: 'parent-scope',
117
+ entities: [entityInstance]
118
+ });
119
+
120
+ expect(resultScope).toBeInstanceOf(A_Scope);
121
+ expect(entityInstance.scope).toBe(resultScope);
122
+ expect(resultScope!.issuer()).toBe(entityInstance);
123
+ expect(A_Context.scope(entityInstance)).toBe(ParentScope);
124
+ });
22
125
  it('Should Allow to create an entity with overridden ASEID Scope or Concept', async () => {
23
126
  class MyEntity extends A_Entity {
24
127
  static get entity(): string {
@@ -1,8 +1,11 @@
1
1
  import { A_CONSTANTS__DEFAULT_ENV_VARIABLES } from "@adaas/a-concept/constants/env.constants";
2
- import { A_Context } from "@adaas/a-concept/global/A-Context/A-Context.class";
3
- import { A_Error } from "@adaas/a-concept/global/A-Error/A_Error.class";
4
- import { A_CONSTANTS__ERROR_CODES, A_CONSTANTS__ERROR_DESCRIPTION } from "@adaas/a-concept/global/A-Error/A_Error.constants";
5
- import { A_FormatterHelper } from "@adaas/a-concept/helpers/A_Formatter.helper";
2
+ import { A_Context } from "@adaas/a-concept/a-context";
3
+ import {
4
+ A_Error,
5
+ A_CONSTANTS__ERROR_CODES,
6
+ A_CONSTANTS__ERROR_DESCRIPTION
7
+ } from "@adaas/a-concept/a-error";
8
+ import { A_FormatterHelper} from "@adaas/a-concept/helpers/A_Formatter.helper";
6
9
 
7
10
  jest.retryTimes(0);
8
11
 
@@ -1,11 +1,15 @@
1
- import { A_Inject } from "@adaas/a-concept/global/A-Inject/A-Inject.decorator";
2
- import { A_Component } from "@adaas/a-concept/global/A-Component/A-Component.class";
3
- import { A_Feature } from "@adaas/a-concept/global/A-Feature/A-Feature.class";
4
- import { A_Scope } from "@adaas/a-concept/global/A-Scope/A-Scope.class";
5
- import { A_Caller } from '@adaas/a-concept/global/A-Caller/A_Caller.class';
6
- import { A_Context } from '@adaas/a-concept/global/A-Context/A-Context.class';
7
- import { A_TYPES__ComponentMetaKey } from '@adaas/a-concept/global/A-Component/A-Component.constants';
8
- import { A_Dependency, A_Entity, A_Error, A_TYPES__FeatureState } from "../src";
1
+ import { A_Inject } from "@adaas/a-concept/a-inject";
2
+ import {
3
+ A_Component,
4
+ A_TYPES__ComponentMetaKey
5
+ } from "@adaas/a-concept/a-component";
6
+ import { A_Feature, A_TYPES__FeatureState } from "@adaas/a-concept/a-feature";
7
+ import { A_Scope } from "@adaas/a-concept/a-scope";
8
+ import { A_Caller } from '@adaas/a-concept/a-caller';
9
+ import { A_Context } from '@adaas/a-concept/a-context';
10
+ import { A_Dependency } from "@adaas/a-concept/a-dependency";
11
+ import { A_Error } from "@adaas/a-concept/a-error";
12
+ import { A_Entity } from "@adaas/a-concept/a-entity";
9
13
 
10
14
  jest.retryTimes(0);
11
15
 
@@ -1,5 +1,4 @@
1
- import { A_Fragment } from "@adaas/a-concept/global/A-Fragment/A-Fragment.class";
2
- import { A_Scope } from "../src";
1
+ import { A_Fragment } from "@adaas/a-concept/a-fragment";
3
2
 
4
3
  jest.retryTimes(0);
5
4
 
@@ -1,4 +1,7 @@
1
- import { A_Component, A_Error, A_Inject, A_Scope } from "../src";
1
+ import { A_Component } from "@adaas/a-concept/a-component";
2
+ import { A_Error } from "@adaas/a-concept/a-error";
3
+ import { A_Inject } from "@adaas/a-concept/a-inject";
4
+ import { A_Scope } from "@adaas/a-concept/a-scope";
2
5
 
3
6
  jest.retryTimes(0);
4
7
 
@@ -1,12 +1,14 @@
1
- import { A_Component } from "@adaas/a-concept/global/A-Component/A-Component.class";
2
- import { A_TYPES__ComponentMetaKey } from "@adaas/a-concept/global/A-Component/A-Component.constants";
3
- import { A_ComponentMeta } from "@adaas/a-concept/global/A-Component/A-Component.meta";
4
- import { A_Concept } from "@adaas/a-concept/global/A-Concept/A-Concept.class";
5
- import { A_Context } from "@adaas/a-concept/global/A-Context/A-Context.class";
6
- import { A_Feature } from "@adaas/a-concept/global/A-Feature/A-Feature.class";
7
- import { A_Meta } from "@adaas/a-concept/global/A-Meta/A-Meta.class";
8
- import { A_Inject } from "@adaas/a-concept/global/A-Inject/A-Inject.decorator";
9
- import { A_TYPES__ComponentMeta } from "@adaas/a-concept/global/A-Component/A-Component.types";
1
+ import {
2
+ A_Component,
3
+ A_ComponentMeta,
4
+ A_TYPES__ComponentMeta,
5
+ A_TYPES__ComponentMetaKey
6
+ } from "@adaas/a-concept/a-component";
7
+ import { A_Concept } from "@adaas/a-concept/a-concept";
8
+ import { A_Context } from "@adaas/a-concept/a-context";
9
+ import { A_Feature } from "@adaas/a-concept/a-feature";
10
+ import { A_Meta } from "@adaas/a-concept/a-meta";
11
+ import { A_Inject } from "@adaas/a-concept/a-inject";
10
12
 
11
13
  jest.retryTimes(0);
12
14
 
@@ -144,7 +146,7 @@ describe('A-Meta tests', () => {
144
146
  @A_Meta.Define(CustomComponentMeta)
145
147
  class CustomComponent extends A_Component {
146
148
 
147
- static Test(){
149
+ static Test() {
148
150
 
149
151
  }
150
152
 
@@ -1,13 +1,14 @@
1
- import { A_Component } from "@adaas/a-concept/global/A-Component/A-Component.class";
2
- import { A_Concept } from '@adaas/a-concept/global/A-Concept/A-Concept.class';
3
- import { A_Container } from '@adaas/a-concept/global/A-Container/A-Container.class';
4
- import { A_Context } from '@adaas/a-concept/global/A-Context/A-Context.class';
5
- import { A_Entity } from "@adaas/a-concept/global/A-Entity/A-Entity.class";
6
- import { A_Feature } from '@adaas/a-concept/global/A-Feature/A-Feature.class';
7
- import { A_Fragment } from '@adaas/a-concept/global/A-Fragment/A-Fragment.class';
8
- import { A_Scope } from "@adaas/a-concept/global/A-Scope/A-Scope.class";
9
- import { ASEID } from '@adaas/a-concept/global/ASEID/ASEID.class';
10
- import { A_Dependency, A_Error } from '../src';
1
+ import { A_Component } from "@adaas/a-concept/a-component";
2
+ import { A_Concept } from '@adaas/a-concept/a-concept';
3
+ import { A_Container } from '@adaas/a-concept/a-container';
4
+ import { A_Context } from '@adaas/a-concept/a-context';
5
+ import { A_Entity } from "@adaas/a-concept/a-entity";
6
+ import { A_Feature } from '@adaas/a-concept/a-feature';
7
+ import { A_Fragment } from '@adaas/a-concept/a-fragment'
8
+ import { A_Scope } from "@adaas/a-concept/a-scope";
9
+ import { ASEID } from '@adaas/a-concept/aseid';
10
+ import { A_Dependency } from "@adaas/a-concept/a-dependency";
11
+ import { A_Error } from "@adaas/a-concept/a-error";
11
12
 
12
13
  jest.retryTimes(0);
13
14
 
@@ -1,6 +1,6 @@
1
- import { A_Component } from "@adaas/a-concept/global/A-Component/A-Component.class";
2
- import { A_Dependency } from "@adaas/a-concept/global/A-Dependency/A-Dependency.class";
3
- import { A_StepsManager } from "@adaas/a-concept/global/A-StepManager/A-StepManager.class";
1
+ import { A_Component } from "@adaas/a-concept/a-component";
2
+ import { A_Dependency } from "@adaas/a-concept/a-dependency";
3
+ import { A_StepsManager } from "@adaas/a-concept/a-step-manager";
4
4
 
5
5
  describe('A-StepManager tests', () => {
6
6
  it('Should Allow to create a step manager', async () => {
@@ -1,6 +1,6 @@
1
1
  import { A_CONSTANTS__DEFAULT_ENV_VARIABLES } from "@adaas/a-concept/constants/env.constants";
2
- import { A_Context } from '@adaas/a-concept/global/A-Context/A-Context.class';
3
- import { ASEID } from "@adaas/a-concept/global/ASEID/ASEID.class";
2
+ import { A_Context } from '@adaas/a-concept/a-context';
3
+ import { ASEID } from "@adaas/a-concept/aseid";
4
4
 
5
5
  jest.retryTimes(0);
6
6
 
@@ -1,30 +1,30 @@
1
- import { A_Context } from '@adaas/a-concept/global/A-Context/A-Context.class';
2
- import fs from 'fs';
1
+ // import { A_Context } from '@adaas/a-concept/a-context';
2
+ // import fs from 'fs';
3
3
 
4
- /**
5
- * Base hooks for tests
6
- */
7
- beforeAll(async () => {
4
+ // /**
5
+ // * Base hooks for tests
6
+ // */
7
+ // beforeAll(async () => {
8
8
 
9
- return Promise.resolve();
10
- });
9
+ // return Promise.resolve();
10
+ // });
11
11
 
12
- afterAll(async () => {
13
- try {
14
- fs.unlinkSync('a-concept.conf.json');
12
+ // afterAll(async () => {
13
+ // try {
14
+ // fs.unlinkSync('a-concept.conf.json');
15
15
 
16
- } catch (error) {
16
+ // } catch (error) {
17
17
 
18
- }
19
- return Promise.resolve();
20
- });
18
+ // }
19
+ // return Promise.resolve();
20
+ // });
21
21
 
22
- beforeEach(async () => {
23
- A_Context.reset();
24
- return Promise.resolve();
25
- });
22
+ // beforeEach(async () => {
23
+ // A_Context.reset();
24
+ // return Promise.resolve();
25
+ // });
26
26
 
27
- afterEach(async () => {
28
- A_Context.reset();
29
- return Promise.resolve();
30
- });
27
+ // afterEach(async () => {
28
+ // A_Context.reset();
29
+ // return Promise.resolve();
30
+ // });
package/tsconfig.json CHANGED
@@ -1,99 +1,61 @@
1
1
  {
2
- "$schema": "https://json.schemastore.org/tsconfig",
3
-
4
- "compileOnSave": false,
5
-
6
- "compilerOptions": {
7
- "useDefineForClassFields": false,
8
-
9
- /* ===============================
10
- Output (tsup controls formats)
11
- =============================== */
12
- "outDir": "dist",
13
- "declaration": true,
14
- "declarationMap": true,
15
- "sourceMap": true,
16
-
17
- /* ===============================
18
- Language & runtime
19
- =============================== */
20
- "target": "ES2022",
21
- "lib": ["ES2022", "DOM"],
22
-
23
- /* ===============================
24
- Module system (CRITICAL)
25
- =============================== */
26
- "module": "nodenext",
27
- "moduleResolution": "NodeNext",
28
-
29
- /* ===============================
30
- Interop
31
- =============================== */
32
- "esModuleInterop": true,
33
- "allowSyntheticDefaultImports": true,
34
- "resolveJsonModule": true,
35
-
36
- /* ===============================
37
- Type safety
38
- =============================== */
39
- "strict": true,
40
- "noImplicitAny": false,
41
- "strictNullChecks": true,
42
- "strictFunctionTypes": true,
43
- "strictPropertyInitialization": true,
44
- "noFallthroughCasesInSwitch": true,
45
-
46
- /* ===============================
47
- Developer experience
48
- =============================== */
49
- "skipLibCheck": true,
50
- "forceConsistentCasingInFileNames": true,
51
- "noErrorTruncation": true,
52
- "noUnusedLocals": false,
53
- "noUnusedParameters": false,
54
-
55
- /* ===============================
56
- Decorators (if used)
57
- =============================== */
58
- "experimentalDecorators": true,
59
-
60
- /* ===============================
61
- Internal aliases (DEV ONLY)
62
- =============================== */
63
- "baseUrl": ".",
64
- "paths": {
65
- "@adaas/a-concept/constants/*": ["src/constants/*"],
66
- "@adaas/a-concept/global/*": ["src/global/*"],
67
- "@adaas/a-concept/types/*": ["src/types/*"],
68
- "@adaas/a-concept/helpers/*": ["src/helpers/*"],
69
- "@adaas/a-concept/decorators/*": ["src/decorators/*"],
70
- "@adaas/a-concept/utils/*": ["src/utils/*"],
71
-
72
- /* DEV-only override to utils source */
73
- "@adaas/a-concept/env": ["src/env/index.node.ts"],
74
- },
75
-
76
- /* ===============================
77
- Types
78
- =============================== */
79
- "types": [
80
- "node",
81
- "jest",
82
- "mocha",
83
- ],
84
- "typeRoots": ["node_modules/@types"]
85
- },
86
-
87
- "include": [
88
- "src/**/*",
89
- "tests/**/*",
90
- "examples/**/*.ts",
91
- "src/index.ts",
92
- "src/env/global.browser.d.ts"
93
- ],
94
-
95
- "exclude": [
96
- "node_modules",
97
- "dist",
98
- ]
2
+ "extends": "./.conf/tsconfig.base.json",
3
+
4
+ "compilerOptions": {
5
+ "rootDir": "./",
6
+ "baseUrl": ".",
7
+ /* ===============================
8
+ Internal aliases (DEV ONLY)
9
+ =============================== */
10
+ "paths": {
11
+ "@adaas/a-concept/constants/*": ["src/constants/*"],
12
+ "@adaas/a-concept/utils/*": ["src/utils/*"],
13
+ "@adaas/a-concept/helpers/*": ["src/helpers/*"],
14
+ "@adaas/a-concept/types": ["src/types"],
15
+ "@adaas/a-concept/env": ["src/env/index.node.ts"],
16
+
17
+
18
+ "@adaas/a-concept/a-abstraction": ["src/lib/A-Abstraction"],
19
+ "@adaas/a-concept/a-caller": ["src/lib/A-Caller"],
20
+ "@adaas/a-concept/a-component": ["src/lib/A-Component"],
21
+ "@adaas/a-concept/a-concept": ["src/lib/A-Concept"],
22
+ "@adaas/a-concept/a-container": ["src/lib/A-Container"],
23
+ "@adaas/a-concept/a-context": ["src/lib/A-Context"],
24
+ "@adaas/a-concept/a-dependency": ["src/lib/A-Dependency"],
25
+ "@adaas/a-concept/a-entity": ["src/lib/A-Entity"],
26
+ "@adaas/a-concept/a-error": ["src/lib/A-Error"],
27
+ "@adaas/a-concept/a-feature": ["src/lib/A-Feature"],
28
+ "@adaas/a-concept/a-fragment": ["src/lib/A-Fragment"],
29
+ "@adaas/a-concept/a-inject": ["src/lib/A-Inject"],
30
+ "@adaas/a-concept/a-meta": ["src/lib/A-Meta"],
31
+ "@adaas/a-concept/a-scope": ["src/lib/A-Scope"],
32
+ "@adaas/a-concept/a-stage": ["src/lib/A-Stage"],
33
+ "@adaas/a-concept/a-step-manager": ["src/lib/A-StepManager"],
34
+ "@adaas/a-concept/aseid": ["src/lib/ASEID"],
35
+
36
+ },
37
+
38
+ /* ===============================
39
+ Types
40
+ =============================== */
41
+ "types": [
42
+ "node",
43
+ "jest",
44
+ "mocha",
45
+ ],
46
+ "typeRoots": ["node_modules/@types"]
47
+ },
48
+
49
+ "include": [
50
+ "src/**/*",
51
+ "tests/**/*",
52
+ "examples/**/*.ts",
53
+ "src/index.ts",
54
+ "src/env/global.browser.d.ts"
55
+ ],
56
+
57
+ "exclude": [
58
+ "node_modules",
59
+ "dist",
60
+ ]
99
61
  }
package/tsup.config.ts CHANGED
@@ -18,15 +18,14 @@ export default defineConfig([
18
18
  entry: {
19
19
  // Public library entry
20
20
  index: "src/index.ts",
21
-
22
- // Public env entry (browser implementation)
23
- env: "src/env/index.browser.ts",
24
21
  },
25
22
 
23
+ tsconfig: "./.conf/tsconfig.browser.json", // Separate tsconfig for browser build
24
+
26
25
  // Output directory for browser bundle
27
26
  outDir: "dist/browser",
28
27
 
29
- bundle: false, // Bundle for browser consumption
28
+ bundle: true, // Bundle for browser consumption
30
29
 
31
30
  // Browser consumers expect ESM
32
31
  format: ["esm"],
@@ -46,11 +45,14 @@ export default defineConfig([
46
45
  // Emit .d.ts files
47
46
  dts: true,
48
47
 
49
- /**
50
- * IMPORTANT:
51
- * We do NOT define process.env here.
52
- * Browser env must never reference process at all.
53
- */
48
+ minify: true, // Minify browser build for smaller size
49
+
50
+ // Ensure .mjs extension for ESM output
51
+ outExtension({ format }) {
52
+ return {
53
+ js: ".mjs"
54
+ };
55
+ }
54
56
  },
55
57
 
56
58
  /**
@@ -71,15 +73,16 @@ export default defineConfig([
71
73
  entry: {
72
74
  // Same public API as browser
73
75
  index: "src/index.ts",
74
-
75
- // Node-specific env implementation
76
- env: "src/env/index.node.ts",
77
76
  },
78
77
 
78
+ tsconfig: "./.conf/tsconfig.node.json", // Separate tsconfig for node build
79
+
80
+ splitting: true, // Disable code splitting for Node build
81
+
79
82
  // Output directory for node bundle
80
83
  outDir: "dist/node",
81
84
 
82
- bundle: false, // Don't bundle node build, keep imports as-is
85
+ bundle: true, // Don't bundle node build, keep imports as-is
83
86
 
84
87
  // Support both module systems
85
88
  format: ["esm", "cjs"],
@@ -96,6 +99,8 @@ export default defineConfig([
96
99
  // Emit .d.ts files (shared shape)
97
100
  dts: true,
98
101
 
102
+ minify: false, // Don't minify Node build for better readability
103
+
99
104
  // Ensure .cjs extension for CommonJS output
100
105
  outExtension({ format }) {
101
106
  return {