@asyncapi/generator 2.5.0 → 2.6.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.
- package/CHANGELOG.md +10 -0
- package/cli.js +7 -0
- package/docs/api.md +12 -3
- package/docs/file-templates.md +2 -0
- package/docs/migration-cli.md +70 -0
- package/docs/migration-nunjucks-react.md +144 -0
- package/docs/nunjucks-render-engine.md +2 -0
- package/lib/filtersRegistry.js +4 -0
- package/lib/generator.js +3 -3
- package/lib/renderer/nunjucks.js +2 -2
- package/package.json +3 -4
- package/test/integration.test.js +4 -4
- package/test/test-project/package.json +0 -1
- package/test/test-project/test.sh +5 -0
- package/test/test-project/verdaccio/config.yaml +6 -0
- package/test/test-templates/nunjucks-template/package-lock.json +67 -64
- package/test/test-templates/react-template/package.json +2 -1
- package/test/test-templates/react-template/template/models.js +6 -0
- package/test/test-templates/react-template/__transpiled/test-file.md.js +0 -24
- package/test/test-templates/react-template/__transpiled/test-file.md.js.map +0 -1
- package/test/test-templates/react-template/package-lock.json +0 -4135
|
@@ -93,11 +93,11 @@
|
|
|
93
93
|
}
|
|
94
94
|
},
|
|
95
95
|
"node_modules/@asyncapi/parser": {
|
|
96
|
-
"version": "3.
|
|
97
|
-
"resolved": "https://registry.npmjs.org/@asyncapi/parser/-/parser-3.
|
|
98
|
-
"integrity": "sha512-
|
|
96
|
+
"version": "3.4.0",
|
|
97
|
+
"resolved": "https://registry.npmjs.org/@asyncapi/parser/-/parser-3.4.0.tgz",
|
|
98
|
+
"integrity": "sha512-Sxn74oHiZSU6+cVeZy62iPZMFMvKp4jupMFHelSICCMw1qELmUHPvuZSr+ZHDmNGgHcEpzJM5HN02kR7T4g+PQ==",
|
|
99
99
|
"dependencies": {
|
|
100
|
-
"@asyncapi/specs": "^6.
|
|
100
|
+
"@asyncapi/specs": "^6.8.0",
|
|
101
101
|
"@openapi-contrib/openapi-schema-to-json-schema": "~3.2.0",
|
|
102
102
|
"@stoplight/json": "3.21.0",
|
|
103
103
|
"@stoplight/json-ref-readers": "^1.2.2",
|
|
@@ -114,14 +114,14 @@
|
|
|
114
114
|
"ajv-formats": "^2.1.1",
|
|
115
115
|
"avsc": "^5.7.5",
|
|
116
116
|
"js-yaml": "^4.1.0",
|
|
117
|
-
"jsonpath-plus": "^
|
|
117
|
+
"jsonpath-plus": "^10.0.0",
|
|
118
118
|
"node-fetch": "2.6.7"
|
|
119
119
|
}
|
|
120
120
|
},
|
|
121
121
|
"node_modules/@asyncapi/specs": {
|
|
122
|
-
"version": "6.
|
|
123
|
-
"resolved": "https://registry.npmjs.org/@asyncapi/specs/-/specs-6.
|
|
124
|
-
"integrity": "sha512-
|
|
122
|
+
"version": "6.8.0",
|
|
123
|
+
"resolved": "https://registry.npmjs.org/@asyncapi/specs/-/specs-6.8.0.tgz",
|
|
124
|
+
"integrity": "sha512-1i6xs8+IOh6U5T7yH+bCMGQBF+m7kP/NpwyAlt++XaDQutoGCgACf24mQBgcDVqDWWoY81evQv+9ABvw0BviVg==",
|
|
125
125
|
"dependencies": {
|
|
126
126
|
"@types/json-schema": "^7.0.11"
|
|
127
127
|
}
|
|
@@ -1827,10 +1827,21 @@
|
|
|
1827
1827
|
"@jridgewell/sourcemap-codec": "^1.4.14"
|
|
1828
1828
|
}
|
|
1829
1829
|
},
|
|
1830
|
+
"node_modules/@jsep-plugin/assignment": {
|
|
1831
|
+
"version": "1.3.0",
|
|
1832
|
+
"resolved": "https://registry.npmjs.org/@jsep-plugin/assignment/-/assignment-1.3.0.tgz",
|
|
1833
|
+
"integrity": "sha512-VVgV+CXrhbMI3aSusQyclHkenWSAm95WaiKrMxRFam3JSUiIaQjoMIw2sEs/OX4XifnqeQUN4DYbJjlA8EfktQ==",
|
|
1834
|
+
"engines": {
|
|
1835
|
+
"node": ">= 10.16.0"
|
|
1836
|
+
},
|
|
1837
|
+
"peerDependencies": {
|
|
1838
|
+
"jsep": "^0.4.0||^1.0.0"
|
|
1839
|
+
}
|
|
1840
|
+
},
|
|
1830
1841
|
"node_modules/@jsep-plugin/regex": {
|
|
1831
|
-
"version": "1.0.
|
|
1832
|
-
"resolved": "https://registry.npmjs.org/@jsep-plugin/regex/-/regex-1.0.
|
|
1833
|
-
"integrity": "sha512-
|
|
1842
|
+
"version": "1.0.4",
|
|
1843
|
+
"resolved": "https://registry.npmjs.org/@jsep-plugin/regex/-/regex-1.0.4.tgz",
|
|
1844
|
+
"integrity": "sha512-q7qL4Mgjs1vByCaTnDFcBnV9HS7GVPJX5vyVoCgZHNSC9rjwIlmbXG5sUuorR5ndfHAIlJ8pVStxvjXHbNvtUg==",
|
|
1834
1845
|
"engines": {
|
|
1835
1846
|
"node": ">= 10.16.0"
|
|
1836
1847
|
},
|
|
@@ -1839,9 +1850,9 @@
|
|
|
1839
1850
|
}
|
|
1840
1851
|
},
|
|
1841
1852
|
"node_modules/@jsep-plugin/ternary": {
|
|
1842
|
-
"version": "1.1.
|
|
1843
|
-
"resolved": "https://registry.npmjs.org/@jsep-plugin/ternary/-/ternary-1.1.
|
|
1844
|
-
"integrity": "sha512-
|
|
1853
|
+
"version": "1.1.4",
|
|
1854
|
+
"resolved": "https://registry.npmjs.org/@jsep-plugin/ternary/-/ternary-1.1.4.tgz",
|
|
1855
|
+
"integrity": "sha512-ck5wiqIbqdMX6WRQztBL7ASDty9YLgJ3sSAK5ZpBzXeySvFGCzIvM6UiAI4hTZ22fEcYQVV/zhUbNscggW+Ukg==",
|
|
1845
1856
|
"engines": {
|
|
1846
1857
|
"node": ">= 10.16.0"
|
|
1847
1858
|
},
|
|
@@ -1980,34 +1991,34 @@
|
|
|
1980
1991
|
}
|
|
1981
1992
|
},
|
|
1982
1993
|
"node_modules/@stoplight/spectral-core": {
|
|
1983
|
-
"version": "1.
|
|
1984
|
-
"resolved": "https://registry.npmjs.org/@stoplight/spectral-core/-/spectral-core-1.
|
|
1985
|
-
"integrity": "sha512-
|
|
1994
|
+
"version": "1.19.4",
|
|
1995
|
+
"resolved": "https://registry.npmjs.org/@stoplight/spectral-core/-/spectral-core-1.19.4.tgz",
|
|
1996
|
+
"integrity": "sha512-8hnZXfssTlV99SKo8J8BwMt5LsiBFHkCh0V3P7j8IPcCNl//bpG92U4TpYy7AwmUms/zCLX7sxNQC6AZ+bkfzg==",
|
|
1986
1997
|
"dependencies": {
|
|
1987
1998
|
"@stoplight/better-ajv-errors": "1.0.3",
|
|
1988
1999
|
"@stoplight/json": "~3.21.0",
|
|
1989
2000
|
"@stoplight/path": "1.3.2",
|
|
1990
2001
|
"@stoplight/spectral-parsers": "^1.0.0",
|
|
1991
|
-
"@stoplight/spectral-ref-resolver": "^1.0.
|
|
1992
|
-
"@stoplight/spectral-runtime": "^1.
|
|
2002
|
+
"@stoplight/spectral-ref-resolver": "^1.0.4",
|
|
2003
|
+
"@stoplight/spectral-runtime": "^1.1.2",
|
|
1993
2004
|
"@stoplight/types": "~13.6.0",
|
|
1994
2005
|
"@types/es-aggregate-error": "^1.0.2",
|
|
1995
2006
|
"@types/json-schema": "^7.0.11",
|
|
1996
|
-
"ajv": "^8.
|
|
2007
|
+
"ajv": "^8.17.1",
|
|
1997
2008
|
"ajv-errors": "~3.0.0",
|
|
1998
2009
|
"ajv-formats": "~2.1.0",
|
|
1999
2010
|
"es-aggregate-error": "^1.0.7",
|
|
2000
|
-
"jsonpath-plus": "
|
|
2011
|
+
"jsonpath-plus": "10.2.0",
|
|
2001
2012
|
"lodash": "~4.17.21",
|
|
2002
2013
|
"lodash.topath": "^4.5.2",
|
|
2003
2014
|
"minimatch": "3.1.2",
|
|
2004
|
-
"nimma": "0.2.
|
|
2005
|
-
"pony-cause": "^1.
|
|
2006
|
-
"simple-eval": "1.0.
|
|
2007
|
-
"tslib": "^2.
|
|
2015
|
+
"nimma": "0.2.3",
|
|
2016
|
+
"pony-cause": "^1.1.1",
|
|
2017
|
+
"simple-eval": "1.0.1",
|
|
2018
|
+
"tslib": "^2.8.1"
|
|
2008
2019
|
},
|
|
2009
2020
|
"engines": {
|
|
2010
|
-
"node": "^
|
|
2021
|
+
"node": "^16.20 || ^18.18 || >= 20.17"
|
|
2011
2022
|
}
|
|
2012
2023
|
},
|
|
2013
2024
|
"node_modules/@stoplight/spectral-core/node_modules/@stoplight/types": {
|
|
@@ -2022,18 +2033,10 @@
|
|
|
2022
2033
|
"node": "^12.20 || >=14.13"
|
|
2023
2034
|
}
|
|
2024
2035
|
},
|
|
2025
|
-
"node_modules/@stoplight/spectral-core/node_modules/jsonpath-plus": {
|
|
2026
|
-
"version": "7.1.0",
|
|
2027
|
-
"resolved": "https://registry.npmjs.org/jsonpath-plus/-/jsonpath-plus-7.1.0.tgz",
|
|
2028
|
-
"integrity": "sha512-gTaNRsPWO/K2KY6MrqaUFClF9kmuM6MFH5Dhg1VYDODgFbByw1yb7xu3hrViE/sz+dGOeMWgCzwUwQtAnCTE9g==",
|
|
2029
|
-
"engines": {
|
|
2030
|
-
"node": ">=12.0.0"
|
|
2031
|
-
}
|
|
2032
|
-
},
|
|
2033
2036
|
"node_modules/@stoplight/spectral-core/node_modules/tslib": {
|
|
2034
|
-
"version": "2.
|
|
2035
|
-
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.
|
|
2036
|
-
"integrity": "sha512-
|
|
2037
|
+
"version": "2.8.1",
|
|
2038
|
+
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz",
|
|
2039
|
+
"integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w=="
|
|
2037
2040
|
},
|
|
2038
2041
|
"node_modules/@stoplight/spectral-formats": {
|
|
2039
2042
|
"version": "1.6.0",
|
|
@@ -2360,9 +2363,9 @@
|
|
|
2360
2363
|
}
|
|
2361
2364
|
},
|
|
2362
2365
|
"node_modules/astring": {
|
|
2363
|
-
"version": "1.
|
|
2364
|
-
"resolved": "https://registry.npmjs.org/astring/-/astring-1.
|
|
2365
|
-
"integrity": "sha512-
|
|
2366
|
+
"version": "1.9.0",
|
|
2367
|
+
"resolved": "https://registry.npmjs.org/astring/-/astring-1.9.0.tgz",
|
|
2368
|
+
"integrity": "sha512-LElXdjswlqjWrPpJFg1Fx4wpkOCxj1TDHlSV4PlaRxHGWko024xICaa97ZkMfs6DRKlCguiAI+rbXv5GWwXIkg==",
|
|
2366
2369
|
"bin": {
|
|
2367
2370
|
"astring": "bin/astring"
|
|
2368
2371
|
}
|
|
@@ -3315,9 +3318,9 @@
|
|
|
3315
3318
|
}
|
|
3316
3319
|
},
|
|
3317
3320
|
"node_modules/jsep": {
|
|
3318
|
-
"version": "1.
|
|
3319
|
-
"resolved": "https://registry.npmjs.org/jsep/-/jsep-1.
|
|
3320
|
-
"integrity": "sha512-
|
|
3321
|
+
"version": "1.4.0",
|
|
3322
|
+
"resolved": "https://registry.npmjs.org/jsep/-/jsep-1.4.0.tgz",
|
|
3323
|
+
"integrity": "sha512-B7qPcEVE3NVkmSJbaYxvv4cHkVW7DQsZz13pUMrfS8z8Q/BuShN+gcTXrUlPiGqM2/t/EEaI030bpxMqY8gMlw==",
|
|
3321
3324
|
"engines": {
|
|
3322
3325
|
"node": ">= 10.16.0"
|
|
3323
3326
|
}
|
|
@@ -3355,11 +3358,20 @@
|
|
|
3355
3358
|
"integrity": "sha512-o6/yDBYccGvTz1+QFevz6l6OBZ2+fMVu2JZ9CIhzsYRX4mjaK5IyX9eldUdCmga16zlgQxyrj5pt9kzuj2C02w=="
|
|
3356
3359
|
},
|
|
3357
3360
|
"node_modules/jsonpath-plus": {
|
|
3358
|
-
"version": "
|
|
3359
|
-
"resolved": "https://registry.npmjs.org/jsonpath-plus/-/jsonpath-plus-
|
|
3360
|
-
"integrity": "sha512-
|
|
3361
|
+
"version": "10.2.0",
|
|
3362
|
+
"resolved": "https://registry.npmjs.org/jsonpath-plus/-/jsonpath-plus-10.2.0.tgz",
|
|
3363
|
+
"integrity": "sha512-T9V+8iNYKFL2n2rF+w02LBOT2JjDnTjioaNFrxRy0Bv1y/hNsqR/EBK7Ojy2ythRHwmz2cRIls+9JitQGZC/sw==",
|
|
3364
|
+
"dependencies": {
|
|
3365
|
+
"@jsep-plugin/assignment": "^1.3.0",
|
|
3366
|
+
"@jsep-plugin/regex": "^1.0.4",
|
|
3367
|
+
"jsep": "^1.4.0"
|
|
3368
|
+
},
|
|
3369
|
+
"bin": {
|
|
3370
|
+
"jsonpath": "bin/jsonpath-cli.js",
|
|
3371
|
+
"jsonpath-plus": "bin/jsonpath-cli.js"
|
|
3372
|
+
},
|
|
3361
3373
|
"engines": {
|
|
3362
|
-
"node": ">=
|
|
3374
|
+
"node": ">=18.0.0"
|
|
3363
3375
|
}
|
|
3364
3376
|
},
|
|
3365
3377
|
"node_modules/jsonpointer": {
|
|
@@ -3429,9 +3441,9 @@
|
|
|
3429
3441
|
"integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w=="
|
|
3430
3442
|
},
|
|
3431
3443
|
"node_modules/nimma": {
|
|
3432
|
-
"version": "0.2.
|
|
3433
|
-
"resolved": "https://registry.npmjs.org/nimma/-/nimma-0.2.
|
|
3434
|
-
"integrity": "sha512-
|
|
3444
|
+
"version": "0.2.3",
|
|
3445
|
+
"resolved": "https://registry.npmjs.org/nimma/-/nimma-0.2.3.tgz",
|
|
3446
|
+
"integrity": "sha512-1ZOI8J+1PKKGceo/5CT5GfQOG6H8I2BencSK06YarZ2wXwH37BSSUWldqJmMJYA5JfqDqffxDXynt6f11AyKcA==",
|
|
3435
3447
|
"dependencies": {
|
|
3436
3448
|
"@jsep-plugin/regex": "^1.0.1",
|
|
3437
3449
|
"@jsep-plugin/ternary": "^1.0.2",
|
|
@@ -3442,19 +3454,10 @@
|
|
|
3442
3454
|
"node": "^12.20 || >=14.13"
|
|
3443
3455
|
},
|
|
3444
3456
|
"optionalDependencies": {
|
|
3445
|
-
"jsonpath-plus": "^6.0.1",
|
|
3457
|
+
"jsonpath-plus": "^6.0.1 || ^10.1.0",
|
|
3446
3458
|
"lodash.topath": "^4.5.2"
|
|
3447
3459
|
}
|
|
3448
3460
|
},
|
|
3449
|
-
"node_modules/nimma/node_modules/jsonpath-plus": {
|
|
3450
|
-
"version": "6.0.1",
|
|
3451
|
-
"resolved": "https://registry.npmjs.org/jsonpath-plus/-/jsonpath-plus-6.0.1.tgz",
|
|
3452
|
-
"integrity": "sha512-EvGovdvau6FyLexFH2OeXfIITlgIbgZoAZe3usiySeaIDm5QS+A10DKNpaPBBqqRSZr2HN6HVNXxtwUAr2apEw==",
|
|
3453
|
-
"optional": true,
|
|
3454
|
-
"engines": {
|
|
3455
|
-
"node": ">=10.0.0"
|
|
3456
|
-
}
|
|
3457
|
-
},
|
|
3458
3461
|
"node_modules/node-fetch": {
|
|
3459
3462
|
"version": "2.6.7",
|
|
3460
3463
|
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz",
|
|
@@ -3800,11 +3803,11 @@
|
|
|
3800
3803
|
}
|
|
3801
3804
|
},
|
|
3802
3805
|
"node_modules/simple-eval": {
|
|
3803
|
-
"version": "1.0.
|
|
3804
|
-
"resolved": "https://registry.npmjs.org/simple-eval/-/simple-eval-1.0.
|
|
3805
|
-
"integrity": "sha512-
|
|
3806
|
+
"version": "1.0.1",
|
|
3807
|
+
"resolved": "https://registry.npmjs.org/simple-eval/-/simple-eval-1.0.1.tgz",
|
|
3808
|
+
"integrity": "sha512-LH7FpTAkeD+y5xQC4fzS+tFtaNlvt3Ib1zKzvhjv/Y+cioV4zIuw4IZr2yhRLu67CWL7FR9/6KXKnjRoZTvGGQ==",
|
|
3806
3809
|
"dependencies": {
|
|
3807
|
-
"jsep": "^1.
|
|
3810
|
+
"jsep": "^1.3.6"
|
|
3808
3811
|
},
|
|
3809
3812
|
"engines": {
|
|
3810
3813
|
"node": ">=12"
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
//TODO: at the moment this template as devDependency set to "@asyncapi/generator-components": "*" in generator root but this is temporary to not complicate one PR too much. We still need to explore concept of having just one dependency in the template pointing to @asyncapi/generator and noting else, and components, react sdks and others should be just part of @asyncapi/generator dependency
|
|
2
|
+
import { Models } from '@asyncapi/generator-components';
|
|
3
|
+
|
|
4
|
+
export default async function({ asyncapi }) {
|
|
5
|
+
return await Models({asyncapi, language: 'csharp'});
|
|
6
|
+
}
|
|
@@ -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;;;;"}
|