Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/uber-web/thrift2flow
Converts Thrift specs into Flow JavaScript type definitions
https://github.com/uber-web/thrift2flow
flow flowtype javascript javascript-tools thrift type types
Last synced: 3 months ago
JSON representation
Converts Thrift specs into Flow JavaScript type definitions
- Host: GitHub
- URL: https://github.com/uber-web/thrift2flow
- Owner: uber-web
- License: mit
- Created: 2017-05-17T23:23:35.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2023-08-10T17:42:40.000Z (over 1 year ago)
- Last Synced: 2024-05-20T08:31:18.835Z (6 months ago)
- Topics: flow, flowtype, javascript, javascript-tools, thrift, type, types
- Language: JavaScript
- Homepage:
- Size: 414 KB
- Stars: 40
- Watchers: 12
- Forks: 21
- Open Issues: 24
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
- awesome-flow - thrift2flow - Converts Thrift specs into Flow JavaScript type definitions. (Tools)
README
# thrift2flow
[![Build status](https://badge.buildkite.com/56a997e5c7caeaa4969da9add5c6435a1d00381d4aee1edf6f.svg?branch=master)](https://buildkite.com/uberopensource/thrift2flow)
Automagically converts [Apache Thrift](https://thrift.apache.org/) specs to
[Flowtype](https://flow.org/) type definition files!NOTE: This library tries to align with the [thriftrw](https://github.com/thriftrw/thriftrw-node) JS semantics which means it may not be compatible with generated code
from the apache thrift project.Example:
```thrift
typedef string UUIDstruct Customer {
1: UUID id
2: string name
3: i32 age
4: list tags
}
```Output:
```js
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](https://docs.google.com/a/uber.com/forms/d/1pAwS_-dA1KhPlfxzYLBqK6rsSWwRwH95OCCZrcsY5rk/viewform).- 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 requestThanks!