fabien0102 / ts-to-zod

Generate zod schemas from typescript types/interfaces
MIT License
1.17k stars 65 forks source link

import modlue from node_modules will error #235

Closed hukangbao closed 4 months ago

hukangbao commented 4 months ago

Bug description

Input

import type { UnaryCall } from "@protobuf-ts/runtime-rpc"; import type { RpcOptions } from "@protobuf-ts/runtime-rpc";

export interface IPublicReviewConfigServiceClient {

getPublicReviewConfig(input: GetPublicReviewConfigRequest, options?: RpcOptions): UnaryCall<GetPublicReviewConfigRequest, GetPublicReviewConfigResponse>;

updatePublicReviewConfig(input: UpdatePublicReviewConfigRequest, options?: RpcOptions): UnaryCall<UpdatePublicReviewConfigRequest, UpdatePublicReviewConfigResponse>;

}

// typescript type or interface causing the output

Expected output

Validating generated types › Error: 'iPublicReviewConfigServiceClientSchema' is not compatible with › 'IPublicReviewConfigServiceClient': › Argument of type '{}' is not assignable to parameter of type › 'IPublicReviewConfigServiceClient'. › Type '{}' is missing the following properties from type › 'IPublicReviewConfigServiceClient': getPublicReviewConfig, › updatePublicReviewConfig

// Expected Zod schemas

Actual output

// Actual Zod schemas

Versions

tvillaren commented 4 months ago

Hello, This is not due to imports but to the fact you use an unsupported method signature, same as #234 that you reported earlier (and #220).