Repository navigation
Normalizer: write named library folders after the media (last) - #149
Merged
Merged
Conversation
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).
This was referenced Nov 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of #148.
What changes
normalizeArchive({ input, output, last }):lastis a list of top-level folders written after everything else, the media included, each whole and in the order the source had them.contentis 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. Withoutlastthe 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 typecheckpasses, withlastand its misuse intests/package-types.ts.h5p-verifypasses both andunzip -tis clean. Its content ends at 1.5 MB instead of 4.1.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.Range: 4.5 s either way, with one more request, eight for seven. The warm pulls every text run beforeready, 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 passlast.