@nestjs/cli 9.3.0 → 9.4.0
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 +2 -2
- package/README.md +1 -3
- package/actions/start.action.d.ts +1 -1
- package/actions/start.action.js +4 -8
- package/lib/compiler/helpers/get-value-or-default.d.ts +1 -1
- package/lib/compiler/helpers/manual-restart.d.ts +2 -0
- package/lib/compiler/helpers/manual-restart.js +18 -0
- package/lib/compiler/watch-compiler.js +10 -2
- package/lib/configuration/configuration.d.ts +2 -0
- package/lib/configuration/defaults.js +1 -0
- package/package.json +18 -18
package/.circleci/config.yml
CHANGED
|
@@ -21,7 +21,7 @@ jobs:
|
|
|
21
21
|
build:
|
|
22
22
|
working_directory: ~/nest
|
|
23
23
|
docker:
|
|
24
|
-
- image: cimg/node:19.
|
|
24
|
+
- image: cimg/node:19.9
|
|
25
25
|
steps:
|
|
26
26
|
- checkout
|
|
27
27
|
- run:
|
|
@@ -43,7 +43,7 @@ jobs:
|
|
|
43
43
|
unit_tests:
|
|
44
44
|
working_directory: ~/nest
|
|
45
45
|
docker:
|
|
46
|
-
- image: cimg/node:19.
|
|
46
|
+
- image: cimg/node:19.9
|
|
47
47
|
steps:
|
|
48
48
|
- checkout
|
|
49
49
|
- *restore-cache
|
package/README.md
CHANGED
|
@@ -7,8 +7,6 @@
|
|
|
7
7
|
<a href="https://www.npmjs.com/~nestjscore"><img src="https://img.shields.io/npm/v/@nestjs/cli.svg" alt="NPM Version" /></a>
|
|
8
8
|
<a href="https://www.npmjs.com/~nestjscore"><img src="https://img.shields.io/npm/l/@nestjs/cli.svg" alt="Package License" /></a>
|
|
9
9
|
<a href="https://www.npmjs.com/~nestjscore"><img src="https://img.shields.io/npm/dm/@nestjs/cli.svg" alt="NPM Downloads" /></a>
|
|
10
|
-
<a href="https://travis-ci.org/nestjs/nest"><img src="https://api.travis-ci.org/nestjs/nest.svg?branch=master" alt="Travis" /></a>
|
|
11
|
-
<a href="https://travis-ci.org/nestjs/nest"><img src="https://img.shields.io/travis/nestjs/nest/master.svg?label=linux" alt="Linux" /></a>
|
|
12
10
|
<a href="https://coveralls.io/github/nestjs/nest?branch=master" target="_blank"><img src="https://coveralls.io/repos/github/nestjs/nest/badge.svg?branch=master#9" alt="Coverage" /></a>
|
|
13
11
|
<a href="https://discord.gg/G7Qnnhy" target="_blank"><img src="https://img.shields.io/badge/discord-online-brightgreen.svg" alt="Discord"/></a>
|
|
14
12
|
<a href="https://opencollective.com/nest#backer" target="_blank"><img src="https://opencollective.com/nest/backers/badge.svg" alt="Backers on Open Collective" /></a>
|
|
@@ -42,4 +40,4 @@ Learn more in the [official documentation](https://docs.nestjs.com/cli/overview)
|
|
|
42
40
|
|
|
43
41
|
## License
|
|
44
42
|
|
|
45
|
-
Nest is [MIT licensed](LICENSE).
|
|
43
|
+
Nest is [MIT licensed](LICENSE).
|
|
@@ -2,7 +2,7 @@ import { Input } from '../commands';
|
|
|
2
2
|
import { BuildAction } from './build.action';
|
|
3
3
|
export declare class StartAction extends BuildAction {
|
|
4
4
|
handle(inputs: Input[], options: Input[]): Promise<void>;
|
|
5
|
-
createOnSuccessHook(entryFile: string, sourceRoot: string, debugFlag: boolean | string | undefined, outDirName: string, binaryToRun
|
|
5
|
+
createOnSuccessHook(entryFile: string, sourceRoot: string, debugFlag: boolean | string | undefined, outDirName: string, binaryToRun: string): () => void;
|
|
6
6
|
private spawnChildProcess;
|
|
7
7
|
private isSourceMapSupportPkgAvailable;
|
|
8
8
|
}
|
package/actions/start.action.js
CHANGED
|
@@ -22,7 +22,6 @@ const ui_1 = require("../lib/ui");
|
|
|
22
22
|
const build_action_1 = require("./build.action");
|
|
23
23
|
class StartAction extends build_action_1.BuildAction {
|
|
24
24
|
handle(inputs, options) {
|
|
25
|
-
var _a, _b;
|
|
26
25
|
return __awaiter(this, void 0, void 0, function* () {
|
|
27
26
|
try {
|
|
28
27
|
const configFileName = options.find((option) => option.name === 'config')
|
|
@@ -31,20 +30,17 @@ class StartAction extends build_action_1.BuildAction {
|
|
|
31
30
|
const appName = inputs.find((input) => input.name === 'app')
|
|
32
31
|
.value;
|
|
33
32
|
const pathToTsconfig = (0, get_value_or_default_1.getValueOrDefault)(configuration, 'compilerOptions.tsConfigPath', appName, 'path', options);
|
|
34
|
-
const binaryToRunOption = options.find((option) => option.name === 'exec');
|
|
35
33
|
const debugModeOption = options.find((option) => option.name === 'debug');
|
|
36
34
|
const watchModeOption = options.find((option) => option.name === 'watch');
|
|
37
35
|
const isWatchEnabled = !!(watchModeOption && watchModeOption.value);
|
|
38
36
|
const watchAssetsModeOption = options.find((option) => option.name === 'watchAssets');
|
|
39
37
|
const isWatchAssetsEnabled = !!(watchAssetsModeOption && watchAssetsModeOption.value);
|
|
40
38
|
const debugFlag = debugModeOption && debugModeOption.value;
|
|
41
|
-
const binaryToRun =
|
|
39
|
+
const binaryToRun = (0, get_value_or_default_1.getValueOrDefault)(configuration, 'exec', appName, 'exec', options, defaults_1.defaultConfiguration.exec);
|
|
42
40
|
const { options: tsOptions } = this.tsConfigProvider.getByConfigFilename(pathToTsconfig);
|
|
43
41
|
const outDir = tsOptions.outDir || defaults_1.defaultOutDir;
|
|
44
|
-
const entryFile = (
|
|
45
|
-
|
|
46
|
-
const sourceRoot = ((_b = options.find((option) => option.name === 'sourceRoot')) === null || _b === void 0 ? void 0 : _b.value) ||
|
|
47
|
-
(0, get_value_or_default_1.getValueOrDefault)(configuration, 'sourceRoot', appName, undefined, undefined, defaults_1.defaultConfiguration.sourceRoot);
|
|
42
|
+
const entryFile = (0, get_value_or_default_1.getValueOrDefault)(configuration, 'entryFile', appName, 'entryFile', options, defaults_1.defaultConfiguration.entryFile);
|
|
43
|
+
const sourceRoot = (0, get_value_or_default_1.getValueOrDefault)(configuration, 'sourceRoot', appName, 'sourceRoot', options, defaults_1.defaultConfiguration.sourceRoot);
|
|
48
44
|
const onSuccess = this.createOnSuccessHook(entryFile, sourceRoot, debugFlag, outDir, binaryToRun);
|
|
49
45
|
yield this.runBuild(inputs, options, isWatchEnabled, isWatchAssetsEnabled, !!debugFlag, onSuccess);
|
|
50
46
|
}
|
|
@@ -58,7 +54,7 @@ class StartAction extends build_action_1.BuildAction {
|
|
|
58
54
|
}
|
|
59
55
|
});
|
|
60
56
|
}
|
|
61
|
-
createOnSuccessHook(entryFile, sourceRoot, debugFlag, outDirName, binaryToRun
|
|
57
|
+
createOnSuccessHook(entryFile, sourceRoot, debugFlag, outDirName, binaryToRun) {
|
|
62
58
|
let childProcessRef;
|
|
63
59
|
process.on('exit', () => childProcessRef && (0, tree_kill_1.treeKillSync)(childProcessRef.pid));
|
|
64
60
|
return () => {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { Input } from '../../../commands';
|
|
2
2
|
import { Configuration } from '../../configuration';
|
|
3
|
-
export declare function getValueOrDefault<T = any>(configuration: Required<Configuration>, propertyPath: string, appName: string, key?: 'path' | 'webpack' | 'webpackPath', options?: Input[], defaultValue?: T): T;
|
|
3
|
+
export declare function getValueOrDefault<T = any>(configuration: Required<Configuration>, propertyPath: string, appName: string, key?: 'path' | 'webpack' | 'webpackPath' | 'entryFile' | 'sourceRoot' | 'exec', options?: Input[], defaultValue?: T): T;
|
|
4
4
|
export declare function getValueOfPath<T = any>(object: Record<string, any>, propertyPath: string): T;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.displayManualRestartTip = exports.listenForManualRestart = void 0;
|
|
4
|
+
const chalk = require("chalk");
|
|
5
|
+
function listenForManualRestart(callback) {
|
|
6
|
+
const stdinListener = (data) => {
|
|
7
|
+
if (data.toString().trim() === 'rs') {
|
|
8
|
+
process.stdin.removeListener('data', stdinListener);
|
|
9
|
+
callback();
|
|
10
|
+
}
|
|
11
|
+
};
|
|
12
|
+
process.stdin.on('data', stdinListener);
|
|
13
|
+
}
|
|
14
|
+
exports.listenForManualRestart = listenForManualRestart;
|
|
15
|
+
function displayManualRestartTip() {
|
|
16
|
+
console.log(`To restart at any time, enter ${chalk.gray('rs')}.\n`);
|
|
17
|
+
}
|
|
18
|
+
exports.displayManualRestartTip = displayManualRestartTip;
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.WatchCompiler = void 0;
|
|
4
4
|
const errors_1 = require("../ui/errors");
|
|
5
5
|
const get_value_or_default_1 = require("./helpers/get-value-or-default");
|
|
6
|
+
const manual_restart_1 = require("./helpers/manual-restart");
|
|
6
7
|
const tsconfig_paths_hook_1 = require("./hooks/tsconfig-paths.hook");
|
|
7
8
|
class WatchCompiler {
|
|
8
9
|
constructor(pluginsLoader, tsConfigProvider, typescriptLoader) {
|
|
@@ -27,7 +28,10 @@ class WatchCompiler {
|
|
|
27
28
|
host.createProgram = (rootNames, options,
|
|
28
29
|
// tslint:disable-next-line:no-shadowed-variable
|
|
29
30
|
host, oldProgram) => {
|
|
30
|
-
|
|
31
|
+
(0, manual_restart_1.displayManualRestartTip)();
|
|
32
|
+
const tsconfigPathsPlugin = options
|
|
33
|
+
? (0, tsconfig_paths_hook_1.tsconfigPathsBeforeHookFactory)(options)
|
|
34
|
+
: null;
|
|
31
35
|
const program = origCreateProgram(rootNames, options, host, oldProgram, undefined, projectReferences);
|
|
32
36
|
const origProgramEmit = program.emit;
|
|
33
37
|
program.emit = (targetSourceFile, writeFile, cancellationToken, emitOnlyDtsFiles, customTransformers) => {
|
|
@@ -46,7 +50,11 @@ class WatchCompiler {
|
|
|
46
50
|
};
|
|
47
51
|
return program;
|
|
48
52
|
};
|
|
49
|
-
tsBin.createWatchProgram(host);
|
|
53
|
+
const watchProgram = tsBin.createWatchProgram(host);
|
|
54
|
+
(0, manual_restart_1.listenForManualRestart)(() => {
|
|
55
|
+
watchProgram.close();
|
|
56
|
+
this.run(configuration, configFilename, appName, tsCompilerOptions, onSuccess);
|
|
57
|
+
});
|
|
50
58
|
}
|
|
51
59
|
createDiagnosticReporter(diagnosticReporter) {
|
|
52
60
|
return function (diagnostic, ...args) {
|
|
@@ -34,6 +34,7 @@ export interface ProjectConfiguration {
|
|
|
34
34
|
type?: string;
|
|
35
35
|
root?: string;
|
|
36
36
|
entryFile?: string;
|
|
37
|
+
exec?: string;
|
|
37
38
|
sourceRoot?: string;
|
|
38
39
|
compilerOptions?: CompilerOptions;
|
|
39
40
|
}
|
|
@@ -43,6 +44,7 @@ export interface Configuration {
|
|
|
43
44
|
collection?: string;
|
|
44
45
|
sourceRoot?: string;
|
|
45
46
|
entryFile?: string;
|
|
47
|
+
exec?: string;
|
|
46
48
|
monorepo?: boolean;
|
|
47
49
|
compilerOptions?: CompilerOptions;
|
|
48
50
|
generateOptions?: GenerateOptions;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nestjs/cli",
|
|
3
|
-
"version": "9.
|
|
3
|
+
"version": "9.4.0",
|
|
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": "15.2.
|
|
42
|
-
"@angular-devkit/schematics": "15.2.
|
|
43
|
-
"@angular-devkit/schematics-cli": "15.2.
|
|
41
|
+
"@angular-devkit/core": "15.2.6",
|
|
42
|
+
"@angular-devkit/schematics": "15.2.6",
|
|
43
|
+
"@angular-devkit/schematics-cli": "15.2.6",
|
|
44
44
|
"@nestjs/schematics": "^9.0.4",
|
|
45
45
|
"chalk": "4.1.2",
|
|
46
46
|
"chokidar": "3.5.3",
|
|
@@ -51,38 +51,38 @@
|
|
|
51
51
|
"node-emoji": "1.11.0",
|
|
52
52
|
"ora": "5.4.1",
|
|
53
53
|
"os-name": "4.0.1",
|
|
54
|
-
"rimraf": "4.4.
|
|
54
|
+
"rimraf": "4.4.1",
|
|
55
55
|
"shelljs": "0.8.5",
|
|
56
56
|
"source-map-support": "0.5.21",
|
|
57
57
|
"tree-kill": "1.2.2",
|
|
58
|
-
"tsconfig-paths": "4.
|
|
58
|
+
"tsconfig-paths": "4.2.0",
|
|
59
59
|
"tsconfig-paths-webpack-plugin": "4.0.1",
|
|
60
60
|
"typescript": "4.9.5",
|
|
61
|
-
"webpack": "5.
|
|
61
|
+
"webpack": "5.79.0",
|
|
62
62
|
"webpack-node-externals": "3.0.0"
|
|
63
63
|
},
|
|
64
64
|
"devDependencies": {
|
|
65
|
-
"@commitlint/cli": "17.
|
|
65
|
+
"@commitlint/cli": "17.5.1",
|
|
66
66
|
"@commitlint/config-angular": "17.4.4",
|
|
67
67
|
"@types/inquirer": "8.2.6",
|
|
68
68
|
"@types/jest": "29.5.0",
|
|
69
|
-
"@types/node": "18.15.
|
|
69
|
+
"@types/node": "18.15.11",
|
|
70
70
|
"@types/node-emoji": "1.8.2",
|
|
71
|
-
"@types/shelljs": "0.8.
|
|
71
|
+
"@types/shelljs": "0.8.12",
|
|
72
72
|
"@types/webpack-node-externals": "3.0.0",
|
|
73
|
-
"@typescript-eslint/eslint-plugin": "5.
|
|
74
|
-
"@typescript-eslint/parser": "5.
|
|
73
|
+
"@typescript-eslint/eslint-plugin": "5.58.0",
|
|
74
|
+
"@typescript-eslint/parser": "5.58.0",
|
|
75
75
|
"delete-empty": "3.0.0",
|
|
76
|
-
"eslint": "8.
|
|
77
|
-
"eslint-config-prettier": "8.
|
|
76
|
+
"eslint": "8.38.0",
|
|
77
|
+
"eslint-config-prettier": "8.8.0",
|
|
78
78
|
"gulp": "4.0.2",
|
|
79
79
|
"gulp-clean": "0.4.0",
|
|
80
80
|
"husky": "8.0.3",
|
|
81
81
|
"jest": "29.5.0",
|
|
82
|
-
"lint-staged": "13.2.
|
|
83
|
-
"prettier": "2.8.
|
|
84
|
-
"release-it": "15.
|
|
85
|
-
"ts-jest": "29.0
|
|
82
|
+
"lint-staged": "13.2.1",
|
|
83
|
+
"prettier": "2.8.7",
|
|
84
|
+
"release-it": "15.10.1",
|
|
85
|
+
"ts-jest": "29.1.0",
|
|
86
86
|
"ts-loader": "9.4.2"
|
|
87
87
|
},
|
|
88
88
|
"lint-staged": {
|