Web UI for swagger-codegen-ts.
This is the (missing) web UI for swagger-codegen-ts. Actually this is whole codegen app ported to client side, no BE required.
Just open https://nedgeva.github.io/swagger-codegen-ts-ui/ and drag-drop your yaml OpenAPI/Swagger spec right to target place. If everything is ok you'll see generated file tree in virtual FS. You're free to inspect each file, export whole output to CodeSandbox or save locally as zipped archive.
Originally swagger-codegen-ts targets NodeJS runtime so it's wasn't planned to run in browser. Therefore shimming of some Node built-ins is required to properly work on client side. At the core of it's dependencies swagger-codegen-ts-ui uses BrowserFS which handles requests to Node API like fs, path, process etc, and provides layer to work with it's own virtual FS. Other shims are covered by Parcel - the build tool.
Besides shimming, some dependencies requires patching to be able successfuly operate in the browser environment. You can refer to patches
folder in project dir (*). Patches should be applied automatically by well-known workaround tool patch-package once packages installed, no extra work required.
So building as easy as:
- cloning this repo
- running
yarn
- and finally
yarn build
Then check output in /dist
folder.
(*) client-side app also forces swagger-codegen-ts to use newer version of Prettier by aliasing dependencies and applying little patch to it's internals, so be aware when building against different versions of swagger-codegen-ts.