@nexus-ioc/core 0.6.1 → 0.7.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 (222) hide show
  1. package/README.md +731 -1
  2. package/dist/cjs/browser.js +2 -2
  3. package/dist/cjs/browser.js.map +1 -1
  4. package/dist/cjs/core/child-module.js +32 -0
  5. package/dist/cjs/core/child-module.js.map +1 -0
  6. package/dist/cjs/core/graph/analyze-lazy-module.js +54 -0
  7. package/dist/cjs/core/graph/analyze-lazy-module.js.map +1 -0
  8. package/dist/cjs/core/graph/analyze-module.js +11 -0
  9. package/dist/cjs/core/graph/analyze-module.js.map +1 -1
  10. package/dist/cjs/core/graph/module-graph.js +685 -70
  11. package/dist/cjs/core/graph/module-graph.js.map +1 -1
  12. package/dist/cjs/core/injection/injection-context.js +29 -0
  13. package/dist/cjs/core/injection/injection-context.js.map +1 -0
  14. package/dist/cjs/core/lazy-module-loader.js +41 -0
  15. package/dist/cjs/core/lazy-module-loader.js.map +1 -0
  16. package/dist/cjs/core/module-ref.js +84 -0
  17. package/dist/cjs/core/module-ref.js.map +1 -0
  18. package/dist/cjs/core/modules/container.js +305 -17
  19. package/dist/cjs/core/modules/container.js.map +1 -1
  20. package/dist/cjs/core/modules/module-container-factory.js +2 -2
  21. package/dist/cjs/core/modules/module-container-factory.js.map +1 -1
  22. package/dist/cjs/core/modules/module-container.js +54 -16
  23. package/dist/cjs/core/modules/module-container.js.map +1 -1
  24. package/dist/cjs/core/modules/module-token-factory.js.map +1 -1
  25. package/dist/cjs/core/modules/modules-container.js +43 -3
  26. package/dist/cjs/core/modules/modules-container.js.map +1 -1
  27. package/dist/cjs/core/nexus-applications.browser.js +57 -15
  28. package/dist/cjs/core/nexus-applications.browser.js.map +1 -1
  29. package/dist/cjs/core/nexus-applications.js +440 -82
  30. package/dist/cjs/core/nexus-applications.js.map +1 -1
  31. package/dist/cjs/core/nexus-applications.server.js +57 -15
  32. package/dist/cjs/core/nexus-applications.server.js.map +1 -1
  33. package/dist/cjs/core/resolver/providers-container.js.map +1 -1
  34. package/dist/cjs/core/resolver/resolution-context.js +62 -0
  35. package/dist/cjs/core/resolver/resolution-context.js.map +1 -0
  36. package/dist/cjs/core/resolver/resolver.js +523 -99
  37. package/dist/cjs/core/resolver/resolver.js.map +1 -1
  38. package/dist/cjs/decorators/inject.js +6 -3
  39. package/dist/cjs/decorators/inject.js.map +1 -1
  40. package/dist/cjs/decorators/injectable.js +0 -7
  41. package/dist/cjs/decorators/injectable.js.map +1 -1
  42. package/dist/cjs/decorators/{nsModule.js → module.js} +9 -7
  43. package/dist/cjs/decorators/module.js.map +1 -0
  44. package/dist/cjs/errors/bootstrap-error.js +47 -0
  45. package/dist/cjs/errors/bootstrap-error.js.map +1 -0
  46. package/dist/cjs/errors/child-errors.js +21 -0
  47. package/dist/cjs/errors/child-errors.js.map +1 -0
  48. package/dist/cjs/errors/index.js +24 -0
  49. package/dist/cjs/errors/index.js.map +1 -0
  50. package/dist/cjs/errors/injection-errors.js +25 -0
  51. package/dist/cjs/errors/injection-errors.js.map +1 -0
  52. package/dist/cjs/errors/lazy-module-errors.js +26 -0
  53. package/dist/cjs/errors/lazy-module-errors.js.map +1 -0
  54. package/dist/cjs/errors/provider-errors.js +95 -0
  55. package/dist/cjs/errors/provider-errors.js.map +1 -0
  56. package/dist/cjs/index.js +30 -6
  57. package/dist/cjs/index.js.map +1 -1
  58. package/dist/cjs/interfaces/index.js +1 -0
  59. package/dist/cjs/interfaces/index.js.map +1 -1
  60. package/dist/cjs/interfaces/modules/index.js +1 -0
  61. package/dist/cjs/interfaces/modules/index.js.map +1 -1
  62. package/dist/cjs/interfaces/modules/module-graph.interface.js +2 -0
  63. package/dist/cjs/interfaces/modules/module-graph.interface.js.map +1 -1
  64. package/dist/cjs/interfaces/modules/parent-link.interface.js +3 -0
  65. package/dist/cjs/interfaces/modules/parent-link.interface.js.map +1 -0
  66. package/dist/cjs/interfaces/on-module-destroy.interface.js +3 -0
  67. package/dist/cjs/interfaces/on-module-destroy.interface.js.map +1 -0
  68. package/dist/cjs/interfaces/scope.interface.js +2 -55
  69. package/dist/cjs/interfaces/scope.interface.js.map +1 -1
  70. package/dist/cjs/interfaces/validate-module-keys.js +2 -0
  71. package/dist/cjs/interfaces/validate-module-keys.js.map +1 -1
  72. package/dist/cjs/internal.js +9 -0
  73. package/dist/cjs/internal.js.map +1 -0
  74. package/dist/cjs/server.js +2 -2
  75. package/dist/cjs/server.js.map +1 -1
  76. package/dist/cjs/utils/forward-ref.js +14 -0
  77. package/dist/cjs/utils/forward-ref.js.map +1 -0
  78. package/dist/cjs/utils/helpers.js +14 -4
  79. package/dist/cjs/utils/helpers.js.map +1 -1
  80. package/dist/cjs/utils/lazy-module.js +33 -0
  81. package/dist/cjs/utils/lazy-module.js.map +1 -0
  82. package/dist/esm/browser.js +1 -1
  83. package/dist/esm/browser.js.map +1 -1
  84. package/dist/esm/core/child-module.js +29 -0
  85. package/dist/esm/core/child-module.js.map +1 -0
  86. package/dist/esm/core/graph/analyze-lazy-module.js +50 -0
  87. package/dist/esm/core/graph/analyze-lazy-module.js.map +1 -0
  88. package/dist/esm/core/graph/analyze-module.js +11 -0
  89. package/dist/esm/core/graph/analyze-module.js.map +1 -1
  90. package/dist/esm/core/graph/module-graph.js +686 -71
  91. package/dist/esm/core/graph/module-graph.js.map +1 -1
  92. package/dist/esm/core/injection/injection-context.js +25 -0
  93. package/dist/esm/core/injection/injection-context.js.map +1 -0
  94. package/dist/esm/core/lazy-module-loader.js +36 -0
  95. package/dist/esm/core/lazy-module-loader.js.map +1 -0
  96. package/dist/esm/core/module-ref.js +80 -0
  97. package/dist/esm/core/module-ref.js.map +1 -0
  98. package/dist/esm/core/modules/container.js +305 -17
  99. package/dist/esm/core/modules/container.js.map +1 -1
  100. package/dist/esm/core/modules/module-container-factory.js +2 -2
  101. package/dist/esm/core/modules/module-container-factory.js.map +1 -1
  102. package/dist/esm/core/modules/module-container.js +55 -17
  103. package/dist/esm/core/modules/module-container.js.map +1 -1
  104. package/dist/esm/core/modules/module-token-factory.js.map +1 -1
  105. package/dist/esm/core/modules/modules-container.js +43 -3
  106. package/dist/esm/core/modules/modules-container.js.map +1 -1
  107. package/dist/esm/core/nexus-applications.browser.js +55 -13
  108. package/dist/esm/core/nexus-applications.browser.js.map +1 -1
  109. package/dist/esm/core/nexus-applications.js +439 -81
  110. package/dist/esm/core/nexus-applications.js.map +1 -1
  111. package/dist/esm/core/nexus-applications.server.js +55 -13
  112. package/dist/esm/core/nexus-applications.server.js.map +1 -1
  113. package/dist/esm/core/resolver/providers-container.js.map +1 -1
  114. package/dist/esm/core/resolver/resolution-context.js +58 -0
  115. package/dist/esm/core/resolver/resolution-context.js.map +1 -0
  116. package/dist/esm/core/resolver/resolver.js +524 -100
  117. package/dist/esm/core/resolver/resolver.js.map +1 -1
  118. package/dist/esm/decorators/inject.js +6 -3
  119. package/dist/esm/decorators/inject.js.map +1 -1
  120. package/dist/esm/decorators/injectable.js +0 -7
  121. package/dist/esm/decorators/injectable.js.map +1 -1
  122. package/dist/esm/decorators/{nsModule.js → module.js} +8 -6
  123. package/dist/esm/decorators/module.js.map +1 -0
  124. package/dist/esm/errors/bootstrap-error.js +42 -0
  125. package/dist/esm/errors/bootstrap-error.js.map +1 -0
  126. package/dist/esm/errors/child-errors.js +17 -0
  127. package/dist/esm/errors/child-errors.js.map +1 -0
  128. package/dist/esm/errors/index.js +6 -0
  129. package/dist/esm/errors/index.js.map +1 -0
  130. package/dist/esm/errors/injection-errors.js +20 -0
  131. package/dist/esm/errors/injection-errors.js.map +1 -0
  132. package/dist/esm/errors/lazy-module-errors.js +21 -0
  133. package/dist/esm/errors/lazy-module-errors.js.map +1 -0
  134. package/dist/esm/errors/provider-errors.js +84 -0
  135. package/dist/esm/errors/provider-errors.js.map +1 -0
  136. package/dist/esm/index.js +9 -4
  137. package/dist/esm/index.js.map +1 -1
  138. package/dist/esm/interfaces/index.js +1 -0
  139. package/dist/esm/interfaces/index.js.map +1 -1
  140. package/dist/esm/interfaces/modules/index.js +1 -0
  141. package/dist/esm/interfaces/modules/index.js.map +1 -1
  142. package/dist/esm/interfaces/modules/module-graph.interface.js +2 -0
  143. package/dist/esm/interfaces/modules/module-graph.interface.js.map +1 -1
  144. package/dist/esm/interfaces/modules/parent-link.interface.js +2 -0
  145. package/dist/esm/interfaces/modules/parent-link.interface.js.map +1 -0
  146. package/dist/esm/interfaces/on-module-destroy.interface.js +2 -0
  147. package/dist/esm/interfaces/on-module-destroy.interface.js.map +1 -0
  148. package/dist/esm/interfaces/scope.interface.js +1 -55
  149. package/dist/esm/interfaces/scope.interface.js.map +1 -1
  150. package/dist/esm/interfaces/validate-module-keys.js +2 -0
  151. package/dist/esm/interfaces/validate-module-keys.js.map +1 -1
  152. package/dist/esm/internal.js +3 -0
  153. package/dist/esm/internal.js.map +1 -0
  154. package/dist/esm/server.js +1 -1
  155. package/dist/esm/server.js.map +1 -1
  156. package/dist/esm/utils/forward-ref.js +10 -0
  157. package/dist/esm/utils/forward-ref.js.map +1 -0
  158. package/dist/esm/utils/helpers.js +14 -4
  159. package/dist/esm/utils/helpers.js.map +1 -1
  160. package/dist/esm/utils/lazy-module.js +29 -0
  161. package/dist/esm/utils/lazy-module.js.map +1 -0
  162. package/dist/types/browser.d.ts +1 -1
  163. package/dist/types/core/child-module.d.ts +8 -0
  164. package/dist/types/core/graph/analyze-lazy-module.d.ts +28 -0
  165. package/dist/types/core/graph/analyze-module.d.ts +4 -2
  166. package/dist/types/core/graph/analyze-provider.d.ts +4 -4
  167. package/dist/types/core/graph/module-graph.d.ts +200 -7
  168. package/dist/types/core/graph/providers/analyze-class-provider.d.ts +1 -1
  169. package/dist/types/core/graph/providers/analyze-factory-provider.d.ts +2 -2
  170. package/dist/types/core/graph/providers/analyze-value-provider.d.ts +1 -1
  171. package/dist/types/core/injection/injection-context.d.ts +29 -0
  172. package/dist/types/core/lazy-module-loader.d.ts +17 -0
  173. package/dist/types/core/module-ref.d.ts +34 -0
  174. package/dist/types/core/modules/container.d.ts +134 -18
  175. package/dist/types/core/modules/module-container-factory.d.ts +3 -3
  176. package/dist/types/core/modules/module-container.d.ts +44 -5
  177. package/dist/types/core/modules/module-token-factory.d.ts +2 -2
  178. package/dist/types/core/modules/modules-container.d.ts +23 -4
  179. package/dist/types/core/nexus-applications.browser.d.ts +30 -8
  180. package/dist/types/core/nexus-applications.d.ts +219 -55
  181. package/dist/types/core/nexus-applications.server.d.ts +30 -8
  182. package/dist/types/core/resolver/providers-container.d.ts +2 -2
  183. package/dist/types/core/resolver/resolution-context.d.ts +22 -0
  184. package/dist/types/core/resolver/resolver.d.ts +122 -4
  185. package/dist/types/decorators/inject.d.ts +9 -5
  186. package/dist/types/decorators/injectable.d.ts +0 -7
  187. package/dist/types/decorators/{nsModule.d.ts → module.d.ts} +6 -5
  188. package/dist/types/errors/bootstrap-error.d.ts +6 -0
  189. package/dist/types/errors/child-errors.d.ts +10 -0
  190. package/dist/types/errors/index.d.ts +5 -0
  191. package/dist/types/errors/injection-errors.d.ts +11 -0
  192. package/dist/types/errors/lazy-module-errors.d.ts +12 -0
  193. package/dist/types/errors/provider-errors.d.ts +47 -0
  194. package/dist/types/index.d.ts +13 -4
  195. package/dist/types/interfaces/abstract.interface.d.ts +1 -3
  196. package/dist/types/interfaces/dynamic-module.interface.d.ts +7 -5
  197. package/dist/types/interfaces/index.d.ts +1 -0
  198. package/dist/types/interfaces/injection-token.interface.d.ts +1 -3
  199. package/dist/types/interfaces/module-metadata.interface.d.ts +12 -4
  200. package/dist/types/interfaces/module-types.interface.d.ts +21 -24
  201. package/dist/types/interfaces/modules/container.interface.d.ts +10 -4
  202. package/dist/types/interfaces/modules/index.d.ts +1 -0
  203. package/dist/types/interfaces/modules/module-container-factory.interface.d.ts +2 -2
  204. package/dist/types/interfaces/modules/module-graph.interface.d.ts +85 -12
  205. package/dist/types/interfaces/modules/module-token-factory.interface.d.ts +2 -2
  206. package/dist/types/interfaces/modules/modules-container.interface.d.ts +5 -4
  207. package/dist/types/interfaces/modules/parent-link.interface.d.ts +12 -0
  208. package/dist/types/interfaces/nexus-application.interface.d.ts +49 -6
  209. package/dist/types/interfaces/on-module-destroy.interface.d.ts +3 -0
  210. package/dist/types/interfaces/plugins/scanner-plugin.interface.d.ts +1 -1
  211. package/dist/types/interfaces/scope.interface.d.ts +1 -54
  212. package/dist/types/interfaces/validate-module-keys.d.ts +1 -0
  213. package/dist/types/internal.d.ts +3 -0
  214. package/dist/types/server.d.ts +1 -1
  215. package/dist/types/utils/forward-ref.d.ts +5 -0
  216. package/dist/types/utils/helpers.d.ts +8 -8
  217. package/dist/types/utils/lazy-module.d.ts +20 -0
  218. package/package.json +23 -7
  219. package/dist/cjs/decorators/nsModule.js.map +0 -1
  220. package/dist/esm/decorators/nsModule.js.map +0 -1
  221. package/dist/tsconfig.cjs.tsbuildinfo +0 -1
  222. package/dist/tsconfig.esm.tsbuildinfo +0 -1
@@ -1,63 +1,299 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.NexusApplications = void 0;
3
+ exports.NexusApplication = void 0;
4
+ const shared_1 = require("@nexus-ioc/shared");
5
+ const errors_1 = require("../errors");
4
6
  const interfaces_1 = require("../interfaces");
5
7
  const hash_utils_1 = require("../utils/hash-utils");
8
+ const helpers_1 = require("../utils/helpers");
9
+ const lazy_module_1 = require("../utils/lazy-module");
10
+ const child_module_1 = require("./child-module");
11
+ const lazy_module_loader_1 = require("./lazy-module-loader");
12
+ const module_ref_1 = require("./module-ref");
6
13
  const container_1 = require("./modules/container");
14
+ function flattenErrors(error) {
15
+ return error instanceof AggregateError ? [...error.errors] : [error];
16
+ }
17
+ /** Closes `apps` one at a time, in order; returns their flattened errors. */
18
+ async function closeAll(apps) {
19
+ const errors = [];
20
+ for (const app of apps) {
21
+ try {
22
+ await app.close();
23
+ }
24
+ catch (error) {
25
+ errors.push(...flattenErrors(error));
26
+ }
27
+ }
28
+ return errors;
29
+ }
7
30
  /**
8
- * NexusApplications is the main application class that provides a high-level
31
+ * NexusApplication is the main application class that provides a high-level
9
32
  * API for creating and managing IoC containers.
10
33
  *
11
34
  * This class wraps the Container and provides additional features:
12
35
  * - Automatic singleton initialization
13
36
  * - Scanner plugin support for custom metadata processing
14
- * - Parent-child container hierarchies
15
- * - Async/sync container modes
37
+ * - Child containers for modules declared in `@Module({ children })`
38
+ * - Lazy/eager container modes
16
39
  *
17
40
  * @example
18
41
  * ```typescript
19
- * const app = NexusApplications.create(AppModule);
42
+ * const app = NexusApplication.create(AppModule);
20
43
  * await app.bootstrap();
21
- * const service = await app.get(MyService);
44
+ * const service = app.get(MyService);
22
45
  * ```
23
46
  */
24
- class NexusApplications {
47
+ class NexusApplication {
25
48
  /**
26
- * Creates a new NexusApplications instance.
49
+ * Creates a new NexusApplication instance.
27
50
  *
28
51
  * @param rootModule - The root module of the application
29
52
  * @param options - Optional configuration
30
53
  * @param options.hashFn - Custom hash function for module identification
31
54
  */
32
- constructor(rootModule, options) {
55
+ constructor(rootModule, options, child) {
33
56
  this.rootModule = rootModule;
34
- this.hashUtil = new hash_utils_1.HashUtil();
57
+ this.options = options;
35
58
  this.isAsyncContainer = false;
36
- this.container = new container_1.Container(this.hashUtil);
37
59
  this.scannerPlugins = [];
38
- this._parentContainer = null;
39
- if (options?.hashFn && typeof options?.hashFn === "function") {
40
- this.hashUtil = new options.hashFn();
41
- }
60
+ this.closePromise = null;
61
+ /**
62
+ * Children created by `createChild()` and not closed yet, in creation
63
+ * order. The only reference the parent keeps to a child.
64
+ */
65
+ this.liveChildren = new Set();
66
+ /**
67
+ * Lazy child code, per lazy ref id, with the token of the declaring
68
+ * module; a failed load is not cached, and an unload that destroys the
69
+ * declaring module drops the entry.
70
+ */
71
+ this.loadedChildren = new Map();
72
+ this.pendingLoads = new Set();
73
+ this.lazyModuleLoader = new lazy_module_loader_1.LazyModuleLoader((lazyModule) => this.load(lazyModule), (ref) => this.unload(ref));
74
+ this.hashUtil =
75
+ typeof options?.hashFn === "function"
76
+ ? new options.hashFn()
77
+ : new hash_utils_1.HashUtil();
78
+ this.container = new container_1.Container(this.hashUtil);
79
+ this.link = child?.link ?? null;
80
+ this.onClosed = child?.onClosed ?? null;
81
+ this.declaredIn = child?.declaredIn ?? null;
82
+ this.container.onUnloading((modules) => this.closeChildrenDeclaredIn(modules));
42
83
  }
43
84
  /**
44
- * Creates a new NexusApplications instance.
85
+ * Creates a new NexusApplication instance.
45
86
  *
46
87
  * This is the main entry point for creating an application.
47
88
  *
48
89
  * @param rootModule - The root module of the application
49
90
  * @param options - Optional configuration
50
91
  * @param options.hashFn - Custom hash function for module identification
51
- * @returns A new NexusApplications instance
92
+ * @returns A new NexusApplication instance
52
93
  *
53
94
  * @example
54
95
  * ```typescript
55
- * const app = NexusApplications.create(AppModule);
96
+ * const app = NexusApplication.create(AppModule);
56
97
  * await app.bootstrap();
57
98
  * ```
58
99
  */
59
100
  static create(rootModule, options) {
60
- return new NexusApplications(rootModule, options);
101
+ return new NexusApplication(rootModule, options);
102
+ }
103
+ /**
104
+ * Creates a not-yet-bootstrapped child application. Private: the only
105
+ * public way to get a child is `createChild()`.
106
+ */
107
+ static createAsChild(root, wiring, options) {
108
+ return new NexusApplication(root, options, wiring);
109
+ }
110
+ /**
111
+ * Creates a child application for a module declared in
112
+ * `@Module({ children })` somewhere in this application's graph. The
113
+ * child is returned bootstrapped, with its singletons created.
114
+ *
115
+ * - `Type` matches a declared class; `DynamicModule` matches by its
116
+ * `.module`; a `LazyModule` matches a declared ref by identity, and its
117
+ * loader runs once per ref (a failed load is retried next time).
118
+ * - `options.providers` are appended to the child root module's providers.
119
+ * - The child's `get()`/`resolve()` look in the child first, then at what
120
+ * the declaring module sees in this application, then up this
121
+ * application's own parent chain.
122
+ *
123
+ * @throws {ContainerNotCompiledError} If this application is not bootstrapped
124
+ * @throws {ContainerClosedError} If this application is closed or closing
125
+ * @throws {ChildModuleNotDeclaredError} If no module declares `child`, or
126
+ * (`reason: "unloaded"`) the lazy module declaring it was unloaded while
127
+ * the child was being created; the child is closed then
128
+ * @throws {LazyModuleLoadError} If a lazy child's loader fails or returns a non-module
129
+ *
130
+ * @example
131
+ * ```typescript
132
+ * @Module({ children: [ProfileModule] })
133
+ * class AppModule {}
134
+ *
135
+ * const app = await NexusApplication.create(AppModule).bootstrap();
136
+ * const profile = await app.createChild(ProfileModule, {
137
+ * providers: [{ provide: PROFILE_ID, useValue: "p1" }],
138
+ * });
139
+ * ```
140
+ */
141
+ async createChild(child, options) {
142
+ this.assertUsable();
143
+ const key = (0, lazy_module_1.isLazyModule)(child)
144
+ ? child
145
+ : (0, helpers_1.isDynamicModule)(child)
146
+ ? child.module
147
+ : child;
148
+ const childName = (0, lazy_module_1.isLazyModule)(child) ? child.name : (0, helpers_1.getModuleLabel)(child);
149
+ const declaredIn = this.container.graph.findChildDeclaration(key);
150
+ if (!declaredIn) {
151
+ throw new errors_1.ChildModuleNotDeclaredError(childName);
152
+ }
153
+ // The declaring module may live in a lazy segment that is unloaded
154
+ // (and maybe loaded again, as a new module) while this call awaits.
155
+ const assertStillDeclared = () => {
156
+ if (this.container.graph.findChildDeclaration(key) !== declaredIn) {
157
+ throw new errors_1.ChildModuleNotDeclaredError(childName, "unloaded");
158
+ }
159
+ };
160
+ let module;
161
+ if ((0, lazy_module_1.isLazyModule)(child)) {
162
+ try {
163
+ module = await this.loadChildModule(child, declaredIn.token);
164
+ }
165
+ catch (error) {
166
+ // A parent that started closing reports that, not the load failure.
167
+ this.assertOpen();
168
+ throw error;
169
+ }
170
+ // The parent may have started closing, or the declaring segment
171
+ // unloading, while the code loaded.
172
+ this.assertOpen();
173
+ assertStillDeclared();
174
+ }
175
+ else {
176
+ module = child;
177
+ }
178
+ const app = NexusApplication.createAsChild((0, child_module_1.withExtraProviders)(module, options?.providers), {
179
+ link: this.linkFor(declaredIn),
180
+ onClosed: () => this.liveChildren.delete(app),
181
+ declaredIn: declaredIn.token,
182
+ }, this.options);
183
+ // Registered before bootstrap so a concurrent close() sees it.
184
+ this.liveChildren.add(app);
185
+ // Only this application can close a child still bootstrapping: its
186
+ // close() cascade or an unload of the declaring module. The caller
187
+ // hears about the parent closing first, then about the unload.
188
+ const reportClosedWhileCreating = () => {
189
+ this.assertOpen();
190
+ if (app.isClosed) {
191
+ throw new errors_1.ChildModuleNotDeclaredError(childName, "unloaded");
192
+ }
193
+ assertStillDeclared();
194
+ };
195
+ try {
196
+ await app.bootstrap();
197
+ }
198
+ catch (error) {
199
+ const closedByParent = app.isClosed;
200
+ this.liveChildren.delete(app);
201
+ await app.close().catch(() => undefined);
202
+ this.assertOpen();
203
+ if (closedByParent) {
204
+ reportClosedWhileCreating();
205
+ }
206
+ throw error;
207
+ }
208
+ try {
209
+ reportClosedWhileCreating();
210
+ }
211
+ catch (error) {
212
+ await app.close();
213
+ throw error;
214
+ }
215
+ return app;
216
+ }
217
+ /** Runs a lazy child's loader once per ref; a failure is not cached. */
218
+ loadChildModule(ref, declaredIn) {
219
+ const cached = this.loadedChildren.get(ref.id);
220
+ if (cached) {
221
+ return cached.module;
222
+ }
223
+ const entry = {
224
+ declaredIn,
225
+ module: this.runChildLoader(ref).catch((error) => {
226
+ // Only this load's entry: an unload may have dropped it already.
227
+ if (this.loadedChildren.get(ref.id) === entry) {
228
+ this.loadedChildren.delete(ref.id);
229
+ }
230
+ throw error;
231
+ }),
232
+ };
233
+ this.loadedChildren.set(ref.id, entry);
234
+ return entry.module;
235
+ }
236
+ async runChildLoader(ref) {
237
+ let loaded;
238
+ try {
239
+ loaded = await ref.load();
240
+ }
241
+ catch (error) {
242
+ throw new errors_1.LazyModuleLoadError(ref.name, error instanceof Error ? error.message : String(error));
243
+ }
244
+ const metatype = loaded && (0, helpers_1.isDynamicModule)(loaded) ? loaded.module : loaded;
245
+ if (typeof metatype !== "function" ||
246
+ !Reflect.hasMetadata(interfaces_1.MODULE_WATERMARK, metatype)) {
247
+ throw new errors_1.LazyModuleLoadError(ref.name, "loader did not return a class decorated with @Module()");
248
+ }
249
+ return loaded;
250
+ }
251
+ /**
252
+ * The link a child declared in `declaredIn` uses: what that module sees
253
+ * in this application, then this application's own parent chain. It
254
+ * never caches instances, only which tokens the declaring module sees,
255
+ * so a `canProvide` followed by `get` walks the imports once per token
256
+ * (until a load or unload changes the graph) instead of twice per call.
257
+ * Once this application closes, `canProvide` still answers from the
258
+ * graph, so `get`/`resolve` of a token the child would have taken from
259
+ * here throw `ContainerClosedError` (even with `optional`) instead of
260
+ * quietly reporting it missing.
261
+ */
262
+ linkFor(declaredIn) {
263
+ // Memoised per token: the visibility walk is a breadth-first search
264
+ // over the declaring module's imports. Valid until a load or unload
265
+ // changes the graph, which bumps `graph.version`.
266
+ const visibility = new Map();
267
+ let visibilityVersion = -1;
268
+ const seesLocally = (token) => {
269
+ const { version } = this.container.graph;
270
+ if (version !== visibilityVersion) {
271
+ visibility.clear();
272
+ visibilityVersion = version;
273
+ }
274
+ let sees = visibility.get(token);
275
+ if (sees === undefined) {
276
+ sees =
277
+ this.container.hasProvider(token) &&
278
+ this.container.graph.isProviderVisible(declaredIn, token);
279
+ visibility.set(token, sees);
280
+ }
281
+ return sees;
282
+ };
283
+ return {
284
+ canProvide: (token) => seesLocally(token) || (this.link?.canProvide(token) ?? false),
285
+ get: (token) => seesLocally(token)
286
+ ? this.container.get(token)
287
+ : this.requireLink(token).get(token),
288
+ resolve: (token) => seesLocally(token)
289
+ ? this.container.resolve(token)
290
+ : this.requireLink(token).resolve(token),
291
+ };
292
+ }
293
+ requireLink(token) {
294
+ if (!this.link)
295
+ throw new errors_1.ProviderNotFoundError(token);
296
+ return this.link;
61
297
  }
62
298
  /**
63
299
  * Bootstraps the application by initializing the container and all providers.
@@ -72,26 +308,135 @@ class NexusApplications {
72
308
  *
73
309
  * @example
74
310
  * ```typescript
75
- * const app = NexusApplications.create(AppModule);
311
+ * const app = NexusApplication.create(AppModule);
76
312
  * await app.bootstrap();
77
313
  * // Application is now ready to use
78
314
  * ```
79
315
  */
80
- async bootstrap() {
81
- await this.container.run(this.rootModule);
316
+ async bootstrap(options) {
317
+ await this.container.run(this.rootModule, [(0, lazy_module_loader_1.createInternalModule)(this.lazyModuleLoader)], this.link ? { link: this.link } : {});
82
318
  for (const scannerPlugin of this.scannerPlugins) {
83
319
  await scannerPlugin.scan(this.container.graph);
84
320
  }
85
- if (!this.isAsyncContainer) {
86
- for (const [token, node] of this.container.graph.nodes) {
87
- if (node.type === interfaces_1.NodeTypeEnum.PROVIDER &&
88
- node.scope === interfaces_1.Scope.Singleton) {
89
- await this.container.get(token);
90
- }
91
- }
321
+ if (this.container.errors.length > 0 && options?.throwOnError !== false) {
322
+ throw new errors_1.BootstrapError(this.container.errors);
92
323
  }
324
+ await this.warmUpSingletons(this.container.graph.nodes.keys());
93
325
  return this;
94
326
  }
327
+ /**
328
+ * Pre-instantiates the singleton providers named by `tokens`, unless the
329
+ * application is running in lazy mode.
330
+ */
331
+ async warmUpSingletons(tokens) {
332
+ if (this.isAsyncContainer) {
333
+ return;
334
+ }
335
+ await this.container.instantiateSingletons(tokens);
336
+ }
337
+ /**
338
+ * Closes the application and cleans up resources.
339
+ *
340
+ * - The closed flag is set synchronously: from this call on, `get`,
341
+ * `resolve` and `load` throw `ContainerClosedError`.
342
+ * - Waits for in-flight lazy loads, then runs on the compile queue so it
343
+ * never interleaves with `load`/`unload`.
344
+ * - Calls every `onModuleDestroy` in reverse creation order, even if some
345
+ * throw; failures are collected into a single `AggregateError`.
346
+ * - Idempotent: later calls return the same promise.
347
+ * - A child application removes itself from its parent's live children
348
+ * once closed.
349
+ *
350
+ * @returns A promise that resolves when the application is closed
351
+ * @throws {AggregateError} If one or more `onModuleDestroy` hooks failed
352
+ *
353
+ * @example
354
+ * ```typescript
355
+ * const app = await NexusApplication.create(AppModule).bootstrap();
356
+ * await app.close();
357
+ * ```
358
+ */
359
+ close() {
360
+ if (!this.closePromise) {
361
+ // Mark the container closed before draining, so module refs are
362
+ // rejected during the drain window too.
363
+ this.container.markClosed();
364
+ this.closePromise = this.closeChildrenThenSelf().finally(() => {
365
+ this.onClosed?.();
366
+ });
367
+ }
368
+ return this.closePromise;
369
+ }
370
+ /**
371
+ * Closes the live children (newest first, one at a time), then this
372
+ * application. Every failure, a child's or its own, ends up in one
373
+ * `AggregateError`, flattened so a child's `AggregateError` contributes
374
+ * its errors rather than nesting.
375
+ */
376
+ async closeChildrenThenSelf() {
377
+ const errors = await closeAll([...this.liveChildren].reverse());
378
+ try {
379
+ await this.drainAndClose();
380
+ }
381
+ catch (error) {
382
+ errors.push(...flattenErrors(error));
383
+ }
384
+ if (errors.length > 0) {
385
+ throw new AggregateError(errors, "One or more onModuleDestroy hooks failed");
386
+ }
387
+ }
388
+ /**
389
+ * Waits for in-flight `load()` calls (including their singleton warm-up,
390
+ * which bypasses the closed guard) so nothing is instantiated after the
391
+ * destroy pass, then tears the container down.
392
+ */
393
+ async drainAndClose() {
394
+ await Promise.allSettled([...this.pendingLoads]);
395
+ await this.container.close();
396
+ }
397
+ /**
398
+ * Unload hook (see `Container.onUnloading`): closes the live children
399
+ * declared by a module the unload destroys, newest first, and forgets
400
+ * the lazy child code those modules declared.
401
+ */
402
+ async closeChildrenDeclaredIn(destroyedModules) {
403
+ const destroyed = new Set(destroyedModules);
404
+ for (const [id, entry] of this.loadedChildren) {
405
+ if (destroyed.has(entry.declaredIn)) {
406
+ this.loadedChildren.delete(id);
407
+ }
408
+ }
409
+ const doomed = [...this.liveChildren]
410
+ .filter((child) => child.declaredIn && destroyed.has(child.declaredIn))
411
+ .reverse();
412
+ // A child someone else is already closing is waited for (it may still
413
+ // use the parent's providers) but neither counted nor re-reported.
414
+ const closingElsewhere = doomed.filter((child) => child.isClosed);
415
+ const started = doomed.filter((child) => !child.isClosed);
416
+ const errors = await closeAll(started);
417
+ await Promise.allSettled(closingElsewhere.map((child) => child.close()));
418
+ return {
419
+ closed: started.length,
420
+ error: errors.length > 0
421
+ ? new AggregateError(errors, "One or more child applications failed to close")
422
+ : undefined,
423
+ };
424
+ }
425
+ /** True once `close()` has been called (the app may still be closing). */
426
+ get isClosed() {
427
+ return this.closePromise !== null;
428
+ }
429
+ assertOpen() {
430
+ if (this.closePromise) {
431
+ throw new errors_1.ContainerClosedError();
432
+ }
433
+ }
434
+ assertUsable() {
435
+ this.assertOpen();
436
+ if (!this.container.isCompiled) {
437
+ throw new shared_1.ContainerNotCompiledError();
438
+ }
439
+ }
95
440
  /**
96
441
  * Adds one or more scanner plugins to the application.
97
442
  *
@@ -104,7 +449,7 @@ class NexusApplications {
104
449
  *
105
450
  * @example
106
451
  * ```typescript
107
- * const app = NexusApplications.create(AppModule)
452
+ * const app = NexusApplication.create(AppModule)
108
453
  * .addScannerPlugin(new CustomScanner())
109
454
  * .addScannerPlugin([new Scanner1(), new Scanner2()]);
110
455
  * await app.bootstrap();
@@ -115,30 +460,63 @@ class NexusApplications {
115
460
  this.scannerPlugins.push(...plugins);
116
461
  return this;
117
462
  }
463
+ get(token, options = {}) {
464
+ this.assertUsable();
465
+ if (this.container.hasProvider(token)) {
466
+ return this.container.get(token);
467
+ }
468
+ if (this.link?.canProvide(token)) {
469
+ return this.link.get(token);
470
+ }
471
+ if (options.optional) {
472
+ return undefined;
473
+ }
474
+ throw new errors_1.ProviderNotFoundError(token);
475
+ }
476
+ async resolve(token, options = {}) {
477
+ this.assertUsable();
478
+ if (this.container.hasProvider(token)) {
479
+ return this.container.resolve(token);
480
+ }
481
+ if (this.link?.canProvide(token)) {
482
+ return this.link.resolve(token);
483
+ }
484
+ if (options.optional) {
485
+ return undefined;
486
+ }
487
+ throw new errors_1.ProviderNotFoundError(token);
488
+ }
118
489
  /**
119
- * Resolves and returns an instance of a provider by its injection token.
120
- *
121
- * If the provider is not found in this container, it will attempt to
122
- * resolve it from the parent container (if set).
123
- *
124
- * @template T - The type of the provider to resolve
125
- * @param token - The injection token (class, string, or symbol)
126
- * @returns A promise that resolves to the provider instance, or undefined if not found
490
+ * Loads a lazy module declared with `lazy()` into this application's
491
+ * container and returns a handle to it. Repeated calls for the same ref
492
+ * return the same providers; the loader runs once.
127
493
  *
128
- * @example
129
- * ```typescript
130
- * const app = await NexusApplications.create(AppModule).bootstrap();
131
- * const userService = await app.get(UserService);
132
- * const config = await app.get('CONFIG');
133
- * ```
494
+ * @throws {LazyModuleLoadError} if the loader fails or returns a non-module
495
+ * @throws {LazyModuleGraphError} if the module's dependency graph is invalid
134
496
  */
135
- async get(token) {
136
- const dependency = await this.container.get(token);
137
- // Check for undefined specifically, not falsy values (null, 0, false, etc. are valid)
138
- if (dependency === undefined) {
139
- return this._parentContainer?.get(token);
497
+ async load(lazyModule) {
498
+ this.assertOpen();
499
+ const loading = this.loadAndWarmUp(lazyModule);
500
+ this.pendingLoads.add(loading);
501
+ try {
502
+ return await loading;
503
+ }
504
+ finally {
505
+ this.pendingLoads.delete(loading);
140
506
  }
141
- return dependency;
507
+ }
508
+ async loadAndWarmUp(lazyModule) {
509
+ const segment = await this.container.load(lazyModule);
510
+ await this.warmUpSingletons(segment.providerTokens);
511
+ return new module_ref_1.ModuleRef(this.container, segment);
512
+ }
513
+ /**
514
+ * Unloads a lazy module previously returned by `load()` (directly or via
515
+ * `LazyModuleLoader`): destroys every singleton and module nothing else
516
+ * still needs. A no-op if `ref` is already unloaded.
517
+ */
518
+ async unload(ref) {
519
+ return ref.unload();
142
520
  }
143
521
  /**
144
522
  * Gets all errors that occurred during graph compilation.
@@ -147,7 +525,7 @@ class NexusApplications {
147
525
  *
148
526
  * @example
149
527
  * ```typescript
150
- * const app = await NexusApplications.create(AppModule).bootstrap();
528
+ * const app = await NexusApplication.create(AppModule).bootstrap();
151
529
  * if (app.errors.length > 0) {
152
530
  * console.error('Application errors:', app.errors);
153
531
  * }
@@ -157,48 +535,28 @@ class NexusApplications {
157
535
  return this.container.errors;
158
536
  }
159
537
  /**
160
- * Enables async mode for the container.
538
+ * Enables lazy mode for the container.
539
+ *
540
+ * In lazy mode, singleton providers are NOT pre-instantiated during
541
+ * bootstrap. They will be created lazily on first access via resolve();
542
+ * get() throws ProviderNotInstantiatedError until then.
161
543
  *
162
- * In async mode, singleton providers are NOT pre-instantiated during
163
- * bootstrap. They will be created lazily on first access via get().
164
- * This can improve startup time for large applications.
544
+ * @deprecated Use lazy modules (lazy()/load()) instead; in this mode get() throws ProviderNotInstantiatedError until resolve() is called.
165
545
  *
166
546
  * @returns This instance for method chaining
167
547
  *
168
548
  * @example
169
549
  * ```typescript
170
- * const app = NexusApplications.create(AppModule)
171
- * .async();
550
+ * const app = NexusApplication.create(AppModule)
551
+ * .lazy();
172
552
  * await app.bootstrap(); // Singletons are NOT created yet
173
- * const service = await app.get(MyService); // Created on first access
553
+ * const service = await app.resolve(MyService); // Created on first access
174
554
  * ```
175
555
  */
176
- async() {
556
+ lazy() {
177
557
  this.isAsyncContainer = true;
178
558
  return this;
179
559
  }
180
- /**
181
- * Sets a parent container for this application.
182
- *
183
- * When a provider is not found in this container, it will be looked up
184
- * in the parent container. This enables hierarchical container structures.
185
- *
186
- * @param parentContainer - The parent container
187
- * @returns This instance for method chaining
188
- *
189
- * @example
190
- * ```typescript
191
- * const parentApp = await NexusApplications.create(ParentModule).bootstrap();
192
- * const childApp = await NexusApplications.create(ChildModule)
193
- * .setParent(parentApp)
194
- * .bootstrap();
195
- * // childApp can access providers from parentApp
196
- * ```
197
- */
198
- setParent(parentContainer) {
199
- this._parentContainer = parentContainer;
200
- return this;
201
- }
202
560
  }
203
- exports.NexusApplications = NexusApplications;
561
+ exports.NexusApplication = NexusApplication;
204
562
  //# sourceMappingURL=nexus-applications.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"nexus-applications.js","sourceRoot":"","sources":["../../../src/core/nexus-applications.ts"],"names":[],"mappings":";;;AAAA,8CAQuB;AACvB,oDAA+C;AAC/C,mDAAgD;AAEhD;;;;;;;;;;;;;;;;GAgBG;AACH,MAAa,iBAAiB;IAO7B;;;;;;OAMG;IACH,YACkB,UAAkB,EACnC,OAAiD;QADhC,eAAU,GAAV,UAAU,CAAQ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;IACb,CAAC;IAED;;;;;;;;;;;;;;;;;OAiBG;IACI,gBAAgB,CACtB,OAA0D;QAE1D,MAAM,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC;QAC7D,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC,CAAC;QACrC,OAAO,IAAI,CAAC;IACb,CAAC;IAED;;;;;;;;;;;;;;;;OAgBG;IACI,KAAK,CAAC,GAAG,CAAI,KAAqB;QACxC,MAAM,UAAU,GAAG,MAAM,IAAI,CAAC,SAAS,CAAC,GAAG,CAAI,KAAK,CAAC,CAAC;QAEtD,sFAAsF;QACtF,IAAI,UAAU,KAAK,SAAS,EAAE,CAAC;YAC9B,OAAO,IAAI,CAAC,gBAAgB,EAAE,GAAG,CAAI,KAAK,CAAC,CAAC;QAC7C,CAAC;QAED,OAAO,UAAU,CAAC;IACnB,CAAC;IAED;;;;;;;;;;;;OAYG;IACH,IAAW,MAAM;QAChB,OAAO,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC;IAC9B,CAAC;IAED;;;;;;;;;;;;;;;;OAgBG;IACI,KAAK;QACX,IAAI,CAAC,gBAAgB,GAAG,IAAI,CAAC;QAC7B,OAAO,IAAI,CAAC;IACb,CAAC;IAED;;;;;;;;;;;;;;;;;OAiBG;IACI,SAAS,CAAC,eAA0C;QAC1D,IAAI,CAAC,gBAAgB,GAAG,eAAe,CAAC;QACxC,OAAO,IAAI,CAAC;IACb,CAAC;CACD;AAxMD,8CAwMC"}
1
+ {"version":3,"file":"nexus-applications.js","sourceRoot":"","sources":["../../../src/core/nexus-applications.ts"],"names":[],"mappings":";;;AAAA,8CAA8D;AAC9D,sCAMmB;AACnB,8CAeuB;AACvB,oDAA+C;AAC/C,8CAAmE;AACnE,sDAAoD;AACpD,iDAAoD;AACpD,6DAA8E;AAC9E,6CAAyC;AACzC,mDAA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