vega-framework 0.1.31__py3-none-any.whl → 0.1.34__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.
- vega/cli/commands/generate.py +3 -3
- vega/cli/scaffolds/fastapi.py +0 -23
- vega/cli/templates/project/main.py.j2 +8 -0
- vega/cli/templates/project/main_fastapi.py.j2 +8 -0
- vega/cli/templates/project/main_standard.py.j2 +8 -0
- vega/cli/templates/web/main.py.j2 +9 -0
- {vega_framework-0.1.31.dist-info → vega_framework-0.1.34.dist-info}/METADATA +1 -1
- {vega_framework-0.1.31.dist-info → vega_framework-0.1.34.dist-info}/RECORD +11 -11
- {vega_framework-0.1.31.dist-info → vega_framework-0.1.34.dist-info}/WHEEL +0 -0
- {vega_framework-0.1.31.dist-info → vega_framework-0.1.34.dist-info}/entry_points.txt +0 -0
- {vega_framework-0.1.31.dist-info → vega_framework-0.1.34.dist-info}/licenses/LICENSE +0 -0
vega/cli/commands/generate.py
CHANGED
@@ -933,9 +933,9 @@ def _generate_event(project_root: Path, project_name: str, class_name: str, file
|
|
933
933
|
|
934
934
|
|
935
935
|
def _generate_event_handler(project_root: Path, project_name: str, class_name: str, file_name: str):
|
936
|
-
"""Generate an application-level event handler/subscriber."""
|
936
|
+
"""Generate an application-level event handler/subscriber in events/ for auto-discovery."""
|
937
937
|
|
938
|
-
handlers_path = project_root / "
|
938
|
+
handlers_path = project_root / "events"
|
939
939
|
handlers_path.mkdir(parents=True, exist_ok=True)
|
940
940
|
|
941
941
|
init_file = handlers_path / "__init__.py"
|
@@ -987,5 +987,5 @@ def _generate_event_handler(project_root: Path, project_name: str, class_name: s
|
|
987
987
|
|
988
988
|
click.echo("\nNext steps:")
|
989
989
|
click.echo(f" 1. Implement your handler in {handler_file.relative_to(project_root)}")
|
990
|
-
click.echo(" 2.
|
990
|
+
click.echo(" 2. Call events.register_all_handlers() during startup so auto-discovery loads it.")
|
991
991
|
click.echo(" 3. Run your workflow and verify the subscriber reacts to the event.")
|
vega/cli/scaffolds/fastapi.py
CHANGED
@@ -64,35 +64,12 @@ def create_fastapi_scaffold(
|
|
64
64
|
created.append(rel_path)
|
65
65
|
echo(f"+ Created {click.style(str(rel_path), fg='green')}")
|
66
66
|
|
67
|
-
if _ensure_fastapi_dependencies(project_root):
|
68
|
-
echo(f"+ Updated {click.style('pyproject.toml', fg='green')} with FastAPI dependencies")
|
69
|
-
|
70
67
|
echo("\n[TIP] FastAPI scaffold ready:")
|
71
68
|
echo(" 1. poetry install # sync dependencies (or poetry update)")
|
72
69
|
echo(" 2. poetry run uvicorn presentation.web.main:app --reload")
|
73
70
|
|
74
71
|
return created
|
75
72
|
|
76
|
-
|
77
|
-
def _ensure_fastapi_dependencies(project_root: Path) -> bool:
|
78
|
-
"""Ensure FastAPI dependencies exist in pyproject.toml; return True if modified."""
|
79
|
-
pyproject_path = project_root / "pyproject.toml"
|
80
|
-
if not pyproject_path.exists():
|
81
|
-
return False
|
82
|
-
|
83
|
-
content = pyproject_path.read_text(encoding="utf-8")
|
84
|
-
lines = content.splitlines(keepends=True)
|
85
|
-
|
86
|
-
changed = False
|
87
|
-
changed |= _ensure_dependency_line(lines, "fastapi", "^0.111")
|
88
|
-
changed |= _ensure_dependency_line(lines, "uvicorn", "^0.30")
|
89
|
-
|
90
|
-
if changed:
|
91
|
-
pyproject_path.write_text("".join(lines), encoding="utf-8")
|
92
|
-
|
93
|
-
return changed
|
94
|
-
|
95
|
-
|
96
73
|
def _ensure_dependency_line(lines: list[str], name: str, spec: str) -> bool:
|
97
74
|
"""Insert dependency assignment into [tool.poetry.dependencies] if missing."""
|
98
75
|
header = "[tool.poetry.dependencies]"
|
@@ -2,6 +2,14 @@
|
|
2
2
|
import click
|
3
3
|
import config # noqa: F401 - Import to initialize DI container
|
4
4
|
|
5
|
+
# Auto-discover event subscribers so @subscribe handlers are ready
|
6
|
+
try:
|
7
|
+
from events import register_all_handlers
|
8
|
+
except ImportError:
|
9
|
+
pass
|
10
|
+
else:
|
11
|
+
register_all_handlers()
|
12
|
+
|
5
13
|
# Import your use cases here
|
6
14
|
# from domain.interactors.create_user import CreateUser
|
7
15
|
|
@@ -3,6 +3,14 @@ import click
|
|
3
3
|
from vega.cli.utils import async_command
|
4
4
|
import config # noqa: F401 - Import to initialize DI container
|
5
5
|
|
6
|
+
# Auto-discover event subscribers so @subscribe handlers are ready
|
7
|
+
try:
|
8
|
+
from events import register_all_handlers
|
9
|
+
except ImportError:
|
10
|
+
pass
|
11
|
+
else:
|
12
|
+
register_all_handlers()
|
13
|
+
|
6
14
|
# Import your use cases here
|
7
15
|
# from domain.interactors.create_user import CreateUser
|
8
16
|
|
@@ -3,6 +3,14 @@ import click
|
|
3
3
|
from vega.cli.utils import async_command
|
4
4
|
import config # noqa: F401 - Import to initialize DI container
|
5
5
|
|
6
|
+
# Auto-discover event subscribers so @subscribe handlers are ready
|
7
|
+
try:
|
8
|
+
from events import register_all_handlers
|
9
|
+
except ImportError:
|
10
|
+
pass
|
11
|
+
else:
|
12
|
+
register_all_handlers()
|
13
|
+
|
6
14
|
# Import your use cases here
|
7
15
|
# from domain.interactors.create_user import CreateUser
|
8
16
|
|
@@ -1,5 +1,14 @@
|
|
1
1
|
"""FastAPI ASGI entrypoint for {{ project_name }}"""
|
2
2
|
from fastapi import FastAPI
|
3
|
+
import config # noqa: F401 - Import to initialize DI container
|
4
|
+
|
5
|
+
# Auto-discover event subscribers so @subscribe handlers are ready
|
6
|
+
try:
|
7
|
+
from events import register_all_handlers
|
8
|
+
except ImportError:
|
9
|
+
pass
|
10
|
+
else:
|
11
|
+
register_all_handlers()
|
3
12
|
|
4
13
|
from .app import create_app
|
5
14
|
|
@@ -2,14 +2,14 @@ vega/__init__.py,sha256=A05RwOYXooAZUz3GnbJ--ofLXgtRZK9gaSmsLVRdGPY,1811
|
|
2
2
|
vega/cli/__init__.py,sha256=NCzOOyhKHqLeN1r80ekhMfkQwBdAQXKcKiKoNwYPNiY,304
|
3
3
|
vega/cli/commands/__init__.py,sha256=UH7MdYduBG_YoulgdiWkUCtcgGLzuYRGFzxaqoa0pyg,19
|
4
4
|
vega/cli/commands/add.py,sha256=5Li588W1KWQqCKV0VZSURx4J3I8dQE297c4V_3anf5U,6465
|
5
|
-
vega/cli/commands/generate.py,sha256=
|
5
|
+
vega/cli/commands/generate.py,sha256=wCvcj1bSIK9MJam8FcT9G2vrQTYv92JFRzPYOipJywA,38172
|
6
6
|
vega/cli/commands/init.py,sha256=Ro35QfCKeo-Nm_rJkRT-DaX0nH7_bGc_ewX5Q1eqpP8,5860
|
7
7
|
vega/cli/commands/migrate.py,sha256=00swKeVhmKr1_1VJhg3GpIMcJ6Jfgz5FUpmJoLf5qSQ,3805
|
8
8
|
vega/cli/commands/update.py,sha256=0zRWkHvQwKGlJL9XF3bi--dThkFapyNOugL6AgGr6Ic,5897
|
9
9
|
vega/cli/commands/web.py,sha256=tkaMzrENiV044JdPtCSRmzX_vVpnumlDeTG6YH3DWo4,3450
|
10
10
|
vega/cli/main.py,sha256=0hSar-MFpu3tp2QDOite4LGVpAhCTojuRZhPDiilEFQ,5476
|
11
11
|
vega/cli/scaffolds/__init__.py,sha256=WFJf2H_4UWL89gDxX8PXKkTVSVOfw7hFfyaPWKokp1g,217
|
12
|
-
vega/cli/scaffolds/fastapi.py,sha256=
|
12
|
+
vega/cli/scaffolds/fastapi.py,sha256=9VqZD5TIT7iX6za_5h0L1aWqJ0V58pV8CyEiIxw7_w0,3013
|
13
13
|
vega/cli/scaffolds/sqlalchemy.py,sha256=il5JqiA8LSQKnNoOYfAFD82rdYx5l_ZsqsjHnplYohw,6164
|
14
14
|
vega/cli/templates/__init__.py,sha256=1Udc3hlhj3pJYQGk4NVpg0u9us040YarL_adlomJTf4,2018
|
15
15
|
vega/cli/templates/cli/command.py.j2,sha256=Z8K9DRfppsco9uID_uG8EKVyWYD_1x-KYqLZY4BJKzM,1097
|
@@ -33,9 +33,9 @@ vega/cli/templates/project/ARCHITECTURE.md.j2,sha256=HunrJ_9LlPxd5-GONaJxjoLlw-X
|
|
33
33
|
vega/cli/templates/project/README.md.j2,sha256=tZtMKhyKjfCq5JTECHihISu0VjYd254t-7y2kJ0nbKY,4589
|
34
34
|
vega/cli/templates/project/config.py.j2,sha256=1Iva9JEz5ej_WmTbRVBvOfSBhYUKIzN88p6GYKR0m4s,866
|
35
35
|
vega/cli/templates/project/events_init.py.j2,sha256=dp9yc8_Du6lv62vum_Br0p030I4TKZAkZG29mj4AZaM,1057
|
36
|
-
vega/cli/templates/project/main.py.j2,sha256=
|
37
|
-
vega/cli/templates/project/main_fastapi.py.j2,sha256=
|
38
|
-
vega/cli/templates/project/main_standard.py.j2,sha256=
|
36
|
+
vega/cli/templates/project/main.py.j2,sha256=33mohAsEP4f-aGPyWcGdKTP8OxDZDI3JVQKhWCeGe_U,753
|
37
|
+
vega/cli/templates/project/main_fastapi.py.j2,sha256=rzlVrHD5BxfSWyKdBsEwOLGRvs1xy-NZo3G6YIDuRZo,794
|
38
|
+
vega/cli/templates/project/main_standard.py.j2,sha256=0fMg-V5zYmeOre8-W548ZYjqRHSsA2CblRKRhdG5C5s,798
|
39
39
|
vega/cli/templates/project/pyproject.toml.j2,sha256=-TZj9rAXzO99lrKOUVZeeFwom_5Kg4ktdN_BIExOx_8,522
|
40
40
|
vega/cli/templates/project/settings.py.j2,sha256=uHt3qVbzoYZNb1ViD2Bu4SZYYw0jCUx6_m_kauILCCs,522
|
41
41
|
vega/cli/templates/sqlalchemy/alembic.ini.j2,sha256=7pcqcXWXU_0lHaokuHlkUNoN20oOw1Dd6HizMG1Cmmk,3472
|
@@ -45,7 +45,7 @@ vega/cli/templates/sqlalchemy/script.py.mako,sha256=MEqL-2qATlST9TAOeYgscMn1uy6H
|
|
45
45
|
vega/cli/templates/web/__init__.py.j2,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
46
46
|
vega/cli/templates/web/app.py.j2,sha256=mu9EjazXWTbKusaUJMA1SrIJzz4hfxeZQvTLfYyCS4E,416
|
47
47
|
vega/cli/templates/web/health_route.py.j2,sha256=iq30wENqti14j3JOfVqJNO4WAE2NiNYzVq3R6ScVKVg,253
|
48
|
-
vega/cli/templates/web/main.py.j2,sha256=
|
48
|
+
vega/cli/templates/web/main.py.j2,sha256=9zJzBMOLZl4J3WqLULARosyILhdHiXYMMdxeNAHlX3w,557
|
49
49
|
vega/cli/templates/web/middleware.py.j2,sha256=ild8nAdq45HGCiA-XVcWgmMBCfwIgORcZ7qsykmOclw,2165
|
50
50
|
vega/cli/templates/web/models_init.py.j2,sha256=QdNOaZ6iMh3Tz7uut1VA3XUIivYD1SkHFmDHCfstqho,159
|
51
51
|
vega/cli/templates/web/request_model.py.j2,sha256=PPoLGMd7VZ6QXj75UxCcryZZ9SNPhaDfMH2ykVtjIXQ,534
|
@@ -83,8 +83,8 @@ vega/patterns/repository.py,sha256=uYUyLs-O8OqW1Wb9ZqIo8UUcCjZ5UFuHors_F2iDg9A,1
|
|
83
83
|
vega/patterns/service.py,sha256=buFRgJoeQtZQK22Upb4vh84c1elWKFXWBaB0X4RaruE,1374
|
84
84
|
vega/settings/__init__.py,sha256=Eb8PMUyXAlCAQIcL2W8QhTTUHUbVlkAfXdpTUlADo1I,786
|
85
85
|
vega/settings/base.py,sha256=bL45hyoa3t-hQOvur860eSo7O833sQMsXJJPwbTVbwE,1321
|
86
|
-
vega_framework-0.1.
|
87
|
-
vega_framework-0.1.
|
88
|
-
vega_framework-0.1.
|
89
|
-
vega_framework-0.1.
|
90
|
-
vega_framework-0.1.
|
86
|
+
vega_framework-0.1.34.dist-info/METADATA,sha256=qW5INwXRHJ0iD84K9niYoDeggeqA_meB2evoLxyFx9w,11105
|
87
|
+
vega_framework-0.1.34.dist-info/WHEEL,sha256=zp0Cn7JsFoX2ATtOhtaFYIiE2rmFAD4OcMhtUki8W3U,88
|
88
|
+
vega_framework-0.1.34.dist-info/entry_points.txt,sha256=p3gyTmPYjNRLbuiKS-hG3ytWd-ssBweFy6VZ-F9FTNk,42
|
89
|
+
vega_framework-0.1.34.dist-info/licenses/LICENSE,sha256=wlHh1MBTcs2kSQr99P30mZ61s7uh7Cp9Rk0YiJxots0,1084
|
90
|
+
vega_framework-0.1.34.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|