From 80c88c0a40f1a6f59311a4ad6ae4c138c3f25c38 Mon Sep 17 00:00:00 2001 From: Terence Cho Date: Fri, 15 May 2026 00:54:17 -0700 Subject: [PATCH] fix(core): move lottieReadiness out of src/runtime so it ships in dist MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The "./runtime/lottie-readiness" subpath export claimed to point at ./dist/runtime/adapters/lottieReadiness.js, but the published 0.6.6 and 0.6.7 tarballs never contained that file. Reason: packages/core/tsconfig.json excludes "src/runtime" (those files run in a browser context and are bundled separately into the IIFE artifact), so tsc never emitted the compiled output. Consumers that import the subpath — most notably @hyperframes/studio's Player.tsx — fail to resolve the module and the build breaks at the consumer site. lottieReadiness.ts is a pure helper: takes `unknown`, returns `boolean`, no DOM or `window` access. It doesn't belong under src/runtime/ in the first place — that's why the runtime-exclude rule rightly caught it. Move it to src/lottieReadiness.ts so the standard library build picks it up. The subpath export name stays "./runtime/lottie-readiness" so existing consumers (studio) don't need a code change; only the exports map's underlying file path moves to ./dist/lottieReadiness.{js,d.ts}. - mv src/runtime/adapters/lottieReadiness.{ts,test.ts} -> src/ - update src/runtime/adapters/lottie.ts re-export path - update package.json + publishConfig.exports to point at new dist path Verified: full core test suite passes (862/862), dist now contains lottieReadiness.{js,d.ts}, studio typechecks against the moved file. Co-Authored-By: Claude Opus 4.7 (1M context) --- packages/core/package.json | 8 ++++---- .../src/{runtime/adapters => }/lottieReadiness.test.ts | 0 .../core/src/{runtime/adapters => }/lottieReadiness.ts | 0 packages/core/src/runtime/adapters/lottie.ts | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) rename packages/core/src/{runtime/adapters => }/lottieReadiness.test.ts (100%) rename packages/core/src/{runtime/adapters => }/lottieReadiness.ts (100%) diff --git a/packages/core/package.json b/packages/core/package.json index 8ae8af394..f8f06c644 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -31,8 +31,8 @@ }, "./runtime": "./dist/hyperframe.runtime.iife.js", "./runtime/lottie-readiness": { - "import": "./src/runtime/adapters/lottieReadiness.ts", - "types": "./src/runtime/adapters/lottieReadiness.ts" + "import": "./src/lottieReadiness.ts", + "types": "./src/lottieReadiness.ts" }, "./studio-api": { "import": "./src/studio-api/index.ts", @@ -78,8 +78,8 @@ }, "./runtime": "./dist/hyperframe.runtime.iife.js", "./runtime/lottie-readiness": { - "import": "./dist/runtime/adapters/lottieReadiness.js", - "types": "./dist/runtime/adapters/lottieReadiness.d.ts" + "import": "./dist/lottieReadiness.js", + "types": "./dist/lottieReadiness.d.ts" }, "./studio-api": { "import": "./dist/studio-api/index.js", diff --git a/packages/core/src/runtime/adapters/lottieReadiness.test.ts b/packages/core/src/lottieReadiness.test.ts similarity index 100% rename from packages/core/src/runtime/adapters/lottieReadiness.test.ts rename to packages/core/src/lottieReadiness.test.ts diff --git a/packages/core/src/runtime/adapters/lottieReadiness.ts b/packages/core/src/lottieReadiness.ts similarity index 100% rename from packages/core/src/runtime/adapters/lottieReadiness.ts rename to packages/core/src/lottieReadiness.ts diff --git a/packages/core/src/runtime/adapters/lottie.ts b/packages/core/src/runtime/adapters/lottie.ts index 74da88a16..88dc35c52 100644 --- a/packages/core/src/runtime/adapters/lottie.ts +++ b/packages/core/src/runtime/adapters/lottie.ts @@ -1,6 +1,6 @@ import type { RuntimeDeterministicAdapter } from "../types"; import { swallow } from "../diagnostics"; -export { isLottieAnimationLoaded } from "./lottieReadiness"; +export { isLottieAnimationLoaded } from "../../lottieReadiness"; /** * Lottie adapter for HyperFrames