@nestjs/cli 9.0.0 → 9.1.1
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.
- package/.circleci/config.yml +3 -3
- package/lib/compiler/compiler.js +3 -1
- package/lib/compiler/hooks/tsconfig-paths.hook.d.ts +1 -1
- package/lib/compiler/hooks/tsconfig-paths.hook.js +12 -6
- package/package.json +17 -17
- package/actions/update.action.d.ts +0 -5
- package/actions/update.action.js +0 -26
- package/commands/update.command.d.ts +0 -5
- package/commands/update.command.js +0 -30
package/.circleci/config.yml
CHANGED
|
@@ -21,12 +21,12 @@ jobs:
|
|
|
21
21
|
build:
|
|
22
22
|
working_directory: ~/nest
|
|
23
23
|
docker:
|
|
24
|
-
- image:
|
|
24
|
+
- image: cimg/node:17.9
|
|
25
25
|
steps:
|
|
26
26
|
- checkout
|
|
27
27
|
- run:
|
|
28
28
|
name: Update NPM version
|
|
29
|
-
command:
|
|
29
|
+
command: npm install -g npm@latest
|
|
30
30
|
- restore_cache:
|
|
31
31
|
key: dependency-cache-{{ checksum "package.json" }}
|
|
32
32
|
- run:
|
|
@@ -43,7 +43,7 @@ jobs:
|
|
|
43
43
|
unit_tests:
|
|
44
44
|
working_directory: ~/nest
|
|
45
45
|
docker:
|
|
46
|
-
- image:
|
|
46
|
+
- image: cimg/node:17.9
|
|
47
47
|
steps:
|
|
48
48
|
- checkout
|
|
49
49
|
- *restore-cache
|
package/lib/compiler/compiler.js
CHANGED
|
@@ -34,7 +34,9 @@ class Compiler {
|
|
|
34
34
|
const after = plugins.afterHooks.map((hook) => hook(programRef));
|
|
35
35
|
const afterDeclarations = plugins.afterDeclarationsHooks.map((hook) => hook(programRef));
|
|
36
36
|
const emitResult = program.emit(undefined, undefined, undefined, undefined, {
|
|
37
|
-
before:
|
|
37
|
+
before: tsconfigPathsPlugin
|
|
38
|
+
? before.concat(tsconfigPathsPlugin)
|
|
39
|
+
: before,
|
|
38
40
|
after,
|
|
39
41
|
afterDeclarations,
|
|
40
42
|
});
|
|
@@ -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
|
|
2
|
+
export declare function tsconfigPathsBeforeHookFactory(compilerOptions: ts.CompilerOptions): ((ctx: ts.TransformationContext) => ts.Transformer<any>) | undefined;
|
|
@@ -9,26 +9,32 @@ function tsconfigPathsBeforeHookFactory(compilerOptions) {
|
|
|
9
9
|
const tsBinary = new typescript_loader_1.TypeScriptBinaryLoader().load();
|
|
10
10
|
const { paths = {}, baseUrl = './' } = compilerOptions;
|
|
11
11
|
const matcher = tsPaths.createMatchPath(baseUrl, paths, ['main']);
|
|
12
|
+
if (Object.keys(paths).length === 0) {
|
|
13
|
+
return undefined;
|
|
14
|
+
}
|
|
12
15
|
return (ctx) => {
|
|
13
16
|
return (sf) => {
|
|
14
17
|
const visitNode = (node) => {
|
|
15
18
|
if (tsBinary.isImportDeclaration(node) ||
|
|
16
19
|
(tsBinary.isExportDeclaration(node) && node.moduleSpecifier)) {
|
|
17
20
|
try {
|
|
18
|
-
const newNode = tsBinary.getMutableClone(node);
|
|
19
21
|
const importPathWithQuotes = node.moduleSpecifier && node.moduleSpecifier.getText();
|
|
20
22
|
if (!importPathWithQuotes) {
|
|
21
23
|
return node;
|
|
22
24
|
}
|
|
23
|
-
const text = importPathWithQuotes.
|
|
25
|
+
const text = importPathWithQuotes.substring(1, importPathWithQuotes.length - 1);
|
|
24
26
|
const result = getNotAliasedPath(sf, matcher, text);
|
|
25
27
|
if (!result) {
|
|
26
28
|
return node;
|
|
27
29
|
}
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
30
|
+
const moduleSpecifier = tsBinary.factory.createStringLiteral(result);
|
|
31
|
+
moduleSpecifier.parent = node.moduleSpecifier.parent;
|
|
32
|
+
if (tsBinary.isImportDeclaration(node)) {
|
|
33
|
+
return tsBinary.factory.updateImportDeclaration(node, node.decorators, node.modifiers, node.importClause, moduleSpecifier, node.assertClause);
|
|
34
|
+
}
|
|
35
|
+
else {
|
|
36
|
+
return tsBinary.factory.updateExportDeclaration(node, node.decorators, node.modifiers, node.isTypeOnly, node.exportClause, moduleSpecifier, node.assertClause);
|
|
37
|
+
}
|
|
32
38
|
}
|
|
33
39
|
catch (_a) {
|
|
34
40
|
return node;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nestjs/cli",
|
|
3
|
-
"version": "9.
|
|
3
|
+
"version": "9.1.1",
|
|
4
4
|
"description": "Nest - modern, fast, powerful node.js web framework (@cli)",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -38,15 +38,15 @@
|
|
|
38
38
|
},
|
|
39
39
|
"homepage": "https://github.com/nestjs/nest-cli#readme",
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"@angular-devkit/core": "14.0
|
|
42
|
-
"@angular-devkit/schematics": "14.0
|
|
43
|
-
"@angular-devkit/schematics-cli": "14.0
|
|
41
|
+
"@angular-devkit/core": "14.2.0",
|
|
42
|
+
"@angular-devkit/schematics": "14.2.0",
|
|
43
|
+
"@angular-devkit/schematics-cli": "14.2.0",
|
|
44
44
|
"@nestjs/schematics": "^9.0.0",
|
|
45
45
|
"chalk": "3.0.0",
|
|
46
46
|
"chokidar": "3.5.3",
|
|
47
47
|
"cli-table3": "0.6.2",
|
|
48
48
|
"commander": "4.1.1",
|
|
49
|
-
"fork-ts-checker-webpack-plugin": "7.2.
|
|
49
|
+
"fork-ts-checker-webpack-plugin": "7.2.13",
|
|
50
50
|
"inquirer": "7.3.3",
|
|
51
51
|
"node-emoji": "1.11.0",
|
|
52
52
|
"ora": "5.4.1",
|
|
@@ -55,8 +55,8 @@
|
|
|
55
55
|
"shelljs": "0.8.5",
|
|
56
56
|
"source-map-support": "0.5.21",
|
|
57
57
|
"tree-kill": "1.2.2",
|
|
58
|
-
"tsconfig-paths": "
|
|
59
|
-
"tsconfig-paths-webpack-plugin": "
|
|
58
|
+
"tsconfig-paths": "4.1.0",
|
|
59
|
+
"tsconfig-paths-webpack-plugin": "4.0.0",
|
|
60
60
|
"typescript": "4.7.4",
|
|
61
61
|
"webpack": "5.73.0",
|
|
62
62
|
"webpack-node-externals": "3.0.0"
|
|
@@ -65,31 +65,31 @@
|
|
|
65
65
|
"@commitlint/cli": "17.0.3",
|
|
66
66
|
"@commitlint/config-angular": "17.0.3",
|
|
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.2",
|
|
69
|
+
"@types/jest": "28.1.6",
|
|
70
|
+
"@types/node": "16.11.47",
|
|
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.
|
|
78
|
-
"@typescript-eslint/parser": "5.30.
|
|
77
|
+
"@typescript-eslint/eslint-plugin": "5.30.7",
|
|
78
|
+
"@typescript-eslint/parser": "5.30.7",
|
|
79
79
|
"delete-empty": "3.0.0",
|
|
80
|
-
"eslint": "8.
|
|
80
|
+
"eslint": "8.20.0",
|
|
81
81
|
"eslint-config-prettier": "8.5.0",
|
|
82
82
|
"eslint-plugin-import": "2.26.0",
|
|
83
83
|
"gulp": "4.0.2",
|
|
84
84
|
"gulp-clean": "0.4.0",
|
|
85
85
|
"husky": "8.0.1",
|
|
86
|
-
"jest": "28.1.
|
|
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.3.0",
|
|
90
|
+
"ts-jest": "28.0.7",
|
|
91
91
|
"ts-loader": "9.3.1",
|
|
92
|
-
"ts-node": "10.
|
|
92
|
+
"ts-node": "10.9.1"
|
|
93
93
|
},
|
|
94
94
|
"lint-staged": {
|
|
95
95
|
"**/*.{ts,json}": []
|
package/actions/update.action.js
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.UpdateAction = void 0;
|
|
13
|
-
const dependency_managers_1 = require("../lib/dependency-managers");
|
|
14
|
-
const package_managers_1 = require("../lib/package-managers");
|
|
15
|
-
const abstract_action_1 = require("./abstract.action");
|
|
16
|
-
class UpdateAction extends abstract_action_1.AbstractAction {
|
|
17
|
-
handle(inputs, options) {
|
|
18
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
19
|
-
const force = options.find((option) => option.name === 'force');
|
|
20
|
-
const tag = options.find((option) => option.name === 'tag');
|
|
21
|
-
const manager = new dependency_managers_1.NestDependencyManager(yield package_managers_1.PackageManagerFactory.find());
|
|
22
|
-
yield manager.update(force.value, tag.value);
|
|
23
|
-
});
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
exports.UpdateAction = UpdateAction;
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.UpdateCommand = void 0;
|
|
13
|
-
const abstract_command_1 = require("./abstract.command");
|
|
14
|
-
class UpdateCommand extends abstract_command_1.AbstractCommand {
|
|
15
|
-
load(program) {
|
|
16
|
-
program
|
|
17
|
-
.command('update')
|
|
18
|
-
.alias('u')
|
|
19
|
-
.description('Update Nest dependencies.')
|
|
20
|
-
.option('-f, --force', 'Remove and re-install dependencies (instead of update).')
|
|
21
|
-
.option('-t, --tag <tag>', 'Upgrade to tagged packages (latest | beta | rc | next tag).')
|
|
22
|
-
.action((command) => __awaiter(this, void 0, void 0, function* () {
|
|
23
|
-
const options = [];
|
|
24
|
-
options.push({ name: 'force', value: !!command.force });
|
|
25
|
-
options.push({ name: 'tag', value: command.tag });
|
|
26
|
-
yield this.action.handle([], options);
|
|
27
|
-
}));
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
exports.UpdateCommand = UpdateCommand;
|