Repository navigation
chore: second-pass cruft cleanup - #414
Conversation
The kody_official_guide capability inlines its own fetch helper in kody-official-guide.ts; nothing else references fetchMarkdownPreferredDoc or MARKDOWN_PREFERRED_ACCEPT, so the module is dead. Co-authored-by: Kent C. Dodds <me+github@kentcdodds.com>
buildUiArtifactEmbedText has no callers outside its own test, so the embed helper and its test are dead. The previous app-search vectorization flow that consumed it has been gone since the legacy inline-source cleanup. Co-authored-by: Kent C. Dodds <me+github@kentcdodds.com>
normalizeUiArtifactParameters / parseUiArtifactParameters / applyUiArtifactParameters and uiArtifactParameterSchema were only referenced by their own test. The only production consumer of the shared UiArtifactParameter types was buildAppSourceFiles, which has no remaining callers either, so the worker module, the shared parameter types, the dead source template, and the orphan test all go away together. Co-authored-by: Kent C. Dodds <me+github@kentcdodds.com>
Drop isJsonRpcEnvelope, jsonResponse, createJsonRpcResultResponse, createJsonRpcErrorResponse, and the identity parseJsonRpcMessage wrapper from remote-connector/utils.ts. None had callers outside the file itself, and parseJsonRpcMessage was just returning its argument, so session.ts can use the JSONRPCMessage value directly. Co-authored-by: Kent C. Dodds <me+github@kentcdodds.com>
The codemode sandbox modules artifact was deleted in 3bd7e38 ("Remove stale codemode sandbox modules file"), but the build target kept the now-nonexistent dependency in dependsOn. Nx silently ignores missing targets, so this has been a no-op string ever since. Co-authored-by: Kent C. Dodds <me+github@kentcdodds.com>
There is no docs/post-download.ts in the repository, but tsconfig-tools.json listed it under include and typescript-setup.md called it out as a Tools environment file. Both references are stale leftovers. Co-authored-by: Kent C. Dodds <me+github@kentcdodds.com>
mq.desktop, colors.primarySoftSubtle, colors.primarySoftHover, and shadows.lg had no callers across the client. Their backing CSS custom properties (--shadow-lg / --shadow-lg-dark) were also unreferenced and go away with them. Co-authored-by: Kent C. Dodds <me+github@kentcdodds.com>
|
ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
💤 Files with no reviewable changes (1)
📝 WalkthroughWalkthroughThis PR systematically removes unused UI artifact parameter types, embed text generation utilities, markdown document fetching capabilities, and related test coverage. It simplifies remote connector JSON-RPC handling by eliminating helper utilities and reducing duplication. Design tokens are pruned to remove unused color and media query variants. Build configuration and TypeScript setup are updated to reflect these removals. ChangesFeature and Type Removal
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
🔎 Preview deployed: https://kody-pr-414.kentcdodds.workers.dev Worker: Mocks:
|
oxfmt has been flagging this on every PR (the validate format:check step fails on main because of it). Re-run oxfmt to make the gate green. Co-authored-by: Kent C. Dodds <me+github@kentcdodds.com>
Follow-up to #411 — concrete leftovers I found by tracing imports and config references.
Findings and changes
Orphan modules (only their own tests / no callers)
packages/worker/src/mcp/capabilities/coding/fetch-markdown-doc.ts—kody_official_guideinlines its own fetch inkody-official-guide.ts; nothing importsfetchMarkdownPreferredDoc/MARKDOWN_PREFERRED_ACCEPT.packages/worker/src/mcp/ui-artifacts-embed.ts(+ its.node.test.ts) —buildUiArtifactEmbedTexthad no remaining callers; the legacy app-search vectorize path that used it is gone.packages/worker/src/mcp/ui-artifact-parameters.ts(+ its.node.test.ts) —normalizeUiArtifactParameters/parseUiArtifactParameters/applyUiArtifactParameters/uiArtifactParameterSchemawere only referenced by their own test.packages/shared/src/ui-artifact-parameters.ts— became orphan after the worker module above andbuildAppSourceFilesare removed.buildAppSourceFilesinpackages/worker/src/repo/source-templates.ts— no callers anywhere; onlybuildJobSourceFilesis used.Dead helpers in
packages/worker/src/remote-connector/utils.tsisJsonRpcEnvelope,jsonResponse,createJsonRpcResultResponse,createJsonRpcErrorResponse— none are imported anywhere.parseJsonRpcMessage, which was an identity function;session.tsnow uses the value directly.Stale config / docs
packages/worker/project.json—buildtarget listedbuild-codemode-sandbox-modulesindependsOn, but that target was removed alongside the sandbox modules artifact in 3bd7e38. Nx silently ignored it.tsconfig-tools.jsonanddocs/contributing/typescript-setup.md— both referenceddocs/post-download.ts, which is not in the repo.Unused style tokens
packages/worker/client/styles/tokens.ts— dropmq.desktop,colors.primarySoftSubtle,colors.primarySoftHover, andshadows.lg.packages/worker/public/styles.css— drop the now-unreferenced--shadow-lgand--shadow-lg-darkcustom properties.Format gate fix
packages/worker/client/mcp-apps/kody-ui-utils-contract.tshad a stray trailing blank line that was makingformat:check(and thereforevalidate) red onmain. Re-ranoxfmton it.Verification
npm run typecheck— pass.npm run lint— pass (0 warnings, 0 errors).npm run format:check— pass (after the trailing-blank-line fix).npm run test— 117 files / 585 tests pass.npm run test:e2e:run— 3 Playwright specs pass.npm run test:mcp— 2 MCP tests pass.Things left for separate decision (each launched as its own Cursor Cloud agent / PR)
packages/worker/src/repo/legacy-inline-sources-migration.node.test.tspackages/worker/src/jobs/jobs-codemode-only-migration.node.test.tspackages/worker/src/email/unified-email-receipt-migration.node.test.tsThese exercise long-shipped structural migrations and read low-signal but do guard replayability if anyone edits an old
.sqlfile. Drop or keep at your discretion.Summary by CodeRabbit
Chores
Refactor
Style
Tests
New Features