srvx 0.7.1 → 0.7.3
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/dist/{chunks/_url-CirWh9Lc.mjs → _chunks/_url-Dsik4Hgl.mjs} +1 -5
- package/dist/{chunks/types-egi3HKdd.d.mts → _chunks/types-CAoaOHnD.d.mts} +11 -1
- package/dist/{bun.d.mts → adapters/bun.d.mts} +3 -3
- package/dist/{bun.mjs → adapters/bun.mjs} +3 -3
- package/dist/{cloudflare.d.mts → adapters/cloudflare.d.mts} +1 -2
- package/dist/{cloudflare.mjs → adapters/cloudflare.mjs} +3 -3
- package/dist/{deno.d.mts → adapters/deno.d.mts} +3 -3
- package/dist/{deno.mjs → adapters/deno.mjs} +3 -3
- package/dist/{generic.d.mts → adapters/generic.d.mts} +1 -2
- package/dist/{generic.mjs → adapters/generic.mjs} +2 -2
- package/dist/{node.d.mts → adapters/node.d.mts} +2 -6
- package/dist/{node.mjs → adapters/node.mjs} +23 -9
- package/dist/{service-worker.d.mts → adapters/service-worker.d.mts} +1 -2
- package/dist/{service-worker.mjs → adapters/service-worker.mjs} +3 -3
- package/dist/types.d.mts +1 -1
- package/package.json +29 -27
- /package/dist/{chunks/_middleware-DSFIayTI.mjs → _chunks/_middleware-Bz7WmB2e.mjs} +0 -0
- /package/dist/{chunks/_plugins-BTotWVHV.mjs → _chunks/_plugins-CDyQtZq-.mjs} +0 -0
- /package/dist/{chunks/_url-BwTFuoNW.d.mts → _chunks/_url-0kFTYgtJ.d.mts} +0 -0
|
@@ -89,11 +89,7 @@ const FastURL = /* @__PURE__ */ (() => {
|
|
|
89
89
|
const url = this.#originalURL;
|
|
90
90
|
const protoIndex = url.indexOf("://");
|
|
91
91
|
if (protoIndex === -1) return this._url.pathname;
|
|
92
|
-
const pIndex = url.indexOf(
|
|
93
|
-
"/",
|
|
94
|
-
protoIndex + 4
|
|
95
|
-
/* :// */
|
|
96
|
-
);
|
|
92
|
+
const pIndex = url.indexOf("/", protoIndex + 4);
|
|
97
93
|
if (pIndex === -1) return this._url.pathname;
|
|
98
94
|
const qIndex = this._urlqindex = url.indexOf("?", pIndex);
|
|
99
95
|
this._pathname = url.slice(pIndex, qIndex === -1 ? void 0 : qIndex);
|
|
@@ -7,6 +7,9 @@ import * as CF from "@cloudflare/workers-types";
|
|
|
7
7
|
|
|
8
8
|
//#region src/types.d.ts
|
|
9
9
|
type MaybePromise<T> = T | Promise<T>;
|
|
10
|
+
// ----------------------------------------------------------------------------
|
|
11
|
+
// srvx API
|
|
12
|
+
// ----------------------------------------------------------------------------
|
|
10
13
|
/**
|
|
11
14
|
* Faster URL constructor with lazy access to pathname and search params (For Node, Deno, and Bun).
|
|
12
15
|
*/
|
|
@@ -187,6 +190,9 @@ interface Server<Handler = ServerHandler> {
|
|
|
187
190
|
*/
|
|
188
191
|
close(closeActiveConnections?: boolean): Promise<void>;
|
|
189
192
|
}
|
|
193
|
+
// ----------------------------------------------------------------------------
|
|
194
|
+
// Request with runtime addons.
|
|
195
|
+
// ----------------------------------------------------------------------------
|
|
190
196
|
interface ServerRuntimeContext {
|
|
191
197
|
name: "node" | "deno" | "bun" | "cloudflare" | (string & {});
|
|
192
198
|
/**
|
|
@@ -226,6 +232,9 @@ interface ServerRequest extends Request {
|
|
|
226
232
|
*/
|
|
227
233
|
ip?: string | undefined;
|
|
228
234
|
}
|
|
235
|
+
// ----------------------------------------------------------------------------
|
|
236
|
+
// Different handler types
|
|
237
|
+
// ----------------------------------------------------------------------------
|
|
229
238
|
type FetchHandler = (request: Request) => Response | Promise<Response>;
|
|
230
239
|
type ErrorHandler = (error: unknown) => Response | Promise<Response>;
|
|
231
240
|
type BunFetchHandler = (request: Request, server?: Bun.Server) => Response | Promise<Response>;
|
|
@@ -233,5 +242,6 @@ type DenoFetchHandler = (request: Request, info?: Deno.ServeHandlerInfo<Deno.Net
|
|
|
233
242
|
type NodeServerRequest = NodeHttp$1.IncomingMessage | NodeHttp2.Http2ServerRequest;
|
|
234
243
|
type NodeServerResponse = NodeHttp$1.ServerResponse | NodeHttp2.Http2ServerResponse;
|
|
235
244
|
type NodeHttpHandler = (req: NodeServerRequest, res: NodeServerResponse) => void | Promise<void>;
|
|
236
|
-
type CloudflareFetchHandler = CF.ExportedHandlerFetchHandler;
|
|
245
|
+
type CloudflareFetchHandler = CF.ExportedHandlerFetchHandler;
|
|
246
|
+
//#endregion
|
|
237
247
|
export { BunFetchHandler, CloudflareFetchHandler, DenoFetchHandler, ErrorHandler, FastResponse, FastURL, FetchHandler, NodeHttpHandler, NodeServerRequest, NodeServerResponse, Server, ServerHandler, ServerMiddleware, ServerOptions, ServerPlugin, ServerRequest, ServerRuntimeContext, serve };
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { BunFetchHandler, Server, ServerOptions } from "
|
|
2
|
-
import { FastURL$2 as FastURL } from "
|
|
1
|
+
import { BunFetchHandler, Server, ServerOptions } from "../_chunks/types-CAoaOHnD.mjs";
|
|
2
|
+
import { FastURL$2 as FastURL } from "../_chunks/_url-0kFTYgtJ.mjs";
|
|
3
3
|
import * as bun from "bun";
|
|
4
4
|
|
|
5
5
|
//#region src/adapters/bun.d.ts
|
|
6
6
|
declare const FastResponse: typeof globalThis.Response;
|
|
7
7
|
declare function serve(options: ServerOptions): BunServer;
|
|
8
|
+
// https://bun.sh/docs/api/http
|
|
8
9
|
declare class BunServer implements Server<BunFetchHandler> {
|
|
9
10
|
readonly runtime = "bun";
|
|
10
11
|
readonly options: Server["options"];
|
|
@@ -17,6 +18,5 @@ declare class BunServer implements Server<BunFetchHandler> {
|
|
|
17
18
|
ready(): Promise<this>;
|
|
18
19
|
close(closeAll?: boolean): Promise<void>;
|
|
19
20
|
}
|
|
20
|
-
|
|
21
21
|
//#endregion
|
|
22
22
|
export { FastResponse, FastURL, serve };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { FastURL$1 as FastURL, fmtURL, printListening, resolvePortAndHost, resolveTLSOptions } from "
|
|
2
|
-
import { wrapFetch } from "
|
|
1
|
+
import { FastURL$1 as FastURL, fmtURL, printListening, resolvePortAndHost, resolveTLSOptions } from "../_chunks/_url-Dsik4Hgl.mjs";
|
|
2
|
+
import { wrapFetch } from "../_chunks/_middleware-Bz7WmB2e.mjs";
|
|
3
3
|
|
|
4
4
|
//#region src/adapters/bun.ts
|
|
5
5
|
const FastResponse = Response;
|
|
@@ -24,7 +24,7 @@ var BunServer = class {
|
|
|
24
24
|
runtime: {
|
|
25
25
|
enumerable: true,
|
|
26
26
|
value: {
|
|
27
|
-
|
|
27
|
+
name: "bun",
|
|
28
28
|
bun: { server }
|
|
29
29
|
}
|
|
30
30
|
},
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import { Server, ServerOptions } from "
|
|
1
|
+
import { Server, ServerOptions } from "../_chunks/types-CAoaOHnD.mjs";
|
|
2
2
|
import * as CF from "@cloudflare/workers-types";
|
|
3
3
|
|
|
4
4
|
//#region src/adapters/cloudflare.d.ts
|
|
5
5
|
declare const FastURL: typeof globalThis.URL;
|
|
6
6
|
declare const FastResponse: typeof globalThis.Response;
|
|
7
7
|
declare function serve(options: ServerOptions): Server<CF.ExportedHandlerFetchHandler>;
|
|
8
|
-
|
|
9
8
|
//#endregion
|
|
10
9
|
export { FastResponse, FastURL, serve };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { wrapFetch } from "
|
|
2
|
-
import { errorPlugin } from "
|
|
1
|
+
import { wrapFetch } from "../_chunks/_middleware-Bz7WmB2e.mjs";
|
|
2
|
+
import { errorPlugin } from "../_chunks/_plugins-CDyQtZq-.mjs";
|
|
3
3
|
|
|
4
4
|
//#region src/adapters/cloudflare.ts
|
|
5
5
|
const FastURL = URL;
|
|
@@ -24,7 +24,7 @@ var CloudflareServer = class {
|
|
|
24
24
|
Object.defineProperties(request, { runtime: {
|
|
25
25
|
enumerable: true,
|
|
26
26
|
value: {
|
|
27
|
-
|
|
27
|
+
name: "cloudflare",
|
|
28
28
|
cloudflare: {
|
|
29
29
|
env,
|
|
30
30
|
context
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { DenoFetchHandler, Server, ServerOptions } from "
|
|
2
|
-
import { FastURL$2 as FastURL } from "
|
|
1
|
+
import { DenoFetchHandler, Server, ServerOptions } from "../_chunks/types-CAoaOHnD.mjs";
|
|
2
|
+
import { FastURL$2 as FastURL } from "../_chunks/_url-0kFTYgtJ.mjs";
|
|
3
3
|
|
|
4
4
|
//#region src/adapters/deno.d.ts
|
|
5
5
|
declare const FastResponse: typeof globalThis.Response;
|
|
6
6
|
declare function serve(options: ServerOptions): DenoServer;
|
|
7
|
+
// https://docs.deno.com/api/deno/~/Deno.serve
|
|
7
8
|
declare class DenoServer implements Server<DenoFetchHandler> {
|
|
8
9
|
#private;
|
|
9
10
|
readonly runtime = "deno";
|
|
@@ -17,6 +18,5 @@ declare class DenoServer implements Server<DenoFetchHandler> {
|
|
|
17
18
|
ready(): Promise<Server>;
|
|
18
19
|
close(): Promise<void | undefined>;
|
|
19
20
|
}
|
|
20
|
-
|
|
21
21
|
//#endregion
|
|
22
22
|
export { FastResponse, FastURL, serve };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { FastURL$1 as FastURL, fmtURL, printListening, resolvePortAndHost, resolveTLSOptions } from "
|
|
2
|
-
import { wrapFetch } from "
|
|
1
|
+
import { FastURL$1 as FastURL, fmtURL, printListening, resolvePortAndHost, resolveTLSOptions } from "../_chunks/_url-Dsik4Hgl.mjs";
|
|
2
|
+
import { wrapFetch } from "../_chunks/_middleware-Bz7WmB2e.mjs";
|
|
3
3
|
|
|
4
4
|
//#region src/adapters/deno.ts
|
|
5
5
|
const FastResponse = Response;
|
|
@@ -26,7 +26,7 @@ var DenoServer = class {
|
|
|
26
26
|
runtime: {
|
|
27
27
|
enumerable: true,
|
|
28
28
|
value: {
|
|
29
|
-
|
|
29
|
+
name: "deno",
|
|
30
30
|
deno: {
|
|
31
31
|
info,
|
|
32
32
|
server: this.deno?.server
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import { Server, ServerOptions } from "
|
|
1
|
+
import { Server, ServerOptions } from "../_chunks/types-CAoaOHnD.mjs";
|
|
2
2
|
|
|
3
3
|
//#region src/adapters/generic.d.ts
|
|
4
4
|
declare const FastURL: typeof globalThis.URL;
|
|
5
5
|
declare const FastResponse: typeof globalThis.Response;
|
|
6
6
|
declare function serve(options: ServerOptions): Server;
|
|
7
|
-
|
|
8
7
|
//#endregion
|
|
9
8
|
export { FastResponse, FastURL, serve };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { wrapFetch } from "
|
|
2
|
-
import { errorPlugin } from "
|
|
1
|
+
import { wrapFetch } from "../_chunks/_middleware-Bz7WmB2e.mjs";
|
|
2
|
+
import { errorPlugin } from "../_chunks/_plugins-CDyQtZq-.mjs";
|
|
3
3
|
|
|
4
4
|
//#region src/adapters/generic.ts
|
|
5
5
|
const FastURL = URL;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { FetchHandler, NodeHttpHandler, NodeServerRequest, NodeServerResponse, Server, ServerOptions, ServerRequest } from "
|
|
2
|
-
import { FastURL$2 as FastURL } from "
|
|
1
|
+
import { FetchHandler, NodeHttpHandler, NodeServerRequest, NodeServerResponse, Server, ServerOptions, ServerRequest } from "../_chunks/types-CAoaOHnD.mjs";
|
|
2
|
+
import { FastURL$2 as FastURL } from "../_chunks/_url-0kFTYgtJ.mjs";
|
|
3
3
|
import NodeHttp from "node:http";
|
|
4
4
|
import { Readable } from "node:stream";
|
|
5
5
|
|
|
@@ -11,7 +11,6 @@ type NodeRequestContext = {
|
|
|
11
11
|
declare const NodeRequest: {
|
|
12
12
|
new (nodeCtx: NodeRequestContext): ServerRequest;
|
|
13
13
|
};
|
|
14
|
-
|
|
15
14
|
//#endregion
|
|
16
15
|
//#region src/adapters/_node/headers.d.ts
|
|
17
16
|
declare const NodeRequestHeaders: {
|
|
@@ -26,7 +25,6 @@ declare const NodeResponseHeaders: {
|
|
|
26
25
|
res: NodeServerResponse;
|
|
27
26
|
}): globalThis.Headers;
|
|
28
27
|
};
|
|
29
|
-
|
|
30
28
|
//#endregion
|
|
31
29
|
//#region src/adapters/_node/response.d.ts
|
|
32
30
|
type NodeResponse = InstanceType<typeof NodeResponse>;
|
|
@@ -45,11 +43,9 @@ declare const NodeResponse: {
|
|
|
45
43
|
};
|
|
46
44
|
};
|
|
47
45
|
};
|
|
48
|
-
|
|
49
46
|
//#endregion
|
|
50
47
|
//#region src/adapters/node.d.ts
|
|
51
48
|
declare function serve(options: ServerOptions): Server;
|
|
52
49
|
declare function toNodeHandler(fetchHandler: FetchHandler): NodeHttpHandler;
|
|
53
|
-
|
|
54
50
|
//#endregion
|
|
55
51
|
export { NodeResponse as FastResponse, FastURL, NodeRequest, NodeRequestHeaders, NodeResponse, NodeResponseHeaders, serve, toNodeHandler };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { FastURL$1 as FastURL, fmtURL, printListening, resolvePortAndHost, resolveTLSOptions } from "
|
|
2
|
-
import { wrapFetch } from "
|
|
3
|
-
import { errorPlugin } from "
|
|
1
|
+
import { FastURL$1 as FastURL, fmtURL, printListening, resolvePortAndHost, resolveTLSOptions } from "../_chunks/_url-Dsik4Hgl.mjs";
|
|
2
|
+
import { wrapFetch } from "../_chunks/_middleware-Bz7WmB2e.mjs";
|
|
3
|
+
import { errorPlugin } from "../_chunks/_plugins-CDyQtZq-.mjs";
|
|
4
4
|
import { splitSetCookieString } from "cookie-es";
|
|
5
5
|
|
|
6
6
|
//#region src/adapters/_node/send.ts
|
|
@@ -222,7 +222,7 @@ function _normalizeValue(value) {
|
|
|
222
222
|
return typeof value === "string" ? value : String(value ?? "");
|
|
223
223
|
}
|
|
224
224
|
function validateHeader(name) {
|
|
225
|
-
if (name[0] === ":") throw new TypeError(
|
|
225
|
+
if (name[0] === ":") throw new TypeError(`${JSON.stringify(name)} is an invalid header name.`);
|
|
226
226
|
return name.toLowerCase();
|
|
227
227
|
}
|
|
228
228
|
|
|
@@ -426,7 +426,12 @@ const NodeRequest = /* @__PURE__ */ (() => {
|
|
|
426
426
|
return this._node.req.method || "GET";
|
|
427
427
|
}
|
|
428
428
|
get signal() {
|
|
429
|
-
if (!this.#abortSignal)
|
|
429
|
+
if (!this.#abortSignal) {
|
|
430
|
+
this.#abortSignal = new AbortController();
|
|
431
|
+
this._node.req.once("close", () => {
|
|
432
|
+
this.#abortSignal?.abort();
|
|
433
|
+
});
|
|
434
|
+
}
|
|
430
435
|
return this.#abortSignal.signal;
|
|
431
436
|
}
|
|
432
437
|
get bodyUsed() {
|
|
@@ -572,13 +577,13 @@ const NodeResponse = /* @__PURE__ */ (() => {
|
|
|
572
577
|
const statusText = this.#init?.statusText ?? "";
|
|
573
578
|
const headers = [];
|
|
574
579
|
const headersInit = this.#init?.headers;
|
|
575
|
-
if (
|
|
580
|
+
if (this.#headersObj) for (const [key, value] of this.#headersObj) if (key === "set-cookie") for (const setCookie of splitSetCookieString(value)) headers.push(["set-cookie", setCookie]);
|
|
581
|
+
else headers.push([key, value]);
|
|
582
|
+
else if (headersInit) {
|
|
576
583
|
const headerEntries = Array.isArray(headersInit) ? headersInit : headersInit.entries ? headersInit.entries() : Object.entries(headersInit);
|
|
577
584
|
for (const [key, value] of headerEntries) if (key === "set-cookie") for (const setCookie of splitSetCookieString(value)) headers.push(["set-cookie", setCookie]);
|
|
578
585
|
else headers.push([key, value]);
|
|
579
586
|
}
|
|
580
|
-
if (this.#headersObj) for (const [key, value] of this.#headersObj) if (key === "set-cookie") for (const setCookie of splitSetCookieString(value)) headers.push(["set-cookie", setCookie]);
|
|
581
|
-
else headers.push([key, value]);
|
|
582
587
|
const bodyInit = this.#body;
|
|
583
588
|
let body;
|
|
584
589
|
if (bodyInit) if (typeof bodyInit === "string") body = bodyInit;
|
|
@@ -597,6 +602,8 @@ const NodeResponse = /* @__PURE__ */ (() => {
|
|
|
597
602
|
}
|
|
598
603
|
this.#body = void 0;
|
|
599
604
|
this.#init = void 0;
|
|
605
|
+
this.#headersObj = void 0;
|
|
606
|
+
this.#responseObj = void 0;
|
|
600
607
|
return {
|
|
601
608
|
status,
|
|
602
609
|
statusText,
|
|
@@ -610,11 +617,18 @@ const NodeResponse = /* @__PURE__ */ (() => {
|
|
|
610
617
|
#headersObj;
|
|
611
618
|
clone() {
|
|
612
619
|
if (this.#responseObj) return this.#responseObj.clone();
|
|
620
|
+
if (this.#headersObj) return new globalThis.Response(this.#body, {
|
|
621
|
+
...this.#init,
|
|
622
|
+
headers: new Headers(this.#headersObj)
|
|
623
|
+
});
|
|
613
624
|
return new globalThis.Response(this.#body, this.#init);
|
|
614
625
|
}
|
|
615
626
|
get #response() {
|
|
616
627
|
if (!this.#responseObj) {
|
|
617
|
-
this.#responseObj = new globalThis.Response(this.#body,
|
|
628
|
+
this.#responseObj = this.#headersObj ? new globalThis.Response(this.#body, {
|
|
629
|
+
...this.#init,
|
|
630
|
+
headers: new Headers(this.#headersObj)
|
|
631
|
+
}) : new globalThis.Response(this.#body, this.#init);
|
|
618
632
|
this.#body = void 0;
|
|
619
633
|
this.#init = void 0;
|
|
620
634
|
this.#headersObj = void 0;
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import { Server, ServerOptions, ServerRequest } from "
|
|
1
|
+
import { Server, ServerOptions, ServerRequest } from "../_chunks/types-CAoaOHnD.mjs";
|
|
2
2
|
|
|
3
3
|
//#region src/adapters/service-worker.d.ts
|
|
4
4
|
declare const FastURL: typeof globalThis.URL;
|
|
5
5
|
declare const FastResponse: typeof globalThis.Response;
|
|
6
6
|
type ServiceWorkerHandler = (request: ServerRequest, event: FetchEvent) => Response | Promise<Response>;
|
|
7
7
|
declare function serve(options: ServerOptions): Server<ServiceWorkerHandler>;
|
|
8
|
-
|
|
9
8
|
//#endregion
|
|
10
9
|
export { FastResponse, FastURL, ServiceWorkerHandler, serve };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { wrapFetch } from "
|
|
2
|
-
import { errorPlugin } from "
|
|
1
|
+
import { wrapFetch } from "../_chunks/_middleware-Bz7WmB2e.mjs";
|
|
2
|
+
import { errorPlugin } from "../_chunks/_plugins-CDyQtZq-.mjs";
|
|
3
3
|
|
|
4
4
|
//#region src/adapters/service-worker.ts
|
|
5
5
|
const FastURL = URL;
|
|
@@ -27,7 +27,7 @@ var ServiceWorkerServer = class {
|
|
|
27
27
|
Object.defineProperties(request, { runtime: {
|
|
28
28
|
enumerable: true,
|
|
29
29
|
value: {
|
|
30
|
-
|
|
30
|
+
name: "service-worker",
|
|
31
31
|
serviceWorker: { event }
|
|
32
32
|
}
|
|
33
33
|
} });
|
package/dist/types.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { BunFetchHandler, CloudflareFetchHandler, DenoFetchHandler, ErrorHandler, FastResponse, FastURL, FetchHandler, NodeHttpHandler, NodeServerRequest, NodeServerResponse, Server, ServerHandler, ServerMiddleware, ServerOptions, ServerPlugin, ServerRequest, ServerRuntimeContext, serve } from "./
|
|
1
|
+
import { BunFetchHandler, CloudflareFetchHandler, DenoFetchHandler, ErrorHandler, FastResponse, FastURL, FetchHandler, NodeHttpHandler, NodeServerRequest, NodeServerResponse, Server, ServerHandler, ServerMiddleware, ServerOptions, ServerPlugin, ServerRequest, ServerRuntimeContext, serve } from "./_chunks/types-CAoaOHnD.mjs";
|
|
2
2
|
export { BunFetchHandler, CloudflareFetchHandler, DenoFetchHandler, ErrorHandler, FastResponse, FastURL, FetchHandler, NodeHttpHandler, NodeServerRequest, NodeServerResponse, Server, ServerHandler, ServerMiddleware, ServerOptions, ServerPlugin, ServerRequest, ServerRuntimeContext, serve };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "srvx",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.3",
|
|
4
4
|
"description": "Universal Server API based on web platform standards. Works seamlessly with Deno, Bun and Node.js.",
|
|
5
5
|
"homepage": "https://srvx.h3.dev",
|
|
6
6
|
"repository": "h3js/srvx",
|
|
@@ -9,20 +9,20 @@
|
|
|
9
9
|
"type": "module",
|
|
10
10
|
"exports": {
|
|
11
11
|
"./types": "./dist/types.d.mts",
|
|
12
|
-
"./deno": "./dist/deno.mjs",
|
|
13
|
-
"./bun": "./dist/bun.mjs",
|
|
14
|
-
"./node": "./dist/node.mjs",
|
|
15
|
-
"./cloudflare": "./dist/cloudflare.mjs",
|
|
16
|
-
"./generic": "./dist/generic.mjs",
|
|
17
|
-
"./service-worker": "./dist/service-worker.mjs",
|
|
12
|
+
"./deno": "./dist/adapters/deno.mjs",
|
|
13
|
+
"./bun": "./dist/adapters/bun.mjs",
|
|
14
|
+
"./node": "./dist/adapters/node.mjs",
|
|
15
|
+
"./cloudflare": "./dist/adapters/cloudflare.mjs",
|
|
16
|
+
"./generic": "./dist/adapters/generic.mjs",
|
|
17
|
+
"./service-worker": "./dist/adapters/service-worker.mjs",
|
|
18
18
|
".": {
|
|
19
19
|
"types": "./dist/types.d.mts",
|
|
20
|
-
"deno": "./dist/deno.mjs",
|
|
21
|
-
"bun": "./dist/bun.mjs",
|
|
22
|
-
"workerd": "./dist/cloudflare.mjs",
|
|
23
|
-
"browser": "./dist/service-worker.mjs",
|
|
24
|
-
"node": "./dist/node.mjs",
|
|
25
|
-
"default": "./dist/generic.mjs"
|
|
20
|
+
"deno": "./dist/adapters/deno.mjs",
|
|
21
|
+
"bun": "./dist/adapters/bun.mjs",
|
|
22
|
+
"workerd": "./dist/adapters/cloudflare.mjs",
|
|
23
|
+
"browser": "./dist/adapters/service-worker.mjs",
|
|
24
|
+
"node": "./dist/adapters/node.mjs",
|
|
25
|
+
"default": "./dist/adapters/generic.mjs"
|
|
26
26
|
}
|
|
27
27
|
},
|
|
28
28
|
"types": "./dist/types.d.mts",
|
|
@@ -40,11 +40,11 @@
|
|
|
40
40
|
"lint:fix": "automd && eslint . --fix && prettier -w .",
|
|
41
41
|
"node-ts": "node --disable-warning=ExperimentalWarning --experimental-strip-types",
|
|
42
42
|
"prepack": "pnpm build",
|
|
43
|
-
"play:bun": "bun playground/app.mjs",
|
|
43
|
+
"play:bun": "bun --watch playground/app.mjs",
|
|
44
44
|
"play:cf": "pnpx wrangler dev playground/app.mjs",
|
|
45
|
-
"play:deno": "deno run -A playground/app.mjs",
|
|
45
|
+
"play:deno": "deno run -A --watch playground/app.mjs",
|
|
46
46
|
"play:mkcert": "openssl req -x509 -newkey rsa:2048 -nodes -keyout server.key -out server.crt -days 365 -subj /CN=srvx.local",
|
|
47
|
-
"play:node": "node playground/app.mjs",
|
|
47
|
+
"play:node": "pnpm node-ts --watch playground/app.mjs",
|
|
48
48
|
"play:sw": "pnpm build && pnpx serve playground",
|
|
49
49
|
"release": "pnpm test && changelogen --release && npm publish && git push --follow-tags",
|
|
50
50
|
"test": "pnpm lint && pnpm test:types && vitest run --coverage",
|
|
@@ -57,29 +57,31 @@
|
|
|
57
57
|
"cookie-es": "^2.0.0"
|
|
58
58
|
},
|
|
59
59
|
"devDependencies": {
|
|
60
|
-
"@cloudflare/workers-types": "^4.
|
|
61
|
-
"@hono/node-server": "^1.14.
|
|
60
|
+
"@cloudflare/workers-types": "^4.20250525.0",
|
|
61
|
+
"@hono/node-server": "^1.14.3",
|
|
62
62
|
"@mitata/counters": "^0.0.8",
|
|
63
63
|
"@mjackson/node-fetch-server": "^0.6.1",
|
|
64
|
-
"@types/bun": "^1.2.
|
|
64
|
+
"@types/bun": "^1.2.14",
|
|
65
65
|
"@types/deno": "^2.3.0",
|
|
66
|
-
"@types/node": "^22.15.
|
|
66
|
+
"@types/node": "^22.15.21",
|
|
67
67
|
"@types/node-forge": "^1.3.11",
|
|
68
|
-
"@types/serviceworker": "^0.0.
|
|
69
|
-
"@vitest/coverage-v8": "^3.1.
|
|
68
|
+
"@types/serviceworker": "^0.0.135",
|
|
69
|
+
"@vitest/coverage-v8": "^3.1.4",
|
|
70
|
+
"@whatwg-node/server": "^0.10.10",
|
|
70
71
|
"automd": "^0.4.0",
|
|
71
72
|
"changelogen": "^0.6.1",
|
|
72
|
-
"eslint": "^9.
|
|
73
|
+
"eslint": "^9.27.0",
|
|
73
74
|
"eslint-config-unjs": "^0.4.2",
|
|
74
|
-
"execa": "^9.
|
|
75
|
+
"execa": "^9.6.0",
|
|
75
76
|
"get-port-please": "^3.1.2",
|
|
76
77
|
"mitata": "^1.0.34",
|
|
77
78
|
"node-forge": "^1.3.1",
|
|
78
|
-
"obuild": "^0.0
|
|
79
|
+
"obuild": "^0.2.0",
|
|
79
80
|
"prettier": "^3.5.3",
|
|
81
|
+
"tslib": "^2.8.1",
|
|
80
82
|
"typescript": "^5.8.3",
|
|
81
|
-
"undici": "^7.
|
|
82
|
-
"vitest": "^3.1.
|
|
83
|
+
"undici": "^7.10.0",
|
|
84
|
+
"vitest": "^3.1.4"
|
|
83
85
|
},
|
|
84
86
|
"packageManager": "pnpm@10.11.0",
|
|
85
87
|
"engines": {
|
|
File without changes
|
|
File without changes
|
|
File without changes
|