@jasonbelmonti/markdown-engine 3.4.0 → 3.5.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.
@@ -343,6 +343,9 @@ interface DeclarativeAssertion {
343
343
  required?: true;
344
344
  valueType?: "string" | "number" | "boolean" | "array" | "object" | "null";
345
345
  nonEmpty?: true;
346
+ equals?: string;
347
+ nonBlank?: true;
348
+ forbidden?: true;
346
349
  }[];
347
350
  };
348
351
  text?: {
@@ -464,12 +467,17 @@ selector because frontmatter is document metadata. `presence` is optional and
464
467
  must be exactly `"required"` or `"forbidden"` when provided. `fields` is an
465
468
  optional non-empty array of field constraints. Each field constraint has a
466
469
  required non-empty `field` name and must include at least one effective
467
- constraint: `required: true`, `valueType`, or `nonEmpty: true`. Field names
468
- within one `frontmatterShape.fields` array must be unique. `valueType` must be
470
+ constraint: `required: true`, `valueType`, `nonEmpty: true`, `equals`,
471
+ `nonBlank: true`, or `forbidden: true`. Field names within one
472
+ `frontmatterShape.fields` array must be unique. `valueType` must be
469
473
  one of `"string"`, `"number"`, `"boolean"`, `"array"`, `"object"`, or `"null"`.
470
- `nonEmpty: true` is a string predicate; when it is combined with `valueType`,
471
- `valueType` must be `"string"`. `presence: "forbidden"` cannot be combined with
472
- `fields`.
474
+ `nonEmpty: true`, `equals`, and `nonBlank: true` are string predicates; when
475
+ any is combined with `valueType`, `valueType` must be `"string"`. `equals`
476
+ accepts any string, including the empty string, and compares it exactly.
477
+ `nonBlank: true` requires a string whose JavaScript `trim()` result is non-empty.
478
+ `forbidden: true` requires the named field to be absent and cannot be combined
479
+ with `required`, `valueType`, `nonEmpty`, `equals`, or `nonBlank`.
480
+ `presence: "forbidden"` cannot be combined with `fields`.
473
481
 
474
482
  Runtime evaluation treats frontmatter as present when
475
483
  `document.frontmatter !== undefined`. `presence: "required"` fails absent
@@ -486,6 +494,16 @@ requires a present field value to be a non-empty string and emits
486
494
  `profile.validation.frontmatterFieldEmpty` when that predicate fails. When
487
495
  `valueType: "string"` and `nonEmpty: true` are combined, a non-string value
488
496
  emits the type-mismatch diagnostic without a duplicate empty-string diagnostic.
497
+ `equals` compares present strings exactly without coercion and emits
498
+ `profile.validation.frontmatterFieldValueMismatch` on mismatch. `nonBlank: true`
499
+ uses JavaScript `trim()` without coercion and emits
500
+ `profile.validation.frontmatterFieldBlank` when its field is not a non-blank
501
+ string. `forbidden: true` emits `profile.validation.frontmatterFieldForbidden`
502
+ when the named field is present, regardless of value. When `valueType: "string"`
503
+ is combined with `equals` or `nonBlank`, a non-string value emits only
504
+ `profile.validation.frontmatterFieldTypeMismatch` rather than an additional
505
+ string-predicate diagnostic. Diagnostic messages do not include frontmatter
506
+ values.
489
507
 
490
508
  `text` must include `contains` or a non-empty `excludes` array.
491
509
  `textOccurrenceCount.count` is a finite number and counts non-overlapping
@@ -558,9 +576,12 @@ an unproven pass.
558
576
  | `profile.validation.assertionFailed` | Rule severity | A supported assertion evaluates and fails without a more specific diagnostic code, including selector-count bound failures, missing table columns, exact table-header mismatches, exact occurrence-count mismatches, text-length bound failures, and text-format `isoDate` failures. |
559
577
  | `profile.validation.duplicateId` | Rule severity | An `ids.unique` assertion finds repeated IDs. |
560
578
  | `profile.validation.frontmatterForbidden` | Rule severity | A `frontmatterShape` assertion with `presence: "forbidden"` finds present frontmatter. |
579
+ | `profile.validation.frontmatterFieldBlank` | Rule severity | A frontmatter field configured with `nonBlank: true` is not a non-blank string. |
561
580
  | `profile.validation.frontmatterFieldEmpty` | Rule severity | A frontmatter field configured with `nonEmpty: true` is not a non-empty string. |
581
+ | `profile.validation.frontmatterFieldForbidden` | Rule severity | A frontmatter field configured with `forbidden: true` is present. |
562
582
  | `profile.validation.frontmatterFieldMissing` | Rule severity | A required frontmatter field is absent. |
563
583
  | `profile.validation.frontmatterFieldTypeMismatch` | Rule severity | A frontmatter field value does not match the configured `frontmatterShape.fields[].valueType` without coercion. |
584
+ | `profile.validation.frontmatterFieldValueMismatch` | Rule severity | A frontmatter field configured with `equals` does not exactly match the configured string without coercion. |
564
585
  | `profile.validation.frontmatterMissing` | Rule severity | A `frontmatterShape` assertion with `presence: "required"` finds absent frontmatter. |
565
586
  | `profile.validation.idCountTooHigh` | Rule severity | Unique ID count after filtering is higher than `ids.maxCount`. |
566
587
  | `profile.validation.idCountTooLow` | Rule severity | Unique ID count after filtering is lower than `ids.minCount`. |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jasonbelmonti/markdown-engine",
3
- "version": "3.4.0",
3
+ "version": "3.5.0",
4
4
  "description": "Deterministic Markdown parsing and validation engine package.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -1,9 +1,9 @@
1
1
  #!/usr/bin/env sh
2
2
  set -eu
3
3
 
4
- VERSION="3.4.0"
4
+ VERSION="3.5.0"
5
5
  PACKAGE="@jasonbelmonti/markdown-engine"
6
- EXPECTED_SHA256="41225925904c038c05392b19e7203bd723d1cbaaa47b48d96648fb0275d3d05b"
6
+ EXPECTED_SHA256="4a4e9ae7d9ff4797c96a7483555bcba7cbec5852d330c6c50dc0ef8fb2e5d933"
7
7
  DEFAULT_DATA_HOME="${XDG_DATA_HOME:-$HOME/.local/share}"
8
8
  MARKDOWN_ENGINE_HOME="${MARKDOWN_ENGINE_HOME:-$DEFAULT_DATA_HOME/markdown-engine}"
9
9
  MARKDOWN_ENGINE_BIN_DIR="${MARKDOWN_ENGINE_BIN_DIR:-$HOME/.local/bin}"