Skip to content

(janitor/dependencies) remove unused discord-api-types from apps/web - #5828

Open
kilo-code-bot[bot] wants to merge 1 commit into
mainfrom
janitor/dependencies/remove-unused-discord-api-types
Open

(janitor/dependencies) remove unused discord-api-types from apps/web#5828
kilo-code-bot[bot] wants to merge 1 commit into
mainfrom
janitor/dependencies/remove-unused-discord-api-types

Conversation

@kilo-code-bot

@kilo-code-bot kilo-code-bot Bot commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Summary

Removes one high-confidence unused dependency from a single workspace package (apps/web).

Dependencies removed

  • discord-api-types@0.38.47 (from apps/web/package.json dependencies)

Evidence each was unused

  • discord-api-types has zero references anywhere in the repository outside its own package.json declaration. A repository-wide search (excluding node_modules, .git, dist, .next, build, and pnpm-lock.yaml) matched only apps/web/package.json:132.
  • No source imports, require calls, import type references, or dynamic imports of discord-api-types exist. The Discord integration in apps/web imports only from discord.js (apps/web/src/app/api/discord/gateway/route.ts) and discord-interactions (apps/web/src/lib/discord/verify-request.ts, apps/web/src/app/discord/webhook/route.ts), both of which remain declared and are still used.
  • discord-api-types is a transitive dependency of discord.js@14.25.1 (which declares discord-api-types@^0.38.33), so it continues to be resolved and available to discord.js at runtime and type level without the direct declaration. apps/web does not rely on it directly, so no undeclared transitive usage is exposed.
  • Git history confirms the string from 'discord-api-types' has never appeared in source; the entry was carried into the monorepo restructure (commit 3ede682dc) without a corresponding importer.

Dynamic, configuration, and tooling references checked

  • Imports / requires / dynamic imports / type-level references: none (grep -rn "discord-api-types" across all tracked source/config).
  • Package scripts: no apps/web script references it (madge/knip/dependency-cruiser/tsconfig-paths scripts verified as the only dev-tool CLI consumers in apps/web/package.json).
  • Build / compiler / bundler config: next.config.mjs references only discord.js (for the optional-native-modules serverExternalPackages list), not discord-api-types. No tsconfig paths/types, Jest moduleNameMapper, Babel, PostCSS, or oxlintrc references exist.
  • Framework plugins / loaders / presets / code-generation: not applicable — it is a plain types package, not a plugin, loader, preset, adapter, or codegen tool, and is not discovered by naming convention or required for side effects.

Package publication and peer-dependency considerations

  • apps/web is "private": true and not published, so there is no published-package contract concern.
  • discord-api-types is declared in dependencies (not peerDependencies or optionalDependencies), so it is not a contractual peer/optional dependency.
  • discord.js@14.25.1 depends on discord-api-types@^0.38.33, so the package remains present in the tree (resolved to 0.38.42) for discord.js's own use.

Validation performed

  • pnpm install --no-frozen-lockfile completed successfully; the resulting pnpm-lock.yaml diff is minimal and scoped only to the removed entry (importer specifier, package resolution, and snapshot). No unrelated lockfile changes.
  • tsgo --noEmit -p apps/web/tsconfig.json (after building @kilocode/trpc) passed with exit code 0.
  • oxlint --config .oxlintrc.json on the three Discord-related source files passed (0 warnings, 0 errors).

Notes / uncertainty

  • The full repository pnpm validate and web next build were not run in this environment (no PostgreSQL/Redis available, and the sandbox runs Node v22.22.3 against the repo's >=24 <25 engine requirement). The narrow typecheck and lint checks above cover the affected package.
  • This environment is memory-constrained; the first pnpm install attempt hit the default Node heap limit and was retried with NODE_OPTIONS=--max-old-space-size=8192.

discord-api-types is declared in apps/web but never imported; discord.js
already provides it transitively via its own ^0.38.33 dependency.
@kilo-code-bot kilo-code-bot Bot added the janitor Automated dead-code/duplication cleanup label Sep 2, 2026
@kilo-code-bot

kilo-code-bot Bot commented Sep 2, 2026

Copy link
Copy Markdown
Contributor Author

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Files Reviewed (2 files)
  • apps/web/package.json
  • pnpm-lock.yaml

Reviewed by grok-4.6 · Input: 122.4K · Output: 3.7K · Cached: 47.7K

Review guidance: REVIEW.md from base branch main

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

Labels

janitor Automated dead-code/duplication cleanup

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants