@revojs/cloudflare 0.1.48 → 0.1.50
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.
|
@@ -6,7 +6,7 @@ let proxy;
|
|
|
6
6
|
function cloudflare() {
|
|
7
7
|
return { setup(app) {
|
|
8
8
|
const { fromModule } = useKit(import.meta.url);
|
|
9
|
-
app.config.server = fromModule("./
|
|
9
|
+
app.config.server = fromModule("./runtime/server.js");
|
|
10
10
|
app.config.development.middleware.push({ async fetch(scope, next) {
|
|
11
11
|
const { request, response } = useServer(scope);
|
|
12
12
|
proxy ??= await getPlatformProxy();
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { SERVER_CONTEXT, Scope } from "revojs";
|
|
2
|
+
//#region src/runtime/server.ts
|
|
3
|
+
var server_default = { async fetch(request, variables) {
|
|
4
|
+
const server = await import("#server").then((module) => module.default);
|
|
5
|
+
const scope = new Scope();
|
|
6
|
+
scope.setContext(SERVER_CONTEXT, {
|
|
7
|
+
states: {},
|
|
8
|
+
request,
|
|
9
|
+
response: { headers: new Headers() },
|
|
10
|
+
variables
|
|
11
|
+
});
|
|
12
|
+
return await server.fetch(scope);
|
|
13
|
+
} };
|
|
14
|
+
//#endregion
|
|
15
|
+
export { server_default as default };
|
package/package.json
CHANGED
|
@@ -1,32 +1,30 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@revojs/cloudflare",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.50",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"repository": "tellua/revojs",
|
|
6
6
|
"files": [
|
|
7
7
|
"dist"
|
|
8
8
|
],
|
|
9
9
|
"type": "module",
|
|
10
|
-
"main": "./dist/index.
|
|
11
|
-
"module": "./dist/index.
|
|
12
|
-
"types": "./dist/index.d.
|
|
10
|
+
"main": "./dist/index.js",
|
|
11
|
+
"module": "./dist/index.js",
|
|
12
|
+
"types": "./dist/index.d.ts",
|
|
13
13
|
"exports": {
|
|
14
14
|
".": {
|
|
15
|
-
"types": "./dist/index.d.
|
|
16
|
-
"import": "./dist/index.
|
|
15
|
+
"types": "./dist/index.d.ts",
|
|
16
|
+
"import": "./dist/index.js"
|
|
17
17
|
}
|
|
18
18
|
},
|
|
19
19
|
"scripts": {
|
|
20
|
-
"build": "
|
|
21
|
-
"watch": "tsdown -w"
|
|
20
|
+
"build": "revojs module build"
|
|
22
21
|
},
|
|
23
22
|
"dependencies": {
|
|
24
|
-
"@cloudflare/workers-types": "^4.
|
|
23
|
+
"@cloudflare/workers-types": "^4.20260412.1",
|
|
25
24
|
"revojs": "*",
|
|
26
|
-
"wrangler": "^4.
|
|
25
|
+
"wrangler": "^4.81.1"
|
|
27
26
|
},
|
|
28
27
|
"devDependencies": {
|
|
29
|
-
"@revojs/tsconfig": "*"
|
|
30
|
-
"tsdown": "^0.21.7"
|
|
28
|
+
"@revojs/tsconfig": "*"
|
|
31
29
|
}
|
|
32
30
|
}
|
package/dist/module/server.ts
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { type Context, Scope, SERVER_CONTEXT } from "revojs";
|
|
2
|
-
|
|
3
|
-
export default {
|
|
4
|
-
async fetch(request: Request, variables: Context) {
|
|
5
|
-
const server = await import("#server").then((module) => module.default);
|
|
6
|
-
|
|
7
|
-
const scope = new Scope();
|
|
8
|
-
|
|
9
|
-
scope.setContext(SERVER_CONTEXT, {
|
|
10
|
-
states: {},
|
|
11
|
-
request,
|
|
12
|
-
response: { headers: new Headers() },
|
|
13
|
-
variables,
|
|
14
|
-
});
|
|
15
|
-
|
|
16
|
-
return await server.fetch(scope);
|
|
17
|
-
},
|
|
18
|
-
};
|
|
File without changes
|