fix: registry imports, alias, testing and prompts#146
Conversation
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (6)
📝 WalkthroughWalkthroughThis PR adds ChangesRender Prop & Block Import Infrastructure
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
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
⛔ Files ignored due to path filters (2)
apps/www/next-env.d.tsis excluded by none and included by noneapps/www/scripts/validate-registries.tsis excluded by none and included by none
📒 Files selected for processing (24)
apps/www/lib/registry.tsapps/www/registry/collection/registry-blocks.tsapps/www/registry/collection/registry-hooks.tsapps/www/registry/collection/registry-ui.tsapps/www/registry/default/blocks/linear-player/components/bottom-controls.tsxapps/www/registry/default/blocks/linear-player/components/button.tsxapps/www/registry/default/blocks/linear-player/components/captions-state-control.tsxapps/www/registry/default/blocks/linear-player/components/media-player.tsxapps/www/registry/default/blocks/linear-player/components/pip-control.tsxapps/www/registry/default/blocks/linear-player/components/playback-state-control.tsxapps/www/registry/default/blocks/linear-player/components/playlist.tsxapps/www/registry/default/blocks/linear-player/components/timeline-slider-control.tsxapps/www/registry/default/blocks/linear-player/components/volume-state-control.tsxapps/www/registry/default/blocks/linear-player/lib/media-kit.tsapps/www/registry/default/examples/picture-in-picture-control-demo.tsxapps/www/registry/default/hooks/use-seek.tsapps/www/registry/default/ui/captions.tsxapps/www/registry/default/ui/mute-control.tsxapps/www/registry/default/ui/picture-in-picture-control.tsxapps/www/registry/default/ui/playback-control.tsxapps/www/registry/proprompts/code-rabbit.mdprompts/github-copilot.mdprompts/ide.md
| }, | ||
| { | ||
| path: `${BASE_SRC_URL}/lib/media.ts`, | ||
| path: `${BASE_SRC_URL}/lib/media-kit.ts`, |
There was a problem hiding this comment.
🧩 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"
fiRepository: 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
fiRepository: 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 20Repository: 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.tsexists and correctly exportsMediaProvider✓apps/www/registry/default/blocks/youtube-music/directory does not exist, but the registry declares 13 files in this block (line 182-238), includinglib/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.
There was a problem hiding this comment.
Where is this mentioned "use-playback", "use-volume", and "use-timeline" these are deprecated?
There was a problem hiding this comment.
@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.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
@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.
There was a problem hiding this comment.
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 asChild → render transform expectations.
Changes:
- Add
render?: React.ReactElementsupport 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.tsandpip-control.tsxin the linear-player block. - Improve registry validation and metadata: pin
shaka-player@^4, add missingimmerdependency, 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-control → pip-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. WhenREGISTRY_HOSTislocalhost(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 whosedepNameis not inallNamesregardless of host (or compare against the configuredREGISTRY_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++
}
| 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 | ||
| } |
Summary by CodeRabbit
New Features
Dependencies
Documentation
Chores