effectable 0.1.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/LICENSE +21 -0
- package/README.md +157 -0
- package/build/LICENSE +21 -0
- package/build/bootstrap/bootstrap.d.ts +32 -0
- package/build/bootstrap/bootstrap.d.ts.map +1 -0
- package/build/bootstrap/bootstrap.js +179 -0
- package/build/bootstrap/bootstrap.js.map +1 -0
- package/build/bootstrap/index.d.ts +9 -0
- package/build/bootstrap/index.d.ts.map +1 -0
- package/build/bootstrap/index.js +14 -0
- package/build/bootstrap/index.js.map +1 -0
- package/build/bootstrap/types.d.ts +105 -0
- package/build/bootstrap/types.d.ts.map +1 -0
- package/build/bootstrap/types.js +26 -0
- package/build/bootstrap/types.js.map +1 -0
- package/build/component/Component.d.ts +126 -0
- package/build/component/Component.d.ts.map +1 -0
- package/build/component/Component.js +123 -0
- package/build/component/Component.js.map +1 -0
- package/build/component/GraphRuntime.d.ts +457 -0
- package/build/component/GraphRuntime.d.ts.map +1 -0
- package/build/component/GraphRuntime.js +1168 -0
- package/build/component/GraphRuntime.js.map +1 -0
- package/build/component/constants.d.ts +1 -0
- package/build/component/constants.d.ts.map +1 -0
- package/build/component/constants.js +2 -0
- package/build/component/constants.js.map +1 -0
- package/build/component/context.d.ts +199 -0
- package/build/component/context.d.ts.map +1 -0
- package/build/component/context.js +262 -0
- package/build/component/context.js.map +1 -0
- package/build/component/graphRuntime.constants.d.ts +13 -0
- package/build/component/graphRuntime.constants.d.ts.map +1 -0
- package/build/component/graphRuntime.constants.js +15 -0
- package/build/component/graphRuntime.constants.js.map +1 -0
- package/build/component/h.d.ts +48 -0
- package/build/component/h.d.ts.map +1 -0
- package/build/component/h.js +72 -0
- package/build/component/h.js.map +1 -0
- package/build/component/index.d.ts +19 -0
- package/build/component/index.d.ts.map +1 -0
- package/build/component/index.js +39 -0
- package/build/component/index.js.map +1 -0
- package/build/component/lifecycle.d.ts +179 -0
- package/build/component/lifecycle.d.ts.map +1 -0
- package/build/component/lifecycle.js +367 -0
- package/build/component/lifecycle.js.map +1 -0
- package/build/component/refs.d.ts +105 -0
- package/build/component/refs.d.ts.map +1 -0
- package/build/component/refs.js +128 -0
- package/build/component/refs.js.map +1 -0
- package/build/component/types.d.ts +169 -0
- package/build/component/types.d.ts.map +1 -0
- package/build/component/types.js +40 -0
- package/build/component/types.js.map +1 -0
- package/build/connect/connect.d.ts +31 -0
- package/build/connect/connect.d.ts.map +1 -0
- package/build/connect/connect.js +500 -0
- package/build/connect/connect.js.map +1 -0
- package/build/connect/index.d.ts +8 -0
- package/build/connect/index.d.ts.map +1 -0
- package/build/connect/index.js +11 -0
- package/build/connect/index.js.map +1 -0
- package/build/connect/types.d.ts +90 -0
- package/build/connect/types.d.ts.map +1 -0
- package/build/connect/types.js +8 -0
- package/build/connect/types.js.map +1 -0
- package/build/index.d.ts +26 -0
- package/build/index.d.ts.map +1 -0
- package/build/index.js +60 -0
- package/build/index.js.map +1 -0
- package/build/runtime/BusDecorators.d.ts +113 -0
- package/build/runtime/BusDecorators.d.ts.map +1 -0
- package/build/runtime/BusDecorators.js +302 -0
- package/build/runtime/BusDecorators.js.map +1 -0
- package/build/runtime/CommandBus.d.ts +43 -0
- package/build/runtime/CommandBus.d.ts.map +1 -0
- package/build/runtime/CommandBus.js +65 -0
- package/build/runtime/CommandBus.js.map +1 -0
- package/build/runtime/EventBus.d.ts +50 -0
- package/build/runtime/EventBus.d.ts.map +1 -0
- package/build/runtime/EventBus.js +90 -0
- package/build/runtime/EventBus.js.map +1 -0
- package/build/runtime/HandleRegistry.d.ts +143 -0
- package/build/runtime/HandleRegistry.d.ts.map +1 -0
- package/build/runtime/HandleRegistry.js +244 -0
- package/build/runtime/HandleRegistry.js.map +1 -0
- package/build/runtime/QueryBus.d.ts +43 -0
- package/build/runtime/QueryBus.d.ts.map +1 -0
- package/build/runtime/QueryBus.js +65 -0
- package/build/runtime/QueryBus.js.map +1 -0
- package/build/runtime/index.d.ts +13 -0
- package/build/runtime/index.d.ts.map +1 -0
- package/build/runtime/index.js +32 -0
- package/build/runtime/index.js.map +1 -0
- package/build/runtime/types.d.ts +79 -0
- package/build/runtime/types.d.ts.map +1 -0
- package/build/runtime/types.js +8 -0
- package/build/runtime/types.js.map +1 -0
- package/build/store/createStore.d.ts +36 -0
- package/build/store/createStore.d.ts.map +1 -0
- package/build/store/createStore.js +131 -0
- package/build/store/createStore.js.map +1 -0
- package/build/store/index.d.ts +14 -0
- package/build/store/index.d.ts.map +1 -0
- package/build/store/index.js +39 -0
- package/build/store/index.js.map +1 -0
- package/build/store/middleware.d.ts +38 -0
- package/build/store/middleware.d.ts.map +1 -0
- package/build/store/middleware.js +99 -0
- package/build/store/middleware.js.map +1 -0
- package/build/store/selector.d.ts +62 -0
- package/build/store/selector.d.ts.map +1 -0
- package/build/store/selector.js +226 -0
- package/build/store/selector.js.map +1 -0
- package/build/store/semanticStateTree.d.ts +91 -0
- package/build/store/semanticStateTree.d.ts.map +1 -0
- package/build/store/semanticStateTree.js +263 -0
- package/build/store/semanticStateTree.js.map +1 -0
- package/build/store/types.d.ts +259 -0
- package/build/store/types.d.ts.map +1 -0
- package/build/store/types.js +28 -0
- package/build/store/types.js.map +1 -0
- package/package.json +109 -0
|
@@ -0,0 +1,259 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Redux-RxJS Store Types
|
|
3
|
+
*
|
|
4
|
+
* Defines types for a Redux-like store with RxJS support.
|
|
5
|
+
* Maximum compatibility with Redux v4 API plus reactive extensions.
|
|
6
|
+
*
|
|
7
|
+
* @module Effectable/store/types
|
|
8
|
+
*/
|
|
9
|
+
import { Observable } from 'rxjs';
|
|
10
|
+
/**
|
|
11
|
+
* Base Action type
|
|
12
|
+
*
|
|
13
|
+
* All actions must have a type field and an optional payload.
|
|
14
|
+
*/
|
|
15
|
+
export interface Action<T = any> {
|
|
16
|
+
type: string;
|
|
17
|
+
payload?: T;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Base action for middleware and default dispatch.
|
|
21
|
+
*
|
|
22
|
+
* Used as “any action” with a required `type`
|
|
23
|
+
* and an optional `payload`.
|
|
24
|
+
*/
|
|
25
|
+
export interface AnyAction extends Action<unknown> {
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Reducer function
|
|
29
|
+
*
|
|
30
|
+
* Takes the current state and an action, returns the new state.
|
|
31
|
+
* Must be a pure function (no side-effects).
|
|
32
|
+
*
|
|
33
|
+
* @template S - State type
|
|
34
|
+
* @template A - Action type
|
|
35
|
+
*/
|
|
36
|
+
export type Reducer<S = any, A extends Action = Action> = (state: S, action: A) => S;
|
|
37
|
+
/**
|
|
38
|
+
* Dispatch function
|
|
39
|
+
*
|
|
40
|
+
* Sends an action to the Store for processing through the middleware chain and reducer.
|
|
41
|
+
* Supports both synchronous and asynchronous middleware.
|
|
42
|
+
*
|
|
43
|
+
* @template A - Action type
|
|
44
|
+
*/
|
|
45
|
+
export type Dispatch<A = AnyAction> = (action: A) => A | Promise<A>;
|
|
46
|
+
/**
|
|
47
|
+
* Dispatch as a Store method with an optional generic to narrow the action type at the call site.
|
|
48
|
+
* Allows calling store.dispatch<ConcreteAction>({ type, payload }) without a type cast.
|
|
49
|
+
*
|
|
50
|
+
* @template A - Base action type (e.g. RootAction)
|
|
51
|
+
*/
|
|
52
|
+
export type DispatchMethod<A extends Action = Action> = <B extends A = A>(action: B) => B | Promise<B>;
|
|
53
|
+
/**
|
|
54
|
+
* Selector function
|
|
55
|
+
*
|
|
56
|
+
* Extracts a slice of state from the Store.
|
|
57
|
+
* Can be used for memoization and composition.
|
|
58
|
+
*
|
|
59
|
+
* @template S - State type
|
|
60
|
+
* @template R - Result type
|
|
61
|
+
*/
|
|
62
|
+
export type Selector<S, R> = (state: S) => R;
|
|
63
|
+
/**
|
|
64
|
+
* Parametric Selector (with extra parameters)
|
|
65
|
+
*
|
|
66
|
+
* A selector that takes not only state but also additional parameters.
|
|
67
|
+
*
|
|
68
|
+
* @template S - State type
|
|
69
|
+
* @template P - Parameters type
|
|
70
|
+
* @template R - Result type
|
|
71
|
+
*/
|
|
72
|
+
export type ParametricSelector<S, P, R> = (state: S, props: P) => R;
|
|
73
|
+
/**
|
|
74
|
+
* Store Creator
|
|
75
|
+
*
|
|
76
|
+
* Function that creates a Store. Used for typing createStore.
|
|
77
|
+
*/
|
|
78
|
+
export type StoreCreator<S = any, A extends Action = Action> = (reducer: Reducer<S, A>, initialState: S) => Store<S, A>;
|
|
79
|
+
/**
|
|
80
|
+
* Store Enhancer
|
|
81
|
+
*
|
|
82
|
+
* Higher-order function for modifying Store behavior.
|
|
83
|
+
* Used to apply middleware via applyMiddleware.
|
|
84
|
+
*/
|
|
85
|
+
export type StoreEnhancer<S = any, A extends Action = Action> = (createStore: StoreCreator<S, A>) => StoreCreator<S, A>;
|
|
86
|
+
/**
|
|
87
|
+
* Store interface
|
|
88
|
+
*
|
|
89
|
+
* Main Redux Store interface with RxJS extensions.
|
|
90
|
+
*
|
|
91
|
+
* @template S - State type
|
|
92
|
+
* @template A - Action type
|
|
93
|
+
*/
|
|
94
|
+
export interface Store<S = any, A extends Action = Action> {
|
|
95
|
+
/**
|
|
96
|
+
* Dispatches an action to the Store.
|
|
97
|
+
* Supports an optional generic to narrow the type: store.dispatch<ConcreteAction>({ type, payload }).
|
|
98
|
+
*
|
|
99
|
+
* The action goes through the middleware chain, then the reducer,
|
|
100
|
+
* and the new state is emitted on the state$ Observable.
|
|
101
|
+
*
|
|
102
|
+
* @param action - Action to process
|
|
103
|
+
* @returns The same action (for chaining)
|
|
104
|
+
*/
|
|
105
|
+
dispatch: DispatchMethod<A>;
|
|
106
|
+
/**
|
|
107
|
+
* Returns the current state synchronously
|
|
108
|
+
*
|
|
109
|
+
* Useful for taking a state snapshot without subscribing.
|
|
110
|
+
*
|
|
111
|
+
* @returns Current Store state
|
|
112
|
+
*/
|
|
113
|
+
getState(): S;
|
|
114
|
+
/**
|
|
115
|
+
* Observable of the current state (RxJS extension)
|
|
116
|
+
*
|
|
117
|
+
* Emits a new value on every state change.
|
|
118
|
+
* Starts with the current state (BehaviorSubject).
|
|
119
|
+
*
|
|
120
|
+
* @example
|
|
121
|
+
* store.state$.subscribe(state => {
|
|
122
|
+
* console.log('State changed:', state);
|
|
123
|
+
* });
|
|
124
|
+
*/
|
|
125
|
+
state$: Observable<S>;
|
|
126
|
+
/**
|
|
127
|
+
* Universal method for applying selectors (RxJS extension)
|
|
128
|
+
*
|
|
129
|
+
* Automatically applies distinctUntilChanged to avoid
|
|
130
|
+
* unnecessary emissions when the selector result is unchanged.
|
|
131
|
+
*
|
|
132
|
+
* @template T - Selector result type
|
|
133
|
+
* @param selectorFn - Selector function
|
|
134
|
+
* @returns Observable of the selector result
|
|
135
|
+
*
|
|
136
|
+
* @example
|
|
137
|
+
* const currentPath$ = store.select(state => state.navigation.currentPath);
|
|
138
|
+
* currentPath$.subscribe(path => console.log('Path:', path));
|
|
139
|
+
*/
|
|
140
|
+
select<T>(selectorFn: Selector<S, T>): Observable<T>;
|
|
141
|
+
/**
|
|
142
|
+
* Completes all subscriptions and cleans up resources
|
|
143
|
+
*
|
|
144
|
+
* After destroy() the Store is no longer usable.
|
|
145
|
+
* Call when unmounting the app or in tests.
|
|
146
|
+
*/
|
|
147
|
+
destroy(): void;
|
|
148
|
+
}
|
|
149
|
+
/**
|
|
150
|
+
* Middleware API
|
|
151
|
+
*
|
|
152
|
+
* API provided to each middleware: dispatch and getState.
|
|
153
|
+
* Calling api.dispatch(action) runs the action through the entire chain again.
|
|
154
|
+
*
|
|
155
|
+
* @template D - Dispatch type
|
|
156
|
+
* @template S - State type
|
|
157
|
+
*/
|
|
158
|
+
export interface MiddlewareAPI<D = Dispatch, S = unknown> {
|
|
159
|
+
/**
|
|
160
|
+
* Dispatch function for sending new actions
|
|
161
|
+
*
|
|
162
|
+
* IMPORTANT: This is the wrapped dispatch that goes through the middleware chain.
|
|
163
|
+
* Can be used to dispatch additional actions inside middleware.
|
|
164
|
+
*/
|
|
165
|
+
dispatch: D;
|
|
166
|
+
/**
|
|
167
|
+
* Function to get the current state
|
|
168
|
+
*
|
|
169
|
+
* Returns a state snapshot at the time of the call.
|
|
170
|
+
*/
|
|
171
|
+
getState(): S;
|
|
172
|
+
}
|
|
173
|
+
/**
|
|
174
|
+
* Middleware function
|
|
175
|
+
*
|
|
176
|
+
* Redux-style middleware with a triple-curried signature:
|
|
177
|
+
* (store) => (next) => (action) => result
|
|
178
|
+
*
|
|
179
|
+
* Middleware can:
|
|
180
|
+
* - Intercept actions
|
|
181
|
+
* - Perform side-effects
|
|
182
|
+
* - Dispatch new actions
|
|
183
|
+
* - Modify or block actions
|
|
184
|
+
* - Call next() multiple times
|
|
185
|
+
* - Use async/await
|
|
186
|
+
* - Subscribe to state$ for reactive logic
|
|
187
|
+
*
|
|
188
|
+
* @template S - State type
|
|
189
|
+
* @template A - Action type
|
|
190
|
+
*
|
|
191
|
+
* @example
|
|
192
|
+
* const loggingMiddleware: Middleware = (store) => (next) => (action) => {
|
|
193
|
+
* console.log('Action:', action.type);
|
|
194
|
+
* const result = next(action);
|
|
195
|
+
* console.log('New state:', store.getState());
|
|
196
|
+
* return result;
|
|
197
|
+
* };
|
|
198
|
+
*
|
|
199
|
+
* @example
|
|
200
|
+
* // Async middleware
|
|
201
|
+
* const asyncMiddleware: Middleware = (store) => (next) => async (action) => {
|
|
202
|
+
* const result = next(action);
|
|
203
|
+
* await saveToServer(action);
|
|
204
|
+
* return result;
|
|
205
|
+
* };
|
|
206
|
+
*/
|
|
207
|
+
export interface Middleware<DispatchExt = {}, S = unknown, D = Dispatch> {
|
|
208
|
+
/**
|
|
209
|
+
* Creates middleware in redux-style format `(api) => (next) => (action)`.
|
|
210
|
+
* `next(action)` forwards the action down the current chain.
|
|
211
|
+
* `api.dispatch(action)` starts the action from the beginning of the entire chain.
|
|
212
|
+
*
|
|
213
|
+
* The action handler may be synchronous or asynchronous.
|
|
214
|
+
*
|
|
215
|
+
* @param {MiddlewareAPI<D, S>} api - Middleware API: dispatch, getState
|
|
216
|
+
* @returns {(next: D) => (action: unknown) => unknown | Promise<unknown>} wrapper over dispatch
|
|
217
|
+
*/
|
|
218
|
+
(api: MiddlewareAPI<D, S>): (next: D) => (action: unknown) => unknown | Promise<unknown>;
|
|
219
|
+
}
|
|
220
|
+
/**
|
|
221
|
+
* Memoized selector
|
|
222
|
+
*
|
|
223
|
+
* Selector with extra methods for memoization control
|
|
224
|
+
* and performance debugging.
|
|
225
|
+
*
|
|
226
|
+
* @template S - State type
|
|
227
|
+
* @template R - Result type
|
|
228
|
+
*/
|
|
229
|
+
export interface MemoizedSelector<S, R> extends Selector<S, R> {
|
|
230
|
+
/**
|
|
231
|
+
* Resets the selector cache
|
|
232
|
+
*
|
|
233
|
+
* After calling, the next selector invocation will recompute
|
|
234
|
+
* regardless of input data.
|
|
235
|
+
*
|
|
236
|
+
* Useful for testing or when you need to force
|
|
237
|
+
* a result recomputation.
|
|
238
|
+
*/
|
|
239
|
+
resetMemoization(): void;
|
|
240
|
+
/**
|
|
241
|
+
* Returns the number of combiner function calls
|
|
242
|
+
*
|
|
243
|
+
* Used for debugging and optimization.
|
|
244
|
+
* If recomputations() grows too quickly,
|
|
245
|
+
* the selector may need optimization.
|
|
246
|
+
*
|
|
247
|
+
* @returns Recomputation count
|
|
248
|
+
*/
|
|
249
|
+
recomputations(): number;
|
|
250
|
+
}
|
|
251
|
+
/**
|
|
252
|
+
* Type guard to check whether an object is an Action
|
|
253
|
+
*/
|
|
254
|
+
export declare function isAction(obj: any): obj is Action;
|
|
255
|
+
/**
|
|
256
|
+
* Type guard to check whether a function is Middleware
|
|
257
|
+
*/
|
|
258
|
+
export declare function isMiddleware<DispatchExt = {}, S = unknown, D extends Dispatch = Dispatch>(fn: any): fn is Middleware<DispatchExt, S, D>;
|
|
259
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources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AC,KAAK,CAAC,MAAM,EAAE,OAAO,KAAK,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;CAC1F;AAMD;;;;;;;;GAQG;AACH,MAAM,WAAW,gBAAgB,CAAC,CAAC,EAAE,CAAC,CAAE,SAAQ,QAAQ,CAAC,CAAC,EAAE,CAAC,CAAC;IAC5D;;;;;;;;OAQG;IACH,gBAAgB,IAAI,IAAI,CAAC;IAEzB;;;;;;;;OAQG;IACH,cAAc,IAAI,MAAM,CAAC;CAC1B;AAMD;;GAEG;AACH,wBAAgB,QAAQ,CAAE,GAAG,EAAE,GAAG,GAAG,GAAG,IAAI,MAAM,CAEjD;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,WAAW,GAAG,EAAE,EAAE,CAAC,GAAG,OAAO,EAAE,CAAC,SAAS,QAAQ,GAAG,QAAQ,EACvF,EAAE,EAAE,GAAG,GACN,EAAE,IAAI,UAAU,CAAC,WAAW,EAAE,CAAC,EAAE,CAAC,CAAC,CAErC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Redux-RxJS Store Types
|
|
4
|
+
*
|
|
5
|
+
* Defines types for a Redux-like store with RxJS support.
|
|
6
|
+
* Maximum compatibility with Redux v4 API plus reactive extensions.
|
|
7
|
+
*
|
|
8
|
+
* @module Effectable/store/types
|
|
9
|
+
*/
|
|
10
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11
|
+
exports.isAction = isAction;
|
|
12
|
+
exports.isMiddleware = isMiddleware;
|
|
13
|
+
// ============================================================================
|
|
14
|
+
// Type Guards
|
|
15
|
+
// ============================================================================
|
|
16
|
+
/**
|
|
17
|
+
* Type guard to check whether an object is an Action
|
|
18
|
+
*/
|
|
19
|
+
function isAction(obj) {
|
|
20
|
+
return typeof obj === 'object' && obj !== null && typeof obj.type === 'string';
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Type guard to check whether a function is Middleware
|
|
24
|
+
*/
|
|
25
|
+
function isMiddleware(fn) {
|
|
26
|
+
return typeof fn === 'function';
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/store/types.ts"],"names":[],"mappings":";AAAA;;;;;;;GAOG;;AA0SH,4BAEC;AAKD,oCAIC;AAlBD,+EAA+E;AAC/E,cAAc;AACd,+EAA+E;AAE/E;;GAEG;AACH,SAAgB,QAAQ,CAAE,GAAQ;IAChC,OAAO,OAAO,GAAG,KAAK,QAAQ,IAAI,GAAG,KAAK,IAAI,IAAI,OAAO,GAAG,CAAC,IAAI,KAAK,QAAQ,CAAC;AACjF,CAAC;AAED;;GAEG;AACH,SAAgB,YAAY,CAC1B,EAAO;IAEP,OAAO,OAAO,EAAE,KAAK,UAAU,CAAC;AAClC,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "effectable",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Declarative reactive runtime for Node.js: bootstrap, Redux-style RxJS store, Component lifecycle, class-based connect, and GraphRuntime.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"author": {
|
|
7
|
+
"name": "Nick Nask",
|
|
8
|
+
"email": "spb.nikas@gmail.com",
|
|
9
|
+
"url": "https://github.com/iamnikas"
|
|
10
|
+
},
|
|
11
|
+
"repository": {
|
|
12
|
+
"type": "git",
|
|
13
|
+
"url": "git+https://github.com/iamnikas/effectable.git"
|
|
14
|
+
},
|
|
15
|
+
"bugs": {
|
|
16
|
+
"url": "https://github.com/iamnikas/effectable/issues"
|
|
17
|
+
},
|
|
18
|
+
"homepage": "https://github.com/iamnikas/effectable#readme",
|
|
19
|
+
"keywords": [
|
|
20
|
+
"effectable",
|
|
21
|
+
"typescript",
|
|
22
|
+
"nodejs",
|
|
23
|
+
"reactive",
|
|
24
|
+
"runtime",
|
|
25
|
+
"bootstrap",
|
|
26
|
+
"store",
|
|
27
|
+
"rxjs",
|
|
28
|
+
"redux",
|
|
29
|
+
"component",
|
|
30
|
+
"lifecycle",
|
|
31
|
+
"connect",
|
|
32
|
+
"graph-runtime",
|
|
33
|
+
"event-bus",
|
|
34
|
+
"command-bus"
|
|
35
|
+
],
|
|
36
|
+
"type": "commonjs",
|
|
37
|
+
"main": "./build/index.js",
|
|
38
|
+
"types": "./build/index.d.ts",
|
|
39
|
+
"sideEffects": [
|
|
40
|
+
"./build/runtime/HandleRegistry.js",
|
|
41
|
+
"./build/runtime/BusDecorators.js"
|
|
42
|
+
],
|
|
43
|
+
"files": [
|
|
44
|
+
"build",
|
|
45
|
+
"LICENSE",
|
|
46
|
+
"README.md"
|
|
47
|
+
],
|
|
48
|
+
"exports": {
|
|
49
|
+
".": {
|
|
50
|
+
"types": "./build/index.d.ts",
|
|
51
|
+
"default": "./build/index.js"
|
|
52
|
+
},
|
|
53
|
+
"./bootstrap": {
|
|
54
|
+
"types": "./build/bootstrap/index.d.ts",
|
|
55
|
+
"default": "./build/bootstrap/index.js"
|
|
56
|
+
},
|
|
57
|
+
"./store": {
|
|
58
|
+
"types": "./build/store/index.d.ts",
|
|
59
|
+
"default": "./build/store/index.js"
|
|
60
|
+
},
|
|
61
|
+
"./component": {
|
|
62
|
+
"types": "./build/component/index.d.ts",
|
|
63
|
+
"default": "./build/component/index.js"
|
|
64
|
+
},
|
|
65
|
+
"./component/*": {
|
|
66
|
+
"types": "./build/component/*.d.ts",
|
|
67
|
+
"default": "./build/component/*.js"
|
|
68
|
+
},
|
|
69
|
+
"./connect": {
|
|
70
|
+
"types": "./build/connect/index.d.ts",
|
|
71
|
+
"default": "./build/connect/index.js"
|
|
72
|
+
},
|
|
73
|
+
"./runtime": {
|
|
74
|
+
"types": "./build/runtime/index.d.ts",
|
|
75
|
+
"default": "./build/runtime/index.js"
|
|
76
|
+
},
|
|
77
|
+
"./package.json": "./package.json"
|
|
78
|
+
},
|
|
79
|
+
"scripts": {
|
|
80
|
+
"clean": "rm -rf ./build",
|
|
81
|
+
"build": "npm run clean && tsc --project ./tsconfig.build.json && npm run build:license",
|
|
82
|
+
"build:license": "cp ./LICENSE ./build/LICENSE",
|
|
83
|
+
"typecheck": "tsc --noEmit --project ./tsconfig.json",
|
|
84
|
+
"test": "jest --config ./jest.config.js --runInBand",
|
|
85
|
+
"test:watch": "jest --config ./jest.config.js --watch",
|
|
86
|
+
"test:spec": "jest --config ./jest.config.js --runInBand --testPathPatterns=spec",
|
|
87
|
+
"test:entity": "jest --config ./jest.config.js --runInBand --testPathPatterns=entity",
|
|
88
|
+
"bench": "jest --config ./jest.bench.config.js --runInBand",
|
|
89
|
+
"prepublishOnly": "npm run typecheck && npm test && npm run build"
|
|
90
|
+
},
|
|
91
|
+
"publishConfig": {
|
|
92
|
+
"access": "public"
|
|
93
|
+
},
|
|
94
|
+
"engines": {
|
|
95
|
+
"node": ">=18.18.0",
|
|
96
|
+
"npm": ">=9"
|
|
97
|
+
},
|
|
98
|
+
"dependencies": {
|
|
99
|
+
"reflect-metadata": "^0.2.2",
|
|
100
|
+
"rxjs": "^7.8.2"
|
|
101
|
+
},
|
|
102
|
+
"devDependencies": {
|
|
103
|
+
"@types/jest": "^29.5.14",
|
|
104
|
+
"@types/node": "^22.16.0",
|
|
105
|
+
"jest": "^30.1.3",
|
|
106
|
+
"ts-jest": "^29.4.9",
|
|
107
|
+
"typescript": "^6.0.3"
|
|
108
|
+
}
|
|
109
|
+
}
|