mirror of
https://github.com/heygen-com/hyperframes.git
synced 2026-09-10 22:20:14 +00:00
refactor: delete orphan declarations flagged by fallow (#949)
* ci: run fallow audit in lefthook pre-commit Mirrors the same `fallow audit --base ... --fail-on-issues` check that runs in CI, but locally against HEAD so issues surface at commit time instead of after the push round-trip. Scoped to `packages/**` source files via the glob — non-code edits (README, docs, top-level configs) skip the hook entirely. Measured locally: ~5s in parallel with the existing lint/format/typecheck checks. Doesn't extend wall-clock time because typecheck (~11s) is the long pole, and lefthook runs commands in parallel. The default `--gate new-only` means inherited findings don't block the commit — same gate behavior as CI, so local pre-commit and PR audit agree. * refactor: delete orphan declarations flagged by fallow After fallow's auto-fix de-exports unused symbols, oxlint surfaces them as no-unused-vars. This PR deletes those orphan declarations outright. Biggest cleanup: studio/src/icons/SystemIcons.tsx shrinks from 132 to 57 lines — 33 unused icon wrappers and their phosphor-icon imports deleted. Other deletions across 14 more files covering paired getter/setters, helper functions, dead env constants, internal components with no callers, and cascading unused imports. Cascade-causing files held back for follow-up PRs: renderOrchestrator barrel of captureCost re-exports, telemetry/portUtils/remote barrels, Button.tsx + ui/index.ts (would orphan whole file), studioMotion type re-exports. Test plan: typecheck clean across 8 packages, oxlint + oxfmt clean, fallow audit exit 0 (remaining findings inherited), cli + studio vitest suites pass.
This commit is contained in:
@@ -23,13 +23,7 @@ export function getTimelineElementLabel(element: TimelineElement): string {
|
||||
return element.label || element.id || element.tag;
|
||||
}
|
||||
|
||||
export function confirmElementDelete(label: string, kind: "timeline clip" | "element"): boolean {
|
||||
return window.confirm(
|
||||
`Delete ${kind} "${label}"?\n\nThis removes it from the project source. You can use Undo to restore it.`,
|
||||
);
|
||||
}
|
||||
|
||||
export function normalizeProjectAssetPath(value: string): string {
|
||||
function normalizeProjectAssetPath(value: string): string {
|
||||
const trimmed = value.trim();
|
||||
const maybeUrl = /^[a-z]+:\/\//i.test(trimmed) ? new URL(trimmed).pathname : trimmed;
|
||||
return decodeURIComponent(maybeUrl)
|
||||
@@ -51,7 +45,7 @@ export function toRelativeProjectAssetPath(sourceFile: string, assetPath: string
|
||||
return [...fromParts.map(() => ".."), ...targetParts].join("/") || assetPath;
|
||||
}
|
||||
|
||||
export function isAbsoluteFilePath(value: string): boolean {
|
||||
function isAbsoluteFilePath(value: string): boolean {
|
||||
return /^(?:\/|[A-Za-z]:[\\/]|\\\\)/.test(value);
|
||||
}
|
||||
|
||||
@@ -181,7 +175,7 @@ export function collectHtmlIds(source: string): string[] {
|
||||
return Array.from(source.matchAll(/\bid="([^"]+)"/g), (match) => match[1] ?? "");
|
||||
}
|
||||
|
||||
export const DEFAULT_TIMELINE_ASSET_DURATION: Record<TimelineAssetKind, number> = {
|
||||
const DEFAULT_TIMELINE_ASSET_DURATION: Record<TimelineAssetKind, number> = {
|
||||
image: 3,
|
||||
video: 5,
|
||||
audio: 5,
|
||||
|
||||
Reference in New Issue
Block a user