Skip to content

Commit

Permalink
feat: new command to generate code bindings
Browse files Browse the repository at this point in the history
  • Loading branch information
ljacobsson committed Dec 27, 2020
1 parent 2a06f4b commit 3c21581
Show file tree
Hide file tree
Showing 7 changed files with 557 additions and 66 deletions.
22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,28 @@ Options:
```
Example event input can be found [here](tests/test-event.json)

## Generate code bindings
```
Usage: evb code-binding|cb [options]
Generates code bindings from the schema registry based on the defined InputPath or InputTransformer
Options:
-t, --template [template] Path to template file
-n, --type-name [typeName] Type name (default: "MyType")
-o, --output-file [outputFile] Output file name. Writes to std out if skipped
-l, --language [language] Output language
-h, --help output usage information
```
![Demo](https://github.com/mhlabs/evb-cli/raw/master/images/demo-codebinding.gif))


If `--template` is provided, the tool will parse your template and generate code bindings that match the `InputPath` or `InputTransformer` that is defined.

If no template is passed to the command, then you will get prompted to select a schema from the registry.

This is using quicktype. See their docs for [target languages](https://github.com/quicktype/quicktype#target-languages)

## Replay events
```
Usage: evb replay|r [options]
Expand Down
1 change: 1 addition & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ require("./src/commands/test-event");
require("./src/commands/replay");
require("./src/commands/replay-dead-letter");
require("./src/commands/local");
require("./src/commands/code-binding");

program.version(package.version, "-v, --vers", "output the current version");

Expand Down
Loading

0 comments on commit 3c21581

Please sign in to comment.