Skip to content

chore: remove dead code, consolidate orphaned MDX, standardize Node version#305

Merged
yasinmiran merged 4 commits into
mainfrom
chore/codebase-audit-cleanup
Jun 18, 2026
Merged

chore: remove dead code, consolidate orphaned MDX, standardize Node version#305
yasinmiran merged 4 commits into
mainfrom
chore/codebase-audit-cleanup

Conversation

@yasinmiran

Copy link
Copy Markdown
Collaborator

Cleanup pass from a codebase audit, executed in three focused commits. No behavior changes to live pages; all routes and content preserved.

1. Content consolidation (JAMstack)

research-support, training, and landing each had an MDX entry that was never queried (getCollection), had drifted from the live .astro page, and acted as a dead second source of truth. These pages aren't CMS-editable and are simple to edit directly, so I removed the orphaned MDX and their collection definitions. grid-feature, basic-feature, and tiny-card-with-icon-left went too, since only the deleted landing page referenced them.

2. Dead code and unused dependencies

  • Components with zero importers: hero-scene, protein-scene, map-with-pin, useful-links, what-we-offer (last one was a 0-byte stub).
  • The entire unused src/types/ directory.
  • Dead exports: classNames, truncateStringToLength, getOrganization, uploadBlob, OAUTH_AUTH_URL.
  • The unlinked, indexable accessibility-test dev scratch page (/admin keeps its own noindex).
  • Dead Tailwind tokens (brand.secondary-text, brand.green, light.on-primary, unused invert steps) and the redundant global .tess-* styles already scoped in the training page.
  • Ten unused dependencies, including the three / @react-three/* stack left over from the replaced 3D scenes, and animate.css (its only use went with the deleted tiny-card). Added a Node >=22 engines floor.

3. Node version

Both workflows hardcoded node-version: 24 while the docs still said Node 18. Added a .nvmrc as the single source of truth and pointed both workflows at it.

Verification

  • astro check + astro build: pass
  • node scripts/check-slugs.mjs: all names valid
  • node scripts/test-pages.mjs: 182/182 pages, 185/185 assets OK (182 not 183, since the test page is gone)

Notes

  • Net +5 / -1625 lines.
  • project_number was flagged as a dead schema field in the audit but I kept it: it is CMS-editable (admin/schema.ts) and present in ~29 funding entries.
  • Verified the removed three.js stack was only used by the deleted scenes; the about-page hero (about-hero-visual.tsx) is framer-motion, not R3F.

The research-support, training, and landing pages render from their .astro routes. The matching MDX entries were never queried (no getCollection) and had drifted from the live copy, leaving a second, dead source of truth. Editing these pages directly in .astro is simple enough that the MDX layer adds no value here.

Also removes grid-feature, basic-feature, and tiny-card-with-icon-left, which were only referenced by the deleted landing page.
Drops components with no importers (hero-scene, protein-scene, map-with-pin, useful-links, what-we-offer), the unused src/types definitions, dead exports (classNames, truncateStringToLength, getOrganization, uploadBlob, OAUTH_AUTH_URL), the unlinked and indexable accessibility-test scratch page, dead Tailwind tokens, and the redundant global .tess-* styles already scoped in the training page.

Removes ten unused dependencies, including the three.js / react-three stack left over from the replaced 3D scenes and animate.css (its only use went with tiny-card), and declares a Node >=22 engines floor.
Both workflows hardcoded node-version: 24 while the project docs still referenced Node 18. Adds a .nvmrc as the single source of truth and points both workflows at it, so the runtime version lives in one place.
Copilot AI review requested due to automatic review settings June 18, 2026 12:26

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Cleanup-focused PR that removes unused content/code/dependencies and standardizes the Node version source of truth for CI and local development.

Changes:

  • Removed orphaned MDX content entries and corresponding astro:content collection definitions.
  • Deleted unused components/types/utilities and stripped unused Tailwind tokens / global styles.
  • Consolidated Node version management by introducing .nvmrc and wiring GitHub Actions workflows to it.

Reviewed changes

Copilot reviewed 22 out of 26 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
tailwind.config.mjs Removes unused theme tokens (colors + invert steps).
src/types/enums.ts Deletes unused enum type definitions.
src/types/components.d.ts Deletes unused component prop/type definitions.
src/types/common.d.ts Deletes unused shared type definitions.
src/styles/global.scss Drops unused global imports/styles (animate.css + TeSS overrides).
src/pages/accessibility-test.astro Removes unlinked dev scratch page.
src/lib/utils.ts Removes unused helper exports.
src/data/organizations.ts Removes unused getOrganization export.
src/content/training/index.mdx Removes orphaned MDX entry.
src/content/research-support/index.mdx Removes orphaned MDX entry.
src/content/landing/index.mdx Removes orphaned MDX entry.
src/content/config.ts Removes unused astro:content collections tied to deleted/orphaned content.
src/components/what-we-offer.astro Removes unused/stub component.
src/components/useful-links.astro Removes unused component.
src/components/tiny-card-with-icon-left.tsx Removes unused component (and associated animate.css usage).
src/components/sections/grid-feature.astro Removes unused section component.
src/components/sections/basic-feature.astro Removes unused section component.
src/components/protein-scene.tsx Removes unused 3D scene component.
src/components/map-with-pin.astro Removes unused map component.
src/components/hero-scene.tsx Removes unused 3D hero scene component.
src/components/admin/github.ts Removes unused exports (uploadBlob, OAUTH_AUTH_URL).
pnpm-lock.yaml Updates lockfile to reflect removed dependencies.
package.json Removes unused dependencies and adds Node engine constraint.
.nvmrc Adds Node version single source of truth for tooling/CI.
.github/workflows/pr-test.yml Switches Node setup to read version from .nvmrc.
.github/workflows/gh-pages.yml Switches Node setup to read version from .nvmrc.
Files not reviewed (1)
  • pnpm-lock.yaml: Generated file

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread package.json
Keeps engines and .nvmrc on the same major so local installs match CI and avoid hard-to-reproduce version drift.
@yasinmiran yasinmiran merged commit 3937625 into main Jun 18, 2026
1 check passed
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