Skip to content

chore: trim unused and redundant dependencies#91

Open
tonyboylehub wants to merge 1 commit intomainfrom
chore/trim-dependencies
Open

chore: trim unused and redundant dependencies#91
tonyboylehub wants to merge 1 commit intomainfrom
chore/trim-dependencies

Conversation

@tonyboylehub
Copy link
Contributor

Audit and cleanup of production dependencies to reduce install time and bundle size.

Removed:

  • @ardrive/turbo-sdk — entirely unused (all references commented out). This was the biggest offender, pulling in wagmi, viem,
    @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
  • node-fetch — unnecessary since Node.js >= 20 has native fetch
  • mime-types + @types/mime-types — redundant with mime v4 already used in 15+ locations - @oclif/plugin-plugins — runtime plugin install not needed
  • @inquirer/testing — moved from production to devDependencies
    Results: - node_modules: 677MB → 308MB (−54%)
  • pnpm-lock.yaml: ~4,600 lines removed
  • Eliminates deprecation warnings for @walletconnect/sign-client, @walletconnect/universal-provider, node-domexception, and superagent

Test plan

  • pnpm install completes without errors
  • tsc compiles without errors
  • mplx config displays correctly (ansis replacement for chalk)
  • mplx core collection fetch -o ./out works (native fetch + mime v4)
  • mplx core asset fetch -o ./out works (mime v4)
  • Docker build completes faster and with fewer deprecation warning

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
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 20, 2026

Summary by CodeRabbit

Release Notes

  • Breaking Changes

    • Removed support for the 'turbo' storage provider. Only 'irys' and 'cascade' storage providers are now available.
  • Dependencies

    • Updated internal dependencies for improved compatibility and performance.

Walkthrough

Removes 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 (@oclif/plugin-plugins, @ardrive/turbo-sdk, node-fetch). Updates oclif plugin configuration accordingly.

Changes

Cohort / File(s) Summary
Dependency & Plugin Configuration
package.json
Removes @oclif/plugin-plugins, @ardrive/turbo-sdk, chalk, mime-types, node-fetch from dependencies; moves @inquirer/testing to devDependencies; updates oclif.plugins configuration to exclude @oclif/plugin-plugins.
Styling Library Migration
src/commands/config/index.ts
Replaces chalk with ansis for all terminal styling calls (yellow, green, bold, cyan, dim, gray color functions).
MIME Type Library Migration
src/commands/core/collection/fetch.ts, src/lib/core/fetch/fetch.ts
Switches from mime-types.extension() to mime.getExtension() and adds mime.getType() for MIME type operations; removes unused node-fetch import.
Turbo Storage Provider Removal
src/lib/Context.ts, src/lib/uploader/uploadProviders/index.ts
Narrows StorageProvider.name type union from 'irys' | 'cascade' | 'turbo' to 'irys' | 'cascade' in exported type definitions.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

Suggested reviewers

  • blockiosaurus
  • nhanphan
🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main objective of the changeset: removing unused and redundant dependencies from the project.
Description check ✅ Passed The description is directly related to the changeset, providing detailed context about why dependencies were removed, the specific benefits (node_modules reduction, lockfile shrinkage), and a comprehensive test plan.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/trim-dependencies

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.

Tip

CodeRabbit can use OpenGrep to find security vulnerabilities and bugs across 17+ programming languages.

OpenGrep is compatible with Semgrep configurations. Add an opengrep.yml or semgrep.yml configuration file to your project to enable OpenGrep analysis.

Copy link
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.

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

📥 Commits

Reviewing files that changed from the base of the PR and between 667e3a9 and dea0072.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (6)
  • package.json
  • src/commands/config/index.ts
  • src/commands/core/collection/fetch.ts
  • src/lib/Context.ts
  • src/lib/core/fetch/fetch.ts
  • src/lib/uploader/uploadProviders/index.ts

const ext = contentType && mime.extension(contentType)
const ext = contentType && mime.getExtension(contentType)

const fileName = basename(jsonFile.image) + (ext && `.${ext}`)
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

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.

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