Remove empty placeholder fields when no LLM enrichment provided

- Removed automatic addition of empty summary, tags, category fields
- Only adds enrichment fields when actual enrichment data is provided
- Added @types/js-yaml dev dependency
This commit is contained in:
FSSCoding 2025-11-20 10:11:13 +11:00
parent 12193b2398
commit ed8a568a10
4 changed files with 27 additions and 18 deletions

9
dist/generator.js vendored

File diff suppressed because one or more lines are too long

1
package-lock.json generated
View File

@ -54,6 +54,7 @@
"integrity": "sha512-e7jT4DxYvIDLk1ZHmU/m/mB19rex9sv0c2ftBtjSBv+kVM/902eh0fINUzD7UwLLNR+jU585GxUJ8/EBfAM5fw==",
"dev": true,
"license": "MIT",
"peer": true,
"dependencies": {
"@babel/code-frame": "^7.27.1",
"@babel/generator": "^7.28.5",

View File

@ -4,7 +4,9 @@
"description": "BOBAI Markdown Standard v1.1 frontmatter generator",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"files": ["dist"],
"files": [
"dist"
],
"scripts": {
"build": "tsc",
"clean": "rm -rf dist",
@ -13,7 +15,13 @@
"test:coverage": "jest --coverage",
"prepublishOnly": "npm run clean && npm run build"
},
"keywords": ["bobai", "frontmatter", "markdown", "yaml", "metadata"],
"keywords": [
"bobai",
"frontmatter",
"markdown",
"yaml",
"metadata"
],
"author": "BobAI",
"license": "MIT",
"dependencies": {
@ -30,11 +38,20 @@
"jest": {
"preset": "ts-jest",
"testEnvironment": "node",
"roots": ["<rootDir>/tests"],
"testMatch": ["**/*.test.ts"],
"collectCoverageFrom": ["src/**/*.ts"],
"roots": [
"<rootDir>/tests"
],
"testMatch": [
"**/*.test.ts"
],
"collectCoverageFrom": [
"src/**/*.ts"
],
"coverageDirectory": "coverage",
"coverageReporters": ["text", "lcov"]
"coverageReporters": [
"text",
"lcov"
]
},
"engines": {
"node": ">=18.0.0"

View File

@ -62,12 +62,8 @@ export class FrontmatterGenerator {
if (enrichment.key_technologies?.length) {
frontmatter.key_technologies = enrichment.key_technologies;
}
} else {
// Placeholders for LLM enrichment
frontmatter.summary = '';
frontmatter.tags = [];
frontmatter.category = '';
}
// No enrichment provided - don't add empty placeholder fields
const yamlStr = yaml.dump(this.removeNulls(frontmatter), {
indent: 2,