From ea6b8e5fe52f54d4c9a1506f330c1017367b19d2 Mon Sep 17 00:00:00 2001 From: Senko Rasic Date: Mon, 29 Jul 2024 13:49:37 +0200 Subject: [PATCH] Use template summary in project details when templates are used --- core/prompts/partials/project_details.prompt | 4 ++++ core/templates/registry.py | 7 +++---- tests/templates/test_templates.py | 3 --- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/core/prompts/partials/project_details.prompt b/core/prompts/partials/project_details.prompt index 3efac36d4..bea8edf37 100644 --- a/core/prompts/partials/project_details.prompt +++ b/core/prompts/partials/project_details.prompt @@ -20,3 +20,7 @@ Here are the technologies that should be used for this project: * {{ tech.name }} - {{ tech.description }} {% endfor %} {% endif %} +{% if state.specification.template_summary %} + +{{ state.specification.template_summary }} +{% endif %} diff --git a/core/templates/registry.py b/core/templates/registry.py index a07a25a39..1e8f432f5 100644 --- a/core/templates/registry.py +++ b/core/templates/registry.py @@ -4,8 +4,7 @@ from .javascript_react import JavascriptReactProjectTemplate from .node_express_mongoose import NodeExpressMongooseProjectTemplate - -# from .react_express import ReactExpressProjectTemplate +from .react_express import ReactExpressProjectTemplate log = get_logger(__name__) @@ -15,11 +14,11 @@ class ProjectTemplateEnum(str, Enum): JAVASCRIPT_REACT = JavascriptReactProjectTemplate.name NODE_EXPRESS_MONGOOSE = NodeExpressMongooseProjectTemplate.name - # REACT_EXPRESS = ReactExpressProjectTemplate.name + REACT_EXPRESS = ReactExpressProjectTemplate.name PROJECT_TEMPLATES = { JavascriptReactProjectTemplate.name: JavascriptReactProjectTemplate, NodeExpressMongooseProjectTemplate.name: NodeExpressMongooseProjectTemplate, - # ReactExpressProjectTemplate.name: ReactExpressProjectTemplate, + ReactExpressProjectTemplate.name: ReactExpressProjectTemplate, } diff --git a/tests/templates/test_templates.py b/tests/templates/test_templates.py index dd21a7866..42efa5cf2 100644 --- a/tests/templates/test_templates.py +++ b/tests/templates/test_templates.py @@ -6,7 +6,6 @@ from core.templates.registry import PROJECT_TEMPLATES -@pytest.mark.skip @pytest.mark.asyncio @patch("core.state.state_manager.get_config") async def test_render_react_express_sql(mock_get_config, testmanager): @@ -31,7 +30,6 @@ async def test_render_react_express_sql(mock_get_config, testmanager): assert "api/models/user.js" not in files -@pytest.mark.skip @pytest.mark.asyncio @patch("core.state.state_manager.get_config") async def test_render_react_express_nosql(mock_get_config, testmanager): @@ -57,7 +55,6 @@ async def test_render_react_express_nosql(mock_get_config, testmanager): assert "prisma/schema.prisma" not in files -@pytest.mark.skip @pytest.mark.asyncio @patch("core.state.state_manager.get_config") async def test_render_javascript_react(mock_get_config, testmanager):