sdd-flow-kit 1.0.4 → 1.0.5
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.
package/dist/steps/startFlow.js
CHANGED
|
@@ -79,7 +79,7 @@ async function startFlowScaffold(options) {
|
|
|
79
79
|
"",
|
|
80
80
|
`本次 runId: \`${runId}\``,
|
|
81
81
|
"",
|
|
82
|
-
"## Step 1:获取需求文档(
|
|
82
|
+
"## Step 1:获取需求文档(docs/<project>-doc-skill)",
|
|
83
83
|
"请打开 `01-获取需求文档指引.md`,并使用你的 AI 工具执行相应动作,把 PRD/接口文档回填到 `source/`。",
|
|
84
84
|
"",
|
|
85
85
|
"## Step 2:执行 SDD 循环并生成 01/02/03 文件",
|
package/package.json
CHANGED
|
@@ -39,6 +39,25 @@ def env(name: str, default: str | None = None) -> str:
|
|
|
39
39
|
return str(v)
|
|
40
40
|
|
|
41
41
|
|
|
42
|
+
def load_env_file(file_path: Path) -> None:
|
|
43
|
+
"""轻量加载 .env 文件(不依赖 python-dotenv)。"""
|
|
44
|
+
if not file_path.exists() or not file_path.is_file():
|
|
45
|
+
return
|
|
46
|
+
try:
|
|
47
|
+
for raw in file_path.read_text(encoding="utf-8").splitlines():
|
|
48
|
+
line = raw.strip()
|
|
49
|
+
if not line or line.startswith("#") or "=" not in line:
|
|
50
|
+
continue
|
|
51
|
+
key, value = line.split("=", 1)
|
|
52
|
+
key = key.strip()
|
|
53
|
+
value = value.strip().strip('"').strip("'")
|
|
54
|
+
if key and key not in os.environ:
|
|
55
|
+
os.environ[key] = value
|
|
56
|
+
except Exception:
|
|
57
|
+
# 失败不阻断,继续走显式环境变量
|
|
58
|
+
pass
|
|
59
|
+
|
|
60
|
+
|
|
42
61
|
def normalize_version(raw: str) -> str:
|
|
43
62
|
"""将 1.2.3 / V1.2.3 / XXX-V1.2.3 / XXX_V1.2.3 统一为 1.2.3"""
|
|
44
63
|
v = raw.strip()
|
|
@@ -171,6 +190,11 @@ def main():
|
|
|
171
190
|
print(" 用法: python3 confluence-doc.py <版本号>")
|
|
172
191
|
sys.exit(1)
|
|
173
192
|
|
|
193
|
+
# 自动尝试从项目常见 env 文件加载配置,降低手工配置成本
|
|
194
|
+
repo_root = Path(__file__).resolve().parents[2]
|
|
195
|
+
for env_name in [".env.pre", ".env", ".env.local", ".env.development", ".env.test"]:
|
|
196
|
+
load_env_file(repo_root / env_name)
|
|
197
|
+
|
|
174
198
|
base_url = env("CONFLUENCE_BASE_URL")
|
|
175
199
|
search_url = env("CONFLUENCE_SEARCH_URL", base_url.rstrip("/") + "/dosearchsite.action?includeArchivedSpaces=false")
|
|
176
200
|
username = env("CONFLUENCE_USERNAME")
|
|
@@ -52,4 +52,5 @@ python3 confluence-doc.py {{PRODUCT_PREFIX}}_V1.2.3
|
|
|
52
52
|
- 依赖 Playwright:`pip install playwright && playwright install chromium`
|
|
53
53
|
- 脚本:`docs/{{SKILL_DIR}}/confluence-doc.py`
|
|
54
54
|
- 为安全起见,脚本不包含默认账号密码,请用环境变量注入
|
|
55
|
+
- 脚本会自动尝试读取仓库根目录的 `.env.pre` / `.env` / `.env.local`(若其中存在 `CONFLUENCE_*` 配置可直接复用)
|
|
55
56
|
|