juxscript 1.0.9 → 1.0.11
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "juxscript",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.11",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "A JavaScript UX authorship platform",
|
|
6
6
|
"main": "lib/jux.js",
|
|
@@ -22,13 +22,14 @@
|
|
|
22
22
|
"default": "./lib/reactivity/index.js"
|
|
23
23
|
},
|
|
24
24
|
"./components/*": "./lib/components/*/index.js",
|
|
25
|
-
"./presets/*": "./
|
|
25
|
+
"./presets/*": "./presets/*.*",
|
|
26
26
|
"./package.json": "./package.json"
|
|
27
27
|
},
|
|
28
28
|
"files": [
|
|
29
29
|
"lib",
|
|
30
30
|
"bin",
|
|
31
31
|
"machinery",
|
|
32
|
+
"presets",
|
|
32
33
|
"types",
|
|
33
34
|
"README.md",
|
|
34
35
|
"LICENSE"
|
|
@@ -50,15 +51,17 @@
|
|
|
50
51
|
"prepublishOnly": "npm run build"
|
|
51
52
|
},
|
|
52
53
|
"dependencies": {
|
|
53
|
-
"express": "^4.18.2",
|
|
54
54
|
"chokidar": "^3.5.3",
|
|
55
|
-
"
|
|
56
|
-
"
|
|
55
|
+
"esbuild": "^0.19.0",
|
|
56
|
+
"express": "^4.18.2",
|
|
57
|
+
"glob": "^13.0.0",
|
|
58
|
+
"sql.js": "^1.8.0",
|
|
59
|
+
"ws": "^8.13.0"
|
|
57
60
|
},
|
|
58
61
|
"devDependencies": {
|
|
59
|
-
"typescript": "^5.0.0",
|
|
60
62
|
"@types/express": "^4.17.17",
|
|
61
63
|
"@types/node": "^20.0.0",
|
|
62
|
-
"@types/ws": "^8.5.5"
|
|
64
|
+
"@types/ws": "^8.5.5",
|
|
65
|
+
"typescript": "^5.0.0"
|
|
63
66
|
}
|
|
64
67
|
}
|
|
@@ -1,107 +0,0 @@
|
|
|
1
|
-
import fs from 'fs';
|
|
2
|
-
import path from 'path';
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Generates a simple HTML wrapper for a .jux file
|
|
6
|
-
* No directives, no parsing - just a clean HTML shell
|
|
7
|
-
*/
|
|
8
|
-
export function generateHTML(fileName, options = {}) {
|
|
9
|
-
const { fileDir = '.', pathPrefix = './', isServe = false } = options;
|
|
10
|
-
|
|
11
|
-
const prefix = pathPrefix;
|
|
12
|
-
|
|
13
|
-
// Page script path
|
|
14
|
-
const pageScriptPath = `${prefix}${fileName}.js`;
|
|
15
|
-
|
|
16
|
-
// Build app structure with semantic nodes
|
|
17
|
-
const appStructure = buildAppStructure(fileName);
|
|
18
|
-
|
|
19
|
-
// Hot reload script (only in serve mode)
|
|
20
|
-
const hotReloadScript = isServe ? `
|
|
21
|
-
<!-- Hot Reload -->
|
|
22
|
-
<script>
|
|
23
|
-
(function() {
|
|
24
|
-
const ws = new WebSocket('ws://' + location.host);
|
|
25
|
-
ws.onmessage = (event) => {
|
|
26
|
-
const data = JSON.parse(event.data);
|
|
27
|
-
if (data.type === 'reload') {
|
|
28
|
-
console.log('🔄 Reloading...');
|
|
29
|
-
location.reload();
|
|
30
|
-
}
|
|
31
|
-
};
|
|
32
|
-
ws.onclose = () => console.log('🔌 Hot reload disconnected');
|
|
33
|
-
})();
|
|
34
|
-
</script>` : '';
|
|
35
|
-
|
|
36
|
-
// Build complete HTML
|
|
37
|
-
const html = `<!DOCTYPE html>
|
|
38
|
-
<html lang="en">
|
|
39
|
-
<head>
|
|
40
|
-
<meta charset="UTF-8">
|
|
41
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
42
|
-
<title>${fileName}</title>
|
|
43
|
-
|
|
44
|
-
<!-- JUX Core Styles -->
|
|
45
|
-
<link rel="stylesheet" href="${prefix}lib/presets/global.css">
|
|
46
|
-
</head>
|
|
47
|
-
<body data-theme="dark">
|
|
48
|
-
${appStructure}
|
|
49
|
-
|
|
50
|
-
<!-- Page Script -->
|
|
51
|
-
<script type="module" src="${pageScriptPath}"></script>${hotReloadScript}
|
|
52
|
-
</body>
|
|
53
|
-
</html>`;
|
|
54
|
-
|
|
55
|
-
return html;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
/**
|
|
59
|
-
* Build semantic app structure - Always includes all nodes
|
|
60
|
-
*/
|
|
61
|
-
function buildAppStructure(pageName) {
|
|
62
|
-
const page = pageName || 'index';
|
|
63
|
-
|
|
64
|
-
return ` <!-- App Container -->
|
|
65
|
-
<div id="app" data-jux-page="${page}">
|
|
66
|
-
<!-- Header -->
|
|
67
|
-
<header id="appheader">
|
|
68
|
-
<div id="appheader-logo"></div>
|
|
69
|
-
<nav id="appheader-nav"></nav>
|
|
70
|
-
<div id="appheader-actions"></div>
|
|
71
|
-
</header>
|
|
72
|
-
|
|
73
|
-
<!-- Subheader (breadcrumbs, tabs, etc.) -->
|
|
74
|
-
<div id="appsubheader">
|
|
75
|
-
<div id="appsubheader-breadcrumbs"></div>
|
|
76
|
-
<div id="appsubheader-tabs"></div>
|
|
77
|
-
<div id="appsubheader-actions"></div>
|
|
78
|
-
</div>
|
|
79
|
-
|
|
80
|
-
<!-- Sidebar -->
|
|
81
|
-
<aside id="appsidebar">
|
|
82
|
-
<div id="appsidebar-header"></div>
|
|
83
|
-
<div id="appsidebar-content"></div>
|
|
84
|
-
<div id="appsidebar-footer"></div>
|
|
85
|
-
</aside>
|
|
86
|
-
|
|
87
|
-
<!-- Main content area -->
|
|
88
|
-
<main id="appmain"></main>
|
|
89
|
-
|
|
90
|
-
<!-- Footer -->
|
|
91
|
-
<footer id="appfooter">
|
|
92
|
-
<div id="appfooter-content"></div>
|
|
93
|
-
<div id="appfooter-legal"></div>
|
|
94
|
-
</footer>
|
|
95
|
-
</div>
|
|
96
|
-
|
|
97
|
-
<!-- Modal overlay -->
|
|
98
|
-
<div id="appmodal" aria-hidden="true" role="dialog">
|
|
99
|
-
<div id="appmodal-backdrop"></div>
|
|
100
|
-
<div id="appmodal-container">
|
|
101
|
-
<button id="appmodal-close" aria-label="Close modal">×</button>
|
|
102
|
-
<header id="appmodal-header"></header>
|
|
103
|
-
<div id="appmodal-content"></div>
|
|
104
|
-
<footer id="appmodal-footer"></footer>
|
|
105
|
-
</div>
|
|
106
|
-
</div>`;
|
|
107
|
-
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|