sillyspec 3.17.6 → 3.17.7
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/package.json +1 -1
- package/src/run.js +8 -8
package/package.json
CHANGED
package/src/run.js
CHANGED
|
@@ -1515,7 +1515,7 @@ async function completeStep(pm, progress, stageName, cwd, outputText, inputText
|
|
|
1515
1515
|
const numbered = outputText.match(/^\s*\d+\.\s+(\S+)/gm)
|
|
1516
1516
|
if (numbered) {
|
|
1517
1517
|
projectNames = numbered.map(m => m.replace(/^\s*\d+\.\s+/, '').replace(/[—\-:].*$/, '').trim())
|
|
1518
|
-
if (projectNames.length > 0) _scanProjectListParsed = true
|
|
1518
|
+
if (projectNames.length > 0) { _scanProjectListParsed = true; stageData.scanMeta = stageData.scanMeta || {}; stageData.scanMeta.projectListParsed = true; }
|
|
1519
1519
|
}
|
|
1520
1520
|
// 匹配方式 2: 括号枚举 "子项目frontend/order-service/user-service" 或 "项目: a, b, c"
|
|
1521
1521
|
if (projectNames.length === 0) {
|
|
@@ -1525,7 +1525,7 @@ async function completeStep(pm, progress, stageName, cwd, outputText, inputText
|
|
|
1525
1525
|
.split(/[\/、,,]+/)
|
|
1526
1526
|
.map(s => s.trim())
|
|
1527
1527
|
.filter(Boolean)
|
|
1528
|
-
if (projectNames.length > 0) _scanProjectListParsed = true
|
|
1528
|
+
if (projectNames.length > 0) { _scanProjectListParsed = true; stageData.scanMeta = stageData.scanMeta || {}; stageData.scanMeta.projectListParsed = true; }
|
|
1529
1529
|
}
|
|
1530
1530
|
}
|
|
1531
1531
|
// 匹配方式 3: 结构化 YAML block "scan_projects:\n - id: name"
|
|
@@ -1533,14 +1533,14 @@ async function completeStep(pm, progress, stageName, cwd, outputText, inputText
|
|
|
1533
1533
|
const yamlMatch = outputText.match(/scan_projects:\s*\n((?:\s+-\s+id:\s+\S+\s*\n?)+)/)
|
|
1534
1534
|
if (yamlMatch) {
|
|
1535
1535
|
projectNames = [...yamlMatch[1].matchAll(/-\s+id:\s*(\S+)/g)].map(m => m[1])
|
|
1536
|
-
if (projectNames.length > 0) _scanProjectListParsed = true
|
|
1536
|
+
if (projectNames.length > 0) { _scanProjectListParsed = true; stageData.scanMeta = stageData.scanMeta || {}; stageData.scanMeta.projectListParsed = true; }
|
|
1537
1537
|
}
|
|
1538
1538
|
}
|
|
1539
1539
|
}
|
|
1540
1540
|
if (projectNames.length === 0) {
|
|
1541
1541
|
// 回退:读取所有已注册项目
|
|
1542
1542
|
console.warn('⚠️ 未能从 step 2 输出解析项目列表,回退扫描所有注册项目')
|
|
1543
|
-
_scanProjectListParsed = false
|
|
1543
|
+
_scanProjectListParsed = false; stageData.scanMeta = stageData.scanMeta || {}; stageData.scanMeta.projectListParsed = false;
|
|
1544
1544
|
const projectsDir = join(specBase, 'projects')
|
|
1545
1545
|
if (existsSync(projectsDir)) {
|
|
1546
1546
|
projectNames = readdirSync(projectsDir)
|
|
@@ -1660,7 +1660,7 @@ async function completeStep(pm, progress, stageName, cwd, outputText, inputText
|
|
|
1660
1660
|
// 平台模式:scan 完成后生成 manifest.json + post-check
|
|
1661
1661
|
if (stageName === 'scan' && (platformOpts.specRoot || platformOpts.runtimeRoot)) {
|
|
1662
1662
|
try {
|
|
1663
|
-
_scanManifestWritten = false // 默认失败
|
|
1663
|
+
_scanManifestWritten = false; stageData.scanMeta = stageData.scanMeta || {}; stageData.scanMeta.manifestWritten = false; // 默认失败
|
|
1664
1664
|
const { mkdirSync, writeFileSync } = await import('fs')
|
|
1665
1665
|
const { join } = await import('path')
|
|
1666
1666
|
const { execSync } = await import('child_process')
|
|
@@ -1680,7 +1680,7 @@ async function completeStep(pm, progress, stageName, cwd, outputText, inputText
|
|
|
1680
1680
|
const manifestPath = join(manifestDir, 'manifest.json')
|
|
1681
1681
|
writeFileSync(manifestPath, JSON.stringify(manifest, null, 2) + '\n')
|
|
1682
1682
|
console.log(`📄 manifest.json 已写入: ${manifestPath}`)
|
|
1683
|
-
_scanManifestWritten = true
|
|
1683
|
+
_scanManifestWritten = true; stageData.scanMeta = stageData.scanMeta || {}; stageData.scanMeta.manifestWritten = true;
|
|
1684
1684
|
if (!sourceCommit) {
|
|
1685
1685
|
console.log(`⚠️ source_commit 无法获取(可能非 git 目录),已设为 null`)
|
|
1686
1686
|
}
|
|
@@ -1696,8 +1696,8 @@ async function completeStep(pm, progress, stageName, cwd, outputText, inputText
|
|
|
1696
1696
|
specDir: platformOpts.specRoot,
|
|
1697
1697
|
outputText,
|
|
1698
1698
|
scanMeta: {
|
|
1699
|
-
projectListParsed:
|
|
1700
|
-
manifestWritten:
|
|
1699
|
+
projectListParsed: stageData.scanMeta?.projectListParsed ?? null,
|
|
1700
|
+
manifestWritten: stageData.scanMeta?.manifestWritten ?? null,
|
|
1701
1701
|
},
|
|
1702
1702
|
})
|
|
1703
1703
|
printScanPostCheckResult(postResult)
|