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:
parent
12193b2398
commit
ed8a568a10
9
dist/generator.js
vendored
9
dist/generator.js
vendored
File diff suppressed because one or more lines are too long
1
package-lock.json
generated
1
package-lock.json
generated
@ -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",
|
||||||
|
|||||||
29
package.json
29
package.json
@ -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"
|
||||||
|
|||||||
@ -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,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user