@hyperframes/producer 0.8.194 → 0.8.196

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.
@@ -1492,6 +1492,7 @@ import {
1492
1492
  readMediaStart,
1493
1493
  redactTelemetryString as redactTelemetryString2,
1494
1494
  resolveNaturalMediaTimelineDurationFromValues,
1495
+ rewriteAssetPath,
1495
1496
  rewriteAssetPaths,
1496
1497
  rewriteCssAssetUrls,
1497
1498
  rewriteInlineStyleAssetUrls
@@ -1499,7 +1500,7 @@ import {
1499
1500
  import { MAX_AUDIO_GAIN } from "@hyperframes/core/audio-gain";
1500
1501
  import { readPlaybackRate } from "@hyperframes/parsers/media-duration";
1501
1502
  import { resolveRateSpec } from "@hyperframes/core/speed-ramp";
1502
- import { gsapCdnDist } from "@hyperframes/core/gsap-cdn";
1503
+ import { gsapCdnDist, normalizeGsapBaseUrl } from "@hyperframes/core/gsap-cdn";
1503
1504
  import {
1504
1505
  assignBundledRuntimeCompositionIds,
1505
1506
  assignMediaRenderIds,
@@ -2021,6 +2022,7 @@ var Semaphore = class {
2021
2022
  constructor(maxConcurrent) {
2022
2023
  this.maxConcurrent = maxConcurrent;
2023
2024
  }
2025
+ maxConcurrent;
2024
2026
  queue = [];
2025
2027
  active = 0;
2026
2028
  async acquire() {
@@ -2532,7 +2534,7 @@ async function parseSubCompositions(html, projectDir, downloadDir, visited = /*
2532
2534
  const results = await Promise.all(
2533
2535
  workItems.map(async (item) => {
2534
2536
  const { html: compiledSub } = await compileHtmlFile(
2535
- item.rawSubHtml,
2537
+ rewriteUnresolvableGsapToCdn(item.rawSubHtml, projectDir, item.srcPath),
2536
2538
  dirname4(item.filePath),
2537
2539
  downloadDir,
2538
2540
  void 0,
@@ -2706,7 +2708,9 @@ function inlineSubCompositions(html, subCompositions, projectDir, variableOverri
2706
2708
  let compHtml = subCompositions.get(srcPath) || null;
2707
2709
  if (!compHtml) {
2708
2710
  const read = readProjectFile(resolve5(projectDir, srcPath));
2709
- if (read.kind === "file") compHtml = read.text;
2711
+ if (read.kind === "file") {
2712
+ compHtml = rewriteUnresolvableGsapToCdn(read.text, projectDir, srcPath);
2713
+ }
2710
2714
  }
2711
2715
  return compHtml;
2712
2716
  },
@@ -3249,18 +3253,27 @@ async function embedLocalFontFaces(html, projectDir) {
3249
3253
  }
3250
3254
  return result;
3251
3255
  }
3252
- var GSAP_CDN_BASE = gsapCdnDist();
3253
- function rewriteUnresolvableGsapToCdn(html, projectDir) {
3256
+ function renderGsapDist() {
3257
+ try {
3258
+ return gsapCdnDist(void 0, normalizeGsapBaseUrl(process.env.HYPERFRAMES_GSAP_BASE_URL));
3259
+ } catch (cause) {
3260
+ throw new Error(
3261
+ "Invalid HYPERFRAMES_GSAP_BASE_URL: use an absolute HTTPS npm mirror root (plain HTTP only for localhost) without credentials, query, or fragment",
3262
+ { cause }
3263
+ );
3264
+ }
3265
+ }
3266
+ function rewriteUnresolvableGsapToCdn(html, projectDir, compSrcPath) {
3267
+ let gsapDist;
3268
+ const exists = (path) => existsSync6(resolve5(projectDir, path));
3254
3269
  return html.replace(
3255
3270
  /(<script\b[^>]*\bsrc=["'])([^"']*gsap[^"']*\/dist\/([^"']+))(["'][^>]*>)/gi,
3256
3271
  (full, prefix, src, file, suffix) => {
3257
3272
  if (/^https?:\/\//i.test(src)) return full;
3258
- const absPath = resolve5(projectDir, src);
3259
- if (existsSync6(absPath)) return full;
3260
- defaultLogger.info(
3261
- `[Compiler] Rewriting missing gsap script to CDN: ${src} \u2192 ${GSAP_CDN_BASE}${file}`
3262
- );
3263
- return `${prefix}${GSAP_CDN_BASE}${file}${suffix}`;
3273
+ if (exists(compSrcPath ? rewriteAssetPath(compSrcPath, src, exists) : src)) return full;
3274
+ gsapDist ??= renderGsapDist();
3275
+ defaultLogger.info(`[Compiler] Rewriting missing gsap script: ${src} \u2192 ${gsapDist}${file}`);
3276
+ return `${prefix}${gsapDist}${file}${suffix}`;
3264
3277
  }
3265
3278
  );
3266
3279
  }
@@ -4753,6 +4766,10 @@ var VideoExtractionStageError = class extends Error {
4753
4766
  this.name = "VideoExtractionStageError";
4754
4767
  this.publicMetadata = { extractionFailure };
4755
4768
  }
4769
+ code;
4770
+ retryable;
4771
+ failures;
4772
+ extractionFailure;
4756
4773
  /**
4757
4774
  * Producer servers may expose this explicitly public, JSON-compatible data
4758
4775
  * without knowing its schema. Boundary adapters remain responsible for
@@ -6422,6 +6439,7 @@ var RenderQualityError = class extends Error {
6422
6439
  this.warnings = warnings;
6423
6440
  this.name = "RenderQualityError";
6424
6441
  }
6442
+ warnings;
6425
6443
  };
6426
6444
  function applyRenderWarningPolicy(job, captureWarnings, log = defaultLogger) {
6427
6445
  job.warnings ??= [];
@@ -10515,6 +10533,7 @@ var MixedCaptureModesError = class extends Error {
10515
10533
  this.modes = modes;
10516
10534
  this.name = "MixedCaptureModesError";
10517
10535
  }
10536
+ modes;
10518
10537
  };
10519
10538
  function observedChunkCaptureMode(perfs) {
10520
10539
  const modes = [...new Set(perfs.map((perf) => perf.captureMode))];
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": "0.1.0",
3
3
  "buildId": "dev",
4
- "sha256": "17f66a5b2b626b2c74d51365de8d8d74f7c4ce6d96089c893cb1054b201bd512",
4
+ "sha256": "76ecb9a94777082e1cb85f468f089ade395649a08149ad8a6795fa3ff6062cc8",
5
5
  "artifacts": {
6
6
  "iife": "hyperframe.runtime.iife.js",
7
7
  "esm": "hyperframe.runtime.mjs"