Skip to content

fix: detect package manager for missing collection install suggestion#474

Open
arashsheyda wants to merge 1 commit intonuxt:mainfrom
arashsheyda:patch-1
Open

fix: detect package manager for missing collection install suggestion#474
arashsheyda wants to merge 1 commit intonuxt:mainfrom
arashsheyda:patch-1

Conversation

@arashsheyda
Copy link
Copy Markdown
Member

🔗 Linked issue

closes #473

📚 Description

This PR detects the active package manager via process.env.npm_config_user_agent and shows the correct install command

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 1, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: c606fd99-34a4-4d8b-8669-3c2f70452400

📥 Commits

Reviewing files that changed from the base of the PR and between b45023d and db24779.

📒 Files selected for processing (1)
  • src/runtime/server/api.ts

📝 Walkthrough

Walkthrough

A new helper function getInstallCommand(pkg) was added to detect the active package manager by inspecting process.env.npm_config_user_agent and return the appropriate install command for pnpm, yarn, bun, or npm. The development-only warning message that displays when a requested icon collection isn't available locally now uses this helper to suggest the correct install command based on the detected package manager, replacing the previously hardcoded npm i -D instruction.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~5 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately and concisely describes the main change: detecting the package manager to provide the correct install suggestion.
Description check ✅ Passed The description is related to the changeset, explaining that it detects the active package manager and shows the correct install command.
Linked Issues check ✅ Passed The PR implements the objective from issue #473 by introducing getInstallCommand() helper that detects the package manager via process.env.npm_config_user_agent and provides the appropriate install command.
Out of Scope Changes check ✅ Passed All changes are directly related to the stated objective of detecting the package manager and updating the install suggestion message; no out-of-scope modifications detected.
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 unit tests (beta)
  • Create PR with unit tests

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.

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.

detect package manager for missing collection install suggestion

1 participant