Skip to content

Commit 1669eb3

Browse files
committed
feat(new): add production backend and web templates
1 parent bab3149 commit 1669eb3

41 files changed

Lines changed: 2647 additions & 126 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

include/vix/cli/commands/new/NewGenerator.hpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,12 @@ namespace vix::commands::new_cmd::generator
7979
const FeaturesSelection &features,
8080
std::string &err);
8181

82+
bool generate_web_project(
83+
const std::filesystem::path &projectDir,
84+
const std::string &projName,
85+
const FeaturesSelection &features,
86+
std::string &err);
87+
8288
// ------------------------------------------------------------------
8389
// Post-generation output
8490
// ------------------------------------------------------------------
@@ -87,4 +93,7 @@ namespace vix::commands::new_cmd::generator
8793
void print_next_steps_lib(const fs::path &projectDir, const std::string &projName);
8894
void print_next_steps_game(const fs::path &projectDir, const std::string &projName);
8995
void print_next_steps_backend(const fs::path &projectDir, const std::string &projName);
96+
void print_next_steps_web(
97+
const std::filesystem::path &projectDir,
98+
const std::string &projName);
9099
} // namespace vix::commands::new_cmd::generator

include/vix/cli/commands/new/NewOutput.hpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,11 @@ namespace vix::commands::new_cmd::output
5454
const std::string &projName,
5555
const FeaturesSelection &features);
5656

57+
void print_creation_web(
58+
const std::filesystem::path &projectDir,
59+
const std::string &projName,
60+
const FeaturesSelection &features);
61+
5762
} // namespace vix::commands::new_cmd::output
5863

5964
#endif

include/vix/cli/commands/new/NewTemplates.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,4 @@
1818
#include <vix/cli/commands/new/templates/GameTemplates.hpp>
1919
#include <vix/cli/commands/new/templates/LibTemplates.hpp>
2020
#include <vix/cli/commands/new/templates/VueTemplates.hpp>
21+
#include <vix/cli/commands/new/templates/WebTemplates.hpp>

include/vix/cli/commands/new/NewTypes.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ namespace vix::commands::new_cmd
2020
Lib,
2121
Vue,
2222
Game,
23-
Backend
23+
Backend,
24+
Web
2425
};
2526

2627
struct FeaturesSelection

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,4 @@
1515
#include <vix/cli/commands/new/templates/backend/BackendReadmeTemplates.hpp>
1616
#include <vix/cli/commands/new/templates/backend/BackendRouteTemplates.hpp>
1717
#include <vix/cli/commands/new/templates/backend/BackendTestTemplates.hpp>
18+
#include <vix/cli/commands/new/templates/backend/BackendSupportTemplates.hpp>
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#pragma once
2+
3+
/**
4+
* @file WebTemplates.hpp
5+
* @author Gaspard Kirira
6+
*
7+
* Public facade for the server-rendered web `vix new` template.
8+
*/
9+
10+
#include <vix/cli/commands/new/templates/web/WebBootstrapTemplates.hpp>
11+
#include <vix/cli/commands/new/templates/web/WebConfigTemplates.hpp>
12+
#include <vix/cli/commands/new/templates/web/WebControllerTemplates.hpp>
13+
#include <vix/cli/commands/new/templates/web/WebManifestTemplates.hpp>
14+
#include <vix/cli/commands/new/templates/web/WebMiddlewareTemplates.hpp>
15+
#include <vix/cli/commands/new/templates/web/WebReadmeTemplates.hpp>
16+
#include <vix/cli/commands/new/templates/web/WebRouteTemplates.hpp>
17+
#include <vix/cli/commands/new/templates/web/WebTestTemplates.hpp>
18+
#include <vix/cli/commands/new/templates/web/WebViewTemplates.hpp>

include/vix/cli/commands/new/templates/backend/BackendConfigTemplates.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
namespace vix::commands::new_cmd::templates
1414
{
1515

16-
std::string make_backend_production_config_json();
17-
std::string make_backend_env_example();
16+
std::string make_backend_production_config_json(const std::string &projectName);
17+
std::string make_backend_env_example(const std::string &projectName);
1818

1919
} // namespace vix::commands::new_cmd::templates

include/vix/cli/commands/new/templates/backend/BackendControllerTemplates.hpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@
1313
namespace vix::commands::new_cmd::templates
1414
{
1515

16+
std::string make_backend_home_controller_hpp(const std::string &projectName);
17+
std::string make_backend_home_controller_cpp(const std::string &projectName);
18+
1619
std::string make_backend_health_controller_hpp(const std::string &projectName);
1720
std::string make_backend_health_controller_cpp(const std::string &projectName);
1821

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 BackendSupportTemplates.hpp
5+
* @author Gaspard Kirira
6+
*
7+
* Support helper 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_http_responses_hpp(const std::string &projectName);
17+
std::string make_backend_http_responses_cpp(const std::string &projectName);
18+
19+
} // namespace vix::commands::new_cmd::templates

include/vix/cli/commands/new/templates/backend/BackendTestTemplates.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,6 @@ namespace vix::commands::new_cmd::templates
1313
{
1414

1515
std::string make_backend_basic_test_cpp(const std::string &projectName);
16+
std::string make_backend_tests_manifest(const std::string &projectName);
1617

1718
} // namespace vix::commands::new_cmd::templates

0 commit comments

Comments
 (0)