Resolve knip dependency findings and align @earendil-works versions - #4416
Merged
Conversation
Declare all imported packages in the workspace that uses them instead of relying on npm hoisting, so resolution is deterministic. Silence knip's confirmed false positives, remove genuinely-dead dependencies and their orphaned test mocks, prune stale dependabot entries, and unify all @earendil-works/pi-* pins at 0.82.1. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Collaborator
📊 Performance Test ResultsComparing 929b8ca vs trunk app-size
site-editor
site-startup
Results are median values from multiple test runs. Legend: 🟢 Improvement (faster) | 🔴 Regression (slower) | ⚪ No change (<50ms diff) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related issues
npx knipcleanup (follow-up to Clean up unused and misplaced dependencies flagged by knip #4394, which deferred the phantom-dependency findings)How AI was used in this PR
Claude Code ran
npx knip, then traced every finding to its root cause: for each phantom ("unlisted") package it checked where the import actually resolves in the lockfile and which workspace owns it; for each "unused" dependency it verified withgrepacrosssrc/e2eandgit logwhether the consumer still exists. Each conclusion was confirmed withnpm run typecheck(all workspaces),npm run cli:build, the affected Vitest suites, and a re-run of knip.I worked iteratively on multiple improvements like deduping pi packages, removing remaining unused packages, then I reviewed all changes before opening this PR.
Proposed Changes
Dev-tooling / manifest change only — no runtime or user-visible behavior changes. The goal is that each workspace's
package.jsonaccurately declares what it imports, and that a knip run is signal-only going forward.typebox/chalkinapps/cliand@earendil-works/pi-agent-core/pi-aiinpackages/commonwere only resolving because a sibling dependency happened to hoist them — a transitive version change could have broken resolution. Each is pinned to the version already in the lockfile, sonpm installis a no-op dedup.@sentry/reactreferenced only as a string in a VitemanualChunks,@wp-playground/clispawned as a binary,@automattic/wp-babel-makepotinvoked vianpxin a Fastfile, and thepromptfooconfig path) via top-levelignoreDependencies/ignoreBinaries, and dropped now-redundant knip config lines.hpagent(never imported since it was added),rehype-raw(its only consumer, the legacy WPCOM assistant, was removed in Studio Code Desktop: remove enableStudioCodeUi beta flag and legacy assistant #3683), and@types/shell-quote(redundant —shell-quotenow ships its own types; the runtime package stays).dependabot.ymlentries for packages that nopackage.jsondeclares anymore (hpagent,compression,compressible,strip-ansi,ora,cross-port-killer,pm2,@rive-app/*), including an empty group.@earendil-works/pi-*pins at0.82.1, the versionpi-coding-agent@0.82.1expects for its siblings. This collapses the duplicate 0.81.0/0.82.1 copies that were sitting in the lockfile.Testing Instructions
npm install— completes cleanly, no peer-dependency conflicts, lockfile shrinks (duplicate copies removed).npm run typecheck— passes across all workspaces, confirming no declared/removed/bumped dependency broke resolution.npm run cli:build— succeeds, confirming the newly-declared bare imports (typebox,chalk) still bundle.npx knip— no remaining unlisted, binary, unresolved, unused-dependency, or configuration-hint findings.Pre-merge Checklist