vega-framework 0.1.26__py3-none-any.whl → 0.1.28__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/add.py +1 -4
- vega/cli/commands/generate.py +1 -29
- vega/cli/templates/domain/repository_interface.py.j2 +1 -1
- vega/cli/templates/project/pyproject.toml.j2 +0 -4
- vega/cli/utils/__init__.py +5 -1
- vega/cli/utils/naming.py +20 -0
- {vega_framework-0.1.26.dist-info → vega_framework-0.1.28.dist-info}/METADATA +1 -1
- {vega_framework-0.1.26.dist-info → vega_framework-0.1.28.dist-info}/RECORD +11 -11
- {vega_framework-0.1.26.dist-info → vega_framework-0.1.28.dist-info}/WHEEL +0 -0
- {vega_framework-0.1.26.dist-info → vega_framework-0.1.28.dist-info}/entry_points.txt +0 -0
- {vega_framework-0.1.26.dist-info → vega_framework-0.1.28.dist-info}/licenses/LICENSE +0 -0
vega/cli/commands/add.py
CHANGED
@@ -114,9 +114,6 @@ def add_sqlalchemy_feature(project_path: Path, project_name: str):
|
|
114
114
|
def _create_user_example_repository(project_path: Path, project_name: str):
|
115
115
|
"""Create example User entity, repository, and SQLAlchemy implementation"""
|
116
116
|
from vega.cli.commands.generate import _generate_entity, _generate_repository, _generate_sqlalchemy_model, _generate_infrastructure_repository
|
117
|
-
from vega.cli.utils import to_pascal_case, to_snake_case
|
118
|
-
|
119
|
-
# Suppress verbose output temporarily by redirecting
|
120
117
|
import sys
|
121
118
|
from io import StringIO
|
122
119
|
|
@@ -153,7 +150,7 @@ def _create_user_example_repository(project_path: Path, project_name: str):
|
|
153
150
|
'sql'
|
154
151
|
)
|
155
152
|
|
156
|
-
click.echo(click.style("\n
|
153
|
+
click.echo(click.style("\n [OK] Example User repository created!", fg='green'))
|
157
154
|
click.echo("\nGenerated files:")
|
158
155
|
click.echo(" - domain/entities/user.py")
|
159
156
|
click.echo(" - domain/repositories/user_repository.py")
|
vega/cli/commands/generate.py
CHANGED
@@ -1,6 +1,5 @@
|
|
1
1
|
"""Generate command - Create components in Vega project"""
|
2
2
|
import click
|
3
|
-
import re
|
4
3
|
from pathlib import Path
|
5
4
|
|
6
5
|
from vega.cli.templates import (
|
@@ -19,34 +18,7 @@ from vega.cli.templates import (
|
|
19
18
|
render_template,
|
20
19
|
)
|
21
20
|
from vega.cli.scaffolds import create_fastapi_scaffold
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
def to_snake_case(name: str) -> str:
|
26
|
-
"""Convert CamelCase to snake_case"""
|
27
|
-
name = re.sub('(.)([A-Z][a-z]+)', r'\1_\2', name)
|
28
|
-
return re.sub('([a-z0-9])([A-Z])', r'\1_\2', name).lower()
|
29
|
-
|
30
|
-
|
31
|
-
def to_pascal_case(name: str) -> str:
|
32
|
-
"""Convert strings to PascalCase, handling separators and camelCase input"""
|
33
|
-
cleaned = name.strip()
|
34
|
-
if not cleaned:
|
35
|
-
return ""
|
36
|
-
|
37
|
-
# Normalize common separators to spaces
|
38
|
-
normalized = cleaned.replace('-', ' ').replace('_', ' ')
|
39
|
-
if ' ' in normalized:
|
40
|
-
parts = normalized.split()
|
41
|
-
else:
|
42
|
-
parts = re.findall(r'[A-Z]+(?=$|[A-Z][a-z0-9])|[A-Z]?[a-z0-9]+|[0-9]+', cleaned)
|
43
|
-
if not parts:
|
44
|
-
parts = [cleaned]
|
45
|
-
|
46
|
-
def _pascal_piece(piece: str) -> str:
|
47
|
-
return piece if piece.isupper() else piece[:1].upper() + piece[1:].lower()
|
48
|
-
|
49
|
-
return ''.join(_pascal_piece(part) for part in parts if part)
|
21
|
+
from vega.cli.utils import to_snake_case, to_pascal_case
|
50
22
|
|
51
23
|
|
52
24
|
def _resolve_implementation_names(class_name: str, implementation: str) -> tuple[str, str]:
|
@@ -3,7 +3,7 @@ from abc import abstractmethod
|
|
3
3
|
from typing import List, Optional
|
4
4
|
|
5
5
|
from vega.patterns import Repository
|
6
|
-
from
|
6
|
+
from entities.{{ entity_file }} import {{ entity_name }}
|
7
7
|
|
8
8
|
|
9
9
|
class {{ class_name }}(Repository[{{ entity_name }}]):
|
@@ -12,11 +12,7 @@ vega-framework = "^{{ vega_version }}"
|
|
12
12
|
pydantic = "^2.0"
|
13
13
|
pydantic-settings = "^2.0"
|
14
14
|
click = "^8.1.0"
|
15
|
-
{% if template == "fastapi" -%}
|
16
|
-
fastapi = "^0.115.0"
|
17
|
-
uvicorn = {extras = ["standard"], version = "^0.32.0"}
|
18
15
|
email-validator = "^2.0"
|
19
|
-
{% endif -%}
|
20
16
|
|
21
17
|
[tool.poetry.group.dev.dependencies]
|
22
18
|
pytest = "^7.0"
|
vega/cli/utils/__init__.py
CHANGED
@@ -1,11 +1,15 @@
|
|
1
1
|
"""Utility modules for Vega CLI"""
|
2
|
-
from .naming import NamingConverter
|
2
|
+
from .naming import NamingConverter, to_snake_case, to_pascal_case, to_camel_case, to_kebab_case
|
3
3
|
from .messages import CLIMessages
|
4
4
|
from .validators import validate_project_name, validate_path_exists
|
5
5
|
from .async_support import async_command, coro
|
6
6
|
|
7
7
|
__all__ = [
|
8
8
|
"NamingConverter",
|
9
|
+
"to_snake_case",
|
10
|
+
"to_pascal_case",
|
11
|
+
"to_camel_case",
|
12
|
+
"to_kebab_case",
|
9
13
|
"CLIMessages",
|
10
14
|
"validate_project_name",
|
11
15
|
"validate_path_exists",
|
vega/cli/utils/naming.py
CHANGED
@@ -2,6 +2,26 @@
|
|
2
2
|
import re
|
3
3
|
|
4
4
|
|
5
|
+
def to_snake_case(name: str) -> str:
|
6
|
+
"""Convert CamelCase/PascalCase to snake_case (standalone function for convenience)"""
|
7
|
+
return NamingConverter.to_snake_case(name)
|
8
|
+
|
9
|
+
|
10
|
+
def to_pascal_case(name: str) -> str:
|
11
|
+
"""Convert any format to PascalCase (standalone function for convenience)"""
|
12
|
+
return NamingConverter.to_pascal_case(name)
|
13
|
+
|
14
|
+
|
15
|
+
def to_camel_case(name: str) -> str:
|
16
|
+
"""Convert any format to camelCase (standalone function for convenience)"""
|
17
|
+
return NamingConverter.to_camel_case(name)
|
18
|
+
|
19
|
+
|
20
|
+
def to_kebab_case(name: str) -> str:
|
21
|
+
"""Convert any format to kebab-case (standalone function for convenience)"""
|
22
|
+
return NamingConverter.to_kebab_case(name)
|
23
|
+
|
24
|
+
|
5
25
|
class NamingConverter:
|
6
26
|
"""Utility class for converting between naming conventions"""
|
7
27
|
|
@@ -1,8 +1,8 @@
|
|
1
1
|
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
|
-
vega/cli/commands/add.py,sha256=
|
5
|
-
vega/cli/commands/generate.py,sha256=
|
4
|
+
vega/cli/commands/add.py,sha256=5Li588W1KWQqCKV0VZSURx4J3I8dQE297c4V_3anf5U,6465
|
5
|
+
vega/cli/commands/generate.py,sha256=Rb4hXPHm_pFEKFViWJ2sMzyUNJWCCoTjLq2H2GvruGc,33720
|
6
6
|
vega/cli/commands/init.py,sha256=kBRtntHT7e-y9uOwZm9o9IUED64e_pO5fBEsIx5m-X8,5592
|
7
7
|
vega/cli/commands/migrate.py,sha256=00swKeVhmKr1_1VJhg3GpIMcJ6Jfgz5FUpmJoLf5qSQ,3805
|
8
8
|
vega/cli/commands/update.py,sha256=0zRWkHvQwKGlJL9XF3bi--dThkFapyNOugL6AgGr6Ic,5897
|
@@ -19,7 +19,7 @@ vega/cli/templates/components.py,sha256=nb8B9ha7-vYqnv6dpkI6ruL_Uo6cvJVdcDUseUAC
|
|
19
19
|
vega/cli/templates/domain/entity.py.j2,sha256=dl5rzuJMnTRqOdU5SYV2o_OPGy9l6DNf_symCcjdjK0,344
|
20
20
|
vega/cli/templates/domain/interactor.py.j2,sha256=Hv6whUyW67smjMRw_HuvC3_-q7g32dEUOFZdmi5xkrc,684
|
21
21
|
vega/cli/templates/domain/mediator.py.j2,sha256=gdEDNscYaB3wOemaVrFr3qKVE5sTS5wRVvbxrrfBemY,694
|
22
|
-
vega/cli/templates/domain/repository_interface.py.j2,sha256=
|
22
|
+
vega/cli/templates/domain/repository_interface.py.j2,sha256=FDlK10yYim6wHMk44IVncoo6RPO0TWDeHWpPjgLlaLo,577
|
23
23
|
vega/cli/templates/domain/service_interface.py.j2,sha256=Pq-wwGvGbns9Z_2lqL8Xi2_G-MMU-0JjAuGW94H6mrE,330
|
24
24
|
vega/cli/templates/infrastructure/model.py.j2,sha256=zNY4m7BZJeQhdu_bTFY6WIhizsYW4eJY6PS1DCs0vbE,796
|
25
25
|
vega/cli/templates/infrastructure/repository_impl.py.j2,sha256=Rmip4Swh3wdJRioVOWKgJVQgl45Y9STu3M-oviaOrPM,488
|
@@ -33,7 +33,7 @@ vega/cli/templates/project/config.py.j2,sha256=1Iva9JEz5ej_WmTbRVBvOfSBhYUKIzN88
|
|
33
33
|
vega/cli/templates/project/main.py.j2,sha256=wpIWNcj0N42KI1crdn0aDISZ6aRt9LjX7FDzJxEE8OM,572
|
34
34
|
vega/cli/templates/project/main_fastapi.py.j2,sha256=5xXB7_OR1-3vkTAkvRvSh3GpL5NWnUEId3bSOOd9qxA,613
|
35
35
|
vega/cli/templates/project/main_standard.py.j2,sha256=j2z6u93_ObiOquzYQM1sZex50Z1cAwHOEG1-0REImRI,617
|
36
|
-
vega/cli/templates/project/pyproject.toml.j2,sha256
|
36
|
+
vega/cli/templates/project/pyproject.toml.j2,sha256=-TZj9rAXzO99lrKOUVZeeFwom_5Kg4ktdN_BIExOx_8,522
|
37
37
|
vega/cli/templates/project/settings.py.j2,sha256=uHt3qVbzoYZNb1ViD2Bu4SZYYw0jCUx6_m_kauILCCs,522
|
38
38
|
vega/cli/templates/sqlalchemy/alembic.ini.j2,sha256=7pcqcXWXU_0lHaokuHlkUNoN20oOw1Dd6HizMG1Cmmk,3472
|
39
39
|
vega/cli/templates/sqlalchemy/database_manager.py.j2,sha256=6h3a5RbGNnVLLt5cozTt_x1-32UG_G10YgYQ3R4Hy1Q,1371
|
@@ -52,10 +52,10 @@ vega/cli/templates/web/routes_init.py.j2,sha256=uyeuLGRZ-bDY-xefJ1eI9wU1kt9z7lwo
|
|
52
52
|
vega/cli/templates/web/routes_init_autodiscovery.py.j2,sha256=jxvFGmWsmW1tMCeOoYfPi4l0U94YkUxcZm2VFsGgTsw,310
|
53
53
|
vega/cli/templates/web/user_models.py.j2,sha256=_lbG-oL8-C7Lk3-48YuKR65USD5TV4D9JNoFT9kktIM,1250
|
54
54
|
vega/cli/templates/web/users_route.py.j2,sha256=TjKu28jxVY3SwToptjOZoclUnZkobbDOUfOYlDkjs40,1927
|
55
|
-
vega/cli/utils/__init__.py,sha256=
|
55
|
+
vega/cli/utils/__init__.py,sha256=18sBatA5Y9TaJCCJqSCYRyF0XJrSty_UlPeZrJPlTlI,513
|
56
56
|
vega/cli/utils/async_support.py,sha256=eU4HVZUCeJclZzpQQoDysiJ_qewwyCtu3C0TcSsuKl4,1511
|
57
57
|
vega/cli/utils/messages.py,sha256=EtRWqMD6BUGaIuEWiH0cigpQPEaLOhnURSACSzdxBdA,2399
|
58
|
-
vega/cli/utils/naming.py,sha256=
|
58
|
+
vega/cli/utils/naming.py,sha256=vrXOqoZYty_gX9HPv7scPduh4My6uEl-CCbyP_WoPAQ,4242
|
59
59
|
vega/cli/utils/validators.py,sha256=YhQ1KQsALdovMh9zgCsuh_I2Tm9C7fBzBkLb05pgX40,3028
|
60
60
|
vega/di/__init__.py,sha256=fgXpF4qaFJrkzAjb_QmZkpJ_thJ2yQQvQgfbd03v4AE,1599
|
61
61
|
vega/di/container.py,sha256=o4cpxCx53wWSNLcrr8Qt9tc7_YiDtHpYvUrdruNVwEc,5467
|
@@ -72,8 +72,8 @@ vega/patterns/repository.py,sha256=uYUyLs-O8OqW1Wb9ZqIo8UUcCjZ5UFuHors_F2iDg9A,1
|
|
72
72
|
vega/patterns/service.py,sha256=buFRgJoeQtZQK22Upb4vh84c1elWKFXWBaB0X4RaruE,1374
|
73
73
|
vega/settings/__init__.py,sha256=Eb8PMUyXAlCAQIcL2W8QhTTUHUbVlkAfXdpTUlADo1I,786
|
74
74
|
vega/settings/base.py,sha256=bL45hyoa3t-hQOvur860eSo7O833sQMsXJJPwbTVbwE,1321
|
75
|
-
vega_framework-0.1.
|
76
|
-
vega_framework-0.1.
|
77
|
-
vega_framework-0.1.
|
78
|
-
vega_framework-0.1.
|
79
|
-
vega_framework-0.1.
|
75
|
+
vega_framework-0.1.28.dist-info/METADATA,sha256=phV5zRJGewa-FkO3KNY2BW8ILdZRaQy8qu-u4eaxISQ,12349
|
76
|
+
vega_framework-0.1.28.dist-info/WHEEL,sha256=zp0Cn7JsFoX2ATtOhtaFYIiE2rmFAD4OcMhtUki8W3U,88
|
77
|
+
vega_framework-0.1.28.dist-info/entry_points.txt,sha256=p3gyTmPYjNRLbuiKS-hG3ytWd-ssBweFy6VZ-F9FTNk,42
|
78
|
+
vega_framework-0.1.28.dist-info/licenses/LICENSE,sha256=wlHh1MBTcs2kSQr99P30mZ61s7uh7Cp9Rk0YiJxots0,1084
|
79
|
+
vega_framework-0.1.28.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|