Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Update type imports syntax on gRPC generation #921

Merged
merged 2 commits into from
Sep 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions integration/grpc-js-use-date-false/grpc-js-use-date-false.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
/* eslint-disable */
import {
import { ChannelCredentials, Client, makeGenericClientConstructor, Metadata } from "@grpc/grpc-js";
import type {
CallOptions,
ChannelCredentials,
Client,
ClientOptions,
ClientUnaryCall,
handleUnaryCall,
makeGenericClientConstructor,
Metadata,
ServiceError,
UntypedServiceImplementation,
} from "@grpc/grpc-js";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
/* eslint-disable */
import {
import { ChannelCredentials, Client, makeGenericClientConstructor, Metadata } from "@grpc/grpc-js";
import type {
CallOptions,
ChannelCredentials,
Client,
ClientOptions,
ClientUnaryCall,
handleUnaryCall,
makeGenericClientConstructor,
Metadata,
ServiceError,
UntypedServiceImplementation,
} from "@grpc/grpc-js";
Expand Down
7 changes: 2 additions & 5 deletions integration/grpc-js-use-date-true/grpc-js-use-date-true.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
/* eslint-disable */
import {
import { ChannelCredentials, Client, makeGenericClientConstructor, Metadata } from "@grpc/grpc-js";
import type {
CallOptions,
ChannelCredentials,
Client,
ClientOptions,
ClientUnaryCall,
handleUnaryCall,
makeGenericClientConstructor,
Metadata,
ServiceError,
UntypedServiceImplementation,
} from "@grpc/grpc-js";
Expand Down
10 changes: 6 additions & 4 deletions integration/grpc-js/simple.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
/* eslint-disable */
import {
CallOptions,
ChannelCredentials,
Client,
ClientDuplexStream,
ClientOptions,
ClientReadableStream,
ClientUnaryCall,
ClientWritableStream,
handleBidiStreamingCall,
handleClientStreamingCall,
handleServerStreamingCall,
handleUnaryCall,
makeGenericClientConstructor,
Metadata,
} from "@grpc/grpc-js";
import type {
CallOptions,
ClientOptions,
ClientUnaryCall,
handleUnaryCall,
ServiceError,
UntypedServiceImplementation,
} from "@grpc/grpc-js";
Expand Down
12 changes: 6 additions & 6 deletions src/generate-grpc-js.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,22 @@ import { messageToTypeName } from "./types";
import { assertInstanceOf, FormattedMethodDescriptor, maybeAddComment, maybePrefixPackage } from "./utils";
import { generateDecoder, generateEncoder } from "./encode";

const CallOptions = imp("CallOptions@@grpc/grpc-js");
const CallOptions = imp("t:CallOptions@@grpc/grpc-js");
const ChannelCredentials = imp("ChannelCredentials@@grpc/grpc-js");
const ClientOptions = imp("ClientOptions@@grpc/grpc-js");
const ClientOptions = imp("t:ClientOptions@@grpc/grpc-js");
const Client = imp("Client@@grpc/grpc-js");
const ClientDuplexStream = imp("ClientDuplexStream@@grpc/grpc-js");
const ClientReadableStream = imp("ClientReadableStream@@grpc/grpc-js");
const ClientUnaryCall = imp("ClientUnaryCall@@grpc/grpc-js");
const ClientUnaryCall = imp("t:ClientUnaryCall@@grpc/grpc-js");
const ClientWritableStream = imp("ClientWritableStream@@grpc/grpc-js");
const handleBidiStreamingCall = imp("handleBidiStreamingCall@@grpc/grpc-js");
const handleClientStreamingCall = imp("handleClientStreamingCall@@grpc/grpc-js");
const handleServerStreamingCall = imp("handleServerStreamingCall@@grpc/grpc-js");
const handleUnaryCall = imp("handleUnaryCall@@grpc/grpc-js");
const UntypedServiceImplementation = imp("UntypedServiceImplementation@@grpc/grpc-js");
const handleUnaryCall = imp("t:handleUnaryCall@@grpc/grpc-js");
const UntypedServiceImplementation = imp("t:UntypedServiceImplementation@@grpc/grpc-js");
const makeGenericClientConstructor = imp("makeGenericClientConstructor@@grpc/grpc-js");
const Metadata = imp("Metadata@@grpc/grpc-js");
const ServiceError = imp("ServiceError@@grpc/grpc-js");
const ServiceError = imp("t:ServiceError@@grpc/grpc-js");

/**
* Generates a service definition and server / client stubs for the
Expand Down
Loading