Skip to content

Normalizer: write named library folders after the media (last) - #149

Merged
alekswebnet merged 1 commit into
mainfrom
feat/normalize-last
Nov 6, 2026
Merged

alekswebnet merged 1 commit into
mainfrom
feat/normalize-last

Conversation

@alekswebnet

Copy link
Copy Markdown
Contributor

Part of #148.

What changes

normalizeArchive({ input, output, last }): last is a list of top-level folders written after everything else, the media included, each whole and in the order the source had them. content is never moved, a name the archive has no folder for is ignored, and a string is refused, since it would be read as a folder per letter. Without last the order is what it was, so this is a minor. There is no command-line flag: only the package's author knows which folders those are.

Nothing in the repository uses it yet. h5p-author's Node build and the demo's content script will, once #147 is merged; that is the second box of #148.

Checked

  • packages/normalize: 24 tests, two of them new, the order itself and a written archive with its library folder last, whose entries keep their forms and bytes and their headers without descriptors; both fail without the change. pnpm typecheck passes, with last and its misuse in tests/package-types.ts.
  • The demo's regenerated video from Carry the editor libraries an H5P site's upload check wants, so h5p-author packages install on a fresh Moodle #147 (an Interactive Video, 5.2 MB, with the libraries an H5P site's upload check wants), as it is and with its 38 install folders written last by this branch: h5p-verify passes both and unzip -t is clean. Its content ends at 1.5 MB instead of 4.1.
    • From a host that ignores Range, paced to 1 MB/s: ready at 2.3 s with 2.3 MB sent, where it was 4.5 s with 4.4 MB.
    • From a host that honours Range: 4.5 s either way, with one more request, eight for seven. The warm pulls every text run before ready, so the trailing run is still waited for. Trimming the warm would change that, and is the player's.

Release: a minor of @missing-elements/h5p-normalize, before h5p-author's, which will pass last.

normalizeArchive takes `last`, a list of library folders to write after everything else, the
media included, each whole and in the order the source had them. Without it the order is as
before. It is for libraries a package carries and nothing reads as it plays, such as the editor
libraries an H5P site's upload check asks for (#146): sorted with the rest they come before
content.json, and a host that ignores Range waits for them before the frame boots (#148).
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