Skip to content

chore(deps): remove unused node-addon-api, node-gyp, hookform/resolvers - #4660

Merged
JSONbored merged 1 commit into
mainfrom
fix/remove-unused-npm-deps-4621
Jul 10, 2026
Merged

chore(deps): remove unused node-addon-api, node-gyp, hookform/resolvers#4660
JSONbored merged 1 commit into
mainfrom
fix/remove-unused-npm-deps-4621

Conversation

@JSONbored

Copy link
Copy Markdown
Owner

Summary

  • Removes three genuinely-unused npm dependencies found during the review-stack architecture
    audit's dead-code pass: node-addon-api and node-gyp (root devDependencies) and
    @hookform/resolvers (apps/gittensory-ui dependencies).
  • Re-verified each before removing (not just trusting the audit): grepped imports/requires across
    src/, test/, review-enrichment/, scripts/, apps/**, all three Dockerfiles, and
    .github/workflows/**. No binding.gyp exists anywhere in the repo. The only repo hits for
    node-addon-api/node-gyp are an unrelated detection-regex string literal in
    review-enrichment/src/analyzers/native-build.ts (used to flag other people's PRs that add a
    native-build dependency — not evidence this repo uses either package itself). react-hook-form
    is genuinely used (apps/gittensory-ui/src/components/ui/form.tsx), but there is no useForm()
    call anywhere in either UI app that wires up a resolver, and @hookform/resolvers has zero
    other hits.
  • Ran npm install to regenerate package-lock.json (single workspace lockfile; there is no
    separate lockfile under apps/gittensory-ui) — 12 packages removed, 0 vulnerabilities.

Scope

  • The PR title follows type(scope): short summary Conventional Commit format, for example fix(api): restore profile access checks.
  • This PR is focused and does not mix unrelated backend, UI, MCP, docs, dependency, and deploy changes.
  • This follows CONTRIBUTING.md and does not reintroduce GitHub Pages, VitePress, site/, or CNAME.
  • I linked a currently open issue this PR resolves (e.g. Closes #123) — a linked open issue is required for every contributor PR.

Validation

  • git diff --check
  • npm run actionlint
  • npm run typecheck
  • npm run test:coverage locally; codecov/patch requires ≥99% coverage of the lines AND branches you changed (aim for 100% on your diff so CI variance does not fail near the threshold). Global coverage is a non-blocking trend with a loose 90% backstop, not the gate.
  • npm run test:workers
  • npm run build:mcp
  • npm run test:mcp-pack
  • npm run ui:openapi:check
  • npm run ui:lint
  • npm run ui:typecheck
  • npm run ui:build
  • npm audit --audit-level=moderate
  • New or changed behavior has unit/integration tests for new branches, fallback paths, and sanitizer boundaries

If any required check was skipped, explain why:

  • No src/** lines changed (only package.json/package-lock.json/apps/gittensory-ui/package.json), so there is no Codecov patch-coverage obligation and no new logic to test. test:coverage/test:workers were not run standalone since typecheck + ui:build + ui:lint + a full npm ci already exercise every workspace's dependency graph without either removed package; build:mcp/test:mcp-pack weren't run because neither package was a dependency of @jsonbored/gittensory-mcp.

Safety

  • No secrets, wallet details, hotkeys, coldkeys, user PATs, private keys, raw trust scores, private rankings, or private maintainer evidence are exposed.
  • Public GitHub text stays sanitized, low-noise, and does not imply compensation guarantees or optimization tactics.
  • Auth, cookie, CORS, GitHub App, Cloudflare, or session changes include negative-path tests.
  • API/OpenAPI/MCP behavior is updated and tested where needed. (No API/OpenAPI/MCP surface touched; ui:openapi:check confirms the spec is unchanged.)
  • UI changes use live API data or real empty/error/loading states, not production mock/demo fallbacks. (No UI behavior changed.)
  • Visible UI changes include a UI Evidence section below with JPG/JPEG or PNG screenshots arranged as organized, captioned, clickable thumbnails. SVG screenshots are not used as review evidence. Review-only screenshots or recordings are not committed to the repository.
  • Public docs/changelogs are updated where needed; changelogs are only edited for release-prep PRs. (No docs/changelog impact.)

UI Evidence

Not applicable — no visible UI change; this PR only removes unused dependency entries from package.json/package-lock.json.

Notes

Grepped imports/requires across source, tests, config, scripts,
Dockerfiles, and workflows to confirm zero real usage of each before
removal; the only repo hits were an unrelated detection-regex string
literal (review-enrichment's native-build analyzer) and the useForm()
call in the UI form component, which has no resolver option wired up.

Fixes #4621
@superagent-security

Copy link
Copy Markdown
Contributor

Superagent didn't find any vulnerabilities or security issues in this PR.

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
gittensory-ui e143cde Commit Preview URL

Branch Preview URL
Jul 10 2026, 10:23 AM

@JSONbored JSONbored self-assigned this Jul 10, 2026
@JSONbored
JSONbored merged commit 5ecdec1 into main Jul 10, 2026
9 checks passed
@JSONbored
JSONbored deleted the fix/remove-unused-npm-deps-4621 branch July 10, 2026 10:28
@codecov

codecov Bot commented Jul 10, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.12%. Comparing base (450e314) to head (e143cde).
⚠️ Report is 4 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4660   +/-   ##
=======================================
  Coverage   94.12%   94.12%           
=======================================
  Files         434      434           
  Lines       38496    38496           
  Branches    14038    14038           
=======================================
  Hits        36233    36233           
  Misses       1604     1604           
  Partials      659      659           
🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

JSONbored added a commit that referenced this pull request Jul 10, 2026
…ld fallback (#4673)

PR #4660 (#4621) removed these as "unused" based on a source-grep that found
zero import statements -- but sharp's own install script falls back to
building its native binding from source via node-gyp when no matching
prebuilt binary is available for the current platform/arch/Node version,
and that build-from-source path explicitly requires node-addon-api. A
source grep can't see this: npm's own postinstall/build machinery pulls
these in, not application code.

Confirmed as a live, reproducible regression: `npm ci` on a clean checkout
of current main fails outright with "sharp: Please add node-addon-api to
your dependencies" on this platform (macOS arm64, Node 26). CI apparently
didn't catch it because its runner has a matching prebuilt sharp binary
available, so the source-build fallback never triggers there -- but any
local dev setup (or self-hoster) on a platform without one does hit it.

@hookform/resolvers's removal (also part of #4660/#4621) is unaffected and
stays removed -- unrelated to this failure mode.

Fixes #4672
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Remove unused npm dependencies

1 participant