hekireki 0.8.2 → 0.8.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/LICENSE +21 -0
- 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-B_9WDdSx.js → bin-Brdok3Yj.js} +11 -2
- package/package.json +18 -18
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 - present, Hekireki Contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
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
|
@@ -540,10 +540,18 @@ function makeIndex(index) {
|
|
|
540
540
|
index.name && `name: '${index.name}'`
|
|
541
541
|
].filter((c) => Boolean(c)))}`;
|
|
542
542
|
}
|
|
543
|
+
function toDbmlAction(action) {
|
|
544
|
+
if (action === "Cascade") return "cascade";
|
|
545
|
+
if (action === "SetNull") return "set null";
|
|
546
|
+
if (action === "SetDefault") return "set default";
|
|
547
|
+
if (action === "NoAction") return "no action";
|
|
548
|
+
if (action === "Restrict") return "restrict";
|
|
549
|
+
return action;
|
|
550
|
+
}
|
|
543
551
|
function makeRef(ref) {
|
|
544
552
|
const name = makeRefName(ref);
|
|
545
553
|
const operator = ref.type ?? ">";
|
|
546
|
-
const actions = [ref.onDelete && `delete: ${ref.onDelete}`, ref.onUpdate && `update: ${ref.onUpdate}`].filter((a) => Boolean(a));
|
|
554
|
+
const actions = [ref.onDelete && `delete: ${toDbmlAction(ref.onDelete)}`, ref.onUpdate && `update: ${toDbmlAction(ref.onUpdate)}`].filter((a) => Boolean(a));
|
|
547
555
|
const actionStr = actions.length > 0 ? ` [${actions.join(", ")}]` : "";
|
|
548
556
|
return `Ref ${name}: ${ref.fromTable}.${ref.fromColumn} ${operator} ${ref.toTable}.${ref.toColumn}${actionStr}`;
|
|
549
557
|
}
|
|
@@ -622,7 +630,8 @@ function makeRelations$1(models, mapToDbSchema = false) {
|
|
|
622
630
|
toTable: relationToName,
|
|
623
631
|
toColumn,
|
|
624
632
|
type: operator,
|
|
625
|
-
onDelete: field.relationOnDelete
|
|
633
|
+
onDelete: field.relationOnDelete,
|
|
634
|
+
onUpdate: field.relationOnUpdate
|
|
626
635
|
});
|
|
627
636
|
}));
|
|
628
637
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "hekireki",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.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",
|
|
@@ -54,38 +54,38 @@
|
|
|
54
54
|
"publishConfig": {
|
|
55
55
|
"access": "public"
|
|
56
56
|
},
|
|
57
|
-
"scripts": {
|
|
58
|
-
"generate": "prisma generate",
|
|
59
|
-
"deps": "rm -rf node_modules && pnpm install",
|
|
60
|
-
"build": "tsdown",
|
|
61
|
-
"release": "npm pkg fix && pnpm build && npm publish"
|
|
62
|
-
},
|
|
63
57
|
"dependencies": {
|
|
64
|
-
"@hono/node-server": "^2.0.
|
|
58
|
+
"@hono/node-server": "^2.0.4",
|
|
65
59
|
"@prisma/generator-helper": "^7.8.0",
|
|
66
60
|
"@resvg/resvg-js": "^2.6.2",
|
|
67
61
|
"@softwaretechnik/dbml-renderer": "^1.0.31",
|
|
68
|
-
"hono": "^4.12.
|
|
69
|
-
"oxfmt": "^0.
|
|
62
|
+
"hono": "^4.12.25",
|
|
63
|
+
"oxfmt": "^0.54.0"
|
|
70
64
|
},
|
|
71
65
|
"devDependencies": {
|
|
72
66
|
"@paralleldrive/cuid2": "^3.3.0",
|
|
73
67
|
"@prisma/client": "^7.8.0",
|
|
74
68
|
"@sinclair/typebox": "^0.34.49",
|
|
75
|
-
"@types/node": "^25.
|
|
76
|
-
"@typescript/native-preview": "7.0.0-dev.
|
|
69
|
+
"@types/node": "^25.9.3",
|
|
70
|
+
"@typescript/native-preview": "7.0.0-dev.20260611.2",
|
|
77
71
|
"ajv": "^8.20.0",
|
|
78
72
|
"arktype": "^2.2.0",
|
|
79
|
-
"better-auth": "^1.6.
|
|
73
|
+
"better-auth": "^1.6.17",
|
|
80
74
|
"drizzle-kit": "^0.31.10",
|
|
81
75
|
"drizzle-orm": "^0.45.2",
|
|
82
|
-
"effect": "^3.21.
|
|
76
|
+
"effect": "^3.21.3",
|
|
83
77
|
"json-schema-to-ts": "^3.1.1",
|
|
84
78
|
"prisma": "^7.8.0",
|
|
85
|
-
"tsdown": "^0.
|
|
86
|
-
"tsx": "^4.
|
|
79
|
+
"tsdown": "^0.22.2",
|
|
80
|
+
"tsx": "^4.22.4",
|
|
87
81
|
"typescript": "^6.0.3",
|
|
88
|
-
"valibot": "1.
|
|
82
|
+
"valibot": "1.4.1",
|
|
89
83
|
"zod": "^4.4.3"
|
|
84
|
+
},
|
|
85
|
+
"scripts": {
|
|
86
|
+
"generate": "prisma generate",
|
|
87
|
+
"deps": "rm -rf node_modules && pnpm install",
|
|
88
|
+
"build": "tsdown",
|
|
89
|
+
"release": "npm pkg fix && pnpm build && npm publish"
|
|
90
90
|
}
|
|
91
|
-
}
|
|
91
|
+
}
|