Skip to content

fix: detect installed collections from Nuxt rootDir/workspaceDir#477

Open
benjamincanac wants to merge 1 commit intomainfrom
fix/detect-collections
Open

fix: detect installed collections from Nuxt rootDir/workspaceDir#477
benjamincanac wants to merge 1 commit intomainfrom
fix/detect-collections

Conversation

@benjamincanac
Copy link
Copy Markdown
Member

@benjamincanac benjamincanac commented Apr 23, 2026

🔗 Linked issue

Related #473

📚 Description

Resolve @iconify-json/* auto-discovery from nuxt.options.rootDir / workspaceDir instead of process.cwd(), so collections installed in a subproject's node_modules are detected when nuxt dev is run from a pnpm workspace root.

@benjamincanac benjamincanac requested a review from antfu April 23, 2026 09:14
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 23, 2026

📝 Walkthrough

Walkthrough

This change introduces Nuxt context awareness to collection path resolution and discovery. The module now passes the Nuxt instance to helper functions that resolve iconify-json collection paths and detect installed collections. The resolution mechanism uses the Nuxt root directory to dynamically determine whether the full @iconify/json bundle is installed or individual @iconify-json/<collection> packages are being used, affecting both path generation for bundling and collection discovery logic. The exported function isFullCollectionExists is replaced with a new hasFullCollection(nuxt) function.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title 'fix: detect installed collections from Nuxt rootDir/workspaceDir' clearly and specifically describes the main change—updating collection detection to use Nuxt context paths instead of process.cwd().
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description check ✅ Passed The PR description clearly explains the problem (collections not detected from workspace subprojects) and the solution (use nuxt.options.rootDir/workspaceDir instead of process.cwd()).

✏️ 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 fix/detect-collections

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.

1 participant