@lunora/nuxt 1.0.0-alpha.4 → 1.0.0-alpha.41

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 CHANGED
@@ -103,3 +103,9 @@ Unless required by applicable law or agreed to in writing, software distributed
103
103
  under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
104
104
  CONDITIONS OF ANY KIND, either express or implied. See the License for the
105
105
  specific language governing permissions and limitations under the License.
106
+
107
+ <!-- DEPENDENCIES -->
108
+ <!-- /DEPENDENCIES -->
109
+
110
+ <!-- TYPE_DEPENDENCIES -->
111
+ <!-- /TYPE_DEPENDENCIES -->
package/README.md CHANGED
@@ -59,14 +59,23 @@ export default defineNuxtConfig({
59
59
  });
60
60
  ```
61
61
 
62
- Add `exports.cloudflare.ts` to the project root so the `ShardDO` Durable Object
63
- class is exported from the emitted worker entry:
62
+ Add a `worker.ts` wrapper at the project root and point `wrangler.jsonc`'s `main`
63
+ at it, so the `ShardDO` Durable Object class is exported from the deployed worker.
64
+ Nitro's `cloudflare_module` output exports only the SSR handler, so `main` must
65
+ point at the wrapper — not the raw `.output/server/index.mjs` — or `wrangler deploy`
66
+ fails on the missing DO class:
64
67
 
65
68
  ```ts
66
- // exports.cloudflare.ts
69
+ // worker.ts
70
+ export { default } from "./.output/server/index.mjs";
67
71
  export { ShardDO } from "./lunora/server";
68
72
  ```
69
73
 
74
+ ```jsonc
75
+ // wrangler.jsonc
76
+ { "main": "worker.ts" }
77
+ ```
78
+
70
79
  `lunora/server.ts` is your built Lunora app (`defineApp().build()`) — its default
71
80
  export is the worker (a `fetch` entrypoint), and it re-exports `ShardDO`. The
72
81
  module aliases the `#lunora/app` virtual to it (configurable via the `lunora.appEntry`
@@ -88,8 +97,8 @@ option, default `~/lunora/server`) and serves it at the `/_lunora/**` route
88
97
  and forwards to your app's `fetch`. A missing Cloudflare runtime answers a clear 500.
89
98
  - **`#lunora/app` alias**: points the route's worker import at your app entry,
90
99
  forwarded into the Nitro server bundle via `nuxt.options.alias`.
91
- - **`ShardDO`** rides to the worker entry through your root `exports.cloudflare.ts`
92
- (the `cloudflare_module` preset appends its exports).
100
+ - **`ShardDO`** rides to the deployed worker through your root `worker.ts` wrapper
101
+ (`wrangler.jsonc`'s `main`), which re-exports Nitro's SSR handler and `ShardDO`.
93
102
 
94
103
  ## Verify before deploy
95
104
 
@@ -102,11 +111,12 @@ Single-worker composition rides on two Nitro behaviours that vary across version
102
111
  subscriptions never connect while RPC does, Nitro is normalising the upgrade
103
112
  response and `/_lunora/ws` needs a deploy-boundary handoff instead of the H3
104
113
  route return.
105
- 2. **`exports.cloudflare.ts` hook.** The `cloudflare_module` preset must append
106
- this file's exports onto the worker entry. If `wrangler deploy` fails with
107
- "ShardDO class not exported", your Nitro version may use a different hook
108
- (`nitro.cloudflare.additionalModules`, or a `rollupConfig` output export). The
109
- module `warn()`s when the file is missing but can't verify the hook fires.
114
+ 2. **`worker.ts` wrapper.** `wrangler.jsonc`'s `main` must point at a root
115
+ `worker.ts` that re-exports Nitro's SSR handler _and_ `ShardDO` Nitro's
116
+ `cloudflare_module` output exports only the SSR handler. If `wrangler deploy`
117
+ fails with "ShardDO class not exported", check that `main` points at the
118
+ wrapper and that it re-exports `ShardDO`. The module `warn()`s when
119
+ `worker.ts` is missing but can't verify wrangler's `main` points at it.
110
120
 
111
121
  ## Server data-loading
112
122
 
@@ -115,6 +125,30 @@ Single-worker composition rides on two Nitro behaviours that vary across version
115
125
  reactive-loader handoff. Safe to import from a Nitro server route (no WebSocket,
116
126
  no browser globals).
117
127
 
128
+ ## Feature flags
129
+
130
+ `@lunora/nuxt` ships no flag composable — Nuxt _is_ Vue, so read `ctx.flags`
131
+ server-side (a Nitro route, a function, or a reactive loader) and pass the
132
+ resolved value down, or call `useFlag` / `useFlags` from
133
+ [`@lunora/vue`](https://www.npmjs.com/package/@lunora/vue) directly in a
134
+ component for live updates over the WebSocket. Requires
135
+ [`@lunora/flags`](https://www.npmjs.com/package/@lunora/flags) wired in
136
+ `lunora/flags.ts`.
137
+
138
+ ```vue
139
+ <script setup lang="ts">
140
+ import { useFlag } from "@lunora/vue";
141
+
142
+ // Live over the Lunora WS — holds `false` until the server resolves it.
143
+ const newHero = useFlag("homepage-hero", false);
144
+ </script>
145
+
146
+ <template>
147
+ <NewHero v-if="newHero" />
148
+ <ClassicHero v-else />
149
+ </template>
150
+ ```
151
+
118
152
  ## Supported Node.js Versions
119
153
 
120
154
  Libraries in this ecosystem make the best effort to track [Node.js' release schedule](https://github.com/nodejs/release#release-schedule).
@@ -0,0 +1,24 @@
1
+ import { defineNuxtModule } from '@nuxt/kit';
2
+ /** Options for the `@lunora/nuxt` module (configurable under the `lunora` key in `nuxt.config`). */
3
+ interface ModuleOptions {
4
+ /**
5
+ * Module specifier of the Lunora app entry — its default export is the built
6
+ * worker (`defineApp().build()` / `createWorker(...)`) and it re-exports
7
+ * `ShardDO`. Aliased to the `#lunora/app` virtual the server route imports.
8
+ */
9
+ appEntry: string;
10
+ /** URL prefix Lunora realtime is mounted at. */
11
+ prefix: string;
12
+ }
13
+ /**
14
+ * Return type of `defineNuxtModule&lt;ModuleOptions>({...})` — the value overload of
15
+ * `defineNuxtModule` (the one taking a definition), extracted structurally so the
16
+ * default export has a locally-nameable type under `isolatedDeclarations` without
17
+ * importing `NuxtModule` from `@nuxt/schema` (not a resolvable dependency here).
18
+ */
19
+ type LunoraNuxtModule = typeof defineNuxtModule<ModuleOptions> extends {
20
+ (definition: infer _Definition): infer Result;
21
+ (): unknown;
22
+ } ? Result : never;
23
+ declare const lunoraNuxtModule: LunoraNuxtModule;
24
+ export { ModuleOptions, lunoraNuxtModule as default };
package/dist/module.js ADDED
@@ -0,0 +1,72 @@
1
+ import { existsSync } from 'node:fs';
2
+ import { join, resolve, dirname } from 'node:path';
3
+ import { defineNuxtModule, createResolver, addServerHandler, useLogger } from '@nuxt/kit';
4
+
5
+ const resolveTildePath = (specifier, rootDirectory, sourceDirectory) => {
6
+ if (specifier.startsWith("~~/")) {
7
+ return join(rootDirectory, specifier.slice(3));
8
+ }
9
+ if (specifier.startsWith("~/")) {
10
+ return join(sourceDirectory, specifier.slice(2));
11
+ }
12
+ if (specifier.startsWith("./") || specifier.startsWith("../")) {
13
+ return join(rootDirectory, specifier);
14
+ }
15
+ return specifier;
16
+ };
17
+
18
+ const JS_EXTENSION_SUFFIX = /\.js$/;
19
+ const lunoraTsSourceResolver = (rootDirectory) => {
20
+ const lunoraDirectory = join(rootDirectory, "lunora");
21
+ return {
22
+ name: "lunora:nitro-ts-source-resolve",
23
+ resolveId: {
24
+ handler(source, importer) {
25
+ if (!source.endsWith(".js")) {
26
+ return void 0;
27
+ }
28
+ let absolute;
29
+ if (source.startsWith("#lunora/")) {
30
+ absolute = join(lunoraDirectory, source.slice("#lunora/".length));
31
+ } else if (source.startsWith(".") && importer !== void 0) {
32
+ absolute = resolve(dirname(importer), source);
33
+ }
34
+ if (absolute === void 0) {
35
+ return void 0;
36
+ }
37
+ const tsSource = absolute.replace(JS_EXTENSION_SUFFIX, ".ts");
38
+ return existsSync(tsSource) ? tsSource : void 0;
39
+ },
40
+ order: "pre"
41
+ }
42
+ };
43
+ };
44
+ const lunoraNuxtModule = defineNuxtModule({
45
+ defaults: {
46
+ appEntry: "~/lunora/server",
47
+ prefix: "/_lunora"
48
+ },
49
+ meta: {
50
+ configKey: "lunora",
51
+ name: "@lunora/nuxt"
52
+ },
53
+ setup(options, nuxt) {
54
+ const resolver = createResolver(import.meta.url);
55
+ nuxt.options.alias["#lunora/app"] = resolveTildePath(options.appEntry, nuxt.options.rootDir, nuxt.options.srcDir);
56
+ nuxt.hook("nitro:config", (nitroConfig) => {
57
+ const plugins = [...nitroConfig.rollupConfig?.plugins ?? [], lunoraTsSourceResolver(nuxt.options.rootDir)];
58
+ nitroConfig.rollupConfig = { ...nitroConfig.rollupConfig, plugins };
59
+ });
60
+ addServerHandler({
61
+ handler: resolver.resolve("./runtime/server/lunora"),
62
+ route: `${options.prefix}/**`
63
+ });
64
+ if (!existsSync(join(nuxt.options.rootDir, "worker.ts"))) {
65
+ useLogger("@lunora/nuxt").warn(
66
+ 'missing worker.ts at the project root — add a wrapper that re-exports Nitro\'s handler and `ShardDO` (`export { default } from "./.output/server/index.mjs"; export { ShardDO } from "./lunora/server";`) and point wrangler\'s `main` at it, so the SHARD Durable Object is exported from the deployed worker.'
67
+ );
68
+ }
69
+ }
70
+ });
71
+
72
+ export { lunoraNuxtModule as default };
package/dist/module.json CHANGED
@@ -1,9 +1,5 @@
1
1
  {
2
2
  "configKey": "lunora",
3
3
  "name": "@lunora/nuxt",
4
- "version": "1.0.0-alpha.3",
5
- "builder": {
6
- "@nuxt/module-builder": "1.0.2",
7
- "unbuild": "unknown"
8
- }
9
- }
4
+ "version": "1.0.0-alpha.40"
5
+ }
@@ -0,0 +1,36 @@
1
+ import { ExecutionContextLike } from '@lunora/runtime';
2
+ export type { ExecutionContextLike } from '@lunora/runtime';
3
+ /** The `{ env, context|ctx }` payload Nitro attaches for the Cloudflare runtime. */
4
+ interface CloudflareEventBag {
5
+ context?: ExecutionContextLike;
6
+ ctx?: ExecutionContextLike;
7
+ env?: Record<string, unknown>;
8
+ }
9
+ /**
10
+ * Structural view of the bits of an H3 event the resolver reads. Both legacy
11
+ * (`context.cloudflare`) and current (`req.runtime.cloudflare`) shapes are
12
+ * optional so a real H3 `H3Event` is assignable here.
13
+ */
14
+ interface H3EventLike {
15
+ context?: {
16
+ cloudflare?: CloudflareEventBag;
17
+ };
18
+ req?: {
19
+ runtime?: {
20
+ cloudflare?: CloudflareEventBag;
21
+ };
22
+ };
23
+ }
24
+ /** Resolved Cloudflare runtime for one request: the bindings `env` and the optional `ExecutionContext`. */
25
+ interface ResolvedCloudflare {
26
+ ctx?: ExecutionContextLike;
27
+ env?: Record<string, unknown>;
28
+ }
29
+ /**
30
+ * Pull the Cloudflare `env` + `ExecutionContext` off a Nitro/H3 event, checking
31
+ * the legacy `event.context.cloudflare` shape first (present under
32
+ * `nitro-cloudflare-dev` in dev) and the newer `event.req.runtime.cloudflare`
33
+ * shape second. Returns `{}` when neither is present.
34
+ */
35
+ declare const resolveCloudflare: (event: H3EventLike) => ResolvedCloudflare;
36
+ export { type H3EventLike, type ResolvedCloudflare, resolveCloudflare };
@@ -1,3 +1,5 @@
1
+ import '@lunora/runtime';
2
+
1
3
  const resolveCloudflare = (event) => {
2
4
  const fromContext = event.context?.cloudflare;
3
5
  if (fromContext?.env) {
@@ -9,4 +11,5 @@ const resolveCloudflare = (event) => {
9
11
  }
10
12
  return {};
11
13
  };
14
+
12
15
  export { resolveCloudflare };
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Resolve the inbound web `Request` from an H3 event across the h3 v1 → v2 break.
3
+ *
4
+ * v1 exposes `toWebRequest(event)`; the v2 web-standards rewrite removed it and
5
+ * carries the web `Request` directly as `event.req`. The `@lunora/nuxt` peer is
6
+ * `h3: "^1.15.0"` (v1 — what Nuxt 4 / Nitro 2 run today); the v2 `event.req`
7
+ * branch is forward-compat for when a stable h3 v2 ships and the peer widens. We
8
+ * feature-detect `toWebRequest` at runtime rather than importing it statically —
9
+ * a named `import { toWebRequest }` would throw at module-eval under v2 (missing export).
10
+ *
11
+ * Kept as a pure helper (the `h3` namespace + event in, a `Request` out) so both
12
+ * branches are unit-tested without booting Nitro or installing a second h3 major.
13
+ */
14
+ interface H3RequestNamespace {
15
+ toWebRequest?: unknown;
16
+ }
17
+ declare const resolveWebRequest: (h3: H3RequestNamespace, event: unknown) => Request;
18
+ export { type H3RequestNamespace, resolveWebRequest };
@@ -0,0 +1,3 @@
1
+ const resolveWebRequest = (h3, event) => typeof h3.toWebRequest === "function" ? h3.toWebRequest(event) : event.req;
2
+
3
+ export { resolveWebRequest };
@@ -0,0 +1,19 @@
1
+ import { ExecutionContextLike } from '@lunora/runtime';
2
+ export { NOOP_EXECUTION_CONTEXT } from '@lunora/runtime';
3
+ /**
4
+ * Structural view of the Lunora worker the route delegates to — just the
5
+ * `fetch` entrypoint. Both `createWorker(...)` and the generated
6
+ * `defineApp().build()` app satisfy it (a `ComposedApp` is a superset). Declared
7
+ * locally so `@lunora/nuxt` doesn't hard-depend on `@lunora/runtime`'s worker type.
8
+ */
9
+ interface LunoraWorkerLike {
10
+ fetch: (request: Request, env: unknown, context: ExecutionContextLike) => Promise<Response> | Response;
11
+ }
12
+ /**
13
+ * Forward one inbound request to the Lunora worker. `env` must be the Cloudflare
14
+ * bindings (carrying the `SHARD` Durable Object namespace); when it is missing
15
+ * the Cloudflare runtime wasn't available (e.g. a non-CF preview), so we answer
16
+ * a clear 500 rather than handing the worker an `undefined` env.
17
+ */
18
+ declare const delegateToLunora: (worker: LunoraWorkerLike, request: Request, env: Record<string, unknown> | undefined, context?: ExecutionContextLike) => Promise<Response>;
19
+ export { type LunoraWorkerLike, delegateToLunora };
@@ -1,9 +1,6 @@
1
- const NOOP_EXECUTION_CONTEXT = {
2
- passThroughOnException: () => {
3
- },
4
- waitUntil: () => {
5
- }
6
- };
1
+ import { NOOP_EXECUTION_CONTEXT } from '@lunora/runtime';
2
+ export { NOOP_EXECUTION_CONTEXT } from '@lunora/runtime';
3
+
7
4
  const delegateToLunora = async (worker, request, env, context) => {
8
5
  if (!env) {
9
6
  return Response.json(
@@ -18,4 +15,5 @@ const delegateToLunora = async (worker, request, env, context) => {
18
15
  }
19
16
  return worker.fetch(request, env, context ?? NOOP_EXECUTION_CONTEXT);
20
17
  };
21
- export { delegateToLunora, NOOP_EXECUTION_CONTEXT };
18
+
19
+ export { delegateToLunora };
@@ -0,0 +1,93 @@
1
+ import { QueryObject } from 'ufo';
2
+ import { Hooks } from 'crossws';
3
+ import { IncomingMessage, ServerResponse } from 'node:http';
4
+ import 'node:stream';
5
+ interface NodeEventContext {
6
+ req: IncomingMessage & {
7
+ originalUrl?: string;
8
+ };
9
+ res: ServerResponse;
10
+ }
11
+ interface WebEventContext {
12
+ request?: Request;
13
+ url?: URL;
14
+ }
15
+ declare class H3Event<_RequestT extends EventHandlerRequest = EventHandlerRequest> implements Pick<FetchEvent, "respondWith"> {
16
+ "__is_event__": boolean;
17
+ node: NodeEventContext;
18
+ web?: WebEventContext;
19
+ context: H3EventContext;
20
+ _method?: HTTPMethod;
21
+ _path?: string;
22
+ _headers?: Headers;
23
+ _requestBody?: BodyInit;
24
+ _handled: boolean;
25
+ _onBeforeResponseCalled: boolean | undefined;
26
+ _onAfterResponseCalled: boolean | undefined;
27
+ constructor(req: IncomingMessage, res: ServerResponse);
28
+ get method(): HTTPMethod;
29
+ get path(): string;
30
+ get headers(): Headers;
31
+ get handled(): boolean;
32
+ respondWith(response: Response | PromiseLike<Response>): Promise<void>;
33
+ toString(): string;
34
+ toJSON(): string;
35
+ /** @deprecated Please use `event.node.req` instead. */
36
+ get req(): IncomingMessage & {
37
+ originalUrl?: string;
38
+ };
39
+ /** @deprecated Please use `event.node.res` instead. */
40
+ get res(): ServerResponse<IncomingMessage>;
41
+ }
42
+ type SessionDataT = Record<string, any>;
43
+ type SessionData<T extends SessionDataT = SessionDataT> = T;
44
+ declare const getSessionPromise: unique symbol;
45
+ interface Session<T extends SessionDataT = SessionDataT> {
46
+ id: string;
47
+ createdAt: number;
48
+ data: SessionData<T>;
49
+ [getSessionPromise]?: Promise<Session<T>>;
50
+ }
51
+ type RouterMethod = Lowercase<HTTPMethod>;
52
+ interface RouteNode {
53
+ handlers: Partial<Record<RouterMethod | "all", EventHandler>>;
54
+ path: string;
55
+ }
56
+ type HTTPMethod = "GET" | "HEAD" | "PATCH" | "POST" | "PUT" | "DELETE" | "CONNECT" | "OPTIONS" | "TRACE";
57
+ interface H3EventContext extends Record<string, any> {
58
+ params?: Record<string, string>;
59
+ /**
60
+ * Matched router Node
61
+ *
62
+ * @experimental The object structure may change in non-major version.
63
+ */
64
+ matchedRoute?: RouteNode;
65
+ sessions?: Record<string, Session>;
66
+ clientAddress?: string;
67
+ }
68
+ type EventHandlerResponse<T = any> = T | Promise<T>;
69
+ interface EventHandlerRequest {
70
+ body?: any;
71
+ query?: QueryObject;
72
+ routerParams?: Record<string, string>;
73
+ }
74
+ type MaybePromise<T> = T | Promise<T>;
75
+ type EventHandlerResolver = (path: string) => MaybePromise<undefined | {
76
+ route?: string;
77
+ handler: EventHandler;
78
+ }>;
79
+ interface EventHandler<Request extends EventHandlerRequest = EventHandlerRequest, Response extends EventHandlerResponse = EventHandlerResponse> {
80
+ __is_handler__?: true;
81
+ __resolve__?: EventHandlerResolver;
82
+ __websocket__?: Partial<Hooks>;
83
+ (event: H3Event<Request>): Response;
84
+ }
85
+ /**
86
+ * Forward `/_lunora/**` to the Lunora worker. We reconstruct a Web `Request`
87
+ * from the H3 event (Lunora speaks the Web Fetch contract — RPC bodies and the
88
+ * WebSocket `Upgrade` handshake), resolve the Cloudflare `env`/`ExecutionContext`
89
+ * off the event, and return the worker's `Response` verbatim (H3 streams it,
90
+ * including a `101 Switching Protocols` upgrade with its `webSocket`).
91
+ */
92
+ declare const lunoraEventHandler: EventHandler;
93
+ export { lunoraEventHandler as default };
@@ -1,9 +1,13 @@
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) => {
1
+ import * as h3 from 'h3';
2
+ import lunoraApp from '#lunora/app';
3
+ import { resolveCloudflare } from '../cloudflare.js';
4
+ import { resolveWebRequest } from '../h3-request.js';
5
+ import { delegateToLunora } from '../handler.js';
6
+
7
+ const lunoraEventHandler = h3.defineEventHandler(async (event) => {
6
8
  const { ctx, env } = resolveCloudflare(event);
7
- const request = toWebRequest(event);
9
+ const request = resolveWebRequest(h3, event);
8
10
  return delegateToLunora(lunoraApp, request, env, ctx);
9
11
  });
12
+
13
+ export { lunoraEventHandler as default };
@@ -0,0 +1 @@
1
+ export { type ArgsOf, type AuthLike, type FunctionReference, type HeadersSource, type Preloaded, type ReturnOf, type ServerClientOptions, type ServerSession, createServerClient, deserializePreloaded, getServerSession, preloadQuery, preloadedQueryResult, serializePreloaded } from '@lunora/client/ssr';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lunora/nuxt",
3
- "version": "1.0.0-alpha.4",
3
+ "version": "1.0.0-alpha.41",
4
4
  "description": "Nuxt module for Lunora — single-worker composition (mounts /_lunora/* into Nitro) plus reactive-loader server helpers",
5
5
  "keywords": [
6
6
  "cloudflare",
@@ -33,17 +33,17 @@
33
33
  ],
34
34
  "type": "module",
35
35
  "sideEffects": false,
36
- "main": "./dist/module.mjs",
37
- "module": "./dist/module.mjs",
38
- "types": "./dist/types.d.mts",
36
+ "main": "./dist/module.js",
37
+ "module": "./dist/module.js",
38
+ "types": "./dist/module.d.ts",
39
39
  "exports": {
40
40
  ".": {
41
- "types": "./dist/types.d.mts",
42
- "import": "./dist/module.mjs"
41
+ "types": "./dist/module.d.ts",
42
+ "import": "./dist/module.js"
43
43
  },
44
44
  "./server": {
45
- "types": "./dist/server.d.mts",
46
- "import": "./dist/server.mjs"
45
+ "types": "./dist/server.d.ts",
46
+ "import": "./dist/server.js"
47
47
  },
48
48
  "./package.json": "./package.json"
49
49
  },
@@ -51,11 +51,12 @@
51
51
  "access": "public"
52
52
  },
53
53
  "dependencies": {
54
- "@lunora/client": "1.0.0-alpha.3",
55
- "@nuxt/kit": "^4.0.0"
54
+ "@lunora/client": "1.0.0-alpha.27",
55
+ "@lunora/runtime": "1.0.0-alpha.36",
56
+ "@nuxt/kit": "^4.4.8"
56
57
  },
57
58
  "peerDependencies": {
58
- "h3": "^1.0.0",
59
+ "h3": "^1.15.0",
59
60
  "nuxt": "^4.0.0"
60
61
  },
61
62
  "peerDependenciesMeta": {
package/dist/module.d.mts DELETED
@@ -1,9 +0,0 @@
1
- import * as nuxt_schema from 'nuxt/schema';
2
-
3
- interface ModuleOptions {
4
- appEntry: string;
5
- prefix: string;
6
- }
7
- declare const _default: nuxt_schema.NuxtModule<ModuleOptions, ModuleOptions, false>;
8
-
9
- export { _default as default };
package/dist/module.mjs DELETED
@@ -1,29 +0,0 @@
1
- import { existsSync } from 'node:fs';
2
- import { join } from 'node:path';
3
- import { defineNuxtModule, createResolver, addServerHandler, useLogger } from '@nuxt/kit';
4
-
5
- const module$1 = defineNuxtModule({
6
- defaults: {
7
- appEntry: "~/lunora/server",
8
- prefix: "/_lunora"
9
- },
10
- meta: {
11
- configKey: "lunora",
12
- name: "@lunora/nuxt"
13
- },
14
- setup(options, nuxt) {
15
- const resolver = createResolver(import.meta.url);
16
- nuxt.options.alias["#lunora/app"] = options.appEntry;
17
- addServerHandler({
18
- handler: resolver.resolve("./runtime/server/lunora"),
19
- route: `${options.prefix}/**`
20
- });
21
- if (!existsSync(join(nuxt.options.rootDir, "exports.cloudflare.ts"))) {
22
- useLogger("@lunora/nuxt").warn(
23
- 'missing exports.cloudflare.ts at the project root \u2014 add `export { ShardDO } from "./lunora/server";` so the SHARD Durable Object is exported from the worker.'
24
- );
25
- }
26
- }
27
- });
28
-
29
- export { module$1 as default };
package/dist/server.d.mts DELETED
@@ -1 +0,0 @@
1
- export { ArgsOf, AuthLike, FunctionReference, HeadersSource, Preloaded, ReturnOf, ServerClientOptions, ServerSession, createServerClient, deserializePreloaded, getServerSession, preloadQuery, preloadedQueryResult, serializePreloaded } from '@lunora/client/ssr';
package/dist/types.d.mts DELETED
@@ -1,7 +0,0 @@
1
- import type { NuxtModule } from '@nuxt/schema'
2
-
3
- import type { default as Module } from './module.mjs'
4
-
5
- export type ModuleOptions = typeof Module extends NuxtModule<infer O> ? Partial<O> : Record<string, any>
6
-
7
- export { default } from './module.mjs'
File without changes