@revojs/bun 0.0.76

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.
@@ -0,0 +1,2 @@
1
+ import { type Module } from "revojs";
2
+ export declare function bun(): Module;
package/dist/index.js ADDED
@@ -0,0 +1,9 @@
1
+ //#region src/index.ts
2
+ function bun() {
3
+ return { setup(app) {
4
+ app.config.server.entry = "@revojs/bun/runtime";
5
+ } };
6
+ }
7
+
8
+ //#endregion
9
+ export { bun };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,17 @@
1
+ import { serve } from "bun";
2
+ import { RUNTIME_CONTEXT, Scope } from "revojs";
3
+ import { runtime } from "#virtual/runtime";
4
+
5
+ //#region src/runtime/index.ts
6
+ serve({ fetch: async (request) => {
7
+ const scope = new Scope();
8
+ scope.setContext(RUNTIME_CONTEXT, {
9
+ tasks: new Array(),
10
+ request,
11
+ response: { headers: new Headers() },
12
+ variables: process.env
13
+ });
14
+ return await runtime.fetch(scope).finally(() => scope.stop());
15
+ } });
16
+
17
+ //#endregion
package/package.json ADDED
@@ -0,0 +1,38 @@
1
+ {
2
+ "name": "@revojs/bun",
3
+ "version": "0.0.76",
4
+ "type": "module",
5
+ "repository": "coverbase/revojs",
6
+ "license": "MIT",
7
+ "exports": {
8
+ ".": {
9
+ "types": "./dist/index.d.ts",
10
+ "import": "./dist/index.js"
11
+ },
12
+ "./runtime": {
13
+ "types": "./dist/runtime/index.d.ts",
14
+ "import": "./dist/runtime/index.js"
15
+ }
16
+ },
17
+ "types": "./dist/index.d.ts",
18
+ "module": "./dist/index.js",
19
+ "main": "./dist/index.js",
20
+ "files": [
21
+ "dist"
22
+ ],
23
+ "scripts": {
24
+ "build": "rolldown -c rolldown.config.ts && tsc",
25
+ "watch": "rolldown -w -c rolldown.config.ts && tsc --watch"
26
+ },
27
+ "dependencies": {
28
+ "revojs": "*"
29
+ },
30
+ "optionalDependencies": {
31
+ "@rolldown/binding-linux-x64-gnu": "*"
32
+ },
33
+ "devDependencies": {
34
+ "@revojs/tsconfig": "*",
35
+ "@types/bun": "^1.2.18",
36
+ "rolldown": "^1.0.0-beta.19"
37
+ }
38
+ }