diff --git a/README.md b/README.md index 78c735a..c8f54bc 100644 --- a/README.md +++ b/README.md @@ -35,6 +35,11 @@ Instantiate the server with Node-RED ### **WORK IN PROGRESS** --> ## Changelog +### **WORK IN PROGRESS** + +- (klein0r) Allow custom themes +- (klein0r) Fixed scoped node-red packages + ### 5.0.2 (2023-12-14) - (TheRealArthurDent) Fixed a fatal error when getting a non-existent value diff --git a/admin/i18n/de/translations.json b/admin/i18n/de/translations.json index 45cf6dc..fe89ec7 100644 --- a/admin/i18n/de/translations.json +++ b/admin/i18n/de/translations.json @@ -33,5 +33,7 @@ "Appearance": "Darstellung", "Editor type": "Editor-Typ", "Environment": "Umgebung", - "Environment variables": "Umgebungsvariablen" + "Environment variables": "Umgebungsvariablen", + "Theme": "Thema", + "Apply a custom theme (if installed)": "Anwenden eines benutzerdefinierten Designs (falls installiert)" } diff --git a/admin/i18n/en/translations.json b/admin/i18n/en/translations.json index 14cba2f..f3a3758 100644 --- a/admin/i18n/en/translations.json +++ b/admin/i18n/en/translations.json @@ -33,5 +33,7 @@ "Appearance": "Appearance", "Editor type": "Editor type", "Environment": "Environment", - "Environment variables": "Environment variables" + "Environment variables": "Environment variables", + "Theme": "Theme", + "Apply a custom theme (if installed)": "Apply a custom theme (if installed)" } diff --git a/admin/i18n/es/translations.json b/admin/i18n/es/translations.json index 1c606dd..2f8997e 100644 --- a/admin/i18n/es/translations.json +++ b/admin/i18n/es/translations.json @@ -33,5 +33,7 @@ "Appearance": "Apariencia", "Editor type": "Tipo de editor", "Environment": "Ambiente", - "Environment variables": "Variables de entorno" + "Environment variables": "Variables de entorno", + "Theme": "Tema", + "Apply a custom theme (if installed)": "Aplicar un tema personalizado (si está instalado)" } diff --git a/admin/i18n/fr/translations.json b/admin/i18n/fr/translations.json index 8805039..1146a13 100644 --- a/admin/i18n/fr/translations.json +++ b/admin/i18n/fr/translations.json @@ -33,5 +33,7 @@ "Appearance": "Apparence", "Editor type": "Type d'éditeur", "Environment": "Environnement", - "Environment variables": "Variables d'environnement" + "Environment variables": "Variables d'environnement", + "Theme": "Thème", + "Apply a custom theme (if installed)": "Appliquer un thème personnalisé (si installé)" } diff --git a/admin/i18n/it/translations.json b/admin/i18n/it/translations.json index 719094e..f891c26 100644 --- a/admin/i18n/it/translations.json +++ b/admin/i18n/it/translations.json @@ -33,5 +33,7 @@ "Appearance": "Aspetto", "Editor type": "Tipo di editore", "Environment": "Ambiente", - "Environment variables": "Variabili ambientali" + "Environment variables": "Variabili ambientali", + "Theme": "Tema", + "Apply a custom theme (if installed)": "Applicare un tema personalizzato (se installato)" } diff --git a/admin/i18n/nl/translations.json b/admin/i18n/nl/translations.json index f93b5f6..604d14b 100644 --- a/admin/i18n/nl/translations.json +++ b/admin/i18n/nl/translations.json @@ -33,5 +33,7 @@ "Appearance": "Verschijning", "Editor type": "Editor-type", "Environment": "Omgeving", - "Environment variables": "Omgevingsvariabelen" + "Environment variables": "Omgevingsvariabelen", + "Theme": "Thema", + "Apply a custom theme (if installed)": "Een aangepast thema toepassen (indien geïnstalleerd)" } diff --git a/admin/i18n/pl/translations.json b/admin/i18n/pl/translations.json index 193abb7..0601e3f 100644 --- a/admin/i18n/pl/translations.json +++ b/admin/i18n/pl/translations.json @@ -33,5 +33,7 @@ "Appearance": "Wygląd", "Editor type": "Typ edytora", "Environment": "Środowisko", - "Environment variables": "Zmienne środowiska" + "Environment variables": "Zmienne środowiska", + "Theme": "Temat", + "Apply a custom theme (if installed)": "Zastosuj niestandardowy motyw (jeśli jest zainstalowany)" } diff --git a/admin/i18n/pt/translations.json b/admin/i18n/pt/translations.json index eb6f3a7..4536464 100644 --- a/admin/i18n/pt/translations.json +++ b/admin/i18n/pt/translations.json @@ -33,5 +33,7 @@ "Appearance": "Aparência", "Editor type": "Tipo de editor", "Environment": "Ambiente", - "Environment variables": "Variáveis ​​ambientais" + "Environment variables": "Variáveis ​​ambientais", + "Theme": "Tema", + "Apply a custom theme (if installed)": "Aplicar um tema personalizado (se instalado)" } diff --git a/admin/i18n/ru/translations.json b/admin/i18n/ru/translations.json index ebdc2b6..73b7b17 100644 --- a/admin/i18n/ru/translations.json +++ b/admin/i18n/ru/translations.json @@ -33,5 +33,7 @@ "Appearance": "Появление", "Editor type": "Тип редактора", "Environment": "Среда", - "Environment variables": "Переменные среды" + "Environment variables": "Переменные среды", + "Theme": "Тема", + "Apply a custom theme (if installed)": "Применить собственную тему (если она установлена)" } diff --git a/admin/i18n/uk/translations.json b/admin/i18n/uk/translations.json index 5ffd723..8f99b2e 100644 --- a/admin/i18n/uk/translations.json +++ b/admin/i18n/uk/translations.json @@ -33,5 +33,7 @@ "Appearance": "Зовнішній вигляд", "Editor type": "Тип редактора", "Environment": "Навколишнє середовище", - "Environment variables": "Змінні середовища" + "Environment variables": "Змінні середовища", + "Theme": "Тема", + "Apply a custom theme (if installed)": "Застосувати спеціальну тему (якщо встановлено)" } diff --git a/admin/i18n/zh-cn/translations.json b/admin/i18n/zh-cn/translations.json index 04249ba..577047e 100644 --- a/admin/i18n/zh-cn/translations.json +++ b/admin/i18n/zh-cn/translations.json @@ -33,5 +33,7 @@ "Appearance": "外貌", "Editor type": "编辑器类型", "Environment": "环境", - "Environment variables": "环境变量" + "Environment variables": "环境变量", + "Theme": "主题", + "Apply a custom theme (if installed)": "应用自定义主题(如果已安装)" } diff --git a/admin/jsonConfig.json b/admin/jsonConfig.json index a78e93c..e9ffd1f 100644 --- a/admin/jsonConfig.json +++ b/admin/jsonConfig.json @@ -401,6 +401,16 @@ "md": 4, "lg": 4, "label": "Editor type" + }, + "theme": { + "newLine": true, + "type": "text", + "sm": 12, + "md": 4, + "lg": 4, + "label": "Theme", + "help": "Apply a custom theme (if installed)", + "helpLink": "https://github.com/node-red-contrib-themes/theme-collection" } } }, diff --git a/io-package.json b/io-package.json index b343795..ab018ea 100644 --- a/io-package.json +++ b/io-package.json @@ -334,6 +334,7 @@ "defaultPermissions": "", "authExt": [], "editor": "monaco", + "theme": "", "envVars": [] }, "objects": [], diff --git a/main.js b/main.js index 710e6bd..068021e 100644 --- a/main.js +++ b/main.js @@ -245,7 +245,7 @@ class NodeRed extends utils.Adapter { const envVars = { ...process.env, - ...this.config.envVars.reduce((acc, v) => ({...acc, [v.name]: v.value || null}), {}) + ...this.config.envVars.reduce((acc, v) => ({ ...acc, [v.name]: v.value || null }), {}) }; this.redProcess = spawn('node', args, { env: envVars }); @@ -272,6 +272,8 @@ class NodeRed extends utils.Adapter { } else if (data.includes('[warn]')) { this.log.warn(`Node-RED: ${data}`); } else if (data.includes('[info] [debug:')) { + this.log.debug(`Node-RED: ${data}`); + } else if (data.includes('[info]')) { this.log.info(`Node-RED: ${data}`); } else { this.log.debug(`Node-RED: ${data}`); @@ -448,7 +450,7 @@ class NodeRed extends utils.Adapter { const hStatic = this.config.httpStatic ? '' : '// '; const npms = this.additional - .filter(pack => !pack.startsWith('node-red-')) + .filter(pack => !pack.startsWith('node-red-') && !pack.startsWith('@node-red-')) .map(pack => ` "${pack}": require('${dir}${pack}')`) .join(',\n'); @@ -500,6 +502,7 @@ class NodeRed extends utils.Adapter { lines[i] = this.setOption(lines[i], 'palletmanagerEnabled', this.config.palletmanagerEnabled); lines[i] = this.setOption(lines[i], 'allowCreationOfForeignObjects', this.config.allowCreationOfForeignObjects); lines[i] = this.setOption(lines[i], 'editor'); + lines[i] = this.setOption(lines[i], 'theme'); } const settingsPath = path.join(this.userDataDir, 'settings.js'); diff --git a/package-lock.json b/package-lock.json index f2cf9a7..c86f622 100644 --- a/package-lock.json +++ b/package-lock.json @@ -29,13 +29,13 @@ "@types/chai": "^4.3.11", "@types/chai-as-promised": "^7.1.8", "@types/mocha": "^10.0.6", - "@types/node": "^20.10.4", + "@types/node": "^20.10.5", "@types/proxyquire": "^1.3.31", "@types/sinon": "^17.0.2", "@types/sinon-chai": "^3.2.12", "chai": "^4.3.10", "chai-as-promised": "^7.1.1", - "eslint": "^8.55.0", + "eslint": "^8.56.0", "mocha": "^10.2.0", "proxyquire": "^2.1.3", "sinon": "^17.0.1", @@ -398,9 +398,9 @@ } }, "node_modules/@eslint/js": { - "version": "8.55.0", - "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.55.0.tgz", - "integrity": "sha512-qQfo2mxH5yVom1kacMtZZJFVdW+E70mqHMJvVg6WTLo+VBuQJ4TojZlfWBjK0ve5BdEeNAVxOsl/nvNMpJOaJA==", + "version": "8.56.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.56.0.tgz", + "integrity": "sha512-gMsVel9D7f2HLkBma9VbtzZRehRogVRfbr++f06nL2vnCGCNlzOD+/MUov/F4p8myyAHspEhVobgjpX64q5m6A==", "dev": true, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" @@ -1288,9 +1288,9 @@ "dev": true }, "node_modules/@types/node": { - "version": "20.10.4", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.10.4.tgz", - "integrity": "sha512-D08YG6rr8X90YB56tSIuBaddy/UXAA9RKJoFvrsnogAum/0pmjkgi4+2nx96A330FmioegBWmEYQ+syqCFaveg==", + "version": "20.10.5", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.10.5.tgz", + "integrity": "sha512-nNPsNE65wjMxEKI93yOP+NPGGBJz/PoN3kZsVLee0XMiJolxSekEVD8wRwBUBqkwc7UWop0edW50yrCQW4CyRw==", "dependencies": { "undici-types": "~5.26.4" } @@ -3260,15 +3260,15 @@ } }, "node_modules/eslint": { - "version": "8.55.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.55.0.tgz", - "integrity": "sha512-iyUUAM0PCKj5QpwGfmCAG9XXbZCWsqP/eWAWrG/W0umvjuLRBECwSFdt+rCntju0xEH7teIABPwXpahftIaTdA==", + "version": "8.56.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.56.0.tgz", + "integrity": "sha512-Go19xM6T9puCOWntie1/P997aXxFsOi37JIHRWI514Hc6ZnaHGKY9xFhrU65RT6CcBEzZoGG1e6Nq+DT04ZtZQ==", "dev": true, "dependencies": { "@eslint-community/eslint-utils": "^4.2.0", "@eslint-community/regexpp": "^4.6.1", "@eslint/eslintrc": "^2.1.4", - "@eslint/js": "8.55.0", + "@eslint/js": "8.56.0", "@humanwhocodes/config-array": "^0.11.13", "@humanwhocodes/module-importer": "^1.0.1", "@nodelib/fs.walk": "^1.2.8", diff --git a/package.json b/package.json index 97afdc6..f06688b 100644 --- a/package.json +++ b/package.json @@ -58,13 +58,13 @@ "@types/chai": "^4.3.11", "@types/chai-as-promised": "^7.1.8", "@types/mocha": "^10.0.6", - "@types/node": "^20.10.4", + "@types/node": "^20.10.5", "@types/proxyquire": "^1.3.31", "@types/sinon": "^17.0.2", "@types/sinon-chai": "^3.2.12", "chai": "^4.3.10", "chai-as-promised": "^7.1.1", - "eslint": "^8.55.0", + "eslint": "^8.56.0", "mocha": "^10.2.0", "proxyquire": "^2.1.3", "sinon": "^17.0.1", diff --git a/settings.js b/settings.js index 791bc6a..606fa4d 100644 --- a/settings.js +++ b/settings.js @@ -345,7 +345,7 @@ module.exports = { * See https://github.com/node-red-contrib-themes/theme-collection for * a collection of themes to chose from. */ - //theme: "", + theme: "'%%theme%%'", palette: { /** The following property can be used to order the categories in the editor * palette. If a node's category is not in the list, the category will get