From 2186c3c5e63e67e4b09accdba31f0362f70251a9 Mon Sep 17 00:00:00 2001 From: martin veillette Date: Fri, 31 Jul 2026 22:31:09 -0400 Subject: [PATCH] Point NAAP/reference tooling at the sibling Baseline repo. Decompile scripts and docs resolve Flash and other upstream sources under ../Baseline; local nested clones are no longer used. Co-authored-by: Cursor --- .gitignore | 2 +- CLAUDE.md | 2 +- README.md | 15 +++++++++++++++ scripts/decompile-flash.ts | 17 +++++++++++++++-- 4 files changed, 32 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index 38e32c9..d486d24 100644 --- a/.gitignore +++ b/.gitignore @@ -38,7 +38,7 @@ Thumbs.db # Claude Code - local settings excluded, hooks tracked .claude/settings.local.json -# NAAP reference sources (vendored Flash originals + decompiled output) — kept local, not committed +# Local decompile output (and any accidental NAAP re-clones). Upstream sources: ../Baseline/Astronomy/ NAAP/ # Flash decompilation tooling (npm run decompile) — downloaded FFDec tools/ffdec/ diff --git a/CLAUDE.md b/CLAUDE.md index 55cbee8..0f4e228 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -76,5 +76,5 @@ npm run lint && npm run check && npm run build && npm test ## Development notes - `ConfigurationsZodiacStrip` and `PtolemaicZodiacStrip` are separate view nodes; `MotionsOfTheSun/` cherry-picks constellation data and strip mapping from here. -- **`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 995d417..bcaffc9 100644 --- a/README.md +++ b/README.md @@ -14,6 +14,21 @@ A two-screen [SceneryStack](https://scenerystack.org/) port of the NAAP **Solar - Git hooks for Biome pre-commit checks - Shared GitHub Actions CI via `OpenPhysics/Baton` +### 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 919554f..c1b82ca 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 Solar System Models sim can be + * Flash sources under `../Baseline/Astronomy/flash-animations/` (sibling Baseline repo), so the ported Solar System Models sim can be * checked against the real implementation. * * The `.fla` files are old binary (OLE compound) projects that no current tool @@ -35,7 +35,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). @@ -430,6 +441,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.");