mdboard 2.1.6 → 2.2.0

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mdboard",
3
- "version": "2.1.6",
3
+ "version": "2.2.0",
4
4
  "description": "Git-based project management dashboard. Reads markdown files with YAML frontmatter and serves a visual kanban board, table, milestones, and metrics views.",
5
5
  "main": "./src/server/server.js",
6
6
  "bin": {
@@ -438,6 +438,9 @@ function buildFrontmatter(cfg, type, id, data) {
438
438
  fm[name] = data[name];
439
439
  } else if (def.default !== undefined) {
440
440
  fm[name] = def.default;
441
+ } else {
442
+ // Include all defined fields with empty values so the schema is always complete
443
+ fm[name] = emptyValueForType(def.type);
441
444
  }
442
445
  }
443
446
 
@@ -445,6 +448,16 @@ function buildFrontmatter(cfg, type, id, data) {
445
448
  return fm;
446
449
  }
447
450
 
451
+ /**
452
+ * Return an appropriate empty value for a field type.
453
+ */
454
+ function emptyValueForType(type) {
455
+ if (type === 'list') return [];
456
+ if (type === 'number') return null;
457
+ if (type === 'ref') return null;
458
+ return '';
459
+ }
460
+
448
461
  /**
449
462
  * Update an entity's markdown file.
450
463
  *