Add document data model and validation

Define the sections/records/items schema with secret-flagged fields and
a validator with tests. build.js bundles model.js. The PDF-derived seed
lives in the gitignored data/ directory.

Closes #3

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-09 08:04:03 -05:00
parent 9fa6096a6c
commit 2c713f3a9b
3 changed files with 167 additions and 1 deletions

View File

@@ -10,7 +10,7 @@ const read = (p) => readFileSync(join(root, 'src', p), 'utf8');
const out = read('index.html')
.replace('/*__CSS__*/', () => read('style.css'))
// Plain-script bundle: drop ES `export` so modules concatenate into one scope.
.replace('/*__JS__*/', () => [read('crypto.js').replace(/^export /gm, ''), read('app.js')].join('\n'))
.replace('/*__JS__*/', () => ['crypto.js', 'model.js'].map((f) => read(f).replace(/^export /gm, '')).concat(read('app.js')).join('\n'))
.replace('/*__PAYLOAD__*/', () => '');
mkdirSync(join(root, 'dist'), { recursive: true });