Skip to content

Cleanup unused dependencies and src files - #1986

Open
marcleblanc2 wants to merge 2 commits into
mainfrom
marc/cleanup/dead-src-code
Open

marcleblanc2 wants to merge 2 commits into
mainfrom
marc/cleanup/dead-src-code

Conversation

@marcleblanc2

@marcleblanc2 marcleblanc2 commented Sep 17, 2026

Copy link
Copy Markdown
Contributor

Summary

Two independent cleanups, each its own commit.

Delete src/ files with no importers

Found by grepping for import specifiers of every file under src/:

  • src/components/PreCode.tsx: empty file; the real PreCode is exported from PreCodeBlock.tsx
  • src/components/ResourceEstimator.tsx: older duplicate; MdxComponents.tsx imports resource-estimator/ResourceEstimator.tsx
  • src/components/DemoLayout.tsx: template leftover (YouTube tabs for "Text-to-Image", "Text-to-Speech", ...)
  • src/components/TopBanner.tsx, src/components/icons/Globe.tsx, src/components/icons/BugIcon.tsx

allCoreContent in src/utils/contentlayer.ts filtered on a draft frontmatter field that contentlayer.config.ts does not declare and that no .mdx file sets, so its production and development branches were equivalent. Collapsed to one.

Remove dependencies nothing imports and stale RSS .gitignore entries

pnpm remove of every package in package.json with no import in src/, dev/, or any config file:

@docsearch/react (only its CSS is vendored in src/components/search/docsearch/), @mdx-js/mdx, date-fns, fast-glob, feed, prism-react-renderer, react-highlight-words + @types/react-highlight-words, react-syntax-highlighter, rehype-toc, simple-functional-loader, dotenv.

Kept on purpose: shiki (peer dependency of rehype-pretty-code) and sharp (Next.js image optimization).

Also drops the .gitignore entries for public/changelog.rss and public/technical-changelog.rss. Nothing generates them any more: the feed comes from sourcegraph.com (src/data/constants.ts) and src/proxy.ts redirects the old paths to it.

Verification

  • pnpm install --frozen-lockfile, npx tsc --noEmit, pnpm run lint (0 errors) on the combined branch
  • pnpm run build exit 0 and pnpm start serving /, /cody/quickstart, /api/versions with 200, on each change separately before they were combined
  • Vercel preview deployment on this PR

@vercel

vercel Bot commented Sep 17, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated
sourcegraph-docs Ready Ready Preview Sep 17, 2026 10:13am UTC

Request Review

@github-actions

Copy link
Copy Markdown
Contributor

@marcleblanc2 marcleblanc2 mentioned this pull request Sep 17, 2026
@marcleblanc2 marcleblanc2 changed the title Remove components nothing imports and the unused draft filter Remove unused imports Sep 17, 2026
@marcleblanc2
marcleblanc2 marked this pull request as ready for review September 17, 2026 03:37
@marcleblanc2
marcleblanc2 enabled auto-merge (squash) September 17, 2026 03:37
@marcleblanc2 marcleblanc2 changed the title Remove unused imports build: Remove unused imports Sep 17, 2026
@marcleblanc2 marcleblanc2 changed the title build: Remove unused imports Remove unused src files, dependencies, and stale .gitignore entries Sep 17, 2026
@github-actions

This comment has been minimized.

@marcleblanc2 marcleblanc2 changed the title Remove unused src files, dependencies, and stale .gitignore entries Cleanup unused dependencies and src files Sep 17, 2026
@marcleblanc2
marcleblanc2 force-pushed the marc/cleanup/dead-src-code branch from 333766c to cd1dfe4 Compare September 17, 2026 10:08
marcleblanc2 and others added 2 commits September 17, 2026 04:10
PreCode.tsx was empty; ResourceEstimator.tsx was an older copy of
resource-estimator/ResourceEstimator.tsx, which MdxComponents imports;
DemoLayout, TopBanner, Globe and BugIcon have no importers.

allCoreContent filtered on a `draft` frontmatter field that
contentlayer.config.ts does not declare and no page sets, so the
production and development branches did the same thing.

Amp-Thread-ID: https://ampcode.com/threads/T-01a0ad56-bd79-73ce-bc8e-a5405d0c11f2
Co-authored-by: Amp <amp@ampcode.com>
None of these packages are imported by src/, dev/, or any config file:
@docsearch/react (only its CSS is vendored), @mdx-js/mdx, date-fns,
fast-glob, feed, prism-react-renderer, react-highlight-words and its
@types, react-syntax-highlighter, rehype-toc, simple-functional-loader,
dotenv.

public/changelog.rss and public/technical-changelog.rss are no longer
generated here: the feed is served from sourcegraph.com (see
src/data/constants.ts) and src/proxy.ts redirects to it.

Amp-Thread-ID: https://ampcode.com/threads/T-01a0ad56-bd79-73ce-bc8e-a5405d0c11f2
Co-authored-by: Amp <amp@ampcode.com>
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