@context-action/core 0.0.2 → 0.0.4
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/README.md +272 -0
- package/dist/index.cjs +779 -62
- package/dist/index.d.cts +658 -30
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.ts +658 -30
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +777 -61
- package/dist/index.js.map +1 -1
- package/package.json +16 -12
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["_typeof","o","_typeof","toPrimitive","toPropertyKey","_defineProperty","action: K","handler: ActionHandler<T[K]>","config: HandlerConfig","name: string","setter: Function","payload?: T[K]","controller: PipelineController<T[K]>","type: K","payload: T[K]","action: any"],"sources":["../../../node_modules/.pnpm/@oxc-project+runtime@0.77.3/node_modules/@oxc-project/runtime/src/helpers/typeof.js","../../../node_modules/.pnpm/@oxc-project+runtime@0.77.3/node_modules/@oxc-project/runtime/src/helpers/toPrimitive.js","../../../node_modules/.pnpm/@oxc-project+runtime@0.77.3/node_modules/@oxc-project/runtime/src/helpers/toPropertyKey.js","../../../node_modules/.pnpm/@oxc-project+runtime@0.77.3/node_modules/@oxc-project/runtime/src/helpers/defineProperty.js","../src/ActionRegister.ts","../src/types.ts"],"sourcesContent":["function _typeof(o) {\n \"@babel/helpers - typeof\";\n\n return module.exports = _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) {\n return typeof o;\n } : function (o) {\n return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o;\n }, module.exports.__esModule = true, module.exports[\"default\"] = module.exports, _typeof(o);\n}\nmodule.exports = _typeof, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","var _typeof = require(\"./typeof.js\")[\"default\"];\nfunction toPrimitive(t, r) {\n if (\"object\" != _typeof(t) || !t) return t;\n var e = t[Symbol.toPrimitive];\n if (void 0 !== e) {\n var i = e.call(t, r || \"default\");\n if (\"object\" != _typeof(i)) return i;\n throw new TypeError(\"@@toPrimitive must return a primitive value.\");\n }\n return (\"string\" === r ? String : Number)(t);\n}\nmodule.exports = toPrimitive, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","var _typeof = require(\"./typeof.js\")[\"default\"];\nvar toPrimitive = require(\"./toPrimitive.js\");\nfunction toPropertyKey(t) {\n var i = toPrimitive(t, \"string\");\n return \"symbol\" == _typeof(i) ? i : i + \"\";\n}\nmodule.exports = toPropertyKey, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","var toPropertyKey = require(\"./toPropertyKey.js\");\nfunction _defineProperty(e, r, t) {\n return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {\n value: t,\n enumerable: !0,\n configurable: !0,\n writable: !0\n }) : e[r] = t, e;\n}\nmodule.exports = _defineProperty, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","// 타입 정의\nexport type PipelineController<T = any> = {\n next: () => void;\n abort: (reason?: string) => void;\n modifyPayload: (modifier: (payload: T) => T) => void;\n};\n\nexport type ActionHandler<T = any> = (\n payload: T,\n controller: PipelineController<T>\n) => void | Promise<void>;\n\nexport type HandlerConfig = {\n priority?: number;\n id?: string;\n blocking?: boolean;\n};\n\n// 선언적 타입 정의를 위한 인터페이스\nexport interface ActionPayloadMap {\n // 확장 가능한 구조\n // 'actionName': PayloadType;\n}\n\n// Action Register 클래스\nexport class ActionRegister<T extends ActionPayloadMap = ActionPayloadMap> {\n private pipelines = new Map<keyof T, Map<string, {\n handler: ActionHandler<any>;\n config: HandlerConfig;\n }>>();\n \n private atomSetters = new Map<string, Function>();\n\n // 파이프라인에 핸들러 등록\n register<K extends keyof T>(\n action: K,\n handler: ActionHandler<T[K]>,\n config: HandlerConfig = {}\n ): () => void {\n if (!this.pipelines.has(action)) {\n this.pipelines.set(action, new Map());\n }\n \n const pipeline = this.pipelines.get(action)!;\n const handlerId = config.id || `handler_${Date.now()}_${Math.random()}`;\n \n // 중복 등록 방지\n if (pipeline.has(handlerId)) {\n console.warn(`Handler with id ${handlerId} already exists`);\n return () => {};\n }\n \n pipeline.set(handlerId, { handler, config });\n \n // 우선순위로 정렬\n this.sortPipeline(action);\n \n // unregister 함수 반환\n return () => {\n pipeline.delete(handlerId);\n };\n }\n\n // Atom setter 등록\n registerAtomSetter(name: string, setter: Function) {\n this.atomSetters.set(name, setter);\n }\n\n // 파이프라인 실행 - void 타입을 위한 오버로드\n async dispatch<K extends keyof T>(\n action: T[K] extends void ? K : never\n ): Promise<void>;\n async dispatch<K extends keyof T>(\n action: K,\n payload: T[K]\n ): Promise<void>;\n async dispatch<K extends keyof T>(\n action: K,\n payload?: T[K]\n ): Promise<void> {\n const pipeline = this.pipelines.get(action);\n \n if (!pipeline || pipeline.size === 0) {\n console.warn(`No handlers registered for action: ${String(action)}`);\n return;\n }\n \n let modifiedPayload = payload as T[K];\n const handlers = Array.from(pipeline.values());\n \n for (const { handler, config } of handlers) {\n let shouldContinue = true;\n \n const controller: PipelineController<T[K]> = {\n next: () => { shouldContinue = true; },\n abort: (reason) => {\n shouldContinue = false;\n console.log(`Pipeline aborted: ${reason}`);\n },\n modifyPayload: (modifier) => {\n modifiedPayload = modifier(modifiedPayload);\n }\n };\n \n try {\n if (config.blocking) {\n await handler(modifiedPayload, controller);\n } else {\n handler(modifiedPayload, controller);\n }\n \n if (!shouldContinue) break;\n } catch (error) {\n console.error(`Error in pipeline handler:`, error);\n if (config.blocking) throw error;\n }\n }\n }\n\n private sortPipeline<K extends keyof T>(action: K) {\n const pipeline = this.pipelines.get(action);\n if (!pipeline) return;\n \n const sorted = Array.from(pipeline.entries())\n .sort(([, a], [, b]) => {\n const priorityA = a.config.priority ?? 0;\n const priorityB = b.config.priority ?? 0;\n return priorityB - priorityA; // 높은 우선순위가 먼저\n });\n \n pipeline.clear();\n sorted.forEach(([id, data]) => pipeline.set(id, data));\n }\n}","// 기본 액션 타입 정의\nexport interface BaseActionPayloadMap {\n // 기본 액션들은 여기에 정의\n}\n\n// 액션 타입 추출 헬퍼\nexport type ActionType<T extends Record<string, any>> = keyof T;\nexport type ActionPayload<\n T extends Record<string, any>,\n K extends keyof T\n> = T[K];\n\n// 액션 핸들러 타입\nexport type ActionHandlerMap<T extends Record<string, any>> = {\n [K in keyof T]?: (payload: T[K]) => void | Promise<void>;\n};\n\n// 액션 생성 헬퍼\nexport function createAction<T extends Record<string, any>, K extends keyof T>(\n type: K,\n payload: T[K]\n): { type: K; payload: T[K] } {\n return { type, payload };\n}\n\n// 타입 가드\nexport function isAction<T extends Record<string, any>, K extends keyof T>(\n action: any,\n type: K\n): action is { type: K; payload: T[K] } {\n return action?.type === type;\n}"],"x_google_ignoreList":[0,1,2,3],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;CAAA,SAASA,UAAQ,GAAG;AAClB;AAEA,SAAO,OAAO,UAAUA,YAAU,cAAc,OAAO,UAAU,YAAY,OAAO,OAAO,WAAW,SAAUC,KAAG;AACjH,UAAO,OAAOA;EACf,IAAG,SAAUA,KAAG;AACf,UAAOA,OAAK,cAAc,OAAO,UAAUA,IAAE,gBAAgB,UAAUA,QAAM,OAAO,YAAY,WAAW,OAAOA;EACnH,GAAE,OAAO,QAAQ,aAAa,MAAM,OAAO,QAAQ,aAAa,OAAO,SAASD,UAAQ,EAAE;CAC5F;CACD,OAAO,UAAUA,WAAS,OAAO,QAAQ,aAAa,MAAM,OAAO,QAAQ,aAAa,OAAO;;;;;;CCT/F,IAAIE,6BAAiC;CACrC,SAASC,cAAY,GAAG,GAAG;AACzB,MAAI,YAAYD,UAAQ,EAAE,IAAI,CAAC,EAAG,QAAO;EACzC,IAAI,IAAI,EAAE,OAAO;AACjB,MAAI,KAAK,MAAM,GAAG;GAChB,IAAI,IAAI,EAAE,KAAK,GAAG,KAAK,UAAU;AACjC,OAAI,YAAYA,UAAQ,EAAE,CAAE,QAAO;AACnC,SAAM,IAAI,UAAU;EACrB;AACD,UAAQ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,CAAC,CAAC,IAAI,KAAK,KAAK,SAAS,IAAI,IAAI,KAAK,CAAC;CACvD;AACF;;;;ACnHD,SAAgB,aACdO,MACAC,SAC4B;AAC5B,QAAO;EAAE;EAAM;CAAS;AACzB;AAGD,SAAgB,SACdC,QACAF,MACsC;AACtC,QAAO,QAAQ,SAAS;AACzB"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["context: PipelineContext<T>","createController: (registration: HandlerRegistration<T>, index: number) => PipelineController<T>","logger: Logger","error: any","_typeof","o","_typeof","toPrimitive","toPropertyKey","_defineProperty","logger: Logger","actionKey: string","debounceMs: number","throttleMs: number","event: K","handler: EventHandler<T[K]>","data: T[K]","event?: keyof T","config: ActionRegisterConfig","action: K","payload?: T[K]","context: PipelineContext<T[K]>","metrics: ActionMetrics","error: any","handler: ActionHandler<T[K]>","config: HandlerConfig","registration: HandlerRegistration<T[K]>","_index: number","reason?: string","modifier: (payload: T[K]) => T[K]","priority: number","executedHandlers: HandlerRegistration<T[K]>[]","handler: EventHandler<ActionRegisterEvents<T>[K]>"],"sources":["../src/execution-modes.ts","../../../node_modules/.pnpm/@oxc-project+runtime@0.77.3/node_modules/@oxc-project/runtime/src/helpers/typeof.js","../../../node_modules/.pnpm/@oxc-project+runtime@0.77.3/node_modules/@oxc-project/runtime/src/helpers/toPrimitive.js","../../../node_modules/.pnpm/@oxc-project+runtime@0.77.3/node_modules/@oxc-project/runtime/src/helpers/toPropertyKey.js","../../../node_modules/.pnpm/@oxc-project+runtime@0.77.3/node_modules/@oxc-project/runtime/src/helpers/defineProperty.js","../src/action-guard.ts","../src/ActionRegister.ts"],"sourcesContent":["/**\n * @fileoverview Execution mode implementations for ActionRegister\n * Provides different execution strategies for action pipelines\n */\n\nimport type { \n HandlerRegistration, \n PipelineContext, \n PipelineController\n} from './types.js';\nimport type { Logger } from '@context-action/logger';\n\n/**\n * Execute handlers in sequential mode (one after another)\n * @implements execution-modes\n * @implements sequential-execution\n * @memberof core-concepts\n * @internal\n * @since 1.0.0\n * \n * Executes action handlers sequentially in priority order, supporting flow control,\n * conditional execution, and priority jumping within the pipeline.\n * \n * @template T - The type of the payload being processed\n * @param context - Pipeline execution context with handlers and state\n * @param createController - Factory function for creating pipeline controllers\n * @param logger - Logger instance for tracing execution\n * @returns Promise that resolves when all handlers complete or pipeline aborts\n * \n * Features:\n * - Priority-based execution order (higher priority first)\n * - Support for priority jumping within execution\n * - Conditional handler execution (condition/validation checks)\n * - Blocking/non-blocking handler support\n * - Comprehensive error handling and recovery\n */\nexport async function executeSequential<T>(\n context: PipelineContext<T>,\n createController: (registration: HandlerRegistration<T>, index: number) => PipelineController<T>,\n logger: Logger\n): Promise<void> {\n logger.trace('Executing in sequential mode', {\n handlerCount: context.handlers.length\n });\n\n for (let i = 0; i < context.handlers.length; i++) {\n if (context.aborted) {\n logger.trace('Sequential execution aborted', { \n atIndex: i,\n reason: context.abortReason \n });\n break;\n }\n\n // Handle jump to priority\n if (context.jumpToPriority !== undefined) {\n const jumpIndex = context.handlers.findIndex(\n handler => handler.config.priority === context.jumpToPriority\n );\n if (jumpIndex !== -1 && jumpIndex !== i) {\n logger.trace('Jumping to priority', {\n fromIndex: i,\n toIndex: jumpIndex,\n priority: context.jumpToPriority\n });\n i = jumpIndex - 1; // -1 because loop will increment\n context.jumpToPriority = undefined;\n continue;\n }\n context.jumpToPriority = undefined;\n }\n\n const registration = context.handlers[i];\n context.currentIndex = i;\n\n // Check condition if provided\n if (registration.config.condition && !registration.config.condition()) {\n logger.debug(`Skipping handler '${registration.id}' - condition not met`);\n continue;\n }\n\n // Check validation if provided\n if (registration.config.validation && !registration.config.validation(context.payload)) {\n logger.debug(`Skipping handler '${registration.id}' - validation failed`);\n continue;\n }\n\n const controller = createController(registration, i);\n\n try {\n logger.trace(`Executing handler ${i + 1}/${context.handlers.length}`, {\n handlerId: registration.id,\n priority: registration.config.priority\n });\n\n const result = registration.handler(context.payload, controller);\n\n // Wait for async handlers if they're blocking\n if (registration.config.blocking && result instanceof Promise) {\n logger.trace(`Waiting for blocking handler '${registration.id}'`);\n await result;\n }\n\n logger.trace(`Handler '${registration.id}' completed`);\n\n } catch (error: any) {\n logger.error(`Handler '${registration.id}' threw an error`, error);\n \n if (registration.config.blocking) {\n throw error;\n }\n }\n }\n}\n\n/**\n * Execute handlers in parallel mode (all at once)\n * @internal\n */\nexport async function executeParallel<T>(\n context: PipelineContext<T>,\n createController: (registration: HandlerRegistration<T>, index: number) => PipelineController<T>,\n logger: Logger\n): Promise<void> {\n logger.trace('Executing in parallel mode', {\n handlerCount: context.handlers.length\n });\n\n // Filter handlers that should run\n const runnableHandlers = context.handlers.filter((registration, _index) => {\n // Check condition\n if (registration.config.condition && !registration.config.condition()) {\n logger.debug(`Skipping handler '${registration.id}' - condition not met`);\n return false;\n }\n\n // Check validation\n if (registration.config.validation && !registration.config.validation(context.payload)) {\n logger.debug(`Skipping handler '${registration.id}' - validation failed`);\n return false;\n }\n\n return true;\n });\n\n logger.trace(`Running ${runnableHandlers.length} handlers in parallel`);\n\n // Create promises for all handlers\n const handlerPromises = runnableHandlers.map(async (registration, _index) => {\n const controller = createController(registration, _index);\n \n try {\n logger.trace(`Starting parallel handler '${registration.id}'`);\n \n const result = registration.handler(context.payload, controller);\n \n if (result instanceof Promise) {\n await result;\n }\n \n logger.trace(`Parallel handler '${registration.id}' completed`);\n return { success: true, handlerId: registration.id };\n \n } catch (error: any) {\n logger.error(`Parallel handler '${registration.id}' failed`, error);\n \n if (registration.config.blocking) {\n throw error;\n }\n \n return { success: false, handlerId: registration.id, error };\n }\n });\n\n // Wait for all handlers to complete\n const results = await Promise.allSettled(handlerPromises);\n \n // Check for any rejected blocking handlers\n const failures = results.filter((result, index) => {\n if (result.status === 'rejected') {\n const registration = runnableHandlers[index];\n return registration.config.blocking;\n }\n return false;\n });\n\n if (failures.length > 0) {\n const firstFailure = failures[0] as PromiseRejectedResult;\n throw firstFailure.reason;\n }\n\n logger.trace('Parallel execution completed', {\n successful: results.filter(r => r.status === 'fulfilled').length,\n failed: results.filter(r => r.status === 'rejected').length\n });\n}\n\n/**\n * Execute handlers in race mode (first to complete wins)\n * @internal\n */\nexport async function executeRace<T>(\n context: PipelineContext<T>,\n createController: (registration: HandlerRegistration<T>, index: number) => PipelineController<T>,\n logger: Logger\n): Promise<void> {\n logger.trace('Executing in race mode', {\n handlerCount: context.handlers.length\n });\n\n // Filter handlers that should run\n const runnableHandlers = context.handlers.filter((registration, _index) => {\n // Check condition\n if (registration.config.condition && !registration.config.condition()) {\n logger.debug(`Skipping handler '${registration.id}' - condition not met`);\n return false;\n }\n\n // Check validation\n if (registration.config.validation && !registration.config.validation(context.payload)) {\n logger.debug(`Skipping handler '${registration.id}' - validation failed`);\n return false;\n }\n\n return true;\n });\n\n if (runnableHandlers.length === 0) {\n logger.trace('No runnable handlers for race mode');\n return;\n }\n\n logger.trace(`Racing ${runnableHandlers.length} handlers`);\n\n // Create promises for all handlers\n const handlerPromises = runnableHandlers.map(async (registration, _index) => {\n const controller = createController(registration, _index);\n \n try {\n logger.trace(`Starting race handler '${registration.id}'`);\n \n const result = registration.handler(context.payload, controller);\n \n if (result instanceof Promise) {\n await result;\n }\n \n logger.trace(`Race handler '${registration.id}' completed`);\n return { success: true, handlerId: registration.id, registration };\n \n } catch (error: any) {\n logger.error(`Race handler '${registration.id}' failed`, error);\n return { success: false, handlerId: registration.id, error, registration };\n }\n });\n\n try {\n // Race all handlers\n const winner = await Promise.race(handlerPromises);\n \n logger.debug('Race completed', {\n winner: winner.handlerId,\n success: winner.success\n });\n\n // If the winner failed and was blocking, throw the error\n if (!winner.success && winner.registration?.config.blocking) {\n throw winner.error;\n }\n\n } catch (error: any) {\n logger.error('Race execution failed', error);\n throw error;\n }\n}","function _typeof(o) {\n \"@babel/helpers - typeof\";\n\n return module.exports = _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) {\n return typeof o;\n } : function (o) {\n return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o;\n }, module.exports.__esModule = true, module.exports[\"default\"] = module.exports, _typeof(o);\n}\nmodule.exports = _typeof, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","var _typeof = require(\"./typeof.js\")[\"default\"];\nfunction toPrimitive(t, r) {\n if (\"object\" != _typeof(t) || !t) return t;\n var e = t[Symbol.toPrimitive];\n if (void 0 !== e) {\n var i = e.call(t, r || \"default\");\n if (\"object\" != _typeof(i)) return i;\n throw new TypeError(\"@@toPrimitive must return a primitive value.\");\n }\n return (\"string\" === r ? String : Number)(t);\n}\nmodule.exports = toPrimitive, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","var _typeof = require(\"./typeof.js\")[\"default\"];\nvar toPrimitive = require(\"./toPrimitive.js\");\nfunction toPropertyKey(t) {\n var i = toPrimitive(t, \"string\");\n return \"symbol\" == _typeof(i) ? i : i + \"\";\n}\nmodule.exports = toPropertyKey, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","var toPropertyKey = require(\"./toPropertyKey.js\");\nfunction _defineProperty(e, r, t) {\n return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {\n value: t,\n enumerable: !0,\n configurable: !0,\n writable: !0\n }) : e[r] = t, e;\n}\nmodule.exports = _defineProperty, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","/**\n * @fileoverview Action Guard system for debouncing, throttling and blocking\n * Provides rate limiting and user experience optimization for actions\n */\n\nimport type { Logger } from '@context-action/logger';\n\n/**\n * Action guard state tracking\n * @internal\n */\ninterface GuardState {\n lastExecuted: number;\n debounceTimer?: NodeJS.Timeout;\n throttleTimer?: NodeJS.Timeout;\n isThrottled: boolean;\n}\n\n/**\n * Action Guard system for managing action execution timing\n * @implements action-guard\n * @implements performance-optimization \n * @implements user-experience-optimization\n * @memberof core-concepts\n * @internal\n * @since 1.0.0\n * \n * Provides debouncing, throttling, and blocking mechanisms for action execution\n * to optimize performance and enhance user experience. Manages timing state\n * per action to prevent unnecessary or excessive action invocations.\n * \n * Key Features:\n * - Debouncing: Delay execution until activity stops\n * - Throttling: Limit execution frequency to intervals\n * - Per-action state management with automatic cleanup\n * - Memory leak prevention through proper timer management\n * \n * @example\n * ```typescript\n * const guard = new ActionGuard(logger);\n * \n * // Debounce search input (wait 300ms after typing stops)\n * if (await guard.debounce('search', 300)) {\n * executeSearch(); \n * }\n * \n * // Throttle scroll handler (max once per 100ms)\n * if (guard.throttle('scroll', 100)) {\n * updateScrollPosition();\n * }\n * ```\n */\nexport class ActionGuard {\n private guards = new Map<string, GuardState>();\n private logger: Logger;\n\n constructor(logger: Logger) {\n this.logger = logger;\n }\n\n /**\n * Check if action should be debounced\n * @param actionKey - Unique key for the action\n * @param debounceMs - Debounce delay in milliseconds\n * @returns Promise that resolves when debounce period is complete\n */\n async debounce(actionKey: string, debounceMs: number): Promise<boolean> {\n this.logger.trace(`Checking debounce for '${actionKey}'`, { debounceMs });\n\n let state = this.guards.get(actionKey);\n if (!state) {\n state = {\n lastExecuted: 0,\n isThrottled: false\n };\n this.guards.set(actionKey, state);\n }\n\n // Clear existing debounce timer\n if (state.debounceTimer) {\n clearTimeout(state.debounceTimer);\n this.logger.trace(`Cleared existing debounce timer for '${actionKey}'`);\n }\n\n // Create new debounce promise\n return new Promise((resolve) => {\n state!.debounceTimer = setTimeout(() => {\n this.logger.trace(`Debounce completed for '${actionKey}'`);\n state!.debounceTimer = undefined;\n state!.lastExecuted = Date.now();\n resolve(true);\n }, debounceMs);\n \n this.logger.trace(`Set debounce timer for '${actionKey}'`, { delay: debounceMs });\n });\n }\n\n /**\n * Check if action should be throttled\n * @param actionKey - Unique key for the action\n * @param throttleMs - Throttle delay in milliseconds\n * @returns True if action should proceed, false if throttled\n */\n throttle(actionKey: string, throttleMs: number): boolean {\n this.logger.trace(`Checking throttle for '${actionKey}'`, { throttleMs });\n\n let state = this.guards.get(actionKey);\n if (!state) {\n state = {\n lastExecuted: 0,\n isThrottled: false\n };\n this.guards.set(actionKey, state);\n }\n\n const now = Date.now();\n const timeSinceLastExecution = now - state.lastExecuted;\n\n // If enough time has passed, allow execution\n if (timeSinceLastExecution >= throttleMs) {\n state.lastExecuted = now;\n state.isThrottled = false;\n \n this.logger.trace(`Throttle passed for '${actionKey}'`, {\n timeSinceLastExecution,\n throttleMs\n });\n \n return true;\n }\n\n // If already throttled, don't set another timer\n if (state.isThrottled) {\n this.logger.trace(`Action '${actionKey}' is already throttled`);\n return false;\n }\n\n // Set throttle timer for future execution\n state.isThrottled = true;\n const remainingTime = throttleMs - timeSinceLastExecution;\n \n state.throttleTimer = setTimeout(() => {\n state!.isThrottled = false;\n state!.throttleTimer = undefined;\n this.logger.trace(`Throttle period ended for '${actionKey}'`);\n }, remainingTime);\n\n this.logger.trace(`Action '${actionKey}' throttled`, {\n timeSinceLastExecution,\n remainingTime\n });\n\n return false;\n }\n\n /**\n * Clear all guards for an action\n * @param actionKey - Action key to clear\n */\n clearGuards(actionKey: string): void {\n this.logger.trace(`Clearing guards for '${actionKey}'`);\n \n const state = this.guards.get(actionKey);\n if (state) {\n if (state.debounceTimer) {\n clearTimeout(state.debounceTimer);\n }\n if (state.throttleTimer) {\n clearTimeout(state.throttleTimer);\n }\n this.guards.delete(actionKey);\n \n this.logger.debug(`Cleared guards for '${actionKey}'`);\n }\n }\n\n /**\n * Clear all guards\n */\n clearAll(): void {\n this.logger.trace('Clearing all action guards');\n \n for (const [, state] of this.guards) {\n if (state.debounceTimer) {\n clearTimeout(state.debounceTimer);\n }\n if (state.throttleTimer) {\n clearTimeout(state.throttleTimer);\n }\n }\n \n this.guards.clear();\n this.logger.debug('Cleared all action guards');\n }\n\n /**\n * Get current guard state for debugging\n * @param actionKey - Action key to inspect\n */\n getGuardState(actionKey: string): GuardState | undefined {\n return this.guards.get(actionKey);\n }\n\n /**\n * Get all active guards for debugging\n */\n getAllGuardStates(): Map<string, GuardState> {\n return new Map(this.guards);\n }\n}","/**\n * @fileoverview ActionRegister - Core action pipeline management system\n * Provides type-safe action dispatch with priority-based handler execution\n */\n\nimport {\n ActionPayloadMap,\n ActionHandler,\n HandlerConfig,\n HandlerRegistration,\n PipelineContext,\n PipelineController,\n ActionRegisterConfig,\n UnregisterFunction,\n ActionDispatcher,\n ActionMetrics,\n ActionRegisterEvents,\n EventEmitter,\n EventHandler,\n ExecutionMode,\n} from './types.js';\nimport { Logger, createLogger, getLoggerNameFromEnv, getDebugFromEnv } from '@context-action/logger';\nimport { executeSequential, executeParallel, executeRace } from './execution-modes.js';\nimport { ActionGuard } from './action-guard.js';\n\n/**\n * Simple event emitter implementation for ActionRegister events\n * @internal\n */\nclass SimpleEventEmitter<T extends Record<string, any>> implements EventEmitter<T> {\n private listeners = new Map<keyof T, Set<EventHandler<any>>>();\n\n on<K extends keyof T>(event: K, handler: EventHandler<T[K]>): UnregisterFunction {\n if (!this.listeners.has(event)) {\n this.listeners.set(event, new Set());\n }\n this.listeners.get(event)!.add(handler);\n\n return () => this.off(event, handler);\n }\n\n emit<K extends keyof T>(event: K, data: T[K]): void {\n const eventListeners = this.listeners.get(event);\n if (eventListeners) {\n eventListeners.forEach(handler => {\n try {\n handler(data);\n } catch (error) {\n console.error(`Error in event handler for ${String(event)}:`, error);\n }\n });\n }\n }\n\n off<K extends keyof T>(event: K, handler: EventHandler<T[K]>): void {\n const eventListeners = this.listeners.get(event);\n if (eventListeners) {\n eventListeners.delete(handler);\n if (eventListeners.size === 0) {\n this.listeners.delete(event);\n }\n }\n }\n\n removeAllListeners(event?: keyof T): void {\n if (event) {\n this.listeners.delete(event);\n } else {\n this.listeners.clear();\n }\n }\n}\n\n/**\n * Central action registration and dispatch system\n * @implements action-pipeline-system\n * @implements actionregister \n * @memberof core-concepts\n * \n * Core action pipeline management system with type-safe action dispatch\n * @template T - Action payload map defining available actions and their payload types\n * \n * @example\n * ```typescript\n * interface AppActions extends ActionPayloadMap {\n * increment: void;\n * setCount: number;\n * updateUser: { id: string; name: string };\n * }\n *\n * const actionRegister = new ActionRegister<AppActions>();\n *\n * // Register handlers with priority and configuration\n * actionRegister.register('increment', (_, controller) => {\n * console.log('Incremented');\n * controller.next();\n * }, { priority: 10 });\n *\n * actionRegister.register('setCount', (count, controller) => {\n * console.log(`Count: ${count}`);\n * controller.next();\n * });\n *\n * // Dispatch actions with type safety\n * await actionRegister.dispatch('increment');\n * await actionRegister.dispatch('setCount', 42);\n * ```\n */\nexport class ActionRegister<T extends ActionPayloadMap = ActionPayloadMap> {\n private pipelines = new Map<keyof T, HandlerRegistration<any>[]>();\n private handlerCounter = 0;\n private readonly logger: Logger;\n private readonly events = new SimpleEventEmitter<ActionRegisterEvents<T>>();\n private readonly config: Required<ActionRegisterConfig>;\n private readonly actionGuard: ActionGuard;\n private executionMode: ExecutionMode = 'sequential';\n private actionExecutionModes = new Map<keyof T, ExecutionMode>();\n\n constructor(config: ActionRegisterConfig = {}) {\n // Set defaults for configuration with .env support\n this.config = {\n logger: config.logger || createLogger(config.logLevel),\n logLevel: config.logLevel ?? 3, // ERROR level as default\n name: config.name || getLoggerNameFromEnv(),\n debug: config.debug ?? getDebugFromEnv(),\n defaultExecutionMode: config.defaultExecutionMode ?? 'sequential',\n } as Required<ActionRegisterConfig>;\n\n this.logger = this.config.logger;\n this.actionGuard = new ActionGuard(this.logger);\n this.executionMode = this.config.defaultExecutionMode;\n \n this.logger.trace(`${this.config.name} constructor called`, { config });\n\n if (this.config.debug) {\n this.logger.info(`${this.config.name} initialized`, {\n logLevel: this.config.logLevel,\n debug: this.config.debug,\n defaultExecutionMode: this.executionMode,\n });\n }\n \n this.logger.trace(`${this.config.name} constructor completed`);\n }\n\n /**\n * Register action handler with pipeline\n * @implements action-handler\n * \n * Register a handler for an action in the pipeline\n * @param action - The action name to handle\n * @param handler - The handler function to execute\n * @param config - Optional configuration for the handler\n * @returns Unregister function to remove the handler\n * \n * @example\n * ```typescript\n * const unregister = actionRegister.register('updateUser', \n * async (payload, controller) => {\n * // Validate payload\n * if (!payload.id) {\n * controller.abort('User ID is required');\n * return;\n * }\n * \n * // Process update\n * await updateUserInStore(payload);\n * controller.next();\n * }, \n * { priority: 10, blocking: true }\n * );\n * \n * // Later, remove the handler\n * unregister();\n * ```\n */\n register<K extends keyof T>(\n action: K,\n handler: ActionHandler<T[K]>,\n config: HandlerConfig = {}\n ): UnregisterFunction {\n this.logger.trace(`Registering handler for action '${String(action)}'`, { config });\n \n // Generate unique handler ID\n const handlerId = config.id || `handler_${++this.handlerCounter}`;\n \n this.logger.trace(`Generated handler ID: ${handlerId}`);\n \n // Create handler registration with defaults\n const registration: HandlerRegistration<T[K]> = {\n handler,\n config: {\n priority: config.priority ?? 0,\n id: handlerId,\n blocking: config.blocking ?? false,\n once: config.once ?? false,\n condition: config.condition || (() => true),\n debounce: config.debounce,\n throttle: config.throttle,\n validation: config.validation,\n middleware: config.middleware ?? false,\n } as Required<HandlerConfig>,\n id: handlerId,\n };\n \n this.logger.trace(`Created handler registration`, { registration: { id: handlerId, config: registration.config } });\n\n // Initialize pipeline if it doesn't exist\n if (!this.pipelines.has(action)) {\n this.logger.trace(`Creating new pipeline for action: ${String(action)}`);\n this.pipelines.set(action, []);\n this.logger.debug(`Created pipeline for action: ${String(action)}`);\n }\n\n const pipeline = this.pipelines.get(action)!;\n this.logger.trace(`Current pipeline for '${String(action)}' has ${pipeline.length} handlers`);\n \n // Check for duplicate handler IDs\n if (pipeline.some(reg => reg.id === handlerId)) {\n this.logger.warn(`Handler with ID '${handlerId}' already exists for action '${String(action)}'`);\n this.logger.trace(`Duplicate handler registration aborted`);\n return () => {}; // Return no-op unregister function\n }\n\n // Add handler to pipeline\n pipeline.push(registration);\n this.logger.trace(`Added handler to pipeline, current length: ${pipeline.length}`);\n \n // Sort pipeline by priority (highest first)\n pipeline.sort((a, b) => b.config.priority - a.config.priority);\n this.logger.trace(`Pipeline sorted by priority`, { \n priorities: pipeline.map(reg => ({ id: reg.id, priority: reg.config.priority })) \n });\n\n this.logger.debug(`Registered handler for action '${String(action)}'`, {\n handlerId,\n priority: registration.config.priority,\n blocking: registration.config.blocking,\n once: registration.config.once,\n });\n\n // Emit registration event\n this.events.emit('handler:register', {\n action,\n handlerId,\n config: registration.config,\n });\n\n // Return unregister function\n return () => {\n this.logger.trace(`Unregistering handler '${handlerId}' from action '${String(action)}'`);\n const index = pipeline.findIndex(reg => reg.id === handlerId);\n if (index !== -1) {\n pipeline.splice(index, 1);\n this.logger.debug(`Unregistered handler '${handlerId}' from action '${String(action)}'`);\n this.logger.trace(`Pipeline now has ${pipeline.length} handlers`);\n \n // Emit unregistration event\n this.events.emit('handler:unregister', {\n action,\n handlerId,\n });\n } else {\n this.logger.trace(`Handler '${handlerId}' not found in pipeline for unregistration`);\n }\n };\n }\n\n /**\n * Dispatch action through pipeline\n * @implements action-dispatcher\n * \n * Dispatch an action through the pipeline\n * Overloaded to provide type safety for actions with and without payloads\n */\n dispatch: ActionDispatcher<T> = async <K extends keyof T>(\n action: K,\n payload?: T[K]\n ): Promise<void> => {\n const startTime = Date.now();\n this.logger.trace(`Starting dispatch for action '${String(action)}'`, { \n action, \n payload, \n startTime \n });\n \n // Emit action start event\n this.events.emit('action:start', { action, payload });\n this.logger.trace(`Emitted 'action:start' event`);\n\n this.logger.debug(`Dispatching action '${String(action)}'`, { payload });\n\n const pipeline = this.pipelines.get(action);\n if (!pipeline || pipeline.length === 0) {\n this.logger.warn(`No handlers registered for action '${String(action)}'`);\n this.logger.trace(`Dispatch completed early - no handlers`);\n return;\n }\n \n this.logger.trace(`Found ${pipeline.length} handlers for action '${String(action)}'`, {\n handlerIds: pipeline.map(reg => reg.id)\n });\n\n // Determine execution mode for this action\n const currentExecutionMode = this.actionExecutionModes.get(action) || this.executionMode;\n\n // Create pipeline execution context\n const context: PipelineContext<T[K]> = {\n action: String(action),\n payload: payload as T[K],\n handlers: [...pipeline], // Copy handlers to avoid modification during execution\n aborted: false,\n abortReason: undefined,\n currentIndex: 0,\n jumpToPriority: undefined,\n executionMode: currentExecutionMode,\n };\n\n try {\n await this.executePipeline(context);\n \n // Create success metrics\n const metrics: ActionMetrics = {\n action: String(action),\n executionTime: Date.now() - startTime,\n handlerCount: context.handlers.length,\n success: !context.aborted,\n timestamp: Date.now(),\n };\n\n if (context.aborted) {\n metrics.error = context.abortReason;\n this.events.emit('action:abort', {\n action,\n payload,\n reason: context.abortReason,\n });\n } else {\n this.events.emit('action:complete', {\n action,\n payload,\n metrics,\n });\n }\n\n this.logger.debug(`Completed action '${String(action)}'`, metrics);\n\n } catch (error: any) {\n const metrics: ActionMetrics = {\n action: String(action),\n executionTime: Date.now() - startTime,\n handlerCount: context.handlers.length,\n success: false,\n error: error.message || 'Unknown error',\n timestamp: Date.now(),\n };\n\n this.logger.error(`Error executing action '${String(action)}'`, metrics);\n \n this.events.emit('action:error', {\n action,\n payload,\n error: error instanceof Error ? error : new Error(String(error)),\n });\n\n throw error;\n }\n };\n\n /**\n * Execute the pipeline with proper flow control\n * @internal\n */\n private async executePipeline<K extends keyof T>(context: PipelineContext<T[K]>): Promise<void> {\n this.logger.trace(`Starting pipeline execution`, {\n action: context.action,\n handlerCount: context.handlers.length,\n executionMode: context.executionMode,\n payload: context.payload\n });\n\n // Create controller factory for handlers\n const createController = (registration: HandlerRegistration<T[K]>, _index: number): PipelineController<T[K]> => {\n return {\n next: () => {\n // Next is called automatically after handler completion\n },\n abort: (reason?: string) => {\n this.logger.trace(`Handler '${registration.id}' is aborting pipeline`, { reason });\n context.aborted = true;\n context.abortReason = reason;\n this.logger.warn(`Pipeline aborted by handler '${registration.id}'`, { reason });\n },\n modifyPayload: (modifier: (payload: T[K]) => T[K]) => {\n this.logger.trace(`Handler '${registration.id}' is modifying payload`);\n const oldPayload = context.payload;\n context.payload = modifier(context.payload);\n this.logger.debug(`Payload modified by handler '${registration.id}'`);\n this.logger.trace(`Payload change`, { oldPayload, newPayload: context.payload });\n },\n getPayload: () => context.payload,\n jumpToPriority: (priority: number) => {\n this.logger.trace(`Handler '${registration.id}' jumping to priority ${priority}`);\n context.jumpToPriority = priority;\n },\n };\n };\n\n // Execute based on execution mode\n switch (context.executionMode) {\n case 'sequential':\n await executeSequential(context, createController, this.logger);\n break;\n case 'parallel':\n await executeParallel(context, createController, this.logger);\n break;\n case 'race':\n await executeRace(context, createController, this.logger);\n break;\n default:\n throw new Error(`Unknown execution mode: ${context.executionMode}`);\n }\n\n // Clean up one-time handlers after execution\n this.cleanupOneTimeHandlers(context.action as K, context.handlers);\n }\n\n /**\n * Clean up one-time handlers after pipeline execution\n * @internal\n */\n private cleanupOneTimeHandlers<K extends keyof T>(action: K, executedHandlers: HandlerRegistration<T[K]>[]): void {\n const pipeline = this.pipelines.get(action);\n if (!pipeline) return;\n\n const oneTimeHandlers = executedHandlers.filter(reg => reg.config.once);\n if (oneTimeHandlers.length === 0) return;\n\n this.logger.trace(`Cleaning up ${oneTimeHandlers.length} one-time handlers`);\n\n oneTimeHandlers.forEach(registration => {\n const index = pipeline.findIndex(reg => reg.id === registration.id);\n if (index !== -1) {\n pipeline.splice(index, 1);\n this.logger.debug(`Removed one-time handler '${registration.id}'`);\n }\n });\n\n this.logger.trace(`Pipeline now has ${pipeline.length} handlers`);\n }\n\n /**\n * Get the number of handlers registered for an action\n * @param action - The action to check\n * @returns Number of handlers registered\n */\n getHandlerCount<K extends keyof T>(action: K): number {\n const pipeline = this.pipelines.get(action);\n const count = pipeline ? pipeline.length : 0;\n this.logger.trace(`Handler count for '${String(action)}': ${count}`);\n return count;\n }\n\n /**\n * Check if any handlers are registered for an action\n * @param action - The action to check\n * @returns True if handlers are registered\n */\n hasHandlers<K extends keyof T>(action: K): boolean {\n const hasHandlers = this.getHandlerCount(action) > 0;\n this.logger.trace(`Has handlers for '${String(action)}': ${hasHandlers}`);\n return hasHandlers;\n }\n\n /**\n * Get all registered action names\n * @returns Array of action names\n */\n getRegisteredActions(): (keyof T)[] {\n const actions = Array.from(this.pipelines.keys());\n this.logger.trace(`Registered actions`, { actions, count: actions.length });\n return actions;\n }\n\n /**\n * Clear all handlers for a specific action\n * @param action - The action to clear\n */\n clearAction<K extends keyof T>(action: K): void {\n this.logger.trace(`Clearing handlers for action '${String(action)}'`);\n const pipeline = this.pipelines.get(action);\n if (pipeline) {\n const handlerCount = pipeline.length;\n this.pipelines.delete(action);\n this.logger.debug(`Cleared ${handlerCount} handlers for action '${String(action)}'`);\n this.logger.trace(`Action '${String(action)}' pipeline removed`);\n } else {\n this.logger.trace(`No pipeline found for action '${String(action)}' to clear`);\n }\n }\n\n /**\n * Clear all handlers for all actions\n */\n clearAll(): void {\n this.logger.trace(`Clearing all handlers and pipelines`);\n const actionCount = this.pipelines.size;\n const totalHandlers = Array.from(this.pipelines.values())\n .reduce((sum, pipeline) => sum + pipeline.length, 0);\n \n this.logger.trace(`Before clear`, { actionCount, totalHandlers });\n \n this.pipelines.clear();\n this.events.removeAllListeners();\n \n this.logger.info(`Cleared all handlers`, {\n actionCount,\n totalHandlers,\n });\n \n this.logger.trace(`All pipelines and event listeners cleared`);\n }\n\n /**\n * Add event listener for ActionRegister events\n * @param event - Event name to listen for\n * @param handler - Event handler function\n * @returns Unregister function to remove the listener\n */\n on<K extends keyof ActionRegisterEvents<T>>(\n event: K,\n handler: EventHandler<ActionRegisterEvents<T>[K]>\n ): UnregisterFunction {\n return this.events.on(event, handler);\n }\n\n /**\n * Remove event listener\n * @param event - Event name\n * @param handler - Event handler to remove\n */\n off<K extends keyof ActionRegisterEvents<T>>(\n event: K,\n handler: EventHandler<ActionRegisterEvents<T>[K]>\n ): void {\n this.events.off(event, handler);\n }\n\n /**\n * Get current configuration\n * @returns Current ActionRegister configuration\n */\n getConfig(): Readonly<Required<ActionRegisterConfig>> {\n return { ...this.config };\n }\n\n /**\n * Get logger instance\n * @returns Current logger instance\n */\n getLogger(): Logger {\n return this.logger;\n }\n}"],"x_google_ignoreList":[1,2,3,4],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoCA,eAAsB,kBACpBA,SACAC,kBACAC,QACe;CACf,OAAO,MAAM,gC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AAM,CAAC,QAAQ,EAAE,OAAO,OAAO,CAAC,kBAAkB,CAAC,CAAC;EACjE,OACC,KAAK,OAAO,MAAM,CAAC,8BAA8B,EAAE,OAAO,OAAO,CAAC,UAAU,CAAC,CAAC;CAEjF;;;;CAKD,WAAiB;EACf,KAAK,OAAO,MAAM,CAAC,mCAAmC,CAAC,CAAC;EACxD,MAAM,cAAc,KAAK,UAAU;EACnC,MAAM,gBAAgB,MAAM,KAAK,KAAK,UAAU,QAAQ,CAAC,CACtD,OAAO,CAAC,KAAK,aAAa,MAAM,SAAS,QAAQ,EAAE;EAEtD,KAAK,OAAO,MAAM,CAAC,YAAY,CAAC,EAAE;GAAE;GAAa;EAAe,EAAC;EAEjE,KAAK,UAAU,OAAO;EACtB,KAAK,OAAO,oBAAoB;EAEhC,KAAK,OAAO,KAAK,CAAC,oBAAoB,CAAC,EAAE;GACvC;GACA;EACD,EAAC;EAEF,KAAK,OAAO,MAAM,CAAC,yCAAyC,CAAC,CAAC;CAC/D;;;;;;;CAQD,GACEL,OACAkB,SACoB;AACpB,SAAO,KAAK,OAAO,GAAG,OAAO,QAAQ;CACtC;;;;;;CAOD,IACElB,OACAkB,SACM;EACN,KAAK,OAAO,IAAI,OAAO,QAAQ;CAChC;;;;;CAMD,YAAsD;AACpD,SAAO,EAAE,GAAG,KAAK,OAAQ;CAC1B;;;;;CAMD,YAAoB;AAClB,SAAO,KAAK;CACb;AACF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@context-action/core",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.4",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Type-safe action pipeline management library for JavaScript/TypeScript",
|
|
6
6
|
"main": "dist/index.cjs",
|
|
@@ -24,6 +24,17 @@
|
|
|
24
24
|
"README.ko.md",
|
|
25
25
|
"LICENSE"
|
|
26
26
|
],
|
|
27
|
+
"scripts": {
|
|
28
|
+
"build": "tsdown",
|
|
29
|
+
"build:watch": "tsdown --watch",
|
|
30
|
+
"test": "jest --passWithNoTests",
|
|
31
|
+
"test:watch": "jest --watch",
|
|
32
|
+
"lint": "eslint src --ext .ts",
|
|
33
|
+
"lint:fix": "eslint src --ext .ts --fix",
|
|
34
|
+
"type-check": "tsc --noEmit",
|
|
35
|
+
"clean": "rimraf dist",
|
|
36
|
+
"prepublishOnly": "pnpm run build"
|
|
37
|
+
},
|
|
27
38
|
"keywords": [
|
|
28
39
|
"typescript",
|
|
29
40
|
"javascript",
|
|
@@ -43,6 +54,9 @@
|
|
|
43
54
|
"url": "https://github.com/mineclover/context-action/issues"
|
|
44
55
|
},
|
|
45
56
|
"homepage": "https://github.com/mineclover/context-action#readme",
|
|
57
|
+
"dependencies": {
|
|
58
|
+
"@context-action/logger": "workspace:*"
|
|
59
|
+
},
|
|
46
60
|
"devDependencies": {
|
|
47
61
|
"@types/jest": "^29.5.0",
|
|
48
62
|
"@typescript-eslint/eslint-plugin": "^6.0.0",
|
|
@@ -57,15 +71,5 @@
|
|
|
57
71
|
},
|
|
58
72
|
"engines": {
|
|
59
73
|
"node": ">=18.0.0"
|
|
60
|
-
},
|
|
61
|
-
"scripts": {
|
|
62
|
-
"build": "tsdown",
|
|
63
|
-
"build:watch": "tsdown --watch",
|
|
64
|
-
"test": "jest",
|
|
65
|
-
"test:watch": "jest --watch",
|
|
66
|
-
"lint": "eslint src --ext .ts",
|
|
67
|
-
"lint:fix": "eslint src --ext .ts --fix",
|
|
68
|
-
"type-check": "tsc --noEmit",
|
|
69
|
-
"clean": "rimraf dist"
|
|
70
74
|
}
|
|
71
|
-
}
|
|
75
|
+
}
|