Manifestbasierter Production-Updater 3.3, Modulnavigation, optionales Produktbild Studio, Listing-Studio-Aktionsleiste sowie plattformübergreifende Windows-/Linux-Release-Gates.
26 lines
2.6 KiB
JavaScript
26 lines
2.6 KiB
JavaScript
import { readFileSync, existsSync } from 'node:fs';
|
|
import { resolve } from 'node:path';
|
|
const root = resolve(import.meta.dirname, '..');
|
|
const must = (condition, message) => { if (!condition) throw new Error(message); };
|
|
const read = path => readFileSync(resolve(root, path), 'utf8');
|
|
const html = read('public/index.html');
|
|
const app = read('public/app.js');
|
|
const server = read('server.mjs');
|
|
const catalog = read('app/modules/catalog.mjs');
|
|
const moduleJson = JSON.parse(read('app/modules/product-image-tools/module.json'));
|
|
must(existsSync(resolve(root, 'app/modules/product-image-tools/index.mjs')), 'Produktbild-Modulindex fehlt.');
|
|
must(moduleJson.id === 'vendoo.product-image-tools' && moduleJson.status === 'native' && moduleJson.defaultEnabled === false, 'Produktbild Studio muss nativ, optional und initial deaktiviert sein.');
|
|
must(catalog.includes('createProductImageToolsModule()'), 'Produktbild Studio ist nicht im Built-in-Katalog registriert.');
|
|
must(server.includes("path: '/api/modules/navigation'"), 'Öffentlicher authentifizierter Modulstatus-Endpunkt fehlt.');
|
|
must(server.includes("return 'vendoo.product-image-tools'"), 'AI-Model-Routen sind nicht dem Produktbild-Modul zugeordnet.');
|
|
for (const id of ['vendoo.ai','vendoo.quality','vendoo.publishing','vendoo.flux-studio','vendoo.listings','vendoo.inventory','vendoo.media','vendoo.module-manager','vendoo.settings','vendoo.users']) must(html.includes(`data-module="${id}"`), `Navigationsbindung fehlt: ${id}`);
|
|
must(html.includes('class="generator-commandbar"') && html.includes('id="generate-btn"') && html.includes('id="save-btn"'), 'Dauerhaft sichtbare Generator-Aktionsleiste fehlt.');
|
|
must((html.match(/id="generate-btn"/g) || []).length === 1, 'generate-btn muss eindeutig sein.');
|
|
must((html.match(/id="save-btn"/g) || []).length === 1, 'save-btn muss eindeutig sein.');
|
|
must(html.includes('data-module-panel="vendoo.product-image-tools"'), 'Produktbild Studio ist nicht als Modul-Panel markiert.');
|
|
must(!html.includes('<h4>Produktbild-Werkzeuge</h4>'), 'Alte Produktbild-Werkzeuge-Bezeichnung ist noch vorhanden.');
|
|
must(app.includes('applyModuleNavigation') && app.includes("vendoo:modules-changed"), 'Frontend reagiert nicht auf Modulstatusänderungen.');
|
|
must(app.indexOf("api('GET', '/api/modules/navigation')") < app.indexOf("aiEnabled ? api('GET', '/api/providers')"), 'Modulstatus muss vor modulgeschützten APIs geladen werden.');
|
|
must(app.includes("saveButton.disabled = false") && app.includes("saveButton.disabled = true"), 'Speichern-Status ist nicht an den Generatorzustand gebunden.');
|
|
console.log('OK: Modulnavigation, optionales Produktbild Studio und Listing-Studio-Aktionsleiste 1.43.0 verifiziert.');
|