burger-api 0.0.33 → 0.0.35

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.
@@ -1,5 +1,5 @@
1
- import type { Router } from "./router";
2
- import type { ServerOptions } from "../types";
1
+ import type { Router } from "./router.js";
2
+ import type { ServerOptions } from "../types/index.js";
3
3
  /**
4
4
  * Generates an OpenAPI 3.0 document from the router's routes and global options.
5
5
  * @param router The router instance with loaded routes.
@@ -1,4 +1,4 @@
1
- import type { RouteDefinition } from "../types";
1
+ import type { RouteDefinition } from "../types/index.js";
2
2
  /**
3
3
  * Router class for handling file-based routing.
4
4
  * Loads routes from a directory structure and matches requests to the appropriate route handlers.
@@ -2,7 +2,7 @@
2
2
  import { readdirSync } from "fs";
3
3
  import * as path from "path";
4
4
  // Import utils
5
- import { cleanPrefix, normalizePath } from "@/utils/index";
5
+ import { cleanPrefix, normalizePath } from "@/utils/index.js";
6
6
  /**
7
7
  * Router class for handling file-based routing.
8
8
  * Loads routes from a directory structure and matches requests to the appropriate route handlers.
@@ -1,8 +1,8 @@
1
1
  // Import stuff from core
2
- import { HttpRequest } from "./request";
3
- import { HttpResponse } from "./response";
2
+ import { HttpRequest } from "./request.js";
3
+ import { HttpResponse } from "./response.js";
4
4
  // Import stuff from utils
5
- import { errorResponse } from "@/utils/error";
5
+ import { errorResponse } from "@/utils/error.js";
6
6
  export class Server {
7
7
  options;
8
8
  server = null;
@@ -27,5 +27,5 @@ export declare class Burger {
27
27
  */
28
28
  serve(port?: number, cb?: () => void): Promise<void>;
29
29
  }
30
- export { setDir } from "./utils/index";
31
- export type { ServerOptions, RequestHandler, BurgerRequest, BurgerResponse, Middleware, } from "./types";
30
+ export { setDir } from "./utils/index.js";
31
+ export type { ServerOptions, RequestHandler, BurgerRequest, BurgerResponse, Middleware, } from "./types/index.js";
package/dist/src/index.js CHANGED
@@ -1,12 +1,12 @@
1
1
  // Import stuff from core
2
- import { Server } from "./core/server";
3
- import { Router } from "./core/router";
4
- import { HttpRequest } from "./core/request";
5
- import { HttpResponse } from "./core/response";
6
- import { generateOpenAPIDocument } from "./core/openapi";
7
- import { swaggerHtml } from "./core/swagger-ui";
2
+ import { Server } from "./core/server.js";
3
+ import { Router } from "./core/router.js";
4
+ import { HttpRequest } from "./core/request.js";
5
+ import { HttpResponse } from "./core/response.js";
6
+ import { generateOpenAPIDocument } from "./core/openapi.js";
7
+ import { swaggerHtml } from "./core/swagger-ui.js";
8
8
  // Import middleware
9
- import { createValidationMiddleware } from "./middleware/validator";
9
+ import { createValidationMiddleware } from "./middleware/validator.js";
10
10
  export class Burger {
11
11
  options;
12
12
  server;
@@ -134,4 +134,4 @@ export class Burger {
134
134
  }
135
135
  }
136
136
  // Export utils
137
- export { setDir } from "./utils/index";
137
+ export { setDir } from "./utils/index.js";
@@ -1,4 +1,4 @@
1
- import type { Middleware, RouteSchema } from "../types/index";
1
+ import type { Middleware, RouteSchema } from "../types/index.js";
2
2
  /**
3
3
  * Creates a middleware function that validates request data according to the
4
4
  * given schema for the current HTTP method.
@@ -1,4 +1,4 @@
1
- import { normalizePath } from "./index";
1
+ import { normalizePath } from "./index.js";
2
2
  /**
3
3
  * Generates an HTTP error response based on the request's "Accept" header.
4
4
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "burger-api",
3
- "version": "0.0.33",
3
+ "version": "0.0.35",
4
4
  "author": "Isfhan Ahmed",
5
5
  "type": "module",
6
6
  "module": "dist/src/index.js",