@nestjs/cli 10.1.14 → 10.1.15

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.
@@ -2,10 +2,10 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SwcCompiler = void 0;
4
4
  const chalk = require("chalk");
5
- const path = require("path");
6
5
  const child_process_1 = require("child_process");
7
6
  const chokidar = require("chokidar");
8
7
  const fs_1 = require("fs");
8
+ const path = require("path");
9
9
  const path_1 = require("path");
10
10
  const ui_1 = require("../../ui");
11
11
  const tree_kill_1 = require("../../utils/tree-kill");
@@ -28,7 +28,7 @@ class SwcCompiler extends base_compiler_1.BaseCompiler {
28
28
  if (extras.typeCheck) {
29
29
  this.runTypeChecker(configuration, tsConfigPath, appName, extras);
30
30
  }
31
- await this.runSwc(configuration, swcOptions, extras, swcrcFilePath);
31
+ await this.runSwc(swcOptions, extras, swcrcFilePath);
32
32
  if (onSuccess) {
33
33
  onSuccess();
34
34
  const debounceTime = 150;
@@ -40,7 +40,7 @@ class SwcCompiler extends base_compiler_1.BaseCompiler {
40
40
  if (extras.typeCheck) {
41
41
  await this.runTypeChecker(configuration, tsConfigPath, appName, extras);
42
42
  }
43
- await this.runSwc(configuration, swcOptions, extras, swcrcFilePath);
43
+ await this.runSwc(swcOptions, extras, swcrcFilePath);
44
44
  if (onSuccess) {
45
45
  onSuccess();
46
46
  }
@@ -96,20 +96,16 @@ class SwcCompiler extends base_compiler_1.BaseCompiler {
96
96
  });
97
97
  }
98
98
  }
99
- async runSwc(configuration, options, extras, swcrcFilePath) {
99
+ async runSwc(options, extras, swcrcFilePath) {
100
100
  process.nextTick(() => console.log(constants_1.SWC_LOG_PREFIX, chalk.cyan('Running...')));
101
101
  const swcCli = this.loadSwcCliBinary();
102
102
  const swcRcFile = await this.getSwcRcFileContentIfExists(swcrcFilePath);
103
103
  const swcOptions = this.deepMerge(options.swcOptions, swcRcFile);
104
- // jsc.baseUrl should be resolved by the caller, if it's passed as an object.
105
- // https://github.com/swc-project/swc/pull/7827
106
- if (swcOptions?.jsc?.baseUrl) {
107
- if (swcrcFilePath) {
108
- swcOptions.jsc.baseUrl = path.join(path.dirname(swcrcFilePath), swcOptions.jsc.baseUrl);
109
- }
110
- else {
111
- swcOptions.jsc.baseUrl = path.join(path.dirname(configuration.sourceRoot), swcOptions.jsc.baseUrl);
112
- }
104
+ if (swcOptions?.jsc?.baseUrl && !(0, path_1.isAbsolute)(swcOptions?.jsc?.baseUrl)) {
105
+ // jsc.baseUrl should be resolved by the caller, if it's passed as an object.
106
+ // https://github.com/swc-project/swc/pull/7827
107
+ const rootDir = process.cwd();
108
+ swcOptions.jsc.baseUrl = path.join(rootDir, swcOptions.jsc.baseUrl);
113
109
  }
114
110
  await swcCli.default({
115
111
  ...options,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nestjs/cli",
3
- "version": "10.1.14",
3
+ "version": "10.1.15",
4
4
  "description": "Nest - modern, fast, powerful node.js web framework (@cli)",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -68,7 +68,7 @@
68
68
  "@swc/core": "1.3.78",
69
69
  "@types/inquirer": "9.0.3",
70
70
  "@types/jest": "29.5.4",
71
- "@types/node": "18.17.8",
71
+ "@types/node": "18.17.9",
72
72
  "@types/node-emoji": "1.8.2",
73
73
  "@types/shelljs": "0.8.12",
74
74
  "@types/webpack-node-externals": "3.0.0",