@vibeorm/generator 1.1.9 → 1.2.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vibeorm/generator",
3
- "version": "1.1.9",
3
+ "version": "1.2.0",
4
4
  "description": "TypeScript client generator for VibeORM — produces typed delegates, inputs, and Zod schemas from a Prisma schema",
5
5
  "license": "MIT",
6
6
  "keywords": [
@@ -37,6 +37,6 @@
37
37
  "bun": ">=1.1.0"
38
38
  },
39
39
  "dependencies": {
40
- "@vibeorm/parser": "1.1.8"
40
+ "@vibeorm/parser": "1.2.0"
41
41
  }
42
42
  }
@@ -16,8 +16,14 @@ export function generateModels(params: { schema: Schema }): string {
16
16
  parts.push(`import type { ${enumImports} } from "./enums.ts";\n`);
17
17
  }
18
18
 
19
- // Generate JsonValue type
20
- parts.push(`export type JsonValue = string | number | boolean | null | JsonValue[] | { [key: string]: JsonValue };\n`);
19
+ // Generate JsonValue type.
20
+ //
21
+ // Arrays and object index signatures are `readonly` so that `readonly T[]` /
22
+ // `ReadonlyArray<T>` (common in typed catalogues, factories, seed scripts) can
23
+ // be assigned into Json columns without forcing a spread/cast at every call
24
+ // site. Postgres doesn't care about JS array mutability — this is a purely
25
+ // type-level relaxation that's strictly more permissive in argument position.
26
+ parts.push(`export type JsonValue = string | number | boolean | null | readonly JsonValue[] | { readonly [key: string]: JsonValue };\n`);
21
27
 
22
28
  // Generate the base OperationPayload interface
23
29
  parts.push(`export type OperationPayload = {