chore: trim unused and redundant dependencies#91
Conversation
Remove @ardrive/turbo-sdk (unused, all code commented out) which pulled in wagmi, walletconnect, viem, and other EVM libraries. Remove redundant chalk (replaced with existing ansis), node-fetch (Node 20 has native fetch), and mime-types (replaced with existing mime v4). Remove @oclif/plugin-plugins (runtime plugin install not needed). Move @inquirer/testing to devDependencies. node_modules: 677MB → 308MB (-54%) lockfile: ~4,600 lines removed
Summary by CodeRabbitRelease Notes
WalkthroughRemoves turbo storage provider support and updates core dependencies. Replaces styling library from chalk to ansis, migrates MIME type detection from mime-types to mime, and removes related unused dependencies ( Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 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 Tip CodeRabbit can use OpenGrep to find security vulnerabilities and bugs across 17+ programming languages.OpenGrep is compatible with Semgrep configurations. Add an |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@src/commands/core/collection/fetch.ts`:
- Line 71: The filename construction can append "false" when ext is
null/undefined because (ext && `.${ext}`) yields false; update the logic around
fileName creation (where basename(jsonFile.image) and ext are used) to coerce
ext to a safe string or use a conditional that returns an empty string when ext
is missing (e.g., ext ? `.${ext}` : '') so fileName becomes
basename(jsonFile.image) + (ext ? `.${ext}` : ''); ensure the ext value produced
by mime.getExtension(contentType) is handled when it returns null.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: 5590932a-f831-4e10-8b79-cb9123d630a7
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (6)
package.jsonsrc/commands/config/index.tssrc/commands/core/collection/fetch.tssrc/lib/Context.tssrc/lib/core/fetch/fetch.tssrc/lib/uploader/uploadProviders/index.ts
| const ext = contentType && mime.extension(contentType) | ||
| const ext = contentType && mime.getExtension(contentType) | ||
|
|
||
| const fileName = basename(jsonFile.image) + (ext && `.${ext}`) |
There was a problem hiding this comment.
Potential filename construction bug when extension is unavailable.
If contentType is missing or mime.getExtension() returns null, the expression (ext && \.${ext}`)evaluates tofalse, resulting in a filename like "image.pngfalse"` due to string concatenation.
🐛 Proposed fix
- const fileName = basename(jsonFile.image) + (ext && `.${ext}`)
+ const fileName = basename(jsonFile.image) + (ext ? `.${ext}` : '')🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@src/commands/core/collection/fetch.ts` at line 71, The filename construction
can append "false" when ext is null/undefined because (ext && `.${ext}`) yields
false; update the logic around fileName creation (where basename(jsonFile.image)
and ext are used) to coerce ext to a safe string or use a conditional that
returns an empty string when ext is missing (e.g., ext ? `.${ext}` : '') so
fileName becomes basename(jsonFile.image) + (ext ? `.${ext}` : ''); ensure the
ext value produced by mime.getExtension(contentType) is handled when it returns
null.
Audit and cleanup of production dependencies to reduce install time and bundle size.
Removed:
@walletconnect/*, ethers, and other EVM libraries irrelevant to a Solana CLI - chalk — redundant with ansis already used via StandardColors.ts. Replaced single usage in src/commands/config/index.ts
Results: - node_modules: 677MB → 308MB (−54%)
Test plan