kimu-core 0.5.0 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/kimu-copilot-instructions.md +14 -13
- package/kimu-core-0.6.0.tgz +0 -0
- package/package.json +1 -1
- package/src/core/kimu-module-manager.ts +11 -20
- package/src/modules-repository/api-axios/manifest.json +25 -0
- package/src/modules-repository/api-core/manifest.json +23 -0
- package/src/modules-repository/event-bus/manifest.json +22 -0
- package/src/modules-repository/notification/manifest.json +22 -0
- package/src/modules-repository/state/manifest.json +22 -0
- package/src/modules-repository/theme/manifest.json +22 -0
- package/kimu-core-0.5.0.tgz +0 -0
|
@@ -1571,11 +1571,10 @@ import RouterModule from './modules/router/module';
|
|
|
1571
1571
|
|
|
1572
1572
|
// Initialize router module
|
|
1573
1573
|
const moduleManager = KimuModuleManager.getInstance();
|
|
1574
|
-
|
|
1575
|
-
await moduleManager.loadModule(routerModule);
|
|
1574
|
+
await moduleManager.loadModule('router');
|
|
1576
1575
|
|
|
1577
1576
|
// Get router service
|
|
1578
|
-
const router = moduleManager.
|
|
1577
|
+
const router = moduleManager.getService('router');
|
|
1579
1578
|
|
|
1580
1579
|
// Define routes
|
|
1581
1580
|
router.addRoute('/', () => {
|
|
@@ -1604,7 +1603,8 @@ export class NavigationComponent extends KimuComponentElement {
|
|
|
1604
1603
|
|
|
1605
1604
|
async onInit() {
|
|
1606
1605
|
// Get router service from module manager
|
|
1607
|
-
|
|
1606
|
+
const moduleManager = KimuModuleManager.getInstance();
|
|
1607
|
+
this.router = moduleManager.getService('router');
|
|
1608
1608
|
}
|
|
1609
1609
|
|
|
1610
1610
|
navigateToHome() {
|
|
@@ -1710,7 +1710,8 @@ export class AppRouterComponent extends KimuComponentElement {
|
|
|
1710
1710
|
private router: KimuRouterService;
|
|
1711
1711
|
|
|
1712
1712
|
async onInit() {
|
|
1713
|
-
|
|
1713
|
+
const moduleManager = KimuModuleManager.getInstance();
|
|
1714
|
+
this.router = moduleManager.getService('router');
|
|
1714
1715
|
|
|
1715
1716
|
// Setup application routes
|
|
1716
1717
|
this.setupRoutes();
|
|
@@ -2511,10 +2512,9 @@ import { KimuModuleManager } from '@kimu/core';
|
|
|
2511
2512
|
import RouterModule from './modules/router/module';
|
|
2512
2513
|
|
|
2513
2514
|
const moduleManager = KimuModuleManager.getInstance();
|
|
2514
|
-
|
|
2515
|
-
await moduleManager.loadModule(routerModule);
|
|
2515
|
+
await moduleManager.loadModule('router');
|
|
2516
2516
|
|
|
2517
|
-
const router = moduleManager.
|
|
2517
|
+
const router = moduleManager.getService('router');
|
|
2518
2518
|
```
|
|
2519
2519
|
|
|
2520
2520
|
#### 2. Define Routes
|
|
@@ -2631,7 +2631,8 @@ export class NavigationComponent extends KimuComponentElement {
|
|
|
2631
2631
|
|
|
2632
2632
|
async onInit() {
|
|
2633
2633
|
// Get router service
|
|
2634
|
-
|
|
2634
|
+
const moduleManager = KimuModuleManager.getInstance();
|
|
2635
|
+
this.router = moduleManager.getService('router');
|
|
2635
2636
|
|
|
2636
2637
|
// Listen for route changes
|
|
2637
2638
|
this.router.onRouteChange(this.handleRouteChange.bind(this));
|
|
@@ -2771,14 +2772,13 @@ import { KimuModuleManager } from '@kimu/core';
|
|
|
2771
2772
|
import I18nModule from './modules/i18n/module';
|
|
2772
2773
|
|
|
2773
2774
|
const moduleManager = KimuModuleManager.getInstance();
|
|
2774
|
-
|
|
2775
|
+
await moduleManager.loadModule('i18n', {
|
|
2775
2776
|
defaultLanguage: 'en',
|
|
2776
2777
|
fallbackLanguage: 'en',
|
|
2777
2778
|
supportedLanguages: ['en', 'it', 'fr']
|
|
2778
2779
|
});
|
|
2779
|
-
await moduleManager.loadModule(i18nModule);
|
|
2780
2780
|
|
|
2781
|
-
const i18n = moduleManager.
|
|
2781
|
+
const i18n = moduleManager.getService('i18n');
|
|
2782
2782
|
```
|
|
2783
2783
|
|
|
2784
2784
|
#### 3. Use Translations in Components
|
|
@@ -2788,7 +2788,8 @@ export class MyComponent extends KimuComponentElement {
|
|
|
2788
2788
|
private i18n: any;
|
|
2789
2789
|
|
|
2790
2790
|
onInit() {
|
|
2791
|
-
|
|
2791
|
+
const moduleManager = KimuModuleManager.getInstance();
|
|
2792
|
+
this.i18n = moduleManager.getService('i18n');
|
|
2792
2793
|
}
|
|
2793
2794
|
|
|
2794
2795
|
getData() {
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -32,6 +32,17 @@ export class KimuModuleManager {
|
|
|
32
32
|
return instance;
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
+
/**
|
|
36
|
+
* Register an already instantiated module
|
|
37
|
+
* Useful for manually created module instances
|
|
38
|
+
*/
|
|
39
|
+
registerModule(name: string, instance: KimuModule): void {
|
|
40
|
+
if (this.modules.has(name)) {
|
|
41
|
+
console.warn(`[KimuModuleManager] Module '${name}' already registered, replacing...`);
|
|
42
|
+
}
|
|
43
|
+
this.modules.set(name, instance);
|
|
44
|
+
}
|
|
45
|
+
|
|
35
46
|
getModule(name: string): KimuModule | undefined {
|
|
36
47
|
return this.modules.get(name);
|
|
37
48
|
}
|
|
@@ -46,24 +57,4 @@ export class KimuModuleManager {
|
|
|
46
57
|
const mod = this.modules.get(name);
|
|
47
58
|
return mod ? mod.getService() : undefined;
|
|
48
59
|
}
|
|
49
|
-
|
|
50
|
-
// Convenience methods for commonly used modules
|
|
51
|
-
async getI18nService(options?: KimuModuleOptions): Promise<any> {
|
|
52
|
-
const module = await this.loadModule('i18n', options);
|
|
53
|
-
return module.getService();
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
async getRouterService(options?: KimuModuleOptions): Promise<any> {
|
|
57
|
-
const module = await this.loadModule('router', options);
|
|
58
|
-
return module.getService();
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
// Static convenience methods for global access
|
|
62
|
-
static async getI18nService(options?: KimuModuleOptions): Promise<any> {
|
|
63
|
-
return KimuModuleManager.getInstance().getI18nService(options);
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
static async getRouterService(options?: KimuModuleOptions): Promise<any> {
|
|
67
|
-
return KimuModuleManager.getInstance().getRouterService(options);
|
|
68
|
-
}
|
|
69
60
|
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "api-axios",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Axios-based API module for KIMU applications with advanced features including interceptors, cancellation and request/response transformations",
|
|
5
|
+
"author": "KIMU Team",
|
|
6
|
+
"license": "MPL-2.0",
|
|
7
|
+
"dependencies": [
|
|
8
|
+
"axios"
|
|
9
|
+
],
|
|
10
|
+
"kimuCoreVersion": "^0.3.0",
|
|
11
|
+
"keywords": [
|
|
12
|
+
"api",
|
|
13
|
+
"axios",
|
|
14
|
+
"http",
|
|
15
|
+
"rest",
|
|
16
|
+
"client",
|
|
17
|
+
"ajax",
|
|
18
|
+
"request"
|
|
19
|
+
],
|
|
20
|
+
"repository": {
|
|
21
|
+
"type": "git",
|
|
22
|
+
"url": "https://github.com/UnicoVerso/kimu-core",
|
|
23
|
+
"directory": "src/modules/api-axios"
|
|
24
|
+
}
|
|
25
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "api-core",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Core API module for KIMU applications providing HTTP client with interceptors, retry logic and comprehensive error handling",
|
|
5
|
+
"author": "KIMU Team",
|
|
6
|
+
"license": "MPL-2.0",
|
|
7
|
+
"dependencies": [],
|
|
8
|
+
"kimuCoreVersion": "^0.3.0",
|
|
9
|
+
"keywords": [
|
|
10
|
+
"api",
|
|
11
|
+
"http",
|
|
12
|
+
"rest",
|
|
13
|
+
"fetch",
|
|
14
|
+
"client",
|
|
15
|
+
"ajax",
|
|
16
|
+
"request"
|
|
17
|
+
],
|
|
18
|
+
"repository": {
|
|
19
|
+
"type": "git",
|
|
20
|
+
"url": "https://github.com/UnicoVerso/kimu-core",
|
|
21
|
+
"directory": "src/modules/api-core"
|
|
22
|
+
}
|
|
23
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "event-bus",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Event bus module for KIMU applications enabling decoupled component communication through publish-subscribe pattern",
|
|
5
|
+
"author": "KIMU Team",
|
|
6
|
+
"license": "MPL-2.0",
|
|
7
|
+
"dependencies": [],
|
|
8
|
+
"kimuCoreVersion": "^0.3.0",
|
|
9
|
+
"keywords": [
|
|
10
|
+
"event-bus",
|
|
11
|
+
"events",
|
|
12
|
+
"pub-sub",
|
|
13
|
+
"messaging",
|
|
14
|
+
"communication",
|
|
15
|
+
"decoupling"
|
|
16
|
+
],
|
|
17
|
+
"repository": {
|
|
18
|
+
"type": "git",
|
|
19
|
+
"url": "https://github.com/UnicoVerso/kimu-core",
|
|
20
|
+
"directory": "src/modules/event-bus"
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "notification",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Notification module for KIMU applications with support for toast messages, alerts and customizable notification types",
|
|
5
|
+
"author": "KIMU Team",
|
|
6
|
+
"license": "MPL-2.0",
|
|
7
|
+
"dependencies": [],
|
|
8
|
+
"kimuCoreVersion": "^0.3.0",
|
|
9
|
+
"keywords": [
|
|
10
|
+
"notification",
|
|
11
|
+
"toast",
|
|
12
|
+
"alert",
|
|
13
|
+
"messages",
|
|
14
|
+
"user-feedback",
|
|
15
|
+
"ui"
|
|
16
|
+
],
|
|
17
|
+
"repository": {
|
|
18
|
+
"type": "git",
|
|
19
|
+
"url": "https://github.com/UnicoVerso/kimu-core",
|
|
20
|
+
"directory": "src/modules/notification"
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "state",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "State management module for KIMU applications providing centralized reactive state with subscription support",
|
|
5
|
+
"author": "KIMU Team",
|
|
6
|
+
"license": "MPL-2.0",
|
|
7
|
+
"dependencies": [],
|
|
8
|
+
"kimuCoreVersion": "^0.3.0",
|
|
9
|
+
"keywords": [
|
|
10
|
+
"state",
|
|
11
|
+
"state-management",
|
|
12
|
+
"reactive",
|
|
13
|
+
"store",
|
|
14
|
+
"data-flow",
|
|
15
|
+
"centralized-state"
|
|
16
|
+
],
|
|
17
|
+
"repository": {
|
|
18
|
+
"type": "git",
|
|
19
|
+
"url": "https://github.com/UnicoVerso/kimu-core",
|
|
20
|
+
"directory": "src/modules/state"
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "theme",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Theme management module for KIMU applications with dark/light mode support and customizable theme configurations",
|
|
5
|
+
"author": "KIMU Team",
|
|
6
|
+
"license": "MPL-2.0",
|
|
7
|
+
"dependencies": [],
|
|
8
|
+
"kimuCoreVersion": "^0.3.0",
|
|
9
|
+
"keywords": [
|
|
10
|
+
"theme",
|
|
11
|
+
"dark-mode",
|
|
12
|
+
"light-mode",
|
|
13
|
+
"styling",
|
|
14
|
+
"customization",
|
|
15
|
+
"ui"
|
|
16
|
+
],
|
|
17
|
+
"repository": {
|
|
18
|
+
"type": "git",
|
|
19
|
+
"url": "https://github.com/UnicoVerso/kimu-core",
|
|
20
|
+
"directory": "src/modules/theme"
|
|
21
|
+
}
|
|
22
|
+
}
|
package/kimu-core-0.5.0.tgz
DELETED
|
Binary file
|