chrishoermann / zod-prisma-types

Generator creates zod types for your prisma models with advanced validation
Other
579 stars 43 forks source link

Colons break custom imports. #179

Closed alex-wellbelove closed 8 months ago

alex-wellbelove commented 10 months ago

This:

/// @zod.import(["import { Buffer } from 'node'"])
model MyModel { 
...

correctly adds the import to the generated file.

However, this:

/// @zod.import(["import { Buffer } from 'node:buffer'"])
model MyModel { 
...

instead includes the comment in the output:

/**
 * @zod.import(["import { Buffer } from 'node:buffer'"])
 */
export const MyModel

and does not add the import to the generated output.

My usecase is:

https://developers.cloudflare.com/workers/runtime-apis/nodejs/buffer/

Nerih commented 9 months ago

i also noticed that @ is not supported either, which would be really cool.

chrishoermann commented 8 months ago

@Nerih thiws should work in 2.7.13 now