Repository navigation
Accept null sections in config_items.json; fix test:config - #53
Conversation
- parseConfig() rejected every non-object section, but field-less types (null_motor, NoSpindle, kinematics.midtbot/Cartesian) are null in the real config_items.json, so the whole file was always rejected. Allow null sections, and cover it in test:config (the synthetic fixture had no null section, so the test passed while the real file failed). - ConfigStudio no longer imports the store: its module-level browser code (localStorage theme read) broke test:config, which loads ConfigStudio under Node. CodeEditor passes espInfo.version down as a firmwareVersion prop instead. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 42 minutes. View limit detailsLimit details: You’ve used the included review currently available. Review configuration: ⚙️ Run configuration
📒 Files selected for processing (4)
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.
🟢 Approval recommended
The changes correctly address both reported regressions and include focused test coverage.
0 open findings
What changed in this PR
Allows FluidNC field-less configuration sections and removes ConfigStudio’s direct store dependency.
Changes:
- Accepts
nullconfiguration sections and adds regression coverage. - Passes firmware version from CodeEditor into ConfigStudio.
- Restores Node compatibility for configuration tests.
| File | Description |
|---|---|
src/lib/fluidSchema.ts |
Accepts null field-less sections. |
src/components/ConfigStudio.tsx |
Receives firmware version via props. |
src/components/CodeEditor.tsx |
Supplies the connected firmware version. |
scripts/test-config-compatibility.mjs |
Tests null-section parsing. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
This follows up #51. That PR was merged at
3ca31cf, before this fix reached its branch.Problem
c53b17crejects any section that isn't an object. Field-less types arenullin the real file:axes.<letter>.motorN.null_motor,NoSpindle,kinematics.midtbotandkinematics.Cartesian. So FigUI never uses the file and always falls back to its built-in field tables. The test passed only because its fixture had nonullsection.npm run test:configfails on main. Load FluidNC's config_items.json instead of the retired schema file #51 made ConfigStudio import the store, and the store's module-level browser code (localStorage.getItem("theme")) fails when the test loads ConfigStudio under Node.Fix
parseConfig()now allowsnullsections.test:configcovers this with aNoSpindle: nullfixture, and no longer asserts thataxes: nullis invalid.espInfo.versiondown as afirmwareVersionprop.Testing
tsc --noEmitis clean, andnpm run test:configpasses.FluidNC/docs/config_items.json(from Emit config_items.json beside config_items.yaml bdring/FluidNC#1901) now loads and builds a schema.🤖 Generated with Claude Code