@smuzi/http-server 0.0.3 → 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.
package/build/config.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { Option, HttpProtocol } from "@smuzi/std";
2
- import { ActionErrorHandler, Http1Router } from "#lib/router.js";
2
+ import { ActionErrorHandler, Http1Router } from "./router.js";
3
3
  import { ServerResponse } from "node:http";
4
4
  type Cert = Option<{
5
5
  key: string;
@@ -1,5 +1,5 @@
1
1
  import { Result, StdError } from '@smuzi/std';
2
- import { HttpServer, HttpServerRunError, Http1ServerConfig } from "#lib/index.js";
2
+ import { HttpServer, HttpServerRunError, Http1ServerConfig } from "../index.js";
3
3
  type NativeServer = any;
4
4
  export declare class StdHttp1Server implements HttpServer {
5
5
  #private;
@@ -2,7 +2,7 @@ import http from 'node:http';
2
2
  import https from 'node:https';
3
3
  import { TLSSocket } from 'node:tls';
4
4
  import fs from 'node:fs';
5
- import { methodFromString } from "#lib/router.js";
5
+ import { methodFromString } from "../router.js";
6
6
  import { isArray, isObject, isString, StdRecord, matchUnknown, OptionFromNullable, Err, Ok, isNull, transformError, StdError, HttpResponse, HttpRequest, isOption, isResult, RequestHttpHeaders, asList, asRecord, asMap, querystring, StdJson } from '@smuzi/std';
7
7
  import { log } from 'node:console';
8
8
  export class StdHttp1Server {
@@ -1,6 +1,6 @@
1
1
  import { Http2SecureServer, Http2Server } from 'node:http2';
2
2
  import { Result, StdError } from '@smuzi/std';
3
- import { HttpServer, HttpServerRunError, Http2ServerConfig } from "#lib/index.js";
3
+ import { HttpServer, HttpServerRunError, Http2ServerConfig } from "../index.js";
4
4
  type NativeServer = Http2SecureServer | Http2Server;
5
5
  export declare class StdHttp2Server implements HttpServer {
6
6
  #private;
@@ -1,6 +1,6 @@
1
1
  import http2 from 'node:http2';
2
2
  import fs from 'node:fs';
3
- import { methodFromString } from "#lib/router.js";
3
+ import { methodFromString } from "../router.js";
4
4
  import { isArray, isObject, isString, matchUnknown, OptionFromNullable, Err, Ok, isNull, transformError, HttpResponse, StdJson } from '@smuzi/std';
5
5
  export class StdHttp2Server {
6
6
  #server;
package/build/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- export * from "#lib/drivers/http2Server.js";
2
- export * from "#lib/drivers/http1Server.js";
3
- export * from "#lib/config.js";
1
+ export * from "./drivers/http2Server.js";
2
+ export * from "./drivers/http1Server.js";
3
+ export * from "./config.js";
4
4
  export * from "./router.js";
5
- export * from "#lib/types.js";
5
+ export * from "./types.js";
package/build/index.js CHANGED
@@ -1,5 +1,5 @@
1
- export * from "#lib/drivers/http2Server.js";
2
- export * from "#lib/drivers/http1Server.js";
3
- export * from "#lib/config.js";
1
+ export * from "./drivers/http2Server.js";
2
+ export * from "./drivers/http1Server.js";
3
+ export * from "./config.js";
4
4
  export * from "./router.js";
5
- export * from "#lib/types.js";
5
+ export * from "./types.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@smuzi/http-server",
3
- "version": "0.0.3",
3
+ "version": "0.0.5",
4
4
  "description": "HTTP server and routing for JavaScript and TypeScript",
5
5
  "type": "module",
6
6
  "types": "./build/index.d.ts",
@@ -23,19 +23,25 @@
23
23
  ],
24
24
  "exports": {
25
25
  "./package.json": "./package.json",
26
- ".": "./src/index.ts",
27
- "./*": "./src/*.ts"
26
+ ".": {
27
+ "types": "./build/index.d.ts",
28
+ "default": "./build/index.js"
29
+ },
30
+ "./*": {
31
+ "types": "./build/*.d.ts",
32
+ "default": "./build/*.js"
33
+ }
28
34
  },
29
35
  "imports": {
30
36
  "#lib/*": "./src/*"
31
37
  },
32
38
  "dependencies": {
33
- "@smuzi/std": "0.2.4",
34
- "@smuzi/schema": "0.0.2"
39
+ "@smuzi/std": "0.2.6",
40
+ "@smuzi/schema": "0.0.5"
35
41
  },
36
42
  "devDependencies": {
37
- "@smuzi/faker": "0.0.2",
38
- "@smuzi/tests": "0.0.1",
43
+ "@smuzi/faker": "0.0.5",
44
+ "@smuzi/tests": "0.0.3",
39
45
  "@types/node": "^22.15.21",
40
46
  "tsx": "^4.20.6",
41
47
  "typescript": "^7.0.2"
package/src/config.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import {Option, HttpProtocol, None, HttpResponse, transformError, dump} from "@smuzi/std";
2
- import {ActionErrorHandler, Context, Http1Router} from "#lib/router.js";
2
+ import {ActionErrorHandler, Context, Http1Router} from "./router.js";
3
3
  import {ServerResponse} from "node:http";
4
4
 
5
5
  type Cert = Option<{
@@ -3,7 +3,7 @@ import https from 'node:https';
3
3
  import { TLSSocket } from 'node:tls';
4
4
  import fs from 'node:fs';
5
5
 
6
- import { methodFromString } from "#lib/router.js";
6
+ import { methodFromString } from "../router.js";
7
7
  import {
8
8
  isArray,
9
9
  isObject,
@@ -31,7 +31,7 @@ import {
31
31
  ResponseHttpHeaders, RequestHttpHeaders, asList, asRecord, asMap, querystring, QueryParams,
32
32
  StdJson, uuid
33
33
  } from '@smuzi/std';
34
- import { HttpServer, HttpServerRunError, Http1ServerConfig } from "#lib/index.js";
34
+ import { HttpServer, HttpServerRunError, Http1ServerConfig } from "../index.js";
35
35
  import { log } from 'node:console';
36
36
 
37
37
  type NativeServer = any
@@ -1,9 +1,9 @@
1
1
  import http2, { Http2SecureServer, Http2Server, IncomingHttpHeaders, ServerHttp2Stream } from 'node:http2';
2
2
  import fs from 'node:fs';
3
3
 
4
- import { methodFromString } from "#lib/router.js";
4
+ import { methodFromString } from "../router.js";
5
5
  import { isArray, isObject, isString, match, matchUnknown, OptionFromNullable, Some, Result, Option, Err, Ok, isNull, transformError, StdError, dump, HttpResponse, StdJson } from '@smuzi/std';
6
- import { HttpServer, HttpServerRunError, Http2ServerConfig } from "#lib/index.js";
6
+ import { HttpServer, HttpServerRunError, Http2ServerConfig } from "../index.js";
7
7
 
8
8
  type NativeServer = Http2SecureServer | Http2Server;
9
9
 
package/src/index.ts CHANGED
@@ -1,5 +1,5 @@
1
- export * from "#lib/drivers/http2Server.js";
2
- export * from "#lib/drivers/http1Server.js";
3
- export * from "#lib/config.js" ;
1
+ export * from "./drivers/http2Server.js";
2
+ export * from "./drivers/http1Server.js";
3
+ export * from "./config.js" ;
4
4
  export * from "./router.js" ;
5
- export * from "#lib/types.js" ;
5
+ export * from "./types.js" ;