refactor(app): restructure plugins into directory modules - #470
Conversation
|
Warning Rate limit exceeded
Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 10 minutes and 59 seconds. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (76)
WalkthroughThis PR restructures the plugin system by consolidating per-plugin imports (removing nested subdirectories like Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 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 |
98adf5e to
f02ae44
Compare
There was a problem hiding this comment.
Actionable comments posted: 2
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
app/src/plugins/index.ts (1)
8-11:⚠️ Potential issue | 🟡 MinorUpdate stale documentation comment.
The comment references
your-chart.ts(flat file) but the new structure uses directories withcomponent.tsx,settings.ts,transform.ts, andindex.ts.📝 Suggested update
* To add a new chart plugin: -* 1. Create `app/src/plugins/your-chart.ts` that exports a plugin -* via `defineChartPlugin({ ... })` +* 1. Create a directory `app/src/plugins/your-chart/` containing: +* - component.tsx (exports plugin via `defineChartPlugin`) +* - settings.ts, transform.ts, index.ts * 2. Add the plugin to the BUILT_IN_PLUGINS array below🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@app/src/plugins/index.ts` around lines 8 - 11, Update the stale doc comment to reflect the new plugin directory structure: instruct contributors to create a directory under app/src/plugins/your-chart containing component.tsx, settings.ts, transform.ts and an index.ts that exports the plugin via defineChartPlugin({...}), and then add that plugin to the BUILT_IN_PLUGINS array (referencing BUILT_IN_PLUGINS and defineChartPlugin to locate the relevant code).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@app/src/plugins/index.ts`:
- Around line 19-35: Replace the 17 direct component path imports (e.g., import
{ barPlugin } from "./bar/component";) with barrel imports that use each plugin
directory's index.ts re-exports (e.g., import { barPlugin } from "./bar";),
doing this for markdownPlugin, barPlugin, linePlugin, piePlugin,
singleValuePlugin, graphPlugin, mapPlugin, tablePlugin, parameterSelectPlugin,
jsonPlugin, formPlugin, iframePlugin, gaugePlugin, sankeyPlugin, sunburstPlugin,
radarPlugin, and treemapPlugin so the per-plugin index.ts files are actually
used and the component paths are not referenced directly.
In `@app/src/plugins/single-value/index.ts`:
- Line 1: The barrel export currently re-exports singleValuePlugin (export {
singleValuePlugin } from "./component") but the registry bypasses it by
importing directly from "./single-value/component"; update the registry import
in the plugins index to import singleValuePlugin from "./single-value" (so it
uses the barrel), ensuring the exported symbol name singleValuePlugin matches
and removing the direct "./single-value/component" import to keep the directory
module pattern consistent.
---
Outside diff comments:
In `@app/src/plugins/index.ts`:
- Around line 8-11: Update the stale doc comment to reflect the new plugin
directory structure: instruct contributors to create a directory under
app/src/plugins/your-chart containing component.tsx, settings.ts, transform.ts
and an index.ts that exports the plugin via defineChartPlugin({...}), and then
add that plugin to the BUILT_IN_PLUGINS array (referencing BUILT_IN_PLUGINS and
defineChartPlugin to locate the relevant code).
🪄 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: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 5451119b-9a18-4afe-a48d-f8adf2f938c5
📒 Files selected for processing (78)
app/package.jsonapp/src/plugins/bar/component.tsxapp/src/plugins/bar/index.tsapp/src/plugins/bar/settings.tsapp/src/plugins/bar/transform.tsapp/src/plugins/form/component.tsxapp/src/plugins/form/index.tsapp/src/plugins/form/settings.tsapp/src/plugins/gauge/component.tsxapp/src/plugins/gauge/index.tsapp/src/plugins/gauge/settings.tsapp/src/plugins/gauge/transform.tsapp/src/plugins/graph/component.tsxapp/src/plugins/graph/index.tsapp/src/plugins/graph/settings.tsapp/src/plugins/graph/transform.tsapp/src/plugins/iframe/component.tsxapp/src/plugins/iframe/index.tsapp/src/plugins/iframe/settings.tsapp/src/plugins/index.tsapp/src/plugins/json/component.tsxapp/src/plugins/json/index.tsapp/src/plugins/json/settings.tsapp/src/plugins/json/transform.tsapp/src/plugins/line/component.tsxapp/src/plugins/line/index.tsapp/src/plugins/line/settings.tsapp/src/plugins/line/transform.tsapp/src/plugins/map/component.tsxapp/src/plugins/map/index.tsapp/src/plugins/map/settings.tsapp/src/plugins/map/transform.tsapp/src/plugins/markdown/component.tsxapp/src/plugins/markdown/index.tsapp/src/plugins/markdown/settings.tsapp/src/plugins/parameter-select/component.tsxapp/src/plugins/parameter-select/index.tsapp/src/plugins/parameter-select/settings.tsapp/src/plugins/parameter-select/transform.tsapp/src/plugins/pie/component.tsxapp/src/plugins/pie/index.tsapp/src/plugins/pie/settings.tsapp/src/plugins/pie/transform.tsapp/src/plugins/radar/component.tsxapp/src/plugins/radar/index.tsapp/src/plugins/radar/settings.tsapp/src/plugins/radar/transform.tsapp/src/plugins/sankey/component.tsxapp/src/plugins/sankey/index.tsapp/src/plugins/sankey/settings.tsapp/src/plugins/sankey/transform.tsapp/src/plugins/settings/__tests__/settings-schemas.test.tsapp/src/plugins/settings/index.tsapp/src/plugins/single-value/component.tsxapp/src/plugins/single-value/index.tsapp/src/plugins/single-value/settings.tsapp/src/plugins/single-value/transform.tsapp/src/plugins/sunburst/component.tsxapp/src/plugins/sunburst/index.tsapp/src/plugins/sunburst/settings.tsapp/src/plugins/sunburst/transform.tsapp/src/plugins/table/component.tsxapp/src/plugins/table/index.tsapp/src/plugins/table/settings.tsapp/src/plugins/table/transform.tsapp/src/plugins/transforms/__tests__/bar.test.tsapp/src/plugins/transforms/__tests__/graph.test.tsapp/src/plugins/transforms/__tests__/line.test.tsapp/src/plugins/transforms/__tests__/pie.test.tsapp/src/plugins/transforms/__tests__/remaining.test.tsapp/src/plugins/transforms/__tests__/shared.test.tsapp/src/plugins/transforms/hierarchical-utils.tsapp/src/plugins/transforms/index.tsapp/src/plugins/transforms/shared-utils.tsapp/src/plugins/treemap/component.tsxapp/src/plugins/treemap/index.tsapp/src/plugins/treemap/settings.tsapp/src/plugins/treemap/transform.ts
💤 Files with no reviewable changes (1)
- app/src/plugins/settings/index.ts
0d39cab to
9f66d84
Compare
Move each chart plugin from flat files into self-contained directories: plugins/bar.tsx → plugins/bar/component.tsx + settings.ts + transform.ts + index.ts All 17 plugins restructured. Each directory colocates component, settings schema, and data transform. Shared utilities remain in plugins/transforms/. Also fixes: - Restore --webpack flag for production build (Turbopack build not ready) - Remove duplicate nodeClick property in sunburst-chart.tsx Closes #421 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…ack) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
9f66d84 to
5b4b89a
Compare
|
* refactor(app): restructure plugins into directory modules, fix build Move each chart plugin from flat files into self-contained directories: plugins/bar.tsx → plugins/bar/component.tsx + settings.ts + transform.ts + index.ts All 17 plugins restructured. Each directory colocates component, settings schema, and data transform. Shared utilities remain in plugins/transforms/. Also fixes: - Restore --webpack flag for production build (Turbopack build not ready) - Remove duplicate nodeClick property in sunburst-chart.tsx Closes #421 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * refactor: use barrel imports for plugin directories (CodeRabbit feedback) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> --------- Co-authored-by: alfredorubin96 <alfredo.rubin@neotechnology.com> Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>


Summary
Restructures all 17 chart plugins from flat files into self-contained directory modules.
Each plugin now has: component.tsx + settings.ts + transform.ts + index.ts
Also fixes:
Test plan
Closes #421
🤖 Generated with Claude Code
Summary by CodeRabbit