hekireki 0.22.0 → 0.22.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/README.md CHANGED
@@ -17,9 +17,40 @@ npm install -D hekireki
17
17
  Add a generator to `schema.prisma` and run `npx prisma generate`. `output` is required.
18
18
 
19
19
  ```prisma
20
+ datasource db {
21
+ provider = "postgresql"
22
+ }
23
+
20
24
  generator Hekireki-Zod {
21
25
  provider = "hekireki-zod"
22
26
  output = "./zod"
27
+ type = true
28
+ }
29
+
30
+ generator Hekireki-Drizzle {
31
+ provider = "hekireki-drizzle"
32
+ output = "./drizzle"
33
+ }
34
+
35
+ model User {
36
+ /// Primary key
37
+ /// @z.uuid()
38
+ id String @id @default(uuid())
39
+ /// Display name
40
+ /// @z.string().min(1).max(50)
41
+ name String
42
+ posts Post[]
43
+ }
44
+
45
+ model Post {
46
+ /// Primary key
47
+ /// @z.uuid()
48
+ id String @id @default(uuid())
49
+ /// Article title
50
+ /// @z.string().min(1).max(100)
51
+ title String
52
+ userId String
53
+ user User @relation(fields: [userId], references: [id])
23
54
  }
24
55
  ```
25
56
 
@@ -53,7 +84,11 @@ generator Hekireki-Zod {
53
84
 
54
85
  - `hekireki-er` — Mermaid, DBML, PNG and SVG
55
86
 
56
- ## Options
87
+ ## Configuration
88
+
89
+ Every generator with every option. All options are optional.
90
+
91
+ ### Validation schemas
57
92
 
58
93
  ```prisma
59
94
  generator Hekireki-Zod {
@@ -64,16 +99,134 @@ generator Hekireki-Zod {
64
99
  relation = true // Add <Model>Relations schemas
65
100
  zod = "v4" // "v4" (default), "mini" or "@hono/zod-openapi"
66
101
  }
102
+
103
+ generator Hekireki-Valibot {
104
+ provider = "hekireki-valibot"
105
+ output = "./valibot"
106
+ type = true
107
+ comment = true
108
+ relation = true
109
+ }
110
+
111
+ generator Hekireki-ArkType {
112
+ provider = "hekireki-arktype"
113
+ output = "./arktype"
114
+ type = true
115
+ comment = true
116
+ relation = true
117
+ }
118
+
119
+ generator Hekireki-Effect {
120
+ provider = "hekireki-effect"
121
+ output = "./effect"
122
+ type = true
123
+ comment = true
124
+ relation = true
125
+ }
126
+
127
+ generator Hekireki-TypeBox {
128
+ provider = "hekireki-typebox"
129
+ output = "./typebox"
130
+ type = true
131
+ comment = true
132
+ relation = true
133
+ }
134
+
135
+ generator Hekireki-AJV {
136
+ provider = "hekireki-ajv"
137
+ output = "./ajv"
138
+ type = true
139
+ comment = true
140
+ relation = true
141
+ }
142
+
143
+ generator Hekireki-Pydantic {
144
+ provider = "hekireki-pydantic"
145
+ output = "./pydantic"
146
+ comment = true
147
+ relation = true
148
+ }
67
149
  ```
68
150
 
69
- - `type`, `comment`, `relation` — every validation schema generator (Pydantic: `comment`, `relation`)
70
- - `package` — GORM package name (default: `model`)
71
- - `renameAll` — SeaORM `#[serde(rename_all = "...")]`
72
- - `app` — Ecto module prefix (default: `MyApp`)
73
- - `namespace` — Eloquent (default: `App\Models`) and EF Core (default: `Models`)
74
- - `context` — EF Core `DbContext` class name (default: `AppDbContext`)
75
- - `schemaName`, `comment` — Atlas
76
- - `outputs`, `theme` — ER
151
+ ### ORM models
152
+
153
+ ```prisma
154
+ generator Hekireki-Drizzle {
155
+ provider = "hekireki-drizzle"
156
+ output = "./drizzle"
157
+ }
158
+
159
+ generator Hekireki-Kysely {
160
+ provider = "hekireki-kysely"
161
+ output = "./kysely"
162
+ }
163
+
164
+ generator Hekireki-SQLAlchemy {
165
+ provider = "hekireki-sqlalchemy"
166
+ output = "./sqlalchemy"
167
+ }
168
+
169
+ generator Hekireki-Django {
170
+ provider = "hekireki-django"
171
+ output = "./django"
172
+ }
173
+
174
+ generator Hekireki-GORM {
175
+ provider = "hekireki-gorm"
176
+ output = "./gorm"
177
+ package = "model" // Go package name (default: "model")
178
+ }
179
+
180
+ generator Hekireki-SeaORM {
181
+ provider = "hekireki-sea-orm"
182
+ output = "./sea-orm"
183
+ renameAll = "camelCase" // #[serde(rename_all = "...")]
184
+ }
185
+
186
+ generator Hekireki-Ecto {
187
+ provider = "hekireki-ecto"
188
+ output = "./ecto"
189
+ app = "MyApp" // Module prefix (default: "MyApp")
190
+ }
191
+
192
+ generator Hekireki-ActiveRecord {
193
+ provider = "hekireki-activerecord"
194
+ output = "./activerecord"
195
+ }
196
+
197
+ generator Hekireki-Eloquent {
198
+ provider = "hekireki-eloquent"
199
+ output = "./eloquent"
200
+ namespace = "App.Models" // "." becomes "\" (default: "App\Models")
201
+ }
202
+
203
+ // PostgreSQL only
204
+ generator Hekireki-EFCore {
205
+ provider = "hekireki-efcore"
206
+ output = "./efcore"
207
+ namespace = "MyApp.Models" // C# namespace (default: "Models")
208
+ context = "AppDbContext" // DbContext class name (default: "AppDbContext")
209
+ }
210
+
211
+ generator Hekireki-Atlas {
212
+ provider = "hekireki-atlas"
213
+ output = "./atlas"
214
+ schemaName = "public" // Default: "public" ("main" on SQLite)
215
+ comment = true // Keep /// comments
216
+ }
217
+ ```
218
+
219
+ ### ER diagrams
220
+
221
+ The extension of each path picks the format: `.md` (Mermaid), `.dbml`, `.png` or `.svg`.
222
+
223
+ ```prisma
224
+ generator Hekireki-ER {
225
+ provider = "hekireki-er"
226
+ outputs = ["docs/er.md", "docs/er.dbml", "docs/er.png", "docs/er.svg"] // One file: output = "docs/er.md"
227
+ theme = "dark" // .png / .svg: "light" (default) or "dark"
228
+ }
229
+ ```
77
230
 
78
231
  ## Annotations
79
232
 
@@ -85,19 +238,33 @@ model User {
85
238
  /// Display name
86
239
  /// @z.string().min(1).max(50)
87
240
  /// @v.pipe(v.string(), v.minLength(1), v.maxLength(50))
88
- name String
241
+ /// @a."1 <= string <= 50"
242
+ /// @e.Schema.String.pipe(Schema.minLength(1), Schema.maxLength(50))
243
+ /// @t.Type.String({ minLength: 1, maxLength: 50 })
244
+ /// @j.{ type: 'string' as const, minLength: 1, maxLength: 50 }
245
+ /// @p.Annotated[str, StringConstraints(min_length=1, max_length=50)]
246
+ name String
247
+ /// @z.email()
248
+ /// @v.pipe(v.string(), v.email())
249
+ /// @a."string.email"
250
+ /// @e.Schema.String.pipe(Schema.pattern(/^[^@]+@[^@]+\.[^@]+$/))
251
+ /// @t.Type.String({ format: 'email' })
252
+ /// @j.{ type: 'string' as const, format: 'email' as const }
253
+ /// @p.EmailStr
254
+ email String @unique
89
255
  }
90
256
  ```
91
257
 
92
- ## ER diagrams
93
-
94
- The extension of each path picks the format: `.md` (Mermaid), `.dbml`, `.png` or `.svg`.
258
+ On a model, `@p.ConfigDict(...)` becomes Pydantic's `model_config`, and
259
+ `@relation <Model>.<field> <Model>.<field> <type>` adds a relation without a foreign key to the ER
260
+ diagram (drawn dashed).
95
261
 
96
262
  ```prisma
97
- generator Hekireki-ER {
98
- provider = "hekireki-er"
99
- outputs = ["docs/er.md", "docs/er.svg"] // One file: output = "docs/er.md"
100
- theme = "dark" // .png / .svg: "light" (default) or "dark"
263
+ /// @p.ConfigDict(extra='forbid')
264
+ /// @relation User.id Post.userId one-to-many
265
+ model Post {
266
+ id String @id @default(uuid())
267
+ userId String
101
268
  }
102
269
  ```
103
270
 
@@ -5,7 +5,7 @@ import { Config, Console, Data, Effect, Option, Schema, Stdio } from "effect";
5
5
  import path from "node:path";
6
6
  import { CliError, Command, Flag } from "effect/unstable/cli";
7
7
  //#region package.json
8
- var version = "0.22.0";
8
+ var version = "0.22.1";
9
9
  //#endregion
10
10
  //#region src/studio/server/constants/index.ts
11
11
  /** Studio only listens on loopback: the API serves the raw schema and runs SQL without authentication. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hekireki",
3
- "version": "0.22.0",
3
+ "version": "0.22.1",
4
4
  "description": "Hekireki is a code generator from Prisma schema to validation schemas, ORM models and ER diagrams, with a Studio for your schema and its data",
5
5
  "keywords": [
6
6
  "activerecord",
@@ -132,7 +132,7 @@
132
132
  "json-schema-to-ts": "^3.1.1",
133
133
  "kysely": "^0.29.5",
134
134
  "monaco-editor": "^0.56.0",
135
- "oxlint": "1.80.0",
135
+ "oxlint": "1.81.0",
136
136
  "prisma": "8.1.0-dev.6",
137
137
  "react": "^19.2.8",
138
138
  "react-aria": "^3.52.0",