@adaas/a-concept 0.2.14 → 0.3.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 (143) 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 +4166 -212
  5. package/dist/browser/index.mjs +2 -67
  6. package/dist/browser/index.mjs.map +1 -1
  7. package/dist/node/index.cjs +5757 -383
  8. package/dist/node/index.cjs.map +1 -1
  9. package/dist/node/index.d.mts +4193 -212
  10. package/dist/node/index.d.ts +4193 -212
  11. package/dist/node/index.mjs +5699 -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 +20 -1
  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 +41 -33
  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/{global → lib}/A-Dependency/A-Dependency-Require.decorator.ts +11 -9
  56. package/src/{global → lib}/A-Dependency/A-Dependency.class.ts +9 -3
  57. package/src/{global → lib}/A-Dependency/A-Dependency.error.ts +1 -1
  58. package/src/{global → lib}/A-Dependency/A-Dependency.types.ts +9 -9
  59. package/src/lib/A-Dependency/index.ts +17 -0
  60. package/src/{global → lib}/A-Entity/A-Entity.class.ts +11 -9
  61. package/src/{global → lib}/A-Entity/A-Entity.error.ts +1 -1
  62. package/src/{global → lib}/A-Entity/A-Entity.meta.ts +3 -3
  63. package/src/{global → lib}/A-Entity/A-Entity.types.ts +5 -5
  64. package/src/lib/A-Entity/index.ts +5 -0
  65. package/src/{global → lib}/A-Error/A_Error.class.ts +13 -13
  66. package/src/{global → lib}/A-Error/A_Error.types.ts +2 -2
  67. package/src/lib/A-Error/index.ts +3 -0
  68. package/src/{global → lib}/A-Feature/A-Feature-Define.decorator.ts +16 -10
  69. package/src/{global → lib}/A-Feature/A-Feature-Extend.decorator.ts +13 -9
  70. package/src/{global → lib}/A-Feature/A-Feature.class.ts +15 -13
  71. package/src/{global → lib}/A-Feature/A-Feature.error.ts +2 -2
  72. package/src/{global → lib}/A-Feature/A-Feature.types.ts +21 -12
  73. package/src/lib/A-Feature/index.ts +13 -0
  74. package/src/{global → lib}/A-Fragment/A-Fragment.class.ts +0 -2
  75. package/src/{global → lib}/A-Fragment/A-Fragment.types.ts +1 -1
  76. package/src/lib/A-Fragment/index.ts +5 -0
  77. package/src/{global → lib}/A-Inject/A-Inject.decorator.ts +42 -24
  78. package/src/{global → lib}/A-Inject/A-Inject.error.ts +1 -1
  79. package/src/{global → lib}/A-Inject/A-Inject.types.ts +3 -9
  80. package/src/lib/A-Inject/index.ts +3 -0
  81. package/src/{global → lib}/A-Meta/A-Meta.decorator.ts +2 -2
  82. package/src/{global → lib}/A-Meta/A-Meta.types.ts +18 -10
  83. package/src/lib/A-Meta/index.ts +11 -0
  84. package/src/{global → lib}/A-Scope/A-Scope.class.ts +34 -24
  85. package/src/{global → lib}/A-Scope/A-Scope.error.ts +1 -1
  86. package/src/{global → lib}/A-Scope/A-Scope.types.ts +22 -14
  87. package/src/lib/A-Scope/index.ts +5 -0
  88. package/src/{global → lib}/A-Stage/A-Stage.class.ts +9 -10
  89. package/src/{global → lib}/A-Stage/A-Stage.error.ts +1 -1
  90. package/src/{global → lib}/A-Stage/A-Stage.types.ts +1 -4
  91. package/src/lib/A-Stage/index.ts +5 -0
  92. package/src/{global → lib}/A-StepManager/A-StepManager.class.ts +8 -4
  93. package/src/{global → lib}/A-StepManager/A-StepManager.error.ts +1 -1
  94. package/src/lib/A-StepManager/index.ts +4 -0
  95. package/src/{global → lib}/ASEID/ASEID.class.ts +20 -23
  96. package/src/lib/ASEID/ASEID.error.ts +12 -0
  97. package/src/lib/ASEID/index.ts +4 -0
  98. package/src/types/A_identity.types.ts +4 -0
  99. package/src/types/index.ts +2 -0
  100. package/tests/A-Abstraction.test.ts +6 -6
  101. package/tests/A-Common.test.ts +6 -4
  102. package/tests/A-Component.test.ts +7 -5
  103. package/tests/A-Concept.test.ts +13 -11
  104. package/tests/A-Container.test.ts +4 -3
  105. package/tests/A-Dependency.test.ts +6 -1
  106. package/tests/A-Entity.test.ts +7 -5
  107. package/tests/A-Error.test.ts +7 -4
  108. package/tests/A-Feature.test.ts +12 -8
  109. package/tests/A-Fragment.test.ts +1 -2
  110. package/tests/A-Inject.test.ts +4 -1
  111. package/tests/A-Meta.test.ts +12 -10
  112. package/tests/A-Scope.test.ts +11 -10
  113. package/tests/A-StepManager.test.ts +3 -3
  114. package/tests/ASEID.test.ts +2 -2
  115. package/tests/jest.setup.ts +23 -23
  116. package/tsconfig.json +59 -97
  117. package/tsup.config.ts +18 -13
  118. package/dist/browser/A-Context.types-BtR_HJ0j.d.mts +0 -3828
  119. package/dist/browser/env.d.mts +0 -64
  120. package/dist/browser/env.mjs +0 -3
  121. package/dist/browser/env.mjs.map +0 -1
  122. package/dist/node/A-Context.types-BtR_HJ0j.d.mts +0 -3828
  123. package/dist/node/A-Context.types-BtR_HJ0j.d.ts +0 -3828
  124. package/dist/node/env.cjs +0 -12
  125. package/dist/node/env.cjs.map +0 -1
  126. package/dist/node/env.d.mts +0 -91
  127. package/dist/node/env.d.ts +0 -91
  128. package/dist/node/env.js +0 -12
  129. package/dist/node/env.js.map +0 -1
  130. package/dist/node/env.mjs +0 -3
  131. package/dist/node/env.mjs.map +0 -1
  132. package/dist/node/index.js +0 -387
  133. package/dist/node/index.js.map +0 -1
  134. package/src/global/A-Context/A-Context.types.ts +0 -14
  135. package/src/global/ASEID/ASEID.error.ts +0 -12
  136. /package/src/{global → lib}/A-Component/A-Component.constants.ts +0 -0
  137. /package/src/{global → lib}/A-Concept/A-Concept.constants.ts +0 -0
  138. /package/src/{global → lib}/A-Container/A-Container.constants.ts +0 -0
  139. /package/src/{global → lib}/A-Entity/A-Entity.constants.ts +0 -0
  140. /package/src/{global → lib}/A-Error/A_Error.constants.ts +0 -0
  141. /package/src/{global → lib}/A-Meta/A-Meta.class.ts +0 -0
  142. /package/src/{global → lib}/ASEID/ASEID.constants.ts +0 -0
  143. /package/src/{global → lib}/ASEID/ASEID.types.ts +0 -0
@@ -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 {