Skip to content

chore: dead-code sweep — remove unused UI snippets and demo dependencies - #286

Open
mbret wants to merge 1 commit into
masterfrom
chore/dead-code-sweep-2026-08-03
Open

chore: dead-code sweep — remove unused UI snippets and demo dependencies#286
mbret wants to merge 1 commit into
masterfrom
chore/dead-code-sweep-2026-08-03

Conversation

@mbret

@mbret mbret commented Aug 3, 2026

Copy link
Copy Markdown
Owner

Automated dead-code sweep. Candidates were surfaced with knip (temporary config, not committed) and every deletion was then verified by repo-wide greps (excluding node_modules, dist, coverage output) for the file basename, its import path, and each exported symbol — including intra-directory relative imports (./close-button style) and tsconfig path aliases. Only items whose searches came back empty were removed.

Deleted files (one line each, with evidence)

apps/demo (private app)

  • src/components/ui/avatar.tsx — no import of ui/avatar anywhere in the workspace or repo
  • src/components/ui/drawer.tsx — no import of ui/drawer in demo (the react-reader hit is that package's own, kept drawer.tsx)
  • src/components/ui/input-group.tsx — no import of ui/input-group anywhere
  • src/components/ui/popover.tsx — no import of ui/popover anywhere
  • src/components/ui/tooltip.tsx — no import of ui/tooltip anywhere
  • src/types.ts — declared only the __PROSE_READER_DEBUG global; nothing under apps/demo references that global (the packages that use it declare it themselves in packages/shared/src/report.ts)

packages/react-reader (published package — none of these are reachable from src/index.ts, so the published surface is unchanged)

  • src/components/ui/accordion.tsx — no import of ui/accordion anywhere
  • src/components/ui/avatar.tsx — no import of ui/avatar anywhere
  • src/components/ui/checkbox.tsx — no import of ui/checkbox in react-reader (demo's checkbox usage is demo's own file)
  • src/components/ui/input-group.tsx — no import of ui/input-group anywhere
  • src/components/ui/popover.tsx — no import of ui/popover anywhere
  • src/components/ui/tooltip.tsx — no import of ui/tooltip anywhere

Removed dependencies (apps/demo)

  • @chakra-ui/styled-system — no source reference anywhere; npm ls shows demo as its only dependent (Chakra v3 no longer uses it)
  • @react-rxjs/utils — no source reference anywhere; no other dependent
  • react-use — no source reference anywhere; no other dependent
  • stream-browserify — no source reference anywhere; demo's vite stream alias points at the local stream-shim.js, not this package

package-lock.json regenerated with the pinned toolchain (Node v25.9.0 / npm 11.12.1 via .nvmrc).

Deliberately left in (flagged by tooling but verified live or intentional)

  • @babel/core (demo) — peer dependency of @rolldown/plugin-babel, used in demo's vite.config.ts
  • @types/sax (archive-reader) — xmldoc's bundled xmldoc.d.ts does import { SAXParser } from "sax", so tsc needs these types
  • buffer devDep (archive-reader) — local install of the package's own optional peer dependency for tests
  • root reactjrx — mirrors the root rxjs: "*" single-instance/dedup convention
  • All unused-export findings in published packages — potentially external API surface, out of scope for this sweep

Verified remainder (not shipped to keep the PR reviewable)

The same verification confirmed 11 more dead files in apps/front (~530 lines), left for a follow-up sweep: src/components/ui/{avatar,checkbox,close-button,dialog,drawer,field,input-group,popover,radio,slider,tooltip}.tsx (front only uses button, color-mode, provider; close-button is imported solely by the dead dialog/drawer/popover).

Gates

Baseline recorded on a clean checkout of the base commit (4e97270), then re-run after deletions:

  • npm run build (18 projects) ✅
  • npm run tsc (8 projects) ✅
  • npm run lint + npm run format (biome) ✅
  • lerna run test vitest suites (15 projects) ✅
  • Playwright (chromium + Mobile Chrome, the browsers available in the sandbox): 78 failures byte-identical before and after the change (pre-existing/environment-only; CI runs the full browser matrix on macOS) — zero new failures introduced

Docs: no gitbook/ update needed — checked; nothing deleted is public surface or documented behavior.

🤖 Generated with Claude Code

https://claude.ai/code/session_01WLMBGKeniwkeDdbxUzYMU5


Generated by Claude Code

Dead-code sweep verified by knip plus repo-wide reference greps:

- apps/demo: delete unused ui snippet components (avatar, drawer,
  input-group, popover, tooltip) and unused global type shim types.ts
- apps/demo: drop dependencies @chakra-ui/styled-system, @react-rxjs/utils,
  react-use and stream-browserify — no source references anywhere
- packages/react-reader: delete unused internal ui snippet components
  (accordion, avatar, checkbox, input-group, popover, tooltip); none are
  reachable from the package entry, so the published surface is unchanged

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WLMBGKeniwkeDdbxUzYMU5
@vercel

vercel Bot commented Aug 3, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
prose-reader-demo Ready Ready Preview Aug 3, 2026 7:29am
prose-reader-front Ready Ready Preview Aug 3, 2026 7:29am

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