@domorium/validator 1.0.0 → 1.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/CHANGELOG.md CHANGED
@@ -2,6 +2,45 @@
2
2
 
3
3
  All notable changes to `@domorium/validator` are documented here.
4
4
 
5
+ ## 1.2.0 - 2026-08-07
6
+
7
+ - Keep the spaces that belong to a value. The lexer treated the delimiter after
8
+ a tag as whitespace to skip, so a `NOTE` whose text began with spaces lost
9
+ them, and `CONC` continuations silently changed the text they rejoined.
10
+ - Report a value that begins with a leading space or ends with a trailing one
11
+ correctly rather than validating a string the document never contained.
12
+ - Name at most ten candidates when a payload is not in its permitted set, and
13
+ count the rest, joining them with `", "`. The full list is every matching
14
+ xref in the document, and interpolating it produced a message tens of
15
+ thousands of characters long with no break opportunity in it — enough to
16
+ stretch an editor's diagnostic tooltip past the edge of the screen.
17
+ - `ASTNode` and `ASTToken` now carry `startOffset` and `endOffset`, and their
18
+ `range` is derived from those on access rather than stored. This is what makes
19
+ a large document affordable: a stored range costs three objects per token, and
20
+ that was most of the syntax tree's memory. `range` is `readonly` as a result —
21
+ code that assigned to it must set the offsets instead, and code in a tight loop
22
+ should read the offsets, because reading `range` allocates.
23
+ - Build the syntax tree straight from the token stream instead of walking a
24
+ Chevrotain parse tree first, and index pointer targets once per document
25
+ rather than scanning every pointer for each one. Validation cost no longer
26
+ grows with records times nodes.
27
+
28
+ ## 1.1.0 - 2026-08-06
29
+
30
+ - Accept application-defined extension tags (`_XXXX`) instead of reporting them
31
+ as unknown. Their subtrees are not validated: an extension's payload and
32
+ permitted substructures are defined by whoever authored it. See
33
+ [ADR-0008](../../docs/adr/0008-extension-tag-validation.md).
34
+ - Read `HEAD.SCHMA` declarations, and report a GEDCOM 7 extension tag that is
35
+ used without one as `VAL008`. GEDCOM 5.5.1 documents, which have no SCHMA
36
+ structure, are unaffected.
37
+ - Report a tag declared twice in `HEAD.SCHMA` as `VAL009`, and validate that
38
+ each declaration is an underscore-prefixed tag followed by an absolute URI.
39
+ - Resolve the declared URI of an extension tag through `getLabel`, and offer
40
+ declared extension tags from `getCompletions`.
41
+ - Stop offering root record tags as completions inside a subtree whose parent
42
+ type cannot be resolved.
43
+
5
44
  ## 1.0.0 - 2026-08-05
6
45
 
7
46
  - First stable release. `GedcomDocument` and the diagnostic shapes it returns are
@@ -1,6 +1,7 @@
1
1
  import type { ASTNode } from "../parser";
2
2
  import type { Position } from "../types/position";
3
3
  import { type GedcomScheme } from "../schemes/schema-types";
4
+ import type { ExtensionContext } from "../validator/extensions";
4
5
  export interface GedcomCompletion {
5
6
  label: string;
6
7
  kind: "tag" | "enum" | "pointer";
@@ -10,6 +11,7 @@ interface CompletionContext {
10
11
  nodes: ASTNode[];
11
12
  pointers: Map<string, ASTNode[]>;
12
13
  scheme: GedcomScheme;
14
+ extensions: ExtensionContext;
13
15
  isGedcom7: boolean;
14
16
  position: Position;
15
17
  lineText: string;
@@ -8,6 +8,7 @@ export declare class GedcomDocument {
8
8
  xRefs: Map<string, ASTToken[]>;
9
9
  private errors;
10
10
  private scheme;
11
+ private extensions;
11
12
  private parseGedcom;
12
13
  createDocument(text: string): GedcomDocument;
13
14
  private validateLevels;