@zudojs/core 0.1.0 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +141 -7
- package/dist/application/application.d.ts +43 -2
- package/dist/application/application.js +111 -13
- package/dist/application/applicationContext.context.d.ts +27 -1
- package/dist/application/applicationContext.context.js +22 -2
- package/dist/application/createApplication.d.ts +78 -0
- package/dist/application/createApplication.js +109 -0
- package/dist/application/index.d.ts +2 -1
- package/dist/application/index.js +2 -1
- package/dist/configuration/configurationManager.manager.d.ts +42 -0
- package/dist/configuration/configurationManager.manager.js +104 -7
- package/dist/configuration/core/configuration.d.ts +60 -15
- package/dist/configuration/core/configuration.js +248 -51
- package/dist/configuration/core/configurationKey.key.d.ts +4 -2
- package/dist/configuration/core/configurationKey.key.js +2 -13
- package/dist/configuration/core/configurationPath.path.d.ts +17 -0
- package/dist/configuration/core/configurationPath.path.js +33 -0
- package/dist/configuration/core/index.d.ts +7 -1
- package/dist/configuration/core/index.js +1 -0
- package/dist/configuration/error/configurationError.error.d.ts +11 -0
- package/dist/configuration/error/configurationError.error.js +29 -1
- package/dist/configuration/error/configurationRedactor.redactor.d.ts +16 -0
- package/dist/configuration/error/configurationRedactor.redactor.js +83 -5
- package/dist/configuration/error/index.d.ts +2 -1
- package/dist/configuration/error/index.js +2 -1
- package/dist/configuration/index.d.ts +1 -1
- package/dist/configuration/loader/configurationLoader.loader.d.ts +47 -9
- package/dist/configuration/loader/configurationLoader.loader.js +107 -26
- package/dist/configuration/loader/index.d.ts +1 -1
- package/dist/configuration/loader/index.js +1 -1
- package/dist/configuration/registry/configurationProvider.provider.d.ts +26 -1
- package/dist/configuration/registry/configurationProvider.provider.js +33 -7
- package/dist/configuration/registry/configurationRegistry.registry.js +2 -1
- package/dist/configuration/schema/configurationSchema.schema.d.ts +0 -4
- package/dist/configuration/schema/configurationSchema.schema.js +11 -32
- package/dist/configuration/schema/configurationValidation.validator.d.ts +14 -2
- package/dist/configuration/schema/configurationValidation.validator.js +55 -7
- package/dist/configuration/schema/index.d.ts +1 -1
- package/dist/configuration/schema/index.js +1 -1
- package/dist/container/container.d.ts +51 -5
- package/dist/container/container.js +104 -33
- package/dist/container/index.d.ts +1 -1
- package/dist/container/index.js +1 -1
- package/dist/container/scope.d.ts +7 -6
- package/dist/context/core/contextAliases.deprecated.d.ts +32 -0
- package/dist/context/core/contextAliases.deprecated.js +6 -0
- package/dist/context/core/executionContext.context.d.ts +8 -0
- package/dist/context/core/executionContext.context.js +38 -15
- package/dist/context/core/index.d.ts +2 -2
- package/dist/context/core/index.js +2 -2
- package/dist/context/index.d.ts +20 -0
- package/dist/context/index.js +20 -0
- package/dist/context/provider/contextProvider.provider.d.ts +7 -4
- package/dist/context/provider/contextProvider.provider.js +9 -6
- package/dist/context/provider/contextStorage.storage.d.ts +47 -7
- package/dist/context/provider/contextStorage.storage.js +54 -12
- package/dist/context/provider/defaultContextStorage.storage.d.ts +18 -0
- package/dist/context/provider/defaultContextStorage.storage.js +20 -0
- package/dist/context/provider/index.d.ts +2 -1
- package/dist/context/provider/index.js +1 -0
- package/dist/errors/exceptions.d.ts +22 -0
- package/dist/errors/exceptions.js +38 -1
- package/dist/errors/frameworkError.error.d.ts +6 -9
- package/dist/errors/index.d.ts +1 -1
- package/dist/errors/index.js +1 -1
- package/dist/index.d.ts +4 -0
- package/dist/index.js +14 -0
- package/dist/lifecycle/core/index.d.ts +1 -1
- package/dist/lifecycle/core/index.js +1 -1
- package/dist/lifecycle/core/lifecycle.d.ts +47 -2
- package/dist/lifecycle/core/lifecycle.js +251 -85
- package/dist/lifecycle/core/lifecycleRegistry.registry.d.ts +8 -0
- package/dist/lifecycle/core/lifecycleRegistry.registry.js +20 -1
- package/dist/lifecycle/manager/lifecycleManager.manager.d.ts +21 -2
- package/dist/lifecycle/manager/lifecycleManager.manager.js +62 -99
- package/dist/lifecycle/scope/lifecycleScope.scope.d.ts +22 -1
- package/dist/lifecycle/scope/lifecycleScope.scope.js +85 -17
- package/dist/logging/console/consoleLogger.logger.d.ts +20 -1
- package/dist/logging/console/consoleLogger.logger.js +77 -11
- package/dist/logging/console/loggerFactory.factory.d.ts +6 -5
- package/dist/logging/console/loggerFactory.factory.js +1 -7
- package/dist/logging/core/index.d.ts +4 -3
- package/dist/logging/core/index.js +4 -3
- package/dist/logging/core/logEntry.entry.d.ts +41 -3
- package/dist/logging/core/logEntry.entry.js +125 -4
- package/dist/logging/core/logLevel.level.d.ts +18 -0
- package/dist/logging/core/logLevel.level.js +25 -1
- package/dist/logging/core/logRedaction.redaction.d.ts +38 -0
- package/dist/logging/core/logRedaction.redaction.js +19 -0
- package/dist/logging/core/logger.d.ts +14 -11
- package/dist/logging/core/logger.js +31 -6
- package/dist/logging/core/loggerContext.context.d.ts +12 -0
- package/dist/logging/core/loggerContext.context.js +19 -0
- package/dist/logging/core/loggerOptions.options.d.ts +17 -0
- package/dist/modules/index.d.ts +0 -1
- package/dist/modules/index.js +0 -6
- package/dist/modules/module.d.ts +7 -1
- package/dist/modules/moduleContext.context.d.ts +41 -7
- package/dist/modules/moduleContext.context.js +31 -8
- package/dist/modules/moduleDefinition.definition.d.ts +11 -7
- package/dist/modules/moduleDefinition.definition.js +41 -8
- package/dist/modules/moduleDependency/index.d.ts +2 -2
- package/dist/modules/moduleDependency/index.js +1 -1
- package/dist/modules/moduleDependency/moduleDependency.graph.d.ts +19 -2
- package/dist/modules/moduleDependency/moduleDependency.graph.js +122 -8
- package/dist/modules/moduleDependency/moduleDependency.ordering.d.ts +8 -0
- package/dist/modules/moduleDependency/moduleDependency.ordering.js +85 -57
- package/dist/modules/moduleDependency/moduleDependency.type.d.ts +28 -1
- package/dist/modules/moduleError/index.d.ts +1 -1
- package/dist/modules/moduleError/index.js +1 -1
- package/dist/modules/moduleError/moduleError.dependency.d.ts +11 -0
- package/dist/modules/moduleError/moduleError.dependency.js +15 -0
- package/dist/modules/moduleLifecycle/index.d.ts +5 -2
- package/dist/modules/moduleLifecycle/index.js +4 -1
- package/dist/modules/moduleLifecycle/moduleLifecycle.lifecycle.d.ts +73 -10
- package/dist/modules/moduleLifecycle/moduleLifecycle.lifecycle.js +204 -19
- package/dist/modules/moduleLifecycle/moduleLifecycle.stateMachine.d.ts +30 -5
- package/dist/modules/moduleLifecycle/moduleLifecycle.stateMachine.js +130 -10
- package/dist/modules/moduleLifecycle/moduleLifecycle.type.d.ts +78 -28
- package/dist/modules/moduleLifecycle/moduleLifecycle.type.js +15 -4
- package/dist/modules/moduleLoader/moduleLoader.loader.d.ts +39 -5
- package/dist/modules/moduleLoader/moduleLoader.loader.js +168 -59
- package/dist/modules/moduleLoader/moduleLoader.type.d.ts +4 -2
- package/dist/modules/moduleLoader/moduleLoader.type.js +10 -3
- package/dist/modules/moduleMetadata.metadata.js +15 -5
- package/dist/modules/moduleRegistry/index.d.ts +1 -1
- package/dist/modules/moduleRegistry/moduleRegistry.registry.d.ts +2 -2
- package/dist/modules/moduleRegistry/moduleRegistry.registry.js +38 -6
- package/dist/modules/moduleRegistry/moduleRegistry.type.d.ts +18 -1
- package/dist/runtime/index.d.ts +17 -15
- package/dist/runtime/index.js +14 -10
- package/dist/runtime/runtime.d.ts +135 -33
- package/dist/runtime/runtime.js +344 -114
- package/dist/runtime/runtimeBootstrap/index.d.ts +2 -1
- package/dist/runtime/runtimeBootstrap/index.js +1 -1
- package/dist/runtime/runtimeBootstrap/pipeline/index.d.ts +2 -2
- package/dist/runtime/runtimeBootstrap/pipeline/index.js +1 -2
- package/dist/runtime/runtimeBootstrap/pipeline/runtimeBootstrap.pipeline.d.ts +41 -15
- package/dist/runtime/runtimeBootstrap/pipeline/runtimeBootstrap.pipeline.js +111 -76
- package/dist/runtime/runtimeBootstrap/runtimeBootstrap.core.d.ts +7 -4
- package/dist/runtime/runtimeBootstrap/runtimeBootstrap.core.js +87 -59
- package/dist/runtime/runtimeBootstrap/runtimeBootstrap.type.d.ts +10 -4
- package/dist/runtime/runtimeContext/index.d.ts +3 -5
- package/dist/runtime/runtimeContext/index.js +2 -4
- package/dist/runtime/runtimeContext/runtimeContext.factory.d.ts +10 -4
- package/dist/runtime/runtimeContext/runtimeContext.factory.js +30 -7
- package/dist/runtime/runtimeContext/runtimeContext.type.d.ts +36 -47
- package/dist/runtime/runtimeEnvironment/detection/runtimeEnvironment.env.d.ts +5 -0
- package/dist/runtime/runtimeEnvironment/detection/runtimeEnvironment.env.js +6 -4
- package/dist/runtime/runtimeEnvironment/detection/runtimeEnvironment.os.d.ts +4 -0
- package/dist/runtime/runtimeEnvironment/detection/runtimeEnvironment.os.js +7 -9
- package/dist/runtime/runtimeEnvironment/index.d.ts +2 -2
- package/dist/runtime/runtimeEnvironment/index.js +1 -1
- package/dist/runtime/runtimeEnvironment/runtimeEnvironment.core.d.ts +20 -17
- package/dist/runtime/runtimeEnvironment/runtimeEnvironment.core.js +20 -13
- package/dist/runtime/runtimeEnvironment/runtimeEnvironment.type.d.ts +12 -1
- package/dist/runtime/runtimeError/index.d.ts +3 -3
- package/dist/runtime/runtimeError/index.js +1 -1
- package/dist/runtime/runtimeError/runtimeError.base.d.ts +15 -18
- package/dist/runtime/runtimeError/runtimeError.base.js +38 -36
- package/dist/runtime/runtimeError/runtimeError.lifecycle.d.ts +23 -8
- package/dist/runtime/runtimeError/runtimeError.lifecycle.js +31 -7
- package/dist/runtime/runtimeError/runtimeError.specialized.d.ts +1 -1
- package/dist/runtime/runtimeError/runtimeError.specialized.js +1 -1
- package/dist/runtime/runtimeError/runtimeError.type.d.ts +5 -9
- package/dist/runtime/runtimeLogger.d.ts +2 -2
- package/dist/runtime/runtimeLogger.js +3 -3
- package/dist/runtime/runtimeOptions/index.d.ts +1 -1
- package/dist/runtime/runtimeOptions/runtimeOptions.defaults.d.ts +1 -1
- package/dist/runtime/runtimeOptions/runtimeOptions.defaults.js +2 -0
- package/dist/runtime/runtimeOptions/runtimeOptions.resolver.js +13 -2
- package/dist/runtime/runtimeOptions/runtimeOptions.type.d.ts +45 -16
- package/dist/runtime/runtimeOptions/runtimeOptions.validation.js +0 -1
- package/dist/runtime/runtimeShutdown/index.d.ts +3 -2
- package/dist/runtime/runtimeShutdown/index.js +2 -2
- package/dist/runtime/runtimeShutdown/pipeline/index.d.ts +2 -1
- package/dist/runtime/runtimeShutdown/pipeline/index.js +1 -1
- package/dist/runtime/runtimeShutdown/pipeline/runtimeShutdown.pipeline.d.ts +37 -7
- package/dist/runtime/runtimeShutdown/pipeline/runtimeShutdown.pipeline.js +85 -51
- package/dist/runtime/runtimeShutdown/runtimeShutdown.core.d.ts +8 -16
- package/dist/runtime/runtimeShutdown/runtimeShutdown.core.js +85 -87
- package/dist/runtime/runtimeShutdown/runtimeShutdown.type.d.ts +9 -5
- package/dist/runtime/runtimeSignals/index.d.ts +8 -0
- package/dist/runtime/runtimeSignals/index.js +7 -0
- package/dist/runtime/runtimeSignals/runtimeSignals.d.ts +93 -0
- package/dist/runtime/runtimeSignals/runtimeSignals.js +149 -0
- package/dist/runtime/runtimeState.state.d.ts +32 -14
- package/dist/runtime/runtimeState.state.js +34 -27
- package/dist/runtime/runtimeTimeout.d.ts +40 -0
- package/dist/runtime/runtimeTimeout.js +42 -0
- package/package.json +25 -15
- package/dist/.tsbuildinfo +0 -1
- package/dist/application/application.d.ts.map +0 -1
- package/dist/application/application.js.map +0 -1
- package/dist/application/applicationContext.context.d.ts.map +0 -1
- package/dist/application/applicationContext.context.js.map +0 -1
- package/dist/application/applicationState.state.d.ts.map +0 -1
- package/dist/application/applicationState.state.js.map +0 -1
- package/dist/application/index.d.ts.map +0 -1
- package/dist/application/index.js.map +0 -1
- package/dist/configuration/configurationManager.manager.d.ts.map +0 -1
- package/dist/configuration/configurationManager.manager.js.map +0 -1
- package/dist/configuration/core/configuration.d.ts.map +0 -1
- package/dist/configuration/core/configuration.js.map +0 -1
- package/dist/configuration/core/configurationKey.key.d.ts.map +0 -1
- package/dist/configuration/core/configurationKey.key.js.map +0 -1
- package/dist/configuration/core/configurationSource.source.d.ts.map +0 -1
- package/dist/configuration/core/configurationSource.source.js.map +0 -1
- package/dist/configuration/core/index.d.ts.map +0 -1
- package/dist/configuration/core/index.js.map +0 -1
- package/dist/configuration/error/configurationError.error.d.ts.map +0 -1
- package/dist/configuration/error/configurationError.error.js.map +0 -1
- package/dist/configuration/error/configurationRedactor.redactor.d.ts.map +0 -1
- package/dist/configuration/error/configurationRedactor.redactor.js.map +0 -1
- package/dist/configuration/error/index.d.ts.map +0 -1
- package/dist/configuration/error/index.js.map +0 -1
- package/dist/configuration/events/configurationEvents.events.d.ts.map +0 -1
- package/dist/configuration/events/configurationEvents.events.js.map +0 -1
- package/dist/configuration/events/index.d.ts.map +0 -1
- package/dist/configuration/events/index.js.map +0 -1
- package/dist/configuration/index.d.ts.map +0 -1
- package/dist/configuration/index.js.map +0 -1
- package/dist/configuration/loader/configurationLoader.loader.d.ts.map +0 -1
- package/dist/configuration/loader/configurationLoader.loader.js.map +0 -1
- package/dist/configuration/loader/index.d.ts.map +0 -1
- package/dist/configuration/loader/index.js.map +0 -1
- package/dist/configuration/registry/configurationProvider.provider.d.ts.map +0 -1
- package/dist/configuration/registry/configurationProvider.provider.js.map +0 -1
- package/dist/configuration/registry/configurationRegistry.registry.d.ts.map +0 -1
- package/dist/configuration/registry/configurationRegistry.registry.js.map +0 -1
- package/dist/configuration/registry/index.d.ts.map +0 -1
- package/dist/configuration/registry/index.js.map +0 -1
- package/dist/configuration/schema/configurationSchema.schema.d.ts.map +0 -1
- package/dist/configuration/schema/configurationSchema.schema.js.map +0 -1
- package/dist/configuration/schema/configurationValidation.validator.d.ts.map +0 -1
- package/dist/configuration/schema/configurationValidation.validator.js.map +0 -1
- package/dist/configuration/schema/index.d.ts.map +0 -1
- package/dist/configuration/schema/index.js.map +0 -1
- package/dist/container/container.d.ts.map +0 -1
- package/dist/container/container.js.map +0 -1
- package/dist/container/index.d.ts.map +0 -1
- package/dist/container/index.js.map +0 -1
- package/dist/container/provider.d.ts.map +0 -1
- package/dist/container/provider.js.map +0 -1
- package/dist/container/scope.d.ts.map +0 -1
- package/dist/container/scope.js.map +0 -1
- package/dist/container/token.d.ts.map +0 -1
- package/dist/container/token.js.map +0 -1
- package/dist/context/core/context.d.ts +0 -95
- package/dist/context/core/context.d.ts.map +0 -1
- package/dist/context/core/context.js +0 -103
- package/dist/context/core/context.js.map +0 -1
- package/dist/context/core/contextKey.key.d.ts.map +0 -1
- package/dist/context/core/contextKey.key.js.map +0 -1
- package/dist/context/core/executionContext.context.d.ts.map +0 -1
- package/dist/context/core/executionContext.context.js.map +0 -1
- package/dist/context/core/index.d.ts.map +0 -1
- package/dist/context/core/index.js.map +0 -1
- package/dist/context/index.d.ts.map +0 -1
- package/dist/context/index.js.map +0 -1
- package/dist/context/provider/contextProvider.provider.d.ts.map +0 -1
- package/dist/context/provider/contextProvider.provider.js.map +0 -1
- package/dist/context/provider/contextStorage.storage.d.ts.map +0 -1
- package/dist/context/provider/contextStorage.storage.js.map +0 -1
- package/dist/context/provider/index.d.ts.map +0 -1
- package/dist/context/provider/index.js.map +0 -1
- package/dist/context/snapshot/contextSnapshot.snapshot.d.ts.map +0 -1
- package/dist/context/snapshot/contextSnapshot.snapshot.js.map +0 -1
- package/dist/context/snapshot/index.d.ts.map +0 -1
- package/dist/context/snapshot/index.js.map +0 -1
- package/dist/context/values/contextValues.values.d.ts.map +0 -1
- package/dist/context/values/contextValues.values.js.map +0 -1
- package/dist/context/values/index.d.ts.map +0 -1
- package/dist/context/values/index.js.map +0 -1
- package/dist/contracts/adapter.d.ts.map +0 -1
- package/dist/contracts/adapter.js.map +0 -1
- package/dist/contracts/disposable.d.ts.map +0 -1
- package/dist/contracts/disposable.js.map +0 -1
- package/dist/contracts/handler.d.ts.map +0 -1
- package/dist/contracts/handler.js.map +0 -1
- package/dist/contracts/index.d.ts.map +0 -1
- package/dist/contracts/index.js.map +0 -1
- package/dist/errors/errorCode.code.d.ts.map +0 -1
- package/dist/errors/errorCode.code.js.map +0 -1
- package/dist/errors/exceptions.d.ts.map +0 -1
- package/dist/errors/exceptions.js.map +0 -1
- package/dist/errors/frameworkError.error.d.ts.map +0 -1
- package/dist/errors/frameworkError.error.js.map +0 -1
- package/dist/errors/index.d.ts.map +0 -1
- package/dist/errors/index.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/lifecycle/core/index.d.ts.map +0 -1
- package/dist/lifecycle/core/index.js.map +0 -1
- package/dist/lifecycle/core/lifecycle.d.ts.map +0 -1
- package/dist/lifecycle/core/lifecycle.js.map +0 -1
- package/dist/lifecycle/core/lifecycleHook.hook.d.ts.map +0 -1
- package/dist/lifecycle/core/lifecycleHook.hook.js.map +0 -1
- package/dist/lifecycle/core/lifecycleRegistry.registry.d.ts.map +0 -1
- package/dist/lifecycle/core/lifecycleRegistry.registry.js.map +0 -1
- package/dist/lifecycle/core/lifecycleState.state.d.ts +0 -2
- package/dist/lifecycle/core/lifecycleState.state.d.ts.map +0 -1
- package/dist/lifecycle/core/lifecycleState.state.js +0 -2
- package/dist/lifecycle/core/lifecycleState.state.js.map +0 -1
- package/dist/lifecycle/index.d.ts.map +0 -1
- package/dist/lifecycle/index.js.map +0 -1
- package/dist/lifecycle/manager/index.d.ts.map +0 -1
- package/dist/lifecycle/manager/index.js.map +0 -1
- package/dist/lifecycle/manager/lifecycleManager.manager.d.ts.map +0 -1
- package/dist/lifecycle/manager/lifecycleManager.manager.js.map +0 -1
- package/dist/lifecycle/scope/index.d.ts.map +0 -1
- package/dist/lifecycle/scope/index.js.map +0 -1
- package/dist/lifecycle/scope/lifecycleScope.scope.d.ts.map +0 -1
- package/dist/lifecycle/scope/lifecycleScope.scope.js.map +0 -1
- package/dist/logging/console/consoleLogger.logger.d.ts.map +0 -1
- package/dist/logging/console/consoleLogger.logger.js.map +0 -1
- package/dist/logging/console/index.d.ts.map +0 -1
- package/dist/logging/console/index.js.map +0 -1
- package/dist/logging/console/loggerFactory.factory.d.ts.map +0 -1
- package/dist/logging/console/loggerFactory.factory.js.map +0 -1
- package/dist/logging/core/index.d.ts.map +0 -1
- package/dist/logging/core/index.js.map +0 -1
- package/dist/logging/core/logEntry.entry.d.ts.map +0 -1
- package/dist/logging/core/logEntry.entry.js.map +0 -1
- package/dist/logging/core/logLevel.level.d.ts.map +0 -1
- package/dist/logging/core/logLevel.level.js.map +0 -1
- package/dist/logging/core/logger.d.ts.map +0 -1
- package/dist/logging/core/logger.js.map +0 -1
- package/dist/logging/core/loggerContext.context.d.ts.map +0 -1
- package/dist/logging/core/loggerContext.context.js.map +0 -1
- package/dist/logging/core/loggerOptions.options.d.ts.map +0 -1
- package/dist/logging/core/loggerOptions.options.js.map +0 -1
- package/dist/logging/index.d.ts.map +0 -1
- package/dist/logging/index.js.map +0 -1
- package/dist/modules/index.d.ts.map +0 -1
- package/dist/modules/index.js.map +0 -1
- package/dist/modules/module.d.ts.map +0 -1
- package/dist/modules/module.js.map +0 -1
- package/dist/modules/moduleContext.context.d.ts.map +0 -1
- package/dist/modules/moduleContext.context.js.map +0 -1
- package/dist/modules/moduleDefinition.definition.d.ts.map +0 -1
- package/dist/modules/moduleDefinition.definition.js.map +0 -1
- package/dist/modules/moduleDependency/index.d.ts.map +0 -1
- package/dist/modules/moduleDependency/index.js.map +0 -1
- package/dist/modules/moduleDependency/moduleDependency.graph.d.ts.map +0 -1
- package/dist/modules/moduleDependency/moduleDependency.graph.js.map +0 -1
- package/dist/modules/moduleDependency/moduleDependency.ordering.d.ts.map +0 -1
- package/dist/modules/moduleDependency/moduleDependency.ordering.js.map +0 -1
- package/dist/modules/moduleDependency/moduleDependency.type.d.ts.map +0 -1
- package/dist/modules/moduleDependency/moduleDependency.type.js.map +0 -1
- package/dist/modules/moduleError/index.d.ts.map +0 -1
- package/dist/modules/moduleError/index.js.map +0 -1
- package/dist/modules/moduleError/moduleError.base.d.ts.map +0 -1
- package/dist/modules/moduleError/moduleError.base.js.map +0 -1
- package/dist/modules/moduleError/moduleError.dependency.d.ts.map +0 -1
- package/dist/modules/moduleError/moduleError.dependency.js.map +0 -1
- package/dist/modules/moduleError/moduleError.helpers.d.ts.map +0 -1
- package/dist/modules/moduleError/moduleError.helpers.js.map +0 -1
- package/dist/modules/moduleError/moduleError.lifecycle.d.ts.map +0 -1
- package/dist/modules/moduleError/moduleError.lifecycle.js.map +0 -1
- package/dist/modules/moduleError/moduleError.registration.d.ts.map +0 -1
- package/dist/modules/moduleError/moduleError.registration.js.map +0 -1
- package/dist/modules/moduleLifecycle/index.d.ts.map +0 -1
- package/dist/modules/moduleLifecycle/index.js.map +0 -1
- package/dist/modules/moduleLifecycle/moduleLifecycle.lifecycle.d.ts.map +0 -1
- package/dist/modules/moduleLifecycle/moduleLifecycle.lifecycle.js.map +0 -1
- package/dist/modules/moduleLifecycle/moduleLifecycle.stateMachine.d.ts.map +0 -1
- package/dist/modules/moduleLifecycle/moduleLifecycle.stateMachine.js.map +0 -1
- package/dist/modules/moduleLifecycle/moduleLifecycle.type.d.ts.map +0 -1
- package/dist/modules/moduleLifecycle/moduleLifecycle.type.js.map +0 -1
- package/dist/modules/moduleLoader/index.d.ts.map +0 -1
- package/dist/modules/moduleLoader/index.js.map +0 -1
- package/dist/modules/moduleLoader/moduleLoader.loader.d.ts.map +0 -1
- package/dist/modules/moduleLoader/moduleLoader.loader.js.map +0 -1
- package/dist/modules/moduleLoader/moduleLoader.type.d.ts.map +0 -1
- package/dist/modules/moduleLoader/moduleLoader.type.js.map +0 -1
- package/dist/modules/moduleMetadata.metadata.d.ts.map +0 -1
- package/dist/modules/moduleMetadata.metadata.js.map +0 -1
- package/dist/modules/moduleRegistry/index.d.ts.map +0 -1
- package/dist/modules/moduleRegistry/index.js.map +0 -1
- package/dist/modules/moduleRegistry/moduleRegistry.registry.d.ts.map +0 -1
- package/dist/modules/moduleRegistry/moduleRegistry.registry.js.map +0 -1
- package/dist/modules/moduleRegistry/moduleRegistry.type.d.ts.map +0 -1
- package/dist/modules/moduleRegistry/moduleRegistry.type.js.map +0 -1
- package/dist/runtime/index.d.ts.map +0 -1
- package/dist/runtime/index.js.map +0 -1
- package/dist/runtime/runtime.d.ts.map +0 -1
- package/dist/runtime/runtime.js.map +0 -1
- package/dist/runtime/runtimeBootstrap/index.d.ts.map +0 -1
- package/dist/runtime/runtimeBootstrap/index.js.map +0 -1
- package/dist/runtime/runtimeBootstrap/pipeline/index.d.ts.map +0 -1
- package/dist/runtime/runtimeBootstrap/pipeline/index.js.map +0 -1
- package/dist/runtime/runtimeBootstrap/pipeline/runtimeBootstrap.invoke.d.ts +0 -6
- package/dist/runtime/runtimeBootstrap/pipeline/runtimeBootstrap.invoke.d.ts.map +0 -1
- package/dist/runtime/runtimeBootstrap/pipeline/runtimeBootstrap.invoke.js +0 -27
- package/dist/runtime/runtimeBootstrap/pipeline/runtimeBootstrap.invoke.js.map +0 -1
- package/dist/runtime/runtimeBootstrap/pipeline/runtimeBootstrap.pipeline.d.ts.map +0 -1
- package/dist/runtime/runtimeBootstrap/pipeline/runtimeBootstrap.pipeline.js.map +0 -1
- package/dist/runtime/runtimeBootstrap/runtimeBootstrap.core.d.ts.map +0 -1
- package/dist/runtime/runtimeBootstrap/runtimeBootstrap.core.js.map +0 -1
- package/dist/runtime/runtimeBootstrap/runtimeBootstrap.type.d.ts.map +0 -1
- package/dist/runtime/runtimeBootstrap/runtimeBootstrap.type.js.map +0 -1
- package/dist/runtime/runtimeContext/index.d.ts.map +0 -1
- package/dist/runtime/runtimeContext/index.js.map +0 -1
- package/dist/runtime/runtimeContext/runtimeContext.core.d.ts +0 -38
- package/dist/runtime/runtimeContext/runtimeContext.core.d.ts.map +0 -1
- package/dist/runtime/runtimeContext/runtimeContext.core.js +0 -99
- package/dist/runtime/runtimeContext/runtimeContext.core.js.map +0 -1
- package/dist/runtime/runtimeContext/runtimeContext.factory.d.ts.map +0 -1
- package/dist/runtime/runtimeContext/runtimeContext.factory.js.map +0 -1
- package/dist/runtime/runtimeContext/runtimeContext.type.d.ts.map +0 -1
- package/dist/runtime/runtimeContext/runtimeContext.type.js.map +0 -1
- package/dist/runtime/runtimeEnvironment/detection/index.d.ts.map +0 -1
- package/dist/runtime/runtimeEnvironment/detection/index.js.map +0 -1
- package/dist/runtime/runtimeEnvironment/detection/runtimeEnvironment.detection.d.ts.map +0 -1
- package/dist/runtime/runtimeEnvironment/detection/runtimeEnvironment.detection.js.map +0 -1
- package/dist/runtime/runtimeEnvironment/detection/runtimeEnvironment.env.d.ts.map +0 -1
- package/dist/runtime/runtimeEnvironment/detection/runtimeEnvironment.env.js.map +0 -1
- package/dist/runtime/runtimeEnvironment/detection/runtimeEnvironment.os.d.ts.map +0 -1
- package/dist/runtime/runtimeEnvironment/detection/runtimeEnvironment.os.js.map +0 -1
- package/dist/runtime/runtimeEnvironment/index.d.ts.map +0 -1
- package/dist/runtime/runtimeEnvironment/index.js.map +0 -1
- package/dist/runtime/runtimeEnvironment/runtimeEnvironment.core.d.ts.map +0 -1
- package/dist/runtime/runtimeEnvironment/runtimeEnvironment.core.js.map +0 -1
- package/dist/runtime/runtimeEnvironment/runtimeEnvironment.type.d.ts.map +0 -1
- package/dist/runtime/runtimeEnvironment/runtimeEnvironment.type.js.map +0 -1
- package/dist/runtime/runtimeError/index.d.ts.map +0 -1
- package/dist/runtime/runtimeError/index.js.map +0 -1
- package/dist/runtime/runtimeError/runtimeError.base.d.ts.map +0 -1
- package/dist/runtime/runtimeError/runtimeError.base.js.map +0 -1
- package/dist/runtime/runtimeError/runtimeError.lifecycle.d.ts.map +0 -1
- package/dist/runtime/runtimeError/runtimeError.lifecycle.js.map +0 -1
- package/dist/runtime/runtimeError/runtimeError.specialized.d.ts.map +0 -1
- package/dist/runtime/runtimeError/runtimeError.specialized.js.map +0 -1
- package/dist/runtime/runtimeError/runtimeError.type.d.ts.map +0 -1
- package/dist/runtime/runtimeError/runtimeError.type.js.map +0 -1
- package/dist/runtime/runtimeLogger.d.ts.map +0 -1
- package/dist/runtime/runtimeLogger.js.map +0 -1
- package/dist/runtime/runtimeManager/index.d.ts +0 -12
- package/dist/runtime/runtimeManager/index.d.ts.map +0 -1
- package/dist/runtime/runtimeManager/index.js +0 -11
- package/dist/runtime/runtimeManager/index.js.map +0 -1
- package/dist/runtime/runtimeManager/runtimeManager.core.d.ts +0 -31
- package/dist/runtime/runtimeManager/runtimeManager.core.d.ts.map +0 -1
- package/dist/runtime/runtimeManager/runtimeManager.core.js +0 -136
- package/dist/runtime/runtimeManager/runtimeManager.core.js.map +0 -1
- package/dist/runtime/runtimeManager/runtimeManager.error.d.ts +0 -14
- package/dist/runtime/runtimeManager/runtimeManager.error.d.ts.map +0 -1
- package/dist/runtime/runtimeManager/runtimeManager.error.js +0 -21
- package/dist/runtime/runtimeManager/runtimeManager.error.js.map +0 -1
- package/dist/runtime/runtimeManager/runtimeManager.factory.d.ts +0 -7
- package/dist/runtime/runtimeManager/runtimeManager.factory.d.ts.map +0 -1
- package/dist/runtime/runtimeManager/runtimeManager.factory.js +0 -8
- package/dist/runtime/runtimeManager/runtimeManager.factory.js.map +0 -1
- package/dist/runtime/runtimeManager/runtimeManager.lifecycle.d.ts +0 -16
- package/dist/runtime/runtimeManager/runtimeManager.lifecycle.d.ts.map +0 -1
- package/dist/runtime/runtimeManager/runtimeManager.lifecycle.js +0 -49
- package/dist/runtime/runtimeManager/runtimeManager.lifecycle.js.map +0 -1
- package/dist/runtime/runtimeManager/runtimeManager.type.d.ts +0 -54
- package/dist/runtime/runtimeManager/runtimeManager.type.d.ts.map +0 -1
- package/dist/runtime/runtimeManager/runtimeManager.type.js +0 -2
- package/dist/runtime/runtimeManager/runtimeManager.type.js.map +0 -1
- package/dist/runtime/runtimeOptions/index.d.ts.map +0 -1
- package/dist/runtime/runtimeOptions/index.js.map +0 -1
- package/dist/runtime/runtimeOptions/runtimeOptions.defaults.d.ts.map +0 -1
- package/dist/runtime/runtimeOptions/runtimeOptions.defaults.js.map +0 -1
- package/dist/runtime/runtimeOptions/runtimeOptions.resolver.d.ts.map +0 -1
- package/dist/runtime/runtimeOptions/runtimeOptions.resolver.js.map +0 -1
- package/dist/runtime/runtimeOptions/runtimeOptions.type.d.ts.map +0 -1
- package/dist/runtime/runtimeOptions/runtimeOptions.type.js.map +0 -1
- package/dist/runtime/runtimeOptions/runtimeOptions.validation.d.ts.map +0 -1
- package/dist/runtime/runtimeOptions/runtimeOptions.validation.js.map +0 -1
- package/dist/runtime/runtimeShutdown/index.d.ts.map +0 -1
- package/dist/runtime/runtimeShutdown/index.js.map +0 -1
- package/dist/runtime/runtimeShutdown/pipeline/index.d.ts.map +0 -1
- package/dist/runtime/runtimeShutdown/pipeline/index.js.map +0 -1
- package/dist/runtime/runtimeShutdown/pipeline/runtimeShutdown.pipeline.d.ts.map +0 -1
- package/dist/runtime/runtimeShutdown/pipeline/runtimeShutdown.pipeline.js.map +0 -1
- package/dist/runtime/runtimeShutdown/runtimeShutdown.core.d.ts.map +0 -1
- package/dist/runtime/runtimeShutdown/runtimeShutdown.core.js.map +0 -1
- package/dist/runtime/runtimeShutdown/runtimeShutdown.type.d.ts.map +0 -1
- package/dist/runtime/runtimeShutdown/runtimeShutdown.type.js.map +0 -1
- package/dist/runtime/runtimeState.state.d.ts.map +0 -1
- package/dist/runtime/runtimeState.state.js.map +0 -1
|
@@ -1,44 +1,50 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { CircularModuleDependencyError, MissingModuleDependencyError, } from "../moduleError/moduleError.dependency.js";
|
|
2
2
|
/**
|
|
3
3
|
* Detects circular dependencies in a module graph.
|
|
4
4
|
*
|
|
5
5
|
* Returns the dependency cycle when one exists.
|
|
6
|
+
*
|
|
7
|
+
* This is the single cycle-detection mechanism used by the
|
|
8
|
+
* dependency subsystem. The implementation is iterative so very
|
|
9
|
+
* deep graphs cannot overflow the call stack.
|
|
6
10
|
*/
|
|
7
11
|
export function findModuleDependencyCycle(graph) {
|
|
8
|
-
const visiting = new Set();
|
|
9
12
|
const visited = new Set();
|
|
10
|
-
const
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
if (
|
|
13
|
+
for (const startId of graph.nodes.keys()) {
|
|
14
|
+
if (visited.has(startId))
|
|
15
|
+
continue;
|
|
16
|
+
/*
|
|
17
|
+
* Iterative DFS. Each stack frame tracks the module and the
|
|
18
|
+
* index of the next dependency to visit.
|
|
19
|
+
*/
|
|
20
|
+
const stack = [
|
|
21
|
+
{ id: startId, nextDependency: 0 },
|
|
22
|
+
];
|
|
23
|
+
const inPath = new Set([startId]);
|
|
24
|
+
const path = [startId];
|
|
25
|
+
while (stack.length > 0) {
|
|
26
|
+
const frame = stack[stack.length - 1];
|
|
27
|
+
const dependencies = graph.getDependencies(frame.id);
|
|
28
|
+
if (frame.nextDependency >= dependencies.length) {
|
|
29
|
+
stack.pop();
|
|
30
|
+
path.pop();
|
|
31
|
+
inPath.delete(frame.id);
|
|
32
|
+
visited.add(frame.id);
|
|
26
33
|
continue;
|
|
27
34
|
}
|
|
28
|
-
const
|
|
29
|
-
|
|
30
|
-
|
|
35
|
+
const dependency = dependencies[frame.nextDependency];
|
|
36
|
+
frame.nextDependency += 1;
|
|
37
|
+
if (!graph.hasModule(dependency.id))
|
|
38
|
+
continue;
|
|
39
|
+
if (inPath.has(dependency.id)) {
|
|
40
|
+
const index = path.indexOf(dependency.id);
|
|
41
|
+
return [...path.slice(index), dependency.id];
|
|
31
42
|
}
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
};
|
|
38
|
-
for (const moduleId of graph.nodes.keys()) {
|
|
39
|
-
const cycle = visit(moduleId);
|
|
40
|
-
if (cycle) {
|
|
41
|
-
return cycle;
|
|
43
|
+
if (visited.has(dependency.id))
|
|
44
|
+
continue;
|
|
45
|
+
stack.push({ id: dependency.id, nextDependency: 0 });
|
|
46
|
+
inPath.add(dependency.id);
|
|
47
|
+
path.push(dependency.id);
|
|
42
48
|
}
|
|
43
49
|
}
|
|
44
50
|
return undefined;
|
|
@@ -65,38 +71,60 @@ export function hasModuleDependencyCycle(graph) {
|
|
|
65
71
|
* produces:
|
|
66
72
|
*
|
|
67
73
|
* users → orders → payments
|
|
74
|
+
*
|
|
75
|
+
* The sort is implemented iteratively (Kahn's algorithm). When
|
|
76
|
+
* not every module can be ordered, the cycle is located with
|
|
77
|
+
* findModuleDependencyCycle and reported.
|
|
68
78
|
*/
|
|
69
79
|
export function resolveModuleStartupOrder(graph) {
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
80
|
+
/*
|
|
81
|
+
* Missing required dependencies make the order meaningless,
|
|
82
|
+
* so they are reported first with the requiring module.
|
|
83
|
+
*/
|
|
84
|
+
for (const node of graph.nodes.values()) {
|
|
85
|
+
for (const dependency of node.dependencies) {
|
|
86
|
+
if (dependency.optional)
|
|
87
|
+
continue;
|
|
88
|
+
if (!graph.hasModule(dependency.id)) {
|
|
89
|
+
throw new MissingModuleDependencyError(node.id, dependency.id);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
const inDegree = new Map();
|
|
94
|
+
const dependents = new Map();
|
|
95
|
+
for (const node of graph.nodes.values()) {
|
|
96
|
+
let degree = 0;
|
|
97
|
+
for (const dependency of node.dependencies) {
|
|
98
|
+
if (!graph.hasModule(dependency.id))
|
|
99
|
+
continue;
|
|
100
|
+
degree += 1;
|
|
101
|
+
const list = dependents.get(dependency.id);
|
|
102
|
+
if (list)
|
|
103
|
+
list.push(node.id);
|
|
104
|
+
else
|
|
105
|
+
dependents.set(dependency.id, [node.id]);
|
|
106
|
+
}
|
|
107
|
+
inDegree.set(node.id, degree);
|
|
73
108
|
}
|
|
74
|
-
const
|
|
75
|
-
|
|
76
|
-
|
|
109
|
+
const queue = [];
|
|
110
|
+
for (const [moduleId, degree] of inDegree) {
|
|
111
|
+
if (degree === 0)
|
|
112
|
+
queue.push(moduleId);
|
|
77
113
|
}
|
|
78
|
-
const temporary = new Set();
|
|
79
|
-
const permanent = new Set();
|
|
80
114
|
const order = [];
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
return;
|
|
84
|
-
}
|
|
85
|
-
if (temporary.has(moduleId)) {
|
|
86
|
-
throw new Error(`Circular module dependency detected involving "${moduleId}".`);
|
|
87
|
-
}
|
|
88
|
-
temporary.add(moduleId);
|
|
89
|
-
for (const dependency of graph.getDependencies(moduleId)) {
|
|
90
|
-
if (graph.hasModule(dependency.id)) {
|
|
91
|
-
visit(dependency.id);
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
temporary.delete(moduleId);
|
|
95
|
-
permanent.add(moduleId);
|
|
115
|
+
for (let index = 0; index < queue.length; index++) {
|
|
116
|
+
const moduleId = queue[index];
|
|
96
117
|
order.push(moduleId);
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
118
|
+
for (const dependent of dependents.get(moduleId) ?? []) {
|
|
119
|
+
const degree = (inDegree.get(dependent) ?? 0) - 1;
|
|
120
|
+
inDegree.set(dependent, degree);
|
|
121
|
+
if (degree === 0)
|
|
122
|
+
queue.push(dependent);
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
if (order.length !== graph.nodes.size) {
|
|
126
|
+
const cycle = findModuleDependencyCycle(graph);
|
|
127
|
+
throw new CircularModuleDependencyError(cycle ?? [...graph.nodes.keys()].filter((id) => !order.includes(id)));
|
|
100
128
|
}
|
|
101
129
|
return Object.freeze(order);
|
|
102
130
|
}
|
|
@@ -37,6 +37,13 @@ export interface ModuleDependencyNode {
|
|
|
37
37
|
* Dependencies declared by the module.
|
|
38
38
|
*/
|
|
39
39
|
readonly dependencies: ModuleDependencies;
|
|
40
|
+
/**
|
|
41
|
+
* Semantic version of the module, when known.
|
|
42
|
+
*
|
|
43
|
+
* Used to check dependency version constraints while
|
|
44
|
+
* building the graph.
|
|
45
|
+
*/
|
|
46
|
+
readonly version?: string;
|
|
40
47
|
}
|
|
41
48
|
/**
|
|
42
49
|
* Complete module dependency graph.
|
|
@@ -62,5 +69,25 @@ export interface ModuleDependencyGraph {
|
|
|
62
69
|
/**
|
|
63
70
|
* A raw dependency declaration accepted by the framework.
|
|
64
71
|
*/
|
|
65
|
-
export type ModuleDependencyInput = ModuleId | ModuleDependency;
|
|
72
|
+
export type ModuleDependencyInput = ModuleId | (Pick<ModuleDependency, "id"> & Partial<Omit<ModuleDependency, "id">>);
|
|
73
|
+
/**
|
|
74
|
+
* A raw dependency graph node accepted by `createModuleDependencyGraph`.
|
|
75
|
+
*
|
|
76
|
+
* Dependencies may be declared as plain ids or partial dependency objects;
|
|
77
|
+
* they are normalized while the graph is built.
|
|
78
|
+
*/
|
|
79
|
+
export interface ModuleDependencyNodeInput {
|
|
80
|
+
/**
|
|
81
|
+
* Module identifier.
|
|
82
|
+
*/
|
|
83
|
+
readonly id: ModuleId;
|
|
84
|
+
/**
|
|
85
|
+
* Dependencies declared by the module.
|
|
86
|
+
*/
|
|
87
|
+
readonly dependencies?: readonly ModuleDependencyInput[];
|
|
88
|
+
/**
|
|
89
|
+
* Semantic version of the module, when known.
|
|
90
|
+
*/
|
|
91
|
+
readonly version?: string;
|
|
92
|
+
}
|
|
66
93
|
//# sourceMappingURL=moduleDependency.type.d.ts.map
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
export { ModuleErrorCode, type ModuleErrorCode as ModuleErrorCodeType, type ModuleErrorDetails, ModuleError, } from "./moduleError.base.js";
|
|
7
7
|
export { InvalidModuleDefinitionError, ModuleNotFoundError, DuplicateModuleError, } from "./moduleError.registration.js";
|
|
8
|
-
export { MissingModuleDependencyError, CircularModuleDependencyError, ModuleVersionMismatchError, } from "./moduleError.dependency.js";
|
|
8
|
+
export { InvalidModuleDependencyError, MissingModuleDependencyError, CircularModuleDependencyError, ModuleVersionMismatchError, } from "./moduleError.dependency.js";
|
|
9
9
|
export { getLifecycleErrorCode, ModuleInstantiationError, ModuleOperationError, InvalidModuleInstanceError, InvalidModuleStateError, ModuleOperationInProgressError, } from "./moduleError.lifecycle.js";
|
|
10
10
|
export { isModuleError, hasModuleErrorCode, toModuleError, } from "./moduleError.helpers.js";
|
|
11
11
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
export { ModuleErrorCode, ModuleError, } from "./moduleError.base.js";
|
|
7
7
|
export { InvalidModuleDefinitionError, ModuleNotFoundError, DuplicateModuleError, } from "./moduleError.registration.js";
|
|
8
|
-
export { MissingModuleDependencyError, CircularModuleDependencyError, ModuleVersionMismatchError, } from "./moduleError.dependency.js";
|
|
8
|
+
export { InvalidModuleDependencyError, MissingModuleDependencyError, CircularModuleDependencyError, ModuleVersionMismatchError, } from "./moduleError.dependency.js";
|
|
9
9
|
export { getLifecycleErrorCode, ModuleInstantiationError, ModuleOperationError, InvalidModuleInstanceError, InvalidModuleStateError, ModuleOperationInProgressError, } from "./moduleError.lifecycle.js";
|
|
10
10
|
export { isModuleError, hasModuleErrorCode, toModuleError, } from "./moduleError.helpers.js";
|
|
11
11
|
//# sourceMappingURL=index.js.map
|
|
@@ -12,6 +12,17 @@ export declare class MissingModuleDependencyError extends ModuleError {
|
|
|
12
12
|
export declare class CircularModuleDependencyError extends ModuleError {
|
|
13
13
|
constructor(cycle: readonly ModuleId[]);
|
|
14
14
|
}
|
|
15
|
+
/**
|
|
16
|
+
* Error thrown when a dependency declaration is malformed:
|
|
17
|
+
* empty ids, self-dependencies, duplicate declarations, or
|
|
18
|
+
* unsupported version constraints.
|
|
19
|
+
*/
|
|
20
|
+
export declare class InvalidModuleDependencyError extends ModuleError {
|
|
21
|
+
constructor(message: string, options?: {
|
|
22
|
+
readonly moduleId?: ModuleId;
|
|
23
|
+
readonly dependencyId?: ModuleId;
|
|
24
|
+
});
|
|
25
|
+
}
|
|
15
26
|
/**
|
|
16
27
|
* Error thrown when a module dependency version
|
|
17
28
|
* cannot be satisfied.
|
|
@@ -26,6 +26,21 @@ export class CircularModuleDependencyError extends ModuleError {
|
|
|
26
26
|
this.name = "CircularModuleDependencyError";
|
|
27
27
|
}
|
|
28
28
|
}
|
|
29
|
+
/**
|
|
30
|
+
* Error thrown when a dependency declaration is malformed:
|
|
31
|
+
* empty ids, self-dependencies, duplicate declarations, or
|
|
32
|
+
* unsupported version constraints.
|
|
33
|
+
*/
|
|
34
|
+
export class InvalidModuleDependencyError extends ModuleError {
|
|
35
|
+
constructor(message, options = {}) {
|
|
36
|
+
super(message, {
|
|
37
|
+
code: ModuleErrorCode.INVALID_DEPENDENCY,
|
|
38
|
+
moduleId: options.moduleId,
|
|
39
|
+
dependencyId: options.dependencyId,
|
|
40
|
+
});
|
|
41
|
+
this.name = "InvalidModuleDependencyError";
|
|
42
|
+
}
|
|
43
|
+
}
|
|
29
44
|
/**
|
|
30
45
|
* Error thrown when a module dependency version
|
|
31
46
|
* cannot be satisfied.
|
|
@@ -3,8 +3,11 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Manages the lifecycle phases of loaded modules:
|
|
5
5
|
* initialize → start → stop → destroy.
|
|
6
|
+
*
|
|
7
|
+
* The state-machine plumbing (hook invocation, phase execution,
|
|
8
|
+
* state maps) is internal to this subsystem and intentionally
|
|
9
|
+
* not exported from this barrel.
|
|
6
10
|
*/
|
|
7
|
-
export { type ModuleLifecyclePhase, type ModuleLifecycleState, type ModuleLifecycleHooks, type ModuleLifecycleOptions, ModuleLifecycleError, type ModuleLifecycleResult, type
|
|
8
|
-
export { ensureStateSynchronized, getLifecycleState, requireLifecycleState, getAllLifecycleStates, isModuleInitialized, isModuleStarted, isModuleDestroyed, invokeLifecycleHook, canModuleEnterPhase, setLifecycleState, executeLifecyclePhase, } from "./moduleLifecycle.stateMachine.js";
|
|
11
|
+
export { type ModuleLifecyclePhase, type ModuleLifecycleState, type ModuleLifecycleHookName, type ModuleLifecycleStep, type ModuleLifecycleHooks, type ModuleLifecycleOptions, type ModuleLifecyclePhaseOptions, ModuleLifecycleError, type ModuleLifecycleResult, type ModuleLifecycleSkip, } from "./moduleLifecycle.type.js";
|
|
9
12
|
export { ModuleLifecycleManager, createModuleLifecycleManager, } from "./moduleLifecycle.lifecycle.js";
|
|
10
13
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -3,8 +3,11 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Manages the lifecycle phases of loaded modules:
|
|
5
5
|
* initialize → start → stop → destroy.
|
|
6
|
+
*
|
|
7
|
+
* The state-machine plumbing (hook invocation, phase execution,
|
|
8
|
+
* state maps) is internal to this subsystem and intentionally
|
|
9
|
+
* not exported from this barrel.
|
|
6
10
|
*/
|
|
7
11
|
export { ModuleLifecycleError, } from "./moduleLifecycle.type.js";
|
|
8
|
-
export { ensureStateSynchronized, getLifecycleState, requireLifecycleState, getAllLifecycleStates, isModuleInitialized, isModuleStarted, isModuleDestroyed, invokeLifecycleHook, canModuleEnterPhase, setLifecycleState, executeLifecyclePhase, } from "./moduleLifecycle.stateMachine.js";
|
|
9
12
|
export { ModuleLifecycleManager, createModuleLifecycleManager, } from "./moduleLifecycle.lifecycle.js";
|
|
10
13
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import type { ModuleId } from "../module.js";
|
|
2
|
-
import type {
|
|
1
|
+
import type { Module, ModuleId } from "../module.js";
|
|
2
|
+
import type { ModuleDefinition } from "../moduleDefinition.definition.js";
|
|
3
|
+
import type { ModuleRegistration, ModuleRegistry } from "../moduleRegistry/index.js";
|
|
3
4
|
import type { ModuleLoader } from "../moduleLoader/index.js";
|
|
4
|
-
import type { ModuleLifecycleOptions, ModuleLifecycleResult } from "./moduleLifecycle.type.js";
|
|
5
|
+
import type { ModuleLifecycleOptions, ModuleLifecyclePhaseOptions, ModuleLifecycleResult, ModuleLifecycleState } from "./moduleLifecycle.type.js";
|
|
6
|
+
import type { ModuleDependency } from "../moduleDependency/moduleDependency.type.js";
|
|
5
7
|
/**
|
|
6
8
|
* Module lifecycle manager.
|
|
7
9
|
* Initializes, starts, stops, and destroys modules in dependency order.
|
|
@@ -10,13 +12,58 @@ export declare class ModuleLifecycleManager {
|
|
|
10
12
|
private readonly registry;
|
|
11
13
|
private readonly loader;
|
|
12
14
|
private readonly options;
|
|
15
|
+
private readonly contextStorage;
|
|
13
16
|
private readonly states;
|
|
14
17
|
private operation;
|
|
15
18
|
constructor(registry: ModuleRegistry, loader: ModuleLoader, options?: ModuleLifecycleOptions);
|
|
16
|
-
initialize(): Promise<ModuleLifecycleResult>;
|
|
17
|
-
start(): Promise<ModuleLifecycleResult>;
|
|
18
|
-
stop(): Promise<ModuleLifecycleResult>;
|
|
19
|
-
destroy(): Promise<ModuleLifecycleResult>;
|
|
19
|
+
initialize(options?: ModuleLifecyclePhaseOptions): Promise<ModuleLifecycleResult>;
|
|
20
|
+
start(options?: ModuleLifecyclePhaseOptions): Promise<ModuleLifecycleResult>;
|
|
21
|
+
stop(options?: ModuleLifecyclePhaseOptions): Promise<ModuleLifecycleResult>;
|
|
22
|
+
destroy(options?: ModuleLifecyclePhaseOptions): Promise<ModuleLifecycleResult>;
|
|
23
|
+
/**
|
|
24
|
+
* Rolls back modules that completed earlier phases after a
|
|
25
|
+
* startup failure.
|
|
26
|
+
*
|
|
27
|
+
* The rollback is best-effort: the already-completed subset is
|
|
28
|
+
* stopped (when requested) and destroyed in reverse dependency
|
|
29
|
+
* order, and any rollback errors are collected onto the
|
|
30
|
+
* original ModuleLifecycleError instead of masking it.
|
|
31
|
+
*/
|
|
32
|
+
private rollbackAfterFailure;
|
|
33
|
+
/**
|
|
34
|
+
* Shuts down and unloads a single module.
|
|
35
|
+
*
|
|
36
|
+
* The module is stopped (when started) and destroyed, its
|
|
37
|
+
* lifecycle state is dropped, and the loader forgets its
|
|
38
|
+
* instance and context. Hook failures never abort the unload;
|
|
39
|
+
* they are reported in the result and on the lifecycle state.
|
|
40
|
+
*
|
|
41
|
+
* A module that other loaded modules still depend on cannot be
|
|
42
|
+
* unloaded; ModuleError (MODULE_OPERATION_NOT_ALLOWED) is thrown.
|
|
43
|
+
*/
|
|
44
|
+
unloadModule(moduleId: ModuleId): Promise<ModuleLifecycleResult>;
|
|
45
|
+
/**
|
|
46
|
+
* Replaces a module definition, shutting down the currently
|
|
47
|
+
* loaded instance first.
|
|
48
|
+
*
|
|
49
|
+
* The registry must allow replacement (allowReplacement: true).
|
|
50
|
+
* The new definition is registered but not loaded; call the
|
|
51
|
+
* loader and lifecycle methods afterwards to bring it up.
|
|
52
|
+
*/
|
|
53
|
+
replaceModule<TModule extends Module>(definition: ModuleDefinition<TModule>): Promise<ModuleRegistration<TModule>>;
|
|
54
|
+
/**
|
|
55
|
+
* Returns ids of loaded modules that declare a required or
|
|
56
|
+
* optional dependency on the given module.
|
|
57
|
+
*/
|
|
58
|
+
private getLoadedDependents;
|
|
59
|
+
/**
|
|
60
|
+
* Dependencies of a registered module: those declared on the
|
|
61
|
+
* definition plus any the loaded instance declares itself
|
|
62
|
+
* (`Module.dependencies`, e.g. via the BaseModule constructor).
|
|
63
|
+
* Instance-declared dependencies are required; a definition
|
|
64
|
+
* entry for the same id wins so optional/version flags survive.
|
|
65
|
+
*/
|
|
66
|
+
private resolveDependencies;
|
|
20
67
|
startApplication(): Promise<{
|
|
21
68
|
readonly initialized: ModuleLifecycleResult;
|
|
22
69
|
readonly started: ModuleLifecycleResult;
|
|
@@ -25,17 +72,33 @@ export declare class ModuleLifecycleManager {
|
|
|
25
72
|
readonly stopped: ModuleLifecycleResult;
|
|
26
73
|
readonly destroyed: ModuleLifecycleResult;
|
|
27
74
|
}>;
|
|
28
|
-
getState(moduleId: ModuleId):
|
|
29
|
-
requireState(moduleId: ModuleId):
|
|
30
|
-
getStates(): ReadonlyMap<ModuleId,
|
|
75
|
+
getState(moduleId: ModuleId): ModuleLifecycleState | undefined;
|
|
76
|
+
requireState(moduleId: ModuleId): ModuleLifecycleState;
|
|
77
|
+
getStates(): ReadonlyMap<ModuleId, ModuleLifecycleState>;
|
|
31
78
|
isInitialized(moduleId: ModuleId): boolean;
|
|
32
79
|
isStarted(moduleId: ModuleId): boolean;
|
|
33
80
|
isDestroyed(moduleId: ModuleId): boolean;
|
|
81
|
+
/**
|
|
82
|
+
* Builds the dependency graph over the loaded modules only.
|
|
83
|
+
*
|
|
84
|
+
* Lifecycle phases run for loaded modules, so a registered but
|
|
85
|
+
* unloaded definition (autoLoad: false) must not be able to
|
|
86
|
+
* break them with a missing or circular dependency of its own.
|
|
87
|
+
* Dependencies of a loaded module that are not loaded are kept
|
|
88
|
+
* as edges so the ordering reports them as missing.
|
|
89
|
+
*/
|
|
34
90
|
private createGraph;
|
|
35
91
|
private getStartupOrder;
|
|
36
92
|
private getShutdownOrder;
|
|
37
93
|
private runExclusive;
|
|
38
94
|
}
|
|
95
|
+
/**
|
|
96
|
+
* Resolves the dependencies of a registration: definition-declared
|
|
97
|
+
* dependencies plus the ids the loaded instance declares through
|
|
98
|
+
* `Module.dependencies`. Shared by the lifecycle manager and the
|
|
99
|
+
* loader so both agree on the graph.
|
|
100
|
+
*/
|
|
101
|
+
export declare function resolveRegistrationDependencies(registry: ModuleRegistry, registration: ModuleRegistration): readonly ModuleDependency[];
|
|
39
102
|
/** Creates a module lifecycle manager. */
|
|
40
103
|
export declare function createModuleLifecycleManager(registry: ModuleRegistry, loader: ModuleLoader, options?: ModuleLifecycleOptions): ModuleLifecycleManager;
|
|
41
104
|
//# sourceMappingURL=moduleLifecycle.lifecycle.d.ts.map
|