FlowFuse / device-agent

An agent to run FlowFuse managed instances of Node-RED on devices
Apache License 2.0
15 stars 8 forks source link

nr-theme package in the launcher.js still points to the old @flowforge scope #224

Closed novuscy closed 7 months ago

novuscy commented 7 months ago

Current Behavior

These messages show up when register a brand new device

[AGENT] Fri Jan 26 2024 09:22:01 GMT+0800 (CST) [info] Updating theme files
[AGENT] Fri Jan 26 2024 09:22:01 GMT+0800 (CST) [info] Could not write theme files. Theme not found: '/usr/lib/node_modules/@flowfuse/nr-theme'
[AGENT] Fri Jan 26 2024 09:22:01 GMT+0800 (CST) [info] Starting Node-RED

and the device editor theme is the default node-red theme, not the FlowFuse one.

Expected Behavior

No error message. Use the FlowFuse theme

Steps To Reproduce

Register a new device in the platform. Enable develop mode Open device editor

Environment

novuscy commented 7 months ago

It seems that the writeThemeFiles() function in the launcher.js file is still searching for the old @flowforge scope:


    async writeThemeFiles () {
        info('Updating theme files')
        const sourceDir1 = path.join(__dirname, '..', 'node_modules', '@flowforge', 'nr-theme')
        const sourceDir2 = path.join(__dirname, '..', '..', 'nr-theme')
        const sourceDir = existsSync(sourceDir1) ? sourceDir1 : sourceDir2
        const targetDir = path.join(this.projectDir, 'node_modules', '@flowforge', 'nr-theme')
        ...
   }
knolleary commented 7 months ago

Thanks for highlighting - we'll get that fixed.

hardillb commented 6 months ago

Verified with Device agent v2.1.0