@navios/core 1.0.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.
Files changed (49) hide show
  1. package/CHANGELOG.md +44 -0
  2. package/lib/{index-C0Sg16Eb.d.cts → index-3LcTrbxz.d.mts} +491 -52
  3. package/lib/index-3LcTrbxz.d.mts.map +1 -0
  4. package/lib/{index-DySQ6Dpd.d.mts → index-B14SekVb.d.cts} +491 -52
  5. package/lib/index-B14SekVb.d.cts.map +1 -0
  6. package/lib/index.cjs +18 -3
  7. package/lib/index.d.cts +2 -2
  8. package/lib/index.d.mts +2 -2
  9. package/lib/index.mjs +4 -4
  10. package/lib/legacy-compat/index.cjs +3 -3
  11. package/lib/legacy-compat/index.d.cts +1 -1
  12. package/lib/legacy-compat/index.d.mts +1 -1
  13. package/lib/legacy-compat/index.mjs +2 -2
  14. package/lib/{navios.factory-CO5MB_OK.cjs → navios.factory-CUrO_p6K.cjs} +461 -48
  15. package/lib/navios.factory-CUrO_p6K.cjs.map +1 -0
  16. package/lib/{navios.factory-D6Y94P9B.mjs → navios.factory-DjUOOVVL.mjs} +372 -49
  17. package/lib/navios.factory-DjUOOVVL.mjs.map +1 -0
  18. package/lib/testing/index.cjs +2 -2
  19. package/lib/testing/index.d.cts +1 -1
  20. package/lib/testing/index.d.mts +1 -1
  21. package/lib/testing/index.mjs +2 -2
  22. package/lib/{tokens-CWw9kyeD.cjs → tokens-BEuBMGGX.cjs} +18 -21
  23. package/lib/tokens-BEuBMGGX.cjs.map +1 -0
  24. package/lib/{tokens-4J9sredA.mjs → tokens-COyNGV1I.mjs} +17 -20
  25. package/lib/tokens-COyNGV1I.mjs.map +1 -0
  26. package/lib/{use-guards.decorator-BecoQSmE.mjs → use-guards.decorator-DLmRl2CV.mjs} +14 -17
  27. package/lib/use-guards.decorator-DLmRl2CV.mjs.map +1 -0
  28. package/lib/{use-guards.decorator-C4ml9XaT.cjs → use-guards.decorator-DhumFTk3.cjs} +15 -18
  29. package/lib/use-guards.decorator-DhumFTk3.cjs.map +1 -0
  30. package/package.json +2 -2
  31. package/src/interfaces/index.mts +3 -0
  32. package/src/interfaces/plugin-context.mts +104 -0
  33. package/src/interfaces/plugin-stage.mts +62 -0
  34. package/src/interfaces/plugin.interface.mts +42 -62
  35. package/src/interfaces/staged-plugin.interface.mts +209 -0
  36. package/src/metadata/controller.metadata.mts +29 -22
  37. package/src/metadata/module.metadata.mts +33 -25
  38. package/src/navios.application.mts +247 -53
  39. package/src/services/module-loader.service.mts +11 -8
  40. package/src/utils/define-plugin.mts +251 -0
  41. package/src/utils/index.mts +1 -0
  42. package/lib/index-C0Sg16Eb.d.cts.map +0 -1
  43. package/lib/index-DySQ6Dpd.d.mts.map +0 -1
  44. package/lib/navios.factory-CO5MB_OK.cjs.map +0 -1
  45. package/lib/navios.factory-D6Y94P9B.mjs.map +0 -1
  46. package/lib/tokens-4J9sredA.mjs.map +0 -1
  47. package/lib/tokens-CWw9kyeD.cjs.map +0 -1
  48. package/lib/use-guards.decorator-BecoQSmE.mjs.map +0 -1
  49. package/lib/use-guards.decorator-C4ml9XaT.cjs.map +0 -1
package/CHANGELOG.md CHANGED
@@ -5,6 +5,50 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [1.1.0] - 2026-01-15
9
+
10
+ ### Added
11
+
12
+ - **Staged Plugin System**: New comprehensive plugin lifecycle with 10 stages for fine-grained control over application initialization
13
+ - `pre:modules-traverse` - Before module tree traversal (container only)
14
+ - `post:modules-traverse` - After module tree traversal (modules available)
15
+ - `pre:adapter-resolve` - Before adapter is resolved from container (ideal for DI modifications)
16
+ - `post:adapter-resolve` - After adapter is resolved
17
+ - `pre:adapter-setup` - Before adapter setup
18
+ - `post:adapter-setup` - After adapter setup
19
+ - `pre:modules-init` - Before route registration
20
+ - `post:modules-init` - After route registration (legacy plugin default)
21
+ - `pre:ready` - Before adapter signals ready
22
+ - `post:ready` - After adapter signals ready (app fully initialized)
23
+ - **Stage-Specific Context Types**: Each stage provides appropriate context
24
+ - `ContainerOnlyContext` - Container access only (early stages)
25
+ - `ModulesLoadedContext` - Container + modules + moduleLoader (pre-adapter stages)
26
+ - `FullPluginContext<TAdapter>` - Full context with typed adapter (post-adapter stages)
27
+ - **Plugin Factory Functions**: Convenient factory functions for creating staged plugins
28
+ - `definePreModulesTraversePlugin()` - Create pre:modules-traverse plugins
29
+ - `definePostModulesTraversePlugin()` - Create post:modules-traverse plugins
30
+ - `definePreAdapterResolvePlugin()` - Create pre:adapter-resolve plugins (ideal for instrumentation)
31
+ - `definePostAdapterResolvePlugin<TAdapter>()()` - Create post:adapter-resolve plugins
32
+ - `definePreAdapterSetupPlugin<TAdapter>()()` - Create pre:adapter-setup plugins
33
+ - `definePostAdapterSetupPlugin<TAdapter>()()` - Create post:adapter-setup plugins
34
+ - `definePreModulesInitPlugin<TAdapter>()()` - Create pre:modules-init plugins
35
+ - `definePostModulesInitPlugin<TAdapter>()()` - Create post:modules-init plugins
36
+ - `definePreReadyPlugin<TAdapter>()()` - Create pre:ready plugins
37
+ - `definePostReadyPlugin<TAdapter>()()` - Create post:ready plugins
38
+ - **Plugin Stage Constants**: `PluginStages` object with all stage names as constants
39
+ - **Stage Order Array**: `PLUGIN_STAGES_ORDER` array defining execution order
40
+
41
+ ### Changed
42
+
43
+ - **Legacy Plugin Deprecation**: `NaviosPlugin` interface now deprecated in favor of staged plugins
44
+ - Legacy plugins automatically map to `post:modules-init` stage
45
+ - `PluginDefinition` type deprecated in favor of `StagedPluginDefinition`
46
+ - **Plugin Context Types**: `PluginContext` type deprecated, use stage-specific context types instead
47
+
48
+ ### Dependencies
49
+
50
+ - Updated internal plugin execution to support staged lifecycle
51
+
8
52
  ## [1.0.0] - 2026-01-09
9
53
 
10
54
  ### Added