diff --git a/.eslintignore b/.eslintignore index 3a2e366842f..0162adf18b6 100644 --- a/.eslintignore +++ b/.eslintignore @@ -4,4 +4,5 @@ lib /test/commands/generate/models/ test/helpers /test/fixtures/minimaltemplate +/test/fixtures/newtemplate create-glee-app diff --git a/.eslintrc b/.eslintrc index 5ff4cc62635..c6e3d35e246 100644 --- a/.eslintrc +++ b/.eslintrc @@ -197,6 +197,12 @@ "no-use-before-define": "off", "sonarjs/cognitive-complexity": "off" } + }, + { + "files": ["src/core/base.ts"], + "rules": { + "@typescript-eslint/ban-ts-comment": "off" + } } ] } \ No newline at end of file diff --git a/assets/create-glee-app/templates/default/package-lock.json b/assets/create-glee-app/templates/default/package-lock.json index 565ef21c0bd..af1796b3eab 100644 --- a/assets/create-glee-app/templates/default/package-lock.json +++ b/assets/create-glee-app/templates/default/package-lock.json @@ -9,7 +9,7 @@ "version": "0.1.0", "license": "Apache-2.0", "dependencies": { - "@asyncapi/glee": "^0.37.7" + "@asyncapi/glee": "^0.37.8" }, "devDependencies": { "@types/node": "^20.5.9" @@ -81,9 +81,9 @@ } }, "node_modules/@asyncapi/generator-react-sdk": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/@asyncapi/generator-react-sdk/-/generator-react-sdk-1.1.1.tgz", - "integrity": "sha512-R86Xa20wLtzI4fVf9HECR+UCSYvNE1B4WZs3eI5jAvGtONBTFOvkixd4SUL+uLP4DP96pU2DuKhih/PQbmMneQ==", + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@asyncapi/generator-react-sdk/-/generator-react-sdk-1.1.2.tgz", + "integrity": "sha512-hU9ux8hEMhXwQWWzySZlZ+L5SsM0r4uXdPFvYRTX5uVGeLKGoj4Ok8hY2gPhahKcvMELOIU2mw3O6h9h9AcskQ==", "dependencies": { "@asyncapi/parser": "^3.1.0", "@babel/core": "7.12.9", @@ -169,13 +169,13 @@ "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==" }, "node_modules/@asyncapi/glee": { - "version": "0.37.7", - "resolved": "https://registry.npmjs.org/@asyncapi/glee/-/glee-0.37.7.tgz", - "integrity": "sha512-E+wGnDmV3ix2eELOeDlHOKSQx0Q+7BcxrBWzQQGkxAiMPjJz+2gzfKXU/58MX8CNnvXFWSVLnKRDtR+ntU4rJQ==", + "version": "0.37.8", + "resolved": "https://registry.npmjs.org/@asyncapi/glee/-/glee-0.37.8.tgz", + "integrity": "sha512-1qa/OuOzA38AvuNu1w/wduXKnXjxtHMcCYggVoCQVIzJZ6lG9xaK73g3floUUDK5sMAqiytvisCyGVobXzv4Kw==", "dependencies": { "@asyncapi/generator": "^1.17.25", - "@asyncapi/html-template": "^2.3.10", - "@asyncapi/markdown-template": "^1.6.5", + "@asyncapi/html-template": "^2.3.14", + "@asyncapi/markdown-template": "^1.6.6", "@asyncapi/parser": "^3.1.0", "@next/env": "^14.0.4", "@types/jest": "^29.5.11", @@ -216,11 +216,11 @@ } }, "node_modules/@asyncapi/html-template": { - "version": "2.3.13", - "resolved": "https://registry.npmjs.org/@asyncapi/html-template/-/html-template-2.3.13.tgz", - "integrity": "sha512-IxldILMhc78cQVGf+gP9ggBeclOs7d2AHGhoCeyLsqfTbn4ndnxLS5IjI+JgAf1BAPvHFg6bBX6Tnfnw8ZxxFw==", + "version": "2.3.14", + "resolved": "https://registry.npmjs.org/@asyncapi/html-template/-/html-template-2.3.14.tgz", + "integrity": "sha512-e7jHGXNtovA2u9n0A9CtPy+xkXa76vpz+gdY/4q4TC4bm6EadEhcDiNQ0LtFnUjcHDuxXzYZs8/0BZr1vSBeQw==", "dependencies": { - "@asyncapi/generator-react-sdk": "^1.1.1", + "@asyncapi/generator-react-sdk": "^1.1.2", "@asyncapi/parser": "^3.1.0", "@asyncapi/react-component": "^1.2.13", "highlight.js": "10.7.3", @@ -231,11 +231,11 @@ } }, "node_modules/@asyncapi/markdown-template": { - "version": "1.6.5", - "resolved": "https://registry.npmjs.org/@asyncapi/markdown-template/-/markdown-template-1.6.5.tgz", - "integrity": "sha512-5lzj5HO0sKNkg90fRQ/cE20MJoYmqKdvHhRDocFm5LKN0OPj3sgFqExYE64mVA0AEdXcUeF23dpv8094qc2hkg==", + "version": "1.6.6", + "resolved": "https://registry.npmjs.org/@asyncapi/markdown-template/-/markdown-template-1.6.6.tgz", + "integrity": "sha512-Hm9B/g2B9lHpE2uoM6nKQqU3PmRGpalwm/ufKcLHV4aPq3S870nvD2TWPv+qVMCCeJMyOeJi0l8Wj5yWY4TU2A==", "dependencies": { - "@asyncapi/generator-react-sdk": "^1.1.1", + "@asyncapi/generator-react-sdk": "^1.1.2", "openapi-sampler": "^1.3.0", "yaml": "^1.10.2" } @@ -11518,9 +11518,9 @@ } }, "node_modules/rollup": { - "version": "2.79.1", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.79.1.tgz", - "integrity": "sha512-uKxbd0IhMZOhjAiD5oAFp7BqvkA4Dv47qpOCtaNvng4HBwdbWtdOh8f5nZNuk2rp51PMGk3bzfWu5oayNEuYnw==", + "version": "2.79.2", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.79.2.tgz", + "integrity": "sha512-fS6iqSPZDs3dr/y7Od6y5nha8dW1YnbgtsyotCVvoFGKbERG++CVRFv1meyGDE1SNItQA8BrnCw7ScdAhRJ3XQ==", "bin": { "rollup": "dist/bin/rollup" }, diff --git a/assets/create-glee-app/templates/default/package.json b/assets/create-glee-app/templates/default/package.json index fcb49477603..e36ee27bd92 100644 --- a/assets/create-glee-app/templates/default/package.json +++ b/assets/create-glee-app/templates/default/package.json @@ -24,7 +24,7 @@ }, "homepage": "https://github.com/asyncapi/glee-hello-world#readme", "dependencies": { - "@asyncapi/glee": "^0.37.7" + "@asyncapi/glee": "^0.37.8" }, "devDependencies": { "@types/node": "^20.5.9" diff --git a/assets/create-glee-app/templates/tutorial/package-lock.json b/assets/create-glee-app/templates/tutorial/package-lock.json index f59263a9fe7..4bf45a7827e 100644 --- a/assets/create-glee-app/templates/tutorial/package-lock.json +++ b/assets/create-glee-app/templates/tutorial/package-lock.json @@ -9,7 +9,7 @@ "version": "0.1.0", "license": "Apache-2.0", "dependencies": { - "@asyncapi/glee": "^0.37.7" + "@asyncapi/glee": "^0.37.8" }, "engines": { "node": ">=14.15.1" @@ -78,9 +78,9 @@ } }, "node_modules/@asyncapi/generator-react-sdk": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/@asyncapi/generator-react-sdk/-/generator-react-sdk-1.1.1.tgz", - "integrity": "sha512-R86Xa20wLtzI4fVf9HECR+UCSYvNE1B4WZs3eI5jAvGtONBTFOvkixd4SUL+uLP4DP96pU2DuKhih/PQbmMneQ==", + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@asyncapi/generator-react-sdk/-/generator-react-sdk-1.1.2.tgz", + "integrity": "sha512-hU9ux8hEMhXwQWWzySZlZ+L5SsM0r4uXdPFvYRTX5uVGeLKGoj4Ok8hY2gPhahKcvMELOIU2mw3O6h9h9AcskQ==", "dependencies": { "@asyncapi/parser": "^3.1.0", "@babel/core": "7.12.9", @@ -166,13 +166,13 @@ "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==" }, "node_modules/@asyncapi/glee": { - "version": "0.37.7", - "resolved": "https://registry.npmjs.org/@asyncapi/glee/-/glee-0.37.7.tgz", - "integrity": "sha512-E+wGnDmV3ix2eELOeDlHOKSQx0Q+7BcxrBWzQQGkxAiMPjJz+2gzfKXU/58MX8CNnvXFWSVLnKRDtR+ntU4rJQ==", + "version": "0.37.8", + "resolved": "https://registry.npmjs.org/@asyncapi/glee/-/glee-0.37.8.tgz", + "integrity": "sha512-1qa/OuOzA38AvuNu1w/wduXKnXjxtHMcCYggVoCQVIzJZ6lG9xaK73g3floUUDK5sMAqiytvisCyGVobXzv4Kw==", "dependencies": { "@asyncapi/generator": "^1.17.25", - "@asyncapi/html-template": "^2.3.10", - "@asyncapi/markdown-template": "^1.6.5", + "@asyncapi/html-template": "^2.3.14", + "@asyncapi/markdown-template": "^1.6.6", "@asyncapi/parser": "^3.1.0", "@next/env": "^14.0.4", "@types/jest": "^29.5.11", @@ -213,11 +213,11 @@ } }, "node_modules/@asyncapi/html-template": { - "version": "2.3.13", - "resolved": "https://registry.npmjs.org/@asyncapi/html-template/-/html-template-2.3.13.tgz", - "integrity": "sha512-IxldILMhc78cQVGf+gP9ggBeclOs7d2AHGhoCeyLsqfTbn4ndnxLS5IjI+JgAf1BAPvHFg6bBX6Tnfnw8ZxxFw==", + "version": "2.3.14", + "resolved": "https://registry.npmjs.org/@asyncapi/html-template/-/html-template-2.3.14.tgz", + "integrity": "sha512-e7jHGXNtovA2u9n0A9CtPy+xkXa76vpz+gdY/4q4TC4bm6EadEhcDiNQ0LtFnUjcHDuxXzYZs8/0BZr1vSBeQw==", "dependencies": { - "@asyncapi/generator-react-sdk": "^1.1.1", + "@asyncapi/generator-react-sdk": "^1.1.2", "@asyncapi/parser": "^3.1.0", "@asyncapi/react-component": "^1.2.13", "highlight.js": "10.7.3", @@ -228,11 +228,11 @@ } }, "node_modules/@asyncapi/markdown-template": { - "version": "1.6.5", - "resolved": "https://registry.npmjs.org/@asyncapi/markdown-template/-/markdown-template-1.6.5.tgz", - "integrity": "sha512-5lzj5HO0sKNkg90fRQ/cE20MJoYmqKdvHhRDocFm5LKN0OPj3sgFqExYE64mVA0AEdXcUeF23dpv8094qc2hkg==", + "version": "1.6.6", + "resolved": "https://registry.npmjs.org/@asyncapi/markdown-template/-/markdown-template-1.6.6.tgz", + "integrity": "sha512-Hm9B/g2B9lHpE2uoM6nKQqU3PmRGpalwm/ufKcLHV4aPq3S870nvD2TWPv+qVMCCeJMyOeJi0l8Wj5yWY4TU2A==", "dependencies": { - "@asyncapi/generator-react-sdk": "^1.1.1", + "@asyncapi/generator-react-sdk": "^1.1.2", "openapi-sampler": "^1.3.0", "yaml": "^1.10.2" } @@ -11515,9 +11515,9 @@ } }, "node_modules/rollup": { - "version": "2.79.1", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.79.1.tgz", - "integrity": "sha512-uKxbd0IhMZOhjAiD5oAFp7BqvkA4Dv47qpOCtaNvng4HBwdbWtdOh8f5nZNuk2rp51PMGk3bzfWu5oayNEuYnw==", + "version": "2.79.2", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.79.2.tgz", + "integrity": "sha512-fS6iqSPZDs3dr/y7Od6y5nha8dW1YnbgtsyotCVvoFGKbERG++CVRFv1meyGDE1SNItQA8BrnCw7ScdAhRJ3XQ==", "bin": { "rollup": "dist/bin/rollup" }, diff --git a/assets/create-glee-app/templates/tutorial/package.json b/assets/create-glee-app/templates/tutorial/package.json index 38504ce84b3..1e67c9fa669 100644 --- a/assets/create-glee-app/templates/tutorial/package.json +++ b/assets/create-glee-app/templates/tutorial/package.json @@ -16,6 +16,6 @@ "author": "Fran Mendez", "license": "Apache-2.0", "dependencies": { - "@asyncapi/glee": "^0.37.7" + "@asyncapi/glee": "^0.37.8" } } diff --git a/assets/create-template/templates/default/package-lock.json b/assets/create-template/templates/default/package-lock.json index 22d76fe62e2..0231c20d08a 100644 --- a/assets/create-template/templates/default/package-lock.json +++ b/assets/create-template/templates/default/package-lock.json @@ -6,7 +6,7 @@ "": { "name": "myTemplate", "dependencies": { - "@asyncapi/generator-react-sdk": "^1.1.1" + "@asyncapi/generator-react-sdk": "^1.1.2" } }, "node_modules/@ampproject/remapping": { @@ -23,9 +23,9 @@ } }, "node_modules/@asyncapi/generator-react-sdk": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/@asyncapi/generator-react-sdk/-/generator-react-sdk-1.1.1.tgz", - "integrity": "sha512-R86Xa20wLtzI4fVf9HECR+UCSYvNE1B4WZs3eI5jAvGtONBTFOvkixd4SUL+uLP4DP96pU2DuKhih/PQbmMneQ==", + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@asyncapi/generator-react-sdk/-/generator-react-sdk-1.1.2.tgz", + "integrity": "sha512-hU9ux8hEMhXwQWWzySZlZ+L5SsM0r4uXdPFvYRTX5uVGeLKGoj4Ok8hY2gPhahKcvMELOIU2mw3O6h9h9AcskQ==", "dependencies": { "@asyncapi/parser": "^3.1.0", "@babel/core": "7.12.9", diff --git a/assets/create-template/templates/default/package.json b/assets/create-template/templates/default/package.json index 013ba39df60..58318f5aa97 100644 --- a/assets/create-template/templates/default/package.json +++ b/assets/create-template/templates/default/package.json @@ -5,6 +5,6 @@ "supportedProtocols": [] }, "dependencies": { - "@asyncapi/generator-react-sdk": "^1.1.1" + "@asyncapi/generator-react-sdk": "^1.1.2" } } diff --git a/docs/usage.md b/docs/usage.md index 7d40f79d64f..95669e0efd6 100644 --- a/docs/usage.md +++ b/docs/usage.md @@ -27,7 +27,7 @@ $ npm install -g @asyncapi/cli $ asyncapi COMMAND running command... $ asyncapi (--version) -@asyncapi/cli/2.3.11 linux-x64 node-v18.20.4 +@asyncapi/cli/2.5.0 linux-x64 node-v18.20.4 $ asyncapi --help [COMMAND] USAGE $ asyncapi COMMAND @@ -99,7 +99,7 @@ EXAMPLES $ asyncapi bundle ./asyncapi.yaml -o final-asyncapi.yaml --base ../public-api/main.yaml --baseDir ./social-media/comments-service ``` -_See code: [src/commands/bundle.ts](https://github.com/asyncapi/cli/blob/v2.3.11/src/commands/bundle.ts)_ +_See code: [src/commands/bundle.ts](https://github.com/asyncapi/cli/blob/v2.5.0/src/commands/bundle.ts)_ ## `asyncapi config` @@ -113,7 +113,7 @@ DESCRIPTION CLI config settings ``` -_See code: [src/commands/config/index.ts](https://github.com/asyncapi/cli/blob/v2.3.11/src/commands/config/index.ts)_ +_See code: [src/commands/config/index.ts](https://github.com/asyncapi/cli/blob/v2.5.0/src/commands/config/index.ts)_ ## `asyncapi config analytics` @@ -133,7 +133,7 @@ DESCRIPTION Enable or disable analytics for metrics collection ``` -_See code: [src/commands/config/analytics.ts](https://github.com/asyncapi/cli/blob/v2.3.11/src/commands/config/analytics.ts)_ +_See code: [src/commands/config/analytics.ts](https://github.com/asyncapi/cli/blob/v2.5.0/src/commands/config/analytics.ts)_ ## `asyncapi config context` @@ -147,7 +147,7 @@ DESCRIPTION Manage short aliases for full paths to AsyncAPI documents ``` -_See code: [src/commands/config/context/index.ts](https://github.com/asyncapi/cli/blob/v2.3.11/src/commands/config/context/index.ts)_ +_See code: [src/commands/config/context/index.ts](https://github.com/asyncapi/cli/blob/v2.5.0/src/commands/config/context/index.ts)_ ## `asyncapi config context add CONTEXT-NAME SPEC-FILE-PATH` @@ -169,7 +169,7 @@ DESCRIPTION Add a context to the store ``` -_See code: [src/commands/config/context/add.ts](https://github.com/asyncapi/cli/blob/v2.3.11/src/commands/config/context/add.ts)_ +_See code: [src/commands/config/context/add.ts](https://github.com/asyncapi/cli/blob/v2.5.0/src/commands/config/context/add.ts)_ ## `asyncapi config context current` @@ -186,7 +186,7 @@ DESCRIPTION Shows the current context that is being used ``` -_See code: [src/commands/config/context/current.ts](https://github.com/asyncapi/cli/blob/v2.3.11/src/commands/config/context/current.ts)_ +_See code: [src/commands/config/context/current.ts](https://github.com/asyncapi/cli/blob/v2.5.0/src/commands/config/context/current.ts)_ ## `asyncapi config context edit CONTEXT-NAME NEW-SPEC-FILE-PATH` @@ -207,7 +207,7 @@ DESCRIPTION Edit a context in the store ``` -_See code: [src/commands/config/context/edit.ts](https://github.com/asyncapi/cli/blob/v2.3.11/src/commands/config/context/edit.ts)_ +_See code: [src/commands/config/context/edit.ts](https://github.com/asyncapi/cli/blob/v2.5.0/src/commands/config/context/edit.ts)_ ## `asyncapi config context init [CONTEXT-FILE-PATH]` @@ -230,7 +230,7 @@ DESCRIPTION Initialize context ``` -_See code: [src/commands/config/context/init.ts](https://github.com/asyncapi/cli/blob/v2.3.11/src/commands/config/context/init.ts)_ +_See code: [src/commands/config/context/init.ts](https://github.com/asyncapi/cli/blob/v2.5.0/src/commands/config/context/init.ts)_ ## `asyncapi config context list` @@ -247,7 +247,7 @@ DESCRIPTION List all the stored contexts in the store ``` -_See code: [src/commands/config/context/list.ts](https://github.com/asyncapi/cli/blob/v2.3.11/src/commands/config/context/list.ts)_ +_See code: [src/commands/config/context/list.ts](https://github.com/asyncapi/cli/blob/v2.5.0/src/commands/config/context/list.ts)_ ## `asyncapi config context remove CONTEXT-NAME` @@ -267,7 +267,7 @@ DESCRIPTION Delete a context from the store ``` -_See code: [src/commands/config/context/remove.ts](https://github.com/asyncapi/cli/blob/v2.3.11/src/commands/config/context/remove.ts)_ +_See code: [src/commands/config/context/remove.ts](https://github.com/asyncapi/cli/blob/v2.5.0/src/commands/config/context/remove.ts)_ ## `asyncapi config context use CONTEXT-NAME` @@ -287,7 +287,7 @@ DESCRIPTION Set a context as current ``` -_See code: [src/commands/config/context/use.ts](https://github.com/asyncapi/cli/blob/v2.3.11/src/commands/config/context/use.ts)_ +_See code: [src/commands/config/context/use.ts](https://github.com/asyncapi/cli/blob/v2.5.0/src/commands/config/context/use.ts)_ ## `asyncapi config versions` @@ -304,29 +304,35 @@ DESCRIPTION Show versions of AsyncAPI tools used ``` -_See code: [src/commands/config/versions.ts](https://github.com/asyncapi/cli/blob/v2.3.11/src/commands/config/versions.ts)_ +_See code: [src/commands/config/versions.ts](https://github.com/asyncapi/cli/blob/v2.5.0/src/commands/config/versions.ts)_ ## `asyncapi convert [SPEC-FILE]` -Convert asyncapi documents older to newer versions +Convert asyncapi documents older to newer versions or OpenAPI/postman-collection documents to AsyncAPI ``` USAGE - $ asyncapi convert [SPEC-FILE] [-h] [-o ] [-t ] + $ asyncapi convert [SPEC-FILE] -f openapi|asyncapi|postman-collection [-h] [-o ] [-t ] [-p + client|server] ARGUMENTS SPEC-FILE spec path, url, or context-name FLAGS + -f, --format=