stackforge-cli 0.1.2__py3-none-any.whl → 0.1.4__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.
- stackforge/engines/dotnet/__init__.py +7 -7
- stackforge/engines/dotnet/api_generator.py +313 -312
- stackforge/engines/dotnet/config_generator.py +76 -76
- stackforge/engines/dotnet/csproj_generator.py +82 -82
- stackforge/engines/dotnet/docker_generator.py +63 -63
- stackforge/engines/dotnet/git_generator.py +126 -111
- stackforge/engines/dotnet/layers_generator.py +543 -543
- stackforge/engines/dotnet/program_generator.py +245 -195
- stackforge/engines/dotnet/scaffolder.py +74 -74
- stackforge/project_name.py +34 -34
- stackforge/scaffold.py +90 -80
- stackforge/ui.py +72 -72
- stackforge/version.py +48 -48
- {stackforge_cli-0.1.2.dist-info → stackforge_cli-0.1.4.dist-info}/METADATA +107 -107
- stackforge_cli-0.1.4.dist-info/RECORD +19 -0
- {stackforge_cli-0.1.2.dist-info → stackforge_cli-0.1.4.dist-info}/WHEEL +1 -1
- stackforge_cli-0.1.2.dist-info/RECORD +0 -19
- {stackforge_cli-0.1.2.dist-info → stackforge_cli-0.1.4.dist-info}/entry_points.txt +0 -0
- {stackforge_cli-0.1.2.dist-info → stackforge_cli-0.1.4.dist-info}/top_level.txt +0 -0
stackforge/scaffold.py
CHANGED
|
@@ -1,80 +1,90 @@
|
|
|
1
|
-
from pathlib import Path
|
|
2
|
-
from stackforge.engines.dotnet.scaffolder import scaffold_folders
|
|
3
|
-
from stackforge.version import get_installed_version, notify_if_update_available
|
|
4
|
-
from stackforge.project_name import is_valid_project_name, to_pascal_case
|
|
5
|
-
from stackforge import ui
|
|
6
|
-
import sys
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
ui.
|
|
14
|
-
ui.
|
|
15
|
-
ui.
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
return
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
if
|
|
56
|
-
ui.
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
ui.
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
1
|
+
from pathlib import Path
|
|
2
|
+
from stackforge.engines.dotnet.scaffolder import scaffold_folders
|
|
3
|
+
from stackforge.version import get_installed_version, notify_if_update_available
|
|
4
|
+
from stackforge.project_name import is_valid_project_name, to_pascal_case
|
|
5
|
+
from stackforge import ui
|
|
6
|
+
import sys
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
FRAMEWORK_CHOICES = frozenset({"dotnet", "django", "fastapi", "flask", "exit"})
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
def select_framework() -> str:
|
|
13
|
+
ui.info("\n Select a framework:\n")
|
|
14
|
+
ui.menu_item("dotnet", ".NET Clean Architecture (CQRS)")
|
|
15
|
+
ui.menu_item("django", "Django [coming soon]", style=ui.Fore.YELLOW)
|
|
16
|
+
ui.menu_item("fastapi", "FastAPI [coming soon]", style=ui.Fore.YELLOW)
|
|
17
|
+
ui.menu_item("flask", "Flask [coming soon]", style=ui.Fore.YELLOW)
|
|
18
|
+
ui.menu_item("exit", "Exit", style=ui.Fore.RED)
|
|
19
|
+
|
|
20
|
+
choice = ui.prompt("\n Framework [dotnet]:").lower() or "dotnet"
|
|
21
|
+
if choice not in FRAMEWORK_CHOICES:
|
|
22
|
+
ui.error(f"Unknown framework '{choice}'.")
|
|
23
|
+
ui.step("Options: dotnet, django, fastapi, flask, exit\n")
|
|
24
|
+
return ""
|
|
25
|
+
return choice
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
def main():
|
|
29
|
+
if "--version" in sys.argv or "-V" in sys.argv:
|
|
30
|
+
print(get_installed_version())
|
|
31
|
+
return
|
|
32
|
+
|
|
33
|
+
notify_if_update_available()
|
|
34
|
+
ui.banner(".NET Clean Architecture Scaffolder", get_installed_version())
|
|
35
|
+
print()
|
|
36
|
+
|
|
37
|
+
while True:
|
|
38
|
+
framework = select_framework()
|
|
39
|
+
|
|
40
|
+
if not framework:
|
|
41
|
+
continue
|
|
42
|
+
|
|
43
|
+
if framework == "exit":
|
|
44
|
+
ui.warn("\n Exiting...")
|
|
45
|
+
break
|
|
46
|
+
|
|
47
|
+
if framework != "dotnet":
|
|
48
|
+
ui.warn("\n This framework is under development. Stay tuned!\n")
|
|
49
|
+
continue
|
|
50
|
+
|
|
51
|
+
raw_name = ui.prompt(
|
|
52
|
+
"\n Enter project name (PascalCase, camelCase, snake_case, or kebab-case):"
|
|
53
|
+
)
|
|
54
|
+
|
|
55
|
+
if not raw_name:
|
|
56
|
+
ui.error("Project name cannot be empty.\n")
|
|
57
|
+
continue
|
|
58
|
+
|
|
59
|
+
if not is_valid_project_name(raw_name):
|
|
60
|
+
ui.error("Invalid project name. Use letters, numbers, hyphens, or underscores.")
|
|
61
|
+
ui.step("Examples: MyApi, myApi, my_api, my-api\n")
|
|
62
|
+
continue
|
|
63
|
+
|
|
64
|
+
project_name = to_pascal_case(raw_name)
|
|
65
|
+
if project_name != raw_name:
|
|
66
|
+
ui.info(f" Normalized to: {project_name}")
|
|
67
|
+
|
|
68
|
+
base_path = Path.home() / "stackforge" / project_name
|
|
69
|
+
|
|
70
|
+
if base_path.exists():
|
|
71
|
+
ui.error(f"\n Project '{project_name}' already exists in the stackforge workspace.")
|
|
72
|
+
ui.step(f"Path: {base_path}")
|
|
73
|
+
ui.step("Choose a different project name or delete the existing one.\n")
|
|
74
|
+
continue
|
|
75
|
+
|
|
76
|
+
base_path.mkdir(parents=True, exist_ok=True)
|
|
77
|
+
scaffold_folders(base_path, project_name)
|
|
78
|
+
|
|
79
|
+
ui.section("Project ready")
|
|
80
|
+
ui.success(f"Created '{project_name}'")
|
|
81
|
+
ui.success(f"Location: {base_path}")
|
|
82
|
+
ui.info("\n Next steps:")
|
|
83
|
+
ui.step("Open the project in Visual Studio or VS Code")
|
|
84
|
+
ui.step("Run: docker-compose up --build")
|
|
85
|
+
ui.step("Visit: http://localhost:5000/swagger")
|
|
86
|
+
ui.muted("\n Press Ctrl+C to exit or continue to scaffold another project.\n")
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
if __name__ == "__main__":
|
|
90
|
+
main()
|
stackforge/ui.py
CHANGED
|
@@ -1,72 +1,72 @@
|
|
|
1
|
-
from colorama import Fore, Style, init
|
|
2
|
-
|
|
3
|
-
init(autoreset=True)
|
|
4
|
-
|
|
5
|
-
__all__ = [
|
|
6
|
-
"BANNER", "banner", "section", "step", "file_created", "success",
|
|
7
|
-
"warn", "error", "info", "prompt", "
|
|
8
|
-
"Fore", "Style",
|
|
9
|
-
]
|
|
10
|
-
|
|
11
|
-
BANNER = r"""
|
|
12
|
-
_____ _ _ ______
|
|
13
|
-
/ ____| | | | | ____|
|
|
14
|
-
| (___ | |_ __ _ ___| | _| |__ ___ _ __ __ _ ___
|
|
15
|
-
\___ \| __/ _` |/ __| |/ / __/ _ \| '__/ _` |/ _ \
|
|
16
|
-
____) | || (_| | (__| <| | | (_) | | | (_| | __/
|
|
17
|
-
|_____/ \__\__,_|\___|_|\_\_| \___/|_| \__, |\___|
|
|
18
|
-
__/ |
|
|
19
|
-
|___/"""
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
def banner(subtitle: str, version: str = "") -> None:
|
|
23
|
-
print(f"{Style.BRIGHT}{Fore.CYAN}{BANNER}{Style.RESET_ALL}")
|
|
24
|
-
print(f" {Style.BRIGHT}{Fore.WHITE}{subtitle}{Style.RESET_ALL}", end="")
|
|
25
|
-
if version:
|
|
26
|
-
print(f" {Fore.LIGHTBLACK_EX}v{version}{Style.RESET_ALL}")
|
|
27
|
-
else:
|
|
28
|
-
print()
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
def section(title: str) -> None:
|
|
32
|
-
print(f"\n {Style.BRIGHT}{Fore.CYAN}> {title}{Style.RESET_ALL}")
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
def step(label: str) -> None:
|
|
36
|
-
print(f" {Fore.BLUE}|{Style.RESET_ALL} {label}")
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
def file_created(path: str) -> None:
|
|
40
|
-
print(f" {Fore.GREEN}+{Style.RESET_ALL} {Fore.LIGHTWHITE_EX}{path}{Style.RESET_ALL}")
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
def success(message: str) -> None:
|
|
44
|
-
print(f" {Fore.GREEN}+{Style.RESET_ALL} {message}")
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
def warn(message: str) -> None:
|
|
48
|
-
print(f" {Fore.YELLOW}!{Style.RESET_ALL} {message}")
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
def error(message: str) -> None:
|
|
52
|
-
print(f" {Fore.RED}x{Style.RESET_ALL} {message}")
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
def info(message: str) -> None:
|
|
56
|
-
print(f" {Fore.CYAN}{message}{Style.RESET_ALL}")
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
def prompt(label: str) -> str:
|
|
60
|
-
return input(f" {Style.BRIGHT}{Fore.CYAN}{label}{Style.RESET_ALL} ").strip()
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
def
|
|
64
|
-
print(f" {style}{
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
def done() -> None:
|
|
68
|
-
print(f"\n {Style.BRIGHT}{Fore.GREEN}+ Scaffold complete.{Style.RESET_ALL}")
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
def muted(message: str) -> None:
|
|
72
|
-
print(f" {Fore.LIGHTBLACK_EX}{message}{Style.RESET_ALL}")
|
|
1
|
+
from colorama import Fore, Style, init
|
|
2
|
+
|
|
3
|
+
init(autoreset=True)
|
|
4
|
+
|
|
5
|
+
__all__ = [
|
|
6
|
+
"BANNER", "banner", "section", "step", "file_created", "success",
|
|
7
|
+
"warn", "error", "info", "prompt", "menu_item", "done", "muted",
|
|
8
|
+
"Fore", "Style",
|
|
9
|
+
]
|
|
10
|
+
|
|
11
|
+
BANNER = r"""
|
|
12
|
+
_____ _ _ ______
|
|
13
|
+
/ ____| | | | | ____|
|
|
14
|
+
| (___ | |_ __ _ ___| | _| |__ ___ _ __ __ _ ___
|
|
15
|
+
\___ \| __/ _` |/ __| |/ / __/ _ \| '__/ _` |/ _ \
|
|
16
|
+
____) | || (_| | (__| <| | | (_) | | | (_| | __/
|
|
17
|
+
|_____/ \__\__,_|\___|_|\_\_| \___/|_| \__, |\___|
|
|
18
|
+
__/ |
|
|
19
|
+
|___/"""
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
def banner(subtitle: str, version: str = "") -> None:
|
|
23
|
+
print(f"{Style.BRIGHT}{Fore.CYAN}{BANNER}{Style.RESET_ALL}")
|
|
24
|
+
print(f" {Style.BRIGHT}{Fore.WHITE}{subtitle}{Style.RESET_ALL}", end="")
|
|
25
|
+
if version:
|
|
26
|
+
print(f" {Fore.LIGHTBLACK_EX}v{version}{Style.RESET_ALL}")
|
|
27
|
+
else:
|
|
28
|
+
print()
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
def section(title: str) -> None:
|
|
32
|
+
print(f"\n {Style.BRIGHT}{Fore.CYAN}> {title}{Style.RESET_ALL}")
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
def step(label: str) -> None:
|
|
36
|
+
print(f" {Fore.BLUE}|{Style.RESET_ALL} {label}")
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
def file_created(path: str) -> None:
|
|
40
|
+
print(f" {Fore.GREEN}+{Style.RESET_ALL} {Fore.LIGHTWHITE_EX}{path}{Style.RESET_ALL}")
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
def success(message: str) -> None:
|
|
44
|
+
print(f" {Fore.GREEN}+{Style.RESET_ALL} {message}")
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
def warn(message: str) -> None:
|
|
48
|
+
print(f" {Fore.YELLOW}!{Style.RESET_ALL} {message}")
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
def error(message: str) -> None:
|
|
52
|
+
print(f" {Fore.RED}x{Style.RESET_ALL} {message}")
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
def info(message: str) -> None:
|
|
56
|
+
print(f" {Fore.CYAN}{message}{Style.RESET_ALL}")
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
def prompt(label: str) -> str:
|
|
60
|
+
return input(f" {Style.BRIGHT}{Fore.CYAN}{label}{Style.RESET_ALL} ").strip()
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
def menu_item(key: str, label: str, *, style: str = Fore.GREEN) -> None:
|
|
64
|
+
print(f" {style}{key:<10}{Style.RESET_ALL} {label}")
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
def done() -> None:
|
|
68
|
+
print(f"\n {Style.BRIGHT}{Fore.GREEN}+ Scaffold complete.{Style.RESET_ALL}")
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
def muted(message: str) -> None:
|
|
72
|
+
print(f" {Fore.LIGHTBLACK_EX}{message}{Style.RESET_ALL}")
|
stackforge/version.py
CHANGED
|
@@ -1,48 +1,48 @@
|
|
|
1
|
-
import json
|
|
2
|
-
import urllib.error
|
|
3
|
-
import urllib.request
|
|
4
|
-
from importlib.metadata import PackageNotFoundError, version
|
|
5
|
-
|
|
6
|
-
PACKAGE_NAME = "stackforge-cli"
|
|
7
|
-
PYPI_JSON_URL = f"https://pypi.org/pypi/{PACKAGE_NAME}/json"
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
def get_installed_version() -> str:
|
|
11
|
-
try:
|
|
12
|
-
return version(PACKAGE_NAME)
|
|
13
|
-
except PackageNotFoundError:
|
|
14
|
-
return "0.0.0-dev"
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
def _version_tuple(value: str) -> tuple[int, ...]:
|
|
18
|
-
parts: list[int] = []
|
|
19
|
-
for segment in value.split("."):
|
|
20
|
-
digits = "".join(c for c in segment if c.isdigit())
|
|
21
|
-
if digits:
|
|
22
|
-
parts.append(int(digits))
|
|
23
|
-
return tuple(parts)
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
def fetch_latest_version(timeout: float = 2.0) -> str | None:
|
|
27
|
-
request = urllib.request.Request(
|
|
28
|
-
PYPI_JSON_URL,
|
|
29
|
-
headers={"Accept": "application/json"},
|
|
30
|
-
)
|
|
31
|
-
try:
|
|
32
|
-
with urllib.request.urlopen(request, timeout=timeout) as response:
|
|
33
|
-
payload = json.load(response)
|
|
34
|
-
return payload["info"]["version"]
|
|
35
|
-
except (urllib.error.URLError, TimeoutError, KeyError, json.JSONDecodeError):
|
|
36
|
-
return None
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
def notify_if_update_available() -> None:
|
|
40
|
-
from stackforge import ui
|
|
41
|
-
|
|
42
|
-
installed = get_installed_version()
|
|
43
|
-
latest = fetch_latest_version()
|
|
44
|
-
if not latest or _version_tuple(latest) <= _version_tuple(installed):
|
|
45
|
-
return
|
|
46
|
-
|
|
47
|
-
ui.warn(f"StackForge {latest} is available (you have {installed}).")
|
|
48
|
-
ui.step(f"Update: pip install --upgrade {PACKAGE_NAME}\n")
|
|
1
|
+
import json
|
|
2
|
+
import urllib.error
|
|
3
|
+
import urllib.request
|
|
4
|
+
from importlib.metadata import PackageNotFoundError, version
|
|
5
|
+
|
|
6
|
+
PACKAGE_NAME = "stackforge-cli"
|
|
7
|
+
PYPI_JSON_URL = f"https://pypi.org/pypi/{PACKAGE_NAME}/json"
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
def get_installed_version() -> str:
|
|
11
|
+
try:
|
|
12
|
+
return version(PACKAGE_NAME)
|
|
13
|
+
except PackageNotFoundError:
|
|
14
|
+
return "0.0.0-dev"
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
def _version_tuple(value: str) -> tuple[int, ...]:
|
|
18
|
+
parts: list[int] = []
|
|
19
|
+
for segment in value.split("."):
|
|
20
|
+
digits = "".join(c for c in segment if c.isdigit())
|
|
21
|
+
if digits:
|
|
22
|
+
parts.append(int(digits))
|
|
23
|
+
return tuple(parts)
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
def fetch_latest_version(timeout: float = 2.0) -> str | None:
|
|
27
|
+
request = urllib.request.Request(
|
|
28
|
+
PYPI_JSON_URL,
|
|
29
|
+
headers={"Accept": "application/json"},
|
|
30
|
+
)
|
|
31
|
+
try:
|
|
32
|
+
with urllib.request.urlopen(request, timeout=timeout) as response:
|
|
33
|
+
payload = json.load(response)
|
|
34
|
+
return payload["info"]["version"]
|
|
35
|
+
except (urllib.error.URLError, TimeoutError, KeyError, json.JSONDecodeError):
|
|
36
|
+
return None
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
def notify_if_update_available() -> None:
|
|
40
|
+
from stackforge import ui
|
|
41
|
+
|
|
42
|
+
installed = get_installed_version()
|
|
43
|
+
latest = fetch_latest_version()
|
|
44
|
+
if not latest or _version_tuple(latest) <= _version_tuple(installed):
|
|
45
|
+
return
|
|
46
|
+
|
|
47
|
+
ui.warn(f"StackForge {latest} is available (you have {installed}).")
|
|
48
|
+
ui.step(f"Update: pip install --upgrade {PACKAGE_NAME}\n")
|
|
@@ -1,107 +1,107 @@
|
|
|
1
|
-
Metadata-Version: 2.4
|
|
2
|
-
Name: stackforge-cli
|
|
3
|
-
Version: 0.1.
|
|
4
|
-
Summary: A CLI scaffolder for .NET Clean Architecture projects
|
|
5
|
-
License: MIT
|
|
6
|
-
Keywords: scaffolder,dotnet,clean-architecture,cli
|
|
7
|
-
Classifier: Programming Language :: Python :: 3
|
|
8
|
-
Classifier: License :: OSI Approved :: MIT License
|
|
9
|
-
Classifier: Operating System :: OS Independent
|
|
10
|
-
Classifier: Environment :: Console
|
|
11
|
-
Requires-Python: >=3.10
|
|
12
|
-
Description-Content-Type: text/markdown
|
|
13
|
-
Requires-Dist: colorama>=0.4.6
|
|
14
|
-
|
|
15
|
-
# StackForge
|
|
16
|
-
|
|
17
|
-
A CLI scaffolder for .NET Clean Architecture (CQRS) projects.
|
|
18
|
-
|
|
19
|
-
## Installation
|
|
20
|
-
|
|
21
|
-
```bash
|
|
22
|
-
pip install stackforge-cli
|
|
23
|
-
```
|
|
24
|
-
|
|
25
|
-
## Usage
|
|
26
|
-
|
|
27
|
-
```bash
|
|
28
|
-
stackforge
|
|
29
|
-
```
|
|
30
|
-
|
|
31
|
-
Then follow the prompts to scaffold a new project.
|
|
32
|
-
|
|
33
|
-
## Version and updates
|
|
34
|
-
|
|
35
|
-
Check the version you have installed:
|
|
36
|
-
|
|
37
|
-
```bash
|
|
38
|
-
stackforge --version
|
|
39
|
-
```
|
|
40
|
-
|
|
41
|
-
Update to the latest release:
|
|
42
|
-
|
|
43
|
-
```bash
|
|
44
|
-
pip install --upgrade stackforge-cli
|
|
45
|
-
```
|
|
46
|
-
|
|
47
|
-
When you run `stackforge`, it checks PyPI for a newer version and prints an upgrade notice if one is available (network required; fails silently if offline).
|
|
48
|
-
|
|
49
|
-
## What it generates
|
|
50
|
-
|
|
51
|
-
- .NET 10 Clean Architecture structure (API, Application, Domain, Infrastructure, Persistence)
|
|
52
|
-
- JWT authentication with ASP.NET Identity
|
|
53
|
-
- Swagger UI with Bearer token support
|
|
54
|
-
- PostgreSQL with EF Core
|
|
55
|
-
- Docker + docker-compose with healthchecks
|
|
56
|
-
- Role and user seeders (SuperAdmin out of the box)
|
|
57
|
-
- Git initialization on `main` with `staging` and `development` branches
|
|
58
|
-
- GitHub Actions workflow to create `staging` and `development` on first push to `main`
|
|
59
|
-
|
|
60
|
-
## Quickstart after scaffolding
|
|
61
|
-
|
|
62
|
-
1. Open the project in VS Code or Visual Studio
|
|
63
|
-
2. Run: `docker-compose up --build`
|
|
64
|
-
3. Visit: `http://localhost:5000/swagger`
|
|
65
|
-
|
|
66
|
-
## Git workflow
|
|
67
|
-
|
|
68
|
-
Each scaffolded project is initialized with three local branches:
|
|
69
|
-
|
|
70
|
-
| Branch | Purpose |
|
|
71
|
-
|---------------|----------------------------------|
|
|
72
|
-
| `main` | Production / default branch |
|
|
73
|
-
| `staging` | Pre-production environment |
|
|
74
|
-
| `development` | Active development environment |
|
|
75
|
-
|
|
76
|
-
A GitHub Actions workflow (`.github/workflows/sync-branches.yml`) is also included as a fallback: if you only push `main` first, it creates remote `staging` and `development` on GitHub automatically.
|
|
77
|
-
|
|
78
|
-
### Example: push to GitHub
|
|
79
|
-
|
|
80
|
-
From your scaffolded project directory (e.g. `~/stackforge/MyApi`):
|
|
81
|
-
|
|
82
|
-
```bash
|
|
83
|
-
# 1. Create a new repo on GitHub (empty, no README), then add the remote
|
|
84
|
-
git remote add origin https://github.com/<your-user>/MyApi.git
|
|
85
|
-
|
|
86
|
-
# 2. Push all branches in one go
|
|
87
|
-
git push -u origin --all
|
|
88
|
-
```
|
|
89
|
-
|
|
90
|
-
That publishes `main`, `staging`, and `development` in a single command and sets upstream tracking for each.
|
|
91
|
-
|
|
92
|
-
### Day-to-day branching
|
|
93
|
-
|
|
94
|
-
```bash
|
|
95
|
-
# Work on a feature
|
|
96
|
-
git checkout development
|
|
97
|
-
git checkout -b feature/my-feature
|
|
98
|
-
# ... commit changes ...
|
|
99
|
-
git push -u origin feature/my-feature
|
|
100
|
-
|
|
101
|
-
# Merge into development when ready (via PR or locally)
|
|
102
|
-
git checkout development
|
|
103
|
-
git merge feature/my-feature
|
|
104
|
-
git push origin development
|
|
105
|
-
```
|
|
106
|
-
|
|
107
|
-
Promote changes up the chain (`development` → `staging` → `main`) using pull requests or merges as your team prefers.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: stackforge-cli
|
|
3
|
+
Version: 0.1.4
|
|
4
|
+
Summary: A CLI scaffolder for .NET Clean Architecture projects
|
|
5
|
+
License: MIT
|
|
6
|
+
Keywords: scaffolder,dotnet,clean-architecture,cli
|
|
7
|
+
Classifier: Programming Language :: Python :: 3
|
|
8
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
9
|
+
Classifier: Operating System :: OS Independent
|
|
10
|
+
Classifier: Environment :: Console
|
|
11
|
+
Requires-Python: >=3.10
|
|
12
|
+
Description-Content-Type: text/markdown
|
|
13
|
+
Requires-Dist: colorama>=0.4.6
|
|
14
|
+
|
|
15
|
+
# StackForge
|
|
16
|
+
|
|
17
|
+
A CLI scaffolder for .NET Clean Architecture (CQRS) projects.
|
|
18
|
+
|
|
19
|
+
## Installation
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
pip install stackforge-cli
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Usage
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
stackforge
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
Then follow the prompts to scaffold a new project.
|
|
32
|
+
|
|
33
|
+
## Version and updates
|
|
34
|
+
|
|
35
|
+
Check the version you have installed:
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
stackforge --version
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
Update to the latest release:
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
pip install --upgrade stackforge-cli
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
When you run `stackforge`, it checks PyPI for a newer version and prints an upgrade notice if one is available (network required; fails silently if offline).
|
|
48
|
+
|
|
49
|
+
## What it generates
|
|
50
|
+
|
|
51
|
+
- .NET 10 Clean Architecture structure (API, Application, Domain, Infrastructure, Persistence)
|
|
52
|
+
- JWT authentication with ASP.NET Identity
|
|
53
|
+
- Swagger UI with Bearer token support
|
|
54
|
+
- PostgreSQL with EF Core
|
|
55
|
+
- Docker + docker-compose with healthchecks
|
|
56
|
+
- Role and user seeders (SuperAdmin out of the box)
|
|
57
|
+
- Git initialization on `main` with `staging` and `development` branches
|
|
58
|
+
- GitHub Actions workflow to create `staging` and `development` on first push to `main`
|
|
59
|
+
|
|
60
|
+
## Quickstart after scaffolding
|
|
61
|
+
|
|
62
|
+
1. Open the project in VS Code or Visual Studio
|
|
63
|
+
2. Run: `docker-compose up --build`
|
|
64
|
+
3. Visit: `http://localhost:5000/swagger`
|
|
65
|
+
|
|
66
|
+
## Git workflow
|
|
67
|
+
|
|
68
|
+
Each scaffolded project is initialized with three local branches:
|
|
69
|
+
|
|
70
|
+
| Branch | Purpose |
|
|
71
|
+
|---------------|----------------------------------|
|
|
72
|
+
| `main` | Production / default branch |
|
|
73
|
+
| `staging` | Pre-production environment |
|
|
74
|
+
| `development` | Active development environment |
|
|
75
|
+
|
|
76
|
+
A GitHub Actions workflow (`.github/workflows/sync-branches.yml`) is also included as a fallback: if you only push `main` first, it creates remote `staging` and `development` on GitHub automatically.
|
|
77
|
+
|
|
78
|
+
### Example: push to GitHub
|
|
79
|
+
|
|
80
|
+
From your scaffolded project directory (e.g. `~/stackforge/MyApi`):
|
|
81
|
+
|
|
82
|
+
```bash
|
|
83
|
+
# 1. Create a new repo on GitHub (empty, no README), then add the remote
|
|
84
|
+
git remote add origin https://github.com/<your-user>/MyApi.git
|
|
85
|
+
|
|
86
|
+
# 2. Push all branches in one go
|
|
87
|
+
git push -u origin --all
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
That publishes `main`, `staging`, and `development` in a single command and sets upstream tracking for each.
|
|
91
|
+
|
|
92
|
+
### Day-to-day branching
|
|
93
|
+
|
|
94
|
+
```bash
|
|
95
|
+
# Work on a feature
|
|
96
|
+
git checkout development
|
|
97
|
+
git checkout -b feature/my-feature
|
|
98
|
+
# ... commit changes ...
|
|
99
|
+
git push -u origin feature/my-feature
|
|
100
|
+
|
|
101
|
+
# Merge into development when ready (via PR or locally)
|
|
102
|
+
git checkout development
|
|
103
|
+
git merge feature/my-feature
|
|
104
|
+
git push origin development
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
Promote changes up the chain (`development` → `staging` → `main`) using pull requests or merges as your team prefers.
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
stackforge/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
|
+
stackforge/project_name.py,sha256=KbFoDx-2C3dER7m9PJwdlbJZH-IRFr--akgTxSQWf2g,851
|
|
3
|
+
stackforge/scaffold.py,sha256=KJMhXfPkXub_ZPZupFp1qfiwsHZwpHU254gylzqhaVE,3191
|
|
4
|
+
stackforge/ui.py,sha256=rZamzP2OoCDF89-lUPkXe3zQSo0an6VK0HYldAFkpZE,2081
|
|
5
|
+
stackforge/version.py,sha256=axl5_By977ufg96ZEc1m2nwaUpIXXHWXKE5X1FfWkOc,1436
|
|
6
|
+
stackforge/engines/dotnet/__init__.py,sha256=mY5rNIb6A5OyX-pkIvjyOYr0prqe2EMGB2Ri_-M8sv0,611
|
|
7
|
+
stackforge/engines/dotnet/api_generator.py,sha256=h91vkal_fopbf3IwOt192YlxFpfWV_XYSxQuB_6nq1k,9527
|
|
8
|
+
stackforge/engines/dotnet/config_generator.py,sha256=_1O448JruZJwsImUGpkWvmT2lwYPT9PxrNcLIpNwfO8,1993
|
|
9
|
+
stackforge/engines/dotnet/csproj_generator.py,sha256=6lsymgqvufXBYrcraPwBwiqw3ioCb0ClnxeyuG-RHYI,2432
|
|
10
|
+
stackforge/engines/dotnet/docker_generator.py,sha256=ujk11sAgjO5Cbe87rO-sc3ICmEBC0LiG0FvZZCuRDUA,1596
|
|
11
|
+
stackforge/engines/dotnet/git_generator.py,sha256=cfAuXQ7gFQI6Utf8UwGGBCAn__sSND98F4Mc2XPfbSk,3622
|
|
12
|
+
stackforge/engines/dotnet/layers_generator.py,sha256=rDOB_4HBeueGT1bU8zA5_D9oJtpEaFPHqwUNPcbAenI,17632
|
|
13
|
+
stackforge/engines/dotnet/program_generator.py,sha256=jetpNGz7Eb8zqeF0gcxSr7XV95I88Tsh4J9KtwuOgtg,8349
|
|
14
|
+
stackforge/engines/dotnet/scaffolder.py,sha256=ViyT9Chf8zlYOZ5dVaDeIRXyYiI3-NGgvGXVQOBeRm0,2320
|
|
15
|
+
stackforge_cli-0.1.4.dist-info/METADATA,sha256=54pvUun4oKdHQOfP9Sd8nrtluAgrvzS-idcxadSCy08,3072
|
|
16
|
+
stackforge_cli-0.1.4.dist-info/WHEEL,sha256=mOdXR9C3wMVov7cSY8PY-XCzo3SmmWCHvGQr5csJoao,91
|
|
17
|
+
stackforge_cli-0.1.4.dist-info/entry_points.txt,sha256=r6YqYMrqMdXBiKTqSNdbEjwuzhCSksAlAmdhnqIOvJE,56
|
|
18
|
+
stackforge_cli-0.1.4.dist-info/top_level.txt,sha256=rLeEUKSWLyFKeW9uVuvTDIxq05hOic0cG7Xy3XlSYI8,11
|
|
19
|
+
stackforge_cli-0.1.4.dist-info/RECORD,,
|