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

View File

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

View File

@ -62,12 +62,8 @@ export class FrontmatterGenerator {
if (enrichment.key_technologies?.length) { if (enrichment.key_technologies?.length) {
frontmatter.key_technologies = enrichment.key_technologies; 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), { const yamlStr = yaml.dump(this.removeNulls(frontmatter), {
indent: 2, indent: 2,