Skip to content

Commit

Permalink
Merge branch 'release/0.6.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
fmvilas committed Jan 13, 2019
2 parents b57e6c6 + 4cf24e4 commit 945f3e0
Show file tree
Hide file tree
Showing 9 changed files with 943 additions and 12 deletions.
21 changes: 21 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,27 @@ generator.getTemplateFile({

* Node.js v7.6+

## Contributing

Contributions are more than welcome. If you want to make a contribution, please make sure you go through the following steps:

1. Pick or create an issue. It's always a good idea to leave a message saying that you're going to work on it before you start any actual work.
2. Fork the repository and work there.
3. Open a Pull Request pointing to `develop` branch.
4. A maintainer will review and, eventually, merge your Pull Request. Please, be patient as most of us are doing this in our spare time.

If you're a maintainer, take it from here:

1. Merge Pull Request into `develop`.
2. Make sure your local `develop` and `master` branches are up to date.
3. Switch to `develop` branch.
4. Whenever you think it makes sense, make a release:
1. From develop branch, run: `git flow release start X.X.X`.
2. In release branch, update version in `package.json` and `package-lock.json`.
3. In release branch, run: `git flow release finish X.X.X`.
4. You should now be in `develop` branch. Run: `git push --tags && git checkout master && git push`.
5. Release to NPM should happen automatically. You can check status at https://travis-ci.org/asyncapi/asyncapi.

## Author

Fran Méndez ([@fmvilas](http://twitter.com/fmvilas))
8 changes: 5 additions & 3 deletions lib/beautifier.js
Original file line number Diff line number Diff line change
Expand Up @@ -160,9 +160,11 @@ module.exports = (asyncapi) => {
beautifySchema(schema);
});

const commonPrefix = sharedStart(Object.keys(asyncapi.topics));
const levels = commonPrefix.split('.').length - 1;
asyncapi.__commonPrefix = commonPrefix.split('.').slice(0, levels).join('.');
if (asyncapi.topics) {
const commonPrefix = sharedStart(Object.keys(asyncapi.topics));
const levels = commonPrefix.split('.').length - 1;
asyncapi.__commonPrefix = commonPrefix.split('.').slice(0, levels).join('.');
}

return asyncapi;
};
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "asyncapi-generator",
"version": "0.5.1",
"version": "0.6.0",
"description": "The AsyncAPI generator. It can generate documentation, code, anything!",
"main": "./lib/generator.js",
"bin": {
Expand All @@ -27,19 +27,19 @@
},
"homepage": "https://github.com/asyncapi/generator",
"dependencies": {
"asyncapi": "^2.0.2",
"asyncapi": "^2.1.0",
"commander": "^2.12.2",
"fs.extra": "^1.3.2",
"handlebars": "^4.0.6",
"js-yaml": "^3.8.3",
"json-schema-ref-parser": "^5.1.0",
"lodash": "^4.17.4",
"markdown-it": "^8.4.1",
"minimatch": "^3.0.4",
"mkdirp": "^0.5.1",
"openapi-sampler": "^1.0.0-beta.9",
"project-name-generator": "^2.1.5",
"z-schema": "^3.18.2",
"minimatch": "^3.0.4"
"z-schema": "^3.18.2"
},
"devDependencies": {}
}
6 changes: 6 additions & 0 deletions templates/markdown/.partials/content.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,13 @@

{{> security}}

{{#if asyncapi.topics}}
{{> topics }}
{{/if}}

{{#if asyncapi.events}}
{{> events }}
{{/if}}

{{> messages}}

Expand Down
21 changes: 21 additions & 0 deletions templates/markdown/.partials/events.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
## <a id="events"/>Events

### <a id="events-receive"/>Events a client can receive:
{{#each asyncapi.events.receive as |event index|}}
{{#if event.x-title}}
#### {{event.x-title}} {{#if event.deprecated}} (**deprecated**){{/if}}
{{else}}
#### Event #{{index}} {{#if event.deprecated}} (**deprecated**){{/if}}
{{/if}}
{{> message message=event hideTitle=true}}
{{/each}}

### <a id="events-send"/>Events a client can send:
{{#each asyncapi.events.send as |event index|}}
{{#if event.x-title}}
#### {{event.x-title}} {{#if event.deprecated}} (**deprecated**){{/if}}
{{else}}
#### Event #{{index}} {{#if event.deprecated}} (**deprecated**){{/if}}
{{/if}}
{{> message message=event hideTitle=true}}
{{/each}}
4 changes: 3 additions & 1 deletion templates/markdown/.partials/message.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
### {{messageName}} {{#if message.deprecated}} (**deprecated**){{/if}}
{{#unless hideTitle}}
### {{messageName}} {{#if message.deprecated}} (**deprecated**){{/if}}
{{/unless}}
{{#if message.summary}}
{{{message.summary}}}

Expand Down
2 changes: 2 additions & 0 deletions templates/markdown/asyncapi.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
{{/if}}
{{#if asyncapi.events}}
* [Events](#events)
- [Events a client can receive](#events-receive)
- [Events a client can send](#events-send)
{{/if}}
{{#if asyncapi.stream}}
* [Stream](#stream)
Expand Down
Loading

0 comments on commit 945f3e0

Please sign in to comment.