@vibecodeapp/cloud-studio 0.1.6 → 0.2.0

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.
@@ -2360,23 +2360,39 @@ import { pathToFileURL } from "url";
2360
2360
  import { join as join2 } from "path";
2361
2361
  var cachedSchema = null;
2362
2362
  var PrismaClientConstructor = null;
2363
+ var PRISMA_CLIENT_PATHS = [
2364
+ // Custom output locations (relative to CWD)
2365
+ ["generated", "prisma", "index.js"],
2366
+ ["generated", "client", "index.js"],
2367
+ ["src", "generated", "prisma", "index.js"],
2368
+ ["src", "generated", "client", "index.js"],
2369
+ ["prisma", "generated", "index.js"],
2370
+ // Default node_modules locations
2371
+ ["node_modules", ".prisma", "client", "index.js"],
2372
+ ["node_modules", "@prisma", "client", "index.js"]
2373
+ ];
2363
2374
  async function loadPrismaClient() {
2364
2375
  if (PrismaClientConstructor) {
2365
2376
  return PrismaClientConstructor;
2366
2377
  }
2367
- try {
2368
- const prismaPath = join2(process.cwd(), "generated", "prisma", "index.js");
2369
- const prismaModule = await import(pathToFileURL(prismaPath).href);
2370
- PrismaClientConstructor = prismaModule.PrismaClient;
2371
- if (prismaModule.Prisma?.dmmf?.datamodel) {
2372
- cachedSchema = prismaModule.Prisma.dmmf.datamodel;
2378
+ const errors = [];
2379
+ for (const pathSegments of PRISMA_CLIENT_PATHS) {
2380
+ const prismaPath = join2(process.cwd(), ...pathSegments);
2381
+ try {
2382
+ const prismaModule = await import(pathToFileURL(prismaPath).href);
2383
+ PrismaClientConstructor = prismaModule.PrismaClient;
2384
+ if (prismaModule.Prisma?.dmmf?.datamodel) {
2385
+ cachedSchema = prismaModule.Prisma.dmmf.datamodel;
2386
+ }
2387
+ return PrismaClientConstructor;
2388
+ } catch (error) {
2389
+ errors.push(`${prismaPath}: ${error instanceof Error ? error.message : String(error)}`);
2373
2390
  }
2374
- return PrismaClientConstructor;
2375
- } catch (error) {
2376
- throw new Error(
2377
- `Failed to load Prisma Client from ${join2(process.cwd(), "generated", "prisma", "index.js")}: ${error instanceof Error ? error.message : String(error)}`
2378
- );
2379
2391
  }
2392
+ throw new Error(
2393
+ `Failed to load Prisma Client. Searched locations:
2394
+ ${errors.join("\n")}`
2395
+ );
2380
2396
  }
2381
2397
  async function withPrisma(fn) {
2382
2398
  const ClientConstructor = await loadPrismaClient();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vibecodeapp/cloud-studio",
3
- "version": "0.1.6",
3
+ "version": "0.2.0",
4
4
  "description": "Lightweight database UI for SQLite with Prisma",
5
5
  "type": "module",
6
6
  "main": "dist/server/index.js",