refactor backend module architecture

This commit is contained in:
jxxghp
2026-08-14 15:45:38 +08:00
parent 557cc0e2e3
commit 7b3444c366
716 changed files with 10378 additions and 7709 deletions

View File

@@ -22,7 +22,7 @@ python tests/run.py # 等价于 pytest 全量(参数透
收集任何测试模块、`import app.*` **之前**conftest 完成两件事:
1. **临时库**:把 `CONFIG_DIR` 指向临时目录并 `init_db()` 建表。`app.db` 在导入期即按 `CONFIG_PATH` 连接 `user.db`,所以必须早于首个 `import app.*`;空库会让运行期查表报 `no such table`,故必须建表。
2. **`app.helper.sites` 垫片**该模块由独立仓库动态拉取、CI 无此文件conftest 统一补最小垫片(本地存在真实模块时优先用真实模块)。
2. **`app.infrastructure.sites` 垫片**该模块由独立仓库动态拉取、CI 无此文件conftest 统一补最小垫片(本地存在真实模块时优先用真实模块)。兼容层会把旧插件的 `app.helper.sites` 导入路由到同一模块。
由此推出两条**硬规范**