@nestjs/cli 10.1.10 → 10.1.11

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.
@@ -97,8 +97,8 @@ class BuildAction extends abstract_action_1.AbstractAction {
97
97
  if (watchMode) {
98
98
  const { WatchCompiler } = await Promise.resolve().then(() => require('../lib/compiler/watch-compiler'));
99
99
  const watchCompiler = new WatchCompiler(this.pluginsLoader, this.tsConfigProvider, this.tsLoader);
100
- const isPreserveWatchOutputEnabled = options.find((option) => option.name === 'preserveWatchOutput' && option.value === true);
101
- watchCompiler.run(configuration, pathToTsconfig, appName, { preserveWatchOutput: !!isPreserveWatchOutputEnabled }, onSuccess);
100
+ const isPreserveWatchOutputEnabled = options.find((option) => option.name === 'preserveWatchOutput' && option.value === true)?.value;
101
+ watchCompiler.run(configuration, pathToTsconfig, appName, { preserveWatchOutput: isPreserveWatchOutputEnabled }, onSuccess);
102
102
  }
103
103
  else {
104
104
  const { Compiler } = await Promise.resolve().then(() => require('../lib/compiler/compiler'));
@@ -15,7 +15,8 @@ class BuildCommand extends abstract_command_1.AbstractCommand {
15
15
  .option('--webpack', 'Use webpack for compilation (deprecated option, use --builder instead).')
16
16
  .option('--type-check', 'Enable type checking (when SWC is used).')
17
17
  .option('--webpackPath [path]', 'Path to webpack configuration.')
18
- .option('--tsc', 'Use tsc for compilation.')
18
+ .option('--tsc', 'Use typescript compiler for compilation.')
19
+ .option('--preserveWatchOutput', 'Use "preserveWatchOutput" option when using tsc watch mode.')
19
20
  .description('Build Nest application.')
20
21
  .action(async (app, command) => {
21
22
  const options = [];
@@ -53,6 +54,12 @@ class BuildCommand extends abstract_command_1.AbstractCommand {
53
54
  name: 'typeCheck',
54
55
  value: command.typeCheck,
55
56
  });
57
+ options.push({
58
+ name: 'preserveWatchOutput',
59
+ value: !!command.preserveWatchOutput &&
60
+ !!command.watch &&
61
+ !isWebpackEnabled,
62
+ });
56
63
  const inputs = [];
57
64
  inputs.push({ name: 'app', value: app });
58
65
  await this.action.handle(inputs, options);
@@ -17,11 +17,11 @@ class StartCommand extends abstract_command_1.AbstractCommand {
17
17
  .option('--webpack', 'Use webpack for compilation (deprecated option, use --builder instead).')
18
18
  .option('--webpackPath [path]', 'Path to webpack configuration.')
19
19
  .option('--type-check', 'Enable type checking (when SWC is used).')
20
- .option('--tsc', 'Use tsc for compilation.')
20
+ .option('--tsc', 'Use typescript compiler for compilation.')
21
21
  .option('--sourceRoot [sourceRoot]', 'Points at the root of the source code for the single project in standard mode structures, or the default project in monorepo mode structures.')
22
22
  .option('--entryFile [entryFile]', "Path to the entry file where this command will work with. Defaults to the one defined at your Nest's CLI config file.")
23
23
  .option('-e, --exec [binary]', 'Binary to run (default: "node").')
24
- .option('--preserveWatchOutput', 'Use "preserveWatchOutput" option when tsc watch mode.')
24
+ .option('--preserveWatchOutput', 'Use "preserveWatchOutput" option when using tsc watch mode.')
25
25
  .description('Run Nest application.')
26
26
  .action(async (app, command) => {
27
27
  const options = [];
@@ -20,7 +20,7 @@ const swcDefaultsFactory = (tsOptions, configuration) => {
20
20
  transform: {
21
21
  legacyDecorator: true,
22
22
  decoratorMetadata: true,
23
- useDefineForClassFields: false
23
+ useDefineForClassFields: false,
24
24
  },
25
25
  keepClassNames: true,
26
26
  baseUrl: tsOptions?.baseUrl,
@@ -4,7 +4,11 @@ import { TsConfigProvider } from './helpers/tsconfig-provider';
4
4
  import { PluginsLoader } from './plugins/plugins-loader';
5
5
  import { TypeScriptBinaryLoader } from './typescript-loader';
6
6
  type TypescriptWatchCompilerExtras = {
7
- preserveWatchOutput: boolean;
7
+ /**
8
+ * If `undefined`, the value of 'preserveWatchOutput' option from tsconfig
9
+ * file will be used instead.
10
+ */
11
+ preserveWatchOutput: boolean | undefined;
8
12
  };
9
13
  export declare class WatchCompiler extends BaseCompiler<TypescriptWatchCompilerExtras> {
10
14
  private readonly tsConfigProvider;
@@ -24,7 +24,7 @@ class WatchCompiler extends base_compiler_1.BaseCompiler {
24
24
  const origWatchStatusReporter = tsBin.createWatchStatusReporter(tsBin.sys, true);
25
25
  const host = tsBin.createWatchCompilerHost(configPath, {
26
26
  ...options,
27
- preserveWatchOutput: extras.preserveWatchOutput,
27
+ preserveWatchOutput: extras.preserveWatchOutput ?? options.preserveWatchOutput,
28
28
  }, tsBin.sys, createProgram, this.createDiagnosticReporter(origDiagnosticReporter), this.createWatchStatusChanged(origWatchStatusReporter, onSuccess));
29
29
  const manualRestart = (0, get_value_or_default_1.getValueOrDefault)(configuration, 'compilerOptions.manualRestart', appName);
30
30
  const plugins = this.loadPlugins(configuration, tsConfigPath, appName);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nestjs/cli",
3
- "version": "10.1.10",
3
+ "version": "10.1.11",
4
4
  "description": "Nest - modern, fast, powerful node.js web framework (@cli)",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -65,25 +65,25 @@
65
65
  "@commitlint/cli": "17.6.7",
66
66
  "@commitlint/config-angular": "17.6.7",
67
67
  "@swc/cli": "0.1.62",
68
- "@swc/core": "1.3.70",
68
+ "@swc/core": "1.3.72",
69
69
  "@types/inquirer": "8.2.6",
70
70
  "@types/jest": "29.5.3",
71
- "@types/node": "18.16.19",
71
+ "@types/node": "18.17.1",
72
72
  "@types/node-emoji": "1.8.2",
73
73
  "@types/shelljs": "0.8.12",
74
74
  "@types/webpack-node-externals": "3.0.0",
75
- "@typescript-eslint/eslint-plugin": "6.1.0",
76
- "@typescript-eslint/parser": "6.1.0",
75
+ "@typescript-eslint/eslint-plugin": "6.2.0",
76
+ "@typescript-eslint/parser": "6.2.0",
77
77
  "delete-empty": "3.0.0",
78
- "eslint": "8.45.0",
79
- "eslint-config-prettier": "8.8.0",
78
+ "eslint": "8.46.0",
79
+ "eslint-config-prettier": "8.9.0",
80
80
  "gulp": "4.0.2",
81
81
  "gulp-clean": "0.4.0",
82
82
  "husky": "8.0.3",
83
- "jest": "29.6.1",
83
+ "jest": "29.6.2",
84
84
  "lint-staged": "13.2.3",
85
85
  "prettier": "3.0.0",
86
- "release-it": "16.1.2",
86
+ "release-it": "16.1.3",
87
87
  "ts-jest": "29.1.1",
88
88
  "ts-loader": "9.4.4"
89
89
  },