Repository navigation
feat(author): say which H5P core a site needs to take a package - #248
Merged
Merged
Conversation
H5P's upload check refuses a package when a library in it asks for a newer core than the site has. With pack 1.1.0, 50 of the 57 runnable libraries ask for 1.28, which Moodle has from 4.5.11, 5.0.7 and 5.1.4, and the WordPress plugin from 1.17. A build now returns coreApi, the newest core its libraries ask for. The command line and h5p_build print it in one line, naming those releases for 1.28.
Contributor
There was a problem hiding this comment.
All reported issues were addressed across 13 files
Reply with feedback, questions, or to request a fix.
View guided diff | Turn on auto-fix | Re-trigger cubic
#245) coreApiOf reads a coreApi that leaves out its minor as .0 and passes over one that is not two whole numbers, so no build says 2.NaN. design/author.md: 50 of the 57 runnable libraries need 1.28, 31 asking for it themselves; the line comes from a build, not build --check.
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.
Closes #245.
H5P's upload check refuses a package when a library in it asks for a newer core than the site has. The message names that library, not the package. With pack 1.1.0, 50 of the 57 runnable libraries need core 1.28: 31 ask for it themselves, and the rest carry a library that does. A Moodle site before April 2026's point releases therefore refuses nearly every package built today.
What changes
The build:
coreApiOf(inlib/install.mjs, exported from./core) finds the newest core API among the libraries a package carries, counting those carried for the upload check. A library that names none counts as 1.0, as H5P reads it. A version without a minor counts as .0, and one that is not two whole numbers is ignored. Every build result has it ascoreApi, in Node and in a page.The line:
coreApiLinewrites it as one line. For 1.28 the line names the releases that have it, as checked on 2026-11-19:For any other version it says the version alone.
Where it shows:
h5p-author buildprints the line right after "Built …".build --checkdoes not, since it writes no package.h5p_build's answer gives it second, after its "Built …" line.Docs:
design/author.mdanddesign/mcp.mdsay the same.Where the releases come from
H5PValidator::isValidH5pDatain h5p-php-library, errorapi-version-unsupported.h5plib_v128(MDL-88092) is first in 4.5.11, 5.0.7 and 5.1.4, all tagged 2026-04-16, and an upgrade step makes it the default. Moodle 4.4 has v127.Tested
pnpm typecheckpasses, and so do the author's node suite (266 tests) and the MCP suite (21).coreApiequals the newestcoreApiamong thelibrary.jsonfiles in the written package. It also covers a library that names none, numbers written as strings, a missing minor, values that are not whole numbers, and the line for 1.28 and for 1.29.Not done
The skill does not tell the model to pass the line on. It reaches the model with the build's output, and a skill change would need its own check on Haiku.
Summary by cubic
Builds now say which H5P core a site needs to accept the package. H5P's upload check refuses a package when a library in it asks for a newer core than the site has, and its error names only that library; with pack 1.1.0, 50 of the 57 runnable libraries ask for 1.28, so a package built today is refused by an older site without saying why.
buildPackagereturnscoreApi, the newest core API among the libraries a package carries, in Node and in a page; a library naming none counts as 1.0, a missing minor as 0, and anything not two whole numbers is passed over.h5p-author buildandh5p_buildprint a line naming that core after the "Built …" line — for 1.28 it names the first releases that have it (Moodle 4.5.11, 5.0.7 or 5.1.4, WordPress plugin 1.17).build --checkdoes not, since it writes no package.Written for commit c4055f2. Summary will update on new commits.