refactor: use OpenAPI file path for generator instead of stdin & modernize generator-cli #3214
+220
−255
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request includes significant updates to both the Java and TypeScript codebases, focusing on improving the
GeneratorProcessor
andGeneratorIO
functionalities. The most important changes include the use of direct read of an OpenAPI file instead of copying it to stdin, refactoring the TypeScript generator CLI to use URLs, and updating the test suite to reflect these changes.Java Changes:
packages/java/engine-core/src/main/java/com/vaadin/hilla/engine/GeneratorProcessor.java
)TypeScript Changes:
GeneratorIO Refactoring:
GeneratorIO
to useURL
instead of string paths for file operations. (packages/ts/generator-cli/src/GeneratorIO.ts
) [1] [2]CLI Improvements:
parseArgs
for argument parsing and removedmeow
. (packages/ts/generator-cli/src/index.ts
)processInput
utility function and updated the CLI to accept the input file path to read it directly. (packages/ts/generator-cli/src/index.ts
)Testing Enhancements:
GeneratorIO
and added new tests for the CLI. (packages/ts/generator-cli/test/GeneratorIO.spec.ts
,packages/ts/generator-cli/test/cli.spec.ts
) [1] [2]packages/ts/generator-cli/test/TestPlugin.ts
)