@hamak/ui-store-impl 0.4.16 → 0.4.19
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/dist/core/store-manager.d.ts +3 -0
- package/dist/core/store-manager.d.ts.map +1 -1
- package/dist/core/store-manager.js +7 -0
- package/dist/es2015/core/store-manager.js +7 -0
- package/dist/es2015/plugin/store-plugin-factory.js +14 -1
- package/dist/plugin/store-plugin-factory.d.ts +1 -0
- package/dist/plugin/store-plugin-factory.d.ts.map +1 -1
- package/dist/plugin/store-plugin-factory.js +14 -1
- package/package.json +1 -1
|
@@ -11,9 +11,12 @@ export declare class StoreManager implements IStoreManager {
|
|
|
11
11
|
private reducerRegistry;
|
|
12
12
|
private initialized;
|
|
13
13
|
private config;
|
|
14
|
+
private fileSystemAdapter;
|
|
14
15
|
constructor();
|
|
15
16
|
getMiddlewareRegistry(): MiddlewareRegistry;
|
|
16
17
|
getReducerRegistry(): ReducerRegistry;
|
|
18
|
+
setFileSystemAdapter(adapter: any): void;
|
|
19
|
+
getFileSystemAdapter(): any;
|
|
17
20
|
isInitialized(): boolean;
|
|
18
21
|
initialize(config?: StoreConfig): Store<RootState, AppAction>;
|
|
19
22
|
getStore(): Store<RootState, AppAction>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"store-manager.d.ts","sourceRoot":"","sources":["../../src/core/store-manager.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAyC,KAAK,KAAK,EAAE,KAAK,OAAO,EAAE,MAAM,OAAO,CAAC;AACxF,OAAO,KAAK,EAAE,aAAa,EAAE,WAAW,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAC5F,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAErD,qBAAa,YAAa,YAAW,aAAa;IAChD,OAAO,CAAC,KAAK,CAA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AC,GAAG,IAAI;IAIhE,OAAO,IAAI,IAAI;CAKhB"}
|
|
@@ -9,6 +9,7 @@ export class StoreManager {
|
|
|
9
9
|
this.store = null;
|
|
10
10
|
this.initialized = false;
|
|
11
11
|
this.config = null;
|
|
12
|
+
this.fileSystemAdapter = null;
|
|
12
13
|
this.middlewareRegistry = new MiddlewareRegistry();
|
|
13
14
|
this.reducerRegistry = new ReducerRegistry((rootReducer) => {
|
|
14
15
|
// Hot replacement callback
|
|
@@ -23,6 +24,12 @@ export class StoreManager {
|
|
|
23
24
|
getReducerRegistry() {
|
|
24
25
|
return this.reducerRegistry;
|
|
25
26
|
}
|
|
27
|
+
setFileSystemAdapter(adapter) {
|
|
28
|
+
this.fileSystemAdapter = adapter;
|
|
29
|
+
}
|
|
30
|
+
getFileSystemAdapter() {
|
|
31
|
+
return this.fileSystemAdapter;
|
|
32
|
+
}
|
|
26
33
|
isInitialized() {
|
|
27
34
|
return this.initialized;
|
|
28
35
|
}
|
|
@@ -9,6 +9,7 @@ export class StoreManager {
|
|
|
9
9
|
this.store = null;
|
|
10
10
|
this.initialized = false;
|
|
11
11
|
this.config = null;
|
|
12
|
+
this.fileSystemAdapter = null;
|
|
12
13
|
this.middlewareRegistry = new MiddlewareRegistry();
|
|
13
14
|
this.reducerRegistry = new ReducerRegistry((rootReducer) => {
|
|
14
15
|
// Hot replacement callback
|
|
@@ -23,6 +24,12 @@ export class StoreManager {
|
|
|
23
24
|
getReducerRegistry() {
|
|
24
25
|
return this.reducerRegistry;
|
|
25
26
|
}
|
|
27
|
+
setFileSystemAdapter(adapter) {
|
|
28
|
+
this.fileSystemAdapter = adapter;
|
|
29
|
+
}
|
|
30
|
+
getFileSystemAdapter() {
|
|
31
|
+
return this.fileSystemAdapter;
|
|
32
|
+
}
|
|
26
33
|
isInitialized() {
|
|
27
34
|
return this.initialized;
|
|
28
35
|
}
|
|
@@ -15,11 +15,16 @@ import { STORE_MANAGER_TOKEN, MIDDLEWARE_REGISTRY_TOKEN, REDUCER_REGISTRY_TOKEN,
|
|
|
15
15
|
import { StoreManager } from '../core/store-manager';
|
|
16
16
|
import { createEventBridgeMiddleware, createLoggerMiddleware, } from '../middleware';
|
|
17
17
|
import { applyStoreExtensions, createStoreExtensionsCollector, } from '../extensions/store-extensions';
|
|
18
|
+
import { createFileSystemAdapter } from '../fs/core/fs-adapter';
|
|
19
|
+
// DI token for filesystem adapter
|
|
20
|
+
export const FILESYSTEM_ADAPTER_TOKEN = 'FILESYSTEM_ADAPTER';
|
|
18
21
|
export function createStorePlugin(config = {}) {
|
|
19
22
|
const storeManager = new StoreManager();
|
|
20
23
|
const middlewareRegistry = storeManager.getMiddlewareRegistry();
|
|
21
24
|
const reducerRegistry = storeManager.getReducerRegistry();
|
|
22
25
|
const extensionsCollector = createStoreExtensionsCollector();
|
|
26
|
+
// Create filesystem adapter with 'fs' slice name
|
|
27
|
+
const fileSystemAdapter = createFileSystemAdapter('fs');
|
|
23
28
|
const registerDefaultMiddleware = (hooks) => {
|
|
24
29
|
extensionsCollector.register('ui-store:event-bridge', {
|
|
25
30
|
middleware: [
|
|
@@ -67,6 +72,10 @@ export function createStorePlugin(config = {}) {
|
|
|
67
72
|
return {
|
|
68
73
|
initialize(ctx) {
|
|
69
74
|
return __awaiter(this, void 0, void 0, function* () {
|
|
75
|
+
// Set filesystem adapter on store manager
|
|
76
|
+
storeManager.setFileSystemAdapter(fileSystemAdapter);
|
|
77
|
+
// Register filesystem reducer
|
|
78
|
+
reducerRegistry.register('fs', fileSystemAdapter.getReducer());
|
|
70
79
|
// Register services via DI
|
|
71
80
|
ctx.provide({ provide: STORE_MANAGER_TOKEN, useValue: storeManager });
|
|
72
81
|
ctx.provide({
|
|
@@ -81,9 +90,13 @@ export function createStorePlugin(config = {}) {
|
|
|
81
90
|
provide: STORE_EXTENSIONS_TOKEN,
|
|
82
91
|
useValue: extensionsCollector,
|
|
83
92
|
});
|
|
93
|
+
ctx.provide({
|
|
94
|
+
provide: FILESYSTEM_ADAPTER_TOKEN,
|
|
95
|
+
useValue: fileSystemAdapter,
|
|
96
|
+
});
|
|
84
97
|
registerDefaultMiddleware(ctx.hooks);
|
|
85
98
|
registerConfigExtensions();
|
|
86
|
-
console.log('[ui-store] Plugin initialized');
|
|
99
|
+
console.log('[ui-store] Plugin initialized with filesystem support');
|
|
87
100
|
});
|
|
88
101
|
},
|
|
89
102
|
activate(ctx) {
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import type { PluginModule } from '@hamak/microkernel-spi';
|
|
6
6
|
import { type StorePluginExtensions } from '@hamak/ui-store-api';
|
|
7
|
+
export declare const FILESYSTEM_ADAPTER_TOKEN = "FILESYSTEM_ADAPTER";
|
|
7
8
|
export interface StorePluginConfig extends StorePluginExtensions {
|
|
8
9
|
/** Enable Redux DevTools integration */
|
|
9
10
|
devTools?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"store-plugin-factory.d.ts","sourceRoot":"","sources":["../../src/plugin/store-plugin-factory.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAML,KAAK,qBAAqB,EAC3B,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"store-plugin-factory.d.ts","sourceRoot":"","sources":["../../src/plugin/store-plugin-factory.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAML,KAAK,qBAAqB,EAC3B,MAAM,qBAAqB,CAAC;AAa7B,eAAO,MAAM,wBAAwB,uBAAuB,CAAC;AAE7D,MAAM,WAAW,iBAAkB,SAAQ,qBAAqB;IAC9D,wCAAwC;IACxC,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB,8CAA8C;IAC9C,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED,wBAAgB,iBAAiB,CAC/B,MAAM,GAAE,iBAAsB,GAC7B,YAAY,CAwHd"}
|
|
@@ -6,11 +6,16 @@ import { STORE_MANAGER_TOKEN, MIDDLEWARE_REGISTRY_TOKEN, REDUCER_REGISTRY_TOKEN,
|
|
|
6
6
|
import { StoreManager } from '../core/store-manager';
|
|
7
7
|
import { createEventBridgeMiddleware, createLoggerMiddleware, } from '../middleware';
|
|
8
8
|
import { applyStoreExtensions, createStoreExtensionsCollector, } from '../extensions/store-extensions';
|
|
9
|
+
import { createFileSystemAdapter } from '../fs/core/fs-adapter';
|
|
10
|
+
// DI token for filesystem adapter
|
|
11
|
+
export const FILESYSTEM_ADAPTER_TOKEN = 'FILESYSTEM_ADAPTER';
|
|
9
12
|
export function createStorePlugin(config = {}) {
|
|
10
13
|
const storeManager = new StoreManager();
|
|
11
14
|
const middlewareRegistry = storeManager.getMiddlewareRegistry();
|
|
12
15
|
const reducerRegistry = storeManager.getReducerRegistry();
|
|
13
16
|
const extensionsCollector = createStoreExtensionsCollector();
|
|
17
|
+
// Create filesystem adapter with 'fs' slice name
|
|
18
|
+
const fileSystemAdapter = createFileSystemAdapter('fs');
|
|
14
19
|
const registerDefaultMiddleware = (hooks) => {
|
|
15
20
|
extensionsCollector.register('ui-store:event-bridge', {
|
|
16
21
|
middleware: [
|
|
@@ -56,6 +61,10 @@ export function createStorePlugin(config = {}) {
|
|
|
56
61
|
};
|
|
57
62
|
return {
|
|
58
63
|
async initialize(ctx) {
|
|
64
|
+
// Set filesystem adapter on store manager
|
|
65
|
+
storeManager.setFileSystemAdapter(fileSystemAdapter);
|
|
66
|
+
// Register filesystem reducer
|
|
67
|
+
reducerRegistry.register('fs', fileSystemAdapter.getReducer());
|
|
59
68
|
// Register services via DI
|
|
60
69
|
ctx.provide({ provide: STORE_MANAGER_TOKEN, useValue: storeManager });
|
|
61
70
|
ctx.provide({
|
|
@@ -70,9 +79,13 @@ export function createStorePlugin(config = {}) {
|
|
|
70
79
|
provide: STORE_EXTENSIONS_TOKEN,
|
|
71
80
|
useValue: extensionsCollector,
|
|
72
81
|
});
|
|
82
|
+
ctx.provide({
|
|
83
|
+
provide: FILESYSTEM_ADAPTER_TOKEN,
|
|
84
|
+
useValue: fileSystemAdapter,
|
|
85
|
+
});
|
|
73
86
|
registerDefaultMiddleware(ctx.hooks);
|
|
74
87
|
registerConfigExtensions();
|
|
75
|
-
console.log('[ui-store] Plugin initialized');
|
|
88
|
+
console.log('[ui-store] Plugin initialized with filesystem support');
|
|
76
89
|
},
|
|
77
90
|
async activate(ctx) {
|
|
78
91
|
applyStoreExtensions(extensionsCollector, middlewareRegistry, reducerRegistry);
|