Skip to content

fix(react-doctor): clear architecture structure warnings#344

Open
bntvllnt wants to merge 3 commits into
mainfrom
fix/269-architecture
Open

fix(react-doctor): clear architecture structure warnings#344
bntvllnt wants to merge 3 commits into
mainfrom
fix/269-architecture

Conversation

@bntvllnt
Copy link
Copy Markdown
Collaborator

Closes #269

Summary

  • add a Knip workspace config so generated and framework-owned files are excluded from file-structure diagnostics
  • remove unused public registry exports and keep helper types private where they are only used internally
  • replace the BlogCard duplicate alias with a wrapper and regenerate the registry copy from the source component

Validation

  • pnpm -F @vllnt/ui lint
  • pnpm -F @vllnt/ui exec tsc --noEmit --project tsconfig.build.json
  • pnpm -F @vllnt/ui-registry exec tsc --noEmit --project tsconfig.json
  • pnpm build
  • pnpm test:once
  • git diff --check
  • npx --yes react-doctor . --diff origin/main --annotations --fail-on error --offline
  • npx --yes react-doctor . --offline --json: targeted files/exports/types/duplicates warnings = 0

Notes

  • Next.js build still emits the known multiple-lockfile root warning in worktrees.
  • Vitest still emits the known jsdom navigation, InteractiveTimeline duplicate-key, and ShareDialog description warnings.

@bntvllnt bntvllnt added react-doctor Reported by react-doctor (codebase health) tech-debt Refactoring or cleanup dx Developer experience labels May 12, 2026
@bntvllnt bntvllnt self-assigned this May 12, 2026
@vllnt-pilot vllnt-pilot Bot had a problem deploying to Preview · pr-344-storybook May 18, 2026 17:14 Failure
@vllnt-pilot
Copy link
Copy Markdown

vllnt-pilot Bot commented May 18, 2026

Preview ready · pr-344-ui-registry

Service Status Preview
ui-registry Ready https://pr-344-ui-registry.preview.vllnt.ai
Inspect
  • Deployed to vllnt-cluster from ee3d20e
  • Reply with /clean to destroy this preview now

@vllnt vllnt deleted a comment from vllnt-pilot Bot May 18, 2026
@vllnt vllnt deleted a comment from vercel Bot May 18, 2026
Copy link
Copy Markdown
Collaborator Author

@bntvllnt bntvllnt left a comment

Choose a reason for hiding this comment

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

Review — 1 blocking finding (REQUEST_CHANGES not submitted because GitHub blocks self-review verdicts)

BLOCKING

Verdict: request changes / not safe to merge yet.

  • C1 — BlogCard still violates the repo component export contract.
    • Evidence: packages/ui/src/components/blog-card/blog-card.tsx:93-95 and apps/registry/registry/default/blog-card/blog-card.tsx:93-95 now replace the alias with a wrapper function, but neither export is React.forwardRef(...) and neither sets BlogCard.displayName.
    • Why it matters: this was the specific R9-class issue I needed to re-check. docs/agents/RULES.md R9 and docs/agents/COMPONENTS.md require every named component export to use forwardRef and set displayName; changing the alias to a plain wrapper keeps the named export outside that contract and drops ref passthrough for consumers using the legacy name.
    • Fix: implement BlogCard as a real React.forwardRef wrapper around ContentCard, set BlogCard.displayName = "BlogCard", and keep the registry copy in sync with the package source.

WARN

  • Local registry touched-file lint currently fails on changed registry files (apps/registry/lib/jsonld.ts, apps/registry/lib/stats.ts, apps/registry/types/registry.ts) after validation bootstrap. Some diagnostics appear to be broader existing lint/style debt, so I am not treating them as the primary blocker here, but the PR body should not imply all local validation was independently re-run by this reviewer.

VERIFIED CLEAN

  • PR metadata is live and coherent: open, non-draft, fix/269-architecture -> main, Closes #269, 10 changed files matching the reviewed diff.
  • The react-doctor architecture target is green locally: pnpm doctor exited 0.
  • BlogCard no longer uses the previous direct alias (export const BlogCard = ContentCard), and both package source and registry copy match the same wrapper shape.
  • GitHub checks are green/neutral on the reviewed head: 12 passing checks plus the neutral superseded legacy preview check.

VALIDATION

  • Reviewed head: ee3d20e9bfc36849f0bcc8b47644bd6d3fb47a3a.
  • Ran: git diff --check origin/main...HEAD — pass.
  • Ran: pnpm doctor — pass.
  • Ran with temporary worktree node_modules symlinks from /home/ubuntu/ui: pnpm --filter @vllnt/ui test:once -- blog-card — pass.
  • Ran with the same validation bootstrap: pnpm --filter @vllnt/ui exec eslint src/components/blog-card/blog-card.tsx src/components/blog-card/blog-card.test.tsx — pass.
  • Ran with the same validation bootstrap: pnpm --filter @vllnt/ui-registry exec eslint lib/jsonld.ts lib/og-templates.ts lib/og.ts lib/schemas.ts lib/stats.ts types/registry.ts registry/default/blog-card/blog-card.tsx — fails on registry lint/style diagnostics; see warning above.
  • Not run locally: full pnpm build / pnpm test:once; relied on current GitHub checks for full-suite signal.


// Keep BlogCard as an alias for backward compatibility
export const BlogCard = ContentCard;
export function BlogCard(props: ContentCardProps) {
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Blocking: this still does not resolve the R9 component-export contract. BlogCard is now a named wrapper component, but it is not React.forwardRef(...) and has no BlogCard.displayName. Please make the compatibility export a real forwardRef wrapper, set the displayName, and keep the registry copy in sync.


// Keep BlogCard as an alias for backward compatibility
export const BlogCard = ContentCard;
export function BlogCard(props: ContentCardProps) {
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Same blocker in the registry copy: the generated/example component still exports BlogCard as a plain function with no forwardRef or displayName. Once the package source is corrected, regenerate/sync this copy so consumers do not get a different contract.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dx Developer experience react-doctor Reported by react-doctor (codebase health) tech-debt Refactoring or cleanup

Projects

None yet

Development

Successfully merging this pull request may close these issues.

react-doctor: file/exports/types structure (files + exports + types + duplicates, 336 warnings)

1 participant