baraqex 1.0.20 → 1.0.22

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 ADDED
@@ -0,0 +1,523 @@
1
+ #!/usr/bin/env node
2
+
3
+ import { Command } from 'commander';
4
+ import inquirer from 'inquirer';
5
+ import chalk from 'chalk';
6
+ import gradient from 'gradient-string';
7
+ import { createSpinner } from 'nanospinner';
8
+ import path from 'path';
9
+ import fs from 'fs-extra';
10
+ import { fileURLToPath } from 'url';
11
+ import { exec } from 'child_process';
12
+ import { promisify } from 'util';
13
+ import boxen from 'boxen';
14
+ import terminalLink from 'terminal-link';
15
+ import updateNotifier from 'update-notifier';
16
+ import ora from 'ora';
17
+ import figlet from 'figlet';
18
+
19
+ // Convert to ESM-friendly __dirname equivalent
20
+ const __filename = fileURLToPath(import.meta.url);
21
+ const __dirname = path.dirname(__filename);
22
+ const execAsync = promisify(exec);
23
+
24
+ // Check for package updates
25
+ try {
26
+ const pkg = JSON.parse(fs.readFileSync(path.join(__dirname, '..', 'package.json'), 'utf8'));
27
+ const notifier = updateNotifier({ pkg, updateCheckInterval: 1000 * 60 * 60 * 24 });
28
+
29
+ if (notifier.update) {
30
+ const updateMessage = boxen(
31
+ `Update available: ${chalk.dim(notifier.update.current)} → ${chalk.green(notifier.update.latest)}\n` +
32
+ `Run ${chalk.cyan('npm i -g baraqex')} to update`,
33
+ {
34
+ padding: 1,
35
+ margin: 1,
36
+ borderStyle: 'round',
37
+ borderColor: 'cyan'
38
+ }
39
+ );
40
+ console.log(updateMessage);
41
+ }
42
+ } catch (error) {
43
+ // Silently continue if update check fails
44
+ }
45
+
46
+ // CLI instance
47
+ const program = new Command();
48
+
49
+ // Create beautiful ASCII art banner with gradient colors
50
+ const displayBanner = () => {
51
+ const titleText = figlet.textSync('Baraqex', {
52
+ font: 'Standard',
53
+ horizontalLayout: 'default',
54
+ verticalLayout: 'default'
55
+ });
56
+
57
+ console.log('\n' + gradient.pastel.multiline(titleText));
58
+
59
+ console.log(boxen(
60
+ `${chalk.bold('A powerful full-stack framework with WebAssembly integration')}\n\n` +
61
+ `${chalk.dim('Version:')} ${chalk.cyan(JSON.parse(fs.readFileSync(path.join(__dirname, '..', 'package.json'), 'utf8')).version)}\n` +
62
+ `${chalk.dim('Website:')} ${terminalLink('www.baraqex.tech', 'https://www.baraqex.tech')}`,
63
+ {
64
+ padding: 1,
65
+ margin: { top: 1, bottom: 1 },
66
+ borderStyle: 'round',
67
+ borderColor: 'cyan'
68
+ }
69
+ ));
70
+ };
71
+
72
+ // Version and description
73
+ program
74
+ .name('baraqex')
75
+ .description('CLI for Baraqex - A powerful full-stack JavaScript/TypeScript framework with WebAssembly integration')
76
+ .version(JSON.parse(fs.readFileSync(path.join(__dirname, '..', 'package.json'), 'utf8')).version);
77
+
78
+ // Helper for creating visually consistent sections
79
+ const createSection = (title) => {
80
+ console.log('\n' + chalk.bold.cyan(`◆ ${title}`));
81
+ console.log(chalk.cyan('─'.repeat(60)) + '\n');
82
+ };
83
+
84
+ // Helper for checking dependencies with improved feedback
85
+ async function checkDependencies() {
86
+ const spinner = ora({
87
+ text: 'Checking environment...',
88
+ spinner: 'dots',
89
+ color: 'cyan'
90
+ }).start();
91
+
92
+ try {
93
+ // Check Node version
94
+ const nodeVersionOutput = await execAsync('node --version');
95
+ const nodeVersion = nodeVersionOutput.stdout.trim().replace('v', '');
96
+ const requiredNodeVersion = '14.0.0';
97
+
98
+ if (compareVersions(nodeVersion, requiredNodeVersion) < 0) {
99
+ spinner.fail(`Node.js ${requiredNodeVersion}+ required, but found ${nodeVersion}`);
100
+ console.log(chalk.yellow(`Please upgrade Node.js: ${terminalLink('https://nodejs.org', 'https://nodejs.org')}`));
101
+ return false;
102
+ }
103
+
104
+ // Check npm version
105
+ const npmVersionOutput = await execAsync('npm --version');
106
+ const npmVersion = npmVersionOutput.stdout.trim();
107
+ const requiredNpmVersion = '6.0.0';
108
+
109
+ if (compareVersions(npmVersion, requiredNpmVersion) < 0) {
110
+ spinner.fail(`npm ${requiredNpmVersion}+ required, but found ${npmVersion}`);
111
+ console.log(chalk.yellow(`Please upgrade npm: ${chalk.cyan('npm install -g npm')}`));
112
+ return false;
113
+ }
114
+
115
+ // Check for Go (optional, for WASM features)
116
+ try {
117
+ const goVersionOutput = await execAsync('go version');
118
+ const goVersion = goVersionOutput.stdout.match(/go(\d+\.\d+\.\d+)/)?.[1] || 'unknown';
119
+ spinner.succeed(`Environment ready: Node ${chalk.green(nodeVersion)}, npm ${chalk.green(npmVersion)}, Go ${chalk.green(goVersion)}`);
120
+ } catch (error) {
121
+ spinner.succeed(`Environment ready: Node ${chalk.green(nodeVersion)}, npm ${chalk.green(npmVersion)} ${chalk.yellow('(Go not found - WebAssembly features limited)')}`);
122
+ }
123
+
124
+ return true;
125
+ } catch (error) {
126
+ spinner.fail('Environment check failed');
127
+ console.log(chalk.red('Error: Node.js and npm are required to use this tool.'));
128
+ return false;
129
+ }
130
+ }
131
+
132
+ // Compare versions helper
133
+ function compareVersions(a, b) {
134
+ const aParts = a.split('.').map(Number);
135
+ const bParts = b.split('.').map(Number);
136
+
137
+ for (let i = 0; i < Math.max(aParts.length, bParts.length); i++) {
138
+ const aVal = aParts[i] || 0;
139
+ const bVal = bParts[i] || 0;
140
+
141
+ if (aVal > bVal) return 1;
142
+ if (aVal < bVal) return -1;
143
+ }
144
+
145
+ return 0;
146
+ }
147
+
148
+ // Choose template interactively with improved visualization
149
+ async function chooseTemplate() {
150
+ const templatesPath = path.join(__dirname, '..', 'templates');
151
+
152
+ // Create templates directory if it doesn't exist
153
+ if (!fs.existsSync(templatesPath)) {
154
+ fs.mkdirSync(templatesPath, { recursive: true });
155
+ }
156
+
157
+ const templates = fs.readdirSync(templatesPath).filter(file =>
158
+ fs.statSync(path.join(templatesPath, file)).isDirectory()
159
+ );
160
+
161
+ // If no templates exist, create default ones
162
+ if (templates.length === 0) {
163
+ await createDefaultTemplates(templatesPath);
164
+ const newTemplates = fs.readdirSync(templatesPath).filter(file =>
165
+ fs.statSync(path.join(templatesPath, file)).isDirectory()
166
+ );
167
+ templates.push(...newTemplates);
168
+ }
169
+
170
+ // Emoji indicators for templates
171
+ const templateIcons = {
172
+ 'basic-app': '🚀',
173
+ 'ssr-template': '🌐',
174
+ 'fullstack-app': '⚡',
175
+ 'go-wasm-app': '🔄',
176
+ };
177
+
178
+ // Detailed descriptions
179
+ const templateDescriptions = {
180
+ 'basic-app': 'Single-page application with just the essentials. Perfect for learning the framework or building simple apps.',
181
+ 'ssr-template': 'Server-side rendered application with hydration. Optimized for SEO and fast initial load.',
182
+ 'fullstack-app': 'Complete solution with API routes, authentication, and database integration ready to go.',
183
+ 'go-wasm-app': 'WebAssembly integration with Go for high-performance computing in the browser and Node.js.'
184
+ };
185
+
186
+ console.log(boxen(
187
+ `${chalk.bold('Available Project Templates')}\n\n` +
188
+ templates.map(template => {
189
+ const icon = templateIcons[template] || '📦';
190
+ const shortDesc = {
191
+ 'basic-app': 'Simple client-side application',
192
+ 'ssr-template': 'Server-side rendering with hydration',
193
+ 'fullstack-app': 'Complete fullstack application with API',
194
+ 'go-wasm-app': 'WebAssembly integration with Go'
195
+ }[template] || 'Application template';
196
+
197
+ return `${icon} ${chalk.cyan(template)}\n ${chalk.dim(shortDesc)}`;
198
+ }).join('\n\n'),
199
+ {
200
+ padding: 1,
201
+ margin: 1,
202
+ borderStyle: 'round',
203
+ borderColor: 'cyan'
204
+ }
205
+ ));
206
+
207
+ const templateChoices = templates.map(template => ({
208
+ name: `${templateIcons[template] || '📦'} ${chalk.bold(template)}`,
209
+ value: template,
210
+ description: templateDescriptions[template] || 'An application template'
211
+ }));
212
+
213
+ const answers = await inquirer.prompt([
214
+ {
215
+ type: 'list',
216
+ name: 'template',
217
+ message: chalk.green('Select a project template:'),
218
+ choices: templateChoices,
219
+ loop: false,
220
+ pageSize: 10
221
+ },
222
+ {
223
+ type: 'confirm',
224
+ name: 'viewDetails',
225
+ message: 'Would you like to see template details before proceeding?',
226
+ default: false
227
+ }
228
+ ]);
229
+
230
+ if (answers.viewDetails) {
231
+ const detailedDescription = {
232
+ 'basic-app': [
233
+ `${chalk.bold('Basic App Template')} ${templateIcons['basic-app']}`,
234
+ '',
235
+ `${chalk.dim('A lightweight client-side application template.')}`,
236
+ '',
237
+ `${chalk.yellow('Features:')}`,
238
+ '• Modern JSX components without dependencies',
239
+ '• Built-in state management with hooks',
240
+ '• Component-based architecture',
241
+ '• Zero-config development setup',
242
+ '',
243
+ `${chalk.yellow('Best for:')}`,
244
+ '• Simple web applications',
245
+ '• Learning the framework',
246
+ '• Quick prototyping',
247
+ ],
248
+ 'ssr-template': [
249
+ `${chalk.bold('SSR Template')} ${templateIcons['ssr-template']}`,
250
+ '',
251
+ `${chalk.dim('Server-side rendering with client hydration.')}`,
252
+ '',
253
+ `${chalk.yellow('Features:')}`,
254
+ '• SEO-friendly rendered HTML',
255
+ '• Fast initial page load',
256
+ '• Smooth client-side transitions',
257
+ '• Built-in dynamic meta tag generation',
258
+ '• Express.js integration',
259
+ '',
260
+ `${chalk.yellow('Best for:')}`,
261
+ '• Production websites needing SEO',
262
+ '• Content-focused applications',
263
+ '• Sites requiring social sharing previews'
264
+ ],
265
+ 'fullstack-app': [
266
+ `${chalk.bold('Fullstack App Template')} ${templateIcons['fullstack-app']}`,
267
+ '',
268
+ `${chalk.dim('Complete solution with frontend and backend.')}`,
269
+ '',
270
+ `${chalk.yellow('Features:')}`,
271
+ '• API routes with Express integration',
272
+ '• File-based routing system',
273
+ '• Authentication system with JWT',
274
+ '• Database connectors (MongoDB, MySQL, PostgreSQL)',
275
+ '• Server-side rendering with hydration',
276
+ '• WebSocket support',
277
+ '',
278
+ `${chalk.yellow('Best for:')}`,
279
+ '• Full production applications',
280
+ '• Apps needing authentication',
281
+ '• Projects requiring database integration'
282
+ ],
283
+ 'go-wasm-app': [
284
+ `${chalk.bold('Go WASM App Template')} ${templateIcons['go-wasm-app'] || '🔄'}`,
285
+ '',
286
+ `${chalk.dim('WebAssembly integration with Go programming language.')}`,
287
+ '',
288
+ `${chalk.yellow('Features:')}`,
289
+ '• Go + WebAssembly integration',
290
+ '• High-performance computation in browser',
291
+ '• Server-side WASM processing',
292
+ '• Shared code between Go and JavaScript',
293
+ '• Optimized build pipeline',
294
+ '',
295
+ `${chalk.yellow('Best for:')}`,
296
+ '• Computation-heavy applications',
297
+ '• Projects requiring Go libraries',
298
+ '• Performance-critical features'
299
+ ]
300
+ }[answers.template] || ['No detailed information available for this template'];
301
+
302
+ console.log(boxen(detailedDescription.join('\n'), {
303
+ padding: 1,
304
+ margin: 1,
305
+ title: answers.template,
306
+ titleAlignment: 'center',
307
+ borderStyle: 'round',
308
+ borderColor: 'yellow'
309
+ }));
310
+
311
+ const proceed = await inquirer.prompt([{
312
+ type: 'confirm',
313
+ name: 'continue',
314
+ message: 'Continue with this template?',
315
+ default: true
316
+ }]);
317
+
318
+ if (!proceed.continue) {
319
+ return chooseTemplate();
320
+ }
321
+ }
322
+
323
+ return answers.template;
324
+ }
325
+
326
+ // Create default templates if they don't exist
327
+ async function createDefaultTemplates(templatesPath) {
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');
331
+ }
332
+
333
+ // Create a new project with enhanced visuals and status updates
334
+ async function createProject(projectName, options) {
335
+ displayBanner();
336
+ createSection('Project Setup');
337
+
338
+ if (!projectName) {
339
+ const answers = await inquirer.prompt([
340
+ {
341
+ type: 'input',
342
+ name: 'projectName',
343
+ message: chalk.green('What is your project name?'),
344
+ default: 'my-baraqex-app',
345
+ validate: input =>
346
+ /^[a-z0-9-_]+$/.test(input)
347
+ ? true
348
+ : 'Project name can only contain lowercase letters, numbers, hyphens, and underscores'
349
+ }
350
+ ]);
351
+ projectName = answers.projectName;
352
+ }
353
+
354
+ if (!await checkDependencies()) return;
355
+
356
+ let template = options.template || await chooseTemplate();
357
+
358
+ const targetDir = path.resolve(projectName);
359
+ const templateDir = path.join(__dirname, '..', 'templates', template);
360
+
361
+ if (fs.existsSync(targetDir)) {
362
+ const answers = await inquirer.prompt([
363
+ {
364
+ type: 'confirm',
365
+ name: 'overwrite',
366
+ message: chalk.yellow(`Directory ${projectName} already exists. Overwrite?`),
367
+ default: false
368
+ }
369
+ ]);
370
+ if (!answers.overwrite) {
371
+ console.log(chalk.red('✖ Operation cancelled'));
372
+ return;
373
+ }
374
+ }
375
+
376
+ // Multi-step execution with progress reporting
377
+ console.log(chalk.dim('\nCreating your new Baraqex project...'));
378
+
379
+ // Step 1: Create directory
380
+ const step1 = ora({text: 'Creating project directory', color: 'cyan'}).start();
381
+ try {
382
+ await fs.ensureDir(targetDir);
383
+ step1.succeed();
384
+ } catch (error) {
385
+ step1.fail();
386
+ console.error(chalk.red(`Error creating directory: ${error.message}`));
387
+ return;
388
+ }
389
+
390
+ // Step 2: Copy template files
391
+ const step2 = ora({text: 'Copying template files', color: 'cyan'}).start();
392
+ try {
393
+ await fs.copy(templateDir, targetDir, { overwrite: true });
394
+ step2.succeed();
395
+ } catch (error) {
396
+ step2.fail();
397
+ console.error(chalk.red(`Error copying files: ${error.message}`));
398
+ return;
399
+ }
400
+
401
+ // Step 3: Update package.json
402
+ const step3 = ora({text: 'Configuring package.json', color: 'cyan'}).start();
403
+ try {
404
+ const pkgJsonPath = path.join(targetDir, 'package.json');
405
+ if (fs.existsSync(pkgJsonPath)) {
406
+ const pkgJson = await fs.readJson(pkgJsonPath);
407
+ pkgJson.name = projectName;
408
+ await fs.writeJson(pkgJsonPath, pkgJson, { spaces: 2 });
409
+ step3.succeed();
410
+ } else {
411
+ step3.warn('No package.json found in template');
412
+ }
413
+ } catch (error) {
414
+ step3.fail();
415
+ console.error(chalk.red(`Error updating package.json: ${error.message}`));
416
+ return;
417
+ }
418
+
419
+ // Final success message with helpful instructions
420
+ console.log('\n' + boxen(
421
+ `${chalk.bold.green('Project created successfully!')}\n\n` +
422
+ `${chalk.bold('Project:')} ${chalk.cyan(projectName)}\n` +
423
+ `${chalk.bold('Template:')} ${chalk.cyan(template)}\n` +
424
+ `${chalk.bold('Location:')} ${chalk.cyan(targetDir)}\n\n` +
425
+ `${chalk.bold.yellow('Next steps:')}\n\n` +
426
+ ` ${chalk.dim('1.')} ${chalk.cyan(`cd ${projectName}`)}\n` +
427
+ ` ${chalk.dim('2.')} ${chalk.cyan('npm install')}\n` +
428
+ ` ${chalk.dim('3.')} ${chalk.cyan('npm run dev')}\n\n` +
429
+ `${chalk.dim('For help and documentation:')} ${terminalLink('www.baraqex.tech', 'https://www.baraqex.tech')}`,
430
+ {
431
+ padding: 1,
432
+ margin: 1,
433
+ borderStyle: 'round',
434
+ borderColor: 'green'
435
+ }
436
+ ));
437
+
438
+ // Suggest next command
439
+ console.log(`\n${chalk.cyan('Tip:')} Run ${chalk.bold.green(`cd ${projectName} && npm install`)} to get started right away.\n`);
440
+ }
441
+
442
+ // ...existing code... (add:component, dev:tools, and all other functions remain the same but update references)
443
+
444
+ // Dashboard when no commands are specified
445
+ function showDashboard() {
446
+ displayBanner();
447
+
448
+ const commands = [
449
+ { name: 'create', description: 'Create a new project', command: 'baraqex create my-app' },
450
+ { name: 'add:component', description: 'Add a new UI component', command: 'baraqex add:component Button' },
451
+ { name: 'add:page', description: 'Create a new page', command: 'baraqex add:page home' },
452
+ { name: 'add:api', description: 'Create a new API endpoint', command: 'baraqex add:api users' },
453
+ { name: 'dev:tools', description: 'Show development tools', command: 'baraqex dev:tools' },
454
+ { name: 'test:server', description: 'Test server functions', command: 'baraqex test:server' }
455
+ ];
456
+
457
+ console.log(boxen(
458
+ `${chalk.bold.cyan('Welcome to Baraqex CLI!')}\n\n` +
459
+ `Select a command to get started or run ${chalk.yellow('baraqex <command> --help')} for more info.\n`,
460
+ {
461
+ padding: 1,
462
+ margin: { top: 1, bottom: 1 },
463
+ borderStyle: 'round',
464
+ borderColor: 'cyan'
465
+ }
466
+ ));
467
+
468
+ console.log(`${chalk.bold.cyan('Available Commands:')}\n`);
469
+ commands.forEach((cmd, i) => {
470
+ console.log(` ${chalk.green((i+1) + '.')} ${chalk.bold(cmd.name.padEnd(15))} ${chalk.dim(cmd.description)}`);
471
+ console.log(` ${chalk.yellow(cmd.command)}\n`);
472
+ });
473
+
474
+ console.log(boxen(
475
+ `${chalk.bold('Quick Start:')} ${chalk.yellow('baraqex create my-app')}\n` +
476
+ `${chalk.dim('More info:')} ${terminalLink('www.baraqex.tech', 'https://www.baraqex.tech')}`,
477
+ {
478
+ padding: 0.5,
479
+ margin: { top: 1 },
480
+ borderStyle: 'round',
481
+ borderColor: 'blue'
482
+ }
483
+ ));
484
+ }
485
+
486
+ // Register commands with improved descriptions
487
+ program
488
+ .command('create [name]')
489
+ .description('Create a new Baraqex project')
490
+ .option('-t, --template <template>', 'Specify template (basic-app, ssr-template, fullstack-app, go-wasm-app)')
491
+ .action(createProject);
492
+
493
+ program
494
+ .command('test:server')
495
+ .description('Run server function tests')
496
+ .action(async () => {
497
+ displayBanner();
498
+ createSection('Server Function Testing');
499
+
500
+ const spinner = ora('Running server tests...').start();
501
+
502
+ try {
503
+ // Import and run the test-server.js file
504
+ const { runAllTests } = await import('../test-server.js');
505
+ const success = await runAllTests();
506
+
507
+ if (success) {
508
+ spinner.succeed('All server tests passed!');
509
+ } else {
510
+ spinner.fail('Some server tests failed');
511
+ }
512
+ } catch (error) {
513
+ spinner.fail('Failed to run server tests');
514
+ console.error(chalk.red(`Error: ${error.message}`));
515
+ }
516
+ });
517
+
518
+ // Default command when no arguments
519
+ if (process.argv.length <= 2) {
520
+ showDashboard();
521
+ } else {
522
+ program.parse(process.argv);
523
+ }
package/dist/index.d.ts CHANGED
@@ -6,4 +6,5 @@ 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';
9
10
  //# sourceMappingURL=index.d.ts.map
@@ -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,CAAA"}
package/dist/index.js CHANGED
@@ -10,5 +10,6 @@ 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';
13
14
  console.log('Baraqex - powered by Frontend Hamroun Framework with additional utilities');
14
15
  //# 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,aAA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AAG,CAAC,2EAA2E,CAAC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"api-router.d.ts","sourceRoot":"","sources":["../../src/server/api-router.ts"],"names":[],"mappings":"AAAA,OAAgB,EAAE,MAAM,EAAmC,MAAM,SAAS,CAAC;AAG3E,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAkBxC,qBAAa,SAAS;IACb,MAAM,EAAE,MAAM,CAAC;IACtB,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,IAAI,CAAqB;gBAErB,MAAM,EAAE,MAAM,EAAE,IAAI,GAAE,WAAW,GAAG,IAAW;IAQ3D,OAAO,CAAC,WAAW;IASnB,OAAO,CAAC,aAAa;IAiBrB,OAAO,CAAC,WAAW;IAMnB,OAAO,CAAC,YAAY;YAiBN,aAAa;IAgC3B,OAAO,CAAC,kBAAkB;IAQ1B,OAAO,CAAC,WAAW;CASpB"}
1
+ {"version":3,"file":"api-router.d.ts","sourceRoot":"","sources":["../../src/server/api-router.ts"],"names":[],"mappings":"AAAA,OAAgB,EAAE,MAAM,EAAmC,MAAM,SAAS,CAAC;AAG3E,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAmBxC,qBAAa,SAAS;IACb,MAAM,EAAE,MAAM,CAAC;IACtB,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,IAAI,CAAqB;gBAErB,MAAM,EAAE,MAAM,EAAE,IAAI,GAAE,WAAW,GAAG,IAAW;IAQ3D,OAAO,CAAC,WAAW;IASnB,OAAO,CAAC,aAAa;IAiBrB,OAAO,CAAC,WAAW;IAMnB,OAAO,CAAC,YAAY;YAiBN,aAAa;IAuE3B,OAAO,CAAC,kBAAkB;IAQ1B,OAAO,CAAC,WAAW;CASpB"}
@@ -1,6 +1,7 @@
1
1
  import express from 'express';
2
2
  import path from 'path';
3
3
  import fs from 'fs';
4
+ import { pathToFileURL } from 'url';
4
5
  export class ApiRouter {
5
6
  constructor(apiDir, auth = null) {
6
7
  this.router = express.Router();
@@ -50,21 +51,48 @@ export class ApiRouter {
50
51
  }
51
52
  async registerRoute(filePath, routePath) {
52
53
  try {
53
- // Dynamic import the route file
54
- const routeModule = await import(filePath);
55
- if (!this.isValidRouteModule(routeModule)) {
56
- console.warn(`Invalid route module: ${filePath}`);
57
- return;
54
+ // Ensure we have an absolute path and normalize it
55
+ const absolutePath = path.isAbsolute(filePath) ? filePath : path.resolve(filePath);
56
+ // Convert to proper file:// URL for Windows
57
+ const fileUrl = pathToFileURL(absolutePath).href;
58
+ if (process.platform === 'win32') {
59
+ // Add timestamp to force reload on Windows
60
+ const urlWithTimestamp = `${fileUrl}?t=${Date.now()}`;
61
+ // Dynamic import the route file
62
+ const routeModule = await import(urlWithTimestamp);
63
+ if (!this.isValidRouteModule(routeModule)) {
64
+ console.warn(`Invalid route module: ${filePath}`);
65
+ return;
66
+ }
67
+ console.log(`Registering API route: ${routePath}`);
68
+ // Register middleware if any
69
+ const middleware = routeModule.middleware || [];
70
+ // Register HTTP methods
71
+ for (const method of ['get', 'post', 'put', 'delete', 'patch', 'options']) {
72
+ const handler = routeModule[method];
73
+ if (typeof handler === 'function') {
74
+ const routerMethod = this.router[method];
75
+ routerMethod.call(this.router, routePath, ...middleware, this.wrapHandler(handler));
76
+ }
77
+ }
58
78
  }
59
- console.log(`Registering API route: ${routePath}`);
60
- // Register middleware if any
61
- const middleware = routeModule.middleware || [];
62
- // Register HTTP methods
63
- for (const method of ['get', 'post', 'put', 'delete', 'patch', 'options']) {
64
- const handler = routeModule[method];
65
- if (typeof handler === 'function') {
66
- const routerMethod = this.router[method];
67
- routerMethod(routePath, ...middleware, this.wrapHandler(handler));
79
+ else {
80
+ // Non-Windows platforms
81
+ const routeModule = await import(fileUrl);
82
+ if (!this.isValidRouteModule(routeModule)) {
83
+ console.warn(`Invalid route module: ${filePath}`);
84
+ return;
85
+ }
86
+ console.log(`Registering API route: ${routePath}`);
87
+ // Register middleware if any
88
+ const middleware = routeModule.middleware || [];
89
+ // Register HTTP methods
90
+ for (const method of ['get', 'post', 'put', 'delete', 'patch', 'options']) {
91
+ const handler = routeModule[method];
92
+ if (typeof handler === 'function') {
93
+ const routerMethod = this.router[method];
94
+ routerMethod.call(this.router, routePath, ...middleware, this.wrapHandler(handler));
95
+ }
68
96
  }
69
97
  }
70
98
  }
@@ -1 +1 @@
1
- {"version":3,"file":"api-router.js","sourceRoot":"","sources":["../../src/server/api-router.ts"],"names":[],"mappings":"AAAA,OAAO,OAAoD,MAAM,SAAS,CAAC;AAC3E,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,MAAM,IAAI,CAAC;AAmBpB,MAAM,OAAO,SAAS;IAKpB,YAAY,MAAc,EAAE,OAA2B,IAAI;QACzD,IAAI,CAAC,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;QAC/B,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,MAAM,CAAC,CAAC;QAClD,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QAEjB,IAAI,CAAC,WAAW,EAAE,CAAC;IACrB,CAAC;IAEO,WAAW;QACjB,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC;YAChC,OAAO,CAAC,GAAG,CAAC,4BAA4B,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC;YACvD,OAAO;QACT,CAAC;QAED,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;IACtC,CAAC;IAEO,aAAa,CAAC,OAAe,EAAE,WAAmB;QACxD,MAAM,OAAO,GAAG,EAAE,CAAC,WAAW,CAAC,OAAO,EAAE,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC,CAAC;QAEjE,KAAK,MAAM,KAAK,IAAI,OAAO,EAAE,CAAC;YAC5B,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC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,CAAC;IAEO,kBAAkB,CAAC,MAAW;QACpC,IAAI,CAAC,MAAM;YAAE,OAAO,KAAK,CAAC;QAE1B,uDAAuD;QACvD,OAAO,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,SAAS,CAAC;aACxD,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,OAAO,MAAM,CAAC,MAAM,CAAC,KAAK,UAAU,CAAC,CAAC;IAC1D,CAAC;IAEO,WAAW,CAAC,OAAqB;QACvC,OAAO,KAAK,EAAE,GAAY,EAAE,GAAa,EAAE,IAAkB,EAAE,EAAE;YAC/D,IAAI,CAAC;gBACH,MAAM,OAAO,CAAC,GAAG,EAAE,GAAG,EAAE,IAAI,CAAC,CAAC;YAChC,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,IAAI,CAAC,KAAK,CAAC,CAAC;YACd,CAAC;QACH,CAAC,CAAC;IACJ,CAAC;CACF"}
@@ -8,7 +8,7 @@ import { ApiRouter } from './api-router.js';
8
8
  import { rateLimit } from './middleware.js';
9
9
  import * as utils from './utils.js';
10
10
  import * as templates from './templates.js';
11
- import { loadGoWasmFromFile } from './wasm.js';
11
+ import { loadGoWasmFromFile, callWasmFunction, isWasmReady, getWasmFunctions } from './wasm.js';
12
12
  export interface ServerConfig {
13
13
  port?: number;
14
14
  apiDir?: string;
@@ -77,7 +77,7 @@ export declare const renderComponent: (Component: any, props?: any) => Promise<{
77
77
  success: boolean;
78
78
  error: unknown;
79
79
  }>;
80
- export { initNodeWasm, loadGoWasmFromFile } from './wasm.js';
80
+ export { initNodeWasm, loadGoWasmFromFile, callWasmFunction, isWasmReady, getWasmFunctions } from './wasm.js';
81
81
  export * from './utils.js';
82
82
  export * from './templates.js';
83
83
  export { Database } from './database.js';
@@ -95,6 +95,9 @@ declare const _default: {
95
95
  errorHandler: (err: Error, req: Request, res: Response, next: NextFunction) => void;
96
96
  notFoundHandler: (req: Request, res: Response) => void;
97
97
  loadGoWasmFromFile: typeof loadGoWasmFromFile;
98
+ callWasmFunction: typeof callWasmFunction;
99
+ isWasmReady: typeof isWasmReady;
100
+ getWasmFunctions: typeof getWasmFunctions;
98
101
  templates: typeof templates;
99
102
  utils: typeof utils;
100
103
  renderComponent: (Component: any, props?: any) => Promise<{