@lunora/nuxt 1.0.0-alpha.2 → 1.0.0-alpha.200
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/LICENSE.md +6 -0
- package/README.md +123 -15
- package/__assets__/package-og.svg +1 -1
- package/dist/module.d.mts +76 -7
- package/dist/module.d.ts +78 -0
- package/dist/module.json +2 -6
- package/dist/module.mjs +1 -29
- package/dist/runtime/cloudflare.d.mts +36 -0
- package/dist/runtime/cloudflare.d.ts +36 -0
- package/dist/runtime/cloudflare.mjs +1 -0
- package/dist/runtime/h3-request.d.mts +18 -0
- package/dist/runtime/h3-request.d.ts +18 -0
- package/dist/runtime/h3-request.mjs +1 -0
- package/dist/runtime/handler.d.mts +19 -0
- package/dist/runtime/handler.d.ts +19 -0
- package/dist/runtime/handler.mjs +1 -0
- package/dist/runtime/server/lunora.d.mts +92 -0
- package/dist/runtime/server/lunora.d.ts +92 -0
- package/dist/runtime/server/lunora.mjs +1 -0
- package/dist/server.d.mts +1 -1
- package/dist/server.d.ts +1 -0
- package/dist/server.mjs +1 -1
- package/package.json +10 -9
- package/dist/runtime/cloudflare.js +0 -12
- package/dist/runtime/handler.js +0 -21
- package/dist/runtime/server/lunora.js +0 -9
- package/dist/types.d.mts +0 -7
package/dist/runtime/handler.js
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
const NOOP_EXECUTION_CONTEXT = {
|
|
2
|
-
passThroughOnException: () => {
|
|
3
|
-
},
|
|
4
|
-
waitUntil: () => {
|
|
5
|
-
}
|
|
6
|
-
};
|
|
7
|
-
const delegateToLunora = async (worker, request, env, context) => {
|
|
8
|
-
if (!env) {
|
|
9
|
-
return Response.json(
|
|
10
|
-
{
|
|
11
|
-
error: {
|
|
12
|
-
code: "LUNORA_RUNTIME_UNAVAILABLE",
|
|
13
|
-
message: "Lunora could not read the Cloudflare bindings from the request. The `/_lunora/**` route only works on the Cloudflare Workers runtime (deployed, or `nuxt dev` with `nitro-cloudflare-dev`)."
|
|
14
|
-
}
|
|
15
|
-
},
|
|
16
|
-
{ status: 500 }
|
|
17
|
-
);
|
|
18
|
-
}
|
|
19
|
-
return worker.fetch(request, env, context ?? NOOP_EXECUTION_CONTEXT);
|
|
20
|
-
};
|
|
21
|
-
export { delegateToLunora, NOOP_EXECUTION_CONTEXT };
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { defineEventHandler, toWebRequest } from "h3";
|
|
2
|
-
import lunoraApp from "#lunora/app";
|
|
3
|
-
import { resolveCloudflare } from "../cloudflare.js";
|
|
4
|
-
import { delegateToLunora } from "../handler.js";
|
|
5
|
-
export default defineEventHandler(async (event) => {
|
|
6
|
-
const { ctx, env } = resolveCloudflare(event);
|
|
7
|
-
const request = toWebRequest(event);
|
|
8
|
-
return delegateToLunora(lunoraApp, request, env, ctx);
|
|
9
|
-
});
|
package/dist/types.d.mts
DELETED