@nestjs/cli 9.1.0 → 9.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,2 +1,2 @@
|
|
|
1
1
|
import * as ts from 'typescript';
|
|
2
|
-
export declare function tsconfigPathsBeforeHookFactory(compilerOptions: ts.CompilerOptions): (
|
|
2
|
+
export declare function tsconfigPathsBeforeHookFactory(compilerOptions: ts.CompilerOptions): (ctx: ts.TransformationContext) => ts.Transformer<any>;
|
|
@@ -6,12 +6,12 @@ const path_1 = require("path");
|
|
|
6
6
|
const typescript_loader_1 = require("../typescript-loader");
|
|
7
7
|
const tsPaths = require("tsconfig-paths");
|
|
8
8
|
function tsconfigPathsBeforeHookFactory(compilerOptions) {
|
|
9
|
+
var _a;
|
|
9
10
|
const tsBinary = new typescript_loader_1.TypeScriptBinaryLoader().load();
|
|
11
|
+
const [tsVersionMajor, tsVersionMinor] = (_a = tsBinary.versionMajorMinor) === null || _a === void 0 ? void 0 : _a.split('.').map((x) => +x);
|
|
12
|
+
const isInUpdatedAstContext = tsVersionMinor >= 8 || tsVersionMajor > 4;
|
|
10
13
|
const { paths = {}, baseUrl = './' } = compilerOptions;
|
|
11
14
|
const matcher = tsPaths.createMatchPath(baseUrl, paths, ['main']);
|
|
12
|
-
if (Object.keys(paths).length === 0) {
|
|
13
|
-
return undefined;
|
|
14
|
-
}
|
|
15
15
|
return (ctx) => {
|
|
16
16
|
return (sf) => {
|
|
17
17
|
const visitNode = (node) => {
|
|
@@ -30,10 +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
|
+
? tsBinary.factory.updateImportDeclaration(node, node.modifiers, node.importClause, moduleSpecifier, node.assertClause)
|
|
35
|
+
: tsBinary.factory.updateImportDeclaration(node, node.decorators, node.modifiers, node.importClause, moduleSpecifier, node.assertClause);
|
|
36
|
+
updatedNode.flags = node.flags;
|
|
37
|
+
return updatedNode;
|
|
34
38
|
}
|
|
35
39
|
else {
|
|
36
|
-
|
|
40
|
+
const updatedNode = isInUpdatedAstContext
|
|
41
|
+
? tsBinary.factory.updateExportDeclaration(node, node.modifiers, node.isTypeOnly, node.exportClause, moduleSpecifier, node.assertClause)
|
|
42
|
+
: tsBinary.factory.updateExportDeclaration(node, node.decorators, node.modifiers, node.isTypeOnly, node.exportClause, moduleSpecifier, node.assertClause);
|
|
43
|
+
updatedNode.flags = node.flags;
|
|
44
|
+
return updatedNode;
|
|
37
45
|
}
|
|
38
46
|
}
|
|
39
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.3",
|
|
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,27 +57,27 @@
|
|
|
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.
|
|
61
|
-
"webpack": "5.
|
|
60
|
+
"typescript": "4.8.3",
|
|
61
|
+
"webpack": "5.74.0",
|
|
62
62
|
"webpack-node-externals": "3.0.0"
|
|
63
63
|
},
|
|
64
64
|
"devDependencies": {
|
|
65
|
-
"@commitlint/cli": "17.
|
|
66
|
-
"@commitlint/config-angular": "17.0
|
|
65
|
+
"@commitlint/cli": "17.1.2",
|
|
66
|
+
"@commitlint/config-angular": "17.1.0",
|
|
67
67
|
"@types/copyfiles": "2.4.1",
|
|
68
|
-
"@types/inquirer": "8.2.
|
|
69
|
-
"@types/jest": "28.1.
|
|
70
|
-
"@types/node": "16.11.
|
|
68
|
+
"@types/inquirer": "8.2.3",
|
|
69
|
+
"@types/jest": "28.1.8",
|
|
70
|
+
"@types/node": "16.11.58",
|
|
71
71
|
"@types/node-emoji": "1.8.1",
|
|
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.36.2",
|
|
78
|
+
"@typescript-eslint/parser": "5.36.2",
|
|
79
79
|
"delete-empty": "3.0.0",
|
|
80
|
-
"eslint": "8.
|
|
80
|
+
"eslint": "8.23.1",
|
|
81
81
|
"eslint-config-prettier": "8.5.0",
|
|
82
82
|
"eslint-plugin-import": "2.26.0",
|
|
83
83
|
"gulp": "4.0.2",
|
|
@@ -86,8 +86,8 @@
|
|
|
86
86
|
"jest": "28.1.3",
|
|
87
87
|
"lint-staged": "13.0.3",
|
|
88
88
|
"prettier": "2.7.1",
|
|
89
|
-
"release-it": "15.
|
|
90
|
-
"ts-jest": "28.0.
|
|
89
|
+
"release-it": "15.4.1",
|
|
90
|
+
"ts-jest": "28.0.8",
|
|
91
91
|
"ts-loader": "9.3.1",
|
|
92
92
|
"ts-node": "10.9.1"
|
|
93
93
|
},
|