Skip to content

Commit

Permalink
feat: Import CallContext and CallOptions as type (#684)
Browse files Browse the repository at this point in the history
* Import CallContext and CallOptions as type

When generating the nice-grpc output, CallContext and CallOptions
only needed for the typing.

Closes #677

Signed-off-by: dankeboy36 <dankeboy36@gmail.com>

* Corrected the format step in docs

Signed-off-by: dankeboy36 <dankeboy36@gmail.com>

Signed-off-by: dankeboy36 <dankeboy36@gmail.com>
  • Loading branch information
dankeboy36 committed Oct 12, 2022
1 parent d2be6f9 commit 8b388f6
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -562,7 +562,7 @@ The commands below assume you have **Docker** installed. To use a **local** copy
**Contributing**

- Run `yarn build:test` and `yarn test` to make sure everything works.
- Run `yarn prettier` to format the typescript files.
- Run `yarn format` to format the typescript files.
- Commit the changes:
- Also include the generated `.bin` files for the tests where you added or modified `.proto` files.
> These are checked into git so that the test suite can run without having to invoke the `protoc` build chain.
Expand Down
2 changes: 1 addition & 1 deletion integration/nice-grpc/simple.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* eslint-disable */
import { CallContext, CallOptions } from "nice-grpc-common";
import type { CallContext, CallOptions } from "nice-grpc-common";
import * as _m0 from "protobufjs/minimal";
import { Empty } from "./google/protobuf/empty";
import { ListValue, Struct, Value } from "./google/protobuf/struct";
Expand Down
4 changes: 2 additions & 2 deletions src/generate-nice-grpc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import SourceInfo, { Fields } from "./sourceInfo";
import { messageToTypeName } from "./types";
import { assertInstanceOf, FormattedMethodDescriptor, maybeAddComment } from "./utils";

const CallOptions = imp("CallOptions@nice-grpc-common");
const CallContext = imp("CallContext@nice-grpc-common");
const CallOptions = imp("t:CallOptions@nice-grpc-common");
const CallContext = imp("t:CallContext@nice-grpc-common");

/**
* Generates server / client stubs for `nice-grpc` library.
Expand Down

0 comments on commit 8b388f6

Please sign in to comment.