From b6366ea1fe109759a9c8e8a4a2817f6c650c64b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Lohrer?= Date: Tue, 28 Apr 2026 08:08:17 +0200 Subject: [PATCH] feat(snapshot): modul-skelett Co-Authored-By: Claude Opus 4.7 (1M context) --- snapshot/.gitignore | 2 ++ snapshot/README.md | 22 ++++++++++++++++++++++ snapshot/deno.jsonc | 31 +++++++++++++++++++++++++++++++ 3 files changed, 55 insertions(+) create mode 100644 snapshot/.gitignore create mode 100644 snapshot/README.md create mode 100644 snapshot/deno.jsonc diff --git a/snapshot/.gitignore b/snapshot/.gitignore new file mode 100644 index 0000000..dbad61f --- /dev/null +++ b/snapshot/.gitignore @@ -0,0 +1,2 @@ +output/ +.last-snapshot.json diff --git a/snapshot/README.md b/snapshot/README.md new file mode 100644 index 0000000..53cb7f0 --- /dev/null +++ b/snapshot/README.md @@ -0,0 +1,22 @@ +# snapshot/ + +Liest die `kind:30023`-Events des Site-Autors von den Read-Relays und +schreibt sie als JSON-Artefakte für den SvelteKit-Prerender-Schritt. +Kein Live-Proxy: Relays werden nur zur Build-Zeit befragt. + +Spec: [`../docs/superpowers/specs/2026-04-21-prerender-snapshot-design.md`](../docs/superpowers/specs/2026-04-21-prerender-snapshot-design.md) + +## Nutzung + +```sh +cd snapshot +deno task snapshot # default +deno task snapshot --out ./output # alternatives Ziel +deno task snapshot --min-events 20 # Schwelle +deno task snapshot --allow-shrink # Drop-Check aus +``` + +Erwartet diese Env-Vars (aus `../.env.local`): + +- `AUTHOR_PUBKEY_HEX` (64 hex chars) +- `BOOTSTRAP_RELAY` (wss-URL) diff --git a/snapshot/deno.jsonc b/snapshot/deno.jsonc new file mode 100644 index 0000000..b8d9feb --- /dev/null +++ b/snapshot/deno.jsonc @@ -0,0 +1,31 @@ +{ + "tasks": { + "snapshot": "deno run --env-file=../.env.local --allow-env --allow-read --allow-write --allow-net src/cli.ts", + "test": "deno test --allow-env --allow-read --allow-write --allow-net", + "fmt": "deno fmt", + "lint": "deno lint" + }, + "imports": { + "@std/yaml": "jsr:@std/yaml@^1.0.5", + "@std/cli": "jsr:@std/cli@^1.0.6", + "@std/fs": "jsr:@std/fs@^1.0.4", + "@std/path": "jsr:@std/path@^1.0.6", + "@std/testing": "jsr:@std/testing@^1.0.3", + "@std/assert": "jsr:@std/assert@^1.0.6", + "@std/encoding": "jsr:@std/encoding@^1.0.5", + "nostr-tools": "npm:nostr-tools@^2.10.4", + "applesauce-relay": "npm:applesauce-relay@^2.0.0", + "rxjs": "npm:rxjs@^7.8.1" + }, + "fmt": { + "lineWidth": 100, + "indentWidth": 2, + "semiColons": false, + "singleQuote": true + }, + "lint": { + "rules": { + "tags": ["recommended"] + } + } +}