diff --git a/packages/core/package-subpaths.json b/packages/core/package-subpaths.json index 149b071752..cc40df3544 100644 --- a/packages/core/package-subpaths.json +++ b/packages/core/package-subpaths.json @@ -32,6 +32,12 @@ "types": "./dist/telemetryRedaction.d.ts", "environments": ["browser", "bun", "node"] }, + "./distributed-fps": { + "source": "./src/distributedFps.ts", + "runtime": "./dist/distributedFps.js", + "types": "./dist/distributedFps.d.ts", + "environments": ["browser", "bun", "node"] + }, "./beats": { "source": "./src/beats/index.ts", "runtime": "./dist/beats/index.js", diff --git a/packages/core/package.json b/packages/core/package.json index 0211f3dda1..51f28db6b1 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -44,6 +44,12 @@ "import": "./src/telemetryRedaction.ts", "types": "./src/telemetryRedaction.ts" }, + "./distributed-fps": { + "bun": "./src/distributedFps.ts", + "node": "./dist/distributedFps.js", + "import": "./src/distributedFps.ts", + "types": "./src/distributedFps.ts" + }, "./beats": { "bun": "./src/beats/index.ts", "node": "./dist/beats/index.js", @@ -560,6 +566,10 @@ "import": "./dist/telemetryRedaction.js", "types": "./dist/telemetryRedaction.d.ts" }, + "./distributed-fps": { + "import": "./dist/distributedFps.js", + "types": "./dist/distributedFps.d.ts" + }, "./beats": { "import": "./dist/beats/index.js", "types": "./dist/beats/index.d.ts" diff --git a/packages/core/src/core.types.ts b/packages/core/src/core.types.ts index 7abca72567..99d356b557 100644 --- a/packages/core/src/core.types.ts +++ b/packages/core/src/core.types.ts @@ -136,14 +136,6 @@ export function parseFpsWithDefault(input: string | number | undefined): FpsPars return parseFps(input); } -/** Integer rates the distributed renderer (Lambda, Cloud Run) accepts; fractional fps renders in-process only. */ -export const DISTRIBUTED_FPS = [24, 25, 30, 60] as const; -export type DistributedFps = (typeof DISTRIBUTED_FPS)[number]; - -export function isDistributedFps(value: unknown): value is DistributedFps { - return (DISTRIBUTED_FPS as readonly unknown[]).includes(value); -} - /** Video orientation / aspect ratio. */ export type Orientation = "16:9" | "9:16"; diff --git a/packages/core/src/distributedFps.ts b/packages/core/src/distributedFps.ts new file mode 100644 index 0000000000..46b3501b90 --- /dev/null +++ b/packages/core/src/distributedFps.ts @@ -0,0 +1,7 @@ +/** Integer rates the distributed renderer (Lambda, Cloud Run) accepts; fractional fps renders in-process only. */ +export const DISTRIBUTED_FPS = [24, 25, 30, 60] as const; +export type DistributedFps = (typeof DISTRIBUTED_FPS)[number]; + +export function isDistributedFps(value: unknown): value is DistributedFps { + return (DISTRIBUTED_FPS as readonly unknown[]).includes(value); +} diff --git a/packages/core/src/index.ts b/packages/core/src/index.ts index ebb8f87042..ee90c67f79 100644 --- a/packages/core/src/index.ts +++ b/packages/core/src/index.ts @@ -14,7 +14,6 @@ export type { CanvasResolution, Fps, FpsInput, - DistributedFps, FpsParseResult, MediaFile, CompositionAPI, @@ -73,8 +72,6 @@ export { toFps, fpsToNumber, fpsToFfmpegArg, - DISTRIBUTED_FPS, - isDistributedFps, TIMELINE_COLORS, DEFAULT_DURATIONS, COMPOSITION_VARIABLE_TYPES, @@ -84,6 +81,8 @@ export { getDefaultStageZoom, } from "./core.types"; +export { DISTRIBUTED_FPS, type DistributedFps, isDistributedFps } from "./distributedFps"; + // Templates export { generateBaseHtml, getStageStyles } from "./templates/base"; export { diff --git a/packages/core/src/parseFps.test.ts b/packages/core/src/parseFps.test.ts index d2821b3210..dcae316dba 100644 --- a/packages/core/src/parseFps.test.ts +++ b/packages/core/src/parseFps.test.ts @@ -1,11 +1,6 @@ import { describe, expect, it } from "vitest"; -import { - DISTRIBUTED_FPS, - fpsToFfmpegArg, - fpsToNumber, - isDistributedFps, - parseFps, -} from "./core.types"; +import { fpsToFfmpegArg, fpsToNumber, parseFps } from "./core.types"; +import { DISTRIBUTED_FPS, isDistributedFps } from "./distributedFps"; describe("parseFps — integer forms", () => { it("parses integer string '30' as { num: 30, den: 1 }", () => { diff --git a/packages/engine/src/config.ts b/packages/engine/src/config.ts index 06f0ee0ab0..0c96f7dd5d 100644 --- a/packages/engine/src/config.ts +++ b/packages/engine/src/config.ts @@ -7,7 +7,7 @@ */ import { tmpdir } from "node:os"; -import { DISTRIBUTED_FPS, type DistributedFps } from "@hyperframes/core"; +import { DISTRIBUTED_FPS, type DistributedFps } from "@hyperframes/core/distributed-fps"; import { chromeMajorCeiling } from "./services/chromeHostCeiling.js"; import { join } from "node:path"; import { diff --git a/packages/gcp-cloud-run/Dockerfile b/packages/gcp-cloud-run/Dockerfile index 4d5484f19a..65fe7180a6 100644 --- a/packages/gcp-cloud-run/Dockerfile +++ b/packages/gcp-cloud-run/Dockerfile @@ -132,6 +132,7 @@ RUN timeout 300 bun install --frozen-lockfile \ # argument list with the production engine helper so a launcher-flag regression # invalidates this layer and fails the contract instead of testing a duplicate # hard-coded profile. +COPY packages/core/ packages/core/ COPY packages/parsers/ packages/parsers/ COPY packages/engine/ packages/engine/ COPY packages/aws-lambda/scripts/probe-beginframe.ts packages/aws-lambda/scripts/probe-beginframe.ts