Skip to content

Commit

Permalink
document: update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
TbhT committed Jul 13, 2024
1 parent 8691628 commit aaa1ab8
Showing 1 changed file with 48 additions and 1 deletion.
49 changes: 48 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,29 @@
# thrift-cli
# thrift-cli

[![oclif](https://img.shields.io/badge/cli-oclif-brightgreen.svg)](https://oclif.io)
[![Version](https://img.shields.io/npm/v/@olierjs/thrift-cli.svg)](https://npmjs.org/package/@olierjs/thrift-cli)
[![Downloads/week](https://img.shields.io/npm/dw/@olierjs/thrift-cli.svg)](https://npmjs.org/package/@olierjs/thrift-cli)


- [thrift-cli](#thrift-cli)
- [Usage](#usage)
- [Commands](#commands)
- [`thrift-cli help [COMMAND]`](#thrift-cli-help-command)
- [`thrift-cli gen --config=/path/of/idl.config.json`](#thrift-cli-gen---configpathofidlconfigjson)
- [Features](#features)
- [IDL Config Options](#idl-config-options)
- [Core Configuration](#core-configuration)
- [TS Plugin Configuration](#ts-plugin-configuration)
- [Validator Plugin Configuration](#validator-plugin-configuration)
- [Mock Plugin Configuration](#mock-plugin-configuration)
- [Example of Mock Annotations](#example-of-mock-annotations)


> A tool to help developers use Thrift for __BFF__ (Backend for Frontend) development, reducing manual boilerplate code.
- 💡 Generates boilerplate code based on the Thrift IDL, including `ts-types`, `validator`, and `mock` code.


<!-- tocstop -->
# Usage

Expand Down Expand Up @@ -46,6 +62,37 @@ DESCRIPTION

```

## `thrift-cli gen --config=/path/of/idl.config.json`


```shell

USAGE
$ thrift-cli gen --config=<params>

ARGUMENTS
gen generate all template files

FLAGS
--config the idl.config.json file path, relative current work directory

```

gen the typescript code files with `idl.config.json`, such as:

```json
{
"sourceDir": "./thrift-files",
"outputDir": "./files-gens",
"validatorOptions": {
"enable": true,
"entry": "*"
}
}
```

more plugin config as belows:

# Features

The `thrift-cli` scaffolding tool converts the Thrift IDL to corresponding TypeScript (TS) code. It currently generates the following types of code:
Expand Down

0 comments on commit aaa1ab8

Please sign in to comment.