vibe-gx 4.0.0 → 4.1.0

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/README.md CHANGED
@@ -428,7 +428,7 @@ process.on("SIGTERM", () => dbPool.close());
428
428
  Use any Express middleware with the adapter:
429
429
 
430
430
  ```javascript
431
- import { adapt } from "vibe-gx/utils/helpers/adapt.js";
431
+ import vibe, { adapt } from "vibe-gx";
432
432
  import cors from "cors";
433
433
  import helmet from "helmet";
434
434
  import compression from "compression";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vibe-gx",
3
- "version": "4.0.0",
3
+ "version": "4.1.0",
4
4
  "description": "A lightweight, high-performance Node.js web framework.",
5
5
  "type": "module",
6
6
  "main": "vibe.js",
package/vibe.d.ts CHANGED
@@ -560,3 +560,33 @@ export function parseJsonStream(
560
560
  onEnd?: () => void,
561
561
  onError?: (err: Error) => void,
562
562
  ): void;
563
+
564
+ // ==========================================
565
+ // Express Middleware Adapter
566
+ // ==========================================
567
+
568
+ /**
569
+ * Adapt an Express-style middleware to work as a Vibe interceptor.
570
+ * @param mw - Express middleware function (req, res, next)
571
+ * @returns Vibe-compatible interceptor
572
+ *
573
+ * @example
574
+ * import { adapt } from "vibe-gx";
575
+ * import cors from "cors";
576
+ * import cookieParser from "cookie-parser";
577
+ *
578
+ * app.plugin(adapt(cors()));
579
+ * app.plugin(adapt(cookieParser()));
580
+ */
581
+ export function adapt(
582
+ mw: (req: any, res: any, next: (err?: any) => void) => void,
583
+ ): Interceptor;
584
+
585
+ /**
586
+ * Adapt multiple Express middlewares at once.
587
+ * @param middlewares - Express middleware functions
588
+ * @returns Array of Vibe-compatible interceptors
589
+ */
590
+ export function adaptAll(
591
+ ...middlewares: Array<(req: any, res: any, next: (err?: any) => void) => void>
592
+ ): Interceptor[];
package/vibe.js CHANGED
@@ -570,7 +570,7 @@ const vibe = () => {
570
570
  };
571
571
 
572
572
  export default vibe;
573
- export { color };
573
+ export { color, adapt };
574
574
 
575
575
  // Scalability utilities
576
576
  export {