@revojs/cloudflare 0.1.48 → 0.1.49

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("./module/server.ts");
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,8 @@
1
+ import { Context } from "revojs";
2
+
3
+ //#region src/runtime/server.d.ts
4
+ declare const _default: {
5
+ fetch(request: Request, variables: Context): Promise<void | Response>;
6
+ };
7
+ //#endregion
8
+ export { _default as default };
@@ -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,24 +1,23 @@
1
1
  {
2
2
  "name": "@revojs/cloudflare",
3
- "version": "0.1.48",
3
+ "version": "0.1.49",
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.mjs",
11
- "module": "./dist/index.mjs",
12
- "types": "./dist/index.d.mts",
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.mts",
16
- "import": "./dist/index.mjs"
15
+ "types": "./dist/index.d.ts",
16
+ "import": "./dist/index.js"
17
17
  }
18
18
  },
19
19
  "scripts": {
20
- "build": "tsdown",
21
- "watch": "tsdown -w"
20
+ "build": "revojs module build"
22
21
  },
23
22
  "dependencies": {
24
23
  "@cloudflare/workers-types": "^4.20260402.1",
@@ -26,7 +25,6 @@
26
25
  "wrangler": "^4.79.0"
27
26
  },
28
27
  "devDependencies": {
29
- "@revojs/tsconfig": "*",
30
- "tsdown": "^0.21.7"
28
+ "@revojs/tsconfig": "*"
31
29
  }
32
30
  }
@@ -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