chore(dead-code): drop ~2k lines of unreachable exports and orphan modules (#12077)

* chore(dead-code): drop 2k lines of unreachable exports and orphan modules

Ran knip across every build entry (main, preload, renderer, popout, web,
cli, relay, workers, forked sidecars, config scripts) and removed what no
entry graph can reach.

- 11 orphan modules nothing imported, plus one test that only covered them
- 159 unused exports/types, with their now-dead helpers, imports and tests

Each candidate was verified against dynamic references before deletion.
42 knip hits were false positives and are kept: shared modules consumed by
the mobile/ workspace, the src/shared/plugins/** public API, vendored
shadcn primitives, and relay wire-protocol constants held for compatibility.

Adds knip.json + `pnpm audit:dead-code` so this stays measurable.

Verified: pnpm typecheck, pnpm lint, and 2081 tests across the 73 affected
test files all pass.

* chore(dead-code): move knip config under config/

Root-level additions are blocked by the root directory guard.

Co-authored-by: Orca <help@stably.ai>

---------

Co-authored-by: Orca <help@stably.ai>
This commit is contained in:
Neil
2026-08-02 00:33:57 -07:00
committed by GitHub
co-authored by Orca
parent 1562f12f78
commit 73c5009b82
146 changed files with 71 additions and 2102 deletions
-9
View File
@@ -65,11 +65,6 @@ export function _resetOriginGitHubApiRepositoryCache(): void {
originRepoInFlight.clear()
}
/** @internal - exposed for cache-bound tests only */
export function _getOriginGitHubApiRepositoryCacheSize(): number {
return originRepoCache.size
}
function pruneOriginRepoCache(now: number): void {
for (const [key, entry] of originRepoCache) {
if (entry.expiresAt <= now) {
@@ -296,10 +291,6 @@ export async function resolveGitHubApiRepository(
return null
}
export function isGitHubDotComRepository(repository: GitHubApiRepository): boolean {
return isDefaultGitHubHost(repository.host)
}
// Why: the gh runner host-qualifies argv from `options.host`, so every known
// host must be carried through. Pinning github.com prevents a process-level
// GH_HOST from silently redirecting an otherwise unambiguous API request.