Skip to content

Commit 34fcd14

Browse files
authored
refactor: migrate from nunjucks to react-sdk for code generation and handle curly-braces in operationID (#386)
* Migration from nunjucks to react-sdk for code generation Broadly, the code changes covers the following: - Efficient schema handling and class generation (for both JSON and AVRO) - Support for complex JSON and AVRO schema (inheritences, nested objects and complex schema settings) - Support for schema settings around field formats, constraints etc - Proper binder configuration (for Solace, Kafka and RabbitMQ) - Solace-specific: Queue/Topic handing in the binding configuration - Revamped integration.test with support scripts for generating code from asyncapi files in mocks and compiling the generated code, generate report - Support for all the template parameters and x-* custom overrides * Update to README with information on how to use test scripts and integration test * Updated README with info to enable debug logging * Handled a case where the operationID contains curly-braces {} * fix: resolve eslint errors for upstream PR compatibility - Add missing toJavaClassName import in ApplicationYml.js - Fix duplicate 'properties' key in avroProcessor.js (renamed to propertiesArray) - Move ModelClass definition before SchemaModel to fix use-before-define - Refactor nested ternary expressions into helper functions - Fix brace-style issues (else-if on same line) - Fix lonely-if by converting to else-if chain - Add radix parameter to parseInt() - Prefix intentionally unused variables with underscore - Remove unused destructured variables in coreProcessor.js - Update .eslintrc to ignore vars/args prefixed with underscore - Add .eslintignore to exclude build artifacts * Reduce code duplication to meet SonarQube <3% threshold - Create utils/processorUtils.js with shared processor functions - Create utils/schemaModel/BaseSchemaModel.js for common schema logic - Create utils/packageUtils.js for AVRO package extraction - Refactor avroProcessor and jsonProcessor to use shared utilities - Refactor hooks/pre-process.js and post-process.js - Add helper functions to components/Application.js - Add test/run_output.sh script for running generated projects
1 parent 97b0a4d commit 34fcd14

File tree

76 files changed

+26887
-20881
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

76 files changed

+26887
-20881
lines changed

.eslintignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
__transpiled/
2+
node_modules/
3+
test/output/
4+
test/temp/

.eslintrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ rules:
4040
no-empty-character-class: 2
4141
no-self-compare: 2
4242
valid-typeof: 2
43-
no-unused-vars: [2, { "args": "none" }]
43+
no-unused-vars: [2, { "args": "none", "varsIgnorePattern": "^_", "argsIgnorePattern": "^_" }]
4444
handle-callback-err: 2
4545
no-shadow-restricted-names: 2
4646
no-new-require: 2

.gitignore

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
node_modules
22
test/temp
3+
test/output
34
coverage
45
**/.DS_Store
5-
**/.vscode
6+
**/.vscode
7+
__transpiled
8+
**/__transpiled
9+
samples/

README.md

Lines changed: 318 additions & 20 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)