@aklinker1/zeta 1.2.2 → 1.2.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/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aklinker1/zeta",
|
|
3
3
|
"description": "Composable, testable, OpenAPI-first backend framework with validation built-in",
|
|
4
|
-
"version": "1.2.
|
|
4
|
+
"version": "1.2.3",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"packageManager": "bun@1.3.2",
|
|
@@ -19,7 +19,8 @@
|
|
|
19
19
|
"files": [
|
|
20
20
|
"src/*.ts",
|
|
21
21
|
"src/adapters/*.ts",
|
|
22
|
-
"src/internal/*.ts"
|
|
22
|
+
"src/internal/*.ts",
|
|
23
|
+
"src/transports/*.ts"
|
|
23
24
|
],
|
|
24
25
|
"publishConfig": {
|
|
25
26
|
"access": "public"
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { Transport } from "../types";
|
|
2
|
+
// @ts-ignore: Bun types may not be available
|
|
3
|
+
import type { ServeFunctionOptions } from "@types/bun";
|
|
4
|
+
|
|
5
|
+
export function createBunTransport(
|
|
6
|
+
options: Omit<ServeFunctionOptions<any, any>, "fetch" | "port">,
|
|
7
|
+
): Transport {
|
|
8
|
+
const listen: Transport["listen"] = (port, fetch, cb) => {
|
|
9
|
+
// @ts-ignore: Bun types may not be available
|
|
10
|
+
Bun.serve({ ...options, port, fetch });
|
|
11
|
+
if (cb) setTimeout(cb, 0);
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
return {
|
|
15
|
+
listen,
|
|
16
|
+
};
|
|
17
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { Transport } from "../types";
|
|
2
|
+
|
|
3
|
+
export function createDenoTransport(): Transport {
|
|
4
|
+
const listen: Transport["listen"] = (port, fetch, cb) => {
|
|
5
|
+
// @ts-ignore: Deno types may not be available
|
|
6
|
+
Deno.serve({ port, fetch });
|
|
7
|
+
if (cb) setTimeout(cb, 0);
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
return {
|
|
11
|
+
listen,
|
|
12
|
+
};
|
|
13
|
+
}
|