@zap-js/client 0.0.4 → 0.0.5

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.
@@ -14,6 +14,7 @@ interface RouteTree {
14
14
  name: string;
15
15
  index: number;
16
16
  catchAll: boolean;
17
+ optional: boolean;
17
18
  }>;
18
19
  isIndex: boolean;
19
20
  }>;
@@ -26,10 +27,22 @@ interface RouteTree {
26
27
  name: string;
27
28
  index: number;
28
29
  catchAll: boolean;
30
+ optional: boolean;
29
31
  }>;
30
32
  methods?: string[];
31
33
  isIndex: boolean;
32
34
  }>;
35
+ wsRoutes: Array<{
36
+ filePath: string;
37
+ relativePath: string;
38
+ urlPath: string;
39
+ params: Array<{
40
+ name: string;
41
+ index: number;
42
+ catchAll: boolean;
43
+ optional: boolean;
44
+ }>;
45
+ }>;
33
46
  layouts: unknown[];
34
47
  root: unknown;
35
48
  }
@@ -22,13 +22,12 @@ export class RouteScannerRunner extends EventEmitter {
22
22
  */
23
23
  async loadRouter() {
24
24
  try {
25
- // Dynamic import using variable to prevent TypeScript from resolving at compile time
26
- const moduleName = '@zapjs/router';
27
- // eslint-disable-next-line @typescript-eslint/no-require-imports
28
- const router = await (Function('moduleName', 'return import(moduleName)')(moduleName));
25
+ // Import from local router module
26
+ const router = await import('../router/index.js');
29
27
  return router;
30
28
  }
31
- catch {
29
+ catch (error) {
30
+ console.error('[route-scanner] Failed to load router:', error);
32
31
  return null;
33
32
  }
34
33
  }
@@ -301,8 +301,10 @@ export class DevServer extends EventEmitter {
301
301
  this.log('debug', `IPC server listening on ${this.socketPath}`);
302
302
  // Load and register route handlers
303
303
  const routes = await this.loadRouteHandlers(routeTree);
304
+ console.log(`[dev-server] Loaded ${routes.length} route configurations`);
304
305
  // Build Rust server configuration
305
306
  const config = this.buildRustConfig(routes);
307
+ console.log(`[dev-server] Built Rust config with ${config.routes.length} routes`);
306
308
  // Get binary path
307
309
  const binaryPath = this.rustBuilder.getBinaryPath();
308
310
  this.log('debug', `Using Rust binary: ${binaryPath}`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zap-js/client",
3
- "version": "0.0.4",
3
+ "version": "0.0.5",
4
4
  "description": "High-performance fullstack React framework - Client package",
5
5
  "homepage": "https://github.com/saint0x/zapjs",
6
6
  "repository": {