feat(schema): resolve symlinked schema directories - #1298
Conversation
Schema discovery filtered directory entries with `Dirent.isDirectory()`, which reports the raw entry type and returns false for symlinks — even those pointing at a real directory. As a result, symlinked schema dirs in the user/project/package schema locations were silently skipped. Add a shared `isSchemaDir()` helper that accepts real directories and dereferences symlinks (via statSync) to admit symlinked directories while still rejecting symlinks-to-files and broken links. Use it at all six discovery sites in resolver.ts and in `schema validate` in schema.ts.
Add unit tests for isSchemaDir (real dir, symlink-to-dir, symlink-to-file, broken symlink, regular file) plus integration tests confirming listSchemas and listSchemasWithInfo pick up a symlinked user schema dir while ignoring symlinks whose target is a file.
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughAdds an ChangesSymlink-aware schema directory detection
Estimated code review effort: 2 (Simple) | ~12 minutes Possibly related PRs
Suggested reviewers: ✨ Finishing Touches🧪 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 Warning |
Summary
P0 of the performance audit. Vercel Speed Insights showed perf 85 with FCP 2.76s / LCP 3.42s / TTFB 0.85s all amber. Root cause: every public page used the cookie-bound Supabase client, forcing per-request dynamic SSR with no caching — and the existing
revalidateTagcalls invalidated nothing because no cached read attached tags.This branch decouples public reads from the auth client and adopts Cache Components (
cacheComponents: true) for the public surface.What changed
src/lib/auth/public.ts) for anonymous published-content reads — nocookies(), so routes are no longer forced dynamic.use cache+cacheTag+cacheLifeonlistPublishedPosts/getPublishedPost/getAllTags/getAllCategories(taggedposts-list+post-${slug}) and publicgetRef. The existingrevalidateTagcalls in the post/ref Server Actions now actually invalidate.cache()wraps the per-slug post read sogenerateMetadata+ body share one query per request.generateStaticParams+ ISR on/blog/[slug](build-time pre-warm, ISR fallback for new slugs — not frozen).<Suspense>.Skeletonprimitive (src/components/ui/skeleton.tsx) replacing ~9 duplicated inline skeletons.use cachereads throwDatabaseError— verified against Next docs that throws are not written to cache (no poisoning) and theDbUnavailablefallbacks stay live.openspec/changes/public-read-caching-perf/.Route shape (build output)
/○ static + ISR (15m/1h), Recent Writing streamed/blog/[slug]◐ PPR + ISR/admin/*◐ PPR behind auth guard (unchangedsrc/proxy.ts)Verification
pnpm buildpasses, warning-clean (32 pages)See ADR
docs/adr/0003-cache-components-public-content-delivery.md.Summary by CodeRabbit