Skip to content

Remove import-free files, duplicate analytics wiring and eight unused dependencies - #1164

Merged
yattias merged 2 commits into
mainfrom
cleanup/1-unused-files
Oct 10, 2026
Merged

yattias merged 2 commits into
mainfrom
cleanup/1-unused-files

Conversation

@yattias

@yattias yattias commented Oct 10, 2026 •

Copy link
Copy Markdown
Member

First chunk of the dead-code removal plan (docs/dead-code-report.md, kept local). Everything removed here was imported by nothing: found with knip 5 plus an independent import-graph scan, then each file was grepped for its basename to rule out dynamic imports and string references, and re-checked against today's main.

What goes

  • Empty files: RequestFundingModal.tsx, VoteButton.tsx (0 bytes each).
  • Tiptap template leftovers: Pages-router files inside components/Editor/pages, the *Free AI stubs, useSidebar / SidebarContext, five barrels nobody imports, and app/notebook/robots.ts (only app/robots.ts is a metadata file, so this never ran).
  • Analytics duplicates: the older amplitude.service.ts and AmplitudeProvider, and AnalyticsProvider, which was never mounted. analytics.service.ts is the live path and is untouched.
  • Unused UI and helpers: Aurora / CardSwap / SplitText / SpotlightCard, Card, badges, Pill nav, six icon files, RSCBadgeExamples, feed and notification leftovers, ReleaseNotesModal, ShareModalTrigger, profile About pieces, expert-finder reply-to files, journal.service.ts, hubStore.ts, types/audit.ts and the four audit helpers only it called, avatarUtil, dateUtils.
  • ChangelogLink.tsx, which lost its last importer in the "Help & resources" sidebar merge (Recently visited shows pictures, and the sidebar footer is one Help & resources menu #1150-era) after the scan.
  • Dependencies: ogl (only Aurora used it), tailwindcss-animate and @tailwindcss/typography (no Tailwind plugins are registered), autoprefixer (not in postcss.config.mjs), @eslint/eslintrc (flat config), and @types/qrcode.react, @types/react-datepicker, @types/react-avatar-editor (those libraries ship their own types). Removed with npx -y npm@10.7.0 uninstall.
  • Declared date-fns: five files import it directly, but it only reached node_modules through @types/react-datepicker. Without the declaration /peer-review, /journal and anything else rendering FundingProposalCard fails to compile. Pinned to the 3.x line that was already installed. (highlight.js, @radix-ui/react-portal, @tanstack/react-query and wagmi are in the same situation but still resolve today; declaring them is a follow-up.)
  • Config: tsconfig.json no longer excludes a file that does not exist; .env.example drops two variables nothing reads; two commented-out blocks in hooks/useTip.ts and next.config.js.

63 files deleted, 4156 lines removed (lockfile included); no behaviour change intended.

Checks

  • npm run lint: 0 errors (2 pre-existing warnings in untouched files)
  • npm run type-check: clean
  • knip re-run on the branch: none of the removed files are referenced, no new unused exports or dependencies
  • Dev server on the branch: home, peer review, journal, My Funding and the work pages render; API calls succeed

Next

Chunk 2 (cleanup/2-funding-wallet-files) follows once this is merged.

🤖 Generated with Claude Code

… dependencies

First chunk of the dead-code plan. Everything here was imported by nothing
(knip plus an independent import-graph scan, cross-checked by grep on the
current main).

- Two empty files, the Tiptap template leftovers (Pages-router files inside
  components/Editor, the *Free AI stubs, useSidebar/SidebarContext, five
  unused barrels) and the nested app/notebook/robots.ts that Next.js never
  reads.
- The older Amplitude service and the two providers that were never mounted;
  analytics.service.ts is the live path.
- Unused UI, modals, icons, feed, profile, expert-finder and store/service
  files, types/audit.ts and the audit helpers only it used, and
  ChangelogLink.tsx, which lost its last importer in the sidebar footer merge.
- Dependencies nothing resolves: ogl, tailwindcss-animate,
  @tailwindcss/typography, autoprefixer, @eslint/eslintrc and three @types
  packages for libraries that ship their own types.
- tsconfig no longer excludes a file that does not exist; .env.example drops
  two variables nothing reads; two commented-out blocks go.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@yattias
yattias requested a review from a team as a code owner October 10, 2026 12:45
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Credits must be used to enable repository wide code reviews.

@vercel

vercel Bot commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

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

Project Deployment Actions Updated
web Ready Ready Preview Oct 10, 2026 12:53pm UTC

Request Review

It only reached node_modules through @types/react-datepicker, which the
previous commit removed, so /peer-review, /journal and anything else
rendering FundingProposalCard failed to compile with "Can't resolve
'date-fns'". Pinned to the 3.x line that was already installed; a bump to
4.x (which react-datepicker 8 nests its own copy of) is a separate change.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@sonarqubecloud

Copy link
Copy Markdown

@yattias
yattias merged commit d9c4257 into main Oct 10, 2026
4 of 5 checks passed
@yattias
yattias deleted the cleanup/1-unused-files branch October 10, 2026 13:19

This branch was successfully deployed

1 active deployment
Preview — 6bb3113a Deployed Oct 10, 2026 by vercel[bot]
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.

1 participant