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 <noreply@anthropic.com>
This commit is contained in:
2026-11-09 07:57:25 -05:00
parent 8acc9bad57
commit fa6ba95d3e
6 changed files with 60 additions and 0 deletions

7
.gitignore vendored Normal file
View File

@@ -0,0 +1,7 @@
# Source PDF and plaintext working data contain real secrets: never commit
*.pdf
data/
# Build output
dist/
node_modules/
.DS_Store

17
build.js Normal file
View File

@@ -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)');

12
package.json Normal file
View File

@@ -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" }
}

5
src/app.js Normal file
View File

@@ -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.';
})();

16
src/index.html Normal file
View File

@@ -0,0 +1,16 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Final Wishes</title>
<!-- build.js inlines CSS and JS here; no external requests (must work offline) -->
<style>/*__CSS__*/</style>
</head>
<body>
<main id="app"><noscript>This document needs JavaScript enabled.</noscript></main>
<!-- Encrypted data blob is injected by build.js (issue #6). -->
<script id="payload" type="application/octet-stream">/*__PAYLOAD__*/</script>
<script>/*__JS__*/</script>
</body>
</html>

3
src/style.css Normal file
View File

@@ -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; }