Skip to content

chore: prune 6 unused dependencies, 2 dead scripts, and dead Tailwind globs - #35

Merged
Programcode merged 2 commits into
mainfrom
chore/prune-unused-deps-and-dead-config
Sep 7, 2026
Merged

Programcode merged 2 commits into
mainfrom
chore/prune-unused-deps-and-dead-config

Conversation

@Programcode

@Programcode Programcode commented Sep 6, 2026 •

Copy link
Copy Markdown
Owner

Second PR from the over-engineering audit. Plumbing only: no source file changes. Independent of #34, #36, #37, and #38, based directly on current main.

Note: #34 also edits package.json and package-lock.json. Whichever merges second needs a lockfile rebase, which npm ci regenerates, and the verification numbers below should be re-run against the rebased lockfile. I originally stacked this on #34 to avoid that, but CodeRabbit refuses to review a PR whose base is not main, so independent branches are the better trade.

Dependencies removed

Each has zero imports across src, e2e, scripts, supabase, and every config file:

  • @stripe/stripe-js — src/lib/stripe.ts drives checkout entirely through the create-checkout / create-portal Edge Functions and then hands the returned URL to openExternalUrl. The browser SDK is never loaded.

  • i18next-browser-languagedetector — src/i18n.ts sets lng and fallbackLng directly, and the settings page calls changeLanguage. No detector is ever registered.

  • @types/jspdf and @types/react-joyride — both runtime packages ship their own declarations (jspdf declares types: types/index.d.ts, react-joyride declares dist/index.d.ts), so the DefinitelyTyped stubs are dead weight that can only drift.

  • baseline-browser-mapping and caniuse-lite — declared as direct dependencies, never imported. Both stay installed transitively through autoprefixer → browserslist, the only consumer.

    One wrinkle worth stating rather than glossing: because autoprefixer is a devDependency, npm now records both packages as "dev": true in the lockfile. So "still installed transitively" holds for installs that include devDependencies. That covers every install path in this repo, all plain npm ci:

    Dockerfile:11                    npm ci
    .github/workflows/deploy.yml:31  npm ci
    .github/workflows/deploy.yml:108 npm ci
    .github/workflows/staging-e2e.yml:57 npm ci
    

    No path uses --omit=dev or --production, and Vercel installs dev dependencies too. If a prod-only install stage is ever added ahead of a PostCSS step, these would need to move back.

@types/file-saver deliberately stays: file-saver ships no declarations of its own.

Also removed

  • test:coverage script. Nothing invokes it: no workflow, npm script, or shell script calls it, and the documented command is npm test -- --coverage, which both verify and CI use. To be precise, .audit/crossfire.tsv mentions npm run test:coverage in two rows, but those are historical records of commands run in August, not callers. I left that log untouched rather than edit history to make this claim tidier.
  • test:e2e:ui script — no workflow, doc, or script references it.
  • Tailwind content globs for ./pages, ./components, and ./app. None of those directories exists here; all source lives in src/.

Rejected during this pass

Two config cuts I tried and backed out:

  1. The compilerOptions block in the root tsconfig.json, on the theory that nothing extends it and typecheck runs against tsconfig.app.json. Reverted: esbuild parses the root tsconfig.json when it transforms vite.config.ts and vitest.config.ts, so it is not unreferenced.

  2. optimizeDeps.entries: ['index.html']. I originally removed this as a restatement of Vite's default. That was wrong, and it is now documented in the config with a comment instead. Vite's default crawls every .html file under the root, and this repo has 84 of them, because public/ holds 58 prerendered SEO pages plus their siblings:

    $ find . -name "*.html" -not -path "./node_modules/*" -not -path "./dist/*" -not -path "./ios/*" | wc -l
    84
    

    The explicit entry narrows dev-server prebundling from 84 files to 1. It is load-bearing, so it stays, with a comment so the next person does not make my mistake.

Verification

Clean npm ci on Node 22, all green:

check result
npm run lint pass
npm run typecheck pass
npm test -- --coverage 95 files, 925 tests pass, coverage 90.45% stmts
npm run test:edge 121 pass
npm run build pass
npm run test:e2e 126 pass (desktop + mobile Chromium)

The dependency removals are largely self-verifying: any static consumer in src, e2e, or scripts would break typecheck or build after a clean npm ci, and both are green.

Not run: the WebKit smoke gate and the protected staging suite. No rendering-engine-specific or staging-dependent changes here.

Summary by CodeRabbit

  • Chores
    • Updated project verification checks to include documentation validation.
    • Removed obsolete coverage and browser-based UI test commands.
    • Removed unused payment, browser compatibility, language-detection, type-definition, and UI component packages.
    • Streamlined styling and build configuration to reflect the current application structure.
    • No changes to the application’s user-facing features or functionality.

@vercel

vercel Bot commented Sep 6, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated
debate-navigator Ready Ready Preview Sep 7, 2026 9:33am UTC

@coderabbitai

coderabbitai Bot commented Sep 6, 2026 •

Copy link
Copy Markdown

Review Change Stack

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Free

Run ID: 385ae279-123f-48b0-bbed-2270b8dc8895

📥 Commits

Reviewing files that changed from the base of the PR and between c74479d and 2e13d30.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (3)
  • package.json
  • tailwind.config.ts
  • vite.config.ts
💤 Files with no reviewable changes (3)
  • tailwind.config.ts
  • package.json
  • vite.config.ts

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

The pull request updates verification scripts and removes unused dependencies. It narrows Tailwind content scanning to src and updates Vite dependency prebundling configuration.

Changes

Configuration and dependency cleanup

Layer / File(s) Summary
Package scripts and dependencies
package.json
Adds docs:check to verify, removes two test scripts, and removes unused type definitions and compatibility dependencies.
Build configuration simplification
tailwind.config.ts, vite.config.ts
Restricts Tailwind scanning to src, documents Vite prebundling scope, and removes an unused Radix package from the vendor chunk.

Estimated code review effort: 1 (Trivial) | ~5 minutes


Note

🎁 Summarized by CodeRabbit Free

Your organization is on the Free plan. CodeRabbit will generate a high-level summary and a walkthrough for each pull request. For a comprehensive line-by-line review, please upgrade your subscription to CodeRabbit Essentials by visiting https://app.coderabbit.ai/settings/billing.

Comment @coderabbitai help to get the list of available commands.

@Programcode

Copy link
Copy Markdown
Owner Author

Interim independent review while CodeRabbit is rate limited (Free plan allows 1 review/hour).

Reviewer: Claude Opus 4.5, run locally against git diff origin/main..origin/<branch> with a deletion-safety and claim-accuracy brief. Full output:

BLOCKERS: none

SHOULD-FIX: none

NITS:
1. Commit message says "920 unit tests" and "116 edge tests"; PR description says "925 tests" and "121 edge tests". Minor discrepancy—neither affects correctness, but one was presumably a stale number.

VERDICT: Approve. All deletions are correctly justified: grep/import verification is sound, the @types packages are genuinely redundant (runtime libs ship their own types), the Tailwind globs target non-existent directories, and the Vite `optimizeDeps.entries` default already covers `index.html`. No production references missed.

CodeRabbit will still review this PR when its hourly window resets; this does not replace it.

@Programcode
Programcode force-pushed the chore/prune-unused-deps-and-dead-config branch from cd7fd52 to 660f8a0 Compare September 6, 2026 17:13
@Programcode Programcode changed the title chore: prune 6 unused dependencies, 2 dead scripts, and dead config globs chore: prune 6 unused dependencies, 2 dead scripts, and dead Tailwind globs Sep 6, 2026
@Programcode

Copy link
Copy Markdown
Owner Author

Independent review, second pass, model upgraded to Claude Opus 5 (the earlier comment on this PR used Opus 4.5). Run locally against git diff origin/main..origin/<branch> through cliproxyapi, briefed on deletion safety and claim accuracy.

Every should-fix finding below has been addressed in the current head. Full output:

BLOCKERS: none

SHOULD-FIX:
1. **Lockfile now marks `caniuse-lite` and `baseline-browser-mapping` as `"dev": true`.** That is npm's correct recomputation (their only remaining parents — `browserslist`/`autoprefixer` — are dev), but it makes the commit message's flat claim "Both remain installed as transitive dependencies" true *only* for installs that include devDependencies. Confirm no install path does `npm ci --omit=dev` before a browserslist-consuming step (Docker/nginx build stage, any GitHub workflow step that installs prod-only then runs postcss). Vercel installs dev deps, so the main build path is fine; it's the container/CI variants that need the check. If confirmed, reword the claim rather than change the diff.
2. **`optimizeDeps.entries: ['index.html']` was not a pure restatement.** Vite's default is to crawl *every* `.html` under root, not just `index.html`; the explicit entry narrowed that. Removing it is a real (dev-server-only, prebundling-scope) behavior change, so "restated the only HTML entry" and "no behavior change" are both slightly overstated. Verify there is no second HTML file — e.g. a `public/offline.html`, `404.html`, or anything referenced from `nginx.conf` / `vercel.json` rewrites / the service-worker precache list. If there is one, dev prebundling will now crawl it; if there isn't, say so and the line is fine to drop.

NITS:
1. The commit message says the two scripts are ones "nothing invokes," dropping the `.audit/crossfire.tsv` caveat that the PR body discloses honestly. Carry the caveat into the commit message so the merged history matches the PR.
2. Commit message says "Verified after rebasing onto main c7d3437"; PR body says "based directly on current `main`." Harmless, but if #34 lands first the recorded verification applies to a lockfile that no longer exists — re-run `npm ci` + `verify` after the lockfile rebase rather than reusing these numbers.

Correctly justified, no action needed:
- `@stripe/stripe-js`, `i18next-browser-languagedetector`, `@types/jspdf`, `@types/react-joyride`: any static consumer in `src`/`e2e`/`scripts` would have broken `typecheck` or `build` after a clean `npm ci`, both of which are reported green — these removals are self-verifying.
- Tailwind glob removal touches only directories that do not exist; `index.html` was not in `content` before or after, so scanning coverage is unchanged.
- `@types/file-saver` retention is correct (`file-saver` ships no bundled declarations).
- Both JSON edits are syntactically clean — no removals at object tails, no dangling commas, no orphaned lock entries (`@babel/runtime` is still required by `i18next`).
- Test counts (925 / 121 / 125) and coverage (90.45%) are internally consistent between commit and PR body, and no tests were touched, so nothing is stale.

VERDICT: **approve** once the `--omit=dev` install path and the "only HTML file" assumption are confirmed — both are claim-accuracy checks, not code changes; the deletions themselves are sound.

@Programcode

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Sep 6, 2026 •

Copy link
Copy Markdown
⚠️ Action not completed

Review rate limited.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@Programcode

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Sep 6, 2026 •

Copy link
Copy Markdown
⚠️ Action not completed

Review rate limited.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@Programcode

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Sep 6, 2026 •

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

… globs

Dependencies with zero imports anywhere in src, e2e, scripts, supabase, or
any config file:

- @stripe/stripe-js: checkout and portal go through the create-checkout and
  create-portal Edge Functions and a plain URL redirect (src/lib/stripe.ts).
  The browser SDK is never loaded.
- i18next-browser-languagedetector: src/i18n.ts sets lng and fallbackLng
  explicitly and SettingsPage calls changeLanguage. No detector is registered.
- @types/jspdf and @types/react-joyride: both runtime packages ship their own
  declarations, so the DefinitelyTyped stubs are redundant.
- baseline-browser-mapping and caniuse-lite: incidentally added as direct
  dependencies, never imported. Both stay installed transitively through
  autoprefixer/browserslist, which is the only consumer. npm now records them
  as dev-only, since browserslist is a devDependency; that is safe here because
  every install path in this repo (Dockerfile, all three workflow jobs, Vercel)
  runs a plain `npm ci` with devDependencies included. No path uses
  --omit=dev or --production.

@types/file-saver stays: file-saver ships no declarations of its own.

Also removes two npm scripts and three dead Tailwind content globs:

- test:coverage, superseded by `npm test -- --coverage`. No workflow, script,
  or docs file invokes it. Two rows in .audit/crossfire.tsv do mention it, but
  those are historical records of August runs, not callers, and that log is
  deliberately left untouched.
- test:e2e:ui, which nothing references at all.
- the ./pages, ./components, and ./app content globs, for directories that do
  not exist in this repo.

The verify script keeps the docs:check step main added in #39.

Verified on main fe679fd, from a clean npm ci: docs:check, lint, typecheck,
956 unit tests, 121 edge tests, build, and 126 Chromium e2e tests pass.
Coverage 90.45% statements.
@Programcode

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Sep 6, 2026 •

Copy link
Copy Markdown
⚠️ Action not completed

Review rate limited.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@Programcode

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Sep 6, 2026 •

Copy link
Copy Markdown
⚠️ Action not completed

Review rate limited.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@Programcode

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Sep 6, 2026 •

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

…ps-and-dead-config

# Conflicts:
#	package-lock.json
#	package.json
@Programcode
Programcode merged commit 0e940ed into main Sep 7, 2026
7 checks passed
@Programcode
Programcode deleted the chore/prune-unused-deps-and-dead-config branch September 7, 2026 09:41

This branch was successfully deployed

1 active deployment
Preview — 2e13d30b Deployed Sep 7, 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