Refactor app to modular ES6 components

Migrates the main application logic from a monolithic script to a modular, component-based architecture using ES6 modules. Adds ThemeManager, ServicesManager, ServiceConfigGenerator, and OutputManager components for improved maintainability and scalability. Updates index.html to use the new entry point and enhances accessibility and UI structure. Removes legacy main.js.
This commit is contained in:
xixu-me committed 2025-07-14 12:39:21 +08:00
1 parent 68e8dd407b
commit 7f84415aaa
11 files changed
+1993 -486

No files matched your search

+36
View File
@@ -0,0 +1,36 @@
/**
* Module Validation Script
*
* Simple script to validate that all ES6 modules can be imported correctly
* and that the basic structure is working as expected.
*/
// Validate that all components can be imported
try {
import("./src/scripts/components/ThemeManager.js")
.then((module) => {
console.log("✓ ThemeManager module loaded successfully");
return import("./src/scripts/components/ServicesManager.js");
})
.then((module) => {
console.log("✓ ServicesManager module loaded successfully");
return import("./src/scripts/components/ServiceConfigGenerator.js");
})
.then((module) => {
console.log("✓ ServiceConfigGenerator module loaded successfully");
return import("./src/scripts/components/OutputManager.js");
})
.then((module) => {
console.log("✓ OutputManager module loaded successfully");
return import("./src/scripts/app.js");
})
.then((module) => {
console.log("✓ Main app module loaded successfully");
console.log("🎉 All modules loaded successfully! Architecture is valid.");
})
.catch((error) => {
console.error("❌ Module loading failed:", error);
});
} catch (error) {
console.error("❌ Dynamic import not supported:", error);
}