hekireki 0.9.0 → 0.9.1
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/bin/ajv.js +1 -1
- package/dist/bin/arktype.js +1 -1
- package/dist/bin/dbml.js +1 -1
- package/dist/bin/docs.js +1 -1
- package/dist/bin/drizzle.js +1 -1
- package/dist/bin/ecto.js +1 -1
- package/dist/bin/effect.js +1 -1
- package/dist/bin/gorm.js +1 -1
- package/dist/bin/mermaid-er.js +1 -1
- package/dist/bin/sea-orm.js +1 -1
- package/dist/bin/sqlalchemy.js +1 -1
- package/dist/bin/typebox.js +1 -1
- package/dist/bin/valibot.js +1 -1
- package/dist/bin/zod.js +1 -1
- package/dist/{bin-Dh-MFTeu.js → bin-CR8sx_jS.js} +4 -1
- package/package.json +1 -1
package/dist/bin/ajv.js
CHANGED
package/dist/bin/arktype.js
CHANGED
package/dist/bin/dbml.js
CHANGED
package/dist/bin/docs.js
CHANGED
package/dist/bin/drizzle.js
CHANGED
package/dist/bin/ecto.js
CHANGED
package/dist/bin/effect.js
CHANGED
package/dist/bin/gorm.js
CHANGED
package/dist/bin/mermaid-er.js
CHANGED
package/dist/bin/sea-orm.js
CHANGED
package/dist/bin/sqlalchemy.js
CHANGED
package/dist/bin/typebox.js
CHANGED
package/dist/bin/valibot.js
CHANGED
package/dist/bin/zod.js
CHANGED
|
@@ -2812,6 +2812,9 @@ const RELATIONSHIPS = {
|
|
|
2812
2812
|
"zero-many": "}o",
|
|
2813
2813
|
many: "}|"
|
|
2814
2814
|
};
|
|
2815
|
+
function escapeComment(comment) {
|
|
2816
|
+
return comment.replace(/\r?\n/g, " ").replace(/"/g, "#quot;");
|
|
2817
|
+
}
|
|
2815
2818
|
function erRelationLine(relation, resolveName = (model) => model) {
|
|
2816
2819
|
return ` ${resolveName(relation.from.model)} ${RELATIONSHIPS[relation.from.cardinality]}--${RELATIONSHIPS[relation.to.cardinality]} ${resolveName(relation.to.model)} : "(${relation.from.field}) - (${relation.to.field})"`;
|
|
2817
2820
|
}
|
|
@@ -2822,7 +2825,7 @@ function modelFields(model) {
|
|
|
2822
2825
|
const commentPart = stripAnnotations(field.documentation) ?? "";
|
|
2823
2826
|
const keyMarker = field.isId ? "PK" : fkFields.has(field.name) ? "FK" : "";
|
|
2824
2827
|
const keyPart = keyMarker ? ` ${keyMarker}` : "";
|
|
2825
|
-
return ` ${field.type.toLowerCase()} ${field.name}${keyPart}${commentPart ? ` "${commentPart}"` : ""}`;
|
|
2828
|
+
return ` ${field.type.toLowerCase()} ${field.name}${keyPart}${commentPart ? ` "${escapeComment(commentPart)}"` : ""}`;
|
|
2826
2829
|
}).filter((field) => field !== null);
|
|
2827
2830
|
}
|
|
2828
2831
|
function modelInfo(model) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "hekireki",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.1",
|
|
4
4
|
"description": "Hekireki is a tool that generates validation schemas for Zod, Valibot, ArkType, and Effect Schema, as well as ER diagrams and DBML, from Prisma schemas annotated with comments.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ajv",
|