@nestjs/cli 11.0.16 → 12.0.0-alpha.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/actions/abstract.action.d.ts +1 -2
- package/actions/abstract.action.js +1 -5
- package/actions/add.action.d.ts +3 -4
- package/actions/add.action.js +38 -52
- package/actions/build.action.d.ts +11 -10
- package/actions/build.action.js +85 -72
- package/actions/generate.action.d.ts +3 -3
- package/actions/generate.action.js +56 -59
- package/actions/index.d.ts +7 -7
- package/actions/index.js +7 -23
- package/actions/info.action.d.ts +12 -28
- package/actions/info.action.js +47 -55
- package/actions/new.action.d.ts +3 -3
- package/actions/new.action.js +75 -105
- package/actions/start.action.d.ts +4 -7
- package/actions/start.action.js +36 -46
- package/bin/nest.js +14 -10
- package/commands/abstract.command.d.ts +3 -3
- package/commands/abstract.command.js +2 -5
- package/commands/add.command.d.ts +3 -3
- package/commands/add.command.js +13 -20
- package/commands/build.command.d.ts +3 -3
- package/commands/build.command.js +25 -54
- package/commands/command.input.js +1 -2
- package/commands/command.loader.d.ts +2 -2
- package/commands/command.loader.js +18 -22
- package/commands/context/add.context.d.ts +7 -0
- package/commands/context/add.context.js +1 -0
- package/commands/context/build.context.d.ts +13 -0
- package/commands/context/build.context.js +1 -0
- package/commands/context/generate.context.d.ts +15 -0
- package/commands/context/generate.context.js +1 -0
- package/commands/context/index.d.ts +5 -0
- package/commands/context/index.js +5 -0
- package/commands/context/new.context.d.ts +11 -0
- package/commands/context/new.context.js +1 -0
- package/commands/context/start.context.d.ts +19 -0
- package/commands/context/start.context.js +1 -0
- package/commands/generate.command.d.ts +3 -3
- package/commands/generate.command.js +26 -54
- package/commands/index.d.ts +3 -2
- package/commands/index.js +3 -18
- package/commands/info.command.d.ts +3 -3
- package/commands/info.command.js +2 -6
- package/commands/new.command.d.ts +3 -3
- package/commands/new.command.js +24 -33
- package/commands/start.command.d.ts +3 -3
- package/commands/start.command.js +34 -71
- package/lib/compiler/assets-manager.d.ts +1 -1
- package/lib/compiler/assets-manager.js +27 -33
- package/lib/compiler/base-compiler.d.ts +5 -5
- package/lib/compiler/base-compiler.js +10 -13
- package/lib/compiler/compiler.d.ts +6 -6
- package/lib/compiler/compiler.js +7 -9
- package/lib/compiler/defaults/rspack-defaults.d.ts +2 -0
- package/lib/compiler/defaults/rspack-defaults.js +138 -0
- package/lib/compiler/defaults/swc-defaults.d.ts +1 -1
- package/lib/compiler/defaults/swc-defaults.js +1 -5
- package/lib/compiler/defaults/webpack-defaults.d.ts +3 -3
- package/lib/compiler/defaults/webpack-defaults.js +36 -18
- package/lib/compiler/helpers/append-extension.js +3 -6
- package/lib/compiler/helpers/copy-path-resolve.js +2 -5
- package/lib/compiler/helpers/delete-out-dir.d.ts +1 -1
- package/lib/compiler/helpers/delete-out-dir.js +5 -8
- package/lib/compiler/helpers/get-builder.d.ts +9 -7
- package/lib/compiler/helpers/get-builder.js +3 -6
- package/lib/compiler/helpers/get-rspack-config-path.d.ts +9 -0
- package/lib/compiler/helpers/get-rspack-config-path.js +15 -0
- package/lib/compiler/helpers/get-tsc-config.path.d.ts +2 -3
- package/lib/compiler/helpers/get-tsc-config.path.js +6 -9
- package/lib/compiler/helpers/get-value-or-default.d.ts +2 -3
- package/lib/compiler/helpers/get-value-or-default.js +3 -8
- package/lib/compiler/helpers/get-webpack-config-path.d.ts +2 -3
- package/lib/compiler/helpers/get-webpack-config-path.js +4 -7
- package/lib/compiler/helpers/manual-restart.js +4 -8
- package/lib/compiler/helpers/tsconfig-provider.d.ts +1 -1
- package/lib/compiler/helpers/tsconfig-provider.js +8 -11
- package/lib/compiler/hooks/tsconfig-paths.hook.js +13 -13
- package/lib/compiler/interfaces/readonly-visitor.interface.js +1 -2
- package/lib/compiler/plugins/plugin-metadata-generator.d.ts +1 -1
- package/lib/compiler/plugins/plugin-metadata-generator.js +10 -13
- package/lib/compiler/plugins/plugin-metadata-printer.d.ts +1 -1
- package/lib/compiler/plugins/plugin-metadata-printer.js +5 -9
- package/lib/compiler/plugins/plugins-loader.d.ts +2 -2
- package/lib/compiler/plugins/plugins-loader.js +13 -13
- package/lib/compiler/rspack-compiler.d.ts +19 -0
- package/lib/compiler/rspack-compiler.js +105 -0
- package/lib/compiler/swc/constants.d.ts +0 -1
- package/lib/compiler/swc/constants.js +9 -13
- package/lib/compiler/swc/forked-type-checker.js +13 -18
- package/lib/compiler/swc/swc-compiler.d.ts +4 -4
- package/lib/compiler/swc/swc-compiler.js +41 -39
- package/lib/compiler/swc/type-checker-host.js +12 -18
- package/lib/compiler/typescript-loader.js +5 -7
- package/lib/compiler/watch-compiler.d.ts +5 -5
- package/lib/compiler/watch-compiler.js +14 -18
- package/lib/compiler/webpack-compiler.d.ts +6 -7
- package/lib/compiler/webpack-compiler.js +30 -22
- package/lib/configuration/configuration.d.ts +9 -4
- package/lib/configuration/configuration.js +1 -2
- package/lib/configuration/configuration.loader.d.ts +1 -1
- package/lib/configuration/configuration.loader.js +1 -2
- package/lib/configuration/defaults.d.ts +2 -1
- package/lib/configuration/defaults.js +8 -10
- package/lib/configuration/index.d.ts +3 -3
- package/lib/configuration/index.js +3 -19
- package/lib/configuration/nest-configuration.loader.d.ts +3 -3
- package/lib/configuration/nest-configuration.loader.js +11 -20
- package/lib/package-managers/abstract.package-manager.d.ts +4 -4
- package/lib/package-managers/abstract.package-manager.js +19 -30
- package/lib/package-managers/index.d.ts +8 -8
- package/lib/package-managers/index.js +8 -24
- package/lib/package-managers/npm.package-manager.d.ts +2 -2
- package/lib/package-managers/npm.package-manager.js +6 -10
- package/lib/package-managers/package-manager-commands.js +1 -2
- package/lib/package-managers/package-manager.factory.d.ts +2 -2
- package/lib/package-managers/package-manager.factory.js +16 -20
- package/lib/package-managers/package-manager.js +2 -5
- package/lib/package-managers/pnpm.package-manager.d.ts +2 -2
- package/lib/package-managers/pnpm.package-manager.js +6 -10
- package/lib/package-managers/project.dependency.js +1 -2
- package/lib/package-managers/yarn.package-manager.d.ts +2 -2
- package/lib/package-managers/yarn.package-manager.js +6 -10
- package/lib/questions/questions.d.ts +5 -1
- package/lib/questions/questions.js +2 -7
- package/lib/readers/file-system.reader.d.ts +1 -1
- package/lib/readers/file-system.reader.js +6 -9
- package/lib/readers/index.d.ts +2 -2
- package/lib/readers/index.js +2 -18
- package/lib/readers/reader.js +3 -5
- package/lib/runners/abstract.runner.js +10 -12
- package/lib/runners/git.runner.d.ts +1 -1
- package/lib/runners/git.runner.js +2 -6
- package/lib/runners/index.d.ts +3 -3
- package/lib/runners/index.js +3 -19
- package/lib/runners/npm.runner.d.ts +1 -1
- package/lib/runners/npm.runner.js +2 -6
- package/lib/runners/pnpm.runner.d.ts +1 -1
- package/lib/runners/pnpm.runner.js +2 -6
- package/lib/runners/runner.factory.d.ts +6 -6
- package/lib/runners/runner.factory.js +15 -20
- package/lib/runners/runner.js +2 -5
- package/lib/runners/schematic.runner.d.ts +1 -1
- package/lib/runners/schematic.runner.js +5 -7
- package/lib/runners/yarn.runner.d.ts +1 -1
- package/lib/runners/yarn.runner.js +2 -6
- package/lib/schematics/abstract.collection.d.ts +3 -3
- package/lib/schematics/abstract.collection.js +3 -5
- package/lib/schematics/collection.factory.d.ts +2 -2
- package/lib/schematics/collection.factory.js +9 -13
- package/lib/schematics/collection.js +2 -5
- package/lib/schematics/custom.collection.d.ts +2 -2
- package/lib/schematics/custom.collection.js +4 -8
- package/lib/schematics/index.d.ts +4 -4
- package/lib/schematics/index.js +4 -20
- package/lib/schematics/nest.collection.d.ts +3 -3
- package/lib/schematics/nest.collection.js +104 -108
- package/lib/schematics/schematic.option.js +7 -9
- package/lib/ui/banner.js +1 -4
- package/lib/ui/emojis.d.ts +17 -17
- package/lib/ui/emojis.js +19 -22
- package/lib/ui/errors.js +1 -5
- package/lib/ui/index.d.ts +5 -5
- package/lib/ui/index.js +5 -21
- package/lib/ui/messages.js +15 -19
- package/lib/ui/prefixes.js +3 -6
- package/lib/utils/formatting.js +1 -4
- package/lib/utils/get-default-tsconfig-path.js +4 -7
- package/lib/utils/gracefully-exit-on-prompt-error.js +1 -4
- package/lib/utils/is-esm-project.d.ts +5 -0
- package/lib/utils/is-esm-project.js +16 -0
- package/lib/utils/is-module-available.js +3 -4
- package/lib/utils/load-configuration.d.ts +1 -1
- package/lib/utils/load-configuration.js +4 -7
- package/lib/utils/local-binaries.d.ts +1 -1
- package/lib/utils/local-binaries.js +8 -11
- package/lib/utils/os-info.utils.js +1 -4
- package/lib/utils/project-utils.d.ts +1 -3
- package/lib/utils/project-utils.js +16 -28
- package/lib/utils/remaining-flags.d.ts +2 -2
- package/lib/utils/remaining-flags.js +2 -5
- package/lib/utils/tree-kill.js +7 -10
- package/lib/utils/type-assertions.js +1 -4
- package/package.json +59 -38
|
@@ -1,12 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.getDefaultTsconfigPath = getDefaultTsconfigPath;
|
|
4
|
-
const fs = require("fs");
|
|
5
|
-
const path_1 = require("path");
|
|
1
|
+
import * as fs from 'fs';
|
|
2
|
+
import { join } from 'path';
|
|
6
3
|
const TSCONFIG_BUILD_JSON = 'tsconfig.build.json';
|
|
7
4
|
const TSCONFIG_JSON = 'tsconfig.json';
|
|
8
|
-
function getDefaultTsconfigPath() {
|
|
9
|
-
return fs.existsSync(
|
|
5
|
+
export function getDefaultTsconfigPath() {
|
|
6
|
+
return fs.existsSync(join(process.cwd(), TSCONFIG_BUILD_JSON))
|
|
10
7
|
? TSCONFIG_BUILD_JSON
|
|
11
8
|
: TSCONFIG_JSON;
|
|
12
9
|
}
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.gracefullyExitOnPromptError = gracefullyExitOnPromptError;
|
|
4
|
-
function gracefullyExitOnPromptError(err) {
|
|
1
|
+
export function gracefullyExitOnPromptError(err) {
|
|
5
2
|
if (err.name === 'ExitPromptError') {
|
|
6
3
|
process.exit(1);
|
|
7
4
|
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { readFileSync } from 'fs';
|
|
2
|
+
import { join } from 'path';
|
|
3
|
+
/**
|
|
4
|
+
* Detect whether the target project uses ESM output.
|
|
5
|
+
* Checks the project's package.json for `"type": "module"`.
|
|
6
|
+
*/
|
|
7
|
+
export function isEsmProject(cwd = process.cwd()) {
|
|
8
|
+
try {
|
|
9
|
+
const raw = readFileSync(join(cwd, 'package.json'), 'utf-8');
|
|
10
|
+
const pkg = JSON.parse(raw);
|
|
11
|
+
return pkg.type === 'module';
|
|
12
|
+
}
|
|
13
|
+
catch {
|
|
14
|
+
return false;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
function isModuleAvailable(path) {
|
|
1
|
+
import { createRequire } from 'module';
|
|
2
|
+
const require = createRequire(import.meta.url);
|
|
3
|
+
export function isModuleAvailable(path) {
|
|
5
4
|
try {
|
|
6
5
|
require.resolve(path);
|
|
7
6
|
return true;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { Configuration } from '../configuration';
|
|
1
|
+
import { Configuration } from '../configuration/index.js';
|
|
2
2
|
export declare function loadConfiguration(): Promise<Required<Configuration>>;
|
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const
|
|
5
|
-
const readers_1 = require("../readers");
|
|
6
|
-
async function loadConfiguration() {
|
|
7
|
-
const loader = new nest_configuration_loader_1.NestConfigurationLoader(new readers_1.FileSystemReader(process.cwd()));
|
|
1
|
+
import { NestConfigurationLoader } from '../configuration/nest-configuration.loader.js';
|
|
2
|
+
import { FileSystemReader } from '../readers/index.js';
|
|
3
|
+
export async function loadConfiguration() {
|
|
4
|
+
const loader = new NestConfigurationLoader(new FileSystemReader(process.cwd()));
|
|
8
5
|
return loader.load();
|
|
9
6
|
}
|
|
@@ -1,15 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
const fs_1 = require("fs");
|
|
6
|
-
const path_1 = require("path");
|
|
1
|
+
import { existsSync } from 'fs';
|
|
2
|
+
import { createRequire } from 'module';
|
|
3
|
+
import { join, posix } from 'path';
|
|
4
|
+
const require = createRequire(import.meta.url);
|
|
7
5
|
const localBinPathSegments = [process.cwd(), 'node_modules', '@nestjs', 'cli'];
|
|
8
|
-
function localBinExists() {
|
|
9
|
-
return
|
|
6
|
+
export function localBinExists() {
|
|
7
|
+
return existsSync(join(...localBinPathSegments));
|
|
10
8
|
}
|
|
11
|
-
function loadLocalBinCommandLoader() {
|
|
12
|
-
|
|
13
|
-
const commandsFile = require(path_1.posix.join(...localBinPathSegments, 'commands'));
|
|
9
|
+
export function loadLocalBinCommandLoader() {
|
|
10
|
+
const commandsFile = require(posix.join(...localBinPathSegments, 'commands'));
|
|
14
11
|
return commandsFile.CommandLoader;
|
|
15
12
|
}
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.default = osName;
|
|
4
|
-
function osName(platform, release) {
|
|
1
|
+
export default function osName(platform, release) {
|
|
5
2
|
switch (platform) {
|
|
6
3
|
case 'darwin':
|
|
7
4
|
return Number(release.split('.')[0]) > 15 ? 'macOS' : 'OS X';
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Configuration, ProjectConfiguration } from '../configuration';
|
|
1
|
+
import { Configuration, ProjectConfiguration } from '../configuration/index.js';
|
|
3
2
|
export declare function shouldAskForProject(schematic: string, configurationProjects: {
|
|
4
3
|
[key: string]: ProjectConfiguration;
|
|
5
4
|
}, appName: string): boolean;
|
|
@@ -8,4 +7,3 @@ export declare function shouldGenerateFlat(configuration: Required<Configuration
|
|
|
8
7
|
export declare function getSpecFileSuffix(configuration: Required<Configuration>, appName: string, specFileSuffixValue: string): string;
|
|
9
8
|
export declare function askForProjectName(promptQuestion: string, projects: string[]): Promise<string | void>;
|
|
10
9
|
export declare function moveDefaultProjectToStart(configuration: Configuration, defaultProjectName: string, defaultLabel: string): string[];
|
|
11
|
-
export declare function hasValidOptionFlag(queriedOptionName: string, options: Input[], queriedValue?: string | number | boolean): boolean;
|
|
@@ -1,28 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
exports.getSpecFileSuffix = getSpecFileSuffix;
|
|
7
|
-
exports.askForProjectName = askForProjectName;
|
|
8
|
-
exports.moveDefaultProjectToStart = moveDefaultProjectToStart;
|
|
9
|
-
exports.hasValidOptionFlag = hasValidOptionFlag;
|
|
10
|
-
const prompts_1 = require("@inquirer/prompts");
|
|
11
|
-
const get_value_or_default_1 = require("../compiler/helpers/get-value-or-default");
|
|
12
|
-
const questions_1 = require("../questions/questions");
|
|
13
|
-
const gracefully_exit_on_prompt_error_1 = require("./gracefully-exit-on-prompt-error");
|
|
14
|
-
function shouldAskForProject(schematic, configurationProjects, appName) {
|
|
1
|
+
import { select } from '@inquirer/prompts';
|
|
2
|
+
import { getValueOrDefault } from '../compiler/helpers/get-value-or-default.js';
|
|
3
|
+
import { generateSelect } from '../questions/questions.js';
|
|
4
|
+
import { gracefullyExitOnPromptError } from './gracefully-exit-on-prompt-error.js';
|
|
5
|
+
export function shouldAskForProject(schematic, configurationProjects, appName) {
|
|
15
6
|
return (['app', 'sub-app', 'library', 'lib'].includes(schematic) === false &&
|
|
16
7
|
configurationProjects &&
|
|
17
8
|
Object.entries(configurationProjects).length !== 0 &&
|
|
18
9
|
!appName);
|
|
19
10
|
}
|
|
20
|
-
function shouldGenerateSpec(configuration, schematic, appName, specValue, specPassedAsInput) {
|
|
11
|
+
export function shouldGenerateSpec(configuration, schematic, appName, specValue, specPassedAsInput) {
|
|
21
12
|
if (specPassedAsInput === true || specPassedAsInput === undefined) {
|
|
22
13
|
// CLI parameters has the highest priority
|
|
23
14
|
return specValue;
|
|
24
15
|
}
|
|
25
|
-
let specConfiguration =
|
|
16
|
+
let specConfiguration = getValueOrDefault(configuration, 'generateOptions.spec', appName || '');
|
|
26
17
|
if (typeof specConfiguration === 'boolean') {
|
|
27
18
|
return specConfiguration;
|
|
28
19
|
}
|
|
@@ -33,7 +24,7 @@ function shouldGenerateSpec(configuration, schematic, appName, specValue, specPa
|
|
|
33
24
|
if (typeof specConfiguration === 'object' && appName) {
|
|
34
25
|
// The appName has a generateOption spec, but not for the schematic trying to generate
|
|
35
26
|
// Check if the global generateOptions has a spec to use instead
|
|
36
|
-
specConfiguration =
|
|
27
|
+
specConfiguration = getValueOrDefault(configuration, 'generateOptions.spec', '');
|
|
37
28
|
if (typeof specConfiguration === 'boolean') {
|
|
38
29
|
return specConfiguration;
|
|
39
30
|
}
|
|
@@ -44,33 +35,33 @@ function shouldGenerateSpec(configuration, schematic, appName, specValue, specPa
|
|
|
44
35
|
}
|
|
45
36
|
return specValue;
|
|
46
37
|
}
|
|
47
|
-
function shouldGenerateFlat(configuration, appName, flatValue) {
|
|
38
|
+
export function shouldGenerateFlat(configuration, appName, flatValue) {
|
|
48
39
|
// CLI parameters have the highest priority
|
|
49
40
|
if (flatValue === true) {
|
|
50
41
|
return flatValue;
|
|
51
42
|
}
|
|
52
|
-
const flatConfiguration =
|
|
43
|
+
const flatConfiguration = getValueOrDefault(configuration, 'generateOptions.flat', appName || '');
|
|
53
44
|
if (typeof flatConfiguration === 'boolean') {
|
|
54
45
|
return flatConfiguration;
|
|
55
46
|
}
|
|
56
47
|
return flatValue;
|
|
57
48
|
}
|
|
58
|
-
function getSpecFileSuffix(configuration, appName, specFileSuffixValue) {
|
|
49
|
+
export function getSpecFileSuffix(configuration, appName, specFileSuffixValue) {
|
|
59
50
|
// CLI parameters have the highest priority
|
|
60
51
|
if (specFileSuffixValue) {
|
|
61
52
|
return specFileSuffixValue;
|
|
62
53
|
}
|
|
63
|
-
const specFileSuffixConfiguration =
|
|
54
|
+
const specFileSuffixConfiguration = getValueOrDefault(configuration, 'generateOptions.specFileSuffix', appName || '', undefined, undefined, 'spec');
|
|
64
55
|
if (typeof specFileSuffixConfiguration === 'string') {
|
|
65
56
|
return specFileSuffixConfiguration;
|
|
66
57
|
}
|
|
67
58
|
return specFileSuffixValue;
|
|
68
59
|
}
|
|
69
|
-
async function askForProjectName(promptQuestion, projects) {
|
|
70
|
-
const projectNameSelect =
|
|
71
|
-
return
|
|
60
|
+
export async function askForProjectName(promptQuestion, projects) {
|
|
61
|
+
const projectNameSelect = generateSelect('appName')(promptQuestion)(projects);
|
|
62
|
+
return select(projectNameSelect).catch(gracefullyExitOnPromptError);
|
|
72
63
|
}
|
|
73
|
-
function moveDefaultProjectToStart(configuration, defaultProjectName, defaultLabel) {
|
|
64
|
+
export function moveDefaultProjectToStart(configuration, defaultProjectName, defaultLabel) {
|
|
74
65
|
let projects = configuration.projects != null ? Object.keys(configuration.projects) : [];
|
|
75
66
|
if (configuration.sourceRoot !== 'src') {
|
|
76
67
|
projects = projects.filter((p) => p !== defaultProjectName.replace(defaultLabel, ''));
|
|
@@ -78,6 +69,3 @@ function moveDefaultProjectToStart(configuration, defaultProjectName, defaultLab
|
|
|
78
69
|
projects.unshift(defaultProjectName);
|
|
79
70
|
return projects;
|
|
80
71
|
}
|
|
81
|
-
function hasValidOptionFlag(queriedOptionName, options, queriedValue = true) {
|
|
82
|
-
return options.some((option) => option.name === queriedOptionName && option.value === queriedValue);
|
|
83
|
-
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare function getRemainingFlags(cli:
|
|
1
|
+
import { Command } from 'commander';
|
|
2
|
+
export declare function getRemainingFlags(cli: Command): any[];
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getRemainingFlags = getRemainingFlags;
|
|
4
|
-
function getRemainingFlags(cli) {
|
|
1
|
+
export function getRemainingFlags(cli) {
|
|
5
2
|
const rawArgs = [...cli.rawArgs];
|
|
6
3
|
return rawArgs
|
|
7
4
|
.splice(Math.max(rawArgs.findIndex((item) => item.startsWith('--')), 0))
|
|
@@ -15,7 +12,7 @@ function getRemainingFlags(cli) {
|
|
|
15
12
|
const prevKeyRaw = array[index - 1];
|
|
16
13
|
if (prevKeyRaw) {
|
|
17
14
|
const previousKey = camelCase(prevKeyRaw.replace(/--/g, '').replace('no', ''));
|
|
18
|
-
if (cli
|
|
15
|
+
if (cli.getOptionValue(previousKey) === item) {
|
|
19
16
|
return false;
|
|
20
17
|
}
|
|
21
18
|
}
|
package/lib/utils/tree-kill.js
CHANGED
|
@@ -1,21 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.treeKillSync = treeKillSync;
|
|
4
|
-
const child_process_1 = require("child_process");
|
|
5
|
-
function treeKillSync(pid, signal) {
|
|
1
|
+
import { execSync, spawnSync } from 'child_process';
|
|
2
|
+
export function treeKillSync(pid, signal) {
|
|
6
3
|
if (process.platform === 'win32') {
|
|
7
|
-
|
|
4
|
+
execSync('taskkill /pid ' + pid + ' /T /F');
|
|
8
5
|
return;
|
|
9
6
|
}
|
|
10
|
-
const
|
|
11
|
-
|
|
7
|
+
const children = getAllChildren(pid);
|
|
8
|
+
children.forEach(function (pid) {
|
|
12
9
|
killPid(pid, signal);
|
|
13
10
|
});
|
|
14
11
|
killPid(pid, signal);
|
|
15
12
|
return;
|
|
16
13
|
}
|
|
17
14
|
function getAllPid() {
|
|
18
|
-
const result =
|
|
15
|
+
const result = spawnSync('ps', ['-A', '-o', 'pid,ppid'], {
|
|
19
16
|
encoding: 'utf-8',
|
|
20
17
|
stdio: 'pipe',
|
|
21
18
|
});
|
|
@@ -38,7 +35,7 @@ function getAllPid() {
|
|
|
38
35
|
return input != null;
|
|
39
36
|
});
|
|
40
37
|
}
|
|
41
|
-
function
|
|
38
|
+
function getAllChildren(pid) {
|
|
42
39
|
const allpid = getAllPid();
|
|
43
40
|
const ppidHash = {};
|
|
44
41
|
const result = [];
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.assertNonArray = assertNonArray;
|
|
4
|
-
function assertNonArray(value) {
|
|
1
|
+
export function assertNonArray(value) {
|
|
5
2
|
if (Array.isArray(value)) {
|
|
6
3
|
throw new TypeError('Expected a non-array value');
|
|
7
4
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nestjs/cli",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "12.0.0-alpha.1",
|
|
4
|
+
"type": "module",
|
|
4
5
|
"description": "Nest - modern, fast, powerful node.js web framework (@cli)",
|
|
5
6
|
"publishConfig": {
|
|
6
7
|
"access": "public"
|
|
@@ -15,18 +16,19 @@
|
|
|
15
16
|
"build": "tsc",
|
|
16
17
|
"clean": "gulp clean:bundle",
|
|
17
18
|
"format": "prettier --write \"**/*.ts\"",
|
|
18
|
-
"lint": "eslint '
|
|
19
|
+
"lint": "eslint 'lib/**/*.ts' 'commands/**/*.ts' 'actions/**/*.ts' --fix",
|
|
19
20
|
"start": "node bin/nest.js",
|
|
20
21
|
"prepack": "npm run build",
|
|
21
22
|
"prepublish:next": "npm run build",
|
|
22
23
|
"publish:next": "npm publish --access public --tag next",
|
|
23
24
|
"prepublish:npm": "npm run build",
|
|
24
25
|
"publish:npm": "npm publish --access public",
|
|
25
|
-
"test": "
|
|
26
|
-
"test:
|
|
26
|
+
"test": "vitest run",
|
|
27
|
+
"test:e2e": "vitest run -c vitest.e2e.config.ts",
|
|
28
|
+
"test:dev": "npm run clean && vitest --watch",
|
|
27
29
|
"prerelease": "npm run build",
|
|
28
30
|
"release": "release-it",
|
|
29
|
-
"prepare": "husky"
|
|
31
|
+
"prepare": "husky && node tools/postinstall.cjs"
|
|
30
32
|
},
|
|
31
33
|
"repository": {
|
|
32
34
|
"type": "git",
|
|
@@ -38,64 +40,83 @@
|
|
|
38
40
|
},
|
|
39
41
|
"homepage": "https://github.com/nestjs/nest-cli#readme",
|
|
40
42
|
"dependencies": {
|
|
41
|
-
"@angular-devkit/core": "
|
|
42
|
-
"@angular-devkit/schematics": "
|
|
43
|
-
"@angular-devkit/schematics-cli": "
|
|
44
|
-
"@inquirer/prompts": "
|
|
45
|
-
"@nestjs/schematics": "^
|
|
43
|
+
"@angular-devkit/core": "21.2.0",
|
|
44
|
+
"@angular-devkit/schematics": "21.2.0",
|
|
45
|
+
"@angular-devkit/schematics-cli": "21.2.0",
|
|
46
|
+
"@inquirer/prompts": "8.3.0",
|
|
47
|
+
"@nestjs/schematics": "^12.0.0-alpha.0",
|
|
46
48
|
"ansis": "4.2.0",
|
|
47
49
|
"chokidar": "4.0.3",
|
|
48
50
|
"cli-table3": "0.6.5",
|
|
49
|
-
"commander": "
|
|
50
|
-
"
|
|
51
|
-
"
|
|
52
|
-
"
|
|
53
|
-
"ora": "5.4.1",
|
|
51
|
+
"commander": "14.0.3",
|
|
52
|
+
"glob": "13.0.6",
|
|
53
|
+
"node-emoji": "2.2.0",
|
|
54
|
+
"ora": "9.3.0",
|
|
54
55
|
"tsconfig-paths": "4.2.0",
|
|
55
|
-
"
|
|
56
|
-
"typescript": "5.9.3",
|
|
57
|
-
"webpack": "5.104.1",
|
|
58
|
-
"webpack-node-externals": "3.0.0"
|
|
56
|
+
"typescript": "5.9.3"
|
|
59
57
|
},
|
|
60
58
|
"devDependencies": {
|
|
61
|
-
"@commitlint/cli": "20.3
|
|
62
|
-
"@commitlint/config-angular": "20.3
|
|
63
|
-
"@swc/cli": "0.
|
|
64
|
-
"@swc/core": "1.15.
|
|
65
|
-
"@types/
|
|
66
|
-
"@types/jest": "29.5.14",
|
|
67
|
-
"@types/node": "24.10.8",
|
|
68
|
-
"@types/node-emoji": "1.8.2",
|
|
59
|
+
"@commitlint/cli": "20.4.3",
|
|
60
|
+
"@commitlint/config-angular": "20.4.3",
|
|
61
|
+
"@swc/cli": "0.8.0",
|
|
62
|
+
"@swc/core": "1.15.18",
|
|
63
|
+
"@types/node": "24.10.13",
|
|
69
64
|
"@types/webpack-node-externals": "3.0.4",
|
|
70
|
-
"@
|
|
71
|
-
"@typescript-eslint/parser": "8.53.0",
|
|
65
|
+
"@eslint/js": "10.0.1",
|
|
72
66
|
"delete-empty": "3.0.0",
|
|
73
|
-
"eslint": "
|
|
67
|
+
"eslint": "10.0.2",
|
|
74
68
|
"eslint-config-prettier": "10.1.8",
|
|
69
|
+
"typescript-eslint": "8.56.1",
|
|
70
|
+
"fork-ts-checker-webpack-plugin": "9.1.0",
|
|
75
71
|
"gulp": "5.0.1",
|
|
76
72
|
"gulp-clean": "0.4.0",
|
|
77
73
|
"husky": "9.1.7",
|
|
78
|
-
"
|
|
79
|
-
"
|
|
80
|
-
"
|
|
81
|
-
"release-it": "19.2.3",
|
|
82
|
-
"ts-jest": "29.4.6",
|
|
74
|
+
"lint-staged": "16.3.2",
|
|
75
|
+
"prettier": "3.8.1",
|
|
76
|
+
"release-it": "19.2.4",
|
|
83
77
|
"ts-loader": "9.5.4",
|
|
84
|
-
"
|
|
78
|
+
"tsconfig-paths-webpack-plugin": "4.2.0",
|
|
79
|
+
"vitest": "3.2.4",
|
|
80
|
+
"webpack": "5.105.4",
|
|
81
|
+
"webpack-node-externals": "3.0.0"
|
|
85
82
|
},
|
|
86
83
|
"lint-staged": {
|
|
87
84
|
"**/*.{ts,json}": []
|
|
88
85
|
},
|
|
89
86
|
"peerDependencies": {
|
|
90
|
-
"@
|
|
91
|
-
"@swc/
|
|
87
|
+
"@rspack/core": "^1.0.0",
|
|
88
|
+
"@swc/cli": "^0.1.62 || ^0.3.0 || ^0.4.0 || ^0.5.0 || ^0.6.0 || ^0.7.0 || ^0.8.0",
|
|
89
|
+
"@swc/core": "^1.3.62",
|
|
90
|
+
"fork-ts-checker-webpack-plugin": "^9.0.0",
|
|
91
|
+
"ts-loader": "^9.0.0",
|
|
92
|
+
"tsconfig-paths-webpack-plugin": "^4.0.0",
|
|
93
|
+
"webpack": "^5.0.0",
|
|
94
|
+
"webpack-node-externals": "^3.0.0"
|
|
92
95
|
},
|
|
93
96
|
"peerDependenciesMeta": {
|
|
97
|
+
"@rspack/core": {
|
|
98
|
+
"optional": true
|
|
99
|
+
},
|
|
94
100
|
"@swc/cli": {
|
|
95
101
|
"optional": true
|
|
96
102
|
},
|
|
97
103
|
"@swc/core": {
|
|
98
104
|
"optional": true
|
|
105
|
+
},
|
|
106
|
+
"fork-ts-checker-webpack-plugin": {
|
|
107
|
+
"optional": true
|
|
108
|
+
},
|
|
109
|
+
"ts-loader": {
|
|
110
|
+
"optional": true
|
|
111
|
+
},
|
|
112
|
+
"tsconfig-paths-webpack-plugin": {
|
|
113
|
+
"optional": true
|
|
114
|
+
},
|
|
115
|
+
"webpack": {
|
|
116
|
+
"optional": true
|
|
117
|
+
},
|
|
118
|
+
"webpack-node-externals": {
|
|
119
|
+
"optional": true
|
|
99
120
|
}
|
|
100
121
|
}
|
|
101
122
|
}
|