pecunia-cli 0.0.8 → 0.1.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.
package/dist/api.mjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { a as generateKyselySchema, n as generateSchema, o as generateDrizzleSchema, r as generatePrismaSchema, t as adapters } from "./generators-
|
|
1
|
+
import { a as generateKyselySchema, n as generateSchema, o as generateDrizzleSchema, r as generatePrismaSchema, t as adapters } from "./generators-a19-M_dj.mjs";
|
|
2
2
|
|
|
3
3
|
export { adapters, generateDrizzleSchema, generateKyselySchema, generatePrismaSchema, generateSchema };
|
|
@@ -387,8 +387,7 @@ const generatePrismaSchema = async ({ adapter, options, file }) => {
|
|
|
387
387
|
}
|
|
388
388
|
}
|
|
389
389
|
const prismaModel = builder.findByType("model", { name: modelName });
|
|
390
|
-
if (!prismaModel)
|
|
391
|
-
else builder.model(modelName).field("id", "String").attribute("id");
|
|
390
|
+
if (!prismaModel) builder.model(modelName).field("id", "String").attribute("id");
|
|
392
391
|
for (const field in fields) {
|
|
393
392
|
const attr = fields[field];
|
|
394
393
|
const fieldName = attr.fieldName || field;
|
|
@@ -403,10 +402,7 @@ const generatePrismaSchema = async ({ adapter, options, file }) => {
|
|
|
403
402
|
isOptional: !attr?.required,
|
|
404
403
|
type: "string"
|
|
405
404
|
}));
|
|
406
|
-
if (field === "id")
|
|
407
|
-
fieldBuilder.attribute("id");
|
|
408
|
-
if (provider === "mongodb") fieldBuilder.attribute(`map("_id")`);
|
|
409
|
-
}
|
|
405
|
+
if (field === "id") fieldBuilder.attribute("id");
|
|
410
406
|
if (attr.unique) builder.model(modelName).blockAttribute(`unique([${fieldName}])`);
|
|
411
407
|
if (attr.defaultValue !== void 0) {
|
|
412
408
|
if (Array.isArray(attr.defaultValue)) {
|
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { i as getPackageInfo, n as generateSchema } from "./generators-
|
|
2
|
+
import { i as getPackageInfo, n as generateSchema } from "./generators-a19-M_dj.mjs";
|
|
3
3
|
import { Command } from "commander";
|
|
4
4
|
import fs, { existsSync, readFileSync } from "node:fs";
|
|
5
5
|
import fs$1 from "node:fs/promises";
|
|
@@ -368,7 +368,6 @@ function getDatabaseInfo(projectRoot) {
|
|
|
368
368
|
"@prisma/client": deps["@prisma/client"],
|
|
369
369
|
drizzle: deps["drizzle-orm"],
|
|
370
370
|
kysely: deps["kysely"],
|
|
371
|
-
mongodb: deps["mongodb"],
|
|
372
371
|
"@neondatabase/serverless": deps["@neondatabase/serverless"],
|
|
373
372
|
"@vercel/postgres": deps["@vercel/postgres"],
|
|
374
373
|
"@planetscale/database": deps["@planetscale/database"]
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pecunia-cli",
|
|
3
|
-
"version": "0.0
|
|
3
|
+
"version": "0.1.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"module": "dist/index.mjs",
|
|
6
6
|
"main": "./dist/index.mjs",
|
|
@@ -64,8 +64,8 @@
|
|
|
64
64
|
"dotenv": "^17.2.2",
|
|
65
65
|
"drizzle-orm": "^0.33.0",
|
|
66
66
|
"open": "^10.2.0",
|
|
67
|
-
"pecunia-core": "^0.0.
|
|
68
|
-
"pecunia-root": "^0.1.
|
|
67
|
+
"pecunia-core": "^0.0.4",
|
|
68
|
+
"pecunia-root": "^0.1.2",
|
|
69
69
|
"pg": "^8.16.3",
|
|
70
70
|
"prettier": "^3.6.2",
|
|
71
71
|
"prompts": "^2.4.2",
|