faster-app 0.0.12__tar.gz → 0.0.13__tar.gz
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.
- {faster_app-0.0.12 → faster_app-0.0.13}/PKG-INFO +1 -1
- {faster_app-0.0.12 → faster_app-0.0.13}/faster_app/__init__.py +1 -1
- faster_app-0.0.13/faster_app/commands/builtins/app.py +46 -0
- {faster_app-0.0.12 → faster_app-0.0.13}/faster_app.egg-info/PKG-INFO +1 -1
- {faster_app-0.0.12 → faster_app-0.0.13}/pyproject.toml +1 -1
- faster_app-0.0.12/faster_app/commands/builtins/app.py +0 -29
- {faster_app-0.0.12 → faster_app-0.0.13}/LICENSE +0 -0
- {faster_app-0.0.12 → faster_app-0.0.13}/README.md +0 -0
- {faster_app-0.0.12 → faster_app-0.0.13}/faster_app/.env.example +0 -0
- {faster_app-0.0.12 → faster_app-0.0.13}/faster_app/base.py +0 -0
- {faster_app-0.0.12 → faster_app-0.0.13}/faster_app/commands/__init__.py +0 -0
- {faster_app-0.0.12 → faster_app-0.0.13}/faster_app/commands/base.py +0 -0
- {faster_app-0.0.12 → faster_app-0.0.13}/faster_app/commands/builtins/__init__.py +0 -0
- {faster_app-0.0.12 → faster_app-0.0.13}/faster_app/commands/builtins/db.py +0 -0
- {faster_app-0.0.12 → faster_app-0.0.13}/faster_app/commands/builtins/fastapi.py +0 -0
- {faster_app-0.0.12 → faster_app-0.0.13}/faster_app/commands/discover.py +0 -0
- {faster_app-0.0.12 → faster_app-0.0.13}/faster_app/db.py +0 -0
- {faster_app-0.0.12 → faster_app-0.0.13}/faster_app/main.py +0 -0
- {faster_app-0.0.12 → faster_app-0.0.13}/faster_app/models/__init__.py +0 -0
- {faster_app-0.0.12 → faster_app-0.0.13}/faster_app/models/base.py +0 -0
- {faster_app-0.0.12 → faster_app-0.0.13}/faster_app/models/discover.py +0 -0
- {faster_app-0.0.12 → faster_app-0.0.13}/faster_app/routes/__init__.py +0 -0
- {faster_app-0.0.12 → faster_app-0.0.13}/faster_app/routes/base.py +0 -0
- {faster_app-0.0.12 → faster_app-0.0.13}/faster_app/routes/builtins/__init__.py +0 -0
- {faster_app-0.0.12 → faster_app-0.0.13}/faster_app/routes/builtins/defaults.py +0 -0
- {faster_app-0.0.12 → faster_app-0.0.13}/faster_app/routes/builtins/swagger.py +0 -0
- {faster_app-0.0.12 → faster_app-0.0.13}/faster_app/routes/discover.py +0 -0
- {faster_app-0.0.12 → faster_app-0.0.13}/faster_app/settings/__init__.py +0 -0
- {faster_app-0.0.12 → faster_app-0.0.13}/faster_app/settings/builtins/settings.py +0 -0
- {faster_app-0.0.12 → faster_app-0.0.13}/faster_app/settings/discover.py +0 -0
- {faster_app-0.0.12 → faster_app-0.0.13}/faster_app/statics/swagger-ui-bundle.min.js +0 -0
- {faster_app-0.0.12 → faster_app-0.0.13}/faster_app/statics/swagger-ui.min.css +0 -0
- {faster_app-0.0.12 → faster_app-0.0.13}/faster_app/templates/apps/demo/commands.py +0 -0
- {faster_app-0.0.12 → faster_app-0.0.13}/faster_app/templates/apps/demo/models.py +0 -0
- {faster_app-0.0.12 → faster_app-0.0.13}/faster_app/templates/apps/demo/routes.py +0 -0
- {faster_app-0.0.12 → faster_app-0.0.13}/faster_app/templates/config/settings.py +0 -0
- {faster_app-0.0.12 → faster_app-0.0.13}/faster_app.egg-info/SOURCES.txt +0 -0
- {faster_app-0.0.12 → faster_app-0.0.13}/faster_app.egg-info/dependency_links.txt +0 -0
- {faster_app-0.0.12 → faster_app-0.0.13}/faster_app.egg-info/entry_points.txt +0 -0
- {faster_app-0.0.12 → faster_app-0.0.13}/faster_app.egg-info/requires.txt +0 -0
- {faster_app-0.0.12 → faster_app-0.0.13}/faster_app.egg-info/top_level.txt +0 -0
- {faster_app-0.0.12 → faster_app-0.0.13}/setup.cfg +0 -0
@@ -0,0 +1,46 @@
|
|
1
|
+
import os
|
2
|
+
import shutil
|
3
|
+
from faster_app.commands.base import CommandBase
|
4
|
+
from rich.console import Console
|
5
|
+
|
6
|
+
console = Console()
|
7
|
+
|
8
|
+
|
9
|
+
class AppCommand(CommandBase):
|
10
|
+
"""App Command"""
|
11
|
+
|
12
|
+
async def env(self):
|
13
|
+
"""Create .env file"""
|
14
|
+
# 拷贝项目根路径下的 .env.example 文件到项目根路径
|
15
|
+
try:
|
16
|
+
shutil.copy(f"{self.BASE_PATH}/.env.example", ".env")
|
17
|
+
console.print("✅ .env created successfully")
|
18
|
+
except FileExistsError:
|
19
|
+
console.print("✅ .env already exists")
|
20
|
+
except Exception as e:
|
21
|
+
console.print(f"❌ .env created failed: {e}")
|
22
|
+
|
23
|
+
async def demo(self):
|
24
|
+
"""create demo app"""
|
25
|
+
# 项目根路径下创建 apps 目录,如果存在则跳过
|
26
|
+
try:
|
27
|
+
if not os.path.exists("apps"):
|
28
|
+
os.makedirs("apps")
|
29
|
+
# 拷贝 templates/apps/demo 目录到 apps 目录
|
30
|
+
shutil.copytree(f"{self.BASE_PATH}/templates/apps/demo", "apps/demo")
|
31
|
+
console.print("✅ apps/demo created successfully")
|
32
|
+
except FileExistsError:
|
33
|
+
console.print("✅ apps/demo already exists")
|
34
|
+
except Exception as e:
|
35
|
+
console.print(f"❌ apps/demo created failed: {e}")
|
36
|
+
|
37
|
+
async def config(self):
|
38
|
+
"""create config"""
|
39
|
+
# 拷贝 templates/config 到 . 目录
|
40
|
+
try:
|
41
|
+
shutil.copytree(f"{self.BASE_PATH}/templates/config", "./config")
|
42
|
+
console.print("✅ config created successfully")
|
43
|
+
except FileExistsError:
|
44
|
+
console.print("✅ config already exists")
|
45
|
+
except Exception as e:
|
46
|
+
console.print(f"❌ config created failed: {e}")
|
@@ -1,29 +0,0 @@
|
|
1
|
-
import os
|
2
|
-
import shutil
|
3
|
-
from faster_app.commands.base import CommandBase
|
4
|
-
from rich.console import Console
|
5
|
-
|
6
|
-
console = Console()
|
7
|
-
|
8
|
-
|
9
|
-
class AppCommand(CommandBase):
|
10
|
-
"""App Command"""
|
11
|
-
|
12
|
-
async def env(self):
|
13
|
-
"""Create .env file"""
|
14
|
-
# 拷贝项目根路径下的 .env.example 文件到项目根路径
|
15
|
-
shutil.copy(f"{self.BASE_PATH}/.env.example", ".env")
|
16
|
-
console.print("✅ .env created successfully")
|
17
|
-
|
18
|
-
async def demo(self):
|
19
|
-
"""create demo app"""
|
20
|
-
# 项目根路径下创建 apps 目录,如果存在则跳过
|
21
|
-
if not os.path.exists("apps"):
|
22
|
-
os.makedirs("apps")
|
23
|
-
# 拷贝 templates/apps/demo 目录到 apps 目录
|
24
|
-
shutil.copytree(f"{self.BASE_PATH}/templates/apps/demo", "apps/demo")
|
25
|
-
|
26
|
-
async def config(self):
|
27
|
-
"""create config"""
|
28
|
-
# 拷贝 templates/config 到 . 目录
|
29
|
-
shutil.copytree(f"{self.BASE_PATH}/templates/config", ".")
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|