Skip to content

Add support for generate_package_definition #56

@smnbbrv

Description

@smnbbrv

Hi @agreatfool

thank you for your work! The tool is very much helpful.

There is a quite new feature flag generate_package_definition on the gprc-tools's protoc that is missing in your implementation.

It does not rely on grpc package anymore and that's why it breaks the generated definitions for the client.

In fact, the very first I need to do after running your plugin is changing

- import * as grpc from "grpc";
+ import * as grpc from "@grpc/grpc-js";

The next difference is the exported token that is not exported in a way it was before, but it uses the full path

var PdfGeneratorServiceService = exports['services.pdf.PdfGeneratorService'] = {
  //...

So it is not accessible anymore through the simple import

import {PdfGeneratorServiceService} from '...';

The full package path is required.

Actually, after this is implemented one can use your tool with @grpc/grpc-js as well as with grpc.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions