Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: updated lazy handling #64

Merged
merged 3 commits into from
Dec 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
486 changes: 476 additions & 10 deletions package-lock.json

Large diffs are not rendered by default.

18 changes: 12 additions & 6 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,11 @@ nodeenv = ["nodeenv"]
build-backend = "hatchling.build"
requires = ["hatchling"]

[tool.hatch.build]
dev-mode-dirs = ["src/py", "."]

[tool.hatch.build.targets.sdist]
dev-mode-dirs = ["src/py", "."]
exclude = [".github", "docs"]
packages = ["src/py/litestar_vite", "src/py/tests"]
include = ["src/py/*","src/js/*"]
skip-excluded-dirs = false

Expand All @@ -55,7 +55,7 @@ packages = ["src/py/litestar_vite"]
sources = ["src/py"]

[dependency-groups]
dev = [ {include-group = "build"}, { include-group = "linting" }, { include-group = "test" }, { include-group = "docs" } ]
dev = [ {include-group = "build"}, { include-group = "linting" }, { include-group = "test" }, { include-group = "docs" } ]
build = ["bump-my-version"]
docs = [
"auto-pytabs[sphinx]>=0.4.0",
Expand All @@ -76,7 +76,7 @@ test = [
"pytest>=7.4.1",
"pytest-cov",
"coverage",
"anyio",
"pytest-asyncio",
"pytest-sugar",
"pytest-mock>=3.11.1",
"pytest-xdist>=3.6.1",
Expand Down Expand Up @@ -151,8 +151,14 @@ search = ' "litestar-vite-plugin": "^{current_version}",'

[tool.pytest.ini_options]
addopts = ["-q", "-ra"]
filterwarnings = ["ignore::DeprecationWarning:pkg_resources.*"]
testpaths = ["src/py/tests"]
filterwarnings = [
"ignore::DeprecationWarning:pkg_resources.*",
]
testpaths = ["tests", "src/py/tests"]
tmp_path_retention_policy = "failed"
tmp_path_retention_count = 3
asyncio_default_fixture_loop_scope = "function"
asyncio_mode = "auto"

[tool.coverage.report]
exclude_lines = [
Expand Down
6 changes: 3 additions & 3 deletions src/py/litestar_vite/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@
DEFAULT_RESOURCES: set[str] = {"styles.css.j2", "main.ts.j2"}
DEFAULT_DEV_DEPENDENCIES: dict[str, str] = {
"typescript": "^5.7.2",
"vite": "^6.0.3",
"vite": "^6.0.6",
"litestar-vite-plugin": "^0.12.0",
"@types/node": "^22.10.1",
"@types/node": "^22.10.2",
}
DEFAULT_DEPENDENCIES: dict[str, str] = {"axios": "^1.7.2"}
DEFAULT_DEPENDENCIES: dict[str, str] = {"axios": "^1.7.9"}


def to_json(value: Any) -> str:
Expand Down
21 changes: 12 additions & 9 deletions src/py/litestar_vite/inertia/__init__.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
from .config import InertiaConfig
from .exception_handler import create_inertia_exception_response, exception_to_http_response
from .middleware import InertiaMiddleware
from .plugin import InertiaPlugin
from .request import InertiaDetails, InertiaHeaders, InertiaRequest
from .response import (
from litestar_vite.inertia import helpers
from litestar_vite.inertia.config import InertiaConfig
from litestar_vite.inertia.exception_handler import create_inertia_exception_response, exception_to_http_response
from litestar_vite.inertia.helpers import error, get_shared_props, js_routes_script, lazy, share
from litestar_vite.inertia.middleware import InertiaMiddleware
from litestar_vite.inertia.plugin import InertiaPlugin
from litestar_vite.inertia.request import InertiaDetails, InertiaHeaders, InertiaRequest
from litestar_vite.inertia.response import (
InertiaBack,
InertiaExternalRedirect,
InertiaRedirect,
InertiaResponse,
error,
get_shared_props,
share,
)

from .routes import generate_js_routes

__all__ = (
Expand All @@ -30,5 +30,8 @@
"exception_to_http_response",
"generate_js_routes",
"get_shared_props",
"helpers",
"js_routes_script",
"lazy",
"share",
)
3 changes: 2 additions & 1 deletion src/py/litestar_vite/inertia/exception_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@
HTTP_500_INTERNAL_SERVER_ERROR,
)

from litestar_vite.inertia.response import InertiaBack, InertiaRedirect, InertiaResponse, error
from litestar_vite.inertia.helpers import error
from litestar_vite.inertia.response import InertiaBack, InertiaRedirect, InertiaResponse

if TYPE_CHECKING:
from litestar.connection import Request
Expand Down
Loading
Loading