@hamak/ui-store-impl 0.4.7 → 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.
Files changed (38) hide show
  1. package/dist/core/store-manager.d.ts +3 -0
  2. package/dist/core/store-manager.d.ts.map +1 -1
  3. package/dist/core/store-manager.js +7 -0
  4. package/dist/es2015/core/store-manager.js +7 -0
  5. package/dist/es2015/plugin/store-plugin-factory.js +14 -1
  6. package/dist/plugin/store-plugin-factory.d.ts +1 -0
  7. package/dist/plugin/store-plugin-factory.d.ts.map +1 -1
  8. package/dist/plugin/store-plugin-factory.js +14 -1
  9. package/package.json +9 -6
  10. package/.turbo/turbo-build.log +0 -1
  11. package/.turbo/turbo-test.log +0 -115
  12. package/CHANGELOG.md +0 -41
  13. package/project.json +0 -24
  14. package/src/core/index.ts +0 -3
  15. package/src/core/middleware-registry.test.ts +0 -247
  16. package/src/core/middleware-registry.ts +0 -64
  17. package/src/core/reducer-registry.test.ts +0 -215
  18. package/src/core/reducer-registry.ts +0 -71
  19. package/src/core/store-manager.test.ts +0 -288
  20. package/src/core/store-manager.ts +0 -125
  21. package/src/extensions/store-extensions.ts +0 -90
  22. package/src/fs/commands/fs-commands.ts +0 -389
  23. package/src/fs/commands/structure-commands.ts +0 -105
  24. package/src/fs/core/fs-adapter.ts +0 -180
  25. package/src/fs/core/fs-facade.ts +0 -100
  26. package/src/fs/index.ts +0 -14
  27. package/src/fs/utils/data-updater.ts +0 -273
  28. package/src/fs/utils/deep-equal.ts +0 -35
  29. package/src/index.ts +0 -9
  30. package/src/middleware/event-bridge-middleware.test.ts +0 -131
  31. package/src/middleware/event-bridge-middleware.ts +0 -26
  32. package/src/middleware/index.ts +0 -6
  33. package/src/middleware/logger-middleware.test.ts +0 -129
  34. package/src/middleware/logger-middleware.ts +0 -25
  35. package/src/plugin/index.ts +0 -5
  36. package/src/plugin/store-plugin-factory.ts +0 -142
  37. package/tsconfig.es2015.json +0 -24
  38. package/tsconfig.json +0 -19
@@ -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,CAA4C;IACzD,OAAO,CAAC,kBAAkB,CAAqB;IAC/C,OAAO,CAAC,eAAe,CAAkB;IACzC,OAAO,CAAC,WAAW,CAAS;IAC5B,OAAO,CAAC,MAAM,CAA4B;;IAY1C,qBAAqB;IAIrB,kBAAkB;IAIlB,aAAa,IAAI,OAAO;IAIxB,UAAU,CAAC,MAAM,GAAE,WAAgB,GAAG,KAAK,CAAC,SAAS,EAAE,SAAS,CAAC;IA0DjE,QAAQ,IAAI,KAAK,CAAC,SAAS,EAAE,SAAS,CAAC;IAOvC,QAAQ,CAAC,CAAC,SAAS,SAAS,EAAE,MAAM,EAAE,CAAC,GAAG,CAAC;IAI3C,QAAQ,CAAC,CAAC,GAAG,SAAS,KAAK,CAAC;IAI5B,SAAS,CAAC,QAAQ,EAAE,MAAM,IAAI,GAAG,MAAM,IAAI;IAI3C,cAAc,CAAC,WAAW,EAAE,OAAO,CAAC,SAAS,EAAE,SAAS,CAAC,GAAG,IAAI;IAIhE,OAAO,IAAI,IAAI;CAKhB"}
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,CAA4C;IACzD,OAAO,CAAC,kBAAkB,CAAqB;IAC/C,OAAO,CAAC,eAAe,CAAkB;IACzC,OAAO,CAAC,WAAW,CAAS;IAC5B,OAAO,CAAC,MAAM,CAA4B;IAC1C,OAAO,CAAC,iBAAiB,CAAoB;;IAY7C,qBAAqB;IAIrB,kBAAkB;IAIlB,oBAAoB,CAAC,OAAO,EAAE,GAAG;IAIjC,oBAAoB;IAIpB,aAAa,IAAI,OAAO;IAIxB,UAAU,CAAC,MAAM,GAAE,WAAgB,GAAG,KAAK,CAAC,SAAS,EAAE,SAAS,CAAC;IA0DjE,QAAQ,IAAI,KAAK,CAAC,SAAS,EAAE,SAAS,CAAC;IAOvC,QAAQ,CAAC,CAAC,SAAS,SAAS,EAAE,MAAM,EAAE,CAAC,GAAG,CAAC;IAI3C,QAAQ,CAAC,CAAC,GAAG,SAAS,KAAK,CAAC;IAI5B,SAAS,CAAC,QAAQ,EAAE,MAAM,IAAI,GAAG,MAAM,IAAI;IAI3C,cAAc,CAAC,WAAW,EAAE,OAAO,CAAC,SAAS,EAAE,SAAS,CAAC,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;AAW7B,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,CA2Gd"}
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);
package/package.json CHANGED
@@ -1,12 +1,15 @@
1
1
  {
2
2
  "name": "@hamak/ui-store-impl",
3
- "version": "0.4.7",
3
+ "version": "0.4.19",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "description": "UI Store Implementation - Redux store implementation with middleware",
7
7
  "main": "dist/index.js",
8
8
  "types": "dist/index.d.ts",
9
9
  "sideEffects": false,
10
+ "files": [
11
+ "dist"
12
+ ],
10
13
  "repository": {
11
14
  "type": "git",
12
15
  "url": "https://github.com/amah/app-framework.git",
@@ -34,11 +37,11 @@
34
37
  }
35
38
  },
36
39
  "dependencies": {
37
- "@hamak/shared-utils": "0.4.7",
38
- "@hamak/ui-store-api": "0.4.7",
39
- "@hamak/ui-store-spi": "0.4.7",
40
- "@hamak/microkernel-api": "0.4.7",
41
- "@hamak/microkernel-spi": "0.4.7",
40
+ "@hamak/shared-utils": "*",
41
+ "@hamak/ui-store-api": "*",
42
+ "@hamak/ui-store-spi": "*",
43
+ "@hamak/microkernel-api": "*",
44
+ "@hamak/microkernel-spi": "*",
42
45
  "@reduxjs/toolkit": "^2.0.0",
43
46
  "immer": "^10.0.0",
44
47
  "redux": "^5.0.1",
@@ -1 +0,0 @@
1
- $ tsc -p tsconfig.json && tsc -p tsconfig.es2015.json
@@ -1,115 +0,0 @@
1
- $ vitest run
2
-
3
- RUN v2.1.9 /Users/amah/Devs/projects/app-framework/packages/ui-store/ui-store-impl
4
-
5
- stderr | src/core/middleware-registry.test.ts > MiddlewareRegistry > register > should replace existing middleware with same id
6
- [MiddlewareRegistry] Middleware "test-middleware" already registered, overwriting.
7
-
8
- ✓ src/core/middleware-registry.test.ts (20 tests) 16ms
9
- stdout | src/core/store-manager.test.ts > StoreManager > initialization > should initialize store
10
- [StoreManager] Store initialized with: { reducers: [], middleware: [], devTools: true }
11
-
12
- stdout | src/core/store-manager.test.ts > StoreManager > initialization > should throw error when initializing twice
13
- [StoreManager] Store initialized with: { reducers: [], middleware: [], devTools: true }
14
-
15
- stdout | src/core/store-manager.test.ts > StoreManager > initialization > should lock middleware registry after initialization
16
- [StoreManager] Store initialized with: { reducers: [], middleware: [], devTools: true }
17
-
18
- stdout | src/core/store-manager.test.ts > StoreManager > middleware registration > should apply middleware in priority order
19
- [StoreManager] Store initialized with: {
20
- reducers: [],
21
- middleware: [
22
- { id: 'high', priority: 100, plugin: undefined },
23
- { id: 'medium', priority: 50, plugin: undefined },
24
- { id: 'low', priority: 10, plugin: undefined }
25
- ],
26
- devTools: true
27
- }
28
-
29
- stdout | src/core/store-manager.test.ts > StoreManager > reducer registration > should combine multiple reducers
30
- [StoreManager] Store initialized with: { reducers: [ 'counter', 'name' ], middleware: [], devTools: true }
31
-
32
- stdout | src/core/store-manager.test.ts > StoreManager > reducer registration > should support hot reducer replacement
33
- [StoreManager] Store initialized with: { reducers: [ 'feature' ], middleware: [], devTools: true }
34
-
35
- stdout | src/core/store-manager.test.ts > StoreManager > store operations > should dispatch actions
36
- [StoreManager] Store initialized with: { reducers: [ 'counter' ], middleware: [], devTools: true }
37
-
38
- stdout | src/core/store-manager.test.ts > StoreManager > store operations > should get state
39
- [StoreManager] Store initialized with: { reducers: [ 'data' ], middleware: [], devTools: true }
40
-
41
- stdout | src/core/store-manager.test.ts > StoreManager > store operations > should subscribe to changes
42
- [StoreManager] Store initialized with: { reducers: [ 'counter' ], middleware: [], devTools: true }
43
-
44
- stdout | src/core/store-manager.test.ts > StoreManager > store operations > should replace reducer
45
- [StoreManager] Store initialized with: { reducers: [ 'data' ], middleware: [], devTools: true }
46
-
47
- stdout | src/core/store-manager.test.ts > StoreManager > preloaded state > should initialize with preloaded state
48
- [StoreManager] Store initialized with: { reducers: [ 'counter' ], middleware: [], devTools: true }
49
-
50
- stdout | src/core/store-manager.test.ts > StoreManager > destroy > should destroy store
51
- [StoreManager] Store initialized with: { reducers: [], middleware: [], devTools: true }
52
- [StoreManager] Store destroyed
53
-
54
- stdout | src/core/store-manager.test.ts > StoreManager > destroy > should allow re-initialization after destroy
55
- [StoreManager] Store initialized with: { reducers: [], middleware: [], devTools: true }
56
- [StoreManager] Store destroyed
57
- [StoreManager] Store initialized with: { reducers: [], middleware: [], devTools: true }
58
-
59
- stdout | src/core/store-manager.test.ts > StoreManager > DevTools configuration > should accept devTools configuration
60
- [StoreManager] Store initialized with: { reducers: [], middleware: [], devTools: false }
61
-
62
- stdout | src/core/store-manager.test.ts > StoreManager > DevTools configuration > should accept enhancers
63
- [StoreManager] Store initialized with: { reducers: [], middleware: [], devTools: true }
64
-
65
- ✓ src/core/store-manager.test.ts (19 tests) 229ms
66
- stderr | src/core/reducer-registry.test.ts > ReducerRegistry > register > should warn when replacing without replace flag
67
- [ReducerRegistry] Reducer "test" already registered. Use replace=true to override.
68
-
69
- ✓ src/core/reducer-registry.test.ts (19 tests) 130ms
70
- stdout | src/middleware/logger-middleware.test.ts > createLoggerMiddleware > should log actions with type
71
- [Redux] INCREMENT
72
- Prev State: { count: 0 }
73
- Action: { type: 'INCREMENT' }
74
- Next State: { count: 1 }
75
-
76
- stdout | src/middleware/logger-middleware.test.ts > createLoggerMiddleware > should pass action through middleware chain
77
- [Redux] TEST
78
- Prev State: {}
79
- Action: { type: 'TEST' }
80
- Next State: {}
81
-
82
- stdout | src/middleware/logger-middleware.test.ts > createLoggerMiddleware > should return action result
83
- [Redux] TEST
84
- Prev State: {}
85
- Action: { type: 'TEST', payload: 123 }
86
- Next State: {}
87
-
88
- stdout | src/middleware/logger-middleware.test.ts > createLoggerMiddleware > should log state before and after action
89
- [Redux] SET_VALUE
90
- Prev State: { value: 0 }
91
- Action: { type: 'SET_VALUE', payload: 42 }
92
- Next State: { value: 42 }
93
-
94
- stdout | src/middleware/logger-middleware.test.ts > createLoggerMiddleware > should work with multiple actions
95
- [Redux] INCREMENT
96
- Prev State: { count: 0 }
97
- Action: { type: 'INCREMENT' }
98
- Next State: { count: 1 }
99
- [Redux] INCREMENT
100
- Prev State: { count: 1 }
101
- Action: { type: 'INCREMENT' }
102
- Next State: { count: 2 }
103
- [Redux] DECREMENT
104
- Prev State: { count: 2 }
105
- Action: { type: 'DECREMENT' }
106
- Next State: { count: 1 }
107
-
108
- ✓ src/middleware/logger-middleware.test.ts (8 tests) 160ms
109
- ✓ src/middleware/event-bridge-middleware.test.ts (8 tests) 73ms
110
-
111
- Test Files 5 passed (5)
112
- Tests 74 passed (74)
113
- Start at 21:18:15
114
- Duration 3.29s (transform 279ms, setup 0ms, collect 376ms, tests 608ms, environment 1ms, prepare 2.75s)
115
-
package/CHANGELOG.md DELETED
@@ -1,41 +0,0 @@
1
- ## 0.4.0 (2025-11-10)
2
-
3
- ### 🚀 Features
4
-
5
- - implement notification plugin with UI and backend components ([c19ffcf](https://github.com/amah/app-framework/commit/c19ffcf))
6
- - add ES2015 build support and fix TypeScript config for logging packages ([be5e45e](https://github.com/amah/app-framework/commit/be5e45e))
7
- - complete logging system build and add optional console interception ([f390bc6](https://github.com/amah/app-framework/commit/f390bc6))
8
- - implement core pluggable logging system (Phase 1) ([2abdc1a](https://github.com/amah/app-framework/commit/2abdc1a))
9
-
10
- ### 🩹 Fixes
11
-
12
- - add notification packages to workspaces ([97a234d](https://github.com/amah/app-framework/commit/97a234d))
13
-
14
- ### ❤️ Thank You
15
-
16
- - Amah
17
- - Claude
18
-
19
- ## 0.3.0 (2025-11-06)
20
-
21
- ### 🚀 Features
22
-
23
- - migrate from Turbo to Nx 22 with comprehensive monorepo setup ([e63801e](https://github.com/amah/app-framework/commit/e63801e))
24
- - add Nx Release for automated dependency management ([01d474f](https://github.com/amah/app-framework/commit/01d474f))
25
- - migrate from Turbo to Nx 22 monorepo orchestration ([d374271](https://github.com/amah/app-framework/commit/d374271))
26
- - add configurable main padding and resizable sidebar to DashboardLayout ([c1d25bf](https://github.com/amah/app-framework/commit/c1d25bf))
27
- - add debug logging and version management system ([ea514fc](https://github.com/amah/app-framework/commit/ea514fc))
28
- - **ui-store:** add STORE_EXTENSIONS_TOKEN for DI-based middleware/reducer registration ([e855bdd](https://github.com/amah/app-framework/commit/e855bdd))
29
- - Rename package scope from @amk to @hamak and configure npm publishing ([b6040b5](https://github.com/amah/app-framework/commit/b6040b5))
30
- - Add hybrid local/CI-CD development workflow with bun link ([d09f528](https://github.com/amah/app-framework/commit/d09f528))
31
- - Add Turborepo for intelligent build orchestration and fix test type errors ([ba41db8](https://github.com/amah/app-framework/commit/ba41db8))
32
- - Add Redux store integration with ui-store package and demo ([e5aafa8](https://github.com/amah/app-framework/commit/e5aafa8))
33
-
34
- ### 🩹 Fixes
35
-
36
- - move git config to top-level release.git in nx.json ([1bb2187](https://github.com/amah/app-framework/commit/1bb2187))
37
-
38
- ### ❤️ Thank You
39
-
40
- - Amah
41
- - Claude
package/project.json DELETED
@@ -1,24 +0,0 @@
1
- {
2
- "name": "@hamak/ui-store-impl",
3
- "$schema": "../../../node_modules/nx/schemas/project-schema.json",
4
- "sourceRoot": "packages/ui-store/ui-store-impl/src",
5
- "projectType": "library",
6
- "targets": {
7
- "build": {
8
- "executor": "nx:run-commands",
9
- "outputs": ["{projectRoot}/dist"],
10
- "options": {
11
- "command": "tsc -p tsconfig.json && tsc -p tsconfig.es2015.json",
12
- "cwd": "{projectRoot}"
13
- }
14
- },
15
- "clean": {
16
- "executor": "nx:run-commands",
17
- "options": {
18
- "command": "rm -rf dist",
19
- "cwd": "{projectRoot}"
20
- }
21
- }
22
- },
23
- "tags": ["type:library", "scope:ui-store"]
24
- }
package/src/core/index.ts DELETED
@@ -1,3 +0,0 @@
1
- export * from './store-manager';
2
- export * from './middleware-registry';
3
- export * from './reducer-registry';
@@ -1,247 +0,0 @@
1
- /**
2
- * MiddlewareRegistry Tests
3
- */
4
-
5
- import { describe, test, expect, beforeEach, vi } from 'vitest';
6
- import { MiddlewareRegistry } from './middleware-registry';
7
- import type { Middleware } from 'redux';
8
- import type { MiddlewareRegistration } from '@hamak/ui-store-api';
9
-
10
- describe('MiddlewareRegistry', () => {
11
- let registry: MiddlewareRegistry;
12
-
13
- beforeEach(() => {
14
- registry = new MiddlewareRegistry();
15
- });
16
-
17
- describe('register', () => {
18
- test('should register middleware', () => {
19
- const middleware: Middleware = () => (next) => (action) => next(action);
20
- const registration: MiddlewareRegistration = {
21
- id: 'test-middleware',
22
- middleware,
23
- };
24
-
25
- registry.register(registration);
26
-
27
- expect(registry.has('test-middleware')).toBe(true);
28
- });
29
-
30
- test('should register middleware with default priority of 0', () => {
31
- const middleware: Middleware = () => (next) => (action) => next(action);
32
- const registration: MiddlewareRegistration = {
33
- id: 'test-middleware',
34
- middleware,
35
- };
36
-
37
- registry.register(registration);
38
- const info = registry.getInfo('test-middleware');
39
-
40
- expect(info?.priority).toBe(0);
41
- });
42
-
43
- test('should register middleware with custom priority', () => {
44
- const middleware: Middleware = () => (next) => (action) => next(action);
45
- const registration: MiddlewareRegistration = {
46
- id: 'test-middleware',
47
- middleware,
48
- priority: 100,
49
- };
50
-
51
- registry.register(registration);
52
- const info = registry.getInfo('test-middleware');
53
-
54
- expect(info?.priority).toBe(100);
55
- });
56
-
57
- test('should throw error when registering after lock', () => {
58
- const middleware: Middleware = () => (next) => (action) => next(action);
59
- const registration: MiddlewareRegistration = {
60
- id: 'test-middleware',
61
- middleware,
62
- };
63
-
64
- registry.lock();
65
-
66
- expect(() => registry.register(registration)).toThrow(
67
- /Cannot register middleware.*store already created/
68
- );
69
- });
70
-
71
- test('should replace existing middleware with same id', () => {
72
- const middleware1: Middleware = () => (next) => (action) => next(action);
73
- const middleware2: Middleware = () => (next) => (action) => next(action);
74
-
75
- registry.register({
76
- id: 'test-middleware',
77
- middleware: middleware1,
78
- priority: 10,
79
- });
80
-
81
- registry.register({
82
- id: 'test-middleware',
83
- middleware: middleware2,
84
- priority: 20,
85
- });
86
-
87
- const info = registry.getInfo('test-middleware');
88
- expect(info?.priority).toBe(20);
89
- expect(info?.middleware).toBe(middleware2);
90
- });
91
- });
92
-
93
- describe('unregister', () => {
94
- test('should unregister middleware', () => {
95
- const middleware: Middleware = () => (next) => (action) => next(action);
96
- registry.register({
97
- id: 'test-middleware',
98
- middleware,
99
- });
100
-
101
- registry.unregister('test-middleware');
102
-
103
- expect(registry.has('test-middleware')).toBe(false);
104
- });
105
-
106
- test('should not throw when unregistering non-existent middleware', () => {
107
- expect(() => registry.unregister('non-existent')).not.toThrow();
108
- });
109
-
110
- test('should throw error when unregistering after lock', () => {
111
- const middleware: Middleware = () => (next) => (action) => next(action);
112
- registry.register({
113
- id: 'test-middleware',
114
- middleware,
115
- });
116
-
117
- registry.lock();
118
-
119
- expect(() => registry.unregister('test-middleware')).toThrow(
120
- /Cannot unregister middleware after store creation/
121
- );
122
- });
123
- });
124
-
125
- describe('getAll', () => {
126
- test('should return empty array when no middleware registered', () => {
127
- expect(registry.getAll()).toEqual([]);
128
- });
129
-
130
- test('should return all middleware in priority order (highest first)', () => {
131
- const middleware1: Middleware = () => (next) => (action) => next(action);
132
- const middleware2: Middleware = () => (next) => (action) => next(action);
133
- const middleware3: Middleware = () => (next) => (action) => next(action);
134
-
135
- registry.register({ id: 'low', middleware: middleware1, priority: 10 });
136
- registry.register({ id: 'high', middleware: middleware2, priority: 100 });
137
- registry.register({ id: 'medium', middleware: middleware3, priority: 50 });
138
-
139
- const all = registry.getAll();
140
-
141
- expect(all).toEqual([middleware2, middleware3, middleware1]);
142
- });
143
-
144
- test('should handle middleware with same priority', () => {
145
- const middleware1: Middleware = () => (next) => (action) => next(action);
146
- const middleware2: Middleware = () => (next) => (action) => next(action);
147
-
148
- registry.register({ id: 'first', middleware: middleware1, priority: 10 });
149
- registry.register({ id: 'second', middleware: middleware2, priority: 10 });
150
-
151
- const all = registry.getAll();
152
-
153
- expect(all.length).toBe(2);
154
- expect(all).toContain(middleware1);
155
- expect(all).toContain(middleware2);
156
- });
157
- });
158
-
159
- describe('has', () => {
160
- test('should return false for non-existent middleware', () => {
161
- expect(registry.has('non-existent')).toBe(false);
162
- });
163
-
164
- test('should return true for registered middleware', () => {
165
- const middleware: Middleware = () => (next) => (action) => next(action);
166
- registry.register({ id: 'test', middleware });
167
-
168
- expect(registry.has('test')).toBe(true);
169
- });
170
- });
171
-
172
- describe('getInfo', () => {
173
- test('should return undefined for non-existent middleware', () => {
174
- expect(registry.getInfo('non-existent')).toBeUndefined();
175
- });
176
-
177
- test('should return registration info for existing middleware', () => {
178
- const middleware: Middleware = () => (next) => (action) => next(action);
179
- const registration: MiddlewareRegistration = {
180
- id: 'test',
181
- middleware,
182
- priority: 100,
183
- plugin: 'test-plugin',
184
- description: 'Test middleware',
185
- optional: true,
186
- };
187
-
188
- registry.register(registration);
189
- const info = registry.getInfo('test');
190
-
191
- expect(info).toEqual(registration);
192
- });
193
- });
194
-
195
- describe('getAllRegistrations', () => {
196
- test('should return empty array when no middleware registered', () => {
197
- expect(registry.getAllRegistrations()).toEqual([]);
198
- });
199
-
200
- test('should return all registrations', () => {
201
- const middleware1: Middleware = () => (next) => (action) => next(action);
202
- const middleware2: Middleware = () => (next) => (action) => next(action);
203
-
204
- registry.register({ id: 'first', middleware: middleware1 });
205
- registry.register({ id: 'second', middleware: middleware2 });
206
-
207
- const registrations = registry.getAllRegistrations();
208
-
209
- expect(registrations.length).toBe(2);
210
- expect(registrations.map((r) => r.id)).toContain('first');
211
- expect(registrations.map((r) => r.id)).toContain('second');
212
- });
213
- });
214
-
215
- describe('lock', () => {
216
- test('should prevent further registration', () => {
217
- const middleware: Middleware = () => (next) => (action) => next(action);
218
-
219
- registry.lock();
220
-
221
- expect(() =>
222
- registry.register({ id: 'test', middleware })
223
- ).toThrow();
224
- });
225
-
226
- test('should prevent further unregistration', () => {
227
- const middleware: Middleware = () => (next) => (action) => next(action);
228
- registry.register({ id: 'test', middleware });
229
-
230
- registry.lock();
231
-
232
- expect(() => registry.unregister('test')).toThrow();
233
- });
234
-
235
- test('should not affect read operations', () => {
236
- const middleware: Middleware = () => (next) => (action) => next(action);
237
- registry.register({ id: 'test', middleware });
238
-
239
- registry.lock();
240
-
241
- expect(registry.has('test')).toBe(true);
242
- expect(registry.getInfo('test')).toBeDefined();
243
- expect(registry.getAll().length).toBe(1);
244
- expect(registry.getAllRegistrations().length).toBe(1);
245
- });
246
- });
247
- });