asyncapi / saunter

Saunter is a code-first AsyncAPI documentation generator for dotnet.
https://www.asyncapi.com/
MIT License
199 stars 56 forks source link

Missing UI files (when NPM install is not run) #118

Closed amul047 closed 2 years ago

amul047 commented 3 years ago

I ran the Streetlights example API, and attempted to visit /asyncapi/ui/ for the UI.

However, it seems that two files referenced from the index.html are missing - index.js and default.min.css. The former appears to be leading to this error.

index.html:14 Uncaught ReferenceError: AsyncApiStandalone is not defined
    at index.html:14
(anonymous) @ index.html:14
m-wild commented 3 years ago

These files need to be installed/restored from NPM. I opted not to automatically run npm install from MSBuild so that the .NET project could be built without needing to install NodeJS & NPM.

The CI/CD workflows do this automatically: https://github.com/tehmantra/saunter/blob/fcfe05f6045d2f49473b262e87e157bede630d12/.github/workflows/ci.yaml#L27

And there is a unit test to check that the resource exists: https://github.com/tehmantra/saunter/blob/fcfe05f6045d2f49473b262e87e157bede630d12/test/Saunter.Tests/UI/EmbeddedResourceTests.cs#L17

I'm not sure how to make the developer experience better here? Perhaps having instructions in the README to use NPM if you want to test the UI? What would have helped you most in this scenario?

amul047 commented 3 years ago

Thanks for your help, just an update to the example README.md would be useful. It only talks about dotnet run at the moment.