refactor: rename dashboard-provider-mock to dashboard-data-provider#184
Conversation
The plugin now serves as the primary dashboard data provider, making the "mock" name misleading. Rename the plugin directory, package name, global name, exported function, and all references across the codebase. - Rename plugins/dashboard-provider-mock → plugins/dashboard-data-provider - Rename registerMockDashboardProvider → registerDashboardProvider - Update plugin.json (name, displayName, description, entry, keywords) - Update package.json (@naap/plugin-dashboard-data-provider-frontend) - Update vite.config.ts (NaapPluginDashboardDataProvider) - Update App.tsx, mount.tsx, provider.ts, README.md - Update prisma/seed.ts (dashboardDataProvider) - Update BackgroundPluginLoader, plugin-discovery, cleanup script, docs - Update CDN serve tests for new kebab-case name Made-with: Cursor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (1)
📝 WalkthroughWalkthroughRenames the plugin from Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested labels
Suggested reviewers
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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 (2)
apps/web-next/src/app/cdn/plugins/__tests__/cdn-serve.test.ts (1)
160-167: Test expectations are correct, but there's duplicate coverage.The
toKebabCase('dashboardDataProvider')→'dashboard-data-provider'conversion is correct. However, lines 162 and 166 test the exact same input/output pair in two different test cases ("handles unknown/new plugin names" and "handles triple-word camelCase"). Consider consolidating or differentiating these tests.♻️ Suggested differentiation
it('handles unknown/new plugin names without a map entry', () => { expect(toKebabCase('someNewPlugin')).toBe('some-new-plugin'); - expect(toKebabCase('dashboardDataProvider')).toBe('dashboard-data-provider'); + expect(toKebabCase('customAnalytics')).toBe('custom-analytics'); }); it('handles triple-word camelCase', () => { expect(toKebabCase('dashboardDataProvider')).toBe('dashboard-data-provider'); + expect(toKebabCase('networkStatusMonitor')).toBe('network-status-monitor'); });🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@apps/web-next/src/app/cdn/plugins/__tests__/cdn-serve.test.ts` around lines 160 - 167, The tests duplicate the same assertion for toKebabCase('dashboardDataProvider') in two different it blocks; either consolidate them into a single focused test or change the second test to a distinct triple-word example (e.g., call toKebabCase with a different camelCase like 'veryLongPluginName' or 'analyticsDataProvider') and assert its expected kebab-case output, updating the it description accordingly so each case covers unique behavior.apps/web-next/src/content/docs/guides/dashboard-data-provider.mdx (1)
21-21: Consider standardizing the sample destination plugin name across docs.Line 21 uses
plugins/my-network-provider, while the plugin README example usesplugins/my-dashboard-provider. Picking one convention across docs would reduce copy/paste confusion.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@apps/web-next/src/content/docs/guides/dashboard-data-provider.mdx` at line 21, The sample destination plugin name is inconsistent; change the command string "plugins/my-network-provider" to the canonical "plugins/my-dashboard-provider" in the docs (the line containing cp -r plugins/dashboard-data-provider plugins/my-network-provider) and then search other docs/README examples for "my-network-provider" or "my-dashboard-provider" to make them all use the same "plugins/my-dashboard-provider" name for consistency.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@apps/web-next/src/app/cdn/plugins/__tests__/cdn-serve.test.ts`:
- Around line 160-167: The tests duplicate the same assertion for
toKebabCase('dashboardDataProvider') in two different it blocks; either
consolidate them into a single focused test or change the second test to a
distinct triple-word example (e.g., call toKebabCase with a different camelCase
like 'veryLongPluginName' or 'analyticsDataProvider') and assert its expected
kebab-case output, updating the it description accordingly so each case covers
unique behavior.
In `@apps/web-next/src/content/docs/guides/dashboard-data-provider.mdx`:
- Line 21: The sample destination plugin name is inconsistent; change the
command string "plugins/my-network-provider" to the canonical
"plugins/my-dashboard-provider" in the docs (the line containing cp -r
plugins/dashboard-data-provider plugins/my-network-provider) and then search
other docs/README examples for "my-network-provider" or "my-dashboard-provider"
to make them all use the same "plugins/my-dashboard-provider" name for
consistency.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 1a190c6e-930a-4a22-8717-0762fe491bd0
⛔ Files ignored due to path filters (1)
package-lock.jsonis excluded by!**/package-lock.json,!package-lock.json
📒 Files selected for processing (30)
apps/web-next/prisma/seed.tsapps/web-next/src/app/cdn/plugins/__tests__/cdn-serve.test.tsapps/web-next/src/components/plugin/BackgroundPluginLoader.tsxapps/web-next/src/content/docs/guides/dashboard-data-provider.mdxbin/cleanup-moved-plugins.tspackages/database/src/plugin-discovery.tsplugins/dashboard-data-provider/README.mdplugins/dashboard-data-provider/frontend/index.htmlplugins/dashboard-data-provider/frontend/package.jsonplugins/dashboard-data-provider/frontend/src/App.tsxplugins/dashboard-data-provider/frontend/src/__tests__/provider.test.tsplugins/dashboard-data-provider/frontend/src/data/index.tsplugins/dashboard-data-provider/frontend/src/data/mock-fees.tsplugins/dashboard-data-provider/frontend/src/data/mock-gpu.tsplugins/dashboard-data-provider/frontend/src/data/mock-jobs.tsplugins/dashboard-data-provider/frontend/src/data/mock-kpi.tsplugins/dashboard-data-provider/frontend/src/data/mock-pipelines.tsplugins/dashboard-data-provider/frontend/src/data/mock-pricing.tsplugins/dashboard-data-provider/frontend/src/data/mock-protocol.tsplugins/dashboard-data-provider/frontend/src/globals.cssplugins/dashboard-data-provider/frontend/src/job-feed-emitter.tsplugins/dashboard-data-provider/frontend/src/main.tsxplugins/dashboard-data-provider/frontend/src/mount.tsxplugins/dashboard-data-provider/frontend/src/provider.tsplugins/dashboard-data-provider/frontend/tailwind.config.jsplugins/dashboard-data-provider/frontend/tsconfig.jsonplugins/dashboard-data-provider/frontend/vite.config.tsplugins/dashboard-data-provider/plugin.jsonplugins/dashboard-provider-mock/frontend/vite.config.tsplugins/dashboard-provider-mock/plugin.json
💤 Files with no reviewable changes (2)
- plugins/dashboard-provider-mock/frontend/vite.config.ts
- plugins/dashboard-provider-mock/plugin.json
…encies to resolve EBADPLATFORM issues on non-macOS CI runners
The useWHIP hook imports getAuthToken from api.ts but the function was not exported, causing the plugin build to fail with: "getAuthToken is not exported by src/lib/api.ts" Made-with: Cursor
Summary
dashboard-provider-mockplugin todashboard-data-provideracross the entire codebaseChanges
plugins/dashboard-provider-mock→plugins/dashboard-data-provider@naap/plugin-dashboard-data-provider-frontendNaapPluginDashboardDataProviderglobal nameregisterMockDashboardProvider→registerDashboardProviderdashboardDataProvidercamelCase name, updated metadataScreenshots
Breaking Changes
Plugin rename —
dashboard-provider-mockis nowdashboard-data-provider. The DB seed usesdashboardDataProvideras the camelCase name. Existing installations will need a re-seed or manual DB update.registerMockDashboardProvider→registerDashboardProvider— the exported function name changed.Test Plan
dashboard-provider-mocknameSummary by CodeRabbit
Refactor
Documentation
Tests
Chore