Skip to content

A mod is read and named by @scm-js/mod - #8

Merged
jeany55 merged 3 commits into
mainfrom
mod-package
Nov 12, 2026
Merged

jeany55 merged 3 commits into
mainfrom
mod-package

Conversation

@jeany55

@jeany55 jeany55 commented Nov 12, 2026

Copy link
Copy Markdown
Contributor

The Mod Editor opened and named a mod with its own code and with @scm-js/core 0.13's copy of the rules. It now takes them from @scm-js/mod 1.1.1, the reader the play page, the editor and scmjs use. The editing session, saving and the text folder stay here.

Why

Measured against the package on real mods before the switch:

  • One patcher exe opened as an empty mod without saying so (core 0.13 found no archive in it).
  • A folder holding an exe and a library got another hash: a read-me and a DLL beside the exe were taken as game files, and the exe's own plugins had no line.
  • A release with a DLL beside its program got the hash of the earlier rule.

So a mod opened here could be named differently from the same mod on the play page.

What changed

  • source.ts opens what was given through readMod. The prober, the root rule, the system-file and game-archive lists and the old opening code are deleted.
  • An unedited mod's hash is the package's identity. An edited mod's is the package's identityWith over the members an edit touched, which equals what the page's reader gives the files handed to it.
  • The engine is handed every module that has a hash line (a patcher exe's own plugins and libraries too).
  • A mod over 64 MB is described without hashing its files and named when the hash is first asked for; pending hashes go one way, as before.
  • One map of opened archives is shared by every read; closing the mod lets them go.
  • A text folder keeps a plugin or FireGraft file that sat beside the archive (Save as Folder lost them on reopening).
  • Korean for the package's 89 sentences, from the editor's catalogue.

Checked

  • npm run typecheck and the tests' own type-check: clean. npm test: 86 passed, 3 skipped (gated).
  • Gated on six real mods (SCMJS_MODS): the hash at open equals the package's pin; the page's reader gives the same hash as the editor before and after an edit.
  • Opening a 2.6 GB release in Node: the description is ready in about 1.3 s (about 3 s before), the hash at about 3.4 s.

Not checked, not done

  • Not run in a browser, and not against the deployed play page.
  • dist/plugin.js grows from 692 KB to about 786 KB (CI builds it).
  • Play and Start Test Game still hand the page only the files that differ and no code, so a mod with code plays there without it.
  • Saving a patcher exe as an MPQ still drops its plugins.
  • A deferred hash that fails is not tried again until the mod is reopened.
  • A carried plugin whose file is named .dll is taken as a library by the page when handed in game paths.
  • No version bump; @scm-js/core's range is unchanged.

🤖 Generated with Claude Code

https://claude.ai/code/session_01VEdp4WXGmRNueeznohC2C9

jeany55 and others added 3 commits November 12, 2026 10:22
…are gone

- source.ts opens what was given through the package's readMod; the prober, the root rule, the system-file and
  game-archive lists and the old opening code are deleted. The editing session, saving and the text folder stay here.
- An unedited mod's hash is the package's identity; an edited mod's is made from its lines with the touched
  members' lines replaced, which is what the page's reader gives the files handed.
- The engine is handed every module that has a hash line (a patcher exe's own plugins and libraries too), so the
  page names the mod as this plugin does.
- A text folder keeps a plugin or FireGraft file that sat beside the archive.
- The package's 80 sentences have Korean, from the editor's catalogue.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VEdp4WXGmRNueeznohC2C9
…arge mod is shown before it is named

- session.ts: the edited mod's hash is the package's identityWith over the members an edit touched.
- A mod over 64 MB is described without hashing its files and named when the hash is first asked for; pending
  hashes go one way, as before the switch.
- One map of opened archives is shared by every read, and closing the mod lets them go.
- Korean for the package's nine new sentences; an archive that will not open says its reason in Korean.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VEdp4WXGmRNueeznohC2C9
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VEdp4WXGmRNueeznohC2C9
@jeany55
jeany55 merged commit 1ef5866 into main Nov 12, 2026
1 check passed
@jeany55 jeany55 mentioned this pull request Nov 12, 2026
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