baraqex 1.0.21 → 1.0.23
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/bin/baraqex.js +3 -92
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -1
- package/package.json +15 -1
package/bin/baraqex.js
CHANGED
|
@@ -325,98 +325,9 @@ async function chooseTemplate() {
|
|
|
325
325
|
|
|
326
326
|
// Create default templates if they don't exist
|
|
327
327
|
async function createDefaultTemplates(templatesPath) {
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
name: 'baraqex-basic-app',
|
|
332
|
-
version: '1.0.0',
|
|
333
|
-
scripts: {
|
|
334
|
-
dev: 'baraqex dev',
|
|
335
|
-
build: 'baraqex build',
|
|
336
|
-
start: 'baraqex start'
|
|
337
|
-
},
|
|
338
|
-
dependencies: {
|
|
339
|
-
baraqex: '^1.0.0'
|
|
340
|
-
}
|
|
341
|
-
},
|
|
342
|
-
'src/App.jsx': `import { jsx, useState } from 'baraqex';
|
|
343
|
-
|
|
344
|
-
export default function App() {
|
|
345
|
-
const [count, setCount] = useState(0);
|
|
346
|
-
|
|
347
|
-
return (
|
|
348
|
-
<div>
|
|
349
|
-
<h1>Welcome to Baraqex!</h1>
|
|
350
|
-
<p>Count: {count}</p>
|
|
351
|
-
<button onClick={() => setCount(count + 1)}>
|
|
352
|
-
Increment
|
|
353
|
-
</button>
|
|
354
|
-
</div>
|
|
355
|
-
);
|
|
356
|
-
}`,
|
|
357
|
-
'public/index.html': `<!DOCTYPE html>
|
|
358
|
-
<html lang="en">
|
|
359
|
-
<head>
|
|
360
|
-
<meta charset="UTF-8">
|
|
361
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
362
|
-
<title>Baraqex App</title>
|
|
363
|
-
</head>
|
|
364
|
-
<body>
|
|
365
|
-
<div id="root"></div>
|
|
366
|
-
<script src="/src/App.jsx" type="module"></script>
|
|
367
|
-
</body>
|
|
368
|
-
</html>`
|
|
369
|
-
},
|
|
370
|
-
'fullstack-app': {
|
|
371
|
-
'package.json': {
|
|
372
|
-
name: 'baraqex-fullstack-app',
|
|
373
|
-
version: '1.0.0',
|
|
374
|
-
scripts: {
|
|
375
|
-
dev: 'baraqex dev',
|
|
376
|
-
build: 'baraqex build',
|
|
377
|
-
start: 'baraqex start',
|
|
378
|
-
test: 'baraqex test'
|
|
379
|
-
},
|
|
380
|
-
dependencies: {
|
|
381
|
-
baraqex: '^1.0.0'
|
|
382
|
-
}
|
|
383
|
-
},
|
|
384
|
-
'src/pages/index.jsx': `import { jsx } from 'baraqex';
|
|
385
|
-
|
|
386
|
-
export default function HomePage(props) {
|
|
387
|
-
return (
|
|
388
|
-
<html>
|
|
389
|
-
<head>
|
|
390
|
-
<title>Baraqex Fullstack App</title>
|
|
391
|
-
</head>
|
|
392
|
-
<body>
|
|
393
|
-
<h1>Welcome to Baraqex!</h1>
|
|
394
|
-
<p>Server time: {props.api.serverTime}</p>
|
|
395
|
-
</body>
|
|
396
|
-
</html>
|
|
397
|
-
);
|
|
398
|
-
}`,
|
|
399
|
-
'src/api/hello.js': `export async function get(req, res) {
|
|
400
|
-
res.json({ message: 'Hello from Baraqex API!' });
|
|
401
|
-
}`
|
|
402
|
-
}
|
|
403
|
-
};
|
|
404
|
-
|
|
405
|
-
for (const [templateName, files] of Object.entries(templates)) {
|
|
406
|
-
const templatePath = path.join(templatesPath, templateName);
|
|
407
|
-
await fs.ensureDir(templatePath);
|
|
408
|
-
|
|
409
|
-
for (const [filePath, content] of Object.entries(files)) {
|
|
410
|
-
const fullPath = path.join(templatePath, filePath);
|
|
411
|
-
await fs.ensureDir(path.dirname(fullPath));
|
|
412
|
-
|
|
413
|
-
if (typeof content === 'object') {
|
|
414
|
-
await fs.writeJson(fullPath, content, { spaces: 2 });
|
|
415
|
-
} else {
|
|
416
|
-
await fs.writeFile(fullPath, content);
|
|
417
|
-
}
|
|
418
|
-
}
|
|
419
|
-
}
|
|
328
|
+
// Templates are now created as actual directories and files
|
|
329
|
+
// This function can be simplified since templates exist
|
|
330
|
+
console.log('Templates already exist in the templates directory');
|
|
420
331
|
}
|
|
421
332
|
|
|
422
333
|
// Create a new project with enhanced visuals and status updates
|
package/dist/index.d.ts
CHANGED
|
@@ -6,4 +6,6 @@ export { renderToString as baraqexRenderToString, hydrate as baraqexHydrate } fr
|
|
|
6
6
|
export { requestLogger, errorHandler, notFoundHandler, rateLimit } from './server/middleware.js';
|
|
7
7
|
export { loadGoWasm, callWasmFunction, isWasmReady, getWasmFunctions, useGoWasm } from './wasm.js';
|
|
8
8
|
export type { GoWasmOptions, GoWasmInstance } from './wasm.js';
|
|
9
|
+
export { Server as BaraqexServer } from './server/index.js';
|
|
10
|
+
export { createDevServer, createServer, createProductionServer } from './server/index.js';
|
|
9
11
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,cAAc,kBAAkB,CAAC;AAKjC,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AACjG,OAAO,EACL,aAAa,EACb,aAAa,EACb,UAAU,EACV,aAAa,EACb,WAAW,EACX,SAAS,EACT,cAAc,EACd,kBAAkB,EAClB,kBAAkB,EAClB,gBAAgB,EAChB,eAAe,EACf,aAAa,EACb,YAAY,EACb,MAAM,mBAAmB,CAAC;AAG3B,YAAY,EAAE,YAAY,EAAE,IAAI,EAAE,QAAQ,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAG1F,OAAO,EAAE,cAAc,IAAI,qBAAqB,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAG1G,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAGjG,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,WAAW,EAAE,gBAAgB,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACnG,YAAY,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,cAAc,kBAAkB,CAAC;AAKjC,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AACjG,OAAO,EACL,aAAa,EACb,aAAa,EACb,UAAU,EACV,aAAa,EACb,WAAW,EACX,SAAS,EACT,cAAc,EACd,kBAAkB,EAClB,kBAAkB,EAClB,gBAAgB,EAChB,eAAe,EACf,aAAa,EACb,YAAY,EACb,MAAM,mBAAmB,CAAC;AAG3B,YAAY,EAAE,YAAY,EAAE,IAAI,EAAE,QAAQ,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAG1F,OAAO,EAAE,cAAc,IAAI,qBAAqB,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAG1G,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAGjG,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,WAAW,EAAE,gBAAgB,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACnG,YAAY,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAC/D,OAAO,EAAE,MAAM,IAAI,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAG5D,OAAO,EAAC,eAAe,EAAC,YAAY,EAAC,sBAAsB,EAAC,MAAM,mBAAmB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -10,5 +10,8 @@ export { renderToString as baraqexRenderToString, hydrate as baraqexHydrate } fr
|
|
|
10
10
|
export { requestLogger, errorHandler, notFoundHandler, rateLimit } from './server/middleware.js';
|
|
11
11
|
// Export WASM functionality (browser-only functions)
|
|
12
12
|
export { loadGoWasm, callWasmFunction, isWasmReady, getWasmFunctions, useGoWasm } from './wasm.js';
|
|
13
|
+
export { Server as BaraqexServer } from './server/index.js';
|
|
14
|
+
// Export server functionality
|
|
15
|
+
export { createDevServer, createServer, createProductionServer } from './server/index.js';
|
|
13
16
|
console.log('Baraqex - powered by Frontend Hamroun Framework with additional utilities');
|
|
14
17
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,cAAc,kBAAkB,CAAC;AAEjC,2CAA2C;AAE3C,gEAAgE;AAChE,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AACjG,OAAO,EACL,aAAa,EACb,aAAa,EACb,UAAU,EACV,aAAa,EACb,WAAW,EACX,SAAS,EACT,cAAc,EACd,kBAAkB,EAClB,kBAAkB,EAClB,gBAAgB,EAChB,eAAe,EACf,aAAa,EACb,YAAY,EACb,MAAM,mBAAmB,CAAC;AAK3B,mCAAmC;AACnC,OAAO,EAAE,cAAc,IAAI,qBAAqB,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAE1G,8BAA8B;AAC9B,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAEjG,qDAAqD;AACrD,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,WAAW,EAAE,gBAAgB,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,cAAc,kBAAkB,CAAC;AAEjC,2CAA2C;AAE3C,gEAAgE;AAChE,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AACjG,OAAO,EACL,aAAa,EACb,aAAa,EACb,UAAU,EACV,aAAa,EACb,WAAW,EACX,SAAS,EACT,cAAc,EACd,kBAAkB,EAClB,kBAAkB,EAClB,gBAAgB,EAChB,eAAe,EACf,aAAa,EACb,YAAY,EACb,MAAM,mBAAmB,CAAC;AAK3B,mCAAmC;AACnC,OAAO,EAAE,cAAc,IAAI,qBAAqB,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAE1G,8BAA8B;AAC9B,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAEjG,qDAAqD;AACrD,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,WAAW,EAAE,gBAAgB,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAEnG,OAAO,EAAE,MAAM,IAAI,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAE5D,8BAA8B;AAC9B,OAAO,EAAC,eAAe,EAAC,YAAY,EAAC,sBAAsB,EAAC,MAAM,mBAAmB,CAAC;AAEtF,OAAO,CAAC,GAAG,CAAC,2EAA2E,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "baraqex",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.23",
|
|
4
4
|
"description": "A wrapper package for frontend-hamroun framework",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -66,5 +66,19 @@
|
|
|
66
66
|
],
|
|
67
67
|
"bin": {
|
|
68
68
|
"baraqex": "./bin/baraqex.js"
|
|
69
|
+
},
|
|
70
|
+
"exports": {
|
|
71
|
+
".": {
|
|
72
|
+
"import": "./dist/index.js",
|
|
73
|
+
"require": "./dist/index.cjs"
|
|
74
|
+
},
|
|
75
|
+
"./server": {
|
|
76
|
+
"import": "./dist/server/index.js",
|
|
77
|
+
"require": "./dist/server/index.cjs"
|
|
78
|
+
},
|
|
79
|
+
"./wasm": {
|
|
80
|
+
"import": "./dist/wasm.js",
|
|
81
|
+
"require": "./dist/wasm.cjs"
|
|
82
|
+
}
|
|
69
83
|
}
|
|
70
84
|
}
|