@asyncapi/generator 2.5.0 → 2.7.0

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.
Files changed (50) hide show
  1. package/CHANGELOG.md +146 -0
  2. package/Dockerfile +7 -8
  3. package/cli.js +7 -0
  4. package/docs/api.md +12 -3
  5. package/docs/asyncapi-document.md +2 -1
  6. package/docs/configuration-file.md +112 -33
  7. package/docs/file-templates.md +2 -0
  8. package/docs/generator-template-java.md +560 -0
  9. package/docs/generator-template.md +62 -29
  10. package/docs/hooks.md +3 -3
  11. package/docs/installation-guide.md +5 -51
  12. package/docs/migration-cli.md +70 -0
  13. package/docs/migration-nunjucks-react.md +144 -0
  14. package/docs/nunjucks-render-engine.md +6 -2
  15. package/docs/template.md +2 -2
  16. package/docs/usage.md +14 -32
  17. package/docs/versioning.md +3 -1
  18. package/lib/conditionalGeneration.js +162 -0
  19. package/lib/filtersRegistry.js +5 -1
  20. package/lib/generator.js +96 -43
  21. package/lib/hooksRegistry.js +8 -1
  22. package/lib/logMessages.js +6 -1
  23. package/lib/parser.js +10 -0
  24. package/lib/renderer/nunjucks.js +2 -2
  25. package/lib/templateConfigValidator.js +30 -1
  26. package/package.json +4 -6
  27. package/test/generator.test.js +1 -1
  28. package/test/hooksRegistry.test.js +173 -0
  29. package/test/integration.test.js +51 -4
  30. package/test/parser.test.js +100 -2
  31. package/test/templateConfigValidator.test.js +18 -1
  32. package/test/test-project/README.md +5 -1
  33. package/test/test-project/docker-compose.yml +7 -15
  34. package/test/test-project/package.json +0 -1
  35. package/test/test-project/test-project.test.js +6 -2
  36. package/test/test-project/test-registry.test.js +7 -2
  37. package/test/test-project/test.sh +6 -1
  38. package/test/test-project/verdaccio/config.yaml +6 -0
  39. package/test/test-templates/nunjucks-template/package-lock.json +110 -183
  40. package/test/test-templates/react-template/.ageneratorrc +33 -0
  41. package/test/test-templates/react-template/package.json +5 -20
  42. package/test/test-templates/react-template/template/conditionalFile.txt +0 -0
  43. package/test/test-templates/react-template/template/conditionalFolder/conditionalFile.txt +0 -0
  44. package/test/test-templates/react-template/template/conditionalFolder2/input.txt +0 -0
  45. package/test/test-templates/react-template/template/models.js +6 -0
  46. package/test/utils.test.js +53 -0
  47. package/test/test-project/test-entrypoint.sh +0 -12
  48. package/test/test-templates/react-template/__transpiled/test-file.md.js +0 -24
  49. package/test/test-templates/react-template/__transpiled/test-file.md.js.map +0 -1
  50. package/test/test-templates/react-template/package-lock.json +0 -4135
@@ -1,12 +0,0 @@
1
- #!/bin/bash
2
-
3
- # Goal of this script is to copy mounted drive into a separate folder
4
- # It is to assure the test run is isolated from the host
5
- # apptemp is mounted from host and we do not want to mess in there
6
-
7
-
8
- # Copy the contents of /apptemp to /app
9
- cp -r /apptemp /app
10
-
11
- # Execute the bash script
12
- bash /app/apps/generator/test/test-project/test.sh test-project
@@ -1,24 +0,0 @@
1
- 'use strict';
2
-
3
- require('source-map-support/register');
4
- const generatorReactSdk = require('@asyncapi/generator-react-sdk');
5
- const jsxRuntime = require('react/cjs/react-jsx-runtime.production.min');
6
-
7
- function testFile_md ({
8
- asyncapi,
9
- params
10
- }) {
11
- return /*#__PURE__*/jsxRuntime.jsxs(generatorReactSdk.File, {
12
- name: "test-file.md",
13
- children: [/*#__PURE__*/jsxRuntime.jsx(generatorReactSdk.Text, {
14
- children: "This is a markdown file for my application."
15
- }), /*#__PURE__*/jsxRuntime.jsxs(generatorReactSdk.Text, {
16
- children: ["App name is: **", asyncapi.info().title(), "**"]
17
- }), /*#__PURE__*/jsxRuntime.jsxs(generatorReactSdk.Text, {
18
- children: ["Version ", params.version, " running on ", params.mode, " mode "]
19
- })]
20
- });
21
- }
22
-
23
- module.exports = testFile_md;
24
- //# sourceMappingURL=test-file.md.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"test-file.md.js","sources":["../template/test-file.md.js"],"sourcesContent":["import { File, Text } from '@asyncapi/generator-react-sdk';\n\nexport default function({ asyncapi, params }) {\n return (\n <File name=\"test-file.md\">\n <Text>This is a markdown file for my application.</Text>\n <Text>App name is: **{ asyncapi.info().title() }**</Text>\n <Text>Version {params.version} running on {params.mode} mode </Text>\n </File>\n );\n}"],"names":["asyncapi","params","_jsxs","File","name","children","_jsx","Text","info","title","version","mode"],"mappings":";;;;;;AAEe,oBAAS,EAAA;EAAEA,QAAQ;AAAEC,EAAAA,MAAAA;AAAO,CAAC,EAAE;EAC5C,oBACEC,eAAA,CAACC,sBAAI,EAAA;AAACC,IAAAA,IAAI,EAAC,cAAc;IAAAC,QAAA,EAAA,cACvBC,cAAA,CAACC,sBAAI,EAAA;AAAAF,MAAAA,QAAA,EAAC,6CAAA;AAA2C,KAAM,CAAC,eACxDH,eAAA,CAACK,sBAAI,EAAA;AAAAF,MAAAA,QAAA,EAAC,CAAA,iBAAe,EAAEL,QAAQ,CAACQ,IAAI,EAAE,CAACC,KAAK,EAAE,EAAE,IAAE,CAAA;AAAA,KAAM,CAAC,eACzDP,eAAA,CAACK,sBAAI,EAAA;AAAAF,MAAAA,QAAA,EAAC,CAAA,UAAQ,EAACJ,MAAM,CAACS,OAAO,EAAC,cAAY,EAACT,MAAM,CAACU,IAAI,EAAC,QAAM,CAAA;AAAA,KAAM,CAAC,CAAA;AAAA,GAChE,CAAC,CAAA;AAEX;;;;"}