Skip to content

Commit bab3149

Browse files
committed
refactor(new): split backend templates
1 parent 3de62e3 commit bab3149

18 files changed

Lines changed: 791 additions & 541 deletions

include/vix/cli/commands/new/templates/BackendTemplates.hpp

Lines changed: 9 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -4,40 +4,14 @@
44
* @file BackendTemplates.hpp
55
* @author Gaspard Kirira
66
*
7-
* File-content templates for the production backend `vix new` template.
7+
* Public facade for the production backend `vix new` template.
88
*/
99

10-
#include <string>
11-
12-
#include <vix/cli/commands/new/NewTypes.hpp>
13-
14-
namespace vix::commands::new_cmd::templates
15-
{
16-
17-
std::string make_backend_main_cpp(const std::string &projectName);
18-
19-
std::string make_backend_app_bootstrap_hpp(const std::string &projectName);
20-
std::string make_backend_app_bootstrap_cpp(const std::string &projectName);
21-
22-
std::string make_backend_route_registry_hpp(const std::string &projectName);
23-
std::string make_backend_route_registry_cpp(const std::string &projectName);
24-
25-
std::string make_backend_middleware_registry_hpp(const std::string &projectName);
26-
std::string make_backend_middleware_registry_cpp(const std::string &projectName);
27-
28-
std::string make_backend_health_controller_hpp(const std::string &projectName);
29-
std::string make_backend_health_controller_cpp(const std::string &projectName);
30-
31-
std::string make_backend_production_config_json();
32-
std::string make_backend_env_example();
33-
std::string make_backend_basic_test_cpp(const std::string &projectName);
34-
35-
std::string make_readme_backend(const std::string &projectName);
36-
37-
std::string make_project_manifest_backend(
38-
const std::string &projectName,
39-
const FeaturesSelection &features);
40-
41-
std::string make_vix_json_backend(const std::string &projectName);
42-
43-
} // namespace vix::commands::new_cmd::templates
10+
#include <vix/cli/commands/new/templates/backend/BackendBootstrapTemplates.hpp>
11+
#include <vix/cli/commands/new/templates/backend/BackendConfigTemplates.hpp>
12+
#include <vix/cli/commands/new/templates/backend/BackendControllerTemplates.hpp>
13+
#include <vix/cli/commands/new/templates/backend/BackendManifestTemplates.hpp>
14+
#include <vix/cli/commands/new/templates/backend/BackendMiddlewareTemplates.hpp>
15+
#include <vix/cli/commands/new/templates/backend/BackendReadmeTemplates.hpp>
16+
#include <vix/cli/commands/new/templates/backend/BackendRouteTemplates.hpp>
17+
#include <vix/cli/commands/new/templates/backend/BackendTestTemplates.hpp>
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#pragma once
2+
3+
/**
4+
* @file BackendBootstrapTemplates.hpp
5+
* @author Gaspard Kirira
6+
*
7+
* Entry-point and bootstrap file-content templates for the production backend
8+
* `vix new` template.
9+
*/
10+
11+
#include <string>
12+
13+
namespace vix::commands::new_cmd::templates
14+
{
15+
16+
std::string make_backend_main_cpp(const std::string &projectName);
17+
std::string make_backend_app_bootstrap_hpp(const std::string &projectName);
18+
std::string make_backend_app_bootstrap_cpp(const std::string &projectName);
19+
20+
} // namespace vix::commands::new_cmd::templates
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#pragma once
2+
3+
/**
4+
* @file BackendConfigTemplates.hpp
5+
* @author Gaspard Kirira
6+
*
7+
* Configuration file-content templates for the production backend `vix new`
8+
* template.
9+
*/
10+
11+
#include <string>
12+
13+
namespace vix::commands::new_cmd::templates
14+
{
15+
16+
std::string make_backend_production_config_json();
17+
std::string make_backend_env_example();
18+
19+
} // namespace vix::commands::new_cmd::templates
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#pragma once
2+
3+
/**
4+
* @file BackendControllerTemplates.hpp
5+
* @author Gaspard Kirira
6+
*
7+
* Controller file-content templates for the production backend `vix new`
8+
* template.
9+
*/
10+
11+
#include <string>
12+
13+
namespace vix::commands::new_cmd::templates
14+
{
15+
16+
std::string make_backend_health_controller_hpp(const std::string &projectName);
17+
std::string make_backend_health_controller_cpp(const std::string &projectName);
18+
19+
} // namespace vix::commands::new_cmd::templates
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#pragma once
2+
3+
/**
4+
* @file BackendManifestTemplates.hpp
5+
* @author Gaspard Kirira
6+
*
7+
* Manifest file-content templates for the production backend `vix new`
8+
* template.
9+
*/
10+
11+
#include <string>
12+
13+
#include <vix/cli/commands/new/NewTypes.hpp>
14+
15+
namespace vix::commands::new_cmd::templates
16+
{
17+
18+
std::string make_project_manifest_backend(
19+
const std::string &projectName,
20+
const FeaturesSelection &features);
21+
22+
std::string make_vix_json_backend(const std::string &projectName);
23+
24+
} // namespace vix::commands::new_cmd::templates
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#pragma once
2+
3+
/**
4+
* @file BackendMiddlewareTemplates.hpp
5+
* @author Gaspard Kirira
6+
*
7+
* Middleware registry file-content templates for the production backend
8+
* `vix new` template.
9+
*/
10+
11+
#include <string>
12+
13+
namespace vix::commands::new_cmd::templates
14+
{
15+
16+
std::string make_backend_middleware_registry_hpp(const std::string &projectName);
17+
std::string make_backend_middleware_registry_cpp(const std::string &projectName);
18+
19+
} // namespace vix::commands::new_cmd::templates
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#pragma once
2+
3+
/**
4+
* @file BackendReadmeTemplates.hpp
5+
* @author Gaspard Kirira
6+
*
7+
* README file-content templates for the production backend `vix new` template.
8+
*/
9+
10+
#include <string>
11+
12+
namespace vix::commands::new_cmd::templates
13+
{
14+
15+
std::string make_readme_backend(const std::string &projectName);
16+
17+
} // namespace vix::commands::new_cmd::templates
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#pragma once
2+
3+
/**
4+
* @file BackendRouteTemplates.hpp
5+
* @author Gaspard Kirira
6+
*
7+
* Route registry file-content templates for the production backend `vix new`
8+
* template.
9+
*/
10+
11+
#include <string>
12+
13+
namespace vix::commands::new_cmd::templates
14+
{
15+
16+
std::string make_backend_route_registry_hpp(const std::string &projectName);
17+
std::string make_backend_route_registry_cpp(const std::string &projectName);
18+
19+
} // namespace vix::commands::new_cmd::templates
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#pragma once
2+
3+
/**
4+
* @file BackendTestTemplates.hpp
5+
* @author Gaspard Kirira
6+
*
7+
* Test file-content templates for the production backend `vix new` template.
8+
*/
9+
10+
#include <string>
11+
12+
namespace vix::commands::new_cmd::templates
13+
{
14+
15+
std::string make_backend_basic_test_cpp(const std::string &projectName);
16+
17+
} // namespace vix::commands::new_cmd::templates

0 commit comments

Comments
 (0)