zuplo / zudoku

Framework for building high quality, interactive API documentation.
https://zudoku.dev
MIT License
97 stars 7 forks source link

Local setup: How to run demo.html & standalone.html without build ? #261

Open majoshi1 opened 1 month ago

majoshi1 commented 1 month ago

I cloned the repo and could run examples. But also see files demo.html/demo.tsx under packages/zudoku folder. Is it possible to run demo.html, in local?

OS: Windows 10. Client: Git Bash

$ git clone https://github.com/zuplo/zudoku.git
$ pnpm i
$ export ZUDOKU_INTERNAL_DEV=1
$ nx run with-openapi-json:dev    # Works fine

$ cd packages/zudoku

$ npm run build:standalone:vite   # Works fine
> zudoku@0.12.0 build:standalone:vite
> vite build --mode standalone --config vite.standalone.config.ts
. . .
✓ built in 1m 33s

$ npm run build:standalone:html   # Works fine
. . .

$ npx vite src/app/demo.html --port 3000    # Fails
(!) Could not auto-determine entry point from rollupOptions or html files and there are no explicit optimizeDeps.include patterns. Skipping dependency pre-bundling.
linear[bot] commented 1 month ago

ZUP-3703 Local setup: How to run demo.html & standalone.html without build ?

dan-lee commented 1 month ago

What I do is:

nx run zudoku:build:ci
npx serve@latest packages/zudoku/standalone

// then open this for example:
http://localhost:3000/demo?api-url=https://rickandmorty.zuplo.io/openapi.json

This serves as an example for how to use it with HTML (see docs) and we use it on zudoku.dev to serve the demo.

majoshi1 commented 1 month ago

Thanks for the details. I could run it. Although, the page does not update if I make any change in code e.g. DemoAnnouncement.tsx. It worked only after I repeated above steps. Is it possible to make changes and test them simultaneously?