hekireki 0.9.1 → 0.9.3
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/README.md +0 -2
- 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-CR8sx_jS.js → bin-BQVq3vuc.js} +6 -5
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -707,7 +707,6 @@ impl ActiveModelBehavior for ActiveModel {}
|
|
|
707
707
|
Table User {
|
|
708
708
|
id String [pk, note: 'Primary key']
|
|
709
709
|
name String [not null, note: 'Display name']
|
|
710
|
-
posts Post [not null, note: 'One-to-many relation to Post']
|
|
711
710
|
}
|
|
712
711
|
|
|
713
712
|
Table Post {
|
|
@@ -715,7 +714,6 @@ Table Post {
|
|
|
715
714
|
title String [not null, note: 'Article title']
|
|
716
715
|
content String [not null, note: 'Body content (no length limit)']
|
|
717
716
|
userId String [not null, note: 'Foreign key referencing User.id']
|
|
718
|
-
user User [not null, note: 'Prisma relation definition']
|
|
719
717
|
}
|
|
720
718
|
|
|
721
719
|
Ref Post_userId_fk: Post.userId > User.id
|
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
|
@@ -595,7 +595,7 @@ function toDBMLColumn(field, models, mapToDbSchema) {
|
|
|
595
595
|
function makeTables(models, mapToDbSchema = false) {
|
|
596
596
|
return models.map((model) => {
|
|
597
597
|
const modelName = mapToDbSchema && model.dbName ? model.dbName : model.name;
|
|
598
|
-
const columnLines = model.fields.map((field) => toDBMLColumn(field, models, mapToDbSchema)).map(makePrismaColumn).join("\n");
|
|
598
|
+
const columnLines = model.fields.filter((field) => !field.relationName).map((field) => toDBMLColumn(field, models, mapToDbSchema)).map(makePrismaColumn).join("\n");
|
|
599
599
|
const indexes = [...model.primaryKey?.fields && model.primaryKey.fields.length > 0 ? [{
|
|
600
600
|
columns: model.primaryKey.fields,
|
|
601
601
|
isPrimaryKey: true
|
|
@@ -1632,14 +1632,15 @@ const MainContent = ({ models, types }) => /* @__PURE__ */ jsxs("div", {
|
|
|
1632
1632
|
class: mainContentClass,
|
|
1633
1633
|
children: [models, types]
|
|
1634
1634
|
});
|
|
1635
|
-
const generateHTML = (data) => {
|
|
1636
|
-
|
|
1635
|
+
const generateHTML = async (data) => {
|
|
1636
|
+
const element = /* @__PURE__ */ jsx(Layout, { children: /* @__PURE__ */ jsxs("div", {
|
|
1637
1637
|
class: containerClass,
|
|
1638
1638
|
children: [/* @__PURE__ */ jsx(Sidebar, { toc: createTOC(data) }), /* @__PURE__ */ jsx(MainContent, {
|
|
1639
1639
|
models: createModels(data),
|
|
1640
1640
|
types: createTypes(data)
|
|
1641
1641
|
})]
|
|
1642
|
-
}) })
|
|
1642
|
+
}) });
|
|
1643
|
+
return `<!DOCTYPE html>${await Promise.resolve(element).then((node) => node.toString())}`;
|
|
1643
1644
|
};
|
|
1644
1645
|
//#endregion
|
|
1645
1646
|
//#region src/generator/docs.ts
|
|
@@ -1654,7 +1655,7 @@ async function docs(options) {
|
|
|
1654
1655
|
error: "output is required for Hekireki-Docs. Please specify output in your generator config."
|
|
1655
1656
|
};
|
|
1656
1657
|
const output = options.generator.output.value;
|
|
1657
|
-
return emitRaw(docsHTML(options.dmmf), output, path.join(output, "index.html"));
|
|
1658
|
+
return emitRaw(await docsHTML(options.dmmf), output, path.join(output, "index.html"));
|
|
1658
1659
|
}
|
|
1659
1660
|
//#endregion
|
|
1660
1661
|
//#region src/helper/drizzle.ts
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "hekireki",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.3",
|
|
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",
|