qarpeo 0.1.24 → 0.1.26

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.
@@ -9,7 +9,7 @@ import { fileURLToPath } from 'node:url';
9
9
  import { mkdir, writeFile, readFile } from 'node:fs/promises';
10
10
  import { defu } from 'defu';
11
11
 
12
- const version = "0.1.24";
12
+ const version = "0.1.26";
13
13
 
14
14
  function scanSchemaExports(schemaFiles) {
15
15
  const types = [];
@@ -348,7 +348,8 @@ function applyD1Migrations(cwd, options = {}) {
348
348
  execPath = isWindows ? "wrangler.cmd" : "wrangler";
349
349
  }
350
350
  const dbName = options.dbName || "DB";
351
- const wranglerConfigPath = options.wranglerConfigPath || resolve(cwd, ".nuxt/wrangler.json");
351
+ const rootWranglerPath = resolve(cwd, "wrangler.json");
352
+ const wranglerConfigPath = options.wranglerConfigPath || (existsSync(rootWranglerPath) ? rootWranglerPath : resolve(cwd, ".nuxt/wrangler.json"));
352
353
  const wranglerArgs = ["d1", "migrations", "apply", dbName];
353
354
  if (existsSync(wranglerConfigPath)) {
354
355
  wranglerArgs.push("-c", wranglerConfigPath);
@@ -891,4 +892,4 @@ const wrangler = {
891
892
  resolveProjectName: resolveProjectName
892
893
  };
893
894
 
894
- export { checkDrizzleVersion as a, resolveProjectName as b, createWranglerConfig as c, findQueueFiles as d, ensurePackage as e, findScheduledTasks as f, findJobFiles as g, generateDevWranglerConfig as h, applyD1Migrations as i, findSchemaFiles as j, resolveBinaryPath as k, getLocalDatabaseContext as l, getJiti as m, spawnBinSync as n, findLocalD1Database as o, localDb as p, resolveBindingName as r, scanSchemaExports as s, version as v, wrangler as w };
895
+ export { getJiti as a, resolveProjectName as b, checkDrizzleVersion as c, findLocalD1Database as d, ensurePackage as e, findSchemaFiles as f, getLocalDatabaseContext as g, createWranglerConfig as h, resolveBindingName as i, scanSchemaExports as j, findScheduledTasks as k, findQueueFiles as l, findJobFiles as m, generateDevWranglerConfig as n, applyD1Migrations as o, localDb as p, resolveBinaryPath as r, spawnBinSync as s, version as v, wrangler as w };
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  import { defineCommand, runMain } from 'citty';
3
- import { j as findSchemaFiles, k as resolveBinaryPath, e as ensurePackage, l as getLocalDatabaseContext, m as getJiti, n as spawnBinSync, b as resolveProjectName, a as checkDrizzleVersion, o as findLocalD1Database, v as version } from '../chunks/wrangler.mjs';
3
+ import { f as findSchemaFiles, r as resolveBinaryPath, e as ensurePackage, g as getLocalDatabaseContext, a as getJiti, s as spawnBinSync, b as resolveProjectName, c as checkDrizzleVersion, d as findLocalD1Database, v as version } from '../chunks/wrangler.mjs';
4
4
  import { spawnSync, spawn } from 'node:child_process';
5
5
  import { existsSync, mkdirSync, writeFileSync, readFileSync, readdirSync, statSync } from 'node:fs';
6
6
  import { loadNuxtConfig } from '@nuxt/kit';
@@ -1396,8 +1396,8 @@ const deploy = defineCommand({
1396
1396
  env: buildEnv
1397
1397
  });
1398
1398
  if (buildRes.status !== 0) {
1399
- const npxBin = process.platform === "win32" ? "npx.cmd" : "npx";
1400
- buildRes = spawnBinSync(npxBin, ["nuxt", "build"], {
1399
+ const vprBin = process.platform === "win32" ? "vpr.cmd" : "vpr";
1400
+ buildRes = spawnBinSync(vprBin, ["build"], {
1401
1401
  cwd,
1402
1402
  stdio: "inherit",
1403
1403
  env: buildEnv
@@ -2621,7 +2621,8 @@ const init = defineCommand({
2621
2621
  binding: "DB",
2622
2622
  database_name: `${projectName}-db`,
2623
2623
  database_id: existingDbId || "DB_LOCAL_DEV",
2624
- migrations_dir: "server/db/migrations"
2624
+ migrations_dir: "server/db/migrations",
2625
+ migrations_pattern: "server/db/migrations/*/migration.sql"
2625
2626
  }
2626
2627
  ];
2627
2628
  }
package/dist/module.mjs CHANGED
@@ -4,7 +4,7 @@ import { fileURLToPath } from 'node:url';
4
4
  import { defineNuxtModule, useLogger, createResolver, addTemplate, addComponent, hasNuxtModule, installModule, addServerHandler, addPlugin, addServerImports, addImports, addImportsDir, addNitroPlugin, addTypeTemplate, updateTemplates, addServerImportsDir, addRouteMiddleware, extendPages } from '@nuxt/kit';
5
5
  import { defu } from 'defu';
6
6
  import { join, resolve, extname, basename, dirname, normalize, relative } from 'pathe';
7
- import { v as version, e as ensurePackage, c as createWranglerConfig, r as resolveBindingName, a as checkDrizzleVersion, s as scanSchemaExports, f as findScheduledTasks, b as resolveProjectName, d as findQueueFiles, g as findJobFiles, h as generateDevWranglerConfig, i as applyD1Migrations, j as findSchemaFiles } from './chunks/wrangler.mjs';
7
+ import { v as version, e as ensurePackage, h as createWranglerConfig, i as resolveBindingName, c as checkDrizzleVersion, j as scanSchemaExports, k as findScheduledTasks, b as resolveProjectName, l as findQueueFiles, m as findJobFiles, n as generateDevWranglerConfig, o as applyD1Migrations, f 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';
@@ -33,7 +33,7 @@ export function createBrowser(bindingName, event) {
33
33
  const client = await loadPuppeteer();
34
34
  if (!client) {
35
35
  throw new Error(
36
- `[qarpeo] '@cloudflare/puppeteer' is required to launch browser sessions. Please install it with 'vp add -D @cloudflare/puppeteer' or 'npm install -D @cloudflare/puppeteer'.`
36
+ `[qarpeo] '@cloudflare/puppeteer' is required to launch browser sessions. Please install it with 'vp add -D @cloudflare/puppeteer'.`
37
37
  );
38
38
  }
39
39
  return client.launch(getB(), options);
@@ -42,7 +42,7 @@ export function createBrowser(bindingName, event) {
42
42
  const client = await loadPuppeteer();
43
43
  if (!client) {
44
44
  throw new Error(
45
- `[qarpeo] '@cloudflare/puppeteer' is required to connect to browser sessions. Please install it with 'vp add -D @cloudflare/puppeteer' or 'npm install -D @cloudflare/puppeteer'.`
45
+ `[qarpeo] '@cloudflare/puppeteer' is required to connect to browser sessions. Please install it with 'vp add -D @cloudflare/puppeteer'.`
46
46
  );
47
47
  }
48
48
  return client.connect(getB(), sessionId);
@@ -13,7 +13,7 @@ export declare function resolveBinaryPath(binName: string, cwd?: string): string
13
13
  export declare function confirmInstall(packageName: string, purpose: string): Promise<boolean>;
14
14
  /**
15
15
  * Ensures a required dependency is installed in the user's project. If missing, prompts the user to
16
- * install it via their active package manager (pnpm/npm/yarn/bun).
16
+ * install it via Vite+ (vp add).
17
17
  */
18
18
  export declare function ensurePackage(packageName: string, options?: {
19
19
  cwd?: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "qarpeo",
3
- "version": "0.1.24",
3
+ "version": "0.1.26",
4
4
  "description": "Zero-config Cloudflare Edge Platform for Nuxt",
5
5
  "keywords": [
6
6
  "analytics-engine",
package/dist/types.mjs DELETED
@@ -1 +0,0 @@
1
-