@nestjs/cli 10.1.0 → 10.1.2
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.
|
@@ -29,7 +29,7 @@ const swcDefaultsFactory = (tsOptions, configuration) => {
|
|
|
29
29
|
swcrc: true,
|
|
30
30
|
},
|
|
31
31
|
cliOptions: {
|
|
32
|
-
outDir: tsOptions.outDir
|
|
32
|
+
outDir: tsOptions.outDir ? convertPath(tsOptions.outDir) : 'dist',
|
|
33
33
|
filenames: [configuration?.sourceRoot ?? 'src'],
|
|
34
34
|
sync: false,
|
|
35
35
|
extensions: ['.js', '.ts'],
|
|
@@ -42,3 +42,13 @@ const swcDefaultsFactory = (tsOptions, configuration) => {
|
|
|
42
42
|
};
|
|
43
43
|
};
|
|
44
44
|
exports.swcDefaultsFactory = swcDefaultsFactory;
|
|
45
|
+
/**
|
|
46
|
+
* Converts Windows specific file paths to posix
|
|
47
|
+
* @param windowsPath
|
|
48
|
+
*/
|
|
49
|
+
function convertPath(windowsPath) {
|
|
50
|
+
return windowsPath
|
|
51
|
+
.replace(/^\\\\\?\\/, '')
|
|
52
|
+
.replace(/\\/g, '/')
|
|
53
|
+
.replace(/\/\/+/g, '/');
|
|
54
|
+
}
|
|
@@ -15,7 +15,11 @@ function getTscConfigPath(configuration, cmdOptions, appName) {
|
|
|
15
15
|
if (tsconfigPath) {
|
|
16
16
|
return tsconfigPath;
|
|
17
17
|
}
|
|
18
|
-
|
|
18
|
+
const builder = (0, get_value_or_default_1.getValueOrDefault)(configuration, 'compilerOptions.builder', appName);
|
|
19
|
+
tsconfigPath =
|
|
20
|
+
typeof builder === 'object' && builder?.type === 'tsc'
|
|
21
|
+
? builder.options?.configPath
|
|
22
|
+
: undefined;
|
|
19
23
|
return tsconfigPath ?? (0, get_default_tsconfig_path_1.getDefaultTsconfigPath)();
|
|
20
24
|
}
|
|
21
25
|
exports.getTscConfigPath = getTscConfigPath;
|
|
@@ -14,7 +14,11 @@ function getWebpackConfigPath(configuration, cmdOptions, appName) {
|
|
|
14
14
|
if (webpackPath) {
|
|
15
15
|
return webpackPath;
|
|
16
16
|
}
|
|
17
|
-
|
|
17
|
+
const builder = (0, get_value_or_default_1.getValueOrDefault)(configuration, 'compilerOptions.builder', appName);
|
|
18
|
+
webpackPath =
|
|
19
|
+
typeof builder === 'object' && builder?.type === 'webpack'
|
|
20
|
+
? builder.options?.configPath
|
|
21
|
+
: undefined;
|
|
18
22
|
return webpackPath;
|
|
19
23
|
}
|
|
20
24
|
exports.getWebpackConfigPath = getWebpackConfigPath;
|
|
@@ -6,6 +6,7 @@ const child_process_1 = require("child_process");
|
|
|
6
6
|
const chokidar = require("chokidar");
|
|
7
7
|
const fs_1 = require("fs");
|
|
8
8
|
const path_1 = require("path");
|
|
9
|
+
const posix_1 = require("path/posix");
|
|
9
10
|
const ui_1 = require("../../ui");
|
|
10
11
|
const tree_kill_1 = require("../../utils/tree-kill");
|
|
11
12
|
const base_compiler_1 = require("../base-compiler");
|
|
@@ -162,8 +163,11 @@ class SwcCompiler extends base_compiler_1.BaseCompiler {
|
|
|
162
163
|
};
|
|
163
164
|
}
|
|
164
165
|
watchFilesInOutDir(options, onChange) {
|
|
165
|
-
const
|
|
166
|
-
|
|
166
|
+
const dir = (0, posix_1.isAbsolute)(options.cliOptions.outDir)
|
|
167
|
+
? options.cliOptions.outDir
|
|
168
|
+
: (0, path_1.join)(process.cwd(), options.cliOptions.outDir);
|
|
169
|
+
const paths = (0, path_1.join)(dir, '**/*.js');
|
|
170
|
+
const watcher = chokidar.watch(paths, {
|
|
167
171
|
ignoreInitial: true,
|
|
168
172
|
awaitWriteFinish: {
|
|
169
173
|
stabilityThreshold: 50,
|
|
@@ -42,9 +42,6 @@ export type Builder = BuilderVariant | {
|
|
|
42
42
|
options?: TscBuilderOptions;
|
|
43
43
|
};
|
|
44
44
|
export interface CompilerOptions {
|
|
45
|
-
/**
|
|
46
|
-
* @deprecated Use `builder.options.configPath` instead.
|
|
47
|
-
*/
|
|
48
45
|
tsConfigPath?: string;
|
|
49
46
|
/**
|
|
50
47
|
* @deprecated Use `builder` instead.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nestjs/cli",
|
|
3
|
-
"version": "10.1.
|
|
3
|
+
"version": "10.1.2",
|
|
4
4
|
"description": "Nest - modern, fast, powerful node.js web framework (@cli)",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -68,14 +68,14 @@
|
|
|
68
68
|
"@swc/core": "1.3.67",
|
|
69
69
|
"@types/inquirer": "8.2.6",
|
|
70
70
|
"@types/jest": "29.5.2",
|
|
71
|
-
"@types/node": "18.16.
|
|
71
|
+
"@types/node": "18.16.19",
|
|
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": "5.
|
|
76
|
-
"@typescript-eslint/parser": "5.
|
|
75
|
+
"@typescript-eslint/eslint-plugin": "5.61.0",
|
|
76
|
+
"@typescript-eslint/parser": "5.61.0",
|
|
77
77
|
"delete-empty": "3.0.0",
|
|
78
|
-
"eslint": "8.
|
|
78
|
+
"eslint": "8.44.0",
|
|
79
79
|
"eslint-config-prettier": "8.8.0",
|
|
80
80
|
"gulp": "4.0.2",
|
|
81
81
|
"gulp-clean": "0.4.0",
|