Skip to content

Removed unused dependencies surfaced by knip#27720

Merged
9larsons merged 1 commit intomainfrom
knip-cleanup
May 6, 2026
Merged

Removed unused dependencies surfaced by knip#27720
9larsons merged 1 commit intomainfrom
knip-cleanup

Conversation

@9larsons
Copy link
Copy Markdown
Contributor

@9larsons 9larsons commented May 6, 2026

Summary

First cleanup pass after wiring up knip in #27716. Walked through each unused-dep candidate in the baseline report, grep-verified each one, and removed the genuinely vestigial entries.

Net effect: 15 package.json files touched, ~390 lines off the lockfile.

What was removed

ghost/core dependencies@slack/webhook, @tryghost/http-cache-utils, @tryghost/kg-default-transforms, cluster-key-slot, superagent, superagent-throttle (no source references; @tryghost/request replaced superagent; cluster-key-slot still present transitively under ioredis where it's actually used).

ghost/core devDependenciesdetect-indent, detect-newline, find-root, parse-prometheus-text-format, toml.

ghost/admin dependenciesi18n-iso-countries, lru-cache (only mentioned in package.json).

Root devDependencies@actions/core, chalk, chokidar, inquirer (no references in .github/scripts/ or scripts/).

apps/adminlodash.
apps/announcement-bar@tryghost/content-api.
apps/comments-ui@testing-library/user-event.
apps/portal@babel/eslint-parser (eslint config uses @typescript-eslint/parser + default espree).
apps/postsmoment (only moment-timezone is imported).
apps/shade@dnd-kit/core, @dnd-kit/sortable, @ebay/nice-modal-react, @radix-ui/react-form, @radix-ui/react-radio-group, @sentry/react, @types/color (color@5 ships its own types), @uiw/react-codemirror, next-themes, react-colorful, react-hot-toast, react-select, @codemirror/lang-html, @radix-ui/react-tooltip (devDep duplicate of the deps entry), @testing-library/react-hooks, @types/lodash-es, chai, lodash-es, sinon.
apps/activitypub@types/dompurify (dompurify ships its own types), ts-jest (project uses vitest).
apps/admin-x-design-system@radix-ui/react-tooltip (devDep duplicate of the deps entry).
apps/admin-x-frameworksinon.
e2ets-node (project uses tsx).
ghost/parse-email-addresssinon, ts-node.

What was kept (verified false positives)

Held off on tailwindcss / @tailwindcss/vite (PostCSS pipeline), vite plugins (@vitejs/plugin-react, vite-plugin-svgr, vite-plugin-css-injected-by-js), test runners loaded via config (@vitest/coverage-v8, c8, msw, tsx, mocha-slow-test-reporter, cssnano), mysql2 (knex client peer), eslint plugins, prop-types, and papaparse / bookshelf-relations / form-data which all have real source references.

A first-pass also tried to remove @tryghost/debug from portal/comments-ui/signup-form/sodo-search — those vite configs do dedupe: ['@tryghost/debug'] and @tryghost/i18n imports it transitively — but the UMD build externalizes it as a runtime require() when it's not a direct dep, which would crash in the browser. Reverted that removal; left a follow-up note in the cleanup plan.

Workspace version bumps

Per the workspace versioning rule, bumped non-private workspaces whose package.json was modified:

  • apps/announcement-bar: 1.1.181.1.19
  • apps/comments-ui: 1.4.101.4.11
  • apps/portal: 2.68.292.68.30
  • apps/activitypub: 3.1.143.1.16 (the pre-commit hook auto-patched once on top of the manual bump)

ghost/core's version field is release-managed so it isn't bumped here.

Test plan

  • pnpm install — clean; lockfile sheds the removed deps' transitive subtrees
  • cd ghost/core && pnpm test:unit — 6295 passing, 3 pending
  • Built every touched workspace and verified no require() externalization in the UMD bundles: @tryghost/portal, @tryghost/comments-ui, @tryghost/signup-form, @tryghost/sodo-search, @tryghost/announcement-bar
  • Built @tryghost/shade, @tryghost/admin-x-framework, @tryghost/admin-x-design-system, @tryghost/admin, @tryghost/posts, @tryghost/activitypub, @tryghost/stats
  • pnpm --filter @tryghost/portal lint — clean (verifies @babel/eslint-parser removal)
  • pnpm --filter ghost-admin lint — clean (verifies i18n-iso-countries / lru-cache removal)
  • pnpm --filter @tryghost/admin-x-framework test — passing
  • pnpm --filter @tryghost/parse-email-address test — passing

@9larsons 9larsons requested a review from EvanHahn as a code owner May 6, 2026 19:09
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 6, 2026

Walkthrough

Multiple package.json files were modified across the repository. Several packages had version bumps (activitypub, announcement-bar, comments-ui, portal). Numerous dependencies and devDependencies were removed or added in various packages (examples: lodash, moment, sinon, ts-node removed; new testing, linting, and tooling deps added). apps/shade received a large dependency and devDependency overhaul including Storybook and modern React tooling. ghost/core had several runtime and devDependency changes (added @faker-js/faker, @isaacs/ttlcache, postcss, typescript 5.9.3, etc.). The root manifest refactored dev tooling toward eslint and secretlint.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The pull request title 'Removed unused dependencies surfaced by knip' directly and clearly summarizes the main change across the 15 modified package.json files.
Description check ✅ Passed The pull request description provides a comprehensive explanation of the changes, listing all removed dependencies by workspace, rationale for kept dependencies, version bumps, and detailed test results.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch knip-cleanup

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
apps/comments-ui/package.json (1)

25-25: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Add PLAYWRIGHT_REPORTER=list to the test:e2e script.

The test:e2e command is missing the PLAYWRIGHT_REPORTER=list environment variable required for Playwright e2e tests.

🔧 Proposed fix
-    "test:e2e": "NODE_OPTIONS='--experimental-specifier-resolution=node --no-warnings' VITE_TEST=true playwright test",
+    "test:e2e": "NODE_OPTIONS='--experimental-specifier-resolution=node --no-warnings' VITE_TEST=true PLAYWRIGHT_REPORTER=list playwright test",

As per coding guidelines: "Set PLAYWRIGHT_REPORTER=list environment variable when running Playwright e2e tests as an AI agent for better parsing."

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@apps/comments-ui/package.json` at line 25, The test:e2e npm script in
package.json is missing the PLAYWRIGHT_REPORTER=list environment variable;
update the "test:e2e" script to prepend or include PLAYWRIGHT_REPORTER=list
alongside NODE_OPTIONS and VITE_TEST so Playwright runs with the list reporter
(i.e., modify the "test:e2e" script entry to set PLAYWRIGHT_REPORTER=list before
running `playwright test`).
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In `@apps/comments-ui/package.json`:
- Line 25: The test:e2e npm script in package.json is missing the
PLAYWRIGHT_REPORTER=list environment variable; update the "test:e2e" script to
prepend or include PLAYWRIGHT_REPORTER=list alongside NODE_OPTIONS and VITE_TEST
so Playwright runs with the list reporter (i.e., modify the "test:e2e" script
entry to set PLAYWRIGHT_REPORTER=list before running `playwright test`).

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 7131ba23-5b49-4062-81e7-f990a8bc7dd4

📥 Commits

Reviewing files that changed from the base of the PR and between 9ee5b43 and 485b466.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (14)
  • apps/activitypub/package.json
  • apps/admin-x-design-system/package.json
  • apps/admin-x-framework/package.json
  • apps/admin/package.json
  • apps/announcement-bar/package.json
  • apps/comments-ui/package.json
  • apps/portal/package.json
  • apps/posts/package.json
  • apps/shade/package.json
  • e2e/package.json
  • ghost/admin/package.json
  • ghost/core/package.json
  • ghost/parse-email-address/package.json
  • package.json
💤 Files with no reviewable changes (10)
  • apps/posts/package.json
  • ghost/parse-email-address/package.json
  • apps/admin/package.json
  • apps/admin-x-design-system/package.json
  • e2e/package.json
  • ghost/admin/package.json
  • apps/admin-x-framework/package.json
  • package.json
  • apps/shade/package.json
  • ghost/core/package.json

@codecov
Copy link
Copy Markdown

codecov Bot commented May 6, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 73.18%. Comparing base (d2b366d) to head (dd559b6).

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #27720   +/-   ##
=======================================
  Coverage   73.18%   73.18%           
=======================================
  Files        1561     1561           
  Lines      127214   127214           
  Branches    15393    15395    +2     
=======================================
+ Hits        93100    93101    +1     
- Misses      33134    33154   +20     
+ Partials      980      959   -21     
Flag Coverage Δ
admin-tests 49.88% <ø> (ø)
e2e-tests 73.18% <ø> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@9larsons 9larsons enabled auto-merge (squash) May 6, 2026 19:30
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
apps/comments-ui/package.json (1)

25-27: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Add PLAYWRIGHT_REPORTER=list to the base e2e script.

test:e2e is the root Playwright command, so setting the reporter there will also cover test:slowmo and test:e2e:full.

Suggested patch
-    "test:e2e": "NODE_OPTIONS='--experimental-specifier-resolution=node --no-warnings' VITE_TEST=true playwright test",
+    "test:e2e": "NODE_OPTIONS='--experimental-specifier-resolution=node --no-warnings' VITE_TEST=true PLAYWRIGHT_REPORTER=list playwright test",

As per coding guidelines, "Set PLAYWRIGHT_REPORTER=list environment variable when running Playwright e2e tests as an AI agent for better parsing".

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@apps/comments-ui/package.json` around lines 25 - 27, Update the "test:e2e"
npm script to include the PLAYWRIGHT_REPORTER=list environment variable so all
downstream scripts (test:slowmo and test:e2e:full) inherit the reporter setting;
modify the script named "test:e2e" in package.json to prepend or include
PLAYWRIGHT_REPORTER=list alongside NODE_OPTIONS and VITE_TEST so Playwright runs
with the list reporter by default.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In `@apps/comments-ui/package.json`:
- Around line 25-27: Update the "test:e2e" npm script to include the
PLAYWRIGHT_REPORTER=list environment variable so all downstream scripts
(test:slowmo and test:e2e:full) inherit the reporter setting; modify the script
named "test:e2e" in package.json to prepend or include PLAYWRIGHT_REPORTER=list
alongside NODE_OPTIONS and VITE_TEST so Playwright runs with the list reporter
by default.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 468bf92e-9a05-4e42-afec-488e3095ec0c

📥 Commits

Reviewing files that changed from the base of the PR and between 485b466 and dd559b6.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (14)
  • apps/activitypub/package.json
  • apps/admin-x-design-system/package.json
  • apps/admin-x-framework/package.json
  • apps/admin/package.json
  • apps/announcement-bar/package.json
  • apps/comments-ui/package.json
  • apps/portal/package.json
  • apps/posts/package.json
  • apps/shade/package.json
  • e2e/package.json
  • ghost/admin/package.json
  • ghost/core/package.json
  • ghost/parse-email-address/package.json
  • package.json
💤 Files with no reviewable changes (10)
  • apps/posts/package.json
  • apps/admin-x-design-system/package.json
  • e2e/package.json
  • package.json
  • ghost/admin/package.json
  • apps/admin/package.json
  • apps/shade/package.json
  • ghost/parse-email-address/package.json
  • ghost/core/package.json
  • apps/admin-x-framework/package.json

@9larsons 9larsons merged commit 8f2ec8d into main May 6, 2026
85 of 87 checks passed
@9larsons 9larsons deleted the knip-cleanup branch May 6, 2026 20:03
9larsons added a commit that referenced this pull request May 6, 2026
no ref

Two related dep-contract hygiene fixes the post-knip-baseline audit
surfaced. Both came out of running `pnpm knip --debug` against `main`
after #27720 landed and verifying each entry by hand.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant