From e04c4a113288192bf4388a8b6da1df7344ae1318 Mon Sep 17 00:00:00 2001 From: znetsixe Date: Tue, 19 May 2026 16:36:56 +0200 Subject: [PATCH] =?UTF-8?q?fix:=20rename=20dashboardapi.{js,html}=20?= =?UTF-8?q?=E2=86=92=20dashboardAPI.{js,html}?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Aligns the entry-file naming with the folder-name convention from .claude/rules/node-architecture.md / superproject CLAUDE.md. NON-BREAKING: the Node-RED type id stays lowercase (`RED.nodes.registerType('dashboardapi', ...)`) so every deployed flow that references this node continues to load. Only the file paths change. Admin endpoints `/dashboardapi/menu.js` and `/dashboardapi/configData.js` are unaffected — they follow the type id, not the filename. Updated: - package.json `main` + `node-red.nodes` value - test/basic/structure-module-load.basic.test.js require path - CLAUDE.md: legacy-drift warning replaced with a note explaining the type-id preservation strategy Same approach recommended for the remaining two legacy renames (mgc, vgc); the superproject CLAUDE.md drift table now spells that out. Co-Authored-By: Claude Opus 4.7 (1M context) --- CLAUDE.md | 9 +-------- dashboardapi.html => dashboardAPI.html | 0 dashboardapi.js => dashboardAPI.js | 0 package.json | 4 ++-- test/basic/structure-module-load.basic.test.js | 2 +- 5 files changed, 4 insertions(+), 11 deletions(-) rename dashboardapi.html => dashboardAPI.html (100%) rename dashboardapi.js => dashboardAPI.js (100%) diff --git a/CLAUDE.md b/CLAUDE.md index d8d2f21..0e82d44 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -36,13 +36,6 @@ Every per-node file MUST use the folder name (`dashboardAPI`) **exactly**, case- | Tests | `test/{basic,integration,edge}/*.test.js` | | Example flows | `examples/*.flow.json` | -> ⚠️ **Legacy naming drift in this repo** — to be renamed when the file is next touched: -> -> | Path | Currently | Should be | -> |---|---|---| -> | Entry file | `dashboardapi.js` | `dashboardAPI.js` | -> | Editor HTML | `dashboardapi.html` | `dashboardAPI.html` | -> -> Renames require updating: the file itself, `package.json#node-red.nodes`, any `require()` / `import` paths, and superproject submodule references in one commit. +> ℹ️ **Note on the Node-RED type id.** The files are now `dashboardAPI.{js,html}` (folder-name convention satisfied 2026-05-19), but the registered type id stays lowercase: `RED.nodes.registerType('dashboardapi', …)`. Every deployed flow references the type id, not the file name, so this preserves backward compatibility. Admin endpoints (`/dashboardapi/menu.js`, `/dashboardapi/configData.js`) follow the type id and are also unchanged. When adding new files, read the rule above first to avoid drift. diff --git a/dashboardapi.html b/dashboardAPI.html similarity index 100% rename from dashboardapi.html rename to dashboardAPI.html diff --git a/dashboardapi.js b/dashboardAPI.js similarity index 100% rename from dashboardapi.js rename to dashboardAPI.js diff --git a/package.json b/package.json index f1ff3fb..ee45ab3 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "dashboardAPI", "version": "1.0.0", "description": "EVOLV Grafana dashboard generator (Node-RED node).", - "main": "dashboardapi.js", + "main": "dashboardAPI.js", "scripts": { "test": "node --test test/basic/*.test.js test/integration/*.test.js test/edge/*.test.js", "wiki:contract": "node ../generalFunctions/scripts/wikiGen.js contract ./src/commands/index.js --write ./wiki/Home.md", @@ -22,7 +22,7 @@ }, "node-red": { "nodes": { - "dashboardapi": "dashboardapi.js" + "dashboardapi": "dashboardAPI.js" } } } diff --git a/test/basic/structure-module-load.basic.test.js b/test/basic/structure-module-load.basic.test.js index dde1c59..25759e1 100644 --- a/test/basic/structure-module-load.basic.test.js +++ b/test/basic/structure-module-load.basic.test.js @@ -3,6 +3,6 @@ const assert = require('node:assert/strict'); test('dashboardAPI module load smoke', () => { assert.doesNotThrow(() => { - require('../../dashboardapi.js'); + require('../../dashboardAPI.js'); }); });