Skip to content

fix(core): move lottieReadiness out of src/runtime so it ships in dist#861

Open
terencecho wants to merge 1 commit into
mainfrom
fix/core-lottie-readiness-publish
Open

fix(core): move lottieReadiness out of src/runtime so it ships in dist#861
terencecho wants to merge 1 commit into
mainfrom
fix/core-lottie-readiness-publish

Conversation

@terencecho
Copy link
Copy Markdown
Contributor

Summary

The "./runtime/lottie-readiness" subpath export in @hyperframes/core claims to ship at ./dist/runtime/adapters/lottieReadiness.js, but that file is missing from the published 0.6.6 and 0.6.7 tarballs. Consumers that import the subpath — most notably @hyperframes/studio's Player.tsx — fail to resolve the module and break downstream builds (e.g. Next.js/Turbopack).

Root cause

packages/core/tsconfig.json excludes src/runtime (those files run in a browser context and are bundled separately into the IIFE artifact). Since nothing in the included tree imports lottieReadiness.ts, tsc never emits a compiled output, and the file silently goes missing from the publish.

Fix

lottieReadiness.ts is a pure helper — takes unknown, returns boolean, no DOM/window dependencies. It doesn't belong in src/runtime/ in the first place; 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" — only the exports map's underlying file path changes — so existing consumers (studio) don't need any code change.

Changes

  • 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 the new dist path (./dist/lottieReadiness.{js,d.ts})

Test plan

  • pnpm typecheck (core) — clean
  • bun run build (core) — dist/lottieReadiness.{js,d.ts} now present
  • bunx vitest run (core) — 862/862 passing
  • bun run typecheck (studio) — clean, resolves moved file via subpath export
  • Publish 0.6.8 and verify the tarball contains dist/lottieReadiness.js
  • Downstream consumer (e.g. hyperframes-internal/demo-next) builds without the pnpm patch workaround

🤖 Generated with Claude Code

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) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant