@nestjs/core 10.2.9 → 10.3.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/Readme.md CHANGED
@@ -83,7 +83,10 @@ Nest is an MIT-licensed open source project. It can grow thanks to the sponsors
83
83
  <a href="https://fuseautotech.com/" target="_blank"><img src="https://nestjs.com/img/fuse-logo.svg" width="105" valign="middle" /></a></td>
84
84
  <td>
85
85
  <a href="https://ridicorp.com/career/" target="_blank"><img src="https://nestjs.com/img/ridi-logo.svg" width="105" valign="middle" /></a></td><td>
86
- <a href="https://www.movavi.com/imovie-for-windows.html" target="_blank"><img src="https://nestjs.com/img/movavi-logo.svg" width="105" valign="middle" /></a></td></</tr></table>
86
+ <a href="https://www.movavi.com/imovie-for-windows.html" target="_blank"><img src="https://nestjs.com/img/movavi-logo.svg" width="105" valign="middle" /></a></td>
87
+ </tr><tr><td>
88
+ <a href="https://skunk.team" target="_blank"><img src="https://nestjs.com/img/skunk-logo.png" height="60" valign="middle" /></a></td>
89
+ </tr></table>
87
90
 
88
91
  #### Silver Sponsors
89
92
 
@@ -1,4 +1,4 @@
1
1
  import { RuntimeException } from './runtime.exception';
2
2
  export declare class UnknownModuleException extends RuntimeException {
3
- constructor();
3
+ constructor(moduleName?: string);
4
4
  }
@@ -3,8 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.UnknownModuleException = void 0;
4
4
  const runtime_exception_1 = require("./runtime.exception");
5
5
  class UnknownModuleException extends runtime_exception_1.RuntimeException {
6
- constructor() {
7
- super('Nest could not select the given module (it does not exist in current context)');
6
+ constructor(moduleName) {
7
+ super(`Nest could not select the given module (${moduleName ? `"${moduleName}"` : 'it'} does not exist in current context).`);
8
8
  }
9
9
  }
10
10
  exports.UnknownModuleException = UnknownModuleException;
@@ -23,15 +23,15 @@ class InternalCoreModuleFactory {
23
23
  return internal_core_module_1.InternalCoreModule.register([
24
24
  {
25
25
  provide: external_context_creator_1.ExternalContextCreator,
26
- useValue: external_context_creator_1.ExternalContextCreator.fromContainer(container),
26
+ useFactory: () => external_context_creator_1.ExternalContextCreator.fromContainer(container),
27
27
  },
28
28
  {
29
29
  provide: modules_container_1.ModulesContainer,
30
- useValue: container.getModules(),
30
+ useFactory: () => container.getModules(),
31
31
  },
32
32
  {
33
33
  provide: http_adapter_host_1.HttpAdapterHost,
34
- useValue: httpAdapterHost,
34
+ useFactory: () => httpAdapterHost,
35
35
  },
36
36
  {
37
37
  provide: lazy_module_loader_1.LazyModuleLoader,
@@ -39,7 +39,7 @@ class InternalCoreModuleFactory {
39
39
  },
40
40
  {
41
41
  provide: serialized_graph_1.SerializedGraph,
42
- useValue: container.serializedGraph,
42
+ useFactory: () => container.serializedGraph,
43
43
  },
44
44
  ]);
45
45
  }
@@ -57,7 +57,7 @@ class NestApplicationContext extends abstract_instance_resolver_1.AbstractInstan
57
57
  const token = moduleTokenFactory.create(type, dynamicMetadata);
58
58
  const selectedModule = modulesContainer.get(token);
59
59
  if (!selectedModule) {
60
- throw new exceptions_1.UnknownModuleException();
60
+ throw new exceptions_1.UnknownModuleException(type.name);
61
61
  }
62
62
  return new NestApplicationContext(this.container, this.appOptions, selectedModule, scope);
63
63
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nestjs/core",
3
- "version": "10.2.9",
3
+ "version": "10.3.0",
4
4
  "description": "Nest - modern, fast, powerful node.js web framework (@core)",
5
5
  "author": "Kamil Mysliwiec",
6
6
  "license": "MIT",
@@ -36,7 +36,7 @@
36
36
  "uid": "2.0.2"
37
37
  },
38
38
  "devDependencies": {
39
- "@nestjs/common": "10.2.9"
39
+ "@nestjs/common": "10.3.0"
40
40
  },
41
41
  "peerDependencies": {
42
42
  "@nestjs/common": "^10.0.0",
package/repl/repl.d.ts CHANGED
@@ -1,3 +1,4 @@
1
1
  /// <reference types="node" />
2
2
  import { DynamicModule, Type } from '@nestjs/common';
3
- export declare function repl(module: Type | DynamicModule): Promise<import("repl").REPLServer>;
3
+ import type { ReplOptions } from 'repl';
4
+ export declare function repl(module: Type | DynamicModule, replOptions?: ReplOptions): Promise<import("repl").REPLServer>;
package/repl/repl.js CHANGED
@@ -9,7 +9,7 @@ const constants_1 = require("./constants");
9
9
  const repl_context_1 = require("./repl-context");
10
10
  const repl_logger_1 = require("./repl-logger");
11
11
  const repl_native_commands_1 = require("./repl-native-commands");
12
- async function repl(module) {
12
+ async function repl(module, replOptions = {}) {
13
13
  const app = await nest_factory_1.NestFactory.createApplicationContext(module, {
14
14
  abortOnError: false,
15
15
  logger: new repl_logger_1.ReplLogger(),
@@ -21,6 +21,7 @@ async function repl(module) {
21
21
  const replServer = _repl.start({
22
22
  prompt: cli_colors_util_1.clc.green('> '),
23
23
  ignoreUndefined: true,
24
+ ...replOptions,
24
25
  });
25
26
  (0, assign_to_object_util_1.assignToObject)(replServer.context, replContext.globalScope);
26
27
  (0, repl_native_commands_1.defineDefaultCommandsOnRepl)(replServer);