litestar-vite 0.1.4__py3-none-any.whl → 0.1.5__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.

Potentially problematic release.


This version of litestar-vite might be problematic. Click here for more details.

litestar_vite/cli.py CHANGED
@@ -9,9 +9,7 @@ from click import Path as ClickPath
9
9
  from litestar.cli._utils import (
10
10
  LitestarEnv,
11
11
  LitestarGroup,
12
- console,
13
12
  )
14
- from rich.prompt import Confirm
15
13
 
16
14
  if TYPE_CHECKING:
17
15
  from litestar import Litestar
@@ -88,6 +86,11 @@ def vite_init(
88
86
  no_prompt: bool,
89
87
  ) -> None: # sourcery skip: low-code-quality
90
88
  """Run vite build."""
89
+ from litestar.cli._utils import (
90
+ console,
91
+ )
92
+ from rich.prompt import Confirm
93
+
91
94
  from litestar_vite.commands import init_vite
92
95
  from litestar_vite.plugin import VitePlugin
93
96
 
@@ -149,6 +152,10 @@ def vite_init(
149
152
  @option("--verbose", type=bool, help="Enable verbose output.", default=False, is_flag=True)
150
153
  def vite_install(app: Litestar, verbose: bool) -> None: # noqa: ARG001
151
154
  """Run vite build."""
155
+ from litestar.cli._utils import (
156
+ console,
157
+ )
158
+
152
159
  from litestar_vite.commands import run_vite
153
160
  from litestar_vite.plugin import VitePlugin
154
161
 
@@ -164,6 +171,10 @@ def vite_install(app: Litestar, verbose: bool) -> None: # noqa: ARG001
164
171
  @option("--verbose", type=bool, help="Enable verbose output.", default=False, is_flag=True)
165
172
  def vite_build(app: Litestar, verbose: bool) -> None: # noqa: ARG001
166
173
  """Run vite build."""
174
+ from litestar.cli._utils import (
175
+ console,
176
+ )
177
+
167
178
  from litestar_vite.commands import run_vite
168
179
  from litestar_vite.plugin import VitePlugin
169
180
 
@@ -179,6 +190,10 @@ def vite_build(app: Litestar, verbose: bool) -> None: # noqa: ARG001
179
190
  @option("--verbose", type=bool, help="Enable verbose output.", default=False, is_flag=True)
180
191
  def vite_serve(app: Litestar, verbose: bool) -> None: # noqa: ARG001
181
192
  """Run vite serve."""
193
+ from litestar.cli._utils import (
194
+ console,
195
+ )
196
+
182
197
  from litestar_vite.commands import run_vite
183
198
  from litestar_vite.plugin import VitePlugin
184
199
 
litestar_vite/plugin.py CHANGED
@@ -1,16 +1,10 @@
1
1
  from __future__ import annotations
2
2
 
3
- import multiprocessing
4
3
  from contextlib import contextmanager
5
4
  from typing import TYPE_CHECKING, Iterator
6
5
 
7
6
  from litestar.plugins import CLIPlugin, InitPluginProtocol
8
7
 
9
- from litestar_vite.cli import vite_group
10
- from litestar_vite.commands import run_vite
11
- from litestar_vite.config import ViteTemplateConfig
12
- from litestar_vite.template_engine import ViteTemplateEngine
13
-
14
8
  if TYPE_CHECKING:
15
9
  from click import Group
16
10
  from litestar import Litestar
@@ -33,6 +27,8 @@ class VitePlugin(InitPluginProtocol, CLIPlugin):
33
27
  self._config = config
34
28
 
35
29
  def on_cli_init(self, cli: Group) -> None:
30
+ from litestar_vite.cli import vite_group
31
+
36
32
  cli.add_command(vite_group)
37
33
  return super().on_cli_init(cli)
38
34
 
@@ -42,6 +38,10 @@ class VitePlugin(InitPluginProtocol, CLIPlugin):
42
38
  Args:
43
39
  app_config: The :class:`AppConfig <.config.app.AppConfig>` instance.
44
40
  """
41
+
42
+ from litestar_vite.config import ViteTemplateConfig
43
+ from litestar_vite.template_engine import ViteTemplateEngine
44
+
45
45
  app_config.template_config = ViteTemplateConfig( # type: ignore[assignment]
46
46
  engine=ViteTemplateEngine,
47
47
  config=self._config,
@@ -51,6 +51,10 @@ class VitePlugin(InitPluginProtocol, CLIPlugin):
51
51
 
52
52
  @contextmanager
53
53
  def server_lifespan(self, app: Litestar) -> Iterator[None]:
54
+ import multiprocessing
55
+
56
+ from litestar_vite.commands import run_vite
57
+
54
58
  if self._config.use_server_lifespan:
55
59
  command_to_run = self._config.run_command
56
60
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: litestar-vite
3
- Version: 0.1.4
3
+ Version: 0.1.5
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
@@ -1,10 +1,10 @@
1
1
  litestar_vite/__init__.py,sha256=9X3i67Q8DJN2lQYAMa9NSPTZGzHASGn8X8yeWJqBvWg,357
2
2
  litestar_vite/__metadata__.py,sha256=Eml1c9xezV-GSodmysksrT8jPWqE__x0ENO1wM5g6q0,319
3
- litestar_vite/cli.py,sha256=1gfzACx48SEKCxMA4Jj-D_r9LExso3oP9HS356sK5nY,6179
3
+ litestar_vite/cli.py,sha256=gmrh2krPf1_N9idw5x8bwFSNjecDB4nGd9VzFlRoy8g,6418
4
4
  litestar_vite/commands.py,sha256=wkvp5BgE3zPVPO8PedumC9awPk7Vu9Qaz3ExOW4eIPo,3723
5
5
  litestar_vite/config.py,sha256=b9J0jakMHiCxNRczp0bfL9Rt7WGx_ngGZa3s7thrF48,4656
6
6
  litestar_vite/loader.py,sha256=oft1CTyZWbzSNfFv07Ihvyio42Q-QA-JH3NBie4SckM,7149
7
- litestar_vite/plugin.py,sha256=yyFZKJzb5BvVV16cK-btG6g_pGEYF_3is4AGEqoArQA,2007
7
+ litestar_vite/plugin.py,sha256=41UvPw-BXcWiLLPRvbG1dDyHic6ZumeGmATgTSjOU80,2051
8
8
  litestar_vite/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
9
9
  litestar_vite/template_engine.py,sha256=s7fV4Hhi8Sd95ywylims24UpyTBFXmthEcMp4TLaRYg,2962
10
10
  litestar_vite/templates/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -22,7 +22,7 @@ litestar_vite/templates/init/tailwindcss/tailwind.config.js.j2,sha256=DyP-ShjY06
22
22
  litestar_vite/templates/init/vanilla/main.css.j2,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
23
23
  litestar_vite/templates/init/vue/App.vue.j2,sha256=r73CGdnzcg8KTNw1XEgg78nrw7IFyBAADJcAGkMfTT4,63
24
24
  litestar_vite/templates/init/vue/main.ts.j2,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
25
- litestar_vite-0.1.4.dist-info/METADATA,sha256=Zm0VuTh4V1J1dz5nakqe97A5_0heGejKL5CyaJhgrtk,2248
26
- litestar_vite-0.1.4.dist-info/WHEEL,sha256=9QBuHhg6FNW7lppboF2vKVbCGTVzsFykgRQjjlajrhA,87
27
- litestar_vite-0.1.4.dist-info/licenses/LICENSE,sha256=HeTiEfEgvroUXZe_xAmYHxtTBgw--mbXyZLsWDYabHc,1069
28
- litestar_vite-0.1.4.dist-info/RECORD,,
25
+ litestar_vite-0.1.5.dist-info/METADATA,sha256=NvLyP3itCXgOCsbX-UC3X66MIJ1S-VPEX2isa_t3-IA,2248
26
+ litestar_vite-0.1.5.dist-info/WHEEL,sha256=9QBuHhg6FNW7lppboF2vKVbCGTVzsFykgRQjjlajrhA,87
27
+ litestar_vite-0.1.5.dist-info/licenses/LICENSE,sha256=HeTiEfEgvroUXZe_xAmYHxtTBgw--mbXyZLsWDYabHc,1069
28
+ litestar_vite-0.1.5.dist-info/RECORD,,