@revojs/cloudflare 0.1.21 → 0.1.23

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/index.js CHANGED
@@ -6,8 +6,8 @@ import { getPlatformProxy } from "wrangler";
6
6
  let proxy;
7
7
  function cloudflare() {
8
8
  return { setup(app) {
9
- const { toPath } = useKit(app, import.meta.url);
10
- app.config.server = toPath("./module/server.ts");
9
+ const { fromModule } = useKit(import.meta.url);
10
+ app.config.server = fromModule("./module/server.ts");
11
11
  app.config.development.middlewares.push({ async fetch(scope, next) {
12
12
  const { request, response } = useServer(scope);
13
13
  proxy ??= await getPlatformProxy();
@@ -5,17 +5,14 @@ export default {
5
5
  const server = await import("#virtual/server").then((module) => module.default);
6
6
 
7
7
  const scope = new Scope();
8
- try {
9
- scope.setContext(SERVER_CONTEXT, {
10
- states: {},
11
- request,
12
- response: { headers: new Headers() },
13
- variables,
14
- });
15
8
 
16
- return await server.fetch(scope);
17
- } finally {
18
- scope.stop();
19
- }
9
+ scope.setContext(SERVER_CONTEXT, {
10
+ states: {},
11
+ request,
12
+ response: { headers: new Headers() },
13
+ variables,
14
+ });
15
+
16
+ return await server.fetch(scope);
20
17
  },
21
18
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@revojs/cloudflare",
3
- "version": "0.1.21",
3
+ "version": "0.1.23",
4
4
  "type": "module",
5
5
  "repository": "coverbase/revojs",
6
6
  "license": "MIT",