Skip to content

feat(author): say which H5P core a site needs to take a package - #248

Merged
alekswebnet merged 2 commits into
mainfrom
feat/author-core-api
Nov 19, 2026
Merged

alekswebnet merged 2 commits into
mainfrom
feat/author-core-api

Conversation

@alekswebnet

@alekswebnet alekswebnet commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

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 (in lib/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 as coreApi, in Node and in a page.

  • The line: coreApiLine writes it as one line. For 1.28 the line names the releases that have it, as checked on 2026-11-19:

    Needs H5P core 1.28 or newer on a site it is uploaded to: Moodle 4.5.11, 5.0.7 or 5.1.4 and later, or the WordPress H5P plugin 1.17 and later. An older site refuses it.

    For any other version it says the version alone.

  • Where it shows:

    • h5p-author build prints the line right after "Built …". build --check does not, since it writes no package.
    • h5p_build's answer gives it second, after its "Built …" line.
  • Docs:

    • The author README shows the line in its sample output and says what it means.
    • The README now names Moodle 4.5.15 as the release that accepted every example, since Moodle 4.5.0 to 4.5.10 refuse them.
    • The MCP README, design/author.md and design/mcp.md say the same.

Where the releases come from

  • The check itself: H5P's validator, H5PValidator::isValidH5pData in h5p-php-library, error api-version-unsupported.
  • Moodle: 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.
  • WordPress: every 1.17 tag of the H5P plugin on svn has 1.28. 1.16.0 has 1.27.
  • Drupal and Lumi: h5p/h5p-core 1.28.0 came out on 2026-03-03, and Lumi's server library has 1.28. Neither is named in the line, since their releases do not map onto it as simply.

Tested

  • Typecheck and suites: pnpm typecheck passes, and so do the author's node suite (266 tests) and the MCP suite (21).
  • New test: a built Question Set's coreApi equals the newest coreApi among the library.json files 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.
  • The command and the server: the command's test now expects the line right after "Built …", and the MCP build test expects it in the answer.

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.

  • buildPackage returns coreApi, 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 build and h5p_build print 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 --check does not, since it writes no package.
  • Docs updated; the author README now names Moodle 4.5.15 as the release that accepts every example.

Written for commit c4055f2. Summary will update on new commits.

View guided diff Turn on auto-fix

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.
@alekswebnet alekswebnet self-assigned this Nov 19, 2026

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Comment thread design/author.md Resolved
Comment thread packages/author/lib/install.mjs Resolved
Comment thread design/author.md Resolved
#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.
@alekswebnet
alekswebnet merged commit 6fbc5c7 into main Nov 19, 2026
11 checks 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.

h5p-author: say which H5P core a site needs to take a package

1 participant