diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..3277acb --- /dev/null +++ b/.gitignore @@ -0,0 +1,7 @@ +# Source PDF and plaintext working data contain real secrets: never commit +*.pdf +data/ +# Build output +dist/ +node_modules/ +.DS_Store diff --git a/build.js b/build.js new file mode 100644 index 0000000..54e9b06 --- /dev/null +++ b/build.js @@ -0,0 +1,17 @@ +// Inlines src/ into a single self-contained dist/final-wishes.html. +// The encrypted payload is a placeholder until the crypto module exists (#2, #6). +import { readFileSync, writeFileSync, mkdirSync } from 'node:fs'; +import { fileURLToPath } from 'node:url'; +import { dirname, join } from 'node:path'; + +const root = dirname(fileURLToPath(import.meta.url)); +const read = (p) => readFileSync(join(root, 'src', p), 'utf8'); +// Function replacers avoid '$' pattern interpretation in replacement text. +const out = read('index.html') + .replace('/*__CSS__*/', () => read('style.css')) + .replace('/*__JS__*/', () => read('app.js')) + .replace('/*__PAYLOAD__*/', () => ''); + +mkdirSync(join(root, 'dist'), { recursive: true }); +writeFileSync(join(root, 'dist', 'final-wishes.html'), out); +console.log('Wrote dist/final-wishes.html (' + out.length + ' bytes)'); diff --git a/package.json b/package.json new file mode 100644 index 0000000..d12f06f --- /dev/null +++ b/package.json @@ -0,0 +1,12 @@ +{ + "name": "final-wishes", + "version": "0.1.0", + "private": true, + "description": "Encrypted, printable 'in the event of my death or incapacity' file in a single HTML document", + "type": "module", + "scripts": { + "build": "node build.js", + "test": "node --test" + }, + "engines": { "node": ">=20" } +} diff --git a/src/app.js b/src/app.js new file mode 100644 index 0000000..4e56e3e --- /dev/null +++ b/src/app.js @@ -0,0 +1,5 @@ +// App entry point. Crypto (#2), data model (#3), UI (#4) and print (#5) land here. +(function () { + const app = document.getElementById('app'); + app.textContent = 'Final Wishes: scaffold loaded.'; +})(); diff --git a/src/index.html b/src/index.html new file mode 100644 index 0000000..06fd489 --- /dev/null +++ b/src/index.html @@ -0,0 +1,16 @@ + + +
+ + +