@missing-elements/h5p-embed 1.0.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -1
- package/lib/build.mjs +9 -2
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -65,7 +65,8 @@ The headers themselves, for a host not listed:
|
|
|
65
65
|
|---|---|
|
|
66
66
|
| every path | `Content-Security-Policy` (the policy the command prints, with `frame-ancestors` from `--ancestors`), `X-Content-Type-Options: nosniff`, `Referrer-Policy: strict-origin-when-cross-origin` |
|
|
67
67
|
| `/h5p-sw.js` | `Cache-Control: no-cache`, so an update reaches learners on their next visit |
|
|
68
|
-
| `/frame-assets/*`, `/
|
|
68
|
+
| `/frame-assets/*`, `/libraries/*` | `Cache-Control: no-cache`: the runtime and the library pack keep their file names between versions, so a copy from before an update must not be used after it |
|
|
69
|
+
| `/resizer.js` | `Cache-Control: public, max-age=3600, stale-while-revalidate=86400` |
|
|
69
70
|
|
|
70
71
|
To update, run the command again with `--force` and redeploy.
|
|
71
72
|
|
package/lib/build.mjs
CHANGED
|
@@ -137,6 +137,13 @@ export function contentSecurityPolicy({ packages = null, ancestors = null, meta
|
|
|
137
137
|
/** Header rules, one set for every host format: the policy everywhere, and the caching that matters. */
|
|
138
138
|
function headerRules(csp) {
|
|
139
139
|
const revalidate = 'public, max-age=3600, stale-while-revalidate=86400'
|
|
140
|
+
// Asked again on every load, a 304 when nothing changed. The runtime's files keep their names
|
|
141
|
+
// from one version to the next, and the worker's version decides which it needs: kept for an
|
|
142
|
+
// hour, the runtime of the version before ran under the new worker after an update, and every
|
|
143
|
+
// play failed until the hour was out (0.10 to 1.0, measured, #49). The pack the same way, for
|
|
144
|
+
// whatever reads it with the browser's defaults: the element itself asks for its index
|
|
145
|
+
// revalidated and for its parts past the HTTP cache, so for it the header changes nothing.
|
|
146
|
+
const current = 'no-cache'
|
|
140
147
|
return [
|
|
141
148
|
{
|
|
142
149
|
path: '/*',
|
|
@@ -148,9 +155,9 @@ function headerRules(csp) {
|
|
|
148
155
|
},
|
|
149
156
|
// The worker is checked on every load, so an update reaches learners on their next visit.
|
|
150
157
|
{ path: '/h5p-sw.js', headers: { 'Cache-Control': 'no-cache' } },
|
|
151
|
-
{ path: '/frame-assets/*', headers: { 'Cache-Control':
|
|
158
|
+
{ path: '/frame-assets/*', headers: { 'Cache-Control': current } },
|
|
152
159
|
{ path: '/resizer.js', headers: { 'Cache-Control': revalidate } },
|
|
153
|
-
{ path: '/libraries/*', headers: { 'Cache-Control':
|
|
160
|
+
{ path: '/libraries/*', headers: { 'Cache-Control': current } }
|
|
154
161
|
]
|
|
155
162
|
}
|
|
156
163
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@missing-elements/h5p-embed",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"description": "Self-hosted H5P embeds: writes the H5P embed page as a static site for a player domain of your own, then any site frames it with an iframe and one script line. No H5P server, no third-party service; optional allowlists for package hosts and embedding sites.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -43,9 +43,9 @@
|
|
|
43
43
|
"cli"
|
|
44
44
|
],
|
|
45
45
|
"dependencies": {
|
|
46
|
-
"@missing-elements/h5p-
|
|
47
|
-
"@missing-elements/h5p-
|
|
48
|
-
"@missing-elements/h5p-
|
|
46
|
+
"@missing-elements/h5p-libraries": "^1.0.0",
|
|
47
|
+
"@missing-elements/h5p-offline-player": "^1.0.1",
|
|
48
|
+
"@missing-elements/h5p-runtime": "^1.0.0"
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
51
51
|
"@types/node": "^26.6.5",
|