Repository navigation
Host the H5P build page and the library bundles at /h5p/ - #8
Merged
Merged
Conversation
The build page and the bundles move here from embed-my.github.io's /build and /bundles/, as /h5p/build/ and /h5p/bundles/, the page in this site's own layout and palette. Eleventy writes the pages, then Vite bundles the page's script with the player, its runtime and the library pack into /h5p/assets/, so the player's Service Worker is scoped to /h5p/assets/h5p/ and no other page is under it. The bundles are written at build, as embed-my writes them. The theme switch moves into an include the docs layout shares; the docs' HTML is unchanged byte for byte. base.njk takes an optional csp. Closes #7
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
There was a problem hiding this comment.
All reported issues were addressed across 18 files
Reply with feedback, questions, or to request a fix.
View guided diff | Turn on auto-fix | Re-trigger cubic
- base.njk writes a page's Content-Security-Policy first in <head>, before the inline color-scheme script, and an Eleventy transform adds each inline script's hash to script-src, so the policy covers every script on the page. - The test PNG's IDAT failed its CRC and zlib check; it is a valid 2x2 red PNG now, and the test checks the picture reaches the content. - The README describes embed-my's /build redirect as a step of its own, and says the bundles test runs unzip, as the skill's steps do.
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 #7.
The H5P build page and the library bundles move here from embed-my.github.io, in this site's own look.
embed-my.github.io/build/h5p/build/embed-my.github.io/bundles//h5p/bundles/What changed
src/h5p/build/, the page. Its two scripts are embed-my's, unchanged except the stylesheet import and the comments: its styles are now the site's own, a section ofsite.css. The markup keeps every id and text, inside the docs header's brand, theme switch and footer. The heading is now "Build an H5P activity", the same as the tab title, so it fits on two lines on a phone.vite.config.ts. It runs after Eleventy (pnpm buildistsc && eleventy && vite build). It bundles the page's script with the player, its runtime and the library pack into/h5p/assets/, with the runtime's licence and notice and the pack's licence list beside them. It writes/h5p/bundles/as embed-my does._site/is Eleventy's too, so it empties only the folders it writes./h5p/assets/, so its scope is/h5p/assets/h5p/. The home page and the pdfjs-viewer docs are outside it, and a test checks the scope.base.njkwrites an optionalcspfront-matter value as a<meta>policy, first in<head>. An Eleventy transform adds the hash of each inline script on such a page toscript-src, so the policy covers the site's inline color-scheme script too, as embed-my's Vite plugin does for its pages. The build page sets embed-my's policy.theme-switch.njk, which the docs layout now includes. The home page's and the docs' HTML are byte-identical before and after.build.ymlnow runs the browser tests on pull requests.pages.ymlis unchanged, and thepnpm buildit runs now writes/h5p/too._site/grows from 13 MB to 143 MB: the bundles are 113 MB and the page's assets 17 MB, well within Pages' 1 GB.Tests
Seven Playwright tests run against the built site:
site.jsruns under it (the theme switch shows), and that the worker's scope is/h5p/assets/h5p/.All pass locally and in CI. Screenshots in light and dark at 1280 and 390 px were checked, and none had a console error.
Mutation checks:
Review
cubic's four findings, in 5f4902d:
unzipdocumented as a prerequisite ofpnpm e2e, answered in its thread.Merge order
/buildinto a redirect carrying#source=.embed-my keeps serving
/bundles/until the next pack release, for copies of the skill installed before the move.Summary by cubic
Hosts the H5P build page and the library bundles at
/h5p/build/and/h5p/bundles/, moved from embed-my.github.io and now styled like the rest of this site./h5p/assets/, where the Service Worker's scope covers only that folder.base.njkgains an optionalcspfront-matter value, emitted as a<meta>policy first in<head>; an Eleventy transform hashes each inline script intoscript-src, since GitHub Pages sends no headers./h5p/bundles/builds a quiz in an empty folder.build.ymlnow runs them on pull requests._site/grows to 143 MB, within Pages' 1 GB limit.Migration
#source=fragments keep working; embed-my's/buildwill redirect here once this is deployed./bundles/until the next pack release, for copies of the h5p-author skill installed before the move.Written for commit 5f4902d. Summary will update on new commits.