speccrew 0.6.59 → 0.6.61
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.
|
@@ -152,6 +152,19 @@ For each platform, generates:
|
|
|
152
152
|
<field name="output" var="generated_json_path"/>
|
|
153
153
|
</block>
|
|
154
154
|
|
|
155
|
+
<!-- Rule: Output JSON Format Validation -->
|
|
156
|
+
<block type="rule" id="R-FORMAT" scope="mandatory" desc="Output JSON format validation">
|
|
157
|
+
<field name="content">
|
|
158
|
+
The generated entry-dirs JSON file MUST strictly follow this structure:
|
|
159
|
+
- Root object MUST contain "modules" field (array type)
|
|
160
|
+
- Root object MUST NOT contain "businessModules", "subModules", or "components" fields
|
|
161
|
+
- Each module in "modules" array MUST have exactly two fields: "name" (string) and "entryDirs" (array of strings)
|
|
162
|
+
- For platforms with hierarchical directory structure (e.g. frontend views/system/user/), flatten into individual modules
|
|
163
|
+
- Module names should use hyphen-separated composite names for sub-modules (e.g. "system-user", "system-role")
|
|
164
|
+
- If the generated JSON does not match this format, you MUST regenerate it before proceeding
|
|
165
|
+
</field>
|
|
166
|
+
</block>
|
|
167
|
+
|
|
155
168
|
<!-- Checkpoint: Persist Generated JSON -->
|
|
156
169
|
<block type="checkpoint" id="CP1" name="entry-dirs-generated" desc="Verify entry-dirs JSON was generated">
|
|
157
170
|
<field name="file" value="${sync_state_bizs_dir}/entry-dirs-${platform.platformId}.json"/>
|
|
@@ -227,6 +240,14 @@ For each platform, generates:
|
|
|
227
240
|
}
|
|
228
241
|
```
|
|
229
242
|
|
|
243
|
+
### Format Constraints
|
|
244
|
+
|
|
245
|
+
- **MUST use `modules` array** — never use `businessModules`, `components`, or any alternative field name
|
|
246
|
+
- **MUST flatten hierarchy** — if a platform has sub-modules (e.g. frontend `system/user`, `system/role`), each sub-module must be a separate top-level module entry in the `modules` array
|
|
247
|
+
- 例如:`system` 有 `user` 和 `role` 子目录 → 生成 `{ "name": "system-user", "entryDirs": ["src/views/system/user"] }` 和 `{ "name": "system-role", "entryDirs": ["src/views/system/role"] }`
|
|
248
|
+
- **Forbidden fields**: `businessModules`, `subModules`, `components`, `hasSubModules` — 这些都不被下游脚本支持
|
|
249
|
+
- **Each module's entryDirs** must point to directories containing actual entry files (e.g. .vue, .py, .java), not parent wrapper directories
|
|
250
|
+
|
|
230
251
|
### Field Definitions
|
|
231
252
|
|
|
232
253
|
- `platformId`: Platform identifier (e.g., `backend-ai`, `web-vue`, `mobile-uniapp`)
|
package/.speccrew/skills/speccrew-knowledge-bizs-init-features/scripts/generate-inventory.js
CHANGED
|
@@ -647,8 +647,24 @@ function main() {
|
|
|
647
647
|
console.error('Error: entryDirsFile missing required field "sourcePath"');
|
|
648
648
|
process.exit(1);
|
|
649
649
|
}
|
|
650
|
+
// Check for common format mistakes
|
|
651
|
+
if (entryDirsData.businessModules && Array.isArray(entryDirsData.businessModules)) {
|
|
652
|
+
console.error('Error: entryDirsFile uses unsupported "businessModules" format.');
|
|
653
|
+
console.error('Expected: { "modules": [ { "name": "...", "entryDirs": ["..."] } ] }');
|
|
654
|
+
console.error('Received: { "businessModules": [...] }');
|
|
655
|
+
console.error('');
|
|
656
|
+
console.error('Fix: The entry-dirs JSON must use a flat "modules" array.');
|
|
657
|
+
console.error('Each module should have "name" (string) and "entryDirs" (array of strings).');
|
|
658
|
+
console.error('Sub-modules must be flattened into top-level entries.');
|
|
659
|
+
console.error('Re-run the identify-entries skill to regenerate with correct format.');
|
|
660
|
+
process.exit(1);
|
|
661
|
+
}
|
|
662
|
+
|
|
650
663
|
if (!entryDirsData.modules || !Array.isArray(entryDirsData.modules)) {
|
|
651
|
-
console.error('Error: entryDirsFile missing required field "modules" array');
|
|
664
|
+
console.error('Error: entryDirsFile missing required field "modules" array.');
|
|
665
|
+
console.error('Expected format: { "platformId": "...", "modules": [ { "name": "...", "entryDirs": ["..."] } ] }');
|
|
666
|
+
const foundKeys = Object.keys(entryDirsData).join(', ');
|
|
667
|
+
console.error(`Found top-level keys: ${foundKeys}`);
|
|
652
668
|
process.exit(1);
|
|
653
669
|
}
|
|
654
670
|
|