litestar-vite 0.11.0__tar.gz → 0.11.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.11.0 → litestar_vite-0.11.1}/PKG-INFO +1 -1
- {litestar_vite-0.11.0 → litestar_vite-0.11.1}/pyproject.toml +2 -2
- {litestar_vite-0.11.0 → litestar_vite-0.11.1}/src/py/litestar_vite/commands.py +1 -1
- {litestar_vite-0.11.0 → litestar_vite-0.11.1}/src/py/litestar_vite/plugin.py +20 -25
- {litestar_vite-0.11.0 → litestar_vite-0.11.1}/.gitignore +0 -0
- {litestar_vite-0.11.0 → litestar_vite-0.11.1}/LICENSE +0 -0
- {litestar_vite-0.11.0 → litestar_vite-0.11.1}/README.md +0 -0
- {litestar_vite-0.11.0 → litestar_vite-0.11.1}/src/js/LICENSE +0 -0
- {litestar_vite-0.11.0 → litestar_vite-0.11.1}/src/js/Makefile +0 -0
- {litestar_vite-0.11.0 → litestar_vite-0.11.1}/src/js/NOTICE +0 -0
- {litestar_vite-0.11.0 → litestar_vite-0.11.1}/src/js/README.md +0 -0
- {litestar_vite-0.11.0 → litestar_vite-0.11.1}/src/js/src/dev-server-index.html +0 -0
- {litestar_vite-0.11.0 → litestar_vite-0.11.1}/src/js/src/index.ts +0 -0
- {litestar_vite-0.11.0 → litestar_vite-0.11.1}/src/js/src/inertia-helpers/index.ts +0 -0
- {litestar_vite-0.11.0 → litestar_vite-0.11.1}/src/js/tests/__data__/dummy.ts +0 -0
- {litestar_vite-0.11.0 → litestar_vite-0.11.1}/src/js/tests/index.test.ts +0 -0
- {litestar_vite-0.11.0 → litestar_vite-0.11.1}/src/js/tsconfig.inertia-helpers.json +0 -0
- {litestar_vite-0.11.0 → litestar_vite-0.11.1}/src/js/tsconfig.json +0 -0
- {litestar_vite-0.11.0 → litestar_vite-0.11.1}/src/js/vitest.config.ts +0 -0
- {litestar_vite-0.11.0 → litestar_vite-0.11.1}/src/js/vitest.workspace.ts +0 -0
- {litestar_vite-0.11.0 → litestar_vite-0.11.1}/src/py/litestar_vite/__init__.py +0 -0
- {litestar_vite-0.11.0 → litestar_vite-0.11.1}/src/py/litestar_vite/__metadata__.py +0 -0
- {litestar_vite-0.11.0 → litestar_vite-0.11.1}/src/py/litestar_vite/cli.py +0 -0
- {litestar_vite-0.11.0 → litestar_vite-0.11.1}/src/py/litestar_vite/config.py +0 -0
- {litestar_vite-0.11.0 → litestar_vite-0.11.1}/src/py/litestar_vite/inertia/__init__.py +0 -0
- {litestar_vite-0.11.0 → litestar_vite-0.11.1}/src/py/litestar_vite/inertia/_utils.py +0 -0
- {litestar_vite-0.11.0 → litestar_vite-0.11.1}/src/py/litestar_vite/inertia/config.py +0 -0
- {litestar_vite-0.11.0 → litestar_vite-0.11.1}/src/py/litestar_vite/inertia/exception_handler.py +0 -0
- {litestar_vite-0.11.0 → litestar_vite-0.11.1}/src/py/litestar_vite/inertia/middleware.py +0 -0
- {litestar_vite-0.11.0 → litestar_vite-0.11.1}/src/py/litestar_vite/inertia/plugin.py +0 -0
- {litestar_vite-0.11.0 → litestar_vite-0.11.1}/src/py/litestar_vite/inertia/request.py +0 -0
- {litestar_vite-0.11.0 → litestar_vite-0.11.1}/src/py/litestar_vite/inertia/response.py +0 -0
- {litestar_vite-0.11.0 → litestar_vite-0.11.1}/src/py/litestar_vite/inertia/routes.py +0 -0
- {litestar_vite-0.11.0 → litestar_vite-0.11.1}/src/py/litestar_vite/inertia/types.py +0 -0
- {litestar_vite-0.11.0 → litestar_vite-0.11.1}/src/py/litestar_vite/loader.py +0 -0
- {litestar_vite-0.11.0 → litestar_vite-0.11.1}/src/py/litestar_vite/py.typed +0 -0
- {litestar_vite-0.11.0 → litestar_vite-0.11.1}/src/py/litestar_vite/templates/__init__.py +0 -0
- {litestar_vite-0.11.0 → litestar_vite-0.11.1}/src/py/litestar_vite/templates/index.html.j2 +0 -0
- {litestar_vite-0.11.0 → litestar_vite-0.11.1}/src/py/litestar_vite/templates/main.ts.j2 +0 -0
- {litestar_vite-0.11.0 → litestar_vite-0.11.1}/src/py/litestar_vite/templates/package.json.j2 +0 -0
- {litestar_vite-0.11.0 → litestar_vite-0.11.1}/src/py/litestar_vite/templates/styles.css.j2 +0 -0
- {litestar_vite-0.11.0 → litestar_vite-0.11.1}/src/py/litestar_vite/templates/tsconfig.json.j2 +0 -0
- {litestar_vite-0.11.0 → litestar_vite-0.11.1}/src/py/litestar_vite/templates/vite.config.ts.j2 +0 -0
- {litestar_vite-0.11.0 → litestar_vite-0.11.1}/src/py/tests/__init__.py +0 -0
- {litestar_vite-0.11.0 → litestar_vite-0.11.1}/src/py/tests/conftest.py +0 -0
- {litestar_vite-0.11.0 → litestar_vite-0.11.1}/src/py/tests/templates/__init__.py +0 -0
- {litestar_vite-0.11.0 → litestar_vite-0.11.1}/src/py/tests/templates/index.html.j2 +0 -0
- {litestar_vite-0.11.0 → litestar_vite-0.11.1}/src/py/tests/test_app/__init__.py +0 -0
- {litestar_vite-0.11.0 → litestar_vite-0.11.1}/src/py/tests/test_app/app.py +0 -0
- {litestar_vite-0.11.0 → litestar_vite-0.11.1}/src/py/tests/test_app/web/__init__.py +0 -0
- {litestar_vite-0.11.0 → litestar_vite-0.11.1}/src/py/tests/test_app/web/public/.gitkeep +0 -0
- {litestar_vite-0.11.0 → litestar_vite-0.11.1}/src/py/tests/test_app/web/public/assets/main-l0sNRNKZ.js +0 -0
- {litestar_vite-0.11.0 → litestar_vite-0.11.1}/src/py/tests/test_app/web/public/assets/styles-l0sNRNKZ.js +0 -0
- {litestar_vite-0.11.0 → litestar_vite-0.11.1}/src/py/tests/test_app/web/public/manifest.json +0 -0
- {litestar_vite-0.11.0 → litestar_vite-0.11.1}/src/py/tests/test_app/web/resources/.gitkeep +0 -0
- {litestar_vite-0.11.0 → litestar_vite-0.11.1}/src/py/tests/test_app/web/resources/main.ts +0 -0
- {litestar_vite-0.11.0 → litestar_vite-0.11.1}/src/py/tests/test_app/web/resources/styles.css +0 -0
- {litestar_vite-0.11.0 → litestar_vite-0.11.1}/src/py/tests/test_app/web/templates/.gitkeep +0 -0
- {litestar_vite-0.11.0 → litestar_vite-0.11.1}/src/py/tests/test_app/web/templates/index.html +0 -0
- {litestar_vite-0.11.0 → litestar_vite-0.11.1}/src/py/tests/test_asset_loader.py +0 -0
- {litestar_vite-0.11.0 → litestar_vite-0.11.1}/src/py/tests/test_cli/__init__.py +0 -0
- {litestar_vite-0.11.0 → litestar_vite-0.11.1}/src/py/tests/test_cli/conftest.py +0 -0
- {litestar_vite-0.11.0 → litestar_vite-0.11.1}/src/py/tests/test_cli/test_init.py +0 -0
- {litestar_vite-0.11.0 → litestar_vite-0.11.1}/src/py/tests/test_commands.py +0 -0
- {litestar_vite-0.11.0 → litestar_vite-0.11.1}/src/py/tests/test_config.py +0 -0
- {litestar_vite-0.11.0 → litestar_vite-0.11.1}/src/py/tests/test_inertia/__init__.py +0 -0
- {litestar_vite-0.11.0 → litestar_vite-0.11.1}/src/py/tests/test_inertia/conftest.py +0 -0
- {litestar_vite-0.11.0 → litestar_vite-0.11.1}/src/py/tests/test_inertia/templates/index.html.j2 +0 -0
- {litestar_vite-0.11.0 → litestar_vite-0.11.1}/src/py/tests/test_inertia/test_inertia_request.py +0 -0
- {litestar_vite-0.11.0 → litestar_vite-0.11.1}/src/py/tests/test_inertia/test_inertia_response.py +0 -0
- {litestar_vite-0.11.0 → litestar_vite-0.11.1}/src/py/tests/test_inertia/test_routes.py +0 -0
|
@@ -25,7 +25,7 @@ license = { text = "MIT" }
|
|
|
25
25
|
name = "litestar-vite"
|
|
26
26
|
readme = "README.md"
|
|
27
27
|
requires-python = ">=3.8"
|
|
28
|
-
version = "0.11.
|
|
28
|
+
version = "0.11.1"
|
|
29
29
|
|
|
30
30
|
[project.urls]
|
|
31
31
|
Changelog = "https://cofin.github.io/litestar-vite/latest/changelog"
|
|
@@ -85,7 +85,7 @@ test = [
|
|
|
85
85
|
allow_dirty = true
|
|
86
86
|
commit = true
|
|
87
87
|
commit_args = "--no-verify"
|
|
88
|
-
current_version = "0.11.
|
|
88
|
+
current_version = "0.11.1"
|
|
89
89
|
ignore_missing_files = false
|
|
90
90
|
ignore_missing_version = false
|
|
91
91
|
message = "chore(release): bump to v{new_version}"
|
|
@@ -14,7 +14,7 @@ DEFAULT_RESOURCES: set[str] = {"styles.css.j2", "main.ts.j2"}
|
|
|
14
14
|
DEFAULT_DEV_DEPENDENCIES: dict[str, str] = {
|
|
15
15
|
"typescript": "^5.7.2",
|
|
16
16
|
"vite": "^6.0.3",
|
|
17
|
-
"litestar-vite-plugin": "^0.11.
|
|
17
|
+
"litestar-vite-plugin": "^0.11.1",
|
|
18
18
|
"@types/node": "^22.10.1",
|
|
19
19
|
}
|
|
20
20
|
DEFAULT_DEPENDENCIES: dict[str, str] = {"axios": "^1.7.2"}
|
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
2
|
|
|
3
3
|
import os
|
|
4
|
+
import platform
|
|
4
5
|
import signal
|
|
6
|
+
import subprocess
|
|
5
7
|
import threading
|
|
6
8
|
from contextlib import contextmanager
|
|
7
9
|
from pathlib import Path
|
|
8
10
|
from typing import TYPE_CHECKING, Iterator, cast
|
|
9
11
|
|
|
12
|
+
from litestar.cli._utils import console
|
|
10
13
|
from litestar.contrib.jinja import JinjaTemplateEngine
|
|
11
14
|
from litestar.exceptions import ImproperlyConfiguredException
|
|
12
15
|
from litestar.plugins import CLIPlugin, InitPluginProtocol
|
|
@@ -37,50 +40,43 @@ class ViteProcess:
|
|
|
37
40
|
"""Manages the Vite process."""
|
|
38
41
|
|
|
39
42
|
def __init__(self) -> None:
|
|
40
|
-
self.process:
|
|
43
|
+
self.process: subprocess.Popen | None = None # pyright: ignore[reportUnknownMemberType,reportMissingTypeArgument]
|
|
41
44
|
self._lock = threading.Lock()
|
|
42
45
|
|
|
43
46
|
def start(self, command: list[str], cwd: Path | str | None) -> None:
|
|
44
47
|
"""Start the Vite process."""
|
|
45
|
-
from litestar.cli._utils import console
|
|
46
|
-
|
|
47
|
-
from litestar_vite.commands import execute_command
|
|
48
48
|
|
|
49
49
|
try:
|
|
50
50
|
with self._lock:
|
|
51
|
-
if self.process and self.process.
|
|
51
|
+
if self.process and self.process.poll() is None: # pyright: ignore[reportUnknownMemberType]
|
|
52
52
|
return
|
|
53
53
|
|
|
54
|
-
self.process = threading.Thread(
|
|
55
|
-
name="vite",
|
|
56
|
-
target=execute_command,
|
|
57
|
-
args=[],
|
|
58
|
-
kwargs={"command_to_run": command, "cwd": cwd},
|
|
59
|
-
daemon=True, # Make thread daemon so it exits when main thread exits
|
|
60
|
-
)
|
|
61
54
|
console.print(f"Starting Vite process with command: {command}")
|
|
62
|
-
self.process.
|
|
55
|
+
self.process = subprocess.Popen(
|
|
56
|
+
command,
|
|
57
|
+
cwd=cwd,
|
|
58
|
+
shell=platform.system() == "Windows",
|
|
59
|
+
)
|
|
63
60
|
except Exception as e:
|
|
64
61
|
console.print(f"[red]Failed to start Vite process: {e!s}[/]")
|
|
65
62
|
raise
|
|
66
63
|
|
|
67
64
|
def stop(self, timeout: float = 5.0) -> None:
|
|
68
65
|
"""Stop the Vite process."""
|
|
69
|
-
from litestar.cli._utils import console
|
|
70
66
|
|
|
71
67
|
try:
|
|
72
68
|
with self._lock:
|
|
73
|
-
if self.process and self.process.
|
|
69
|
+
if self.process and self.process.poll() is None: # pyright: ignore[reportUnknownMemberType]
|
|
74
70
|
# Send SIGTERM to child process
|
|
75
|
-
if hasattr(signal, "SIGTERM")
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
if hasattr(signal, "SIGKILL")
|
|
82
|
-
|
|
83
|
-
self.process.
|
|
71
|
+
if hasattr(signal, "SIGTERM"):
|
|
72
|
+
self.process.terminate() # pyright: ignore[reportUnknownMemberType]
|
|
73
|
+
try:
|
|
74
|
+
self.process.wait(timeout=timeout) # pyright: ignore[reportUnknownMemberType]
|
|
75
|
+
except subprocess.TimeoutExpired:
|
|
76
|
+
# Force kill if still alive
|
|
77
|
+
if hasattr(signal, "SIGKILL"):
|
|
78
|
+
self.process.kill() # pyright: ignore[reportUnknownMemberType]
|
|
79
|
+
self.process.wait(timeout=1.0) # pyright: ignore[reportUnknownMemberType]
|
|
84
80
|
console.print("Stopping Vite process")
|
|
85
81
|
except Exception as e:
|
|
86
82
|
console.print(f"[red]Failed to stop Vite process: {e!s}[/]")
|
|
@@ -168,7 +164,6 @@ class VitePlugin(InitPluginProtocol, CLIPlugin):
|
|
|
168
164
|
@contextmanager
|
|
169
165
|
def server_lifespan(self, app: Litestar) -> Iterator[None]:
|
|
170
166
|
"""Manage Vite server process lifecycle."""
|
|
171
|
-
from litestar.cli._utils import console
|
|
172
167
|
|
|
173
168
|
if self._config.use_server_lifespan and self._config.dev_mode:
|
|
174
169
|
command_to_run = self._config.run_command if self._config.hot_reload else self._config.build_watch_command
|
|
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.11.0 → litestar_vite-0.11.1}/src/py/litestar_vite/inertia/exception_handler.py
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
|
{litestar_vite-0.11.0 → litestar_vite-0.11.1}/src/py/litestar_vite/templates/package.json.j2
RENAMED
|
File without changes
|
|
File without changes
|
{litestar_vite-0.11.0 → litestar_vite-0.11.1}/src/py/litestar_vite/templates/tsconfig.json.j2
RENAMED
|
File without changes
|
{litestar_vite-0.11.0 → litestar_vite-0.11.1}/src/py/litestar_vite/templates/vite.config.ts.j2
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
|
{litestar_vite-0.11.0 → litestar_vite-0.11.1}/src/py/tests/test_app/web/public/manifest.json
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{litestar_vite-0.11.0 → litestar_vite-0.11.1}/src/py/tests/test_app/web/resources/styles.css
RENAMED
|
File without changes
|
|
File without changes
|
{litestar_vite-0.11.0 → litestar_vite-0.11.1}/src/py/tests/test_app/web/templates/index.html
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
|
{litestar_vite-0.11.0 → litestar_vite-0.11.1}/src/py/tests/test_inertia/templates/index.html.j2
RENAMED
|
File without changes
|
{litestar_vite-0.11.0 → litestar_vite-0.11.1}/src/py/tests/test_inertia/test_inertia_request.py
RENAMED
|
File without changes
|
{litestar_vite-0.11.0 → litestar_vite-0.11.1}/src/py/tests/test_inertia/test_inertia_response.py
RENAMED
|
File without changes
|
|
File without changes
|