GithubHelp home page GithubHelp logo

join-com / protoc-gen-ts-interfaces Goto Github PK

View Code? Open in Web Editor NEW
1.0 26.0 0.0 50 KB

Protocol Buffers Compiler (protoc) plugin for generating interfaces in TypeScript.

JavaScript 0.34% TypeScript 75.17% HTML 24.49%

protoc-gen-ts-interfaces's Introduction

TODO:

  1. Add support of maps
  2. Add support of oneOf
  3. Add support of client stream
  4. Improve interfaces for streaming

protoc-gen-ts-interfaces's People

Contributors

antonversal avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

protoc-gen-ts-interfaces's Issues

How to use?

When I run

protoc --plugin=protoc-gen-ts=${GOPATH}/web/node_modules/protoc-gen-ts-interfaces/bin/protoc-gen-ts-interfaces \
       --ts_out=${GOPATH}/web/upgrade/projects/common/src/lib/models/sharedproto \
       --proto_path=${GOPATH}/sharedproto \
           ${GOPATH}/sharedproto/wallet/*.proto

I get the following error:

protoc-gen-ts-interfaces error: TypeError: /Users/rkorebrits/workspace/core/web/node_modules/protoc-gen-ts-interfaces/dist/templates/module.ejs:12
    10| <% } -%>
    11| <% if(obj.messageTypeList.length > 0) { -%>
 >> 12| <%- include('messages') -%>
    13| <% } -%>
    14| 

/Users/rkorebrits/workspace/core/web/node_modules/protoc-gen-ts-interfaces/dist/templates/messages.ejs:7
    5|   <%= field.name -%>?: <%= helpers.fieldType(field, obj.name) %> | null
    6| <%_ } else if (helpers.isSimpleType(field)) {-%>
 >> 7|   <%= field.name -%>: <%= helpers.fieldType(field, obj.name) %>
    8| <%_ } else {-%>
    9|   <%= field.name -%>?: <%= helpers.fieldType(field, obj.name) %>
    10| <%_ } -%>

Cannot read property 'moduleName' of undefined
    at /Users/rkorebrits/workspace/core/web/node_modules/protoc-gen-ts-interfaces/dist/index.js:70:13
    at Object.fieldType (/Users/rkorebrits/workspace/core/web/node_modules/protoc-gen-ts-interfaces/dist/index.js:84:46)
    at message.fieldList.forEach (eval at compile (/Users/rkorebrits/workspace/core/web/node_modules/ejs/lib/ejs.js:618:12), <anonymous>:30:34)
    at Array.forEach (<anonymous>)
    at obj.messageTypeList.forEach (eval at compile (/Users/rkorebrits/workspace/core/web/node_modules/ejs/lib/ejs.js:618:12), <anonymous>:15:26)
    at Array.forEach (<anonymous>)
    at eval (eval at compile (/Users/rkorebrits/workspace/core/web/node_modules/ejs/lib/ejs.js:618:12), <anonymous>:9:28)
    at returnedFn (/Users/rkorebrits/workspace/core/web/node_modules/ejs/lib/ejs.js:653:17)
    at include (/Users/rkorebrits/workspace/core/web/node_modules/ejs/lib/ejs.js:651:39)
    at eval (eval at compile (/Users/rkorebrits/workspace/core/web/node_modules/ejs/lib/ejs.js:618:12), <anonymous>:31:17)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.