Skip to content

Converts Thrift specs into Flow JavaScript type definitions

License

Notifications You must be signed in to change notification settings

shYkiSto/thrift2flow

This branch is 2 commits behind uber-web/thrift2flow:master.

Folders and files

NameName
Last commit message
Last commit date

Latest commit

7db6c89 · Feb 3, 2022
Sep 24, 2018
Apr 12, 2021
Mar 4, 2019
Feb 2, 2022
Sep 24, 2018
May 18, 2017
May 18, 2017
Feb 28, 2019
Mar 4, 2019
Jan 14, 2020
Apr 23, 2019
May 24, 2017
Mar 7, 2019
Sep 24, 2018
May 17, 2017
Mar 7, 2019
Feb 28, 2019
Sep 24, 2018
Feb 3, 2022
Apr 12, 2021

Repository files navigation

thrift2flow

Build status

Automagically converts Apache Thrift specs to Flowtype type definition files!

NOTE: This library tries to align with the thriftrw JS semantics which means it may not be compatible with generated code from the apache thrift project.

Example:

typedef string UUID

struct Customer {
  1: UUID id
  2: string name
  3: i32 age
  4: list<string> tags
}

Output:

export type UUID = string;

export type Customer = {
  id: UUID,
  name: string,
  age: number,
  tags: string[],
};

Installation and Usage

npm install -g thrift2flow
thrift2flow --path="idl/code.foo.bar" --outputDir="src/types/idl" idl/code.foo.bar/*/*/*.thrift

Contributing

We'd love for you to contribute to this project. Before we can accept your contributions, we kindly ask you to sign our Uber Contributor License Agreement.

  • If you find a bug, please open an issue, or submit a fix via a pull request
  • If you have a feature request, open an issue, or submit an implementation via a pull request
  • If you want to contribute, submit a pull request

Thanks!

About

Converts Thrift specs into Flow JavaScript type definitions

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 89.8%
  • Thrift 10.0%
  • Dockerfile 0.2%