From fa6ba95d3e1562f1d3ec207634dc5a1f6a5785f0 Mon Sep 17 00:00:00 2001 From: Eric Bell Date: Mon, 9 Nov 2026 07:57:25 -0500 Subject: [PATCH] Scaffold project Add src/ shell, build.js single-file bundler, package.json and .gitignore (excludes PDFs, data/, dist/). Closes #1 Co-Authored-By: Claude Sonnet 5.5 --- .gitignore | 7 +++++++ build.js | 17 +++++++++++++++++ package.json | 12 ++++++++++++ src/app.js | 5 +++++ src/index.html | 16 ++++++++++++++++ src/style.css | 3 +++ 6 files changed, 60 insertions(+) create mode 100644 .gitignore create mode 100644 build.js create mode 100644 package.json create mode 100644 src/app.js create mode 100644 src/index.html create mode 100644 src/style.css 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 @@ + + + + + +Final Wishes + + + + +
+ + + + + diff --git a/src/style.css b/src/style.css new file mode 100644 index 0000000..cda9683 --- /dev/null +++ b/src/style.css @@ -0,0 +1,3 @@ +:root { color-scheme: light dark; font-family: system-ui, sans-serif; } +body { margin: 0; padding: 1rem; } +#app { max-width: 50rem; margin: 0 auto; }