thevoidforge 21.0.6 → 21.0.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.
|
@@ -3,12 +3,15 @@
|
|
|
3
3
|
* Handles the simple key: value format used in PRD frontmatter blocks.
|
|
4
4
|
*/
|
|
5
5
|
export function parseFrontmatter(content) {
|
|
6
|
-
//
|
|
6
|
+
// Try ```yaml ... ``` block first (markdown code fence)
|
|
7
7
|
const yamlBlockMatch = content.match(/```yaml\s*\n([\s\S]*?)```/);
|
|
8
|
-
|
|
8
|
+
// Then try --- ... --- block (standard YAML frontmatter)
|
|
9
|
+
const dashBlockMatch = !yamlBlockMatch ? content.match(/^---\s*\n([\s\S]*?)\n---/) : null;
|
|
10
|
+
const match = yamlBlockMatch ?? dashBlockMatch;
|
|
11
|
+
if (!match) {
|
|
9
12
|
return { frontmatter: {}, body: content };
|
|
10
13
|
}
|
|
11
|
-
const yamlStr =
|
|
14
|
+
const yamlStr = match[1];
|
|
12
15
|
const frontmatter = {};
|
|
13
16
|
for (const line of yamlStr.split('\n')) {
|
|
14
17
|
const trimmed = line.trim();
|
|
@@ -188,7 +188,7 @@
|
|
|
188
188
|
|
|
189
189
|
<div class="field">
|
|
190
190
|
<label for="prd-paste">Your PRD</label>
|
|
191
|
-
<textarea id="prd-paste" rows="16" placeholder="Paste your PRD here.
|
|
191
|
+
<textarea id="prd-paste" rows="16" placeholder="Paste your PRD here. Start with YAML frontmatter: --- name: My Project type: full-stack framework: next.js database: postgres deploy: vps --- # My Project Description and requirements..."></textarea>
|
|
192
192
|
</div>
|
|
193
193
|
<button class="btn btn-secondary" id="validate-prd" type="button">Validate Frontmatter</button>
|
|
194
194
|
<div class="status-row" id="prd-status" role="status" aria-live="polite"></div>
|