gedcom-ts 2.0.1 → 2.1.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 +222 -0
- package/README.md +373 -92
- package/dist/commons/Act.d.ts +43 -6
- package/dist/commons/DateAct.d.ts +75 -0
- package/dist/commons/Identificator.enum.d.ts +5 -131
- package/dist/commons/Identifier.enum.d.ts +134 -0
- package/dist/commons/IndiAttribute.d.ts +11 -0
- package/dist/commons/IndiGedcomSubLine.d.ts +6 -0
- package/dist/commons/MultimediaFile.d.ts +13 -2
- package/dist/commons/Note.d.ts +2 -2
- package/dist/commons/Person.d.ts +21 -3
- package/dist/commons/PersonNameVariant.d.ts +21 -0
- package/dist/commons/Place.d.ts +19 -0
- package/dist/commons/gedcomEventTags.d.ts +10 -0
- package/dist/edit/ActEdit.d.ts +29 -0
- package/dist/edit/ActsEdit.d.ts +17 -0
- package/dist/edit/DateActEdit.d.ts +37 -0
- package/dist/edit/NotesEdit.d.ts +14 -0
- package/dist/edit/PersonEdit.d.ts +27 -0
- package/dist/edit/PlaceEdit.d.ts +23 -0
- package/dist/edit/index.d.ts +19 -0
- package/dist/export/GEDCOM.d.ts +33 -7
- package/dist/import/LoadFile.d.ts +14 -0
- package/dist/import/ReadGed.d.ts +48 -0
- package/dist/import/SplitedInformations.d.ts +29 -3
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +25 -9
- package/dist/index.mjs +1 -1
- package/dist/utils/gedcom/actExtraction.d.ts +8 -0
- package/dist/utils/gedcom/datasetVersion.d.ts +7 -0
- package/dist/utils/gedcom/extractIndiNamesAndAttributes.d.ts +4 -0
- package/dist/utils/gedcom/labelKeyedRecords.d.ts +13 -0
- package/dist/utils/gedcom/mediaFormFromUri.d.ts +2 -0
- package/dist/utils/gedcom/parseStandaloneObje.d.ts +9 -0
- package/dist/utils/gedcom/personName.d.ts +13 -0
- package/dist/utils/gedcom/pointers.d.ts +19 -0
- package/dist/utils/multimedia/collectRelativeMediaPaths.d.ts +2 -0
- package/dist/version.d.ts +6 -0
- package/package.json +4 -3
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes of gedcom-ts
|
|
4
|
+
|
|
5
|
+
## [Unreleased]
|
|
6
|
+
|
|
7
|
+
## [2.1.0] - 2026-05-13
|
|
8
|
+
|
|
9
|
+
### Highlights
|
|
10
|
+
|
|
11
|
+
- Major GEDCOM 7 coverage push: round-trip preservation (`preservedTopLevelRecords`, label-keyed FAM / NOTE xrefs, level-0 `OBJE`), richer `HEAD` export options, full P1.4 dates and places (INT/EST/CAL, `3 PHRASE`, `3 TIME`, `2 SDATE`, `2 PHRASE` event-level, ISO date input, verbatim fallback).
|
|
12
|
+
- New **fluent edit layer** (`editPerson`, `editAct`, `editActs`, `editDateAct`, `editPlace`, `editNotes` + `*Edit` classes) for in-place model mutations with chainable APIs.
|
|
13
|
+
- **README fully rewritten** with a complete public-API reference and a link to the live graphical demo at **[https://gedcomts.jaunet.me](https://gedcomts.jaunet.me)**.
|
|
14
|
+
|
|
15
|
+
### Added
|
|
16
|
+
|
|
17
|
+
#### Import
|
|
18
|
+
|
|
19
|
+
- `ReadGed.preservedTopLevelRecords`: top-level `0 …` GEDCOM records that are not loaded into the typed model (e.g. `REPO`, `SOUR`, `SUBM`, and undecodable `OBJE`) are preserved in file order. `0 TRLR` is not stored.
|
|
20
|
+
- **FAM / `@N` xrefs non numériques** : enregistrements `0 @F…@ FAM` et `0 @N…@ NOTE|SNOTE` indexés par libellé puis mappés vers des ids internes numériques (comme pour les `INDI` textuels) ; `FAMS` / `FAMC` / notes résolus via tables de pointeurs.
|
|
21
|
+
- **OBJE de niveau 0** : si le bloc contient un `FILE` exploitable, il est retiré de `preservedTopLevelRecords` et sert à hydrater `MultimediaFile.sourceUri` pour les pointeurs `1 OBJE` / `2 OBJE` (`PersonGedcomImportOptions` / résolution interne dans `ReadGed`).
|
|
22
|
+
- **Import actes (FAM)** : `1 HUSB` / `1 WIFE` avec pointeur `@I{n}@` **ou** xref textuelle `@Libellé@` (même clé que `0 @Libellé@ INDI`) alimentent les participants des actes extraits (`extractActEntriesAndIndis`).
|
|
23
|
+
- `ReadGed.resolveIndividualPointer(raw)`, `ReadGed.getChildrenForParent(parent)`, `ReadGed.getChildrenOfFamily(familyId)` exposés publiquement pour naviguer le graphe importé.
|
|
24
|
+
|
|
25
|
+
#### Export
|
|
26
|
+
|
|
27
|
+
- `GedcomExportOptions` enrichies : `extraTopLevelRecords` (round-trip), `headLanguageTag`, **`headCopyright`** (`1 COPR`), **`headDestination`** (`1 DEST`), **`headSchemaTagDefs`** (`HEAD`.`SCHMA` / `2 TAG …`).
|
|
28
|
+
- `HEAD`.`SOUR` structuré : émission de **`2 VERS`** + **`2 NAME`** sous `SOUR`, en plus du `CHAR` / `LANG` standard.
|
|
29
|
+
- Constante **`GEDCOM_LIBRARY_VERSION`** (`src/version.ts`, alignée sur `package.json` via test) utilisée pour `2 VERS` à l’export.
|
|
30
|
+
- **FAM** : sexes U / X / indéfini sont exportés en **`1 HUSB`** (placeholder GEDCOM moins biaisé que `WIFE`).
|
|
31
|
+
|
|
32
|
+
#### Domain model — dates, places, events (P1.4)
|
|
33
|
+
|
|
34
|
+
- **`DateAct`** :
|
|
35
|
+
- qualificateurs **INT**, **EST**, **CAL** ;
|
|
36
|
+
- phrase finale `(...)` et **`datePhrase`** ;
|
|
37
|
+
- import **`3 PHRASE`** sous `DATE` ;
|
|
38
|
+
- **`3 TIME`** sous `DATE` / **`SDATE`** (`dateTime`) ;
|
|
39
|
+
- entrée date **`YYYY-MM-DD`** / **`YYYY-MM`** ;
|
|
40
|
+
- **`verbatimDatePayload`** pour charges non typées (URI, texte hors parseur) ;
|
|
41
|
+
- tolérance `(...)` sur les bornes d’intervalles (`parseCoreDateValue`) ;
|
|
42
|
+
- format mois/année slash strict **`d{1,2}/d{2,4}`** uniquement (évite les faux positifs sur URL).
|
|
43
|
+
- **`Act`** :
|
|
44
|
+
- **`2 SDATE`** (+ sous-lignes) sur `sdateAct` ;
|
|
45
|
+
- **`2 PHRASE`** niveau événement (`eventPhrases`) ;
|
|
46
|
+
- **`preservedSubrecordPrefix`** / **`preservedSubrecordSuffix`** pour sous-lignes non modélisées (`HUSB`/`AGE`/`4 PHRASE`, `3 DATE` sous `STAT`, …) avec ré-export ;
|
|
47
|
+
- tri des actes : **`DATE`** sinon **`SDATE`** valide.
|
|
48
|
+
- **`Place`** : **`placPhrase`** et import **`3 PHRASE`** direct sous `PLAC` ; export **`3 PHRASE`** pour date et lieu quand présents ; export **`3 TIME`** / blocs **`SDATE`** / **`2 PHRASE`** événement.
|
|
49
|
+
|
|
50
|
+
#### Fluent edit layer
|
|
51
|
+
|
|
52
|
+
- Nouveau module `src/edit/` réexporté depuis la racine du paquet :
|
|
53
|
+
- **`editPerson`** / `PersonEdit` (identité, liens `FAMC` / `FAMS`, name variants, attributes, accès chaîné à `acts()` / `notes()`) ;
|
|
54
|
+
- **`editActs`** / `ActsEdit` (add, replaceAt, removeAt, clear, sortByDate, at) ;
|
|
55
|
+
- **`editAct`** / `ActEdit` (type, indis, date, sdate, place, EVEN, phrases, preserved prefix/suffix) ;
|
|
56
|
+
- **`editDateAct`** / `DateActEdit` (clear, applyGedcomPayload, setExactDate, setQualified, setBetween, setFromTo, setTime, setDatePhrase, setVerbatimPayload) ;
|
|
57
|
+
- **`editPlace`** / `PlaceEdit` (city/county/state/country, GEDCOM 7 payload, placPhrase, coordinates) ;
|
|
58
|
+
- **`editNotes`** / `NotesEdit` (add, replaceAt, removeAt, clear) ;
|
|
59
|
+
- chaînage cohérent (`this`) sur le modèle existant, mutation in-place.
|
|
60
|
+
|
|
61
|
+
#### Public API surface
|
|
62
|
+
|
|
63
|
+
- Types exportés : `PersonGedcomImportOptions`, `GedcomExportOptions`, `TypeDateActSimpleQualifier`, `Gedcom7EventTag`, `IndiGedcomSubLine`, `GedcomDatasetVersion`.
|
|
64
|
+
- Classes / valeurs réexportées depuis l’index : `PersonNameVariant`, `PersonNameTranslation`, `IndiAttribute`, `ActConstructionOptions`, `GEDCOM_7_ALL_EVENT_TAGS`, `GEDCOM_7_EVENT_SORT_ORDER`, `GEDCOM_7_EVENT_TAG_SET`, `selectPrimaryNameVariant`, `extractPersonNameVariants`, `extractIndiAttributes`, `createEmptyReadGed`, `IMPORT_ERR_ZIP_GED_UNREADABLE`, **`GEDCOM_LIBRARY_VERSION`**.
|
|
65
|
+
|
|
66
|
+
#### Tests
|
|
67
|
+
|
|
68
|
+
- **Golden export** : fixture `tests/fixtures/golden-in/marriage-marr-roundtrip.ged` + fichiers attendus `tests/fixtures/golden-out/*.golden.txt` ; `tests/import/goldenMarrExport.spec.ts` verrouille le bloc `1 MARR` exporté (fixture minimale + extrait `maximal70` pour `@I1@`) et l’idempotence import → export → import.
|
|
69
|
+
- Non-régression `ReadGed.groupPartners()` appelée plusieurs fois (les enfants et conjoints ne sont plus dupliqués).
|
|
70
|
+
|
|
71
|
+
#### Documentation
|
|
72
|
+
|
|
73
|
+
- **README intégralement réécrit** : référence complète de l’API publique (un sous-titre par export de `src/index.ts`), tables synthétiques pour `ReadGed`, `GedcomExportOptions` et la couche `*Edit`, exemples mis à jour pour chaque type / classe / fonction exposés.
|
|
74
|
+
- Mention en tête du README du **site de démo graphique** : **[https://gedcomts.jaunet.me](https://gedcomts.jaunet.me)**.
|
|
75
|
+
|
|
76
|
+
### Changed
|
|
77
|
+
|
|
78
|
+
- Export `FAM` : sexe inconnu / non binaire / absent (`U`, `X`, `undefined`) émet **`1 HUSB`** au lieu de **`1 WIFE`** pour le rôle conjoint (placeholder GEDCOM moins biaisé).
|
|
79
|
+
|
|
80
|
+
### Fixed
|
|
81
|
+
|
|
82
|
+
- Export GEDCOM : terminaison correcte `0 TRLR` avec saut de ligne (au lieu du seul tag `TRLR`).
|
|
83
|
+
- **`ReadGed.groupPartners()`** : les cartes `partnersMap` et `childsMap` sont vidées avant reconstruction, afin que des rappels successifs (après édition des liens en mémoire) ne dupliquent plus conjoints ni enfants.
|
|
84
|
+
|
|
85
|
+
## [2.0.4] - 2026-05-11
|
|
86
|
+
|
|
87
|
+
### Added
|
|
88
|
+
|
|
89
|
+
- GEDCOM 7–oriented export: default `SUBM` pointer in `HEAD` and a minimal `@U1@ SUBM` record before `TRLR`.
|
|
90
|
+
- `Place` supports structured locality fields (`county`, `state`, `country`) and comma-separated `PLAC` payloads aligned with the default `HEAD`.`PLAC`.`FORM`.
|
|
91
|
+
- Event and person media: `FILE` with `https?://` URIs without a local `File`; optional `OBJE @O{n}@` pointers with generated `0 @O{n}@ OBJE` records when `MultimediaFile.sourceUri` and `objeXrefId` are set.
|
|
92
|
+
- Import of `2 OBJE @O{n}@` under individual events (same model as level-1 `OBJE` on `INDI`).
|
|
93
|
+
- `guessMediaFormFromUri()` exported from the package entrypoint (MIME guess for `OBJE`.`FILE`.`FORM`).
|
|
94
|
+
- `resolveDatasetVersion` / `GedcomDatasetVersion` and GEDCOM 7 event tag constants (`GEDCOM_7_ALL_EVENT_TAGS`, etc.) on the public API.
|
|
95
|
+
- Tests: `gedcom7Export`, `mediaFormFromUri`, `datasetVersion`, import smoke test against the gedcom.io `maximal70.ged` sample (file added to the repo for CI).
|
|
96
|
+
|
|
97
|
+
## [2.0.2] - 2026-05-11
|
|
98
|
+
|
|
99
|
+
### Fixed
|
|
100
|
+
|
|
101
|
+
- Sorting of undated acts now follows the expected genealogical order:
|
|
102
|
+
- `BIRT`, `CHR`, `MARR`, `DIV`, `DEAT`, `BURI`
|
|
103
|
+
- Undated/invalid dates are now handled consistently during sorting to avoid `BURI` appearing first.
|
|
104
|
+
- Month comparison now treats unknown months as later than known months for stable ordering.
|
|
105
|
+
- Added non-regression tests for invalid dates and undated act type ordering.
|
|
106
|
+
|
|
107
|
+
## [2.0.1] - 2026-05-06
|
|
108
|
+
|
|
109
|
+
### Changed
|
|
110
|
+
|
|
111
|
+
- Removed `file-saver` dependency.
|
|
112
|
+
|
|
113
|
+
## [2.0.0] - 2026-05-05
|
|
114
|
+
|
|
115
|
+
### Highlights
|
|
116
|
+
|
|
117
|
+
- Major modernization of GEDCOM import/export and typed genealogy models.
|
|
118
|
+
- Better media lifecycle for acts and persons, including ZIP path reliability.
|
|
119
|
+
- New build and quality toolchain (esbuild, ESLint, Vitest).
|
|
120
|
+
- Fully rewritten technical documentation and improved package metadata.
|
|
121
|
+
|
|
122
|
+
### Added
|
|
123
|
+
|
|
124
|
+
- New domain models and helpers:
|
|
125
|
+
- `Person` model replacing previous `People` flow
|
|
126
|
+
- `MultimediaFile` / `MultimediaFiles`
|
|
127
|
+
- `Note` / `Notes`
|
|
128
|
+
- `ActsByYear` / `EventsByYears`
|
|
129
|
+
- GED helpers (`parseGedcomLine`, note formatting, media path utilities, Sosa and INDI helpers)
|
|
130
|
+
- New import entrypoint for GED and ZIP: `importGedFile`.
|
|
131
|
+
- ZIP export support with media path strategy for acts:
|
|
132
|
+
- single INDI: `INDI/TYPE/file`
|
|
133
|
+
- multi-INDI: `media/events/indi1-indi2/TYPE/file`
|
|
134
|
+
- Dedicated loader/parser components:
|
|
135
|
+
- `LoadFile`
|
|
136
|
+
- `SplitedInformations`
|
|
137
|
+
- `LICENSE` file added and package license reference aligned (`SEE LICENSE IN LICENSE`).
|
|
138
|
+
- New test suites for core domains and export behavior:
|
|
139
|
+
- `tests/commons/Act.spec.ts`
|
|
140
|
+
- `tests/commons/Person.spec.ts`
|
|
141
|
+
- `tests/export/GEDCOM.spec.ts`
|
|
142
|
+
- `tests/utils/nextAvailableRelativeMediaPath.spec.ts`
|
|
143
|
+
|
|
144
|
+
### Changed
|
|
145
|
+
|
|
146
|
+
- Full build migration to esbuild (`build.js`) and webpack removal.
|
|
147
|
+
- Test stack migrated from Jest to Vitest (`vitest.config.ts`) with `jsdom`.
|
|
148
|
+
- Build output now minified (esbuild minification + tree-shaking, ES2020 target).
|
|
149
|
+
- Obfuscation pipeline introduced with a moderated profile compatible with modern front-end apps.
|
|
150
|
+
- ZIP generation now uses `DEFLATE` compression level `9`.
|
|
151
|
+
- README rewritten with dedicated sections:
|
|
152
|
+
- Import
|
|
153
|
+
- Utilisation
|
|
154
|
+
- Export
|
|
155
|
+
- public API examples for all exports from `src/index.ts`
|
|
156
|
+
- Package metadata improved (`description`, `keywords`) for npm discoverability.
|
|
157
|
+
- CI/config/tooling updates (`.gitlab-ci.yml`, `.npmignore`, `.gitignore`, `tsconfig.json`, eslint config).
|
|
158
|
+
|
|
159
|
+
### Fixed
|
|
160
|
+
|
|
161
|
+
- ZIP export no longer misses act media directories in edge cases.
|
|
162
|
+
- Fallback media path handling fixed to prevent `undefined/...` directories.
|
|
163
|
+
- GED `FILE` lines are now consistent with real ZIP archive paths.
|
|
164
|
+
- Import robustness improved:
|
|
165
|
+
- fallback to `file.text()` when `File.stream()` is unavailable
|
|
166
|
+
- more reliable GED record block parsing (`0 ...` headers preserved and detected)
|
|
167
|
+
- Multiple reliability fixes around acts, notes, places and media handling.
|
|
168
|
+
|
|
169
|
+
## [1.0.9] - 2023-06-16
|
|
170
|
+
|
|
171
|
+
### Added
|
|
172
|
+
|
|
173
|
+
- support multiple FAMS
|
|
174
|
+
|
|
175
|
+
## [1.0.8] - 2023-06-15
|
|
176
|
+
|
|
177
|
+
### Added
|
|
178
|
+
|
|
179
|
+
- all right reserved - proprietary code explicit in licence package
|
|
180
|
+
|
|
181
|
+
## [1.0.7] - 2023-06-15
|
|
182
|
+
|
|
183
|
+
### Added
|
|
184
|
+
|
|
185
|
+
- FAMS and FAMC are exported
|
|
186
|
+
|
|
187
|
+
## [1.0.6] - 2023-06-15
|
|
188
|
+
|
|
189
|
+
### Added
|
|
190
|
+
|
|
191
|
+
- export birth and death date and place
|
|
192
|
+
|
|
193
|
+
## [1.0.5] - 2023-06-10
|
|
194
|
+
|
|
195
|
+
### Added
|
|
196
|
+
|
|
197
|
+
- act birth and death
|
|
198
|
+
|
|
199
|
+
## [1.0.4] - 2020-03-10
|
|
200
|
+
|
|
201
|
+
### Added
|
|
202
|
+
|
|
203
|
+
- read FAMS (code for two parents) and FAMC (code for childs). It's same code between them.
|
|
204
|
+
- read Sex with two possibilities: M or F
|
|
205
|
+
- group partnersMap, it's a map for all parents
|
|
206
|
+
- jest / test in Person / runner
|
|
207
|
+
- createDirectAncestries
|
|
208
|
+
|
|
209
|
+
|
|
210
|
+
## 1.0.3 - 2019-10-01
|
|
211
|
+
|
|
212
|
+
### Added
|
|
213
|
+
|
|
214
|
+
- add import gedcom file and return a JSON data model of an array of Person. It just extract names and firstnames
|
|
215
|
+
|
|
216
|
+
## 1.0.2-alpha - 2019-09-01
|
|
217
|
+
|
|
218
|
+
### Added
|
|
219
|
+
|
|
220
|
+
- export for birth and death in gedcom
|
|
221
|
+
- All identificators can be used for a developper. It's an enum of properties used for all gedcom
|
|
222
|
+
- City is removed and replaced by Place. Place gets more informations
|