baraqex 1.0.47 → 1.0.49
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/dist/index.js +236 -189
- package/dist/index.js.map +4 -4
- package/dist/server.js +1282 -864
- package/dist/server.js.map +4 -4
- package/package.json +1 -1
- package/templates/fullstack-template/package-lock.json +931 -4
- package/templates/fullstack-template/package.json +7 -5
- package/templates/fullstack-template/server.js +548 -15
- package/templates/fullstack-template/src/api/hello.js +9 -11
- package/templates/fullstack-template/src/pages/index.js +196 -114
- package/templates/fullstack-app/package-lock.json +0 -3683
- package/templates/fullstack-app/package.json +0 -26
- package/templates/fullstack-app/public/client.js +0 -139
- package/templates/fullstack-app/public/fullstack-styles.css +0 -445
- package/templates/fullstack-app/server.js +0 -32
- package/templates/fullstack-app/src/api/auth.js +0 -48
- package/templates/fullstack-app/src/api/users.js +0 -85
- package/templates/fullstack-app/src/pages/index.js +0 -0
- package/templates/fullstack-app/src/pages/index.jsx +0 -181
- package/templates/fullstack-app/src/pages/login.js +0 -139
- package/templates/fullstack-app/src/pages/login.jsx +0 -150
- package/templates/fullstack-template/public/client.js +0 -17
- package/templates/fullstack-template/src/api/users/index.js +0 -43
- package/templates/go-wasm-app/package.json +0 -24
- package/templates/go-wasm-app/public/wasm-styles.css +0 -184
- package/templates/go-wasm-app/server.js +0 -36
- package/templates/go-wasm-app/src/pages/index.jsx +0 -161
- package/templates/go-wasm-app/src/wasm/main.go +0 -164
package/dist/index.js
CHANGED
|
@@ -15,6 +15,100 @@ var __export = (target, all) => {
|
|
|
15
15
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
16
16
|
};
|
|
17
17
|
|
|
18
|
+
// src/wasm.ts
|
|
19
|
+
async function loadGoWasm(wasmUrl, options = {}) {
|
|
20
|
+
if (typeof window === "undefined") {
|
|
21
|
+
throw new Error("loadGoWasm() is for browser use only. Use loadGoWasmFromFile() in Node.js.");
|
|
22
|
+
}
|
|
23
|
+
try {
|
|
24
|
+
if (!window.Go) {
|
|
25
|
+
throw new Error("Go WASM runtime not available. Make sure wasm_exec.js is loaded.");
|
|
26
|
+
}
|
|
27
|
+
if (options.debug) {
|
|
28
|
+
console.log("[WASM] Loading WASM from:", wasmUrl);
|
|
29
|
+
}
|
|
30
|
+
const response = await fetch(wasmUrl);
|
|
31
|
+
if (!response.ok) {
|
|
32
|
+
throw new Error(`Failed to fetch WASM file: ${response.status}`);
|
|
33
|
+
}
|
|
34
|
+
const wasmBytes = await response.arrayBuffer();
|
|
35
|
+
const go = new window.Go();
|
|
36
|
+
const wasmModule = await WebAssembly.instantiate(wasmBytes, go.importObject);
|
|
37
|
+
go.run(wasmModule.instance);
|
|
38
|
+
await new Promise((resolve) => setTimeout(resolve, 100));
|
|
39
|
+
if (options.debug) {
|
|
40
|
+
console.log("[WASM] Go program started, checking for registered functions...");
|
|
41
|
+
}
|
|
42
|
+
const functions = {};
|
|
43
|
+
for (const key in window) {
|
|
44
|
+
if (typeof window[key] === "function" && key.startsWith("go")) {
|
|
45
|
+
functions[key] = window[key];
|
|
46
|
+
if (options.debug) {
|
|
47
|
+
console.log(`[WASM] Found function: ${key}`);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
const wasmInstance = {
|
|
52
|
+
instance: wasmModule.instance,
|
|
53
|
+
module: wasmModule,
|
|
54
|
+
exports: wasmModule.instance.exports,
|
|
55
|
+
functions
|
|
56
|
+
};
|
|
57
|
+
if (options.onLoad) {
|
|
58
|
+
options.onLoad(wasmInstance);
|
|
59
|
+
}
|
|
60
|
+
if (options.debug) {
|
|
61
|
+
console.log(`[WASM] Module loaded successfully with ${Object.keys(functions).length} functions`);
|
|
62
|
+
}
|
|
63
|
+
return wasmInstance;
|
|
64
|
+
} catch (error) {
|
|
65
|
+
console.error("[WASM] Error loading Go WASM module:", error);
|
|
66
|
+
throw error;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
function callWasmFunction(funcName, ...args) {
|
|
70
|
+
if (typeof window === "undefined") {
|
|
71
|
+
throw new Error("callWasmFunction() is for browser use only.");
|
|
72
|
+
}
|
|
73
|
+
const func = window[funcName];
|
|
74
|
+
if (typeof func !== "function") {
|
|
75
|
+
throw new Error(`Function ${funcName} not found. Make sure the WASM module is loaded.`);
|
|
76
|
+
}
|
|
77
|
+
return func(...args);
|
|
78
|
+
}
|
|
79
|
+
function isWasmReady() {
|
|
80
|
+
if (typeof window === "undefined") {
|
|
81
|
+
return false;
|
|
82
|
+
}
|
|
83
|
+
return !!(window.Go && Object.keys(window).some(
|
|
84
|
+
(key) => key.startsWith("go") && typeof window[key] === "function"
|
|
85
|
+
));
|
|
86
|
+
}
|
|
87
|
+
function getWasmFunctions() {
|
|
88
|
+
if (typeof window === "undefined") {
|
|
89
|
+
return [];
|
|
90
|
+
}
|
|
91
|
+
return Object.keys(window).filter(
|
|
92
|
+
(key) => key.startsWith("go") && typeof window[key] === "function"
|
|
93
|
+
);
|
|
94
|
+
}
|
|
95
|
+
function useGoWasm(wasmUrl, options = {}) {
|
|
96
|
+
if (typeof window === "undefined") {
|
|
97
|
+
throw new Error("useGoWasm() is for browser use only.");
|
|
98
|
+
}
|
|
99
|
+
return {
|
|
100
|
+
loadWasm: () => loadGoWasm(wasmUrl, options),
|
|
101
|
+
callFunction: callWasmFunction,
|
|
102
|
+
isReady: isWasmReady,
|
|
103
|
+
getFunctions: getWasmFunctions
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
var init_wasm = __esm({
|
|
107
|
+
"src/wasm.ts"() {
|
|
108
|
+
"use strict";
|
|
109
|
+
}
|
|
110
|
+
});
|
|
111
|
+
|
|
18
112
|
// src/server/templates.ts
|
|
19
113
|
var templates_exports = {};
|
|
20
114
|
__export(templates_exports, {
|
|
@@ -895,7 +989,7 @@ async function loadGoWasmFromFile(wasmFilePath, options = {}) {
|
|
|
895
989
|
}
|
|
896
990
|
}
|
|
897
991
|
var initialized;
|
|
898
|
-
var
|
|
992
|
+
var init_wasm2 = __esm({
|
|
899
993
|
"src/server/wasm.ts"() {
|
|
900
994
|
"use strict";
|
|
901
995
|
initialized = false;
|
|
@@ -931,7 +1025,6 @@ __export(server_exports, {
|
|
|
931
1025
|
rateLimit: () => rateLimit,
|
|
932
1026
|
readJsonFile: () => readJsonFile,
|
|
933
1027
|
renderComponent: () => renderComponent,
|
|
934
|
-
renderToString: () => renderToString,
|
|
935
1028
|
requestLogger: () => requestLogger,
|
|
936
1029
|
safeJsonParse: () => safeJsonParse,
|
|
937
1030
|
sendError: () => sendError,
|
|
@@ -942,7 +1035,7 @@ __export(server_exports, {
|
|
|
942
1035
|
});
|
|
943
1036
|
import path4 from "path";
|
|
944
1037
|
import fs4 from "fs";
|
|
945
|
-
import {
|
|
1038
|
+
import { pathToFileURL as pathToFileURL3 } from "url";
|
|
946
1039
|
function getComponentName(filePath, pagesDir) {
|
|
947
1040
|
try {
|
|
948
1041
|
const relativePath = path4.relative(pagesDir, filePath);
|
|
@@ -968,7 +1061,6 @@ function createDevServer(options = {}) {
|
|
|
968
1061
|
function createProductionServer(config) {
|
|
969
1062
|
const server = new Server({
|
|
970
1063
|
...config,
|
|
971
|
-
// Fix the PORT parsing
|
|
972
1064
|
port: config.port || (process.env.PORT ? parseInt(process.env.PORT) : 8080)
|
|
973
1065
|
});
|
|
974
1066
|
server.addShutdownHandler();
|
|
@@ -992,14 +1084,15 @@ var Server, renderComponent, server_default;
|
|
|
992
1084
|
var init_server = __esm({
|
|
993
1085
|
"src/server/index.ts"() {
|
|
994
1086
|
"use strict";
|
|
1087
|
+
init_src();
|
|
995
1088
|
init_database();
|
|
996
1089
|
init_auth();
|
|
997
1090
|
init_api_router();
|
|
998
1091
|
init_middleware();
|
|
999
1092
|
init_utils();
|
|
1000
1093
|
init_templates();
|
|
1001
|
-
|
|
1002
|
-
|
|
1094
|
+
init_wasm2();
|
|
1095
|
+
init_wasm2();
|
|
1003
1096
|
init_utils();
|
|
1004
1097
|
init_templates();
|
|
1005
1098
|
init_database();
|
|
@@ -1020,6 +1113,9 @@ var init_server = __esm({
|
|
|
1020
1113
|
enableCors: true,
|
|
1021
1114
|
...config
|
|
1022
1115
|
};
|
|
1116
|
+
this.initializeApp().catch((error) => {
|
|
1117
|
+
console.error("Failed to initialize server:", error);
|
|
1118
|
+
});
|
|
1023
1119
|
}
|
|
1024
1120
|
async initializeApp() {
|
|
1025
1121
|
if (this.initialized) {
|
|
@@ -1057,7 +1153,7 @@ var init_server = __esm({
|
|
|
1057
1153
|
this.app.use(notFoundHandler);
|
|
1058
1154
|
this.app.use(errorHandler);
|
|
1059
1155
|
this.initialized = true;
|
|
1060
|
-
console.log("
|
|
1156
|
+
console.log("\u2705 Baraqex server initialized successfully");
|
|
1061
1157
|
} catch (error) {
|
|
1062
1158
|
if (error.code === "MODULE_NOT_FOUND" && error.message.includes("express")) {
|
|
1063
1159
|
throw new Error("Express not installed. Run: npm install express @types/express");
|
|
@@ -1175,7 +1271,10 @@ var init_server = __esm({
|
|
|
1175
1271
|
};
|
|
1176
1272
|
}
|
|
1177
1273
|
try {
|
|
1178
|
-
const
|
|
1274
|
+
const absolutePath = path4.resolve(pagePath);
|
|
1275
|
+
const fileUrl = pathToFileURL3(absolutePath).href;
|
|
1276
|
+
const urlWithTimestamp = `${fileUrl}?t=${Date.now()}`;
|
|
1277
|
+
const pageModule = await import(urlWithTimestamp);
|
|
1179
1278
|
if (!pageModule || !pageModule.default) {
|
|
1180
1279
|
throw new Error(`No default export found in ${pagePath}`);
|
|
1181
1280
|
}
|
|
@@ -1246,8 +1345,8 @@ var init_server = __esm({
|
|
|
1246
1345
|
return this.auth;
|
|
1247
1346
|
}
|
|
1248
1347
|
async start() {
|
|
1249
|
-
|
|
1250
|
-
await
|
|
1348
|
+
while (!this.initialized) {
|
|
1349
|
+
await new Promise((resolve) => setTimeout(resolve, 50));
|
|
1251
1350
|
}
|
|
1252
1351
|
return new Promise((resolve, reject) => {
|
|
1253
1352
|
if (!this.app) {
|
|
@@ -1255,7 +1354,7 @@ var init_server = __esm({
|
|
|
1255
1354
|
return;
|
|
1256
1355
|
}
|
|
1257
1356
|
this.server = this.app.listen(this.config.port, () => {
|
|
1258
|
-
console.log(
|
|
1357
|
+
console.log(`\u{1F680} Server running at http://localhost:${this.config.port}`);
|
|
1259
1358
|
resolve();
|
|
1260
1359
|
});
|
|
1261
1360
|
this.server.on("error", (error) => {
|
|
@@ -1410,191 +1509,138 @@ var init_server_renderer = __esm({
|
|
|
1410
1509
|
});
|
|
1411
1510
|
|
|
1412
1511
|
// src/index.ts
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
throw new Error("Go WASM runtime not available. Make sure wasm_exec.js is loaded.");
|
|
1423
|
-
}
|
|
1424
|
-
if (options.debug) {
|
|
1425
|
-
console.log("[WASM] Loading WASM from:", wasmUrl);
|
|
1426
|
-
}
|
|
1427
|
-
const response = await fetch(wasmUrl);
|
|
1428
|
-
if (!response.ok) {
|
|
1429
|
-
throw new Error(`Failed to fetch WASM file: ${response.status}`);
|
|
1430
|
-
}
|
|
1431
|
-
const wasmBytes = await response.arrayBuffer();
|
|
1432
|
-
const go = new window.Go();
|
|
1433
|
-
const wasmModule = await WebAssembly.instantiate(wasmBytes, go.importObject);
|
|
1434
|
-
go.run(wasmModule.instance);
|
|
1435
|
-
await new Promise((resolve) => setTimeout(resolve, 100));
|
|
1436
|
-
if (options.debug) {
|
|
1437
|
-
console.log("[WASM] Go program started, checking for registered functions...");
|
|
1438
|
-
}
|
|
1439
|
-
const functions = {};
|
|
1440
|
-
for (const key in window) {
|
|
1441
|
-
if (typeof window[key] === "function" && key.startsWith("go")) {
|
|
1442
|
-
functions[key] = window[key];
|
|
1443
|
-
if (options.debug) {
|
|
1444
|
-
console.log(`[WASM] Found function: ${key}`);
|
|
1445
|
-
}
|
|
1512
|
+
function createBaraqexServer(options = {}) {
|
|
1513
|
+
return new Promise((resolve, reject) => {
|
|
1514
|
+
const checkServer = () => {
|
|
1515
|
+
if (createDevServer2 && typeof createDevServer2 === "function") {
|
|
1516
|
+
resolve(createDevServer2(options));
|
|
1517
|
+
} else if (isNode) {
|
|
1518
|
+
setTimeout(checkServer, 100);
|
|
1519
|
+
} else {
|
|
1520
|
+
reject(new Error("Server functionality not available in browser environment"));
|
|
1446
1521
|
}
|
|
1447
|
-
}
|
|
1448
|
-
const wasmInstance = {
|
|
1449
|
-
instance: wasmModule.instance,
|
|
1450
|
-
module: wasmModule,
|
|
1451
|
-
exports: wasmModule.instance.exports,
|
|
1452
|
-
functions
|
|
1453
1522
|
};
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
}
|
|
1457
|
-
if (options.debug) {
|
|
1458
|
-
console.log(`[WASM] Module loaded successfully with ${Object.keys(functions).length} functions`);
|
|
1459
|
-
}
|
|
1460
|
-
return wasmInstance;
|
|
1461
|
-
} catch (error) {
|
|
1462
|
-
console.error("[WASM] Error loading Go WASM module:", error);
|
|
1463
|
-
throw error;
|
|
1464
|
-
}
|
|
1465
|
-
}
|
|
1466
|
-
function callWasmFunction(funcName, ...args) {
|
|
1467
|
-
if (typeof window === "undefined") {
|
|
1468
|
-
throw new Error("callWasmFunction() is for browser use only.");
|
|
1469
|
-
}
|
|
1470
|
-
const func = window[funcName];
|
|
1471
|
-
if (typeof func !== "function") {
|
|
1472
|
-
throw new Error(`Function ${funcName} not found. Make sure the WASM module is loaded.`);
|
|
1473
|
-
}
|
|
1474
|
-
return func(...args);
|
|
1475
|
-
}
|
|
1476
|
-
function isWasmReady() {
|
|
1477
|
-
if (typeof window === "undefined") {
|
|
1478
|
-
return false;
|
|
1479
|
-
}
|
|
1480
|
-
return !!(window.Go && Object.keys(window).some(
|
|
1481
|
-
(key) => key.startsWith("go") && typeof window[key] === "function"
|
|
1482
|
-
));
|
|
1483
|
-
}
|
|
1484
|
-
function getWasmFunctions() {
|
|
1485
|
-
if (typeof window === "undefined") {
|
|
1486
|
-
return [];
|
|
1487
|
-
}
|
|
1488
|
-
return Object.keys(window).filter(
|
|
1489
|
-
(key) => key.startsWith("go") && typeof window[key] === "function"
|
|
1490
|
-
);
|
|
1491
|
-
}
|
|
1492
|
-
function useGoWasm(wasmUrl, options = {}) {
|
|
1493
|
-
if (typeof window === "undefined") {
|
|
1494
|
-
throw new Error("useGoWasm() is for browser use only.");
|
|
1495
|
-
}
|
|
1496
|
-
return {
|
|
1497
|
-
loadWasm: () => loadGoWasm(wasmUrl, options),
|
|
1498
|
-
callFunction: callWasmFunction,
|
|
1499
|
-
isReady: isWasmReady,
|
|
1500
|
-
getFunctions: getWasmFunctions
|
|
1501
|
-
};
|
|
1523
|
+
checkServer();
|
|
1524
|
+
});
|
|
1502
1525
|
}
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
return fallback;
|
|
1527
|
-
}
|
|
1528
|
-
};
|
|
1529
|
-
var generateToken2 = (length = 32) => {
|
|
1530
|
-
const array = new Uint8Array(length);
|
|
1531
|
-
if (typeof crypto !== "undefined" && crypto.getRandomValues) {
|
|
1532
|
-
crypto.getRandomValues(array);
|
|
1533
|
-
} else {
|
|
1534
|
-
for (let i = 0; i < array.length; i++) {
|
|
1535
|
-
array[i] = Math.floor(Math.random() * 256);
|
|
1536
|
-
}
|
|
1537
|
-
}
|
|
1538
|
-
return Array.from(array, (byte) => byte.toString(16).padStart(2, "0")).join("");
|
|
1539
|
-
};
|
|
1540
|
-
var hashString2 = null;
|
|
1541
|
-
var getPagination2 = null;
|
|
1542
|
-
var sendSuccess2 = null;
|
|
1543
|
-
var sendError2 = null;
|
|
1544
|
-
var validateFields2 = null;
|
|
1545
|
-
var validateFileUpload2 = null;
|
|
1546
|
-
var getEnvironmentInfo2 = null;
|
|
1547
|
-
var isDirectoryEmpty2 = null;
|
|
1548
|
-
var ensureDirectory2 = null;
|
|
1549
|
-
var writeJsonFile2 = null;
|
|
1550
|
-
var readJsonFile2 = null;
|
|
1551
|
-
var baraqexRenderToString = null;
|
|
1552
|
-
if (isNode && !isBrowser) {
|
|
1553
|
-
Promise.resolve().then(async () => {
|
|
1554
|
-
try {
|
|
1526
|
+
var isNode, isBrowser, BaraqexServer, createServer2, createDevServer2, createProductionServer2, renderComponent2, Database2, AuthService2, ApiRouter2, requestLogger2, errorHandler2, notFoundHandler2, rateLimit2, initNodeWasm3, loadGoWasmFromFile2, safeJsonParse2, generateToken2, hashString2, getPagination2, sendSuccess2, sendError2, validateFields2, validateFileUpload2, getEnvironmentInfo2, isDirectoryEmpty2, ensureDirectory2, writeJsonFile2, readJsonFile2, baraqexRenderToString;
|
|
1527
|
+
var init_src = __esm({
|
|
1528
|
+
"src/index.ts"() {
|
|
1529
|
+
init_wasm();
|
|
1530
|
+
init_templates();
|
|
1531
|
+
export * from "frontend-hamroun";
|
|
1532
|
+
isNode = typeof process !== "undefined" && process.versions?.node;
|
|
1533
|
+
isBrowser = typeof window !== "undefined";
|
|
1534
|
+
BaraqexServer = null;
|
|
1535
|
+
createServer2 = null;
|
|
1536
|
+
createDevServer2 = null;
|
|
1537
|
+
createProductionServer2 = null;
|
|
1538
|
+
renderComponent2 = null;
|
|
1539
|
+
Database2 = null;
|
|
1540
|
+
AuthService2 = null;
|
|
1541
|
+
ApiRouter2 = null;
|
|
1542
|
+
requestLogger2 = null;
|
|
1543
|
+
errorHandler2 = null;
|
|
1544
|
+
notFoundHandler2 = null;
|
|
1545
|
+
rateLimit2 = null;
|
|
1546
|
+
initNodeWasm3 = null;
|
|
1547
|
+
loadGoWasmFromFile2 = null;
|
|
1548
|
+
safeJsonParse2 = (json, fallback) => {
|
|
1555
1549
|
try {
|
|
1556
|
-
|
|
1550
|
+
return JSON.parse(json);
|
|
1557
1551
|
} catch {
|
|
1558
|
-
|
|
1559
|
-
return;
|
|
1552
|
+
return fallback;
|
|
1560
1553
|
}
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
|
|
1554
|
+
};
|
|
1555
|
+
generateToken2 = (length = 32) => {
|
|
1556
|
+
const array = new Uint8Array(length);
|
|
1557
|
+
if (typeof crypto !== "undefined" && crypto.getRandomValues) {
|
|
1558
|
+
crypto.getRandomValues(array);
|
|
1559
|
+
} else {
|
|
1560
|
+
for (let i = 0; i < array.length; i++) {
|
|
1561
|
+
array[i] = Math.floor(Math.random() * 256);
|
|
1562
|
+
}
|
|
1563
|
+
}
|
|
1564
|
+
return Array.from(array, (byte) => byte.toString(16).padStart(2, "0")).join("");
|
|
1565
|
+
};
|
|
1566
|
+
hashString2 = null;
|
|
1567
|
+
getPagination2 = null;
|
|
1568
|
+
sendSuccess2 = null;
|
|
1569
|
+
sendError2 = null;
|
|
1570
|
+
validateFields2 = null;
|
|
1571
|
+
validateFileUpload2 = null;
|
|
1572
|
+
getEnvironmentInfo2 = null;
|
|
1573
|
+
isDirectoryEmpty2 = null;
|
|
1574
|
+
ensureDirectory2 = null;
|
|
1575
|
+
writeJsonFile2 = null;
|
|
1576
|
+
readJsonFile2 = null;
|
|
1577
|
+
baraqexRenderToString = null;
|
|
1578
|
+
if (isNode && !isBrowser) {
|
|
1579
|
+
Promise.resolve().then(async () => {
|
|
1580
|
+
try {
|
|
1581
|
+
try {
|
|
1582
|
+
await import("express");
|
|
1583
|
+
} catch {
|
|
1584
|
+
console.warn("Express not available - server functionality disabled");
|
|
1585
|
+
return;
|
|
1586
|
+
}
|
|
1587
|
+
const serverModule = await Promise.resolve().then(() => (init_server(), server_exports));
|
|
1588
|
+
Object.assign(exports, {
|
|
1589
|
+
BaraqexServer: serverModule.Server,
|
|
1590
|
+
createServer: serverModule.createServer,
|
|
1591
|
+
createDevServer: serverModule.createDevServer,
|
|
1592
|
+
createProductionServer: serverModule.createProductionServer,
|
|
1593
|
+
renderComponent: serverModule.renderComponent,
|
|
1594
|
+
Database: serverModule.Database,
|
|
1595
|
+
AuthService: serverModule.AuthService,
|
|
1596
|
+
ApiRouter: serverModule.ApiRouter,
|
|
1597
|
+
requestLogger: serverModule.requestLogger,
|
|
1598
|
+
errorHandler: serverModule.errorHandler,
|
|
1599
|
+
notFoundHandler: serverModule.notFoundHandler,
|
|
1600
|
+
rateLimit: serverModule.rateLimit,
|
|
1601
|
+
initNodeWasm: serverModule.initNodeWasm,
|
|
1602
|
+
loadGoWasmFromFile: serverModule.loadGoWasmFromFile
|
|
1603
|
+
});
|
|
1604
|
+
BaraqexServer = serverModule.Server;
|
|
1605
|
+
createServer2 = serverModule.createServer;
|
|
1606
|
+
createDevServer2 = serverModule.createDevServer;
|
|
1607
|
+
createProductionServer2 = serverModule.createProductionServer;
|
|
1608
|
+
renderComponent2 = serverModule.renderComponent;
|
|
1609
|
+
Database2 = serverModule.Database;
|
|
1610
|
+
AuthService2 = serverModule.AuthService;
|
|
1611
|
+
ApiRouter2 = serverModule.ApiRouter;
|
|
1612
|
+
requestLogger2 = serverModule.requestLogger;
|
|
1613
|
+
errorHandler2 = serverModule.errorHandler;
|
|
1614
|
+
notFoundHandler2 = serverModule.notFoundHandler;
|
|
1615
|
+
rateLimit2 = serverModule.rateLimit;
|
|
1616
|
+
initNodeWasm3 = serverModule.initNodeWasm;
|
|
1617
|
+
loadGoWasmFromFile2 = serverModule.loadGoWasmFromFile;
|
|
1618
|
+
const utilsModule = await Promise.resolve().then(() => (init_utils(), utils_exports));
|
|
1619
|
+
safeJsonParse2 = utilsModule.safeJsonParse;
|
|
1620
|
+
generateToken2 = utilsModule.generateToken;
|
|
1621
|
+
hashString2 = utilsModule.hashString;
|
|
1622
|
+
getPagination2 = utilsModule.getPagination;
|
|
1623
|
+
sendSuccess2 = utilsModule.sendSuccess;
|
|
1624
|
+
sendError2 = utilsModule.sendError;
|
|
1625
|
+
validateFields2 = utilsModule.validateFields;
|
|
1626
|
+
validateFileUpload2 = utilsModule.validateFileUpload;
|
|
1627
|
+
getEnvironmentInfo2 = utilsModule.getEnvironmentInfo;
|
|
1628
|
+
isDirectoryEmpty2 = utilsModule.isDirectoryEmpty;
|
|
1629
|
+
ensureDirectory2 = utilsModule.ensureDirectory;
|
|
1630
|
+
writeJsonFile2 = utilsModule.writeJsonFile;
|
|
1631
|
+
readJsonFile2 = utilsModule.readJsonFile;
|
|
1632
|
+
const rendererModule = await Promise.resolve().then(() => (init_server_renderer(), server_renderer_exports));
|
|
1633
|
+
baraqexRenderToString = rendererModule.renderToString;
|
|
1634
|
+
console.log("\u2705 Baraqex server modules loaded successfully");
|
|
1635
|
+
} catch (error) {
|
|
1636
|
+
console.warn("Server modules not available:", error.message);
|
|
1637
|
+
}
|
|
1638
|
+
});
|
|
1594
1639
|
}
|
|
1595
|
-
|
|
1596
|
-
}
|
|
1597
|
-
|
|
1640
|
+
console.log("Baraqex - powered by Frontend Hamroun Framework with additional utilities");
|
|
1641
|
+
}
|
|
1642
|
+
});
|
|
1643
|
+
init_src();
|
|
1598
1644
|
export {
|
|
1599
1645
|
ApiRouter2 as ApiRouter,
|
|
1600
1646
|
AuthService2 as AuthService,
|
|
@@ -1602,6 +1648,7 @@ export {
|
|
|
1602
1648
|
Database2 as Database,
|
|
1603
1649
|
baraqexRenderToString,
|
|
1604
1650
|
callWasmFunction,
|
|
1651
|
+
createBaraqexServer,
|
|
1605
1652
|
createDevServer2 as createDevServer,
|
|
1606
1653
|
createProductionServer2 as createProductionServer,
|
|
1607
1654
|
createServer2 as createServer,
|