@bluelibs/runner 3.4.2 → 4.0.1
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/AI.md +621 -0
- package/README.md +1024 -577
- package/dist/context.d.ts +4 -8
- package/dist/context.js +5 -12
- package/dist/context.js.map +1 -1
- package/dist/define.d.ts +9 -113
- package/dist/define.js +29 -358
- package/dist/define.js.map +1 -1
- package/dist/definers/defineEvent.d.ts +2 -0
- package/dist/definers/defineEvent.js +23 -0
- package/dist/definers/defineEvent.js.map +1 -0
- package/dist/definers/defineHook.d.ts +6 -0
- package/dist/definers/defineHook.js +24 -0
- package/dist/definers/defineHook.js.map +1 -0
- package/dist/definers/defineOverride.d.ts +14 -0
- package/dist/definers/defineOverride.js +13 -0
- package/dist/definers/defineOverride.js.map +1 -0
- package/dist/definers/defineResource.d.ts +2 -0
- package/dist/definers/defineResource.js +69 -0
- package/dist/definers/defineResource.js.map +1 -0
- package/dist/definers/defineResourceMiddleware.d.ts +2 -0
- package/dist/definers/defineResourceMiddleware.js +42 -0
- package/dist/definers/defineResourceMiddleware.js.map +1 -0
- package/dist/definers/defineTag.d.ts +12 -0
- package/dist/definers/defineTag.js +106 -0
- package/dist/definers/defineTag.js.map +1 -0
- package/dist/definers/defineTask.d.ts +15 -0
- package/dist/definers/defineTask.js +42 -0
- package/dist/definers/defineTask.js.map +1 -0
- package/dist/definers/defineTaskMiddleware.d.ts +2 -0
- package/dist/definers/defineTaskMiddleware.js +42 -0
- package/dist/definers/defineTaskMiddleware.js.map +1 -0
- package/dist/definers/tools.d.ts +45 -0
- package/dist/definers/tools.js +75 -0
- package/dist/definers/tools.js.map +1 -0
- package/dist/defs.d.ts +16 -424
- package/dist/defs.js +26 -38
- package/dist/defs.js.map +1 -1
- package/dist/errors.d.ts +23 -8
- package/dist/errors.js +50 -10
- package/dist/errors.js.map +1 -1
- package/dist/globals/globalEvents.d.ts +15 -39
- package/dist/globals/globalEvents.js +20 -81
- package/dist/globals/globalEvents.js.map +1 -1
- package/dist/globals/globalMiddleware.d.ts +24 -17
- package/dist/globals/globalMiddleware.js +12 -4
- package/dist/globals/globalMiddleware.js.map +1 -1
- package/dist/globals/globalResources.d.ts +13 -28
- package/dist/globals/globalResources.js +15 -7
- package/dist/globals/globalResources.js.map +1 -1
- package/dist/globals/globalTags.d.ts +9 -0
- package/dist/globals/globalTags.js +23 -0
- package/dist/globals/globalTags.js.map +1 -0
- package/dist/globals/middleware/cache.middleware.d.ts +10 -17
- package/dist/globals/middleware/cache.middleware.js +4 -16
- package/dist/globals/middleware/cache.middleware.js.map +1 -1
- package/dist/globals/middleware/requireContext.middleware.d.ts +1 -1
- package/dist/globals/middleware/requireContext.middleware.js +5 -14
- package/dist/globals/middleware/requireContext.middleware.js.map +1 -1
- package/dist/globals/middleware/retry.middleware.d.ts +2 -1
- package/dist/globals/middleware/retry.middleware.js +32 -5
- package/dist/globals/middleware/retry.middleware.js.map +1 -1
- package/dist/globals/middleware/timeout.middleware.d.ts +2 -1
- package/dist/globals/middleware/timeout.middleware.js +31 -5
- package/dist/globals/middleware/timeout.middleware.js.map +1 -1
- package/dist/globals/resources/debug/debug.resource.d.ts +7 -0
- package/dist/globals/resources/debug/debug.resource.js +29 -0
- package/dist/globals/resources/debug/debug.resource.js.map +1 -0
- package/dist/globals/resources/debug/debug.tag.d.ts +2 -0
- package/dist/globals/resources/debug/debug.tag.js +12 -0
- package/dist/globals/resources/debug/debug.tag.js.map +1 -0
- package/dist/globals/resources/debug/debugConfig.resource.d.ts +22 -0
- package/dist/globals/resources/debug/debugConfig.resource.js +20 -0
- package/dist/globals/resources/debug/debugConfig.resource.js.map +1 -0
- package/dist/globals/resources/debug/executionTracker.middleware.d.ts +50 -0
- package/dist/globals/resources/debug/executionTracker.middleware.js +87 -0
- package/dist/globals/resources/debug/executionTracker.middleware.js.map +1 -0
- package/dist/globals/resources/debug/globalEvent.hook.d.ts +27 -0
- package/dist/globals/resources/debug/globalEvent.hook.js +38 -0
- package/dist/globals/resources/debug/globalEvent.hook.js.map +1 -0
- package/dist/globals/resources/debug/hook.hook.d.ts +25 -0
- package/dist/globals/resources/debug/hook.hook.js +42 -0
- package/dist/globals/resources/debug/hook.hook.js.map +1 -0
- package/dist/globals/resources/debug/index.d.ts +6 -0
- package/dist/{types → globals/resources/debug}/index.js +6 -11
- package/dist/globals/resources/debug/index.js.map +1 -0
- package/dist/globals/resources/debug/middleware.hook.d.ts +25 -0
- package/dist/globals/resources/debug/middleware.hook.js +71 -0
- package/dist/globals/resources/debug/middleware.hook.js.map +1 -0
- package/dist/globals/resources/debug/types.d.ts +25 -0
- package/dist/globals/resources/debug/types.js +65 -0
- package/dist/globals/resources/debug/types.js.map +1 -0
- package/dist/globals/resources/debug/utils.d.ts +2 -0
- package/dist/globals/resources/debug/utils.js +9 -0
- package/dist/globals/resources/debug/utils.js.map +1 -0
- package/dist/globals/resources/queue.resource.d.ts +3 -3
- package/dist/globals/resources/queue.resource.js.map +1 -1
- package/dist/globals/types.d.ts +1 -0
- package/dist/{task.types.js → globals/types.js} +2 -7
- package/dist/globals/types.js.map +1 -0
- package/dist/index.d.ts +58 -85
- package/dist/index.js +23 -10
- package/dist/index.js.map +1 -1
- package/dist/models/DependencyProcessor.d.ts +8 -6
- package/dist/models/DependencyProcessor.js +116 -33
- package/dist/models/DependencyProcessor.js.map +1 -1
- package/dist/models/EventManager.d.ts +127 -7
- package/dist/models/EventManager.js +251 -78
- package/dist/models/EventManager.js.map +1 -1
- package/dist/models/LogPrinter.d.ts +55 -0
- package/dist/models/LogPrinter.js +196 -0
- package/dist/models/LogPrinter.js.map +1 -0
- package/dist/models/Logger.d.ts +47 -27
- package/dist/models/Logger.js +133 -155
- package/dist/models/Logger.js.map +1 -1
- package/dist/models/MiddlewareManager.d.ts +86 -0
- package/dist/models/MiddlewareManager.js +409 -0
- package/dist/models/MiddlewareManager.js.map +1 -0
- package/dist/models/OverrideManager.d.ts +3 -3
- package/dist/models/OverrideManager.js +22 -7
- package/dist/models/OverrideManager.js.map +1 -1
- package/dist/models/ResourceInitializer.d.ts +4 -3
- package/dist/models/ResourceInitializer.js +12 -68
- package/dist/models/ResourceInitializer.js.map +1 -1
- package/dist/models/RunResult.d.ts +35 -0
- package/dist/models/RunResult.js +68 -0
- package/dist/models/RunResult.js.map +1 -0
- package/dist/models/Store.d.ts +30 -17
- package/dist/models/Store.js +87 -25
- package/dist/models/Store.js.map +1 -1
- package/dist/models/StoreRegistry.d.ts +34 -19
- package/dist/models/StoreRegistry.js +248 -100
- package/dist/models/StoreRegistry.js.map +1 -1
- package/dist/models/StoreValidator.d.ts +5 -7
- package/dist/models/StoreValidator.js +50 -17
- package/dist/models/StoreValidator.js.map +1 -1
- package/dist/models/TaskRunner.d.ts +3 -2
- package/dist/models/TaskRunner.js +6 -103
- package/dist/models/TaskRunner.js.map +1 -1
- package/dist/models/UnhandledError.d.ts +11 -0
- package/dist/models/UnhandledError.js +30 -0
- package/dist/models/UnhandledError.js.map +1 -0
- package/dist/models/index.d.ts +3 -0
- package/dist/models/index.js +3 -0
- package/dist/models/index.js.map +1 -1
- package/dist/{tools → models/utils}/findCircularDependencies.js +8 -16
- package/dist/models/utils/findCircularDependencies.js.map +1 -0
- package/dist/models/utils/safeStringify.d.ts +3 -0
- package/dist/models/utils/safeStringify.js +45 -0
- package/dist/models/utils/safeStringify.js.map +1 -0
- package/dist/processHooks.d.ts +2 -0
- package/dist/processHooks.js +70 -0
- package/dist/processHooks.js.map +1 -0
- package/dist/run.d.ts +14 -27
- package/dist/run.js +100 -36
- package/dist/run.js.map +1 -1
- package/dist/testing.d.ts +5 -4
- package/dist/testing.js +3 -2
- package/dist/testing.js.map +1 -1
- package/dist/tools/getCallerFile.d.ts +0 -8
- package/dist/tools/getCallerFile.js +0 -51
- package/dist/tools/getCallerFile.js.map +1 -1
- package/dist/types/contracts.d.ts +55 -0
- package/dist/types/contracts.js +4 -0
- package/dist/types/contracts.js.map +1 -0
- package/dist/types/event.d.ts +26 -7
- package/dist/types/event.js +1 -1
- package/dist/types/event.js.map +1 -1
- package/dist/types/hook.d.ts +21 -0
- package/dist/{models/StoreTypes.js → types/hook.js} +2 -1
- package/dist/types/hook.js.map +1 -0
- package/dist/types/meta.d.ts +6 -1
- package/dist/types/meta.js +4 -2
- package/dist/types/meta.js.map +1 -1
- package/dist/types/resource.d.ts +40 -52
- package/dist/types/resource.js +1 -0
- package/dist/types/resource.js.map +1 -1
- package/dist/types/resourceMiddleware.d.ts +47 -0
- package/dist/{middleware.types.js → types/resourceMiddleware.js} +1 -1
- package/dist/types/resourceMiddleware.js.map +1 -0
- package/dist/types/runner.d.ts +37 -0
- package/dist/types/{base.js → runner.js} +1 -1
- package/dist/types/runner.js.map +1 -0
- package/dist/types/storeTypes.d.ts +40 -0
- package/dist/types/{metadata.js → storeTypes.js} +1 -1
- package/dist/types/storeTypes.js.map +1 -0
- package/dist/types/symbols.d.ts +10 -21
- package/dist/types/symbols.js +17 -22
- package/dist/types/symbols.js.map +1 -1
- package/dist/types/tag.d.ts +46 -0
- package/dist/{resource.types.js → types/tag.js} +2 -1
- package/dist/types/tag.js.map +1 -0
- package/dist/types/task.d.ts +28 -52
- package/dist/types/task.js +1 -0
- package/dist/types/task.js.map +1 -1
- package/dist/types/taskMiddleware.d.ts +48 -0
- package/dist/{event.types.js → types/taskMiddleware.js} +1 -1
- package/dist/types/taskMiddleware.js.map +1 -0
- package/dist/types/utilities.d.ts +105 -6
- package/dist/types/utilities.js +16 -2
- package/dist/types/utilities.js.map +1 -1
- package/package.json +14 -5
- package/dist/cli/extract-docs.d.ts +0 -2
- package/dist/cli/extract-docs.js +0 -88
- package/dist/cli/extract-docs.js.map +0 -1
- package/dist/common.types.d.ts +0 -20
- package/dist/common.types.js +0 -4
- package/dist/common.types.js.map +0 -1
- package/dist/defs/core.d.ts +0 -144
- package/dist/defs/core.js +0 -6
- package/dist/defs/core.js.map +0 -1
- package/dist/defs/symbols.d.ts +0 -42
- package/dist/defs/symbols.js +0 -45
- package/dist/defs/symbols.js.map +0 -1
- package/dist/defs/tags.d.ts +0 -70
- package/dist/defs/tags.js +0 -6
- package/dist/defs/tags.js.map +0 -1
- package/dist/defs.returnTag.d.ts +0 -36
- package/dist/defs.returnTag.js +0 -4
- package/dist/defs.returnTag.js.map +0 -1
- package/dist/docs/introspect.d.ts +0 -7
- package/dist/docs/introspect.js +0 -199
- package/dist/docs/introspect.js.map +0 -1
- package/dist/docs/markdown.d.ts +0 -2
- package/dist/docs/markdown.js +0 -148
- package/dist/docs/markdown.js.map +0 -1
- package/dist/docs/model.d.ts +0 -62
- package/dist/docs/model.js +0 -33
- package/dist/docs/model.js.map +0 -1
- package/dist/event.types.d.ts +0 -18
- package/dist/event.types.js.map +0 -1
- package/dist/examples/express-mongo/index.d.ts +0 -0
- package/dist/examples/express-mongo/index.js +0 -3
- package/dist/examples/express-mongo/index.js.map +0 -1
- package/dist/examples/registrator-example.d.ts +0 -122
- package/dist/examples/registrator-example.js +0 -147
- package/dist/examples/registrator-example.js.map +0 -1
- package/dist/express/docsRouter.d.ts +0 -12
- package/dist/express/docsRouter.js +0 -54
- package/dist/express/docsRouter.js.map +0 -1
- package/dist/globalEvents.d.ts +0 -40
- package/dist/globalEvents.js +0 -94
- package/dist/globalEvents.js.map +0 -1
- package/dist/globalResources.d.ts +0 -10
- package/dist/globalResources.js +0 -43
- package/dist/globalResources.js.map +0 -1
- package/dist/middleware.types.d.ts +0 -40
- package/dist/middleware.types.js.map +0 -1
- package/dist/models/StoreConstants.d.ts +0 -14
- package/dist/models/StoreConstants.js +0 -19
- package/dist/models/StoreConstants.js.map +0 -1
- package/dist/models/StoreTypes.d.ts +0 -21
- package/dist/models/StoreTypes.js.map +0 -1
- package/dist/models/VarStore.d.ts +0 -17
- package/dist/models/VarStore.js +0 -60
- package/dist/models/VarStore.js.map +0 -1
- package/dist/resource.types.d.ts +0 -31
- package/dist/resource.types.js.map +0 -1
- package/dist/symbols.d.ts +0 -24
- package/dist/symbols.js +0 -29
- package/dist/symbols.js.map +0 -1
- package/dist/t1.d.ts +0 -1
- package/dist/t1.js +0 -13
- package/dist/t1.js.map +0 -1
- package/dist/task.types.d.ts +0 -55
- package/dist/task.types.js.map +0 -1
- package/dist/tools/findCircularDependencies.js.map +0 -1
- package/dist/tools/registratorId.d.ts +0 -4
- package/dist/tools/registratorId.js +0 -40
- package/dist/tools/registratorId.js.map +0 -1
- package/dist/tools/simpleHash.d.ts +0 -9
- package/dist/tools/simpleHash.js +0 -34
- package/dist/tools/simpleHash.js.map +0 -1
- package/dist/types/base-interfaces.d.ts +0 -18
- package/dist/types/base-interfaces.js +0 -6
- package/dist/types/base-interfaces.js.map +0 -1
- package/dist/types/base.d.ts +0 -13
- package/dist/types/base.js.map +0 -1
- package/dist/types/dependencies.d.ts +0 -51
- package/dist/types/dependencies.js +0 -3
- package/dist/types/dependencies.js.map +0 -1
- package/dist/types/dependency-core.d.ts +0 -14
- package/dist/types/dependency-core.js +0 -5
- package/dist/types/dependency-core.js.map +0 -1
- package/dist/types/events.d.ts +0 -52
- package/dist/types/events.js +0 -6
- package/dist/types/events.js.map +0 -1
- package/dist/types/hooks.d.ts +0 -16
- package/dist/types/hooks.js +0 -5
- package/dist/types/hooks.js.map +0 -1
- package/dist/types/index.d.ts +0 -8
- package/dist/types/index.js.map +0 -1
- package/dist/types/metadata.d.ts +0 -75
- package/dist/types/metadata.js.map +0 -1
- package/dist/types/middleware.d.ts +0 -63
- package/dist/types/middleware.js +0 -3
- package/dist/types/middleware.js.map +0 -1
- package/dist/types/registerable.d.ts +0 -10
- package/dist/types/registerable.js +0 -5
- package/dist/types/registerable.js.map +0 -1
- package/dist/types/resources.d.ts +0 -44
- package/dist/types/resources.js +0 -5
- package/dist/types/resources.js.map +0 -1
- package/dist/types/tasks.d.ts +0 -41
- package/dist/types/tasks.js +0 -5
- package/dist/types/tasks.js.map +0 -1
- package/src/__tests__/benchmark/benchmark.test.ts +0 -148
- package/src/__tests__/benchmark/task-benchmark.test.ts +0 -132
- package/src/__tests__/context.test.ts +0 -91
- package/src/__tests__/createTestResource.test.ts +0 -139
- package/src/__tests__/errors.test.ts +0 -341
- package/src/__tests__/globalEvents.test.ts +0 -542
- package/src/__tests__/globals/cache.middleware.test.ts +0 -772
- package/src/__tests__/globals/queue.resource.test.ts +0 -141
- package/src/__tests__/globals/requireContext.middleware.test.ts +0 -98
- package/src/__tests__/globals/retry.middleware.test.ts +0 -157
- package/src/__tests__/globals/timeout.middleware.test.ts +0 -88
- package/src/__tests__/index.helper.test.ts +0 -55
- package/src/__tests__/models/EventManager.test.ts +0 -585
- package/src/__tests__/models/Logger.test.ts +0 -519
- package/src/__tests__/models/Queue.test.ts +0 -189
- package/src/__tests__/models/ResourceInitializer.test.ts +0 -148
- package/src/__tests__/models/Semaphore.test.ts +0 -713
- package/src/__tests__/models/Store.test.ts +0 -227
- package/src/__tests__/models/TaskRunner.test.ts +0 -221
- package/src/__tests__/override.test.ts +0 -104
- package/src/__tests__/recursion/README.md +0 -3
- package/src/__tests__/recursion/a.resource.ts +0 -25
- package/src/__tests__/recursion/b.resource.ts +0 -33
- package/src/__tests__/recursion/c.resource.ts +0 -18
- package/src/__tests__/run.anonymous.test.ts +0 -706
- package/src/__tests__/run.dynamic-register-and-dependencies.test.ts +0 -1185
- package/src/__tests__/run.middleware.test.ts +0 -549
- package/src/__tests__/run.overrides.test.ts +0 -424
- package/src/__tests__/run.test.ts +0 -1040
- package/src/__tests__/setOutput.test.ts +0 -244
- package/src/__tests__/tags.test.ts +0 -396
- package/src/__tests__/tools/findCircularDependencies.test.ts +0 -217
- package/src/__tests__/tools/getCallerFile.test.ts +0 -179
- package/src/__tests__/typesafety.test.ts +0 -423
- package/src/__tests__/validation-edge-cases.test.ts +0 -111
- package/src/__tests__/validation-interface.test.ts +0 -428
- package/src/context.ts +0 -86
- package/src/define.ts +0 -480
- package/src/defs.returnTag.ts +0 -91
- package/src/defs.ts +0 -596
- package/src/errors.ts +0 -105
- package/src/globals/globalEvents.ts +0 -125
- package/src/globals/globalMiddleware.ts +0 -16
- package/src/globals/globalResources.ts +0 -53
- package/src/globals/middleware/cache.middleware.ts +0 -115
- package/src/globals/middleware/requireContext.middleware.ts +0 -36
- package/src/globals/middleware/retry.middleware.ts +0 -56
- package/src/globals/middleware/timeout.middleware.ts +0 -46
- package/src/globals/resources/queue.resource.ts +0 -34
- package/src/index.ts +0 -39
- package/src/models/DependencyProcessor.ts +0 -257
- package/src/models/EventManager.ts +0 -210
- package/src/models/Logger.ts +0 -282
- package/src/models/OverrideManager.ts +0 -79
- package/src/models/Queue.ts +0 -66
- package/src/models/ResourceInitializer.ts +0 -165
- package/src/models/Semaphore.ts +0 -208
- package/src/models/Store.ts +0 -193
- package/src/models/StoreConstants.ts +0 -18
- package/src/models/StoreRegistry.ts +0 -253
- package/src/models/StoreTypes.ts +0 -47
- package/src/models/StoreValidator.ts +0 -43
- package/src/models/TaskRunner.ts +0 -203
- package/src/models/index.ts +0 -8
- package/src/run.ts +0 -116
- package/src/testing.ts +0 -66
- package/src/tools/findCircularDependencies.ts +0 -69
- package/src/tools/getCallerFile.ts +0 -96
- /package/dist/{tools → models/utils}/findCircularDependencies.d.ts +0 -0
package/dist/resource.types.d.ts
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { IResourceMeta } from "./common.types";
|
|
2
|
-
import { RegisterableItems } from "./task.types";
|
|
3
|
-
import { MiddlewareAttachments } from "./middleware.types";
|
|
4
|
-
import { IEventDefinition } from "./event.types";
|
|
5
|
-
export interface IResourceDefinition<TConfig = any, TValue = unknown, TDependencies extends import("./task.types").DependencyMapType = {}, TContext = any, THooks = any, TRegisterableItems = any> {
|
|
6
|
-
id: string;
|
|
7
|
-
dependencies?: TDependencies | ((config: TConfig) => TDependencies);
|
|
8
|
-
register?: Array<RegisterableItems> | ((config: TConfig) => Array<RegisterableItems>);
|
|
9
|
-
init?: (this: any, config: TConfig, dependencies: import("./task.types").DependencyValuesType<TDependencies>, context: TContext) => Promise<TValue>;
|
|
10
|
-
dispose?: (this: any, value: TValue, config: TConfig, dependencies: import("./task.types").DependencyValuesType<TDependencies>, context: TContext) => Promise<void>;
|
|
11
|
-
meta?: IResourceMeta;
|
|
12
|
-
overrides?: Array<IResource | import("./task.types").ITask | import("./middleware.types").IMiddleware | IResourceWithConfig>;
|
|
13
|
-
middleware?: MiddlewareAttachments[];
|
|
14
|
-
context?: () => TContext;
|
|
15
|
-
}
|
|
16
|
-
export interface IResource<TConfig = void, TValue = any, TDependencies extends import("./task.types").DependencyMapType = any, TContext = any> extends IResourceDefinition<TConfig, TValue, TDependencies, TContext> {
|
|
17
|
-
with(config: TConfig): IResourceWithConfig<TConfig, TValue, TDependencies>;
|
|
18
|
-
register: Array<RegisterableItems> | ((config: TConfig) => Array<RegisterableItems>);
|
|
19
|
-
events: {
|
|
20
|
-
beforeInit: IEventDefinition<import("./task.types").BeforeInitEventPayload<TConfig>>;
|
|
21
|
-
afterInit: IEventDefinition<import("./task.types").AfterInitEventPayload<TConfig, TValue>>;
|
|
22
|
-
onError: IEventDefinition<import("./task.types").OnErrorEventPayload>;
|
|
23
|
-
};
|
|
24
|
-
overrides: Array<IResource | import("./task.types").ITask | import("./middleware.types").IMiddleware | IResourceWithConfig>;
|
|
25
|
-
middleware: MiddlewareAttachments[];
|
|
26
|
-
}
|
|
27
|
-
export interface IResourceWithConfig<TConfig = any, TValue = any, TDependencies extends import("./task.types").DependencyMapType = any> {
|
|
28
|
-
id: string;
|
|
29
|
-
resource: IResource<TConfig, TValue, TDependencies>;
|
|
30
|
-
config: TConfig;
|
|
31
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"resource.types.js","sourceRoot":"","sources":["../src/resource.types.ts"],"names":[],"mappings":""}
|
package/dist/symbols.d.ts
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
export declare const symbolTask: unique symbol;
|
|
2
|
-
export declare const symbolResource: unique symbol;
|
|
3
|
-
export declare const symbolResourceWithConfig: unique symbol;
|
|
4
|
-
export declare const symbolEvent: unique symbol;
|
|
5
|
-
export declare const symbolMiddleware: unique symbol;
|
|
6
|
-
export declare const symbolMiddlewareConfigured: unique symbol;
|
|
7
|
-
export declare const symbolMiddlewareGlobal: unique symbol;
|
|
8
|
-
export declare const symbolMiddlewareEverywhereTasks: unique symbol;
|
|
9
|
-
export declare const symbolMiddlewareEverywhereResources: unique symbol;
|
|
10
|
-
export declare const symbolFilePath: unique symbol;
|
|
11
|
-
export declare const symbolDispose: unique symbol;
|
|
12
|
-
export declare const symbolStore: unique symbol;
|
|
13
|
-
export declare const symbols: {
|
|
14
|
-
task: symbol;
|
|
15
|
-
resource: symbol;
|
|
16
|
-
resourceWithConfig: symbol;
|
|
17
|
-
event: symbol;
|
|
18
|
-
middleware: symbol;
|
|
19
|
-
middlewareEverywhereTasks: symbol;
|
|
20
|
-
middlewareEverywhereResources: symbol;
|
|
21
|
-
filePath: symbol;
|
|
22
|
-
dispose: symbol;
|
|
23
|
-
store: symbol;
|
|
24
|
-
};
|
package/dist/symbols.js
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// Symbol constants
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.symbols = exports.symbolStore = exports.symbolDispose = exports.symbolFilePath = exports.symbolMiddlewareEverywhereResources = exports.symbolMiddlewareEverywhereTasks = exports.symbolMiddlewareGlobal = exports.symbolMiddlewareConfigured = exports.symbolMiddleware = exports.symbolEvent = exports.symbolResourceWithConfig = exports.symbolResource = exports.symbolTask = void 0;
|
|
5
|
-
exports.symbolTask = Symbol("runner.task");
|
|
6
|
-
exports.symbolResource = Symbol("runner.resource");
|
|
7
|
-
exports.symbolResourceWithConfig = Symbol("runner.resourceWithConfig");
|
|
8
|
-
exports.symbolEvent = Symbol("runner.event");
|
|
9
|
-
exports.symbolMiddleware = Symbol("runner.middleware");
|
|
10
|
-
exports.symbolMiddlewareConfigured = Symbol("runner.middlewareConfigured");
|
|
11
|
-
exports.symbolMiddlewareGlobal = Symbol("runner.middlewareGlobal");
|
|
12
|
-
exports.symbolMiddlewareEverywhereTasks = Symbol("runner.middlewareGlobalTasks");
|
|
13
|
-
exports.symbolMiddlewareEverywhereResources = Symbol("runner.middlewareGlobalResources");
|
|
14
|
-
exports.symbolFilePath = Symbol("runner.filePath");
|
|
15
|
-
exports.symbolDispose = Symbol("runner.dispose");
|
|
16
|
-
exports.symbolStore = Symbol("runner.store");
|
|
17
|
-
exports.symbols = {
|
|
18
|
-
task: exports.symbolTask,
|
|
19
|
-
resource: exports.symbolResource,
|
|
20
|
-
resourceWithConfig: exports.symbolResourceWithConfig,
|
|
21
|
-
event: exports.symbolEvent,
|
|
22
|
-
middleware: exports.symbolMiddleware,
|
|
23
|
-
middlewareEverywhereTasks: exports.symbolMiddlewareEverywhereTasks,
|
|
24
|
-
middlewareEverywhereResources: exports.symbolMiddlewareEverywhereResources,
|
|
25
|
-
filePath: exports.symbolFilePath,
|
|
26
|
-
dispose: exports.symbolDispose,
|
|
27
|
-
store: exports.symbolStore,
|
|
28
|
-
};
|
|
29
|
-
//# sourceMappingURL=symbols.js.map
|
package/dist/symbols.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"symbols.js","sourceRoot":"","sources":["../src/symbols.ts"],"names":[],"mappings":";AAAA,mBAAmB;;;AAEN,QAAA,UAAU,GAAkB,MAAM,CAAC,aAAa,CAAC,CAAC;AAClD,QAAA,cAAc,GAAkB,MAAM,CAAC,iBAAiB,CAAC,CAAC;AAC1D,QAAA,wBAAwB,GAAkB,MAAM,CAAC,2BAA2B,CAAC,CAAC;AAC9E,QAAA,WAAW,GAAkB,MAAM,CAAC,cAAc,CAAC,CAAC;AACpD,QAAA,gBAAgB,GAAkB,MAAM,CAAC,mBAAmB,CAAC,CAAC;AAC9D,QAAA,0BAA0B,GAAkB,MAAM,CAAC,6BAA6B,CAAC,CAAC;AAClF,QAAA,sBAAsB,GAAkB,MAAM,CAAC,yBAAyB,CAAC,CAAC;AAC1E,QAAA,+BAA+B,GAAkB,MAAM,CAAC,8BAA8B,CAAC,CAAC;AACxF,QAAA,mCAAmC,GAAkB,MAAM,CAAC,kCAAkC,CAAC,CAAC;AAChG,QAAA,cAAc,GAAkB,MAAM,CAAC,iBAAiB,CAAC,CAAC;AAC1D,QAAA,aAAa,GAAkB,MAAM,CAAC,gBAAgB,CAAC,CAAC;AACxD,QAAA,WAAW,GAAkB,MAAM,CAAC,cAAc,CAAC,CAAC;AAEpD,QAAA,OAAO,GAAG;IACrB,IAAI,EAAE,kBAAU;IAChB,QAAQ,EAAE,sBAAc;IACxB,kBAAkB,EAAE,gCAAwB;IAC5C,KAAK,EAAE,mBAAW;IAClB,UAAU,EAAE,wBAAgB;IAC5B,yBAAyB,EAAE,uCAA+B;IAC1D,6BAA6B,EAAE,2CAAmC;IAClE,QAAQ,EAAE,sBAAc;IACxB,OAAO,EAAE,qBAAa;IACtB,KAAK,EAAE,mBAAW;CACnB,CAAC"}
|
package/dist/t1.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/dist/t1.js
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const define_1 = require("./define");
|
|
4
|
-
const tag = (0, define_1.defineTag)({ id: "usertag" });
|
|
5
|
-
const tag2 = (0, define_1.defineTag)({ id: "usertag2" });
|
|
6
|
-
const tag3 = (0, define_1.defineTag)({ id: "usertag3" });
|
|
7
|
-
// Preserve as a const tuple for type extraction
|
|
8
|
-
const tags = [tag.with({ value: 123 }), tag2];
|
|
9
|
-
// Build runtime meta by spreading the tuple (meta.tags becomes an array)
|
|
10
|
-
const meta = {
|
|
11
|
-
tags: ["string", tag2, tag3, tag.with({ value: 123 })],
|
|
12
|
-
};
|
|
13
|
-
//# sourceMappingURL=t1.js.map
|
package/dist/t1.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"t1.js","sourceRoot":"","sources":["../src/t1.ts"],"names":[],"mappings":";;AAAA,qCAAqC;AAgBrC,MAAM,GAAG,GAAG,IAAA,kBAAS,EAA2B,EAAE,EAAE,EAAE,SAAS,EAAE,CAAC,CAAC;AACnE,MAAM,IAAI,GAAG,IAAA,kBAAS,EAAe,EAAE,EAAE,EAAE,UAAU,EAAE,CAAC,CAAC;AACzD,MAAM,IAAI,GAAG,IAAA,kBAAS,EAAa,EAAE,EAAE,EAAE,UAAU,EAAE,CAAC,CAAC;AAEvD,gDAAgD;AAChD,MAAM,IAAI,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC,EAAE,IAAI,CAAU,CAAC;AAEvD,yEAAyE;AACzE,MAAM,IAAI,GAAG;IACX,IAAI,EAAE,CAAC,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,GAAG,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC,CAAC;CACvC,CAAC"}
|
package/dist/task.types.d.ts
DELETED
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import { ITaskMeta, DependencyMapType, DependencyValuesType } from "./common.types";
|
|
2
|
-
import { MiddlewareAttachments } from "./middleware.types";
|
|
3
|
-
import { IEvent, IEventDefinition } from "./event.types";
|
|
4
|
-
export type DependencyMapType = Record<string, ITask<any, any, any, any> | IResource<any, any, any> | IEventDefinition<any>>;
|
|
5
|
-
export type ExtractTaskInput<T> = T extends ITask<infer I, any, infer D> ? I : never;
|
|
6
|
-
export type ExtractTaskOutput<T> = T extends ITask<any, infer O, infer D> ? O : never;
|
|
7
|
-
export type ExtractResourceValue<T> = T extends IResource<any, infer V, infer D> ? V : never;
|
|
8
|
-
export type ExtractEventParams<T> = T extends IEventDefinition<infer P> ? P : never;
|
|
9
|
-
export type TaskDependency<I, O> = (...args: I extends null | void ? [] : [I]) => O;
|
|
10
|
-
export type ResourceDependency<V> = V;
|
|
11
|
-
export type EventDependency<P> = (input: P) => Promise<void>;
|
|
12
|
-
export type DependencyValueType<T> = T extends ITask<any, any, any> ? TaskDependency<ExtractTaskInput<T>, ExtractTaskOutput<T>> : T extends IResource<any, any> ? ResourceDependency<ExtractResourceValue<T>> : T extends IEventDefinition<any> ? EventDependency<ExtractEventParams<T>> : never;
|
|
13
|
-
export type DependencyValuesType<T extends DependencyMapType> = {
|
|
14
|
-
[K in keyof T]: DependencyValueType<T[K]>;
|
|
15
|
-
};
|
|
16
|
-
export type RegisterableItems<T = any> = IResourceWithConfig<any> | IResource<void, any, any, any> | IResource<{
|
|
17
|
-
[K in any]?: any;
|
|
18
|
-
}, any, any, any> | ITaskDefinition<any, any, any, any> | IMiddlewareDefinition<any> | IEventDefinition<any>;
|
|
19
|
-
export interface ITaskDefinition<TInput = any, TOutput extends Promise<any> = any, TDependencies extends DependencyMapType = {}, TOn extends "*" | IEventDefinition<any> | undefined = undefined> {
|
|
20
|
-
id: string;
|
|
21
|
-
dependencies?: TDependencies | (() => TDependencies);
|
|
22
|
-
middleware?: MiddlewareAttachments[];
|
|
23
|
-
on?: TOn;
|
|
24
|
-
listenerOrder?: number;
|
|
25
|
-
meta?: ITaskMeta;
|
|
26
|
-
run: (input: TOn extends undefined ? TInput : IEvent<TOn extends "*" ? any : ExtractEventParams<TOn>>, dependencies: DependencyValuesType<TDependencies>) => TOutput;
|
|
27
|
-
}
|
|
28
|
-
export type BeforeRunEventPayload<TInput> = {
|
|
29
|
-
input: TInput;
|
|
30
|
-
};
|
|
31
|
-
export type AfterRunEventPayload<TInput, TOutput> = {
|
|
32
|
-
input: TInput;
|
|
33
|
-
output: TOutput extends Promise<infer U> ? U : TOutput;
|
|
34
|
-
setOutput(newOutput: TOutput extends Promise<infer U> ? U : TOutput): void;
|
|
35
|
-
};
|
|
36
|
-
export type OnErrorEventPayload = {
|
|
37
|
-
error: any;
|
|
38
|
-
suppress(): void;
|
|
39
|
-
};
|
|
40
|
-
export interface ITask<TInput = any, TOutput extends Promise<any> = any, TDependencies extends DependencyMapType = {}, TOn extends "*" | IEventDefinition<any> | undefined = undefined> extends ITaskDefinition<TInput, TOutput, TDependencies, TOn> {
|
|
41
|
-
dependencies: TDependencies | (() => TDependencies);
|
|
42
|
-
computedDependencies?: DependencyValuesType<TDependencies>;
|
|
43
|
-
middleware: MiddlewareAttachments[];
|
|
44
|
-
events: {
|
|
45
|
-
beforeRun: IEventDefinition<BeforeRunEventPayload<TInput>>;
|
|
46
|
-
afterRun: IEventDefinition<AfterRunEventPayload<TInput, TOutput>>;
|
|
47
|
-
onError: IEventDefinition<OnErrorEventPayload>;
|
|
48
|
-
};
|
|
49
|
-
}
|
|
50
|
-
export * from "./task.types";
|
|
51
|
-
export * from "./resource.types";
|
|
52
|
-
export * from "./event.types";
|
|
53
|
-
export * from "./middleware.types";
|
|
54
|
-
export * from "./symbols";
|
|
55
|
-
export * from "./common.types";
|
package/dist/task.types.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"task.types.js","sourceRoot":"","sources":["../src/task.types.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AA+FA,+CAA6B;AAC7B,mDAAiC;AACjC,gDAA8B;AAC9B,qDAAmC;AACnC,4CAA0B;AAC1B,iDAA+B"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"findCircularDependencies.js","sourceRoot":"","sources":["../../src/tools/findCircularDependencies.ts"],"names":[],"mappings":";;AAaA,4DAuDC;AAvDD,SAAgB,wBAAwB,CACtC,KAAuB;IAEvB,MAAM,MAAM,GAAmC;QAC7C,MAAM,EAAE,EAAE;QACV,mBAAmB,EAAE,EAAE;KACxB,CAAC;IACF,MAAM,OAAO,GAAgB,IAAI,GAAG,EAAE,CAAC;IACvC,MAAM,KAAK,GAAgB,IAAI,GAAG,EAAE,CAAC;IACrC,MAAM,IAAI,GAAa,EAAE,CAAC;IAE1B,SAAS,GAAG,CAAC,IAAoB;QAC/B,IAAI,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,CAAC;YACvB,MAAM,eAAe,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;YAC9C,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,eAAe,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;YACvE,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;YAC1B,OAAO;QACT,CAAC;QAED,IAAI,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC;YAAE,OAAO;QAEjC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACrB,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACnB,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QAEnB,IAAI,IAAI,CAAC,YAAY,IAAI,OAAO,IAAI,CAAC,YAAY,KAAK,QAAQ,EAAE,CAAC;YAC/D,KAAK,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,YAAY,CAAC,EAAE,CAAC;gBACxE,IAAI,CAAC,aAAa,EAAE,CAAC;oBACnB,MAAM,CAAC,mBAAmB,CAAC,IAAI,CAAC;wBAC9B,MAAM,EAAE,IAAI,CAAC,EAAE;wBACf,YAAY,EAAE,MAAM;qBACrB,CAAC,CAAC;oBACH,SAAS;gBACX,CAAC;gBACD,GAAG,CAAC,aAAa,CAAC,CAAC;YACrB,CAAC;QACH,CAAC;aAAM,CAAC;YACN,MAAM,CAAC,mBAAmB,CAAC,IAAI,CAAC;gBAC9B,MAAM,EAAE,IAAI,CAAC,EAAE;gBACf,YAAY,EAAE,SAAS;aACxB,CAAC,CAAC;QACL,CAAC;QAED,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACtB,IAAI,CAAC,GAAG,EAAE,CAAC;IACb,CAAC;IAED,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,CAAC;YAC1B,GAAG,CAAC,IAAI,CAAC,CAAC;QACZ,CAAC;IACH,CAAC;IAED,MAAM,CAAC,MAAM,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,0BAA0B;IAC9E,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.generateRegistratorId = generateRegistratorId;
|
|
4
|
-
// Counter to handle multiple registrators in the same file
|
|
5
|
-
let registratorCounter = 0;
|
|
6
|
-
/**
|
|
7
|
-
* Generate a registrator ID based on file path
|
|
8
|
-
*/
|
|
9
|
-
function generateRegistratorId(filePath, explicitId) {
|
|
10
|
-
// If explicit ID is provided, use it
|
|
11
|
-
if (explicitId) {
|
|
12
|
-
return explicitId;
|
|
13
|
-
}
|
|
14
|
-
// Use file path or fallback
|
|
15
|
-
if (!filePath) {
|
|
16
|
-
registratorCounter++;
|
|
17
|
-
return `registrator.unknown.${registratorCounter}`;
|
|
18
|
-
}
|
|
19
|
-
// Extract path from 'src' onwards
|
|
20
|
-
const srcIndex = filePath.lastIndexOf("/src/");
|
|
21
|
-
if (srcIndex !== -1) {
|
|
22
|
-
// Get everything after '/src/'
|
|
23
|
-
let relativePath = filePath.substring(srcIndex + 5);
|
|
24
|
-
// Remove file extension
|
|
25
|
-
relativePath = relativePath.replace(/\.(ts|js)$/, "");
|
|
26
|
-
// Replace path separators with dots
|
|
27
|
-
relativePath = relativePath.replace(/\//g, ".");
|
|
28
|
-
// Add counter to handle multiple registrators in same file
|
|
29
|
-
registratorCounter++;
|
|
30
|
-
return `registrator.${relativePath}.${registratorCounter}`;
|
|
31
|
-
}
|
|
32
|
-
// Fallback: use filename only
|
|
33
|
-
const filename = filePath
|
|
34
|
-
.split("/")
|
|
35
|
-
.pop()
|
|
36
|
-
?.replace(/\.(ts|js)$/, "") || "unknown";
|
|
37
|
-
registratorCounter++;
|
|
38
|
-
return `registrator.${filename}.${registratorCounter}`;
|
|
39
|
-
}
|
|
40
|
-
//# sourceMappingURL=registratorId.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"registratorId.js","sourceRoot":"","sources":["../../src/tools/registratorId.ts"],"names":[],"mappings":";;AAMA,sDAyCC;AA/CD,2DAA2D;AAC3D,IAAI,kBAAkB,GAAG,CAAC,CAAC;AAE3B;;GAEG;AACH,SAAgB,qBAAqB,CACnC,QAA4B,EAC5B,UAAmB;IAEnB,qCAAqC;IACrC,IAAI,UAAU,EAAE,CAAC;QACf,OAAO,UAAU,CAAC;IACpB,CAAC;IAED,4BAA4B;IAC5B,IAAI,CAAC,QAAQ,EAAE,CAAC;QACd,kBAAkB,EAAE,CAAC;QACrB,OAAO,uBAAuB,kBAAkB,EAAE,CAAC;IACrD,CAAC;IAED,kCAAkC;IAClC,MAAM,QAAQ,GAAG,QAAQ,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;IAC/C,IAAI,QAAQ,KAAK,CAAC,CAAC,EAAE,CAAC;QACpB,+BAA+B;QAC/B,IAAI,YAAY,GAAG,QAAQ,CAAC,SAAS,CAAC,QAAQ,GAAG,CAAC,CAAC,CAAC;QAEpD,wBAAwB;QACxB,YAAY,GAAG,YAAY,CAAC,OAAO,CAAC,YAAY,EAAE,EAAE,CAAC,CAAC;QAEtD,oCAAoC;QACpC,YAAY,GAAG,YAAY,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;QAEhD,2DAA2D;QAC3D,kBAAkB,EAAE,CAAC;QACrB,OAAO,eAAe,YAAY,IAAI,kBAAkB,EAAE,CAAC;IAC7D,CAAC;IAED,8BAA8B;IAC9B,MAAM,QAAQ,GACZ,QAAQ;SACL,KAAK,CAAC,GAAG,CAAC;SACV,GAAG,EAAE;QACN,EAAE,OAAO,CAAC,YAAY,EAAE,EAAE,CAAC,IAAI,SAAS,CAAC;IAE7C,kBAAkB,EAAE,CAAC;IACrB,OAAO,eAAe,QAAQ,IAAI,kBAAkB,EAAE,CAAC;AACzD,CAAC"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Simple hash function that generates predictable hashes
|
|
3
|
-
* This is not cryptographically secure but suitable for generating IDs
|
|
4
|
-
*/
|
|
5
|
-
export declare function simpleHash(str: string): string;
|
|
6
|
-
/**
|
|
7
|
-
* Generate a registrator ID based on file path and items count
|
|
8
|
-
*/
|
|
9
|
-
export declare function generateRegistratorId(filePath: string | undefined, itemsCount: number): string;
|
package/dist/tools/simpleHash.js
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.simpleHash = simpleHash;
|
|
4
|
-
exports.generateRegistratorId = generateRegistratorId;
|
|
5
|
-
/**
|
|
6
|
-
* Simple hash function that generates predictable hashes
|
|
7
|
-
* This is not cryptographically secure but suitable for generating IDs
|
|
8
|
-
*/
|
|
9
|
-
function simpleHash(str) {
|
|
10
|
-
let hash = 0;
|
|
11
|
-
if (str.length === 0)
|
|
12
|
-
return hash.toString();
|
|
13
|
-
for (let i = 0; i < str.length; i++) {
|
|
14
|
-
const char = str.charCodeAt(i);
|
|
15
|
-
hash = (hash << 5) - hash + char;
|
|
16
|
-
hash = hash & hash; // Convert to 32bit integer
|
|
17
|
-
}
|
|
18
|
-
// Convert to positive hex string
|
|
19
|
-
const hashStr = Math.abs(hash).toString(16);
|
|
20
|
-
return hashStr.padStart(8, "0");
|
|
21
|
-
}
|
|
22
|
-
/**
|
|
23
|
-
* Generate a registrator ID based on file path and items count
|
|
24
|
-
*/
|
|
25
|
-
function generateRegistratorId(filePath, itemsCount) {
|
|
26
|
-
// Use file path or fallback
|
|
27
|
-
const path = filePath || "unknown";
|
|
28
|
-
// Create a deterministic string to hash
|
|
29
|
-
const hashInput = `registrator:${path}:${itemsCount}`;
|
|
30
|
-
// Generate hash
|
|
31
|
-
const hash = simpleHash(hashInput);
|
|
32
|
-
return `registrator.${hash}`;
|
|
33
|
-
}
|
|
34
|
-
//# sourceMappingURL=simpleHash.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"simpleHash.js","sourceRoot":"","sources":["../../src/tools/simpleHash.ts"],"names":[],"mappings":";;AAIA,gCAaC;AAKD,sDAcC;AApCD;;;GAGG;AACH,SAAgB,UAAU,CAAC,GAAW;IACpC,IAAI,IAAI,GAAG,CAAC,CAAC;IACb,IAAI,GAAG,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,IAAI,CAAC,QAAQ,EAAE,CAAC;IAE7C,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,GAAG,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QACpC,MAAM,IAAI,GAAG,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;QAC/B,IAAI,GAAG,CAAC,IAAI,IAAI,CAAC,CAAC,GAAG,IAAI,GAAG,IAAI,CAAC;QACjC,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC,CAAC,2BAA2B;IACjD,CAAC;IAED,iCAAiC;IACjC,MAAM,OAAO,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;IAC5C,OAAO,OAAO,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;AAClC,CAAC;AAED;;GAEG;AACH,SAAgB,qBAAqB,CACnC,QAA4B,EAC5B,UAAkB;IAElB,4BAA4B;IAC5B,MAAM,IAAI,GAAG,QAAQ,IAAI,SAAS,CAAC;IAEnC,wCAAwC;IACxC,MAAM,SAAS,GAAG,eAAe,IAAI,IAAI,UAAU,EAAE,CAAC;IAEtD,gBAAgB;IAChB,MAAM,IAAI,GAAG,UAAU,CAAC,SAAS,CAAC,CAAC;IAEnC,OAAO,eAAe,IAAI,EAAE,CAAC;AAC/B,CAAC"}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
export interface ITask<TInput = any, TOutput extends Promise<any> = any, TDependencies = any, TOn = any> {
|
|
2
|
-
id: string;
|
|
3
|
-
}
|
|
4
|
-
export interface IResource<TConfig = void, TValue = any, TDependencies = any, TContext = any> {
|
|
5
|
-
id: string;
|
|
6
|
-
}
|
|
7
|
-
export interface IEventDefinition<TPayload = void> {
|
|
8
|
-
id: string;
|
|
9
|
-
}
|
|
10
|
-
export interface IMiddleware<TConfig = any, TDependencies = any> {
|
|
11
|
-
id: string;
|
|
12
|
-
}
|
|
13
|
-
export interface IResourceWithConfig<TConfig = any, TValue = any, TDependencies = any> {
|
|
14
|
-
id: string;
|
|
15
|
-
}
|
|
16
|
-
export interface IMiddlewareConfigured<TConfig = any, TDependencies = any> {
|
|
17
|
-
id: string;
|
|
18
|
-
}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// Layer 2: Core Abstractions - Forward Declarations
|
|
3
|
-
// These are forward declarations only to break circular dependencies
|
|
4
|
-
// They include minimal required properties for dependency system to work
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
//# sourceMappingURL=base-interfaces.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"base-interfaces.js","sourceRoot":"","sources":["../../src/types/base-interfaces.ts"],"names":[],"mappings":";AAAA,oDAAoD;AACpD,qEAAqE;AACrE,yEAAyE"}
|
package/dist/types/base.d.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
export interface IMeta {
|
|
2
|
-
title?: string;
|
|
3
|
-
description?: string;
|
|
4
|
-
tags?: string[];
|
|
5
|
-
}
|
|
6
|
-
export interface ITaskMeta extends IMeta {
|
|
7
|
-
}
|
|
8
|
-
export interface IResourceMeta extends IMeta {
|
|
9
|
-
}
|
|
10
|
-
export interface IEventMeta extends IMeta {
|
|
11
|
-
}
|
|
12
|
-
export interface IMiddlewareMeta extends IMeta {
|
|
13
|
-
}
|
package/dist/types/base.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"base.js","sourceRoot":"","sources":["../../src/types/base.ts"],"names":[],"mappings":""}
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* A mapping of dependency keys to Runner definitions. Used in `dependencies`
|
|
3
|
-
* for tasks and resources. Values are later transformed into the actual
|
|
4
|
-
* callable/value shape by `DependencyValuesType`.
|
|
5
|
-
*/
|
|
6
|
-
export type DependencyMapType = Record<string, any>;
|
|
7
|
-
type ExtractTaskInput<T> = T extends {
|
|
8
|
-
run: (...args: any[]) => any;
|
|
9
|
-
} ? any : never;
|
|
10
|
-
type ExtractTaskOutput<T> = T extends {
|
|
11
|
-
run: (...args: any[]) => infer R;
|
|
12
|
-
} ? R : never;
|
|
13
|
-
type ExtractResourceValue<T> = T extends {
|
|
14
|
-
init?: (...args: any[]) => Promise<infer V>;
|
|
15
|
-
} ? V : T extends {
|
|
16
|
-
init?: (...args: any[]) => infer V;
|
|
17
|
-
} ? V : any;
|
|
18
|
-
type ExtractEventParams<T> = T extends {
|
|
19
|
-
id: any;
|
|
20
|
-
} ? any : never;
|
|
21
|
-
/**
|
|
22
|
-
* Task dependencies transform into callable functions: call with the task input
|
|
23
|
-
* and you receive the task output.
|
|
24
|
-
*/
|
|
25
|
-
export type TaskDependency<I, O> = (...args: I extends null | void ? [] : [I]) => O;
|
|
26
|
-
/**
|
|
27
|
-
* Resource dependencies resolve to the resource's value directly.
|
|
28
|
-
*/
|
|
29
|
-
export type ResourceDependency<V> = V;
|
|
30
|
-
/**
|
|
31
|
-
* Event dependencies resolve to an emitter function. If the payload type is
|
|
32
|
-
* `void`, the function can be called with zero args (or an empty object).
|
|
33
|
-
*/
|
|
34
|
-
export type EventDependency<P> = P extends void ? (() => Promise<void>) & ((input?: Record<string, never>) => Promise<void>) : (input: P) => Promise<void>;
|
|
35
|
-
/**
|
|
36
|
-
* Transforms a dependency definition into the usable shape inside `run`/`init`:
|
|
37
|
-
* - Task -> callable function
|
|
38
|
-
* - Resource -> resolved value
|
|
39
|
-
* - Event -> emit function
|
|
40
|
-
*/
|
|
41
|
-
export type DependencyValueType<T> = T extends {
|
|
42
|
-
run: (...args: any[]) => any;
|
|
43
|
-
} ? TaskDependency<ExtractTaskInput<T>, ExtractTaskOutput<T>> : T extends {
|
|
44
|
-
init?: (...args: any[]) => any;
|
|
45
|
-
} ? ResourceDependency<ExtractResourceValue<T>> : T extends {
|
|
46
|
-
id: any;
|
|
47
|
-
} ? EventDependency<ExtractEventParams<T>> : any;
|
|
48
|
-
export type DependencyValuesType<T extends DependencyMapType> = {
|
|
49
|
-
[K in keyof T]: DependencyValueType<T[K]>;
|
|
50
|
-
};
|
|
51
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"dependencies.js","sourceRoot":"","sources":["../../src/types/dependencies.ts"],"names":[],"mappings":""}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type { ITask, IResource, IEventDefinition } from './base-interfaces';
|
|
2
|
-
export type DependencyMapType = Record<string, ITask<any, any, any, any> | IResource<any, any, any> | IEventDefinition<any>>;
|
|
3
|
-
type ExtractTaskInput<T> = T extends ITask<infer I, any, any, any> ? I : never;
|
|
4
|
-
type ExtractTaskOutput<T> = T extends ITask<any, infer O, any, any> ? O : never;
|
|
5
|
-
type ExtractResourceValue<T> = T extends IResource<any, infer V, any> ? V : never;
|
|
6
|
-
type ExtractEventParams<T> = T extends IEventDefinition<infer P> ? P : never;
|
|
7
|
-
type TaskDependency<I, O> = (...args: I extends null | void ? [] : [I]) => O;
|
|
8
|
-
type ResourceDependency<V> = V;
|
|
9
|
-
type EventDependency<P> = (input: P) => Promise<void>;
|
|
10
|
-
export type DependencyValueType<T> = T extends ITask<any, any, any, any> ? TaskDependency<ExtractTaskInput<T>, ExtractTaskOutput<T>> : T extends IResource<any, any, any> ? ResourceDependency<ExtractResourceValue<T>> : T extends IEventDefinition<any> ? EventDependency<ExtractEventParams<T>> : never;
|
|
11
|
-
export type DependencyValuesType<T extends DependencyMapType> = {
|
|
12
|
-
[K in keyof T]: DependencyValueType<T[K]>;
|
|
13
|
-
};
|
|
14
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"dependency-core.js","sourceRoot":"","sources":["../../src/types/dependency-core.ts"],"names":[],"mappings":";AAAA,iDAAiD;AACjD,2DAA2D"}
|
package/dist/types/events.d.ts
DELETED
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import { symbolEvent } from './symbols';
|
|
2
|
-
import type { IEventMeta } from './meta';
|
|
3
|
-
export interface IEvent<TPayload = any> {
|
|
4
|
-
id: string;
|
|
5
|
-
/**
|
|
6
|
-
* The data that the event carries. It can be anything.
|
|
7
|
-
*/
|
|
8
|
-
data: TPayload;
|
|
9
|
-
/**
|
|
10
|
-
* The timestamp when the event was created.
|
|
11
|
-
*/
|
|
12
|
-
timestamp: Date;
|
|
13
|
-
/**
|
|
14
|
-
* The source of the event. This can be useful for debugging.
|
|
15
|
-
*/
|
|
16
|
-
source: string;
|
|
17
|
-
}
|
|
18
|
-
export type EventHandlerType<T = any> = (event: IEvent<T>) => any | Promise<any>;
|
|
19
|
-
export interface IEventDefinitionConfig<TPayload = void> {
|
|
20
|
-
id: string;
|
|
21
|
-
meta?: IEventMeta;
|
|
22
|
-
}
|
|
23
|
-
export interface IEventDefinition<TPayload = void> {
|
|
24
|
-
id: string;
|
|
25
|
-
/**
|
|
26
|
-
* We use this event to discriminate between resources with just 'id' and 'events' as they collide. This is a workaround, should be redone using classes and instanceof.
|
|
27
|
-
*/
|
|
28
|
-
[symbolEvent]: true;
|
|
29
|
-
meta?: IEventMeta;
|
|
30
|
-
}
|
|
31
|
-
export type BeforeRunEventPayload<TInput> = {
|
|
32
|
-
input: TInput;
|
|
33
|
-
};
|
|
34
|
-
export type AfterRunEventPayload<TInput, TOutput> = {
|
|
35
|
-
input: TInput;
|
|
36
|
-
output: TOutput extends Promise<infer U> ? U : TOutput;
|
|
37
|
-
setOutput(newOutput: TOutput extends Promise<infer U> ? U : TOutput): void;
|
|
38
|
-
};
|
|
39
|
-
export type OnErrorEventPayload = {
|
|
40
|
-
error: any;
|
|
41
|
-
/**
|
|
42
|
-
* This function can be called to suppress the error from being thrown.
|
|
43
|
-
*/
|
|
44
|
-
suppress(): void;
|
|
45
|
-
};
|
|
46
|
-
export type BeforeInitEventPayload<TConfig> = {
|
|
47
|
-
config: TConfig;
|
|
48
|
-
};
|
|
49
|
-
export type AfterInitEventPayload<TConfig, TValue> = {
|
|
50
|
-
config: TConfig;
|
|
51
|
-
value: TValue;
|
|
52
|
-
};
|
package/dist/types/events.js
DELETED
package/dist/types/events.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"events.js","sourceRoot":"","sources":["../../src/types/events.ts"],"names":[],"mappings":";AAAA,0CAA0C;AAC1C,2BAA2B;;AAE3B,uCAAwC"}
|
package/dist/types/hooks.d.ts
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import type { IEventDefinition, IEvent } from './events';
|
|
2
|
-
import type { DependencyMapType, DependencyValuesType } from './dependency-core';
|
|
3
|
-
export interface IHookDefinition<D extends DependencyMapType = {}, T = any, B extends boolean = false> {
|
|
4
|
-
event: "*" | IEventDefinition<T>;
|
|
5
|
-
/**
|
|
6
|
-
* The higher the number, the higher the priority.
|
|
7
|
-
* We recommend using numbers between -1000 and 1000.
|
|
8
|
-
*/
|
|
9
|
-
order?: number;
|
|
10
|
-
/**
|
|
11
|
-
* These are hooks that run before any resource instantiation.
|
|
12
|
-
* @param event
|
|
13
|
-
*/
|
|
14
|
-
early?: B;
|
|
15
|
-
run: (event: IEvent<T>, dependencies: T extends true ? void : DependencyValuesType<D>) => Promise<void> | void;
|
|
16
|
-
}
|
package/dist/types/hooks.js
DELETED
package/dist/types/hooks.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"hooks.js","sourceRoot":"","sources":["../../src/types/hooks.ts"],"names":[],"mappings":";AAAA,qCAAqC;AACrC,4CAA4C"}
|
package/dist/types/index.d.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
export * from './symbols';
|
|
2
|
-
export * from './metadata';
|
|
3
|
-
export * from './dependencies';
|
|
4
|
-
export * from './event';
|
|
5
|
-
export * from './middleware';
|
|
6
|
-
export * from './task';
|
|
7
|
-
export * from './resource';
|
|
8
|
-
export { ICacheInstance } from "../globals/middleware/cache.middleware";
|
package/dist/types/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,UAAU;AACV,4CAA0B;AAE1B,8BAA8B;AAC9B,6CAA2B;AAE3B,eAAe;AACf,iDAA+B;AAE/B,aAAa;AACb,0CAAwB;AACxB,+CAA6B;AAC7B,yCAAuB;AACvB,6CAA2B"}
|
package/dist/types/metadata.d.ts
DELETED
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
export interface ITagDefinition<TConfig = void> {
|
|
2
|
-
id: string | symbol;
|
|
3
|
-
}
|
|
4
|
-
/**
|
|
5
|
-
* A configured instance of a tag as produced by `ITag.with()`.
|
|
6
|
-
*/
|
|
7
|
-
export interface ITagWithConfig<TConfig = void> {
|
|
8
|
-
id: string | symbol;
|
|
9
|
-
/** The tag definition used to produce this configured instance. */
|
|
10
|
-
tag: ITag<TConfig>;
|
|
11
|
-
/** The configuration captured for this tag instance. */
|
|
12
|
-
config: TConfig;
|
|
13
|
-
}
|
|
14
|
-
/**
|
|
15
|
-
* A tag definition (builder). Use `.with(config)` to obtain configured instances,
|
|
16
|
-
* and `.extract(tags)` to find either a configured instance or the bare tag in a list.
|
|
17
|
-
*/
|
|
18
|
-
export interface ITag<TConfig = void> extends ITagDefinition<TConfig> {
|
|
19
|
-
/**
|
|
20
|
-
* Creates a configured instance of the tag.
|
|
21
|
-
*/
|
|
22
|
-
with(config: TConfig): ITagWithConfig<TConfig>;
|
|
23
|
-
/**
|
|
24
|
-
* Extracts either a configured instance or the bare tag from a list of tags
|
|
25
|
-
* or from a taggable object (`{ meta: { tags?: [] } }`).
|
|
26
|
-
*/
|
|
27
|
-
extract(target: TagType[] | ITaggable): ExtractedTagResult<TConfig> | null;
|
|
28
|
-
}
|
|
29
|
-
/**
|
|
30
|
-
* Restrict bare tags to those whose config can be omitted (void or optional object),
|
|
31
|
-
* mirroring the same principle used for resources in `RegisterableItems`.
|
|
32
|
-
* Required-config tags must appear as configured instances.
|
|
33
|
-
*/
|
|
34
|
-
export type TagType = string | ITag<void> | ITag<{
|
|
35
|
-
[K in any]?: any;
|
|
36
|
-
}> | ITagWithConfig<any>;
|
|
37
|
-
/**
|
|
38
|
-
* Conditional result type for `ITag.extract`:
|
|
39
|
-
* - For void config → just the identifier
|
|
40
|
-
* - For optional object config → identifier with optional config
|
|
41
|
-
* - For required config → identifier with required config
|
|
42
|
-
*/
|
|
43
|
-
export type ExtractedTagResult<TConfig> = {} extends TConfig ? {
|
|
44
|
-
id: string | symbol;
|
|
45
|
-
config?: TConfig;
|
|
46
|
-
} : {
|
|
47
|
-
id: string | symbol;
|
|
48
|
-
config: TConfig;
|
|
49
|
-
};
|
|
50
|
-
/**
|
|
51
|
-
* Any object that can carry tags via metadata. This mirrors how tasks,
|
|
52
|
-
* resources, events, and middleware expose `meta.tags`.
|
|
53
|
-
*/
|
|
54
|
-
export interface ITaggable {
|
|
55
|
-
meta?: {
|
|
56
|
-
tags?: TagType[];
|
|
57
|
-
};
|
|
58
|
-
}
|
|
59
|
-
/**
|
|
60
|
-
* Common metadata you can attach to tasks/resources/events/middleware.
|
|
61
|
-
* Useful for docs, filtering and middleware decisions.
|
|
62
|
-
*/
|
|
63
|
-
export interface IMeta {
|
|
64
|
-
title?: string;
|
|
65
|
-
description?: string;
|
|
66
|
-
tags?: TagType[];
|
|
67
|
-
}
|
|
68
|
-
export interface ITaskMeta extends IMeta {
|
|
69
|
-
}
|
|
70
|
-
export interface IResourceMeta extends IMeta {
|
|
71
|
-
}
|
|
72
|
-
export interface IEventMeta extends IMeta {
|
|
73
|
-
}
|
|
74
|
-
export interface IMiddlewareMeta extends IMeta {
|
|
75
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"metadata.js","sourceRoot":"","sources":["../../src/types/metadata.ts"],"names":[],"mappings":""}
|