@asyncapi/generator 2.0.0 → 2.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintignore +2 -1
- package/.eslintrc +15 -0
- package/.releaserc +2 -0
- package/README.md +3 -0
- package/lib/generator.js +1 -1
- package/package.json +4 -2
package/.eslintignore
CHANGED
package/.eslintrc
CHANGED
|
@@ -6,12 +6,20 @@ env:
|
|
|
6
6
|
plugins:
|
|
7
7
|
- sonarjs
|
|
8
8
|
- jest
|
|
9
|
+
- react
|
|
9
10
|
|
|
10
11
|
extends:
|
|
12
|
+
- plugin:react/recommended
|
|
11
13
|
- plugin:sonarjs/recommended
|
|
12
14
|
|
|
13
15
|
parserOptions:
|
|
14
16
|
ecmaVersion: 2018
|
|
17
|
+
sourceType: module
|
|
18
|
+
ecmaFeatures:
|
|
19
|
+
jsx: true
|
|
20
|
+
settings:
|
|
21
|
+
react:
|
|
22
|
+
version: detect
|
|
15
23
|
|
|
16
24
|
rules:
|
|
17
25
|
# Ignore Rules
|
|
@@ -96,3 +104,10 @@ rules:
|
|
|
96
104
|
prefer-const: 2
|
|
97
105
|
prefer-spread: 2
|
|
98
106
|
prefer-template: 2
|
|
107
|
+
|
|
108
|
+
# React
|
|
109
|
+
react/jsx-uses-react: off
|
|
110
|
+
react/react-in-jsx-scope: off
|
|
111
|
+
react/display-name: off
|
|
112
|
+
react/prop-types: off
|
|
113
|
+
react/jsx-key: off
|
package/.releaserc
CHANGED
package/README.md
CHANGED
|
@@ -84,6 +84,9 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
|
|
|
84
84
|
<td align="center" valign="top" width="33.33%"><a href="https://blog.orzzh.icu/"><img src="https://avatars.githubusercontent.com/u/33168669?v=4?s=100" width="100px;" alt="GavinZhengOI"/><br /><sub><b>GavinZhengOI</b></sub></a><br /><a href="https://github.com/asyncapi/generator/commits?author=GavinZhengOI" title="Documentation">📖</a></td>
|
|
85
85
|
<td align="center" valign="top" width="33.33%"><a href="https://github.com/lmgyuan"><img src="https://avatars.githubusercontent.com/u/16447041?v=4?s=100" width="100px;" alt="lmgyuan"/><br /><sub><b>lmgyuan</b></sub></a><br /><a href="https://github.com/asyncapi/generator/commits?author=lmgyuan" title="Documentation">📖</a></td>
|
|
86
86
|
</tr>
|
|
87
|
+
<tr>
|
|
88
|
+
<td align="center" valign="top" width="33.33%"><a href="https://github.com/pierrick-boule"><img src="https://avatars.githubusercontent.com/u/3237116?v=4?s=100" width="100px;" alt="pierrick-boule"/><br /><sub><b>pierrick-boule</b></sub></a><br /><a href="https://github.com/asyncapi/generator/commits?author=pierrick-boule" title="Code">💻</a> <a href="https://github.com/asyncapi/generator/commits?author=pierrick-boule" title="Tests">⚠️</a> <a href="https://github.com/asyncapi/generator/commits?author=pierrick-boule" title="Documentation">📖</a></td>
|
|
89
|
+
</tr>
|
|
87
90
|
</tbody>
|
|
88
91
|
</table>
|
|
89
92
|
|
package/lib/generator.js
CHANGED
|
@@ -879,7 +879,7 @@ class Generator {
|
|
|
879
879
|
if (!shouldOverwriteFile) return;
|
|
880
880
|
|
|
881
881
|
if (this.templateConfig.conditionalFiles && this.templateConfig.conditionalFiles[relativeSourceFile]) {
|
|
882
|
-
const server = this.templateParams.server && asyncapiDocument.
|
|
882
|
+
const server = this.templateParams.server && asyncapiDocument.servers().get(this.templateParams.server);
|
|
883
883
|
const source = jmespath.search({
|
|
884
884
|
...asyncapiDocument.json(),
|
|
885
885
|
...{
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@asyncapi/generator",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.1",
|
|
4
4
|
"description": "The AsyncAPI generator. It can generate documentation, code, anything!",
|
|
5
5
|
"main": "./lib/generator.js",
|
|
6
6
|
"bin": {
|
|
@@ -16,7 +16,8 @@
|
|
|
16
16
|
"test:unit": "jest --coverage --testPathIgnorePatterns=integration --testPathIgnorePatterns=test-project",
|
|
17
17
|
"test:dev": "npm run test:unit -- --watchAll",
|
|
18
18
|
"test:integration": "npm run test:cleanup && jest --testPathPattern=integration --modulePathIgnorePatterns='./__mocks__'",
|
|
19
|
-
"test:
|
|
19
|
+
"test:integration:update": "jest --updateSnapshot --testPathPattern=integration --modulePathIgnorePatterns='./__mocks__'",
|
|
20
|
+
"test:cli": "node cli.js ./test/docs/dummy.yml ./test/test-templates/react-template -o test/output --force-write --debug && test -e test/output/test-file.md",
|
|
20
21
|
"test:cleanup": "rimraf \"test/temp\"",
|
|
21
22
|
"docs": "jsdoc2md --partial docs/jsdoc2md-handlebars/custom-sig-name.hbs docs/jsdoc2md-handlebars/main.hbs docs/jsdoc2md-handlebars/docs.hbs docs/jsdoc2md-handlebars/header.hbs docs/jsdoc2md-handlebars/defaultvalue.hbs docs/jsdoc2md-handlebars/link.hbs docs/jsdoc2md-handlebars/params-table.hbs --files lib/generator.js > docs/api.md",
|
|
22
23
|
"docker:build": "docker build -t asyncapi/generator:latest .",
|
|
@@ -79,6 +80,7 @@
|
|
|
79
80
|
"conventional-changelog-conventionalcommits": "^5.0.0",
|
|
80
81
|
"eslint": "^6.8.0",
|
|
81
82
|
"eslint-plugin-jest": "^23.8.2",
|
|
83
|
+
"eslint-plugin-react": "^7.34.1",
|
|
82
84
|
"eslint-plugin-sonarjs": "^0.5.0",
|
|
83
85
|
"jest": "^25.5.0",
|
|
84
86
|
"jsdoc-to-markdown": "^7.1.1",
|