Giter Site home page Giter Site logo

axxon-proto2ts's Introduction

Axxon proto to ts converter

This is a simple tool to convert Axxon proto files to typescript interfaces.

Important

We must have protoc installed in our system to use this tool. If you don't have it installed, you can install it by following the instructions here.

Installation

Clone the repository

git clone https://github.com/Pisyukaev/axxon-proto2ts.git

Install the dependencies

cd axxon-proto2ts
pnpm install

Install protoc if you don't have it installed in your system. You can install it by following the instructions here.

Usage

Move all proto files/folders with proto to the proto directory Run the following command to convert the proto files to typescript interfaces

pnpm run ts:gen

The generated typescript interfaces will be saved in the types directory

Note

The generated typescript interfaces may need some manual adjustments to work properly.

Example

Input

syntax = "proto3";
package docs;

message User {
  string first_name = 1;
  string last_name = 2;
  bool active = 3;
  User manager = 4;
  repeated string locations = 5;
  map<string, string> projects = 6;
}

Output

/* eslint-disable */

export const protobufPackage = "docs";

export interface User {
  first_name: string;
  last_name: string;
  active: boolean;
  manager: User | undefined;
  locations: string[];
  projects: { [key: string]: string };
}

export interface User_ProjectsEntry {
  key: string;
  value: string;
}

License

MIT

axxon-proto2ts's People

Contributors

pisyukaev avatar

Watchers

 avatar

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.