Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(WIP) MI-56 investigate options for automatic generation of typescript code from api specs (DONT MERGE) #1087

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

ryanrixxh
Copy link

A WIP PR for the openapi code generation plugin. This work also includes an upgrade to Nx 19 this was to try and resolve one of the issues mentioned below - but I can confirm the plugin code does work with the current version on Nx.

Some problems/WIP stuff I've been facing with the plugin that I'm working through:

  • @nx/dependency-checks plugin is causing problems with the 'openapi-typescript' package. Even though its imported and used properly, and functional, it fails a no-extreneous-dependency check. I assumed that it was related to this issue so I attempted a big upgrade to Nx 19 but no luck.
  • The plugin maintains its own package.json dependencies, which according to Nx docs is a valid implementation but it differs from the serverless-plugin in that way. The thing is - I'm not really sure how the current serverless-plugin is doing things in regards to its dependencies. Would appreciate some clarification on how that works if its known - googling/ looking into Nx code didn't provide much insight.
  • The plugin does not have unit tests. Will need to work on how to implement those properly.
  • As it stands, since it manages its own dependencies, the plugin could be pulled out into its own npm package pretty easily. Nx has some documentation on how to do that - so i'll be working through that.

As mentioned before, this is a further extension of api gen. If this isn't a valid solution, theres always the option of just running the openapi-typescript command using nx anyways. The benefit of the plugin is it can scaffold some other small files that are needed for a more complete "api client"

@ryanrixxh ryanrixxh self-assigned this Oct 3, 2024
@ryanrixxh ryanrixxh requested a review from tvhees as a code owner October 3, 2024 06:00
@ryanrixxh
Copy link
Author

Progress:

With some help from @kai-nguyen-aligent dependency check problems have been solved. The migration to Nx 19 seems to have gone smoothly. Services and Api Clients generate as normal.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants