Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ Thumbs.db
# AI session transcripts (accidental commits)
session-*.md

# Local-only reference material (original NAAP Rotating Sky lab) — not part of the sim
# Local decompile output (and any accidental NAAP re-clones). Upstream sources: ../Baseline/Astronomy/
NAAP/

# Flash decompilation tooling (npm run decompile) — downloaded FFDec
Expand Down
2 changes: 1 addition & 1 deletion CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,6 @@ npm run lint && npm run check && npm run build && npm test

## Development notes

- **`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/`.
- To share state across screens instead, construct one `SkyModel` once and thread it through each per-screen model — see [doc/multi-screen.md](doc/multi-screen.md).
- After `npm run build`, the sim is installable offline via Workbox (`dist/manifest.webmanifest`).
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,21 @@ Vite 8, TypeScript 7, and Biome 2.

See `doc/multi-screen.md` for the multi-screen architecture and how to share state across screens.

### 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
Expand Down
17 changes: 15 additions & 2 deletions scripts/decompile-flash.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* decompile-flash.ts
*
* Extract readable ActionScript (and optionally assets) from the original NAAP
* Flash sources under `NAAP/`, so the ported Rotating Sky sim can be checked
* Flash sources under `../Baseline/Astronomy/flash-animations/` (sibling Baseline repo), so the ported Rotating Sky sim can be checked
* against the real implementation.
*
* The `.fla` files are old binary (OLE compound) projects that no current tool
Expand Down Expand Up @@ -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).
Expand Down Expand Up @@ -438,6 +449,8 @@ async function main(): Promise<void> {
return;
}

ensureFlashRoot();

const movies = resolveTargets(opts);
if (movies.length === 0) {
fail("No .swf targets resolved. Check the paths, or run with --help.");
Expand Down