Skip to content

Serve the build tool and a library bundle per content type at /bundles/ - #15

Merged
alekswebnet merged 1 commit into
mainfrom
feat/bundles
Nov 9, 2026
Merged

alekswebnet merged 1 commit into
mainfrom
feat/bundles

Conversation

@alekswebnet

@alekswebnet alekswebnet commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

Closes #14.

The h5p-author skill, as of author 0.6.0 (missing-elements/h5p-offline-player#166), builds where npm is unreachable from two files fetched from this site: the build tool, and the bundle of the source's content type. ChatGPT's sandbox runs Node and its download tool takes a file the browsing tool has opened, so the chat builds, sees every problem itself, fixes its source and hands over the package. The build page stays for a chat that can fetch nothing.

What /bundles/ serves

Path What it holds
/bundles/<type>.zip One per content type in the pack, 55 with pack 1.1.0: parts/, the pack's whole index with the parts a build of that type can read, and libraries.txt. Written by writeBundles, which is h5p-author bundle --all
/bundles/parts/<part>.h5p Every part of the pack under its own name, and its index. No bundle holds an addon: a source with math stops the build, which names H5P.MathDisplay-1.0.h5p to fetch from here
/bundles/h5p-author.mjs The command line as one file (575 kB), everything it imports bundled in by Vite's own SSR build (Rolldown; no esbuild added), so it runs with nothing installed. It takes --libraries; --version does not work in it, so index.json carries the versions
/bundles/index.json The author's and the pack's versions, and each bundle's file, size and parts
/bundles/libraries.txt The pack's licence list

A bundles() plugin in vite.config.ts writes them after the pages, from the packages the lockfile pins, so a Dependabot update of h5p-author or h5p-libraries moves them. They are in dist/ only: 113 MB (the site 136 MB), within GitHub Pages' 1 GB; the build takes about two seconds longer. @missing-elements/h5p-author moves to ^0.6.0, for writeBundles.

Tested

e2e/bundles.spec.ts, through the preview server, as a chat would:

  • index.json lists the bundles, and each is served at its listed size; every part in parts/index.json is served; the licences and the tool are there.
  • The tool and H5P.QuestionSet.zip are fetched into an empty folder outside the project, so nothing installed is found, then unzipped with unzip, and a quiz is built with node h5p-author.mjs build … --libraries parts. A source with $$3^2$$ then stops, the part is read from the build's own message, fetched from /bundles/parts/, and the build succeeds.

The whole suite passes locally, 13 tests, typecheck clean.

After merge

The deploy publishes /bundles/, and the skill's step 3 starts finding its files; until then it falls back to the build page's link. Then the check only ChatGPT can do: the download tool on a zip from github.io, unzip or python3 -m zipfile, Node 22.16 running the tool.


Summary by cubic

Closes #14. Serves the h5p-author build tool and a library bundle per content type at /bundles/, so an AI chat that runs Node and fetches files but reaches no npm registry can build H5P packages itself. The build page stays for a chat that can fetch nothing.

What /bundles/ serves

  • A zip per content type, every library part individually under parts/ for addons a build names, index.json, and libraries.txt.
  • h5p-author.mjs, the command line bundled into a single file by Vite so it runs with nothing installed.
  • Bundles are written into dist/ only (113 MB), from the lockfile-pinned packages, so a Dependabot update of @missing-elements/h5p-author or @missing-elements/h5p-libraries moves them.

Testing

  • e2e fetches the tool and a bundle into an empty folder and builds a quiz with Node alone, then fetches the math addon the failed build names.
  • @missing-elements/h5p-author moves to ^0.6.0 for writeBundles; the build takes about two seconds longer.

Written for commit 7077de0. Summary will update on new commits.

View guided diff Turn on auto-fix

…bundles/

For a chat that runs Node and can fetch a file but reaches no npm registry, as ChatGPT's
sandbox: the h5p-author skill (author 0.6.0) fetches the command line and the bundle of the
source's content type from here and builds with them. The build writes, from the pinned
packages: a zip per content type (h5p-author bundle --all), every part of the pack under its own
name for an addon a build names, the command line as one file bundled by Vite, the licence list
and an index.json. 113 MB in dist/, none of it in git.

Closes #14

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

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

No issues found across 5 files

View guided diff | Turn on auto-fix | Re-trigger cubic

@alekswebnet
alekswebnet merged commit 963d319 into main Nov 9, 2026
3 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.

Serve a library bundle per content type and the build tool as files, for chats that can download but not install

1 participant