@nestjs/cli 9.1.2 → 9.1.4
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.
|
@@ -8,84 +8,90 @@ const defaults_1 = require("../../configuration/defaults");
|
|
|
8
8
|
const append_extension_1 = require("../helpers/append-extension");
|
|
9
9
|
const webpack = require("webpack");
|
|
10
10
|
const nodeExternals = require("webpack-node-externals");
|
|
11
|
-
const webpackDefaultsFactory = (sourceRoot, relativeSourceRoot, entryFilename, isDebugEnabled = false, tsConfigFile = defaults_1.defaultConfiguration.compilerOptions.tsConfigPath, plugins) =>
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
11
|
+
const webpackDefaultsFactory = (sourceRoot, relativeSourceRoot, entryFilename, isDebugEnabled = false, tsConfigFile = defaults_1.defaultConfiguration.compilerOptions.tsConfigPath, plugins) => {
|
|
12
|
+
const isPluginRegistered = isAnyPluginRegistered(plugins);
|
|
13
|
+
const webpackConfiguration = {
|
|
14
|
+
entry: (0, append_extension_1.appendTsExtension)((0, path_1.join)(sourceRoot, entryFilename)),
|
|
15
|
+
devtool: isDebugEnabled ? 'inline-source-map' : false,
|
|
16
|
+
target: 'node',
|
|
17
|
+
output: {
|
|
18
|
+
filename: (0, path_1.join)(relativeSourceRoot, `${entryFilename}.js`),
|
|
19
|
+
},
|
|
20
|
+
ignoreWarnings: [/^(?!CriticalDependenciesWarning$)/],
|
|
21
|
+
externals: [nodeExternals()],
|
|
22
|
+
externalsPresets: { node: true },
|
|
23
|
+
module: {
|
|
24
|
+
rules: [
|
|
25
|
+
{
|
|
26
|
+
test: /.tsx?$/,
|
|
27
|
+
use: [
|
|
28
|
+
{
|
|
29
|
+
loader: 'ts-loader',
|
|
30
|
+
options: {
|
|
31
|
+
transpileOnly: !isPluginRegistered,
|
|
32
|
+
configFile: tsConfigFile,
|
|
33
|
+
getCustomTransformers: (program) => ({
|
|
34
|
+
before: plugins.beforeHooks.map((hook) => hook(program)),
|
|
35
|
+
after: plugins.afterHooks.map((hook) => hook(program)),
|
|
36
|
+
afterDeclarations: plugins.afterDeclarationsHooks.map((hook) => hook(program)),
|
|
37
|
+
}),
|
|
38
|
+
},
|
|
36
39
|
},
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
40
|
+
],
|
|
41
|
+
exclude: /node_modules/,
|
|
42
|
+
},
|
|
43
|
+
],
|
|
44
|
+
},
|
|
45
|
+
resolve: {
|
|
46
|
+
extensions: ['.tsx', '.ts', '.js'],
|
|
47
|
+
plugins: [
|
|
48
|
+
new tsconfig_paths_webpack_plugin_1.TsconfigPathsPlugin({
|
|
49
|
+
configFile: tsConfigFile,
|
|
50
|
+
}),
|
|
51
|
+
],
|
|
52
|
+
},
|
|
53
|
+
mode: 'none',
|
|
54
|
+
optimization: {
|
|
55
|
+
nodeEnv: false,
|
|
56
|
+
},
|
|
57
|
+
node: {
|
|
58
|
+
__filename: false,
|
|
59
|
+
__dirname: false,
|
|
60
|
+
},
|
|
45
61
|
plugins: [
|
|
46
|
-
new
|
|
47
|
-
|
|
62
|
+
new webpack.IgnorePlugin({
|
|
63
|
+
checkResource(resource) {
|
|
64
|
+
const lazyImports = [
|
|
65
|
+
'@nestjs/microservices',
|
|
66
|
+
'cache-manager',
|
|
67
|
+
'class-validator',
|
|
68
|
+
'class-transformer',
|
|
69
|
+
];
|
|
70
|
+
if (!lazyImports.includes(resource)) {
|
|
71
|
+
return false;
|
|
72
|
+
}
|
|
73
|
+
try {
|
|
74
|
+
require.resolve(resource, {
|
|
75
|
+
paths: [process.cwd()],
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
catch (err) {
|
|
79
|
+
return true;
|
|
80
|
+
}
|
|
81
|
+
return false;
|
|
82
|
+
},
|
|
48
83
|
}),
|
|
49
84
|
],
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
nodeEnv: false,
|
|
54
|
-
},
|
|
55
|
-
node: {
|
|
56
|
-
__filename: false,
|
|
57
|
-
__dirname: false,
|
|
58
|
-
},
|
|
59
|
-
plugins: [
|
|
60
|
-
new webpack.IgnorePlugin({
|
|
61
|
-
checkResource(resource) {
|
|
62
|
-
const lazyImports = [
|
|
63
|
-
'@nestjs/microservices',
|
|
64
|
-
'cache-manager',
|
|
65
|
-
'class-validator',
|
|
66
|
-
'class-transformer',
|
|
67
|
-
];
|
|
68
|
-
if (!lazyImports.includes(resource)) {
|
|
69
|
-
return false;
|
|
70
|
-
}
|
|
71
|
-
try {
|
|
72
|
-
require.resolve(resource, {
|
|
73
|
-
paths: [process.cwd()],
|
|
74
|
-
});
|
|
75
|
-
}
|
|
76
|
-
catch (err) {
|
|
77
|
-
return true;
|
|
78
|
-
}
|
|
79
|
-
return false;
|
|
80
|
-
},
|
|
81
|
-
}),
|
|
82
|
-
new ForkTsCheckerWebpackPlugin({
|
|
85
|
+
};
|
|
86
|
+
if (!isPluginRegistered) {
|
|
87
|
+
webpackConfiguration.plugins.push(new ForkTsCheckerWebpackPlugin({
|
|
83
88
|
typescript: {
|
|
84
89
|
configFile: tsConfigFile,
|
|
85
90
|
},
|
|
86
|
-
})
|
|
87
|
-
|
|
88
|
-
|
|
91
|
+
}));
|
|
92
|
+
}
|
|
93
|
+
return webpackConfiguration;
|
|
94
|
+
};
|
|
89
95
|
exports.webpackDefaultsFactory = webpackDefaultsFactory;
|
|
90
96
|
function isAnyPluginRegistered(plugins) {
|
|
91
97
|
return ((plugins.afterHooks && plugins.afterHooks.length > 0) ||
|
|
@@ -30,14 +30,18 @@ function tsconfigPathsBeforeHookFactory(compilerOptions) {
|
|
|
30
30
|
const moduleSpecifier = tsBinary.factory.createStringLiteral(result);
|
|
31
31
|
moduleSpecifier.parent = node.moduleSpecifier.parent;
|
|
32
32
|
if (tsBinary.isImportDeclaration(node)) {
|
|
33
|
-
|
|
33
|
+
const updatedNode = isInUpdatedAstContext
|
|
34
34
|
? tsBinary.factory.updateImportDeclaration(node, node.modifiers, node.importClause, moduleSpecifier, node.assertClause)
|
|
35
35
|
: tsBinary.factory.updateImportDeclaration(node, node.decorators, node.modifiers, node.importClause, moduleSpecifier, node.assertClause);
|
|
36
|
+
updatedNode.flags = node.flags;
|
|
37
|
+
return updatedNode;
|
|
36
38
|
}
|
|
37
39
|
else {
|
|
38
|
-
|
|
40
|
+
const updatedNode = isInUpdatedAstContext
|
|
39
41
|
? tsBinary.factory.updateExportDeclaration(node, node.modifiers, node.isTypeOnly, node.exportClause, moduleSpecifier, node.assertClause)
|
|
40
42
|
: tsBinary.factory.updateExportDeclaration(node, node.decorators, node.modifiers, node.isTypeOnly, node.exportClause, moduleSpecifier, node.assertClause);
|
|
43
|
+
updatedNode.flags = node.flags;
|
|
44
|
+
return updatedNode;
|
|
41
45
|
}
|
|
42
46
|
}
|
|
43
47
|
catch (_a) {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.defaultGitIgnore = exports.defaultOutDir = exports.defaultConfiguration = void 0;
|
|
4
|
+
const get_default_tsconfig_path_1 = require("../utils/get-default-tsconfig-path");
|
|
4
5
|
exports.defaultConfiguration = {
|
|
5
6
|
language: 'ts',
|
|
6
7
|
sourceRoot: 'src',
|
|
@@ -9,7 +10,7 @@ exports.defaultConfiguration = {
|
|
|
9
10
|
projects: {},
|
|
10
11
|
monorepo: false,
|
|
11
12
|
compilerOptions: {
|
|
12
|
-
tsConfigPath:
|
|
13
|
+
tsConfigPath: (0, get_default_tsconfig_path_1.getDefaultTsconfigPath)(),
|
|
13
14
|
webpack: false,
|
|
14
15
|
webpackConfigPath: 'webpack.config.js',
|
|
15
16
|
plugins: [],
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function getDefaultTsconfigPath(): "tsconfig.build.json" | "tsconfig.json";
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getDefaultTsconfigPath = void 0;
|
|
4
|
+
const fs = require("fs");
|
|
5
|
+
const path_1 = require("path");
|
|
6
|
+
const TSCONFIG_BUILD_JSON = 'tsconfig.build.json';
|
|
7
|
+
const TSCONFIG_JSON = 'tsconfig.json';
|
|
8
|
+
function getDefaultTsconfigPath() {
|
|
9
|
+
return fs.existsSync((0, path_1.join)(process.cwd(), TSCONFIG_BUILD_JSON))
|
|
10
|
+
? TSCONFIG_BUILD_JSON
|
|
11
|
+
: TSCONFIG_JSON;
|
|
12
|
+
}
|
|
13
|
+
exports.getDefaultTsconfigPath = getDefaultTsconfigPath;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nestjs/cli",
|
|
3
|
-
"version": "9.1.
|
|
3
|
+
"version": "9.1.4",
|
|
4
4
|
"description": "Nest - modern, fast, powerful node.js web framework (@cli)",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -38,9 +38,9 @@
|
|
|
38
38
|
},
|
|
39
39
|
"homepage": "https://github.com/nestjs/nest-cli#readme",
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"@angular-devkit/core": "14.2.
|
|
42
|
-
"@angular-devkit/schematics": "14.2.
|
|
43
|
-
"@angular-devkit/schematics-cli": "14.2.
|
|
41
|
+
"@angular-devkit/core": "14.2.2",
|
|
42
|
+
"@angular-devkit/schematics": "14.2.2",
|
|
43
|
+
"@angular-devkit/schematics-cli": "14.2.2",
|
|
44
44
|
"@nestjs/schematics": "^9.0.0",
|
|
45
45
|
"chalk": "3.0.0",
|
|
46
46
|
"chokidar": "3.5.3",
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
"tree-kill": "1.2.2",
|
|
58
58
|
"tsconfig-paths": "4.1.0",
|
|
59
59
|
"tsconfig-paths-webpack-plugin": "4.0.0",
|
|
60
|
-
"typescript": "4.
|
|
60
|
+
"typescript": "4.8.3",
|
|
61
61
|
"webpack": "5.74.0",
|
|
62
62
|
"webpack-node-externals": "3.0.0"
|
|
63
63
|
},
|
|
@@ -67,17 +67,17 @@
|
|
|
67
67
|
"@types/copyfiles": "2.4.1",
|
|
68
68
|
"@types/inquirer": "8.2.3",
|
|
69
69
|
"@types/jest": "28.1.8",
|
|
70
|
-
"@types/node": "16.11.
|
|
71
|
-
"@types/node-emoji": "1.8.
|
|
70
|
+
"@types/node": "16.11.62",
|
|
71
|
+
"@types/node-emoji": "1.8.2",
|
|
72
72
|
"@types/ora": "3.2.0",
|
|
73
73
|
"@types/os-name": "3.1.0",
|
|
74
74
|
"@types/rimraf": "3.0.2",
|
|
75
75
|
"@types/shelljs": "0.8.11",
|
|
76
76
|
"@types/webpack-node-externals": "2.5.3",
|
|
77
|
-
"@typescript-eslint/eslint-plugin": "5.
|
|
78
|
-
"@typescript-eslint/parser": "5.
|
|
77
|
+
"@typescript-eslint/eslint-plugin": "5.38.1",
|
|
78
|
+
"@typescript-eslint/parser": "5.38.1",
|
|
79
79
|
"delete-empty": "3.0.0",
|
|
80
|
-
"eslint": "8.
|
|
80
|
+
"eslint": "8.24.0",
|
|
81
81
|
"eslint-config-prettier": "8.5.0",
|
|
82
82
|
"eslint-plugin-import": "2.26.0",
|
|
83
83
|
"gulp": "4.0.2",
|
|
@@ -86,9 +86,9 @@
|
|
|
86
86
|
"jest": "28.1.3",
|
|
87
87
|
"lint-staged": "13.0.3",
|
|
88
88
|
"prettier": "2.7.1",
|
|
89
|
-
"release-it": "15.4.
|
|
89
|
+
"release-it": "15.4.2",
|
|
90
90
|
"ts-jest": "28.0.8",
|
|
91
|
-
"ts-loader": "9.
|
|
91
|
+
"ts-loader": "9.4.1",
|
|
92
92
|
"ts-node": "10.9.1"
|
|
93
93
|
},
|
|
94
94
|
"lint-staged": {
|