Update to version 2.1.0, adding the Expo Mobile App plugin and enhancing plugin management. Introduce self-distributing flag for plugins, update variant configuration, and improve plugin installation logic. Update CHANGELOG and package.json accordingly. - #10
Conversation
…ing plugin management. Introduce self-distributing flag for plugins, update variant configuration, and improve plugin installation logic. Update CHANGELOG and package.json accordingly.
WalkthroughThe plugin model now supports self-distributing Expo plugins and multi-directory installations. Add operations run self-distributing codemods without registry files. Update and outdated checks exclude plugins that are not registry-trackable. Tests cover the new behavior. ChangesPlugin distribution workflow
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant CLI
participant PluginCommand
participant Registry
participant Codemod
CLI->>PluginCommand: process plugin operation
PluginCommand->>PluginCommand: check isTrackable
alt self-distributing plugin
PluginCommand->>Codemod: run without registry version
Codemod-->>CLI: complete installation
else registry-tracked plugin
PluginCommand->>Registry: fetch plugin files
Registry-->>PluginCommand: return registry data
PluginCommand-->>CLI: continue update or installation
end
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 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.
Actionable comments posted: 1
🧹 Nitpick comments (1)
src/plugins-model.test.ts (1)
106-111: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winAdd a test for the missing-
namebranch.This test covers only the
!pkg.exportshalf ofif (!pkg.name || !pkg.exports)inisInstalled. No test exercises apackage.jsonwithexportsbut noname. Add a companion case to cover that branch.✅ Suggested additional test
it('is false when the package.json has no exports', async () => { mockDisk(['packages/plugins/feedback/package.json']); vi.mocked(fs.readJson).mockResolvedValue({ name: 'feedback' }); await expect(isInstalled(SINGLE_PATH, 'next-supabase')).resolves.toBe(false); }); + + it('is false when the package.json has no name', async () => { + mockDisk(['packages/plugins/feedback/package.json']); + vi.mocked(fs.readJson).mockResolvedValue({ exports: { '.': './src/index.ts' } }); + + await expect(isInstalled(SINGLE_PATH, 'next-supabase')).resolves.toBe(false); + });🤖 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 `@src/plugins-model.test.ts` around lines 106 - 111, Add a companion test alongside the existing no-exports case that mocks a package.json containing exports but no name, then assert isInstalled(SINGLE_PATH, 'next-supabase') resolves to false. Keep the setup and assertion pattern consistent with the existing test.
🤖 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.
Inline comments:
In `@src/utils/apply-plugin-update.ts`:
- Around line 57-62: Check isTrackable(plugin) before resolving or caching the
GitHub username in apply-plugin-update.ts and check-plugin-update.ts, leaving
self-distributing plugins independent of registry access; add no-username
regression cases for those flows. In outdated-plugins.ts, filter installed
plugins to trackable entries before requiring a username and return an empty
outdated list when none remain.
---
Nitpick comments:
In `@src/plugins-model.test.ts`:
- Around line 106-111: Add a companion test alongside the existing no-exports
case that mocks a package.json containing exports but no name, then assert
isInstalled(SINGLE_PATH, 'next-supabase') resolves to false. Keep the setup and
assertion pattern consistent with the existing test.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: bc704ba6-7881-4ccc-ba67-ea41a7d2a4e5
📒 Files selected for processing (12)
CHANGELOG.mdpackage.jsonsrc/plugins-model.test.tssrc/plugins-model.tssrc/utils/add-plugin.test.tssrc/utils/add-plugin.tssrc/utils/apply-plugin-update.test.tssrc/utils/apply-plugin-update.tssrc/utils/check-plugin-update.test.tssrc/utils/check-plugin-update.tssrc/utils/outdated-plugins.tssrc/utils/test-helpers.ts
| if (!isTrackable(plugin)) { | ||
| return { | ||
| success: false, | ||
| reason: `Plugin "${plugin.name}" ships its own files and is not tracked by the registry, so there is nothing to apply. Re-run its codemod to pull a newer version.`, | ||
| }; | ||
| } |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Check registry trackability before requiring or caching a GitHub username.
A self-distributing plugin does not need registry access. If no username is cached, these flows return the username failure before they can reject or exclude the plugin. They can also cache a supplied username for an operation that does not use it.
src/utils/apply-plugin-update.ts#L57-L62: Move username resolution andcacheUsername()after theisTrackable(plugin)check.src/utils/check-plugin-update.ts#L61-L66: Move username resolution andcacheUsername()after theisTrackable(plugin)check.src/utils/outdated-plugins.ts#L85-L87: Filter installed trackable plugins before requiring a username. Return an empty outdated list when no trackable installed plugins remain.- Add no-username regression cases for self-distributing plugins.
📍 Affects 3 files
src/utils/apply-plugin-update.ts#L57-L62(this comment)src/utils/check-plugin-update.ts#L61-L66src/utils/outdated-plugins.ts#L85-L87
🤖 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 `@src/utils/apply-plugin-update.ts` around lines 57 - 62, Check
isTrackable(plugin) before resolving or caching the GitHub username in
apply-plugin-update.ts and check-plugin-update.ts, leaving self-distributing
plugins independent of registry access; add no-username regression cases for
those flows. In outdated-plugins.ts, filter installed plugins to trackable
entries before requiring a username and return an empty outdated list when none
remain.
Summary by CodeRabbit
New Features
Bug Fixes
Documentation