You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
docs(dev): add dev:docs workflow for local SuperDoc development (#2165)
* docs(dev): add dev:docs workflow for local SuperDoc development
Enable docs contributors to preview interactive widgets with local source changes. `pnpm dev:docs` starts the Vite dev server, UMD watcher, and Mintlify in parallel.
- Refactor SuperDocEditor widget to load from local dev server on localhost
- Add serve-dist-for-docs Vite plugin to serve UMD bundle over CORS
- Add watch:umd script with debounced rebuilds (300ms)
- Document the workflow in apps/docs/README.md
* fix: fallback to unpkg bundle when the superdoc dev server is not running
* fix: conditionally apply watch buildDelay only for watch mode
Set build.watch.buildDelay only when --watch flag is passed via CLI.
This prevents 'pnpm build' from hanging in watch mode while still
allowing buildDelay to debounce rebuilds in watch:umd and dev:docs.
* fix(docs): remove void operator and add proper error handling in superdoc-editor snippet
Move error handling into the async boot() function to properly catch and
log initialization errors instead of discarding the Promise with void.
* fix(docs): add defensive check after script query in superdoc-editor snippet
Check if SuperDocLibrary loaded between outer check and DOM query to handle
edge case where library finishes loading during synchronous code execution.
* fix(docs): add error rejection handling to script load in superdoc-editor snippet
Copy file name to clipboardExpand all lines: apps/docs/README.md
+18-2Lines changed: 18 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -37,10 +37,26 @@ pnpm dev
37
37
38
38
## Development
39
39
40
+
### Developing with local SuperDoc changes
41
+
42
+
To preview docs with your local SuperDoc source (instead of the published npm version), run from the **repo root**:
43
+
44
+
```bash
45
+
pnpm dev:docs
46
+
```
47
+
48
+
This starts three processes:
49
+
50
+
-**Vite dev server** (port 9094) — serves the built UMD bundle at `/dist`
51
+
-**UMD watcher** — rebuilds `dist/superdoc.umd.js` automatically when source files change
52
+
-**Mintlify** (port 3001) — the docs dev server
53
+
54
+
The `<SuperDocEditor>` widget detects `localhost` and loads SuperDoc from the local Vite server instead of unpkg. After saving a source file, the UMD watcher rebuilds automatically — refresh the docs page to see the changes.
55
+
40
56
### Available Scripts
41
57
42
-
-`pnpm dev` - Start Mintlify development server
43
-
-`pnpm build` - Build documentation for production
58
+
-`pnpm dev` - Start Mintlify development server (uses unpkg, no local changes)
59
+
-`pnpm dev:docs` - Start full local dev environment (**run from repo root**)
44
60
-`pnpm sync:api` - Sync API documentation from OpenAPI spec
45
61
-`pnpm sync:sdk` - Sync SDK documentation from TypeDoc
46
62
-`pnpm sync:all` - Sync both API and SDK documentation
0 commit comments