fastapi-voyager 0.16.0a3__py3-none-any.whl → 0.16.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,2 +1,2 @@
1
1
  __all__ = ["__version__"]
2
- __version__ = "0.16.0alpha-3"
2
+ __version__ = "0.16.1"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: fastapi-voyager
3
- Version: 0.16.0a3
3
+ Version: 0.16.1
4
4
  Summary: Visualize FastAPI application's routing tree and dependencies
5
5
  Project-URL: Homepage, https://github.com/allmonday/fastapi-voyager
6
6
  Project-URL: Source, https://github.com/allmonday/fastapi-voyager
@@ -205,34 +205,44 @@ uvicorn your_app:application --reload
205
205
 
206
206
  ### Litestar
207
207
 
208
+ Litestar doesn't support mounting to an existing app like FastAPI. The recommended pattern is to export `ROUTE_HANDLERS` from your main app:
209
+
208
210
  ```python
209
- from litestar import Litestar, get
210
- from fastapi_voyager import create_voyager
211
+ # In your main app file (e.g., app.py)
212
+ from litestar import Litestar, Controller
211
213
 
212
- # Create Litestar app
213
- app = Litestar()
214
+ class MyController(Controller):
215
+ # ... your routes ...
214
216
 
215
- @get("/hello")
216
- def hello() -> dict:
217
- return {"message": "Hello World"}
217
+ ROUTE_HANDLERS = [MyController] # Export for extension
218
+ app = Litestar(route_handlers=ROUTE_HANDLERS)
219
+ ```
218
220
 
219
- # Create voyager app (returns a Litestar app)
220
- voyager_app = create_voyager(app)
221
+ Then create voyager by reusing `ROUTE_HANDLERS`:
221
222
 
222
- # Create ASGI application that routes between main app and voyager
223
- async def asgi_app(scope, receive, send):
224
- if scope["type"] == "http" and scope["path"].startswith("/voyager"):
225
- # Remove /voyager prefix for voyager app
226
- new_scope = dict(scope)
227
- new_scope["path"] = scope["path"][8:] or "/"
228
- await voyager_app(new_scope, receive, send)
229
- else:
230
- await app(scope, receive, send)
223
+ ```python
224
+ # In your voyager embedding file
225
+ from typing import Any, Awaitable, Callable
226
+ from litestar import Litestar, asgi
227
+ from fastapi_voyager import create_voyager
228
+ from your_app import ROUTE_HANDLERS, app as your_app
229
+
230
+ voyager_app = create_voyager(your_app)
231
+
232
+ @asgi("/voyager", is_mount=True, copy_scope=True)
233
+ async def voyager_mount(
234
+ scope: dict[str, Any],
235
+ receive: Callable[[], Awaitable[dict[str, Any]]],
236
+ send: Callable[[dict[str, Any]], Awaitable[None]]
237
+ ) -> None:
238
+ await voyager_app(scope, receive, send)
239
+
240
+ app = Litestar(route_handlers=ROUTE_HANDLERS + [voyager_mount])
231
241
  ```
232
242
 
233
243
  Start with:
234
244
  ```bash
235
- uvicorn your_app:asgi_app --reload
245
+ uvicorn your_app:app --reload
236
246
  # Visit http://localhost:8000/voyager
237
247
  ```
238
248
 
@@ -335,6 +345,8 @@ voyager -m tests.demo --server --port=8002
335
345
  voyager -m tests.demo --server --app my_app
336
346
  ```
337
347
 
348
+ > **Note**: Server mode does not support ER diagram or pydantic-resolve metadata configuration. Use `create_voyager()` in your code with `er_diagram` and `enable_pydantic_resolve_meta` parameters to enable these features.
349
+
338
350
  ### Generate DOT File
339
351
 
340
352
  ```bash
@@ -9,7 +9,7 @@ fastapi_voyager/render_style.py,sha256=1y3aRhBSJSWU-JuSgjn9il_xFEqjv6mJCoUzImLQT
9
9
  fastapi_voyager/server.py,sha256=qHCN5EqoFwqvIGsMX-ALiogUc4x0xWLpVFpgO06KZvA,7035
10
10
  fastapi_voyager/type.py,sha256=zluWvh5vpnjXJ9aAmyNJTSmXZPjAHCvgRT5oQRAjHrg,2104
11
11
  fastapi_voyager/type_helper.py,sha256=5HYUHdghTISZ44NvVsrMWlRGD5C9-xrGeNKuLYDMA6s,10209
12
- fastapi_voyager/version.py,sha256=zh4QycBWD2nGHz_cZwy5vHQ1KDWxkhAdF_-JPiTVFzU,56
12
+ fastapi_voyager/version.py,sha256=KQqsioyKo8ILOoP_53tP9pUeioVRilkmAOxElLW67O4,49
13
13
  fastapi_voyager/voyager.py,sha256=S0cCMLFv_wPfEMVdp4cYqbc-Y207SjCTSmsYdqzIDHg,15307
14
14
  fastapi_voyager/adapters/__init__.py,sha256=a95rBvV4QVcX_yAzjuJQKOW-EbJ79R--YjUJ3BGkC3k,517
15
15
  fastapi_voyager/adapters/base.py,sha256=mTYCnYYR4VtA7a-cTJmhsT_Up0hgxLC0hBzUbYxQCJQ,1039
@@ -55,8 +55,8 @@ fastapi_voyager/web/icon/favicon-16x16.png,sha256=JC07jEzfIYxBIoQn_FHXvyHuxESdhW
55
55
  fastapi_voyager/web/icon/favicon-32x32.png,sha256=C7v1h58cfWOsiLp9yOIZtlx-dLasBcq3NqpHVGRmpt4,1859
56
56
  fastapi_voyager/web/icon/favicon.ico,sha256=tZolYIXkkBcFiYl1A8ksaXN2VjGamzcSdes838dLvNc,15406
57
57
  fastapi_voyager/web/icon/site.webmanifest,sha256=GRozZ5suTykYcPMap1QhjrAB8PLW0mbT_phhzw_utvQ,316
58
- fastapi_voyager-0.16.0a3.dist-info/METADATA,sha256=v39CCqmxr4ls6J4m9--3R1vPTTBFnAkEBX0BHY9Tgyo,13811
59
- fastapi_voyager-0.16.0a3.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
60
- fastapi_voyager-0.16.0a3.dist-info/entry_points.txt,sha256=pEIKoUnIDXEtdMBq8EmXm70m16vELIu1VPz9-TBUFWM,53
61
- fastapi_voyager-0.16.0a3.dist-info/licenses/LICENSE,sha256=lNVRR3y_bFVoFKuK2JM8N4sFaj3m-7j29kvL3olFi5Y,1067
62
- fastapi_voyager-0.16.0a3.dist-info/RECORD,,
58
+ fastapi_voyager-0.16.1.dist-info/METADATA,sha256=g9vjbDlp4LoZjeWk_Od6CliTYNJV1XCzHaAElEEit4s,14364
59
+ fastapi_voyager-0.16.1.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
60
+ fastapi_voyager-0.16.1.dist-info/entry_points.txt,sha256=pEIKoUnIDXEtdMBq8EmXm70m16vELIu1VPz9-TBUFWM,53
61
+ fastapi_voyager-0.16.1.dist-info/licenses/LICENSE,sha256=lNVRR3y_bFVoFKuK2JM8N4sFaj3m-7j29kvL3olFi5Y,1067
62
+ fastapi_voyager-0.16.1.dist-info/RECORD,,