Skip to content

Download several at once: pick mods, get one ZIP - #17

Merged
kramsey458 merged 1 commit into
mainfrom
claude/mod-bundle
Sep 25, 2026
Merged

kramsey458 merged 1 commit into
mainfrom
claude/mod-bundle

Conversation

@kramsey458

Copy link
Copy Markdown
Collaborator

A new Download several at once section on the hub (#bundle, between the mod boards and the install guide, linked from the opening line and install step 1).

What a visitor sees

  • A Multiplayer choice: None, BeaverBuddies Stability Fork or Timber Together. Only one can run at a time.
  • More mods: ticks for the other six, with Select all.
  • Each row shows the mod's colour, name, version and size.
  • The button reads "Download 3 mods · 2.6 MB". It saves timbermods-mods.zip, with one folder per mod (extract into Documents\Timberborn\Mods) and a short Timbermods.txt listing versions, requirements and release notes.
  • Harmony and Mod Settings aren't bundled; a line points to Installing.

How it works

  • GitHub doesn't let a web page fetch release downloads. I tested both the download link and the API from timbermods.github.io, and both were blocked. So .github/workflows/refresh-downloads.yml keeps the hub's own copies on a downloads branch. It runs hourly at :37, after the release snapshot, and whenever the page or these scripts change.
  • scripts/update-downloads.mjs picks, for each mod, the release its Download button offers (the same rule as site.js, and a test compares the two). It rewrites that ZIP into a plain form with exactly one top folder, and no two mods may share a folder. It lists each copy in manifest.json with its SHA-256.
  • The branch is replaced by one fresh commit each time, so the repo doesn't grow. Previous copies stay one round, for browsers holding a cached manifest.
  • The page reads the copies from raw.githubusercontent.com, which allows it. It checks every SHA-256, then joins the ZIPs with assets/zipmerge.js without unpacking them. Nothing is sent anywhere.

Checked

  • node scripts/test-site.mjs: 20/20, with five new checks (joining, duplicate files refused, one top folder, same release as the buttons, the mirror script end to end with a fake GitHub).
  • The mirror script against all eight live releases: every copy is a valid ZIP, its checksum matches, and a second run changes nothing.
  • The picker in Edge with those copies: 7 mods came out as one valid ZIP (every file's checksum passed), with no page errors.
  • Light, dark and 390px phone, with no sideways scroll.

After merging, the push trigger creates the downloads branch. Until then, the section says the list didn't load and points to each mod's own button.

🤖 Generated with Claude Code

A new section on the hub (#bundle) lets a visitor tick mods and download one timbermods-mods.zip with a folder for
each, plus a short Timbermods.txt guide. Only one of the two BeaverBuddies mods can be picked; Harmony and Mod
Settings are never bundled.

GitHub doesn't let a page fetch release downloads, so refresh-downloads.yml keeps the hub's own copies on the
`downloads` branch (hourly, and when the page or scripts change): update-downloads.mjs picks the release each
Download button offers (same rule as site.js), rewrites it into a plain ZIP with one top folder, and lists it in
manifest.json with its SHA-256. The branch is one fresh commit each time, so it never grows. The page reads the
copies from raw.githubusercontent.com, checks each checksum and joins them with zipmerge.js without unpacking.

Tests: 20/20 (five new: joining, duplicate files, one top folder, same release as the buttons, the mirror script).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kramsey458
kramsey458 merged commit c0ad2fb into main Sep 25, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant