@africode/core 5.0.3 → 5.0.4

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.
@@ -1,6 +1,6 @@
1
1
  {
2
- "timestamp": "2026-06-28T07:49:55.934Z",
3
- "version": "5.0.3",
2
+ "timestamp": "2026-06-28T08:32:20.429Z",
3
+ "version": "5.0.4",
4
4
  "bundles": {
5
5
  "core": {
6
6
  "file": "africode.js",
@@ -19,5 +19,5 @@
19
19
  ]
20
20
  }
21
21
  },
22
- "buildTime": "155.00ms"
22
+ "buildTime": "179.87ms"
23
23
  }
package/package.json CHANGED
@@ -1,13 +1,14 @@
1
1
  {
2
2
  "name": "@africode/core",
3
- "version": "5.0.3",
3
+ "version": "5.0.4",
4
4
  "description": "Bun-native full-stack framework with generative AI, fintech compliance, and real-time performance - built for Tanzanian digital economy",
5
- "module": "src/index.ts",
6
- "main": "src/index.ts",
7
- "types": "src/index.ts",
5
+ "module": "core/sdk.js",
6
+ "main": "core/sdk.js",
7
+ "types": "core/sdk.js",
8
8
  "type": "module",
9
9
  "exports": {
10
- ".": "./src/index.ts",
10
+ ".": "./core/sdk.js",
11
+ "./browser": "./core/sdk-browser.js",
11
12
  "./styles": "./styles/africanity.css",
12
13
  "./core/*": "./core/*",
13
14
  "./components": "./components/index.js",
@@ -10,7 +10,7 @@
10
10
  <script type="importmap">
11
11
  {
12
12
  "imports": {
13
- "africode": "/node_modules/@africode/core/src/index.ts",
13
+ "africode": "/node_modules/@africode/core/core/sdk-browser.js",
14
14
  "africode/components": "/node_modules/@africode/core/components/index.js"
15
15
  }
16
16
  }
@@ -20,7 +20,7 @@
20
20
  <link rel="stylesheet" href="/node_modules/@africode/core/styles/africanity.css">
21
21
  <link rel="stylesheet" href="/node_modules/@africode/core/styles/typography.css">
22
22
  <link rel="stylesheet" href="/styles/main.css">
23
- <script type="module" src="/node_modules/@africode/core/src/index.ts"></script>
23
+ <script type="module" src="/node_modules/@africode/core/core/sdk-browser.js"></script>
24
24
 
25
25
  <!-- SDK & Components -->
26
26
  <script type="module">
@@ -10,7 +10,7 @@
10
10
  <script type="importmap">
11
11
  {
12
12
  "imports": {
13
- "africode": "/node_modules/@africode/core/src/index.ts",
13
+ "africode": "/node_modules/@africode/core/core/sdk-browser.js",
14
14
  "africode/components": "/node_modules/@africode/core/components/index.js"
15
15
  }
16
16
  }
@@ -20,7 +20,7 @@
20
20
  <link rel="stylesheet" href="/node_modules/@africode/core/styles/africanity.css">
21
21
  <link rel="stylesheet" href="/node_modules/@africode/core/styles/typography.css">
22
22
  <link rel="stylesheet" href="/styles/main.css">
23
- <script type="module" src="/node_modules/@africode/core/src/index.ts"></script>
23
+ <script type="module" src="/node_modules/@africode/core/core/sdk-browser.js"></script>
24
24
 
25
25
  <!-- SDK & Components -->
26
26
  <script type="module">
@@ -10,7 +10,7 @@
10
10
  <script type="importmap">
11
11
  {
12
12
  "imports": {
13
- "africode": "/node_modules/@africode/core/src/index.ts",
13
+ "africode": "/node_modules/@africode/core/core/sdk-browser.js",
14
14
  "africode/components": "/node_modules/@africode/core/components/index.js"
15
15
  }
16
16
  }
@@ -20,7 +20,7 @@
20
20
  <link rel="stylesheet" href="/node_modules/@africode/core/styles/africanity.css">
21
21
  <link rel="stylesheet" href="/node_modules/@africode/core/styles/typography.css">
22
22
  <link rel="stylesheet" href="/styles/main.css">
23
- <script type="module" src="/node_modules/@africode/core/src/index.ts"></script>
23
+ <script type="module" src="/node_modules/@africode/core/core/sdk-browser.js"></script>
24
24
 
25
25
  <!-- SDK & Components -->
26
26
  <script type="module">
@@ -10,7 +10,7 @@
10
10
  <script type="importmap">
11
11
  {
12
12
  "imports": {
13
- "africode": "/node_modules/@africode/core/src/index.ts",
13
+ "africode": "/node_modules/@africode/core/core/sdk-browser.js",
14
14
  "africode/components": "/node_modules/@africode/core/components/index.js"
15
15
  }
16
16
  }
@@ -20,7 +20,7 @@
20
20
  <link rel="stylesheet" href="/node_modules/@africode/core/styles/africanity.css">
21
21
  <link rel="stylesheet" href="/node_modules/@africode/core/styles/typography.css">
22
22
  <link rel="stylesheet" href="/styles/main.css">
23
- <script type="module" src="/node_modules/@africode/core/src/index.ts"></script>
23
+ <script type="module" src="/node_modules/@africode/core/core/sdk-browser.js"></script>
24
24
 
25
25
  <!-- SDK & Components -->
26
26
  <script type="module">
package/src/index.ts DELETED
@@ -1,196 +0,0 @@
1
- /**
2
- * AfriCode v5.0.0 - Autonomous Framework Entry Point
3
- * African-centric full-stack framework with AI safety and fintech compliance
4
- */
5
-
6
- import { createReactiveState, subscribe, createSignal, createEffect } from '../core/state.js';
7
- import { store, actions } from '../core/store.js';
8
- import patterns from '../core/patterns.js';
9
- import * as motion from '../core/motion.js';
10
- import { hydrate } from '../core/hydration.js';
11
- import { html, Layout } from '../core/html.js';
12
- import { schemas, Validation, rules, afri, AfriFieldBuilder, normalizeInput, buildSchema } from '../core/validation.js';
13
- import { createFramework, getConfig } from '../core/config.js';
14
- import {
15
- AfriCodeError, ValidationError, InvalidUrlError,
16
- SecurityError, CsrfError, RateLimitError,
17
- DatabaseError, ComponentError
18
- } from '../core/errors.js';
19
-
20
- // v5.0.0 autonomous features
21
- import { initA2UI, A2UIRenderer, A2UIProtocol } from '../core/a2ui.js';
22
- import { NIDAClient, TIPSClient, AMLComplianceEngine, ComplianceMiddleware } from '../core/compliance.js';
23
- import { initBunRuntime, HotReloadEngine, BunHTTPServer, BunDatabase, PerformanceMonitor } from '../core/bun-runtime.js';
24
- import { EnhancedHMRMiddleware } from '../core/enhanced-hmr.js';
25
- import { A2uiSchemaManager } from '../core/a2ui-schema-manager.js';
26
- import { LipaNambaJourney } from '../core/lipa-namba-journey.js';
27
-
28
- import { componentMap as coreMap } from '../components/index.js';
29
-
30
- /**
31
- * AfriCode Framework Class
32
- * Autonomous application lifecycle management
33
- */
34
- export class AfriCode {
35
- private config: any;
36
- private server?: BunHTTPServer;
37
- private hmr?: EnhancedHMRMiddleware;
38
- private schemaManager?: A2uiSchemaManager;
39
-
40
- constructor(config: {
41
- port?: number;
42
- pagesDir?: string;
43
- publicDir?: string;
44
- enableHMR?: boolean;
45
- enableA2UI?: boolean;
46
- fintechCompliance?: boolean;
47
- } = {}) {
48
- this.config = {
49
- port: 3000,
50
- pagesDir: 'pages',
51
- publicDir: 'public',
52
- enableHMR: true,
53
- enableA2UI: true,
54
- fintechCompliance: true,
55
- ...config
56
- };
57
- }
58
-
59
- /**
60
- * Initialize the autonomous framework
61
- */
62
- async initialize(): Promise<void> {
63
- console.log('🚀 Initializing AfriCode v5.0.0...');
64
-
65
- // Initialize Bun runtime
66
- await initBunRuntime();
67
-
68
- // Initialize A2UI schema manager
69
- if (this.config.enableA2UI) {
70
- this.schemaManager = new A2uiSchemaManager();
71
- await this.schemaManager.generateManifest();
72
- }
73
-
74
- // Initialize HMR if enabled
75
- if (this.config.enableHMR) {
76
- this.hmr = new EnhancedHMRMiddleware({
77
- port: this.config.port + 1,
78
- watchPaths: [this.config.pagesDir, 'components', 'core']
79
- });
80
- }
81
-
82
- console.log('✅ AfriCode initialized successfully');
83
- }
84
-
85
- /**
86
- * Start the autonomous server
87
- */
88
- async start(): Promise<void> {
89
- await this.initialize();
90
-
91
- // Create HTTP server with file-based routing
92
- this.server = new BunHTTPServer({
93
- port: this.config.port,
94
- pagesDir: this.config.pagesDir,
95
- publicDir: this.config.publicDir,
96
- middleware: [
97
- this.config.fintechCompliance ? new ComplianceMiddleware() : null,
98
- this.hmr
99
- ].filter(Boolean)
100
- });
101
-
102
- // Start HMR if enabled
103
- if (this.hmr) {
104
- await this.hmr.initialize(this.server);
105
- }
106
-
107
- await this.server.start();
108
- console.log(`🌐 Server running on http://localhost:${this.config.port}`);
109
- }
110
-
111
- /**
112
- * Stop the framework
113
- */
114
- async stop(): Promise<void> {
115
- if (this.server) {
116
- await this.server.stop();
117
- }
118
- if (this.hmr) {
119
- await this.hmr.shutdown();
120
- }
121
- console.log('🛑 AfriCode stopped');
122
- }
123
- }
124
-
125
- /**
126
- * Utility to initialize the full framework (legacy compatibility)
127
- */
128
- export function init(projectComponentMap: Record<string, any> = {}): void {
129
- if (typeof window !== 'undefined') {
130
- console.log('🌍 AfriCode SDK Initialized (Zero-Config Mode)');
131
-
132
- // Merge project map with core map
133
- const finalMap = { ...coreMap, ...projectComponentMap };
134
-
135
- if (Object.keys(finalMap).length > 0) {
136
- hydrate(finalMap);
137
- }
138
- }
139
- }
140
-
141
- // Core exports
142
- export {
143
- createReactiveState,
144
- subscribe,
145
- createSignal,
146
- createEffect,
147
- store,
148
- actions,
149
- patterns,
150
- motion,
151
- hydrate,
152
- html,
153
- Layout,
154
- schemas,
155
- Validation,
156
- rules,
157
- afri,
158
- AfriFieldBuilder,
159
- normalizeInput,
160
- buildSchema,
161
- createFramework,
162
- getConfig,
163
- AfriCodeError,
164
- ValidationError,
165
- InvalidUrlError,
166
- SecurityError,
167
- CsrfError,
168
- RateLimitError,
169
- DatabaseError,
170
- ComponentError
171
- };
172
-
173
- // v5.0.0 autonomous exports
174
- export {
175
- initA2UI,
176
- A2UIRenderer,
177
- A2UIProtocol,
178
- NIDAClient,
179
- TIPSClient,
180
- AMLComplianceEngine,
181
- ComplianceMiddleware,
182
- initBunRuntime,
183
- HotReloadEngine,
184
- BunHTTPServer,
185
- BunDatabase,
186
- PerformanceMonitor,
187
- EnhancedHMRMiddleware,
188
- A2uiSchemaManager,
189
- LipaNambaJourney
190
- };
191
-
192
- // Component exports
193
- export { componentMap as components } from '../components/index.js';
194
-
195
- // Re-export for convenience
196
- export default AfriCode;