Merge pull request #944 from heygen-com/cleanup/fallow-auto-fix

refactor: drop unused exports detected by fallow auto-fix
This commit is contained in:
James Russo
2026-05-18 21:19:44 -04:00
committed by GitHub
38 changed files with 47 additions and 54 deletions
@@ -20,7 +20,7 @@ import { type Device, type ModelId } from "./manager.js";
export type OutputFormat = "webm" | "mov" | "png";
export const QUALITY_CRF = {
const QUALITY_CRF = {
fast: 30,
balanced: 18,
best: 12,
+1 -1
View File
@@ -45,7 +45,7 @@ function estimateDurationFromScripts(root: ParentNode): number {
return duration;
}
export function parseCompositions(html: string, baseDir: string): CompositionInfo[] {
function parseCompositions(html: string, baseDir: string): CompositionInfo[] {
const parser = new DOMParser();
const doc = parser.parseFromString(html, "text/html");
+1 -1
View File
@@ -56,7 +56,7 @@ interface TrustPolicyDocument {
* Actions the CLI needs to deploy/invoke/destroy the stack. Keep this
* sorted alphabetically inside each service so diffs stay readable.
*/
export const REQUIRED_ACTIONS = {
const REQUIRED_ACTIONS = {
cloudformation: [
"cloudformation:CreateChangeSet",
"cloudformation:CreateStack",
+2 -2
View File
@@ -23,7 +23,7 @@ import { existsSync } from "node:fs";
import { join } from "node:path";
/** Throws with a clear hint when the SAM CLI is not on PATH. */
export function assertSamAvailable(): void {
function assertSamAvailable(): void {
try {
execFileSync("sam", ["--version"], { stdio: "ignore" });
} catch {
@@ -34,7 +34,7 @@ export function assertSamAvailable(): void {
}
/** Throws with a clear hint when the `aws` CLI is not on PATH. */
export function assertAwsCliAvailable(): void {
function assertAwsCliAvailable(): void {
try {
execFileSync("aws", ["--version"], { stdio: "ignore" });
} catch {
+1 -1
View File
@@ -145,4 +145,4 @@ export async function ensureVoices(options?: {
return voicesPath;
}
export { MODELS_DIR, VOICES_DIR, DEFAULT_MODEL };
export { MODELS_DIR, DEFAULT_MODEL };
+1 -1
View File
@@ -12,7 +12,7 @@ import { join, resolve } from "node:path";
import { DEFAULT_REGISTRY_URL } from "../registry/index.js";
export const PROJECT_CONFIG_FILENAME = "hyperframes.json";
export const PROJECT_CONFIG_SCHEMA_URL = "https://hyperframes.heygen.com/schema/hyperframes.json";
const PROJECT_CONFIG_SCHEMA_URL = "https://hyperframes.heygen.com/schema/hyperframes.json";
export interface ProjectConfigPaths {
/** Where `hyperframes:block` items land, relative to project root. */
+1 -1
View File
@@ -131,7 +131,7 @@ export function findWhisper(): WhisperResult | undefined {
return findFromEnv() ?? findFromSystem() ?? findBuiltBinary();
}
export function getInstallInstructions(): string {
function getInstallInstructions(): string {
if (platform() === "darwin") {
return "brew install whisper-cpp";
}
-2
View File
@@ -299,5 +299,3 @@ export async function transcribe(
speechOnsetSeconds,
};
}
export { isAudioFile, isVideoFile };
+2 -2
View File
@@ -15,10 +15,10 @@ export type ExtractedBlock = {
index: number;
};
export const TAG_PATTERN = /<([a-z][\w:-]*)(\s[^<>]*?)?>/gi;
const TAG_PATTERN = /<([a-z][\w:-]*)(\s[^<>]*?)?>/gi;
export const STYLE_BLOCK_PATTERN = /<style\b([^>]*)>([\s\S]*?)<\/style>/gi;
export const SCRIPT_BLOCK_PATTERN = /<script\b([^>]*)>([\s\S]*?)<\/script>/gi;
export const COMPOSITION_ID_IN_CSS_PATTERN = /\[data-composition-id=["']([^"']+)["']\]/g;
const COMPOSITION_ID_IN_CSS_PATTERN = /\[data-composition-id=["']([^"']+)["']\]/g;
export const TIMELINE_REGISTRY_INIT_PATTERN =
/window\.__timelines\s*=\s*window\.__timelines\s*\|\|\s*\{\}|window\.__timelines\s*=\s*\{\}|window\.__timelines\s*\?\?=\s*\{\}/i;
export const TIMELINE_REGISTRY_ASSIGN_PATTERN = /window\.__timelines\[[^\]]+\]\s*=/i;
@@ -1,6 +1,5 @@
import type { RuntimeDeterministicAdapter } from "../types";
import { swallow } from "../diagnostics";
export { isLottieAnimationLoaded } from "../../lottieReadiness";
/**
* Lottie adapter for HyperFrames
@@ -4,7 +4,7 @@ import { join } from "node:path";
const SAMPLE_RATE = 4000;
const PEAK_COUNT = 4000;
export const WAVEFORM_CACHE_VERSION = "v2";
const WAVEFORM_CACHE_VERSION = "v2";
export function buildWaveformCacheKey(assetPath: string): string {
return `${WAVEFORM_CACHE_VERSION}_${assetPath.replace(/[/\\]/g, "_")}.json`;
@@ -4,9 +4,6 @@ import type { Hono } from "hono";
import type { StudioApiAdapter } from "../types.js";
import { decodeAudioPeaks, buildWaveformCacheKey } from "../helpers/waveform.js";
export { isAudioFile } from "../helpers/mime.js";
export { generateWaveformCache } from "../helpers/waveform.js";
export function registerWaveformRoutes(api: Hono, adapter: StudioApiAdapter): void {
api.get("/projects/:id/waveform/*", async (c) => {
const project = await adapter.resolveProject(c.req.param("id"));
@@ -149,7 +149,7 @@ async function probeBeginFrameSupport(browser: Browser): Promise<boolean> {
*
* Exported for tests; production callers go through `resolveBrowserGpuMode`.
*/
export let _autoBrowserGpuModeCache: Promise<"software" | "hardware"> | undefined;
let _autoBrowserGpuModeCache: Promise<"software" | "hardware"> | undefined;
/** Test-only: reset the cached probe result. */
export function _resetAutoBrowserGpuModeCacheForTests(): void {
@@ -203,7 +203,7 @@ export async function captureScreenshotWithAlpha(
* video itself is the backdrop, so DOM layers must only contribute their
* foreground UI pixels never a page-spanning solid backdrop.
*/
export const TRANSPARENT_BG_STYLE_ID = "__hf_transparent_bg__";
const TRANSPARENT_BG_STYLE_ID = "__hf_transparent_bg__";
export async function initTransparentBackground(page: Page): Promise<void> {
const client = await getCdpSession(page);
+6 -6
View File
@@ -6,8 +6,8 @@
export const SHADER_CAPTURE_SCALE_ATTR = "shader-capture-scale";
export const SHADER_LOADING_ATTR = "shader-loading";
export const SHADER_CAPTURE_SCALE_PARAM = "__hf_shader_capture_scale";
export const SHADER_LOADING_PARAM = "__hf_shader_loading";
const SHADER_CAPTURE_SCALE_PARAM = "__hf_shader_capture_scale";
const SHADER_LOADING_PARAM = "__hf_shader_loading";
export const SHADER_LOADING_PHRASES = [
"Preparing scene transitions",
@@ -31,14 +31,14 @@ export interface ShaderTransitionState {
loading?: boolean;
}
export function normalizeShaderCaptureScale(value: string | null): string | null {
function normalizeShaderCaptureScale(value: string | null): string | null {
if (value === null) return null;
const parsed = Number(value);
if (!Number.isFinite(parsed) || parsed <= 0) return null;
return String(Math.min(1, Math.max(0.25, parsed)));
}
export function normalizeShaderLoadingMode(value: string | null): ShaderLoadingMode {
function normalizeShaderLoadingMode(value: string | null): ShaderLoadingMode {
if (value === null || value.trim() === "") return "composition";
const normalized = value.trim().toLowerCase();
if (
@@ -65,7 +65,7 @@ function setQueryParam(params: URLSearchParams, key: string, value: string | nul
else params.set(key, value);
}
export function withShaderQueryParams(
function withShaderQueryParams(
src: string,
scale: string | null,
loadingMode: ShaderLoadingMode,
@@ -83,7 +83,7 @@ export function withShaderQueryParams(
return `${path}${nextQuery ? `?${nextQuery}` : ""}${hash}`;
}
export function injectShaderOptionsIntoSrcdoc(
function injectShaderOptionsIntoSrcdoc(
html: string,
scale: string | null,
loadingMode: ShaderLoadingMode,
@@ -39,7 +39,7 @@ const EPSILON = 0.001; // Tolerance for floating-point timing comparisons
* Parse HTML and extract all elements with timing attributes.
* Includes <video>, <audio>, and <div data-composition-src>.
*/
export function extractTimedElements(html: string): CompiledElement[] {
function extractTimedElements(html: string): CompiledElement[] {
const elements: CompiledElement[] = [];
// Extract video elements
@@ -73,7 +73,7 @@ export async function readFfmpegVersion(): Promise<string> {
}
/** Test-only: clear the cached ffmpeg version so a fresh probe runs. */
export function _resetFfmpegVersionCacheForTests(): void {
function _resetFfmpegVersionCacheForTests(): void {
cachedFfmpegVersion = null;
}
+1 -1
View File
@@ -15,7 +15,7 @@ import { join, extname, resolve, sep } from "node:path";
import { injectScriptsAtHeadStart, injectScriptsIntoHtml } from "@hyperframes/core/compiler";
import { getVerifiedHyperframeRuntimeSource } from "./hyperframeRuntimeLoader.js";
export { injectScriptsAtHeadStart, injectScriptsIntoHtml };
export { injectScriptsAtHeadStart };
type PathModuleLike = {
resolve: (...segments: string[]) => string;
@@ -116,7 +116,6 @@ export interface FreezePlanResult {
* `../runtimeEnvSnapshot.ts` chunk workers re-apply the snapshot during
* boot, so it needs to be importable without dragging in the freeze pipeline.
*/
export { RUNTIME_ENV_PREFIXES, snapshotRuntimeEnv } from "../runtimeEnvSnapshot.js";
/** The relative path inside `<planDir>/` to the compiled HTML. */
const COMPILED_INDEX_RELATIVE_PATH = "compiled/index.html";
+1 -1
View File
@@ -61,7 +61,7 @@ function forceSceneVisibleInClone(source: HTMLElement, cloneDoc: Document): void
});
}
export function stabilizeTransformedBoxShadows(root: HTMLElement): void {
function stabilizeTransformedBoxShadows(root: HTMLElement): void {
const view = root.ownerDocument.defaultView;
if (!view) return;
+1 -1
View File
@@ -191,7 +191,7 @@ export const DEFAULT_CONTAINER: CaptionContainerStyle = {
boxShadow: "none",
};
export const DEFAULT_ANIMATION: CaptionAnimation = {
const DEFAULT_ANIMATION: CaptionAnimation = {
preset: "fade",
duration: 0.2,
ease: "power2.out",
@@ -1,7 +1,7 @@
import { useState, useRef, useEffect, type ReactNode } from "react";
import { Zap } from "../../icons/SystemIcons";
export const FIELD =
const FIELD =
"min-w-0 rounded-xl border border-neutral-800 bg-neutral-900/95 px-3 py-2 text-neutral-100 shadow-[inset_0_1px_0_rgba(255,255,255,0.03)] transition-colors focus-within:border-neutral-600";
export const LABEL = "text-[11px] font-medium uppercase tracking-[0.18em] text-neutral-500";
export const RESPONSIVE_GRID = "grid grid-cols-[repeat(auto-fit,minmax(118px,1fr))] gap-3";
@@ -30,7 +30,7 @@ export function parsePlainNumber(value: string): number | null {
// ── CommitField ──
export function CommitField({
function CommitField({
value,
disabled,
onCommit,
@@ -10,7 +10,7 @@ import type { GroupOverlayItem } from "./domEditOverlayGeometry";
export type GestureKind = "drag" | "resize" | "rotate";
export const BLOCKED_MOVE_THRESHOLD_PX = 4;
export const MIN_RESIZE_EDGE_PX = 20;
const MIN_RESIZE_EDGE_PX = 20;
const ROTATION_COMMIT_EPSILON_DEGREES = 0.05;
const ROTATION_SNAP_DEGREES = 15;
@@ -163,7 +163,7 @@ export function normalizeTimelineCompositionSource(value: string | undefined): s
// ─── CSS escaping ─────────────────────────────────────────────────────────────
export function escapeCssIdentifier(value: string): string {
function escapeCssIdentifier(value: string): string {
const css = globalThis.CSS as { escape?: (input: string) => string } | undefined;
if (typeof css?.escape === "function") return css.escape(value);
@@ -8,7 +8,7 @@ const FONT_EXT_RE = /\.(eot|otf|ttc|ttf|woff2?)$/i;
const FONT_STYLE_SUFFIX_RE =
/\s+(thin|extralight|extra light|light|regular|roman|medium|semibold|semi bold|bold|extrabold|extra bold|black|italic|oblique|variable)$/i;
export function cssString(value: string): string {
function cssString(value: string): string {
return JSON.stringify(value);
}
@@ -370,7 +370,7 @@ function formatHex(channel: number): string {
return channel.toString(16).padStart(2, "0");
}
export function interpolateGradientStopColor(model: GradientModel, position: number): string {
function interpolateGradientStopColor(model: GradientModel, position: number): string {
const clampedPosition = clamp(position, 0, 100);
const sortedStops = [...model.stops].sort((a, b) => a.position - b.position);
const exact = sortedStops.find((stop) => Math.abs(stop.position - clampedPosition) < 0.001);
@@ -256,7 +256,7 @@ export function createManualOffsetDragMember(input: {
};
}
export function resolveManualOffsetDragMemberOffset(
function resolveManualOffsetDragMemberOffset(
member: ManualOffsetDragMember,
dx: number,
dy: number,
@@ -289,7 +289,7 @@ export function applyManualOffsetDragCommit(
return offset;
}
export function restoreManualOffsetDragMember(member: ManualOffsetDragMember): void {
function restoreManualOffsetDragMember(member: ManualOffsetDragMember): void {
restoreStudioPathOffset(member.element, member.initialPathOffset);
endStudioManualEditGesture(member.element, member.gestureToken);
}
@@ -18,7 +18,7 @@ const COLOR_PICKER_SIZE = { width: 292, height: 386 };
/* ColorSlider */
/* ------------------------------------------------------------------ */
export function ColorSlider({
function ColorSlider({
label,
value,
min,
@@ -1,7 +1,7 @@
import { useCallback, useEffect, useRef, useState, type ReactNode } from "react";
import { adjustNumericToken, FIELD, LABEL, parseNumericToken } from "./propertyPanelHelpers";
export function CommitField({
function CommitField({
value,
disabled,
liveCommit,
@@ -129,7 +129,7 @@ export function buildStudioGsapPresetMotion(
// ── Manifest parse/serialize ──
export function parseMotionValues(value: unknown): StudioGsapMotionValues | null {
function parseMotionValues(value: unknown): StudioGsapMotionValues | null {
if (!value || typeof value !== "object") return null;
const record = value as Record<string, unknown>;
const parsed: StudioGsapMotionValues = {};
@@ -16,7 +16,7 @@ interface CompositionThumbnailProps {
const CLIP_HEIGHT = 66;
const THUMBNAIL_URL_VERSION = "v3";
export const COMPOSITION_THUMBNAIL_LABEL_Z_INDEX = 10;
const COMPOSITION_THUMBNAIL_LABEL_Z_INDEX = 10;
export function buildCompositionThumbnailUrl({
previewUrl,
@@ -7,7 +7,7 @@ export const TRACK_H = 72;
export const RULER_H = 24;
export const CLIP_Y = 3;
export const CLIP_HANDLE_W = 18;
export const TIMELINE_SCROLL_BUFFER = 20;
const TIMELINE_SCROLL_BUFFER = 20;
/* ── Tick generation ──────────────────────────────────────────────── */
function getMajorTickInterval(duration: number, pixelsPerSecond?: number): number {
@@ -20,7 +20,7 @@ export function isFinitePositive(value: number): boolean {
return Number.isFinite(value) && value > 0;
}
export function clampTime(time: number, duration: number): number {
function clampTime(time: number, duration: number): number {
const safeDuration = Math.max(0, Number.isFinite(duration) ? duration : 0);
const safeTime = Math.max(0, Number.isFinite(time) ? time : 0);
return safeDuration > 0 ? Math.min(safeTime, safeDuration) : safeTime;
@@ -15,7 +15,7 @@ import { isFinitePositive } from "./playbackAdapter";
// Duration attribute helpers
// ---------------------------------------------------------------------------
export function readDurationAttribute(el: Element | null | undefined): number {
function readDurationAttribute(el: Element | null | undefined): number {
if (!el) return 0;
const duration =
Number.parseFloat(el.getAttribute("data-duration") ?? "") ||
@@ -42,7 +42,7 @@ export function readTimelineDurationFromDocument(doc: Document | null | undefine
// DOM element type guards
// ---------------------------------------------------------------------------
export function isHtmlElement(el: Element): el is HTMLElement {
function isHtmlElement(el: Element): el is HTMLElement {
const HtmlElementCtor = el.ownerDocument.defaultView?.HTMLElement ?? globalThis.HTMLElement;
return typeof HtmlElementCtor !== "undefined" && el instanceof HtmlElementCtor;
}
@@ -113,7 +113,7 @@ export function getTimelineElementDisplayLabel(input: {
return tag ? `${tag} clip` : "Timeline clip";
}
export const IMPLICIT_TIMELINE_LAYER_SKIP_TAGS = new Set([
const IMPLICIT_TIMELINE_LAYER_SKIP_TAGS = new Set([
"base",
"link",
"meta",
@@ -123,7 +123,7 @@ export const IMPLICIT_TIMELINE_LAYER_SKIP_TAGS = new Set([
"template",
]);
export function humanizeTimelineIdentifier(value: string): string {
function humanizeTimelineIdentifier(value: string): string {
return value
.trim()
.replace(/[_-]+/g, " ")
@@ -239,7 +239,7 @@ export function getTimelineElementIdentity(element: TimelineElement): string {
// DOM node querying
// ---------------------------------------------------------------------------
export function getTimelineDomNodes(doc: Document): Element[] {
function getTimelineDomNodes(doc: Document): Element[] {
const rootComp = doc.querySelector("[data-composition-id]");
return Array.from(doc.querySelectorAll("[data-start]")).filter((node) => node !== rootComp);
}
@@ -22,7 +22,7 @@ const GENERIC_FONT_FAMILIES = new Set([
"fangsong",
]);
export function primaryFontFamilyFromCss(value: string): string {
function primaryFontFamilyFromCss(value: string): string {
const first = value.split(",")[0] ?? "";
return first.trim().replace(/^["']|["']$/g, "");
}
+1 -1
View File
@@ -80,7 +80,7 @@ function normalizeSelection(params: URLSearchParams): StudioUrlSelectionState |
};
}
export function defaultStudioUrlState(): StudioUrlState {
function defaultStudioUrlState(): StudioUrlState {
return {
activeCompPath: null,
currentTime: null,
@@ -1,6 +1,6 @@
import type { TimelineElement } from "../player";
export const TIMELINE_INSPECTOR_BOUNDARY_EPSILON_SECONDS = 0.08;
const TIMELINE_INSPECTOR_BOUNDARY_EPSILON_SECONDS = 0.08;
const AUDIO_TIMELINE_TAGS = new Set(["audio", "music", "sfx", "sound", "narration"]);
const AUDIO_SOURCE_EXT_RE = /\.(aac|flac|m4a|mp3|ogg|opus|wav)(?:[?#].*)?$/i;
+1 -1
View File
@@ -20,7 +20,7 @@ const CHROME_PATHS = [
"/usr/bin/chromium-browser",
];
export async function getSharedBrowser(): Promise<import("puppeteer-core").Browser | null> {
async function getSharedBrowser(): Promise<import("puppeteer-core").Browser | null> {
if (_browser?.connected) return _browser;
if (_browserLaunchPromise) return _browserLaunchPromise;
_browserLaunchPromise = (async () => {