qarpeo 0.1.14 → 0.1.16

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.
@@ -784,4 +784,4 @@ const wrangler = {
784
784
  resolveProjectName: resolveProjectName
785
785
  };
786
786
 
787
- export { resolveBindingName as a, checkDrizzleVersion as b, createWranglerConfig as c, findJobFiles as d, applyD1Migrations as e, findQueueFiles as f, generateDevWranglerConfig as g, findSchemaFiles as h, resolveBinaryPath as i, ensurePackage as j, getLocalDatabaseContext as k, getJiti as l, findLocalD1Database as m, localDb as n, resolveProjectName as r, scanSchemaExports as s, wrangler as w };
787
+ export { checkDrizzleVersion as a, resolveProjectName as b, createWranglerConfig as c, findJobFiles as d, applyD1Migrations as e, findQueueFiles as f, generateDevWranglerConfig as g, findSchemaFiles as h, resolveBinaryPath as i, ensurePackage as j, getLocalDatabaseContext as k, getJiti as l, findLocalD1Database as m, localDb as n, resolveBindingName as r, scanSchemaExports as s, wrangler as w };
@@ -4,7 +4,7 @@ import { spawnSync } from 'node:child_process';
4
4
  import { existsSync, mkdirSync, writeFileSync, readFileSync, readdirSync, statSync } from 'node:fs';
5
5
  import { loadNuxtConfig } from '@nuxt/kit';
6
6
  import { resolve, join } from 'pathe';
7
- import { h as findSchemaFiles, i as resolveBinaryPath, j as ensurePackage, k as getLocalDatabaseContext, l as getJiti, r as resolveProjectName, b as checkDrizzleVersion, m as findLocalD1Database } from '../chunks/wrangler.mjs';
7
+ import { h as findSchemaFiles, i as resolveBinaryPath, j as ensurePackage, k as getLocalDatabaseContext, l as getJiti, b as resolveProjectName, a as checkDrizzleVersion, m as findLocalD1Database } from '../chunks/wrangler.mjs';
8
8
  import { reset, seed } from 'drizzle-seed';
9
9
  import { stdin, stdout } from 'node:process';
10
10
  import readline from 'node:readline/promises';
@@ -2209,7 +2209,7 @@ const whoami = defineCommand({
2209
2209
  const main = defineCommand({
2210
2210
  meta: {
2211
2211
  name: "qp",
2212
- version: "0.1.14",
2212
+ version: "0.1.16",
2213
2213
  description: "Cloudflare-native powerhouse module for Nuxt"
2214
2214
  },
2215
2215
  subCommands: {
package/dist/module.mjs CHANGED
@@ -4,7 +4,7 @@ import { fileURLToPath } from 'node:url';
4
4
  import { defineNuxtModule, useLogger, createResolver, addTemplate, addComponent, hasNuxtModule, installModule, addNitroPlugin, addImports, addServerImports, addTypeTemplate, updateTemplates, addServerImportsDir, addServerHandler, addRouteMiddleware, addPlugin, extendPages } from '@nuxt/kit';
5
5
  import { defu } from 'defu';
6
6
  import { join, resolve, extname, basename, dirname, normalize, relative } from 'pathe';
7
- import { c as createWranglerConfig, r as resolveProjectName, a as resolveBindingName, b as checkDrizzleVersion, s as scanSchemaExports, f as findQueueFiles, d as findJobFiles, g as generateDevWranglerConfig, e as applyD1Migrations, h as findSchemaFiles } from './chunks/wrangler.mjs';
7
+ import { c as createWranglerConfig, r as resolveBindingName, a as checkDrizzleVersion, s as scanSchemaExports, b as resolveProjectName, f as findQueueFiles, d as findJobFiles, g as generateDevWranglerConfig, e as applyD1Migrations, h as findSchemaFiles } from './chunks/wrangler.mjs';
8
8
  import { generateAuthSchema } from './chunks/auth-schema.mjs';
9
9
  export { getActiveAuthTableNames } from './chunks/auth-schema.mjs';
10
10
  import { createHash } from 'node:crypto';
@@ -19,7 +19,7 @@ import 'drizzle-orm/node-sqlite';
19
19
  import 'node:process';
20
20
  import 'node:readline/promises';
21
21
 
22
- const version = "0.1.14";
22
+ const version = "0.1.16";
23
23
 
24
24
  function ensureDevEnv(rootDir) {
25
25
  const envPath = join(rootDir, ".env");
@@ -1488,51 +1488,6 @@ ${extraSources}
1488
1488
  const configPath = resolve(nuxt.options.buildDir, "wrangler.json");
1489
1489
  process.env.QARPEO_WRANGLER_CONFIG = configPath;
1490
1490
  process.env.QARPEO_PERSIST_PATH = resolve(nuxt.options.rootDir, ".wrangler/state/v3");
1491
- nuxt.hook("ready", async () => {
1492
- try {
1493
- const { existsSync: existsSync2, mkdirSync, writeFileSync } = await import('node:fs');
1494
- const voidDir = resolve(nuxt.options.rootDir, ".void");
1495
- if (!existsSync2(voidDir)) {
1496
- mkdirSync(voidDir, { recursive: true });
1497
- }
1498
- const inferenceImports = [
1499
- "// Auto-generated by Qarpeo for Void Resource Inference",
1500
- "// Triggers Void (void.cloud) to provision Cloudflare bindings automatically"
1501
- ];
1502
- if (options.db) inferenceImports.push('import { db } from "void/db"');
1503
- if (options.kv) inferenceImports.push('import { kv } from "void/kv"');
1504
- if (options.blob) inferenceImports.push('import { storage } from "void/storage"');
1505
- if (options.ai) inferenceImports.push('import { ai } from "void/ai"');
1506
- if (options.realtime) inferenceImports.push('import { defineLiveStream } from "void/live"');
1507
- if (options.queue) inferenceImports.push('import { queues } from "void/queues"');
1508
- writeFileSync(resolve(voidDir, "inference.ts"), inferenceImports.join("\n") + "\n", "utf-8");
1509
- if (options.auth) {
1510
- writeFileSync(
1511
- resolve(voidDir, "better-auth-schema.ts"),
1512
- generateAuthSchema(options.auth),
1513
- "utf-8"
1514
- );
1515
- }
1516
- const voidConfigPath = resolve(nuxt.options.rootDir, "void.config.ts");
1517
- if (!existsSync2(voidConfigPath)) {
1518
- const projectName = resolveProjectName(nuxt, options);
1519
- const voidConfigContent = [
1520
- 'import { defineConfig } from "void/config"',
1521
- "",
1522
- "export default defineConfig({",
1523
- " cloudflare: {",
1524
- ` name: "${projectName}",`,
1525
- ' compatibility_date: "2026-02-24",',
1526
- ' compatibility_flags: ["nodejs_compat", "nodejs_als"],',
1527
- " },",
1528
- "})",
1529
- ""
1530
- ].join("\n");
1531
- writeFileSync(voidConfigPath, voidConfigContent, "utf-8");
1532
- }
1533
- } catch {
1534
- }
1535
- });
1536
1491
  if (options.remote) {
1537
1492
  process.env.QARPEO_CF_REMOTE = "1";
1538
1493
  const hasAccountId = process.env.CLOUDFLARE_ACCOUNT_ID || process.env.CF_ACCOUNT_ID;
@@ -1,2 +1,2 @@
1
- declare const _default: import("h3").EventHandlerWithFetch<import("h3").EventHandlerRequest, Promise<Response>>;
1
+ declare const _default: import("nuxt/server").EventHandler<Promise<Response>>;
2
2
  export default _default;
@@ -1,11 +1,19 @@
1
- import { defineEventHandler, readRawBody } from "h3";
1
+ import { defineEventHandler, getRequestURL, getRequestHeaders, readBody } from "nuxt/server";
2
2
  import { serverAuth } from "../../utils/auth.mjs";
3
3
  export default defineEventHandler(async (event) => {
4
4
  const auth = serverAuth(event);
5
- const req = event.req instanceof Request ? event.req : new Request(`http://${event.headers?.get?.("host") || "localhost"}${event.path || "/api/auth"}`, {
6
- method: event.method,
7
- headers: event.headers,
8
- body: ["POST", "PUT", "PATCH"].includes(event.method) ? await readRawBody(event) : void 0
5
+ const req = event.web?.request || event.req;
6
+ if (req instanceof Request) {
7
+ return auth.handler(req);
8
+ }
9
+ const url = getRequestURL(event);
10
+ const headers = getRequestHeaders(event);
11
+ const method = event.method || "GET";
12
+ const body = ["POST", "PUT", "PATCH"].includes(method) ? await readBody(event).catch(() => void 0) : void 0;
13
+ const request = new Request(url.toString(), {
14
+ method,
15
+ headers,
16
+ body: body ? typeof body === "string" ? body : JSON.stringify(body) : void 0
9
17
  });
10
- return auth.handler(req);
18
+ return auth.handler(request);
11
19
  });
@@ -1,6 +1,6 @@
1
1
  import { betterAuth } from "better-auth";
2
2
  import { drizzleAdapter } from "@better-auth/drizzle-adapter";
3
- import { createError } from "h3";
3
+ import { createError } from "nuxt/server";
4
4
  import { useDrizzle } from "./drizzle.mjs";
5
5
  import * as authSchema from "#qarpeo/auth/schema";
6
6
  export function serverAuth(event) {
@@ -4,6 +4,6 @@ export declare const ALL_AUTH_TABLE_NAMES: readonly ["user", "account", "session
4
4
  export declare function getActiveAuthTableNames(auth?: boolean | AuthOptions): string[];
5
5
  /**
6
6
  * Composes Drizzle SQLite schema conforming to the official Better Auth / void/auth specifications.
7
- * Merged at build time into `#qarpeo/auth/schema` and written to `.void/better-auth-schema.ts`.
7
+ * Merged at build time into `#qarpeo/auth/schema` and virtual `@schema`.
8
8
  */
9
9
  export declare function generateAuthSchema(auth?: boolean | AuthOptions): string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "qarpeo",
3
- "version": "0.1.14",
3
+ "version": "0.1.16",
4
4
  "description": "Zero-config Cloudflare Edge Platform for Nuxt",
5
5
  "keywords": [
6
6
  "analytics-engine",