Skip to content

Commit

Permalink
feat: initial release (#10)
Browse files Browse the repository at this point in the history
* Amend command examples to link to NPM

* Documented asyncapiFileDir parameter

* README typo fix
  • Loading branch information
dan-r authored Jan 12, 2022
1 parent 6bcfbb9 commit 3cea6cf
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ This template must be used with the AsyncAPI Generator. You can find all availab
npm install -g @asyncapi/generator

# Run generation
ag https://ibm.biz/mq-asyncapi-yml-sample https://ibm.biz/asyncapi-java-template -o output -p server=production
ag https://ibm.biz/mq-asyncapi-yml-sample @asyncapi/java-template -o output -p server=production

```
### Template Tutorial
Expand All @@ -78,6 +78,8 @@ Name | Description | Required | Default
`password` | Password for the server to generate code for. This can also be provided as an environment variable (see below) | No | passw0rd
`package` | Java package name for generated code | No | com.ibm.mq.samples.jms
`mqTopicPrefix` | MQ topic prefix. Used for ibmmq protocols. Default will work with dev MQ instance | No | dev//
`asyncapiFileDir` | Custom output location of the AsyncAPI file that you provided as an input | No | The root of the output directory


## Environment variables

Expand All @@ -94,7 +96,7 @@ All credentials are stored in `env.json` in the output directory, so they can be

The most straightforward command to use this template is:
```sh
ag https://ibm.biz/mq-asyncapi-yml-sample https://ibm.biz/asyncapi-java-template -o output -p server=production
ag https://ibm.biz/mq-asyncapi-yml-sample @asyncapi/java-template -o output -p server=production
```

For local development, you need different variations of this command. First of all, you need to know about three important CLI flags:
Expand All @@ -107,13 +109,13 @@ There are two ways you can work on template development:
- Use global Generator and template from your local sources:
```sh
# assumption is that you run this command from the root of your template
ag https://ibm.biz/mq-asyncapi-yml-sample https://ibm.biz/asyncapi-java-template -o output -p server=production
ag https://ibm.biz/mq-asyncapi-yml-sample @asyncapi/java-template -o output -p server=production
```
- Use Generator from sources and template also from local sources. This approach enables more debugging options with awesome `console.log` in the Generator sources or even the Parser located in `node_modules` of the Generator:
```sh
# assumption is that you run this command from the root of your template
# assumption is that generator sources are cloned on the same level as the template
../generator/cli.js https://ibm.biz/mq-asyncapi-yml-sample https://ibm.biz/asyncapi-java-template -o output -p server=production
../generator/cli.js https://ibm.biz/mq-asyncapi-yml-sample @asyncapi/java-template -o output -p server=production
```

## Key Files
Expand Down
2 changes: 1 addition & 1 deletion tutorials/IBMMQ.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ cd ~/asyncapi-java-tutorial
These commands will allow you to run the Java Template publisher/subscriber model using IBM MQ.
1. Run the AsyncAPI Generator. <br>**Note:** You may need to change the username and password values if you have not followed the IBM MQ tutorial.
```
ag https://ibm.biz/mq-asyncapi-yml-sample https://ibm.biz/asyncapi-java-template -o ./output -p server=production -p user=app -p password=passw0rd
ag https://ibm.biz/mq-asyncapi-yml-sample @asyncapi/java-template -o ./output -p server=production -p user=app -p password=passw0rd
```
**Note:** The syntax of the above command is shown below. You do not need to run the below line, it is for informational purposes only.
```
Expand Down
2 changes: 1 addition & 1 deletion tutorials/KAFKA.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ cd ~/asyncapi-java-tutorial
These commands will allow you to run the Java Template publisher/subscriber model using IBM MQ.
1. Run the AsyncAPI Generator.
```
ag https://ibm.biz/kafka-asyncapi-yml-sample https://ibm.biz/asyncapi-java-template -o ./output -p server=production
ag https://ibm.biz/kafka-asyncapi-yml-sample @asyncapi/java-template -o ./output -p server=production
```
**Note:** The syntax of the above command is shown below. You do not need to run the below line, it is for informational purposes only.
```
Expand Down

0 comments on commit 3cea6cf

Please sign in to comment.