diff --git a/package-lock.json b/package-lock.json index b434e244ecb..f06e0da6776 100644 --- a/package-lock.json +++ b/package-lock.json @@ -747,6 +747,19 @@ "semver": "bin/semver" } }, + "node_modules/@asyncapi/generator/node_modules/@smoya/multi-parser": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@smoya/multi-parser/-/multi-parser-4.0.0.tgz", + "integrity": "sha512-NgPxSaB3YqwrIVe7AtQ/wh9I2J0BHR4lP0PdqirYYrc0XXRwdDjIRrywEc2jjECWsL7tuGU/QtGMGIVaJe6ZYA==", + "dependencies": { + "@asyncapi/avro-schema-parser": "^3.0.3", + "@asyncapi/openapi-schema-parser": "^3.0.4", + "@asyncapi/protobuf-schema-parser": "^3.0.0", + "@asyncapi/raml-dt-schema-parser": "^4.0.4", + "parserv2": "npm:@asyncapi/parser@^2.1.0", + "parserv3": "npm:@asyncapi/parser@^3.0.0-next-major-spec.3" + } + }, "node_modules/@asyncapi/generator/node_modules/argparse": { "version": "1.0.10", "license": "MIT", @@ -797,6 +810,55 @@ } } }, + "node_modules/@asyncapi/generator/node_modules/parserv3": { + "name": "@asyncapi/parser", + "version": "3.0.0-next-major-spec.5", + "resolved": "https://registry.npmjs.org/@asyncapi/parser/-/parser-3.0.0-next-major-spec.5.tgz", + "integrity": "sha512-+Da9ZPToTcEVIYtR2wlgeQOkd3+iwMf0Ah+uKA1rDyLj7UZ9UtEANnD1tmi4ONymqGwhneVOwBAu6K/dO36Vmw==", + "dependencies": { + "@asyncapi/specs": "^6.0.0-next-major-spec.6", + "@openapi-contrib/openapi-schema-to-json-schema": "~3.2.0", + "@stoplight/json-ref-resolver": "^3.1.5", + "@stoplight/spectral-core": "^1.16.1", + "@stoplight/spectral-functions": "^1.7.2", + "@stoplight/spectral-parsers": "^1.0.2", + "@types/json-schema": "^7.0.11", + "@types/urijs": "^1.19.19", + "ajv": "^8.11.0", + "ajv-errors": "^3.0.0", + "ajv-formats": "^2.1.1", + "avsc": "^5.7.5", + "js-yaml": "^4.1.0", + "jsonpath-plus": "^7.2.0", + "node-fetch": "2.6.7", + "ramldt2jsonschema": "^1.2.3", + "webapi-parser": "^0.5.0" + } + }, + "node_modules/@asyncapi/generator/node_modules/parserv3/node_modules/@asyncapi/specs": { + "version": "6.0.0-next-major-spec.9", + "resolved": "https://registry.npmjs.org/@asyncapi/specs/-/specs-6.0.0-next-major-spec.9.tgz", + "integrity": "sha512-fmOITQoYMw3I2Vai7u/vT0q4yHMBkeXTPByHhrqCaxnwX59Yb2vsMmukHjq478qqCP/U/TmzVvGpEy0JBMaelw==", + "dependencies": { + "@types/json-schema": "^7.0.11" + } + }, + "node_modules/@asyncapi/generator/node_modules/parserv3/node_modules/argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==" + }, + "node_modules/@asyncapi/generator/node_modules/parserv3/node_modules/js-yaml": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", + "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", + "dependencies": { + "argparse": "^2.0.1" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, "node_modules/@asyncapi/generator/node_modules/react": { "version": "17.0.2", "resolved": "https://registry.npmjs.org/react/-/react-17.0.2.tgz", diff --git a/test/integration/generate/fromTemplate.test.ts b/test/integration/generate/fromTemplate.test.ts index c4265d201bb..8bb079c7beb 100644 --- a/test/integration/generate/fromTemplate.test.ts +++ b/test/integration/generate/fromTemplate.test.ts @@ -45,6 +45,37 @@ describe('template', () => { done(); }); }); + + test + .stderr() + .stdout() + .command([ + 'generate:fromTemplate', + asyncapiv3, + '@asyncapi/markdown-template', '--output=./test/docs/v3/markdown-template', '--force-write']) + .it('should be able to use AsyncAPI v3 with markdown', (ctx, done) => { + expect(ctx.stdout).toContain( + 'Check out your shiny new generated files at ./test/docs/v3/markdown-template.\n\n' + ); + cleanup('./test/docs/v3/markdown-template'); + done(); + }); + + test + .stderr() + .stdout() + .command([ + 'generate:fromTemplate', + asyncapiv3, + '@asyncapi/html-template', '--output=./test/docs/v3/html-template', '--force-write']) + .it('should be able to use AsyncAPI v3 with markdown', (ctx, done) => { + expect(ctx.stdout).toContain( + 'Check out your shiny new generated files at ./test/docs/v3/html-template.\n\n' + ); + cleanup('./test/docs/v3/html-template'); + done(); + }); + describe('git clash', () => { const pathToOutput = './test/docs/2'; before(() => {