@nestjs/cli 10.1.1 → 10.1.3
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.
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as ts from 'typescript';
|
|
2
2
|
import { Configuration } from '../../configuration';
|
|
3
|
-
export declare const swcDefaultsFactory: (tsOptions
|
|
3
|
+
export declare const swcDefaultsFactory: (tsOptions?: ts.CompilerOptions, configuration?: Configuration) => {
|
|
4
4
|
swcOptions: {
|
|
5
5
|
module: {
|
|
6
6
|
type: string;
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.swcDefaultsFactory = void 0;
|
|
4
4
|
const swcDefaultsFactory = (tsOptions, configuration) => {
|
|
5
|
-
const builderOptions = typeof configuration
|
|
6
|
-
? configuration
|
|
5
|
+
const builderOptions = typeof configuration?.compilerOptions?.builder !== 'string'
|
|
6
|
+
? configuration?.compilerOptions?.builder?.options
|
|
7
7
|
: {};
|
|
8
8
|
return {
|
|
9
9
|
swcOptions: {
|
|
@@ -22,14 +22,14 @@ const swcDefaultsFactory = (tsOptions, configuration) => {
|
|
|
22
22
|
decoratorMetadata: true,
|
|
23
23
|
},
|
|
24
24
|
keepClassNames: true,
|
|
25
|
-
baseUrl: tsOptions
|
|
26
|
-
paths: tsOptions
|
|
25
|
+
baseUrl: tsOptions?.baseUrl,
|
|
26
|
+
paths: tsOptions?.paths,
|
|
27
27
|
},
|
|
28
28
|
minify: false,
|
|
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
|
+
}
|
|
@@ -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,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nestjs/cli",
|
|
3
|
-
"version": "10.1.
|
|
3
|
+
"version": "10.1.3",
|
|
4
4
|
"description": "Nest - modern, fast, powerful node.js web framework (@cli)",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -72,8 +72,8 @@
|
|
|
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
78
|
"eslint": "8.44.0",
|
|
79
79
|
"eslint-config-prettier": "8.8.0",
|