@nestjs/cli 9.1.1 → 9.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.
@@ -1,2 +1,2 @@
1
1
  import * as ts from 'typescript';
2
- export declare function tsconfigPathsBeforeHookFactory(compilerOptions: ts.CompilerOptions): ((ctx: ts.TransformationContext) => ts.Transformer<any>) | undefined;
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,14 @@ 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
- return tsBinary.factory.updateImportDeclaration(node, node.decorators, node.modifiers, node.importClause, moduleSpecifier, node.assertClause);
33
+ return 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);
34
36
  }
35
37
  else {
36
- return tsBinary.factory.updateExportDeclaration(node, node.decorators, node.modifiers, node.isTypeOnly, node.exportClause, moduleSpecifier, node.assertClause);
38
+ return isInUpdatedAstContext
39
+ ? tsBinary.factory.updateExportDeclaration(node, node.modifiers, node.isTypeOnly, node.exportClause, moduleSpecifier, node.assertClause)
40
+ : tsBinary.factory.updateExportDeclaration(node, node.decorators, node.modifiers, node.isTypeOnly, node.exportClause, moduleSpecifier, node.assertClause);
37
41
  }
38
42
  }
39
43
  catch (_a) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nestjs/cli",
3
- "version": "9.1.1",
3
+ "version": "9.1.2",
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.0",
42
- "@angular-devkit/schematics": "14.2.0",
43
- "@angular-devkit/schematics-cli": "14.2.0",
41
+ "@angular-devkit/core": "14.2.1",
42
+ "@angular-devkit/schematics": "14.2.1",
43
+ "@angular-devkit/schematics-cli": "14.2.1",
44
44
  "@nestjs/schematics": "^9.0.0",
45
45
  "chalk": "3.0.0",
46
46
  "chokidar": "3.5.3",
@@ -58,26 +58,26 @@
58
58
  "tsconfig-paths": "4.1.0",
59
59
  "tsconfig-paths-webpack-plugin": "4.0.0",
60
60
  "typescript": "4.7.4",
61
- "webpack": "5.73.0",
61
+ "webpack": "5.74.0",
62
62
  "webpack-node-externals": "3.0.0"
63
63
  },
64
64
  "devDependencies": {
65
- "@commitlint/cli": "17.0.3",
66
- "@commitlint/config-angular": "17.0.3",
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.2",
69
- "@types/jest": "28.1.6",
70
- "@types/node": "16.11.47",
68
+ "@types/inquirer": "8.2.3",
69
+ "@types/jest": "28.1.8",
70
+ "@types/node": "16.11.56",
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.30.7",
78
- "@typescript-eslint/parser": "5.30.7",
77
+ "@typescript-eslint/eslint-plugin": "5.36.1",
78
+ "@typescript-eslint/parser": "5.36.1",
79
79
  "delete-empty": "3.0.0",
80
- "eslint": "8.20.0",
80
+ "eslint": "8.23.0",
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.3.0",
90
- "ts-jest": "28.0.7",
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
  },