litestar-vite 0.2.0__tar.gz → 0.2.1__tar.gz
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.
Potentially problematic release.
This version of litestar-vite might be problematic. Click here for more details.
- {litestar_vite-0.2.0 → litestar_vite-0.2.1}/PKG-INFO +2 -2
- {litestar_vite-0.2.0 → litestar_vite-0.2.1}/litestar_vite/config.py +4 -3
- {litestar_vite-0.2.0 → litestar_vite-0.2.1}/litestar_vite/inertia/exception_handler.py +19 -11
- {litestar_vite-0.2.0 → litestar_vite-0.2.1}/litestar_vite/inertia/response.py +7 -5
- {litestar_vite-0.2.0 → litestar_vite-0.2.1}/pdm.lock +17 -17
- {litestar_vite-0.2.0 → litestar_vite-0.2.1}/pyproject.toml +2 -2
- {litestar_vite-0.2.0 → litestar_vite-0.2.1}/.github/CODEOWNERS +0 -0
- {litestar_vite-0.2.0 → litestar_vite-0.2.1}/.github/dependabot.yaml +0 -0
- {litestar_vite-0.2.0 → litestar_vite-0.2.1}/.github/workflows/cd.yaml +0 -0
- {litestar_vite-0.2.0 → litestar_vite-0.2.1}/.github/workflows/ci.yaml +0 -0
- {litestar_vite-0.2.0 → litestar_vite-0.2.1}/.github/workflows/docs-preview.yaml +0 -0
- {litestar_vite-0.2.0 → litestar_vite-0.2.1}/.github/workflows/docs.yaml +0 -0
- {litestar_vite-0.2.0 → litestar_vite-0.2.1}/.github/workflows/pr-title.yaml +0 -0
- {litestar_vite-0.2.0 → litestar_vite-0.2.1}/.github/workflows/publish.yaml +0 -0
- {litestar_vite-0.2.0 → litestar_vite-0.2.1}/.gitignore +0 -0
- {litestar_vite-0.2.0 → litestar_vite-0.2.1}/.pre-commit-config.yaml +0 -0
- {litestar_vite-0.2.0 → litestar_vite-0.2.1}/.python-version +0 -0
- {litestar_vite-0.2.0 → litestar_vite-0.2.1}/CONTRIBUTING.rst +0 -0
- {litestar_vite-0.2.0 → litestar_vite-0.2.1}/LICENSE +0 -0
- {litestar_vite-0.2.0 → litestar_vite-0.2.1}/Makefile +0 -0
- {litestar_vite-0.2.0 → litestar_vite-0.2.1}/README.md +0 -0
- {litestar_vite-0.2.0 → litestar_vite-0.2.1}/docs/Makefile +0 -0
- {litestar_vite-0.2.0 → litestar_vite-0.2.1}/docs/conf.py +0 -0
- {litestar_vite-0.2.0 → litestar_vite-0.2.1}/docs/contribution-guide.rst +0 -0
- {litestar_vite-0.2.0 → litestar_vite-0.2.1}/docs/fix_missing_references.py +0 -0
- {litestar_vite-0.2.0 → litestar_vite-0.2.1}/docs/index.rst +0 -0
- {litestar_vite-0.2.0 → litestar_vite-0.2.1}/docs/reference/config.rst +0 -0
- {litestar_vite-0.2.0 → litestar_vite-0.2.1}/docs/reference/plugin.rst +0 -0
- {litestar_vite-0.2.0 → litestar_vite-0.2.1}/docs/usage/index.rst +0 -0
- {litestar_vite-0.2.0 → litestar_vite-0.2.1}/docs/usage/placeholder.rst +0 -0
- {litestar_vite-0.2.0 → litestar_vite-0.2.1}/examples/__init__.py +0 -0
- {litestar_vite-0.2.0 → litestar_vite-0.2.1}/examples/basic/app.py +0 -0
- {litestar_vite-0.2.0 → litestar_vite-0.2.1}/examples/basic/package-lock.json +0 -0
- {litestar_vite-0.2.0 → litestar_vite-0.2.1}/examples/basic/package.json +0 -0
- {litestar_vite-0.2.0 → litestar_vite-0.2.1}/examples/basic/public/assets/main-l0sNRNKZ.js +0 -0
- {litestar_vite-0.2.0 → litestar_vite-0.2.1}/examples/basic/public/assets/styles-l0sNRNKZ.js +0 -0
- {litestar_vite-0.2.0 → litestar_vite-0.2.1}/examples/basic/public/manifest.json +0 -0
- {litestar_vite-0.2.0 → litestar_vite-0.2.1}/examples/basic/resources/main.ts +0 -0
- {litestar_vite-0.2.0 → litestar_vite-0.2.1}/examples/basic/resources/styles.css +0 -0
- {litestar_vite-0.2.0 → litestar_vite-0.2.1}/examples/basic/templates/index.html.j2 +0 -0
- {litestar_vite-0.2.0 → litestar_vite-0.2.1}/examples/basic/tsconfig.json +0 -0
- {litestar_vite-0.2.0 → litestar_vite-0.2.1}/examples/basic/vite.config.ts +0 -0
- {litestar_vite-0.2.0 → litestar_vite-0.2.1}/examples/flash/app.py +0 -0
- {litestar_vite-0.2.0 → litestar_vite-0.2.1}/examples/flash/package-lock.json +0 -0
- {litestar_vite-0.2.0 → litestar_vite-0.2.1}/examples/flash/package.json +0 -0
- {litestar_vite-0.2.0 → litestar_vite-0.2.1}/examples/flash/public/assets/main-l0sNRNKZ.js +0 -0
- {litestar_vite-0.2.0 → litestar_vite-0.2.1}/examples/flash/public/assets/styles-l0sNRNKZ.js +0 -0
- {litestar_vite-0.2.0 → litestar_vite-0.2.1}/examples/flash/public/manifest.json +0 -0
- {litestar_vite-0.2.0 → litestar_vite-0.2.1}/examples/flash/resources/main.ts +0 -0
- {litestar_vite-0.2.0 → litestar_vite-0.2.1}/examples/flash/resources/styles.css +0 -0
- {litestar_vite-0.2.0 → litestar_vite-0.2.1}/examples/flash/templates/index.html.j2 +0 -0
- {litestar_vite-0.2.0 → litestar_vite-0.2.1}/examples/flash/tsconfig.json +0 -0
- {litestar_vite-0.2.0 → litestar_vite-0.2.1}/examples/flash/vite.config.ts +0 -0
- {litestar_vite-0.2.0 → litestar_vite-0.2.1}/examples/inertia/app.py +0 -0
- {litestar_vite-0.2.0 → litestar_vite-0.2.1}/examples/inertia/package-lock.json +0 -0
- {litestar_vite-0.2.0 → litestar_vite-0.2.1}/examples/inertia/package.json +0 -0
- {litestar_vite-0.2.0 → litestar_vite-0.2.1}/examples/inertia/postcss.config.cjs +0 -0
- {litestar_vite-0.2.0 → litestar_vite-0.2.1}/examples/inertia/public/assets/main-BIhkjqcE.js +0 -0
- {litestar_vite-0.2.0 → litestar_vite-0.2.1}/examples/inertia/public/assets/styles-B8hX6ha2.css +0 -0
- {litestar_vite-0.2.0 → litestar_vite-0.2.1}/examples/inertia/public/manifest.json +0 -0
- {litestar_vite-0.2.0 → litestar_vite-0.2.1}/examples/inertia/resources/Layout.vue +0 -0
- {litestar_vite-0.2.0 → litestar_vite-0.2.1}/examples/inertia/resources/main.js +0 -0
- {litestar_vite-0.2.0 → litestar_vite-0.2.1}/examples/inertia/resources/pages/Dashboard.vue +0 -0
- {litestar_vite-0.2.0 → litestar_vite-0.2.1}/examples/inertia/resources/pages/Home.vue +0 -0
- {litestar_vite-0.2.0 → litestar_vite-0.2.1}/examples/inertia/resources/styles.css +0 -0
- {litestar_vite-0.2.0 → litestar_vite-0.2.1}/examples/inertia/resources/templates/index.html +0 -0
- {litestar_vite-0.2.0 → litestar_vite-0.2.1}/examples/inertia/resources/vite-env.d.ts +0 -0
- {litestar_vite-0.2.0 → litestar_vite-0.2.1}/examples/inertia/tailwind.config.cjs +0 -0
- {litestar_vite-0.2.0 → litestar_vite-0.2.1}/examples/inertia/tsconfig.json +0 -0
- {litestar_vite-0.2.0 → litestar_vite-0.2.1}/examples/inertia/vite.config.ts +0 -0
- {litestar_vite-0.2.0 → litestar_vite-0.2.1}/litestar_vite/__init__.py +0 -0
- {litestar_vite-0.2.0 → litestar_vite-0.2.1}/litestar_vite/__metadata__.py +0 -0
- {litestar_vite-0.2.0 → litestar_vite-0.2.1}/litestar_vite/cli.py +0 -0
- {litestar_vite-0.2.0 → litestar_vite-0.2.1}/litestar_vite/commands.py +0 -0
- {litestar_vite-0.2.0 → litestar_vite-0.2.1}/litestar_vite/inertia/__init__.py +0 -0
- {litestar_vite-0.2.0 → litestar_vite-0.2.1}/litestar_vite/inertia/_utils.py +0 -0
- {litestar_vite-0.2.0 → litestar_vite-0.2.1}/litestar_vite/inertia/config.py +0 -0
- {litestar_vite-0.2.0 → litestar_vite-0.2.1}/litestar_vite/inertia/middleware.py +0 -0
- {litestar_vite-0.2.0 → litestar_vite-0.2.1}/litestar_vite/inertia/plugin.py +0 -0
- {litestar_vite-0.2.0 → litestar_vite-0.2.1}/litestar_vite/inertia/request.py +0 -0
- {litestar_vite-0.2.0 → litestar_vite-0.2.1}/litestar_vite/inertia/routes.py +0 -0
- {litestar_vite-0.2.0 → litestar_vite-0.2.1}/litestar_vite/inertia/types.py +0 -0
- {litestar_vite-0.2.0 → litestar_vite-0.2.1}/litestar_vite/loader.py +0 -0
- {litestar_vite-0.2.0 → litestar_vite-0.2.1}/litestar_vite/plugin.py +0 -0
- {litestar_vite-0.2.0 → litestar_vite-0.2.1}/litestar_vite/py.typed +0 -0
- {litestar_vite-0.2.0 → litestar_vite-0.2.1}/litestar_vite/template_engine.py +0 -0
- {litestar_vite-0.2.0 → litestar_vite-0.2.1}/litestar_vite/templates/__init__.py +0 -0
- {litestar_vite-0.2.0 → litestar_vite-0.2.1}/litestar_vite/templates/index.html.j2 +0 -0
- {litestar_vite-0.2.0 → litestar_vite-0.2.1}/litestar_vite/templates/main.ts.j2 +0 -0
- {litestar_vite-0.2.0 → litestar_vite-0.2.1}/litestar_vite/templates/package.json.j2 +0 -0
- {litestar_vite-0.2.0 → litestar_vite-0.2.1}/litestar_vite/templates/styles.css.j2 +0 -0
- {litestar_vite-0.2.0 → litestar_vite-0.2.1}/litestar_vite/templates/tsconfig.json.j2 +0 -0
- {litestar_vite-0.2.0 → litestar_vite-0.2.1}/litestar_vite/templates/vite.config.ts.j2 +0 -0
- {litestar_vite-0.2.0 → litestar_vite-0.2.1}/tests/__init__.py +0 -0
- {litestar_vite-0.2.0 → litestar_vite-0.2.1}/tests/conftest.py +0 -0
- {litestar_vite-0.2.0 → litestar_vite-0.2.1}/tests/templates/__init__.py +0 -0
- {litestar_vite-0.2.0 → litestar_vite-0.2.1}/tests/templates/index.html.j2 +0 -0
- {litestar_vite-0.2.0 → litestar_vite-0.2.1}/tests/test_app/__init__.py +0 -0
- {litestar_vite-0.2.0 → litestar_vite-0.2.1}/tests/test_app/app.py +0 -0
- {litestar_vite-0.2.0 → litestar_vite-0.2.1}/tests/test_app/web/__init__.py +0 -0
- {litestar_vite-0.2.0 → litestar_vite-0.2.1}/tests/test_app/web/public/.gitkeep +0 -0
- {litestar_vite-0.2.0 → litestar_vite-0.2.1}/tests/test_app/web/public/assets/main-l0sNRNKZ.js +0 -0
- {litestar_vite-0.2.0 → litestar_vite-0.2.1}/tests/test_app/web/public/assets/styles-l0sNRNKZ.js +0 -0
- {litestar_vite-0.2.0 → litestar_vite-0.2.1}/tests/test_app/web/public/manifest.json +0 -0
- {litestar_vite-0.2.0 → litestar_vite-0.2.1}/tests/test_app/web/resources/.gitkeep +0 -0
- {litestar_vite-0.2.0 → litestar_vite-0.2.1}/tests/test_app/web/resources/main.ts +0 -0
- {litestar_vite-0.2.0 → litestar_vite-0.2.1}/tests/test_app/web/resources/styles.css +0 -0
- {litestar_vite-0.2.0 → litestar_vite-0.2.1}/tests/test_app/web/templates/.gitkeep +0 -0
- {litestar_vite-0.2.0 → litestar_vite-0.2.1}/tests/test_app/web/templates/index.html +0 -0
- {litestar_vite-0.2.0 → litestar_vite-0.2.1}/tests/test_cli/__init__.py +0 -0
- {litestar_vite-0.2.0 → litestar_vite-0.2.1}/tests/test_cli/conftest.py +0 -0
- {litestar_vite-0.2.0 → litestar_vite-0.2.1}/tests/test_cli/test_init.py +0 -0
- {litestar_vite-0.2.0 → litestar_vite-0.2.1}/tests/test_commands.py +0 -0
- {litestar_vite-0.2.0 → litestar_vite-0.2.1}/tests/test_config.py +0 -0
- {litestar_vite-0.2.0 → litestar_vite-0.2.1}/tests/test_inertia/__init__.py +0 -0
- {litestar_vite-0.2.0 → litestar_vite-0.2.1}/tests/test_inertia/conftest.py +0 -0
- {litestar_vite-0.2.0 → litestar_vite-0.2.1}/tests/test_inertia/templates/index.html.j2 +0 -0
- {litestar_vite-0.2.0 → litestar_vite-0.2.1}/tests/test_inertia/test_inertia_request.py +0 -0
- {litestar_vite-0.2.0 → litestar_vite-0.2.1}/tests/test_inertia/test_inertia_response.py +0 -0
- {litestar_vite-0.2.0 → litestar_vite-0.2.1}/tests/test_inertia/test_routes.py +0 -0
- {litestar_vite-0.2.0 → litestar_vite-0.2.1}/tests/test_template_engine.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: litestar-vite
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.1
|
|
4
4
|
Summary: Vite plugin for Litestar
|
|
5
5
|
Project-URL: Changelog, https://cofin.github.io/litestar-vite/latest/changelog
|
|
6
6
|
Project-URL: Discord, https://discord.gg/X3FJqy8d2j
|
|
@@ -30,7 +30,7 @@ Classifier: Topic :: Database :: Database Engines/Servers
|
|
|
30
30
|
Classifier: Topic :: Software Development
|
|
31
31
|
Classifier: Typing :: Typed
|
|
32
32
|
Requires-Python: >=3.8
|
|
33
|
-
Requires-Dist: litestar[jinja]>=2.
|
|
33
|
+
Requires-Dist: litestar[jinja]>=2.7.0
|
|
34
34
|
Provides-Extra: nodeenv
|
|
35
35
|
Requires-Dist: nodeenv; extra == 'nodeenv'
|
|
36
36
|
Description-Content-Type: text/markdown
|
|
@@ -17,6 +17,7 @@ if TYPE_CHECKING:
|
|
|
17
17
|
|
|
18
18
|
__all__ = ("ViteConfig", "ViteTemplateConfig")
|
|
19
19
|
EngineType = TypeVar("EngineType", bound=TemplateEngineProtocol[Any, Any])
|
|
20
|
+
TRUE_VALUES = {"True", "true", "1", "yes", "Y", "T"}
|
|
20
21
|
|
|
21
22
|
|
|
22
23
|
@dataclass
|
|
@@ -53,7 +54,7 @@ class ViteConfig:
|
|
|
53
54
|
This file contains a single line containing the host, protocol, and port the Vite server is running.
|
|
54
55
|
"""
|
|
55
56
|
hot_reload: bool = field(
|
|
56
|
-
default_factory=lambda: os.getenv("VITE_HOT_RELOAD", "True") in
|
|
57
|
+
default_factory=lambda: os.getenv("VITE_HOT_RELOAD", "True") in TRUE_VALUES,
|
|
57
58
|
)
|
|
58
59
|
"""Enable HMR for Vite development server."""
|
|
59
60
|
ssr_enabled: bool = False
|
|
@@ -88,11 +89,11 @@ class ViteConfig:
|
|
|
88
89
|
install_command: list[str] = field(default_factory=lambda: ["npm", "install"])
|
|
89
90
|
"""Default command to use for installing Vite."""
|
|
90
91
|
use_server_lifespan: bool = field(
|
|
91
|
-
default_factory=lambda: os.getenv("VITE_USE_SERVER_LIFESPAN", "False") in
|
|
92
|
+
default_factory=lambda: os.getenv("VITE_USE_SERVER_LIFESPAN", "False") in TRUE_VALUES,
|
|
92
93
|
)
|
|
93
94
|
"""Utilize the server lifespan hook to run Vite."""
|
|
94
95
|
dev_mode: bool = field(
|
|
95
|
-
default_factory=lambda: os.getenv("VITE_DEV_MODE", "False") in
|
|
96
|
+
default_factory=lambda: os.getenv("VITE_DEV_MODE", "False") in TRUE_VALUES,
|
|
96
97
|
)
|
|
97
98
|
"""When True, Vite will run with HMR or watch build"""
|
|
98
99
|
detect_nodeenv: bool = True
|
|
@@ -7,6 +7,7 @@ from litestar.connection.base import AuthT, StateT, UserT
|
|
|
7
7
|
from litestar.exceptions import (
|
|
8
8
|
HTTPException,
|
|
9
9
|
InternalServerException,
|
|
10
|
+
NotAuthorizedException,
|
|
10
11
|
NotFoundException,
|
|
11
12
|
PermissionDeniedException,
|
|
12
13
|
)
|
|
@@ -27,6 +28,7 @@ from litestar.status_codes import (
|
|
|
27
28
|
HTTP_422_UNPROCESSABLE_ENTITY,
|
|
28
29
|
HTTP_500_INTERNAL_SERVER_ERROR,
|
|
29
30
|
)
|
|
31
|
+
from litestar.types import Empty
|
|
30
32
|
|
|
31
33
|
from litestar_vite.inertia.response import InertiaBack, InertiaRedirect, InertiaResponse, error
|
|
32
34
|
|
|
@@ -55,6 +57,7 @@ def exception_to_http_response(request: Request[UserT, AuthT, StateT], exc: Exce
|
|
|
55
57
|
if request.app.debug and http_exc not in (PermissionDeniedException, NotFoundError):
|
|
56
58
|
return cast("Response[Any]", create_debug_response(request, exc))
|
|
57
59
|
return cast("Response[Any]", create_exception_response(request, http_exc(detail=str(exc.__cause__))))
|
|
60
|
+
has_active_session = not (not request.session or request.scope["session"] is Empty)
|
|
58
61
|
is_inertia = getattr(request, "is_inertia", False)
|
|
59
62
|
status_code = getattr(exc, "status_code", HTTP_500_INTERNAL_SERVER_ERROR)
|
|
60
63
|
preferred_type = MediaType.HTML if inertia_enabled and not is_inertia else MediaType.JSON
|
|
@@ -64,26 +67,31 @@ def exception_to_http_response(request: Request[UserT, AuthT, StateT], exc: Exce
|
|
|
64
67
|
inertia_plugin = cast("InertiaPlugin", request.app.plugins.get("InertiaPlugin"))
|
|
65
68
|
if extras:
|
|
66
69
|
content.update({"extra": extras})
|
|
67
|
-
|
|
70
|
+
if has_active_session:
|
|
71
|
+
flash(request, detail, category="error")
|
|
68
72
|
if extras and len(extras) >= 1:
|
|
69
73
|
message = extras[0]
|
|
70
74
|
default_field = f"root.{message.get('key')}" if message.get("key", None) is not None else "root" # type: ignore
|
|
71
75
|
error_detail = cast("str", message.get("message", detail)) # type: ignore[union-attr] # pyright: ignore[reportUnknownMemberType,reportUnknownArgumentType]
|
|
72
76
|
match = FIELD_ERR_RE.search(error_detail)
|
|
73
77
|
field = match.group(1) if match else default_field
|
|
74
|
-
if isinstance(message, dict):
|
|
78
|
+
if isinstance(message, dict) and has_active_session:
|
|
75
79
|
error(request, field, error_detail)
|
|
76
|
-
if status_code in {HTTP_422_UNPROCESSABLE_ENTITY, HTTP_400_BAD_REQUEST}
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
status_code == HTTP_401_UNAUTHORIZED
|
|
80
|
-
and inertia_plugin.config.redirect_unauthorized_to is not None
|
|
81
|
-
and not request.url.path.startswith(inertia_plugin.config.redirect_unauthorized_to)
|
|
80
|
+
if status_code in {HTTP_422_UNPROCESSABLE_ENTITY, HTTP_400_BAD_REQUEST} or isinstance(
|
|
81
|
+
exc,
|
|
82
|
+
PermissionDeniedException,
|
|
82
83
|
):
|
|
83
|
-
return
|
|
84
|
-
|
|
85
|
-
|
|
84
|
+
return InertiaBack(request)
|
|
85
|
+
if isinstance(exc, PermissionDeniedException):
|
|
86
|
+
return InertiaBack(request)
|
|
87
|
+
if status_code == HTTP_401_UNAUTHORIZED or isinstance(exc, NotAuthorizedException):
|
|
88
|
+
redirect_to = (
|
|
89
|
+
inertia_plugin.config.redirect_unauthorized_to is not None
|
|
90
|
+
and str(request.url) != inertia_plugin.config.redirect_unauthorized_to
|
|
86
91
|
)
|
|
92
|
+
if redirect_to:
|
|
93
|
+
return InertiaRedirect(request, redirect_to=cast("str", inertia_plugin.config.redirect_unauthorized_to))
|
|
94
|
+
return InertiaBack(request)
|
|
87
95
|
return InertiaResponse[Any](
|
|
88
96
|
media_type=preferred_type,
|
|
89
97
|
content=content,
|
|
@@ -6,7 +6,7 @@ from functools import lru_cache
|
|
|
6
6
|
from mimetypes import guess_type
|
|
7
7
|
from pathlib import PurePath
|
|
8
8
|
from textwrap import dedent
|
|
9
|
-
from typing import TYPE_CHECKING, Any, Dict, Iterable, Mapping, TypeVar, cast
|
|
9
|
+
from typing import TYPE_CHECKING, Any, Dict, Iterable, List, Mapping, TypeVar, cast
|
|
10
10
|
from urllib.parse import quote
|
|
11
11
|
|
|
12
12
|
from litestar import Litestar, MediaType, Request, Response
|
|
@@ -16,6 +16,7 @@ from litestar.response import Redirect
|
|
|
16
16
|
from litestar.response.base import ASGIResponse
|
|
17
17
|
from litestar.serialization import get_serializer
|
|
18
18
|
from litestar.status_codes import HTTP_200_OK, HTTP_303_SEE_OTHER, HTTP_307_TEMPORARY_REDIRECT, HTTP_409_CONFLICT
|
|
19
|
+
from litestar.types import Empty
|
|
19
20
|
from litestar.utils.deprecation import warn_deprecation
|
|
20
21
|
from litestar.utils.empty import value_or_default
|
|
21
22
|
from litestar.utils.helpers import get_enum_string_value
|
|
@@ -63,10 +64,11 @@ def get_shared_props(request: ASGIConnection[Any, Any, Any, Any]) -> Dict[str, A
|
|
|
63
64
|
Be sure to call this before `self.create_template_context` if you would like to include the `flash` message details.
|
|
64
65
|
"""
|
|
65
66
|
error_bag = request.headers.get("X-Inertia-Error-Bag", None)
|
|
66
|
-
|
|
67
|
-
|
|
67
|
+
has_active_session = not (not request.session or request.scope["session"] is Empty)
|
|
68
|
+
errors: dict[str, Any] = request.session.pop("_errors", {}) if has_active_session else {}
|
|
69
|
+
props: dict[str, Any] = request.session.pop("_shared", {}) if has_active_session else {}
|
|
68
70
|
flash: dict[str, list[str]] = defaultdict(list)
|
|
69
|
-
for message in request.session.pop("_messages", []):
|
|
71
|
+
for message in cast("List[Dict[str,Any]]", request.session.pop("_messages", []) if has_active_session else []):
|
|
70
72
|
flash[message["category"]].append(message["message"])
|
|
71
73
|
|
|
72
74
|
inertia_plugin = cast("InertiaPlugin", request.app.plugins.get("InertiaPlugin"))
|
|
@@ -338,7 +340,7 @@ class InertiaBack(Redirect):
|
|
|
338
340
|
and pass redirect url.
|
|
339
341
|
"""
|
|
340
342
|
super().__init__(
|
|
341
|
-
path=request.headers
|
|
343
|
+
path=request.headers.get("referrer", str(request.base_url)),
|
|
342
344
|
status_code=HTTP_307_TEMPORARY_REDIRECT if request.method == "GET" else HTTP_303_SEE_OTHER,
|
|
343
345
|
cookies=request.cookies,
|
|
344
346
|
**kwargs,
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
groups = ["default", "dev", "docs", "linting", "nodeenv", "test"]
|
|
6
6
|
strategy = ["inherit_metadata"]
|
|
7
7
|
lock_version = "4.5.0"
|
|
8
|
-
content_hash = "sha256:
|
|
8
|
+
content_hash = "sha256:55d55a5e5c3f3a4a552f16d6764c9dfd26ef3ddd3fbff51781236391c936d081"
|
|
9
9
|
|
|
10
10
|
[[metadata.targets]]
|
|
11
11
|
requires_python = ">=3.8"
|
|
@@ -482,14 +482,14 @@ files = [
|
|
|
482
482
|
|
|
483
483
|
[[package]]
|
|
484
484
|
name = "exceptiongroup"
|
|
485
|
-
version = "1.2.
|
|
485
|
+
version = "1.2.2"
|
|
486
486
|
requires_python = ">=3.7"
|
|
487
487
|
summary = "Backport of PEP 654 (exception groups)"
|
|
488
488
|
groups = ["default", "dev", "test"]
|
|
489
489
|
marker = "python_version < \"3.11\""
|
|
490
490
|
files = [
|
|
491
|
-
{file = "exceptiongroup-1.2.
|
|
492
|
-
{file = "exceptiongroup-1.2.
|
|
491
|
+
{file = "exceptiongroup-1.2.2-py3-none-any.whl", hash = "sha256:3111b9d131c238bec2f8f516e123e14ba243563fb135d3fe885990585aa7795b"},
|
|
492
|
+
{file = "exceptiongroup-1.2.2.tar.gz", hash = "sha256:47c2edf7c6738fafb49fd34290706d1a1a2f4d1c6df275526b62cbb4aa5393cc"},
|
|
493
493
|
]
|
|
494
494
|
|
|
495
495
|
[[package]]
|
|
@@ -662,13 +662,13 @@ files = [
|
|
|
662
662
|
|
|
663
663
|
[[package]]
|
|
664
664
|
name = "identify"
|
|
665
|
-
version = "2.
|
|
665
|
+
version = "2.6.0"
|
|
666
666
|
requires_python = ">=3.8"
|
|
667
667
|
summary = "File identification library for Python"
|
|
668
668
|
groups = ["linting"]
|
|
669
669
|
files = [
|
|
670
|
-
{file = "identify-2.
|
|
671
|
-
{file = "identify-2.
|
|
670
|
+
{file = "identify-2.6.0-py2.py3-none-any.whl", hash = "sha256:e79ae4406387a9d300332b5fd366d8994f1525e8414984e1a59e058b2eda2dd0"},
|
|
671
|
+
{file = "identify-2.6.0.tar.gz", hash = "sha256:cb171c685bdc31bcc4c1734698736a7d5b6c8bf2e0c15117f4d469c8640ae5cf"},
|
|
672
672
|
]
|
|
673
673
|
|
|
674
674
|
[[package]]
|
|
@@ -1239,7 +1239,7 @@ files = [
|
|
|
1239
1239
|
|
|
1240
1240
|
[[package]]
|
|
1241
1241
|
name = "polyfactory"
|
|
1242
|
-
version = "2.16.
|
|
1242
|
+
version = "2.16.2"
|
|
1243
1243
|
requires_python = "<4.0,>=3.8"
|
|
1244
1244
|
summary = "Mock data generation factories"
|
|
1245
1245
|
groups = ["default", "dev"]
|
|
@@ -1248,8 +1248,8 @@ dependencies = [
|
|
|
1248
1248
|
"typing-extensions>=4.6.0",
|
|
1249
1249
|
]
|
|
1250
1250
|
files = [
|
|
1251
|
-
{file = "polyfactory-2.16.
|
|
1252
|
-
{file = "polyfactory-2.16.
|
|
1251
|
+
{file = "polyfactory-2.16.2-py3-none-any.whl", hash = "sha256:e5eaf97358fee07d0d8de86a93e81dc56e3be1e1514d145fea6c5f486cda6ea1"},
|
|
1252
|
+
{file = "polyfactory-2.16.2.tar.gz", hash = "sha256:6d0d90deb85e5bb1733ea8744c2d44eea2b31656e11b4fa73832d2e2ab5422da"},
|
|
1253
1253
|
]
|
|
1254
1254
|
|
|
1255
1255
|
[[package]]
|
|
@@ -1988,7 +1988,7 @@ files = [
|
|
|
1988
1988
|
|
|
1989
1989
|
[[package]]
|
|
1990
1990
|
name = "uvicorn"
|
|
1991
|
-
version = "0.30.
|
|
1991
|
+
version = "0.30.3"
|
|
1992
1992
|
requires_python = ">=3.8"
|
|
1993
1993
|
summary = "The lightning-fast ASGI server."
|
|
1994
1994
|
groups = ["dev"]
|
|
@@ -1998,13 +1998,13 @@ dependencies = [
|
|
|
1998
1998
|
"typing-extensions>=4.0; python_version < \"3.11\"",
|
|
1999
1999
|
]
|
|
2000
2000
|
files = [
|
|
2001
|
-
{file = "uvicorn-0.30.
|
|
2002
|
-
{file = "uvicorn-0.30.
|
|
2001
|
+
{file = "uvicorn-0.30.3-py3-none-any.whl", hash = "sha256:94a3608da0e530cea8f69683aa4126364ac18e3826b6630d1a65f4638aade503"},
|
|
2002
|
+
{file = "uvicorn-0.30.3.tar.gz", hash = "sha256:0d114d0831ff1adbf231d358cbf42f17333413042552a624ea6a9b4c33dcfd81"},
|
|
2003
2003
|
]
|
|
2004
2004
|
|
|
2005
2005
|
[[package]]
|
|
2006
2006
|
name = "uvicorn"
|
|
2007
|
-
version = "0.30.
|
|
2007
|
+
version = "0.30.3"
|
|
2008
2008
|
extras = ["standard"]
|
|
2009
2009
|
requires_python = ">=3.8"
|
|
2010
2010
|
summary = "The lightning-fast ASGI server."
|
|
@@ -2014,14 +2014,14 @@ dependencies = [
|
|
|
2014
2014
|
"httptools>=0.5.0",
|
|
2015
2015
|
"python-dotenv>=0.13",
|
|
2016
2016
|
"pyyaml>=5.1",
|
|
2017
|
-
"uvicorn==0.30.
|
|
2017
|
+
"uvicorn==0.30.3",
|
|
2018
2018
|
"uvloop!=0.15.0,!=0.15.1,>=0.14.0; (sys_platform != \"cygwin\" and sys_platform != \"win32\") and platform_python_implementation != \"PyPy\"",
|
|
2019
2019
|
"watchfiles>=0.13",
|
|
2020
2020
|
"websockets>=10.4",
|
|
2021
2021
|
]
|
|
2022
2022
|
files = [
|
|
2023
|
-
{file = "uvicorn-0.30.
|
|
2024
|
-
{file = "uvicorn-0.30.
|
|
2023
|
+
{file = "uvicorn-0.30.3-py3-none-any.whl", hash = "sha256:94a3608da0e530cea8f69683aa4126364ac18e3826b6630d1a65f4638aade503"},
|
|
2024
|
+
{file = "uvicorn-0.30.3.tar.gz", hash = "sha256:0d114d0831ff1adbf231d358cbf42f17333413042552a624ea6a9b4c33dcfd81"},
|
|
2025
2025
|
]
|
|
2026
2026
|
|
|
2027
2027
|
[[package]]
|
|
@@ -19,14 +19,14 @@ classifiers = [
|
|
|
19
19
|
"Topic :: Database",
|
|
20
20
|
"Topic :: Database :: Database Engines/Servers",
|
|
21
21
|
]
|
|
22
|
-
dependencies = ["litestar[jinja]>=2.
|
|
22
|
+
dependencies = ["litestar[jinja]>=2.7.0"]
|
|
23
23
|
description = "Vite plugin for Litestar"
|
|
24
24
|
keywords = ["litestar", "vite"]
|
|
25
25
|
license = { text = "MIT" }
|
|
26
26
|
name = "litestar-vite"
|
|
27
27
|
readme = "README.md"
|
|
28
28
|
requires-python = ">=3.8"
|
|
29
|
-
version = "0.2.
|
|
29
|
+
version = "0.2.1"
|
|
30
30
|
|
|
31
31
|
[project.urls]
|
|
32
32
|
Changelog = "https://cofin.github.io/litestar-vite/latest/changelog"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{litestar_vite-0.2.0 → litestar_vite-0.2.1}/examples/inertia/public/assets/styles-B8hX6ha2.css
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{litestar_vite-0.2.0 → litestar_vite-0.2.1}/tests/test_app/web/public/assets/main-l0sNRNKZ.js
RENAMED
|
File without changes
|
{litestar_vite-0.2.0 → litestar_vite-0.2.1}/tests/test_app/web/public/assets/styles-l0sNRNKZ.js
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|