@africode/core 5.0.1 → 5.0.3
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.
- package/COMPONENT_SCHEMA.json +103 -69
- package/components/base.d.ts +1 -1
- package/components/base.js +71 -21
- package/core/a2ui-schema-manager.js +9 -2
- package/core/a2ui.js +131 -43
- package/core/actions.js +27 -0
- package/core/bun-runtime.js +207 -724
- package/core/cli/commands/dev.js +23 -3
- package/core/compliance.js +6 -5
- package/core/config.js +7 -5
- package/core/enhanced-hmr.js +16 -14
- package/core/file-router.js +42 -282
- package/core/hmr.js +8 -7
- package/core/html.d.ts +15 -101
- package/core/html.js +53 -129
- package/core/lipa-namba-journey.js +74 -12
- package/core/logging.js +14 -0
- package/core/middleware.js +82 -0
- package/core/nida-cig-middleware.js +13 -8
- package/core/plugins/index.js +345 -312
- package/core/request-identity.js +44 -0
- package/core/sdk.js +22 -0
- package/core/session-store.js +68 -0
- package/core/state.js +34 -0
- package/core/websocket.js +22 -20
- package/dist/africode.js +108 -112
- package/dist/africode.js.map +6 -6
- package/dist/build-info.json +3 -3
- package/dist/components.js +351 -351
- package/dist/components.js.map +6 -6
- package/package.json +3 -3
- package/scripts/generate-component-schema.js +1 -1
- package/templates/starter/package.json +1 -1
- package/templates/starter/src/pages/index.html +14 -4
- package/templates/starter/src/pages/index.js +13 -28
- package/templates/starter-3d/package.json +1 -1
- package/templates/starter-3d/src/pages/index.html +13 -3
- package/templates/starter-react/package.json +1 -1
- package/templates/starter-react/src/pages/index.html +13 -3
- package/templates/starter-tailwind/package.json +1 -1
- package/templates/starter-tailwind/src/pages/index.html +13 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@africode/core",
|
|
3
|
-
"version": "5.0.
|
|
3
|
+
"version": "5.0.3",
|
|
4
4
|
"description": "Bun-native full-stack framework with generative AI, fintech compliance, and real-time performance - built for Tanzanian digital economy",
|
|
5
5
|
"module": "src/index.ts",
|
|
6
6
|
"main": "src/index.ts",
|
|
@@ -14,8 +14,8 @@
|
|
|
14
14
|
"./components/*": "./components/*"
|
|
15
15
|
},
|
|
16
16
|
"bin": {
|
|
17
|
-
"africode": "./bin/
|
|
18
|
-
"create-africode": "./bin/
|
|
17
|
+
"africode": "./bin/africode.js",
|
|
18
|
+
"create-africode": "./bin/create-africode.js"
|
|
19
19
|
},
|
|
20
20
|
"scripts": {
|
|
21
21
|
"dev": "bun run bin/africode.js dev",
|
|
@@ -14,7 +14,7 @@ const OUTPUT_FILE = 'COMPONENT_SCHEMA.json';
|
|
|
14
14
|
|
|
15
15
|
function parseComponentFile(filePath) {
|
|
16
16
|
const content = readFileSync(filePath, 'utf8');
|
|
17
|
-
const fileName = filePath.split(
|
|
17
|
+
const fileName = filePath.split(/[/\\]/).pop().replace('.js', '');
|
|
18
18
|
|
|
19
19
|
// Extract class name
|
|
20
20
|
const classMatch = content.match(/export class (\w+)/);
|
|
@@ -6,11 +6,21 @@
|
|
|
6
6
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
7
7
|
<title>Welcome to AfriCode</title>
|
|
8
8
|
|
|
9
|
+
<!-- Import Map: resolves bare module specifiers for the browser -->
|
|
10
|
+
<script type="importmap">
|
|
11
|
+
{
|
|
12
|
+
"imports": {
|
|
13
|
+
"africode": "/node_modules/@africode/core/src/index.ts",
|
|
14
|
+
"africode/components": "/node_modules/@africode/core/components/index.js"
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
</script>
|
|
18
|
+
|
|
9
19
|
<!-- Theme -->
|
|
10
|
-
<link rel="stylesheet" href="/node_modules
|
|
11
|
-
<link rel="stylesheet" href="/node_modules
|
|
20
|
+
<link rel="stylesheet" href="/node_modules/@africode/core/styles/africanity.css">
|
|
21
|
+
<link rel="stylesheet" href="/node_modules/@africode/core/styles/typography.css">
|
|
12
22
|
<link rel="stylesheet" href="/styles/main.css">
|
|
13
|
-
<script type="module" src="/node_modules
|
|
23
|
+
<script type="module" src="/node_modules/@africode/core/src/index.ts"></script>
|
|
14
24
|
|
|
15
25
|
<!-- SDK & Components -->
|
|
16
26
|
<script type="module">
|
|
@@ -31,7 +41,7 @@
|
|
|
31
41
|
<div
|
|
32
42
|
style="display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 24px; margin-top: 40px;">
|
|
33
43
|
<af-card title="Getting Started">
|
|
34
|
-
<p>Edit <code>pages/index.html</code> to change this page.</p>
|
|
44
|
+
<p>Edit <code>src/pages/index.html</code> to change this page.</p>
|
|
35
45
|
<af-button variant="primary">Read Docs</af-button>
|
|
36
46
|
</af-card>
|
|
37
47
|
|
|
@@ -1,32 +1,17 @@
|
|
|
1
1
|
import { html, Layout } from 'africode';
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
*/
|
|
7
|
-
export default function HomePage() {
|
|
8
|
-
return Layout({
|
|
9
|
-
title: "Welcome to AfriCode",
|
|
10
|
-
children: html`
|
|
11
|
-
<af-navbar logo="My App" theme="dark"></af-navbar>
|
|
12
|
-
|
|
13
|
-
<main style="max-width: 1000px; margin: 0 auto; padding: 40px;">
|
|
14
|
-
<af-hero
|
|
15
|
-
title="Next-Gen African Web"
|
|
16
|
-
subtitle="Built with the AfriCode JS Framework."
|
|
17
|
-
pattern="kente">
|
|
18
|
-
</af-hero>
|
|
19
|
-
|
|
20
|
-
<div style="display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 24px; margin-top: 40px;">
|
|
21
|
-
<af-card title="JS-First Architecture">
|
|
22
|
-
<p>No more HTML files. Logic and View utilize <code>pages/index.js</code>.</p>
|
|
23
|
-
</af-card>
|
|
3
|
+
export function loader() {
|
|
4
|
+
return { title: 'Welcome to AfriCode' };
|
|
5
|
+
}
|
|
24
6
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
7
|
+
export default function HomePage({ data }) {
|
|
8
|
+
return Layout({
|
|
9
|
+
title: data?.title || 'Welcome to AfriCode',
|
|
10
|
+
children: html`
|
|
11
|
+
<main>
|
|
12
|
+
<h1>Welcome to AfriCode</h1>
|
|
13
|
+
<p>Your African-centric full-stack framework is ready.</p>
|
|
14
|
+
</main>
|
|
15
|
+
`
|
|
16
|
+
});
|
|
32
17
|
}
|
|
@@ -6,11 +6,21 @@
|
|
|
6
6
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
7
7
|
<title>Welcome to AfriCode</title>
|
|
8
8
|
|
|
9
|
+
<!-- Import Map: resolves bare module specifiers for the browser -->
|
|
10
|
+
<script type="importmap">
|
|
11
|
+
{
|
|
12
|
+
"imports": {
|
|
13
|
+
"africode": "/node_modules/@africode/core/src/index.ts",
|
|
14
|
+
"africode/components": "/node_modules/@africode/core/components/index.js"
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
</script>
|
|
18
|
+
|
|
9
19
|
<!-- Theme -->
|
|
10
|
-
<link rel="stylesheet" href="/node_modules
|
|
11
|
-
<link rel="stylesheet" href="/node_modules
|
|
20
|
+
<link rel="stylesheet" href="/node_modules/@africode/core/styles/africanity.css">
|
|
21
|
+
<link rel="stylesheet" href="/node_modules/@africode/core/styles/typography.css">
|
|
12
22
|
<link rel="stylesheet" href="/styles/main.css">
|
|
13
|
-
<script type="module" src="/node_modules
|
|
23
|
+
<script type="module" src="/node_modules/@africode/core/src/index.ts"></script>
|
|
14
24
|
|
|
15
25
|
<!-- SDK & Components -->
|
|
16
26
|
<script type="module">
|
|
@@ -6,11 +6,21 @@
|
|
|
6
6
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
7
7
|
<title>Welcome to AfriCode</title>
|
|
8
8
|
|
|
9
|
+
<!-- Import Map: resolves bare module specifiers for the browser -->
|
|
10
|
+
<script type="importmap">
|
|
11
|
+
{
|
|
12
|
+
"imports": {
|
|
13
|
+
"africode": "/node_modules/@africode/core/src/index.ts",
|
|
14
|
+
"africode/components": "/node_modules/@africode/core/components/index.js"
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
</script>
|
|
18
|
+
|
|
9
19
|
<!-- Theme -->
|
|
10
|
-
<link rel="stylesheet" href="/node_modules
|
|
11
|
-
<link rel="stylesheet" href="/node_modules
|
|
20
|
+
<link rel="stylesheet" href="/node_modules/@africode/core/styles/africanity.css">
|
|
21
|
+
<link rel="stylesheet" href="/node_modules/@africode/core/styles/typography.css">
|
|
12
22
|
<link rel="stylesheet" href="/styles/main.css">
|
|
13
|
-
<script type="module" src="/node_modules
|
|
23
|
+
<script type="module" src="/node_modules/@africode/core/src/index.ts"></script>
|
|
14
24
|
|
|
15
25
|
<!-- SDK & Components -->
|
|
16
26
|
<script type="module">
|
|
@@ -6,11 +6,21 @@
|
|
|
6
6
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
7
7
|
<title>Welcome to AfriCode</title>
|
|
8
8
|
|
|
9
|
+
<!-- Import Map: resolves bare module specifiers for the browser -->
|
|
10
|
+
<script type="importmap">
|
|
11
|
+
{
|
|
12
|
+
"imports": {
|
|
13
|
+
"africode": "/node_modules/@africode/core/src/index.ts",
|
|
14
|
+
"africode/components": "/node_modules/@africode/core/components/index.js"
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
</script>
|
|
18
|
+
|
|
9
19
|
<!-- Theme -->
|
|
10
|
-
<link rel="stylesheet" href="/node_modules
|
|
11
|
-
<link rel="stylesheet" href="/node_modules
|
|
20
|
+
<link rel="stylesheet" href="/node_modules/@africode/core/styles/africanity.css">
|
|
21
|
+
<link rel="stylesheet" href="/node_modules/@africode/core/styles/typography.css">
|
|
12
22
|
<link rel="stylesheet" href="/styles/main.css">
|
|
13
|
-
<script type="module" src="/node_modules
|
|
23
|
+
<script type="module" src="/node_modules/@africode/core/src/index.ts"></script>
|
|
14
24
|
|
|
15
25
|
<!-- SDK & Components -->
|
|
16
26
|
<script type="module">
|