fix: register server handler only for server provider - #524
Conversation
commit: |
📝 WalkthroughWalkthroughThe module now registers the local server API handler only when Estimated code review effort: 2 (Simple) | ~10 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 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 |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
test/module.test.ts (1)
12-18: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick winAdd a positive control for the
serverprovider.This test only checks
provider: "iconify"and skips server handling. Add a separate test withprovider: "server"that asserts/api/_nuxt_icon/:collectionis registered, unless an existing test already covers this branch.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@test/module.test.ts` around lines 12 - 18, Add a separate test alongside the existing iconify-provider test that configures or exercises provider "server" and asserts serverHandlers contains an entry with route "/api/_nuxt_icon/:collection". Reuse the existing test context setup and avoid modifying the negative assertion for the iconify provider.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@test/module.test.ts`:
- Around line 12-18: Add a separate test alongside the existing iconify-provider
test that configures or exercises provider "server" and asserts serverHandlers
contains an entry with route "/api/_nuxt_icon/:collection". Reuse the existing
test context setup and avoid modifying the negative assertion for the iconify
provider.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 3180296d-cd3a-4ebb-87eb-97863fd935ee
📒 Files selected for processing (3)
src/module.tstest/fixtures/iconify-provider/nuxt.config.tstest/module.test.ts
Summary
When
providerisiconify, the client loads icons from the Iconify API and the server bundle resolver disables the server bundle, but the module still registers the local/api/_nuxt_icon/:collectionhandler. This change registers that handler only for theserverprovider.StackBlitz
CLI reproduction
Verify fix
Tests
pnpm test:unit --runpnpm lintpnpm typecheckpnpm build