chore: remove unused dependencies#37468
Conversation
|
Looks like this PR is ready to merge! 🎉 |
|
WalkthroughDependencies are removed from the PDF worker and livechat packages. A Yarn patch resolution is added for Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 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 |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #37468 +/- ##
===========================================
- Coverage 68.13% 68.10% -0.03%
===========================================
Files 3364 3364
Lines 115749 115755 +6
Branches 20907 20906 -1
===========================================
- Hits 78866 78838 -28
- Misses 34194 34229 +35
+ Partials 2689 2688 -1
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Disabled knowledge base sources:
- Jira integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
⛔ Files ignored due to path filters (2)
.yarn/patches/@sematext-gc-stats-npm-1.5.9-01e77be4d0.patchis excluded by!**/.yarn/**yarn.lockis excluded by!**/yarn.lock,!**/*.lock
📒 Files selected for processing (4)
ee/packages/pdf-worker/package.json(0 hunks)package.json(1 hunks)packages/livechat/package.json(0 hunks)packages/livechat/webpack.config.ts(1 hunks)
💤 Files with no reviewable changes (2)
- packages/livechat/package.json
- ee/packages/pdf-worker/package.json
🔇 Additional comments (1)
packages/livechat/webpack.config.ts (1)
62-64: Change verified and approved.The removal of
image-webpack-loaderis correct and safe. The customsvg-component-loaderhandles SVG-to-component conversion (the core functionality), whileimage-webpack-loaderwas only providing image optimization. Since SVG content is embedded directly in component code rather than served as separate image files, the loss of optimization is negligible and does not impact functionality.
| "drachtio-srf": "patch:drachtio-srf@npm%3A5.0.12#~/.yarn/patches/drachtio-srf-npm-5.0.12-b0b1afaad6.patch", | ||
| "@sematext/gc-stats@npm:^1.5.9": "patch:@sematext/gc-stats@npm%3A1.5.9#~/.yarn/patches/@sematext-gc-stats-npm-1.5.9-01e77be4d0.patch" |
There was a problem hiding this comment.
🧩 Analysis chain
Clarify the purpose of adding the @sematext/gc-stats patch.
The PR objective is to remove unused dependencies, but this change adds a new patch resolution for @sematext/gc-stats. Please clarify:
- Is this patch related to removing the dependency, or is it a separate fix?
- What does the patch do?
- Is
@sematext/gc-statsstill being used in the codebase after this PR?
Verify if @sematext/gc-stats is actually used in the codebase and inspect the patch contents:
🏁 Script executed:
#!/bin/bash
# Check if @sematext/gc-stats is used as a dependency
echo "=== Checking package.json files for @sematext/gc-stats dependency ==="
fd -e json package.json -x grep -l "@sematext/gc-stats" {}
echo -e "\n=== Checking for imports or requires of gc-stats in the codebase ==="
rg -nP --type=ts --type=js -C3 "(require|import).*gc-stats|gc-stats"
echo -e "\n=== Inspecting the patch file contents ==="
cat .yarn/patches/@sematext-gc-stats-npm-1.5.9-01e77be4d0.patch 2>/dev/null || echo "Patch file not found in current branch"Length of output: 1152
</parameter>
</invoke>
---
🏁 Script executed:
```shell
#!/bin/bash
# Check if @sematext/gc-stats appears in dependencies section (not just resolutions)
echo "=== Checking for @sematext/gc-stats in dependencies section ==="
cat package.json | jq '.dependencies | has("@sematext/gc-stats")'
echo -e "\n=== Checking for @sematext/gc-stats in patchedDependencies section ==="
cat package.json | jq '.patchedDependencies | has("@sematext/gc-stats@npm:1.5.9") // "not found"'
echo -e "\n=== Checking if prometheus-gc-stats depends on @sematext/gc-stats ==="
rg -nP "prometheus-gc-stats" package.json -A2 -B2
echo -e "\n=== Checking patch resolutions section ==="
cat package.json | jq '.resolutions'
Length of output: 438
🏁 Script executed:
#!/bin/bash
# Check if @sematext/gc-stats appears in dependencies section (not just resolutions)
echo "=== Checking for @sematext/gc-stats in dependencies section ==="
cat package.json | jq '.dependencies | has("@sematext/gc-stats")'
echo -e "\n=== Checking for @sematext/gc-stats in patchedDependencies section ==="
cat package.json | jq '.patchedDependencies | keys[]' | grep -i sematext
echo -e "\n=== Checking resolutions section for @sematext/gc-stats ==="
cat package.json | jq '.resolutions | keys[]' | grep -i sematext
echo -e "\n=== Full patch resolutions section ==="
cat package.json | jq '.resolutions | to_entries[] | select(.key | contains("sematext"))'
echo -e "\n=== Checking prometheus-gc-stats entry in package.json ==="
cat package.json | jq '.dependencies | to_entries[] | select(.key | contains("prometheus"))'Length of output: 543
🏁 Script executed:
#!/bin/bash
# Check all dependencies that remain
echo "=== All remaining dependencies ==="
cat package.json | jq '.dependencies | keys[]'
echo -e "\n=== All remaining devDependencies ==="
cat package.json | jq '.devDependencies | keys[]' | head -20
echo -e "\n=== Check for prometheus references in dependencies ==="
cat package.json | jq '.dependencies | keys[]' | grep -i prometheus
echo -e "\n=== Check for prometheus in devDependencies ==="
cat package.json | jq '.devDependencies | keys[]' | grep -i prometheus
echo -e "\n=== Check if patch file exists ==="
if [ -f .yarn/patches/@sematext-gc-stats-npm-1.5.9-01e77be4d0.patch ]; then
echo "Patch file exists. Size:"
wc -l .yarn/patches/@sematext-gc-stats-npm-1.5.9-01e77be4d0.patch
else
echo "Patch file does not exist"
fiLength of output: 436
🏁 Script executed:
#!/bin/bash
# View the patch file contents
echo "=== Patch file contents ==="
cat .yarn/patches/@sematext-gc-stats-npm-1.5.9-01e77be4d0.patch
echo -e "\n=== Check if collectMetrics.ts import is still present ==="
rg -nP "prometheus-gc-stats" apps/meteor/app/metrics/server/lib/collectMetrics.ts
echo -e "\n=== Check for any gc-stats usage in the entire codebase ==="
rg -nP "prometheus-gc-stats|gc-stats" apps/ --type=ts --type=js | head -20
echo -e "\n=== Check if metrics file or collectMetrics is removed ==="
fd -e ts -e js metrics collectMetrics | head -10Length of output: 790
Remove patch resolution and fix broken prometheus-gc-stats import or restore the dependency.
The patch resolution for @sematext/gc-stats should not be added. Critical issue discovered:
prometheus-gc-statswas removed from dependencies, but code still imports it atapps/meteor/app/metrics/server/lib/collectMetrics.ts:10- The patch file content (removes "depcheck") is unrelated to
@sematext/gc-stats - The patch resolution is orphaned with no parent dependency to patch
Either restore prometheus-gc-stats as a dependency, or remove the import and associated code from collectMetrics.ts.
🤖 Prompt for AI Agents
In package.json around lines 82-83, a patch resolution for @sematext/gc-stats
was added but the project removed prometheus-gc-stats (which collectMetrics.ts
still imports) and the patch file content is unrelated, leaving an orphaned
patch; either restore prometheus-gc-stats as a dependency so the patch applies,
or remove the import and related GC metrics usage from
apps/meteor/app/metrics/server/lib/collectMetrics.ts. To fix: decide whether to
keep GC metrics—if yes, add prometheus-gc-stats back to package.json at the
correct version and remove the stray patch or update the patch to actually
target @sematext/gc-stats; if no, remove the import line and all references to
prometheus-gc-stats from collectMetrics.ts and delete the @sematext/gc-stats
patch resolution from package.json so there are no orphaned patches.
Reduces container image size
Proposed changes (including videos or screenshots)
Issue(s)
Steps to test or reproduce
Further comments
Summary by CodeRabbit