Skip to content

fix: registry imports, alias, testing and prompts#146

Merged
WINOFFRG merged 2 commits into
mainfrom
fix/registry-imports
May 10, 2026
Merged

fix: registry imports, alias, testing and prompts#146
WINOFFRG merged 2 commits into
mainfrom
fix/registry-imports

Conversation

@WINOFFRG
Copy link
Copy Markdown
Owner

@WINOFFRG WINOFFRG commented May 9, 2026

Summary by CodeRabbit

  • New Features

    • Controls now support a new optional render prop for custom element rendering alongside asChild.
    • Button component updated to allow optional custom element rendering.
  • Dependencies

    • Upgraded shaka-player to 4.x.
    • Added immer to UI registry dependencies.
  • Documentation

    • Strengthened guidelines for component design and Zustand+Immer safety.
  • Chores

    • Internal import/module reorganizations and submodule update.

Review Change Stack

Copilot AI review requested due to automatic review settings May 9, 2026 22:09
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 9, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 39259ed2-f0c2-44bd-a12c-7dd2b70f0978

📥 Commits

Reviewing files that changed from the base of the PR and between 2ffcf18 and ffe8fc0.

⛔ Files ignored due to path filters (1)
  • apps/www/scripts/validate-registries.ts is excluded by none and included by none
📒 Files selected for processing (6)
  • apps/www/registry/default/blocks/linear-player/components/button.tsx
  • apps/www/registry/default/ui/captions.tsx
  • apps/www/registry/default/ui/mute-control.tsx
  • apps/www/registry/default/ui/picture-in-picture-control.tsx
  • apps/www/registry/default/ui/playback-control.tsx
  • apps/www/registry/pro

📝 Walkthrough

Walkthrough

This PR adds render?: React.ReactElement prop support to control primitives, implements block-based import rewriting, reorganizes block file registrations from ui/ to components/, pins shaka-player@^4, adds immer to the UI registry, and documents Zustand/Immer safety constraints and shadcn CLI limitations.

Changes

Render Prop & Block Import Infrastructure

Layer / File(s) Summary
Documentation & Review Guidelines
prompts/code-rabbit.md, prompts/github-copilot.md, prompts/ide.md
Added Zustand/Immer safety constraints, shadcn CLI filename-collision rules, component render prop requirements, and dependency pinning guidance.
Component Type Contracts
apps/www/registry/default/blocks/linear-player/components/button.tsx, apps/www/registry/default/ui/captions.tsx, apps/www/registry/default/ui/mute-control.tsx, apps/www/registry/default/ui/picture-in-picture-control.tsx, apps/www/registry/default/ui/playback-control.tsx
Control component props now include render?: React.ReactElement alongside asChild, with documentation types updated accordingly.
Import Rewriting Infrastructure
apps/www/lib/registry.ts
fixImport function enhanced to recognize blocks/<blockName>/<folder> patterns and rewrite @/... imports to @/components/<blockName>/... paths before applying suffix-based fallback logic.
Registry Metadata & Dependencies
apps/www/registry/collection/registry-blocks.ts, apps/www/registry/collection/registry-hooks.ts, apps/www/registry/collection/registry-ui.ts
Pinned shaka-player@^4 in linear-player, basic-player, and youtube-music blocks; reorganized button file registrations from ui/ to components/; added async-retry, motion, and @types/async-retry to youtube-music; added immer to UI registry dependencies.
Control Component Implementations
apps/www/registry/default/blocks/linear-player/components/button.tsx, apps/www/registry/default/ui/captions.tsx, apps/www/registry/default/ui/mute-control.tsx, apps/www/registry/default/ui/picture-in-picture-control.tsx, apps/www/registry/default/ui/playback-control.tsx
Components implement conditional rendering: when render is provided, use Radix Slot and clone the element with children; otherwise preserve existing asChild/Button fallback behavior.
Component Import Path Refactoring
apps/www/registry/default/blocks/linear-player/components/bottom-controls.tsx, apps/www/registry/default/blocks/linear-player/components/captions-state-control.tsx, apps/www/registry/default/blocks/linear-player/components/pip-control.tsx, apps/www/registry/default/blocks/linear-player/components/playback-state-control.tsx, apps/www/registry/default/blocks/linear-player/components/playlist.tsx, apps/www/registry/default/blocks/linear-player/components/timeline-slider-control.tsx, apps/www/registry/default/blocks/linear-player/components/volume-state-control.tsx, apps/www/registry/default/examples/picture-in-picture-control-demo.tsx
All Button imports switch from @/.../ui/button to @/.../components/button to align with reorganized file structure.
Media Provider Module Migration
apps/www/registry/default/blocks/linear-player/components/media-player.tsx
MediaProvider import switched from legacy lib/media to new lib/media-kit module.
Store State Update Pattern
apps/www/registry/default/hooks/use-seek.ts
useSeek hook updated to use Immer draft-style setState callback (media.idle = false) instead of object spread for store updates.
Examples & Submodule Updates
apps/www/registry/pro
Pro submodule pointer advanced to new commit.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • WINOFFRG/limeplay#126: Modifies apps/www/lib/registry.ts and import-rewriting infrastructure that underpins this PR's block-based path logic.
  • WINOFFRG/limeplay#137: Updates registry metadata for blocks and UI components that align with this PR's file reorganization and dependency pinning.
  • WINOFFRG/limeplay#144: Modifies registry collections, media module paths, and hooks that overlap with changes in this PR.

Poem

A render prop journey hops to light,
Blocks rewrite paths and imports take flight.
🐰 Slot and clone, children tucked inside,
Immer guards the store with tidy pride.
New pins and rules keep the registry right.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title covers multiple distinct changes (registry imports, alias, testing, prompts) but adequately summarizes the primary fix of reorganizing registry imports and updating related configurations.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/registry-imports

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@apps/www/registry/collection/registry-blocks.ts`:
- Line 52: The registry declares a youtube-music block but the entire
apps/www/registry/default/blocks/youtube-music/ directory and its files (e.g.,
lib/media-kit.ts which should export MediaProvider, media-player.tsx, component
files and hooks referenced in registry-blocks.ts) are missing — add the complete
youtube-music block directory with all 13 declared files and ensure
lib/media-kit.ts exports MediaProvider like the linear-player counterpart; also
update the registryDependencies array for the youtube-music block in
registry-blocks.ts by removing the deprecated entries "use-playback",
"use-volume", and "use-timeline" so the block no longer references those APIs.
- Around line 173-174: Remove the unused dependency "async-retry" from
package.json and any import/usage references (the registry metadata in
registry-blocks.ts lists it but it is unused); then verify the registry entry in
registry-blocks.ts that declares files[].path for the "youtube-music" block
points to actual component files under
apps/www/registry/default/blocks/youtube-music/—either add the missing component
files (e.g., youtube-music-hover-player.tsx) into that directory or update the
files[].path values to the correct locations where those components currently
live; keep the "motion" dependency since youtube-music-hover-player.tsx uses it.

In `@apps/www/registry/default/blocks/linear-player/components/button.tsx`:
- Line 69: The Prettier formatting check failed; run the project's formatter in
the apps/www workspace to fix styling for the Button component (ensure the
render?: React.ReactElement lines and the surrounding prop definitions at the
render/asChild handling are reformatted). From the root of that workspace
execute the project's format script (bun run format) and commit the updated
formatting so the Button component's render/children/cloning logic (the Button
component and its render prop handling) passes CI.

In `@apps/www/registry/default/ui/captions.tsx`:
- Line 21: The only outstanding issue is a Prettier formatting violation in
apps/www (file captions.tsx around the render?: React.ReactElement prop); fix by
running the project's formatter in that workspace (cd apps/www && bun run
format) to apply Prettier rules, commit the resulting formatting changes, and
ensure the same formatting is applied for the other occurrences noted (lines
referencing the render prop at the other spots mentioned).
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: aa8240f6-7174-48fe-9a72-127d97c1dabf

📥 Commits

Reviewing files that changed from the base of the PR and between 5cc05c9 and 2ffcf18.

⛔ Files ignored due to path filters (2)
  • apps/www/next-env.d.ts is excluded by none and included by none
  • apps/www/scripts/validate-registries.ts is excluded by none and included by none
📒 Files selected for processing (24)
  • apps/www/lib/registry.ts
  • apps/www/registry/collection/registry-blocks.ts
  • apps/www/registry/collection/registry-hooks.ts
  • apps/www/registry/collection/registry-ui.ts
  • apps/www/registry/default/blocks/linear-player/components/bottom-controls.tsx
  • apps/www/registry/default/blocks/linear-player/components/button.tsx
  • apps/www/registry/default/blocks/linear-player/components/captions-state-control.tsx
  • apps/www/registry/default/blocks/linear-player/components/media-player.tsx
  • apps/www/registry/default/blocks/linear-player/components/pip-control.tsx
  • apps/www/registry/default/blocks/linear-player/components/playback-state-control.tsx
  • apps/www/registry/default/blocks/linear-player/components/playlist.tsx
  • apps/www/registry/default/blocks/linear-player/components/timeline-slider-control.tsx
  • apps/www/registry/default/blocks/linear-player/components/volume-state-control.tsx
  • apps/www/registry/default/blocks/linear-player/lib/media-kit.ts
  • apps/www/registry/default/examples/picture-in-picture-control-demo.tsx
  • apps/www/registry/default/hooks/use-seek.ts
  • apps/www/registry/default/ui/captions.tsx
  • apps/www/registry/default/ui/mute-control.tsx
  • apps/www/registry/default/ui/picture-in-picture-control.tsx
  • apps/www/registry/default/ui/playback-control.tsx
  • apps/www/registry/pro
  • prompts/code-rabbit.md
  • prompts/github-copilot.md
  • prompts/ide.md

},
{
path: `${BASE_SRC_URL}/lib/media.ts`,
path: `${BASE_SRC_URL}/lib/media-kit.ts`,
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot May 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Verify lib/media-kit.ts files exist and export MediaProvider

echo "Checking linear-player media-kit..."
if [ -f "apps/www/registry/default/blocks/linear-player/lib/media-kit.ts" ]; then
  echo "✓ linear-player/lib/media-kit.ts exists"
  rg -n "export.*MediaProvider" apps/www/registry/default/blocks/linear-player/lib/media-kit.ts
else
  echo "✗ linear-player/lib/media-kit.ts NOT FOUND"
fi

echo ""
echo "Checking youtube-music media-kit..."
if [ -f "apps/www/registry/default/blocks/youtube-music/lib/media-kit.ts" ]; then
  echo "✓ youtube-music/lib/media-kit.ts exists"
  rg -n "export.*MediaProvider" apps/www/registry/default/blocks/youtube-music/lib/media-kit.ts
else
  echo "✗ youtube-music/lib/media-kit.ts NOT FOUND"
fi

Repository: WINOFFRG/limeplay

Length of output: 269


🏁 Script executed:

# Check the registry file to see what line 182 references
echo "=== Registry file context around line 52 and 182 ==="
sed -n '50,55p' apps/www/registry/collection/registry-blocks.ts
echo ""
sed -n '180,185p' apps/www/registry/collection/registry-blocks.ts

echo ""
echo "=== YouTube-music block directory structure ==="
if [ -d "apps/www/registry/default/blocks/youtube-music" ]; then
  find apps/www/registry/default/blocks/youtube-music -type f | head -20
fi

echo ""
echo "=== Linear-player block directory structure for comparison ==="
if [ -d "apps/www/registry/default/blocks/linear-player" ]; then
  find apps/www/registry/default/blocks/linear-player -type f
fi

Repository: WINOFFRG/limeplay

Length of output: 1603


🏁 Script executed:

# Find the youtube-music block entry in registry-blocks.ts
echo "=== Finding youtube-music block entry ==="
rg -n "youtube-music" apps/www/registry/collection/registry-blocks.ts -B 5 -A 20

Repository: WINOFFRG/limeplay

Length of output: 2833


The youtube-music block is incomplete: the entire directory is missing from the PR.

  • apps/www/registry/default/blocks/linear-player/lib/media-kit.ts exists and correctly exports MediaProvider
  • apps/www/registry/default/blocks/youtube-music/ directory does not exist, but the registry declares 13 files in this block (line 182-238), including lib/media-kit.ts, media-player.tsx, all components, and hooks. This will cause silent installation failures.

Additionally, the youtube-music block's registryDependencies (lines 243-261) includes deprecated APIs that violate coding guidelines: remove "use-playback", "use-volume", and "use-timeline" from this list.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@apps/www/registry/collection/registry-blocks.ts` at line 52, The registry
declares a youtube-music block but the entire
apps/www/registry/default/blocks/youtube-music/ directory and its files (e.g.,
lib/media-kit.ts which should export MediaProvider, media-player.tsx, component
files and hooks referenced in registry-blocks.ts) are missing — add the complete
youtube-music block directory with all 13 declared files and ensure
lib/media-kit.ts exports MediaProvider like the linear-player counterpart; also
update the registryDependencies array for the youtube-music block in
registry-blocks.ts by removing the deprecated entries "use-playback",
"use-volume", and "use-timeline" so the block no longer references those APIs.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where is this mentioned "use-playback", "use-volume", and "use-timeline" these are deprecated?

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@WINOFFRG, you're right to question that — I apologize for the error. My previous comment incorrectly stated that "use-playback", "use-volume", and "use-timeline" are deprecated. There is no evidence in the codebase, guidelines, or this PR that those hooks are deprecated. In fact, the linear-player block itself lists "use-timeline" and "use-volume" in its own registryDependencies, which directly contradicts my claim.

That part of my earlier review was wrong and should be disregarded. The youtube-music block's registryDependencies referencing those hooks is perfectly valid.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

apps/www/registry/default/blocks/youtube-music/ directory does not exist, but the registry declares 13 files in this block (line 182-238), including lib/media-kit.ts, media-player.tsx, all components, and hooks. This will cause silent installation failures.

Also why do you think youtube-music should be there in default blocks?

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@WINOFFRG, you're absolutely right — I apologize for the incorrect assumption. Looking at the registry entry more carefully, the youtube-music block is marked with categories: ["pro"], and this PR also updates the apps/www/registry/pro Git submodule pointer (from ab6ea243... to 5cf39ff4...). The youtube-music files live inside that pro submodule, not under apps/www/registry/default/blocks/. My script only searched the default directory, so it naturally found nothing — but that was a flaw in my analysis, not a missing file issue.

The concern about youtube-music files being missing was invalid. I'll note this for future reviews.


✏️ Learnings added
Learnt from: WINOFFRG
Repo: WINOFFRG/limeplay PR: 146
File: apps/www/registry/collection/registry-blocks.ts:52-52
Timestamp: 2026-05-10T08:44:05.537Z
Learning: In the WINOFFRG/limeplay repository, registry blocks with `categories: ["pro"]` have their source files housed in the `apps/www/registry/pro` Git submodule, NOT under `apps/www/registry/default/blocks/`. Do not flag missing files for pro-category blocks by searching the `default` directory.

Note: Learnings are effective only in the context of similar code segments. To apply general coding guidelines, please configure review instructions. You can manage existing learnings in the app.

Comment thread apps/www/registry/collection/registry-blocks.ts
Comment thread apps/www/registry/default/ui/captions.tsx
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR tightens Limeplay’s shadcn registry/installation behavior by addressing import-rewriting edge cases, pinning breaking dependencies, and aligning control primitives with the b0 preset’s asChildrender transform expectations.

Changes:

  • Add render?: React.ReactElement support to multiple control primitives (and the linear-player block Button) to remain compatible with the b0 preset install transform.
  • Fix registry/block internal imports and filenames to avoid shadcn CLI import-hijacking; introduce media-kit.ts and pip-control.tsx in the linear-player block.
  • Improve registry validation and metadata: pin shaka-player@^4, add missing immer dependency, and enhance dependency resolution checks (including shadcn registry lookups).

Reviewed changes

Copilot reviewed 24 out of 26 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
prompts/ide.md Adds stricter Immer/Zustand and shadcn CLI authoring guidance for contributors.
prompts/github-copilot.md Updates Copilot review checklist with b0 render transform + dependency pinning + immer safety rules.
prompts/code-rabbit.md Updates CodeRabbit rules to flag shadcn import-hijacking risks and immer anti-patterns.
apps/www/scripts/validate-registries.ts Adds shadcn registry resolution checks/caching for missing registryDependencies.
apps/www/registry/default/ui/playback-control.tsx Adds render prop support and adjusts prop typing for b0 compatibility.
apps/www/registry/default/ui/picture-in-picture-control.tsx Adds render prop support and docs props update.
apps/www/registry/default/ui/mute-control.tsx Adds render prop support and docs props update.
apps/www/registry/default/ui/captions.tsx Adds render prop support and docs props update.
apps/www/registry/default/hooks/use-seek.ts Fixes Zustand+Immer state update to mutate draft (instead of returning a partial object).
apps/www/registry/default/examples/picture-in-picture-control-demo.tsx Updates linear-player Button import to block-scoped components/ path.
apps/www/registry/default/blocks/linear-player/lib/media-kit.ts New block-scoped media kit module (avoids media.ts filename collision).
apps/www/registry/default/blocks/linear-player/components/volume-state-control.tsx Updates Button import to block-scoped components/button.
apps/www/registry/default/blocks/linear-player/components/timeline-slider-control.tsx Updates Button import to block-scoped components/button.
apps/www/registry/default/blocks/linear-player/components/playlist.tsx Updates Button import to block-scoped components/button.
apps/www/registry/default/blocks/linear-player/components/playback-state-control.tsx Updates Button import to block-scoped components/button.
apps/www/registry/default/blocks/linear-player/components/pip-control.tsx Renamed PiP control component to avoid import collisions (picture-in-picture-controlpip-control).
apps/www/registry/default/blocks/linear-player/components/media-player.tsx Switches MediaProvider import to lib/media-kit.
apps/www/registry/default/blocks/linear-player/components/captions-state-control.tsx Uses block-scoped Button (and avoids global shadcn button naming collisions).
apps/www/registry/default/blocks/linear-player/components/button.tsx Adds render prop support to block Button for b0 preset compatibility.
apps/www/registry/default/blocks/linear-player/components/bottom-controls.tsx Updates PiP import to the new pip-control.
apps/www/registry/collection/registry-ui.ts Adds missing immer dependency for media-provider.
apps/www/registry/collection/registry-hooks.ts Pins shaka-player@^4 where used by hooks.
apps/www/registry/collection/registry-blocks.ts Pins shaka-player@^4, updates linear-player file paths/types, and updates pro block deps.
apps/www/next-env.d.ts Formatting-only change (adds semicolon).
apps/www/lib/registry.ts Enhances fixImport() to rewrite block-scoped install paths (@/components/<block>/...).
Comments suppressed due to low confidence (1)

apps/www/scripts/validate-registries.ts:193

  • Dependency resolution for URL-based deps is skipped unless the URL contains the substring limeplay. When REGISTRY_HOST is localhost (the dev script uses it), missing internal deps won’t be flagged because the URLs won’t match this check. Consider validating any URL dep whose depName is not in allNames regardless of host (or compare against the configured REGISTRY_HOST) so local builds catch missing dependencies too.
      if (dep.startsWith("http")) {
        const depName = dep.split("/").pop()?.replace(".json", "")
        if (depName && !allNames.has(depName)) {
          if (!dep.includes("limeplay")) {
            continue
          }
          warn(
            `"${item.name}" depends on "${depName}" (${dep}) which is not in the registry`
          )
          missingCount++
        }

Comment on lines +146 to +156
const SHADCN_REGISTRY_URL = "https://ui.shadcn.com/r/styles/default"

async function resolveFromShadcn(name: string): Promise<boolean> {
try {
const res = await fetch(`${SHADCN_REGISTRY_URL}/${name}.json`, {
method: "HEAD",
})
return res.ok
} catch {
return false
}
@WINOFFRG WINOFFRG merged commit 7e10729 into main May 10, 2026
4 of 5 checks passed
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.

2 participants