diff --git a/.gitignore b/.gitignore index 56d24dd..ddcc79f 100644 --- a/.gitignore +++ b/.gitignore @@ -38,7 +38,7 @@ Thumbs.db # Claude Code - local settings excluded, hooks tracked .claude/settings.local.json -# Original NAAP Flash-based reference simulation (not tracked) +# Local decompile output (and any accidental NAAP re-clones). Upstream sources: ../Baseline/Astronomy/ NAAP/ # Flash decompilation tooling (npm run decompile) — downloaded FFDec diff --git a/CLAUDE.md b/CLAUDE.md index d406db6..ad9c534 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -77,5 +77,5 @@ npm run lint && npm run check && npm run build && npm test ## Development notes - **`VariableStarPhotometryConstants.ts`** uses nested frozen `as const` groups (`FIELD`, `APERTURE`, `TIME`, `LAYOUT`, `PDM`) instead of a flat namespace — intentional for five distinct concerns; still no magic numbers in model/view code. -- **`npm run decompile`** extracts NAAP Flash ActionScript via JPEXS FFDec into gitignored `NAAP/decompiled/` — read-only reference. +- **`npm run decompile`** extracts NAAP Flash ActionScript via JPEXS FFDec from `../Baseline/Astronomy/flash-animations` into gitignored `NAAP/decompiled/`. - After `npm run build`, the sim is installable offline via Workbox (`dist/manifest.webmanifest`). diff --git a/README.md b/README.md index 68fbbe5..f9c2391 100644 --- a/README.md +++ b/README.md @@ -16,6 +16,21 @@ A SceneryStack port of the [NAAP Variable Star Photometry Lab](https://astro.unl - English, French, and Spanish localization - Progressive Web App (installable, offline-capable) +### NAAP reference sources + +Upstream Flash / AIR / React NAAP sources live in the sibling +[`Baseline`](https://github.com/OpenPhysics/Baseline) repo under `Astronomy/` +(see `baselines.json`). Clone Baseline with the fleet bootstrap, then: + +```bash +(cd ../Baseline && ./scripts/fetch-baselines.sh) +``` + +`npm run decompile` reads `.swf` files from +`../Baseline/Astronomy/flash-animations` and writes ActionScript into the +sim-local gitignored `NAAP/decompiled/` (requires Java; one-time +`npm run decompile -- --setup`). + ## Quick Start ```bash diff --git a/scripts/decompile-flash.ts b/scripts/decompile-flash.ts index b982e3f..6b6b2a9 100644 --- a/scripts/decompile-flash.ts +++ b/scripts/decompile-flash.ts @@ -2,7 +2,7 @@ * decompile-flash.ts * * Extract readable ActionScript (and optionally assets) from the original NAAP - * Flash sources under `NAAP/`, so the ported Variable Star Photometry sim can be + * Flash sources under `../Baseline/Astronomy/flash-animations/` (sibling Baseline repo), so the ported Variable Star Photometry sim can be * checked against the real implementation. See PORTING_PLAN.md → "Flash simulator * inventory". * @@ -36,7 +36,18 @@ import { inflateRawSync } from "node:zlib"; const here = dirname(fileURLToPath(import.meta.url)); const repoRoot = resolve(here, ".."); -const flashRoot = join(repoRoot, "NAAP", "flash-animations", "flashdev2"); +const flashRoot = resolve(repoRoot, "..", "Baseline", "Astronomy", "flash-animations", "flashdev2"); + +/** Fail fast when the Baseline sibling checkout (or fetch) is missing. */ +function ensureFlashRoot(): void { + if (!existsSync(flashRoot)) { + fail( + `NAAP Flash sources not found at:\n ${flashRoot}\n` + + `Clone OpenPhysics/Baseline as a sibling of this sim, then:\n` + + ` (cd ../Baseline && ./scripts/fetch-baselines.sh --only Astronomy/flash-animations)`, + ); + } +} /** * Latest canonical SWFs whose ActionScript informs the port (used by --all). @@ -438,6 +449,8 @@ async function main(): Promise { return; } + ensureFlashRoot(); + const movies = resolveTargets(opts); if (movies.length === 0) { fail("No .swf targets resolved. Check the paths, or run with --help.");