@hyperframes/producer 0.8.194 → 0.8.195
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/dist/distributed.js +23 -11
- package/dist/hyperframe.manifest.json +1 -1
- package/dist/hyperframe.runtime.iife.js +61 -61
- package/dist/index.js +23 -11
- package/dist/public-server.js +23 -11
- package/package.json +7 -7
package/dist/index.js
CHANGED
|
@@ -5269,6 +5269,7 @@ import {
|
|
|
5269
5269
|
readMediaStart,
|
|
5270
5270
|
redactTelemetryString as redactTelemetryString2,
|
|
5271
5271
|
resolveNaturalMediaTimelineDurationFromValues,
|
|
5272
|
+
rewriteAssetPath,
|
|
5272
5273
|
rewriteAssetPaths,
|
|
5273
5274
|
rewriteCssAssetUrls,
|
|
5274
5275
|
rewriteInlineStyleAssetUrls
|
|
@@ -5276,7 +5277,7 @@ import {
|
|
|
5276
5277
|
import { MAX_AUDIO_GAIN } from "@hyperframes/core/audio-gain";
|
|
5277
5278
|
import { readPlaybackRate } from "@hyperframes/parsers/media-duration";
|
|
5278
5279
|
import { resolveRateSpec } from "@hyperframes/core/speed-ramp";
|
|
5279
|
-
import { gsapCdnDist } from "@hyperframes/core/gsap-cdn";
|
|
5280
|
+
import { gsapCdnDist, normalizeGsapBaseUrl } from "@hyperframes/core/gsap-cdn";
|
|
5280
5281
|
import {
|
|
5281
5282
|
assignBundledRuntimeCompositionIds,
|
|
5282
5283
|
assignMediaRenderIds,
|
|
@@ -6309,7 +6310,7 @@ async function parseSubCompositions(html, projectDir, downloadDir, visited = /*
|
|
|
6309
6310
|
const results = await Promise.all(
|
|
6310
6311
|
workItems.map(async (item) => {
|
|
6311
6312
|
const { html: compiledSub } = await compileHtmlFile(
|
|
6312
|
-
item.rawSubHtml,
|
|
6313
|
+
rewriteUnresolvableGsapToCdn(item.rawSubHtml, projectDir, item.srcPath),
|
|
6313
6314
|
dirname6(item.filePath),
|
|
6314
6315
|
downloadDir,
|
|
6315
6316
|
void 0,
|
|
@@ -6483,7 +6484,9 @@ function inlineSubCompositions(html, subCompositions, projectDir, variableOverri
|
|
|
6483
6484
|
let compHtml = subCompositions.get(srcPath) || null;
|
|
6484
6485
|
if (!compHtml) {
|
|
6485
6486
|
const read = readProjectFile(resolve6(projectDir, srcPath));
|
|
6486
|
-
if (read.kind === "file")
|
|
6487
|
+
if (read.kind === "file") {
|
|
6488
|
+
compHtml = rewriteUnresolvableGsapToCdn(read.text, projectDir, srcPath);
|
|
6489
|
+
}
|
|
6487
6490
|
}
|
|
6488
6491
|
return compHtml;
|
|
6489
6492
|
},
|
|
@@ -7026,18 +7029,27 @@ async function embedLocalFontFaces(html, projectDir) {
|
|
|
7026
7029
|
}
|
|
7027
7030
|
return result;
|
|
7028
7031
|
}
|
|
7029
|
-
|
|
7030
|
-
|
|
7032
|
+
function renderGsapDist() {
|
|
7033
|
+
try {
|
|
7034
|
+
return gsapCdnDist(void 0, normalizeGsapBaseUrl(process.env.HYPERFRAMES_GSAP_BASE_URL));
|
|
7035
|
+
} catch (cause) {
|
|
7036
|
+
throw new Error(
|
|
7037
|
+
"Invalid HYPERFRAMES_GSAP_BASE_URL: use an absolute HTTPS npm mirror root (plain HTTP only for localhost) without credentials, query, or fragment",
|
|
7038
|
+
{ cause }
|
|
7039
|
+
);
|
|
7040
|
+
}
|
|
7041
|
+
}
|
|
7042
|
+
function rewriteUnresolvableGsapToCdn(html, projectDir, compSrcPath) {
|
|
7043
|
+
let gsapDist;
|
|
7044
|
+
const exists = (path) => existsSync10(resolve6(projectDir, path));
|
|
7031
7045
|
return html.replace(
|
|
7032
7046
|
/(<script\b[^>]*\bsrc=["'])([^"']*gsap[^"']*\/dist\/([^"']+))(["'][^>]*>)/gi,
|
|
7033
7047
|
(full, prefix, src, file, suffix) => {
|
|
7034
7048
|
if (/^https?:\/\//i.test(src)) return full;
|
|
7035
|
-
|
|
7036
|
-
|
|
7037
|
-
defaultLogger.info(
|
|
7038
|
-
|
|
7039
|
-
);
|
|
7040
|
-
return `${prefix}${GSAP_CDN_BASE}${file}${suffix}`;
|
|
7049
|
+
if (exists(compSrcPath ? rewriteAssetPath(compSrcPath, src, exists) : src)) return full;
|
|
7050
|
+
gsapDist ??= renderGsapDist();
|
|
7051
|
+
defaultLogger.info(`[Compiler] Rewriting missing gsap script: ${src} \u2192 ${gsapDist}${file}`);
|
|
7052
|
+
return `${prefix}${gsapDist}${file}${suffix}`;
|
|
7041
7053
|
}
|
|
7042
7054
|
);
|
|
7043
7055
|
}
|
package/dist/public-server.js
CHANGED
|
@@ -5288,6 +5288,7 @@ import {
|
|
|
5288
5288
|
readMediaStart,
|
|
5289
5289
|
redactTelemetryString as redactTelemetryString2,
|
|
5290
5290
|
resolveNaturalMediaTimelineDurationFromValues,
|
|
5291
|
+
rewriteAssetPath,
|
|
5291
5292
|
rewriteAssetPaths,
|
|
5292
5293
|
rewriteCssAssetUrls,
|
|
5293
5294
|
rewriteInlineStyleAssetUrls
|
|
@@ -5295,7 +5296,7 @@ import {
|
|
|
5295
5296
|
import { MAX_AUDIO_GAIN } from "@hyperframes/core/audio-gain";
|
|
5296
5297
|
import { readPlaybackRate } from "@hyperframes/parsers/media-duration";
|
|
5297
5298
|
import { resolveRateSpec } from "@hyperframes/core/speed-ramp";
|
|
5298
|
-
import { gsapCdnDist } from "@hyperframes/core/gsap-cdn";
|
|
5299
|
+
import { gsapCdnDist, normalizeGsapBaseUrl } from "@hyperframes/core/gsap-cdn";
|
|
5299
5300
|
import {
|
|
5300
5301
|
assignBundledRuntimeCompositionIds,
|
|
5301
5302
|
assignMediaRenderIds,
|
|
@@ -6328,7 +6329,7 @@ async function parseSubCompositions(html, projectDir, downloadDir, visited = /*
|
|
|
6328
6329
|
const results = await Promise.all(
|
|
6329
6330
|
workItems.map(async (item) => {
|
|
6330
6331
|
const { html: compiledSub } = await compileHtmlFile(
|
|
6331
|
-
item.rawSubHtml,
|
|
6332
|
+
rewriteUnresolvableGsapToCdn(item.rawSubHtml, projectDir, item.srcPath),
|
|
6332
6333
|
dirname6(item.filePath),
|
|
6333
6334
|
downloadDir,
|
|
6334
6335
|
void 0,
|
|
@@ -6502,7 +6503,9 @@ function inlineSubCompositions(html, subCompositions, projectDir, variableOverri
|
|
|
6502
6503
|
let compHtml = subCompositions.get(srcPath) || null;
|
|
6503
6504
|
if (!compHtml) {
|
|
6504
6505
|
const read = readProjectFile(resolve6(projectDir, srcPath));
|
|
6505
|
-
if (read.kind === "file")
|
|
6506
|
+
if (read.kind === "file") {
|
|
6507
|
+
compHtml = rewriteUnresolvableGsapToCdn(read.text, projectDir, srcPath);
|
|
6508
|
+
}
|
|
6506
6509
|
}
|
|
6507
6510
|
return compHtml;
|
|
6508
6511
|
},
|
|
@@ -7045,18 +7048,27 @@ async function embedLocalFontFaces(html, projectDir) {
|
|
|
7045
7048
|
}
|
|
7046
7049
|
return result;
|
|
7047
7050
|
}
|
|
7048
|
-
|
|
7049
|
-
|
|
7051
|
+
function renderGsapDist() {
|
|
7052
|
+
try {
|
|
7053
|
+
return gsapCdnDist(void 0, normalizeGsapBaseUrl(process.env.HYPERFRAMES_GSAP_BASE_URL));
|
|
7054
|
+
} catch (cause) {
|
|
7055
|
+
throw new Error(
|
|
7056
|
+
"Invalid HYPERFRAMES_GSAP_BASE_URL: use an absolute HTTPS npm mirror root (plain HTTP only for localhost) without credentials, query, or fragment",
|
|
7057
|
+
{ cause }
|
|
7058
|
+
);
|
|
7059
|
+
}
|
|
7060
|
+
}
|
|
7061
|
+
function rewriteUnresolvableGsapToCdn(html, projectDir, compSrcPath) {
|
|
7062
|
+
let gsapDist;
|
|
7063
|
+
const exists = (path) => existsSync10(resolve6(projectDir, path));
|
|
7050
7064
|
return html.replace(
|
|
7051
7065
|
/(<script\b[^>]*\bsrc=["'])([^"']*gsap[^"']*\/dist\/([^"']+))(["'][^>]*>)/gi,
|
|
7052
7066
|
(full, prefix, src, file, suffix) => {
|
|
7053
7067
|
if (/^https?:\/\//i.test(src)) return full;
|
|
7054
|
-
|
|
7055
|
-
|
|
7056
|
-
defaultLogger.info(
|
|
7057
|
-
|
|
7058
|
-
);
|
|
7059
|
-
return `${prefix}${GSAP_CDN_BASE}${file}${suffix}`;
|
|
7068
|
+
if (exists(compSrcPath ? rewriteAssetPath(compSrcPath, src, exists) : src)) return full;
|
|
7069
|
+
gsapDist ??= renderGsapDist();
|
|
7070
|
+
defaultLogger.info(`[Compiler] Rewriting missing gsap script: ${src} \u2192 ${gsapDist}${file}`);
|
|
7071
|
+
return `${prefix}${gsapDist}${file}${suffix}`;
|
|
7060
7072
|
}
|
|
7061
7073
|
);
|
|
7062
7074
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hyperframes/producer",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.195",
|
|
4
4
|
"description": "HTML-to-video rendering engine using Chrome's BeginFrame API",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -35,11 +35,11 @@
|
|
|
35
35
|
"postcss": "^8.4.0",
|
|
36
36
|
"puppeteer": "^25.2.1",
|
|
37
37
|
"puppeteer-core": "^25.2.1",
|
|
38
|
-
"@hyperframes/core": "0.8.
|
|
39
|
-
"@hyperframes/
|
|
40
|
-
"@hyperframes/
|
|
41
|
-
"@hyperframes/
|
|
42
|
-
"@hyperframes/
|
|
38
|
+
"@hyperframes/core": "0.8.195",
|
|
39
|
+
"@hyperframes/lint": "0.8.195",
|
|
40
|
+
"@hyperframes/studio-server": "0.8.195",
|
|
41
|
+
"@hyperframes/parsers": "0.8.195",
|
|
42
|
+
"@hyperframes/engine": "0.8.195"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
45
|
"@types/node": "^25.0.10",
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
"tsx": "^4.21.0",
|
|
49
49
|
"typescript": "^5.7.2",
|
|
50
50
|
"vitest": "^4.1.11",
|
|
51
|
-
"@hyperframes/aws-lambda": "0.8.
|
|
51
|
+
"@hyperframes/aws-lambda": "0.8.195"
|
|
52
52
|
},
|
|
53
53
|
"engines": {
|
|
54
54
|
"node": ">=22"
|