Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

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

Merged
antfu merged 1 commit intonuxt:mainnuxt/icon:mainfrom
arashsheyda:patch-1arashsheyda/icon:patch-1Copy head branch name to clipboard
Apr 28, 2026
Merged

fix: detect package manager for missing collection install suggestion#474
antfu merged 1 commit intonuxt:mainnuxt/icon:mainfrom
arashsheyda:patch-1arashsheyda/icon:patch-1Copy head branch name to clipboard

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.

@antfu antfu merged commit 50c3b35 into nuxt:main Apr 28, 2026
2 checks passed
@atinux
Copy link
Copy Markdown
Member

atinux commented May 4, 2026

We could also have suggested to use npx nypm directly :)

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

3 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.