docs: propagate folder-naming convention + bump submodules for editor refresh
Convention: * CLAUDE.md (root): new "Folder & File Layout (READ BEFORE CREATING NEW FILES)" section with required-name table and explicit legacy-drift list (mgc, vgc, dashboardapi). * .claude/rules/node-architecture.md: file-naming convention + src/editor/ module layout sections; serving recipe for /<nodeName>/editor/:file. Submodule bumps: * generalFunctions: shared output-format picker, redesigned position SVGs, tighter asset wizard, restored curve preview size. * rotatingMachine: pump banner, circular state diagram, mode icon cards, picker integration, CLAUDE.md update. * 10 others: per-node CLAUDE.md "Folder & File Layout" sections — 3 of them (machineGroupControl, valveGroupControl, dashboardAPI) carry inline warnings about their entry-filename drift. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
29
CLAUDE.md
29
CLAUDE.md
@@ -9,10 +9,35 @@ Node-RED custom nodes package for wastewater treatment plant automation. Develop
|
||||
|
||||
## Architecture
|
||||
Each node follows a three-layer pattern:
|
||||
1. **Node-RED wrapper** (`<name>.js`) - registers the node type, sets up HTTP endpoints
|
||||
1. **Node-RED wrapper** (`<nodeName>.js`) - registers the node type, sets up HTTP endpoints
|
||||
2. **Node adapter** (`src/nodeClass.js`) - bridges Node-RED API with domain logic, handles config loading, tick loops, events
|
||||
3. **Domain logic** (`src/specificClass.js`) - pure business logic, no Node-RED dependencies
|
||||
|
||||
## Folder & File Layout (READ BEFORE CREATING NEW FILES)
|
||||
Every per-node file MUST use the folder name **exactly** (case-sensitive). No
|
||||
abbreviations. Quick reference:
|
||||
|
||||
| Path | Required name |
|
||||
|---|---|
|
||||
| Entry file | `nodes/<nodeName>/<nodeName>.js` |
|
||||
| Editor HTML | `nodes/<nodeName>/<nodeName>.html` |
|
||||
| Node adapter | `nodes/<nodeName>/src/nodeClass.js` |
|
||||
| Domain logic | `nodes/<nodeName>/src/specificClass.js` |
|
||||
| Editor JS modules | `nodes/<nodeName>/src/editor/*.js` (extract when inline editor JS exceeds ~50 lines) |
|
||||
| Tests | `nodes/<nodeName>/test/{basic,integration,edge}/*.test.js` |
|
||||
| Example flows | `nodes/<nodeName>/examples/*.flow.json` |
|
||||
|
||||
Full rule + serving recipe for `src/editor/`: `.claude/rules/node-architecture.md`.
|
||||
|
||||
**Legacy drift to rename when the file is next touched** (do not introduce new
|
||||
mismatches in the meantime):
|
||||
|
||||
| Node | Currently | Should be |
|
||||
|---|---|---|
|
||||
| `machineGroupControl` | `mgc.{js,html}` | `machineGroupControl.{js,html}` |
|
||||
| `valveGroupControl` | `vgc.{js,html}` | `valveGroupControl.{js,html}` |
|
||||
| `dashboardAPI` | `dashboardapi.{js,html}` | `dashboardAPI.{js,html}` |
|
||||
|
||||
## Key Shared Library: `nodes/generalFunctions/`
|
||||
- `logger` - structured logging (use this, NOT console.log)
|
||||
- `MeasurementContainer` - chainable measurement storage (type/variant/position)
|
||||
@@ -27,7 +52,7 @@ Each node follows a three-layer pattern:
|
||||
- S88 color scheme: Area=#0f52a5, ProcessCell=#0c99d9, Unit=#50a8d9, Equipment=#86bbdd, ControlModule=#a9daee
|
||||
- Config JSON files in `generalFunctions/src/configs/` define defaults, types, enums per node
|
||||
- Tick loop runs at 1000ms intervals for time-based updates
|
||||
- Output ports + 3-tier architecture: see `.claude/rules/node-architecture.md`
|
||||
- Output ports + 3-tier architecture + file-naming + `src/editor/` layout: see `.claude/rules/node-architecture.md`
|
||||
- **Multi-tab demo flows**: see `.claude/rules/node-red-flow-layout.md` for the tab/link-channel/spacing rule set used by `examples/`
|
||||
- **Output coverage** (every output, every state, every layer): see `.claude/rules/output-coverage.md` — manifest + populated/degraded tests are mandatory for any change that touches Port 0/1/2 keys, function-node fan-outs, telemetry fields, or dashboard widget sources
|
||||
|
||||
|
||||
Reference in New Issue
Block a user