@depup/nestjs__cli 11.0.24-depup.8 → 12.0.0-depup.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/README.md +6 -14
- 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 +44 -53
- package/actions/build.action.d.ts +18 -11
- package/actions/build.action.js +172 -79
- package/actions/deploy.action.d.ts +6 -0
- package/actions/deploy.action.js +51 -0
- package/actions/generate.action.d.ts +3 -3
- package/actions/generate.action.js +61 -59
- package/actions/index.d.ts +9 -7
- package/actions/index.js +9 -23
- package/actions/info.action.d.ts +18 -28
- package/actions/info.action.js +80 -60
- package/actions/new.action.d.ts +3 -3
- package/actions/new.action.js +108 -104
- package/actions/start.action.d.ts +4 -7
- package/actions/start.action.js +40 -47
- package/actions/upgrade.action.d.ts +6 -0
- package/actions/upgrade.action.js +53 -0
- package/bin/nest.js +11 -10
- package/changes.json +6 -38
- 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 +17 -20
- package/commands/build.command.d.ts +3 -3
- package/commands/build.command.js +52 -56
- package/commands/command.input.js +1 -2
- package/commands/command.loader.d.ts +2 -2
- package/commands/command.loader.js +29 -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 +17 -0
- package/commands/context/build.context.js +1 -0
- package/commands/context/deploy.context.d.ts +7 -0
- package/commands/context/deploy.context.js +1 -0
- package/commands/context/generate.context.d.ts +18 -0
- package/commands/context/generate.context.js +1 -0
- package/commands/context/index.d.ts +7 -0
- package/commands/context/index.js +7 -0
- package/commands/context/new.context.d.ts +19 -0
- package/commands/context/new.context.js +1 -0
- package/commands/context/start.context.d.ts +22 -0
- package/commands/context/start.context.js +1 -0
- package/commands/context/upgrade.context.d.ts +11 -0
- package/commands/context/upgrade.context.js +1 -0
- package/commands/deploy.command.d.ts +5 -0
- package/commands/deploy.command.js +22 -0
- package/commands/generate.command.d.ts +3 -3
- package/commands/generate.command.js +35 -66
- 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 +4 -8
- package/commands/new.command.d.ts +3 -3
- package/commands/new.command.js +34 -36
- package/commands/start.command.d.ts +3 -3
- package/commands/start.command.js +48 -73
- package/commands/upgrade.command.d.ts +5 -0
- package/commands/upgrade.command.js +32 -0
- package/lib/compiler/assets-manager.d.ts +20 -8
- package/lib/compiler/assets-manager.js +199 -63
- 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 +3 -0
- package/lib/compiler/defaults/rspack-defaults.js +179 -0
- package/lib/compiler/defaults/swc-defaults.d.ts +5 -2
- package/lib/compiler/defaults/swc-defaults.js +22 -6
- package/lib/compiler/defaults/webpack-defaults.d.ts +2 -2
- package/lib/compiler/defaults/webpack-defaults.js +59 -19
- 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 +45 -10
- package/lib/compiler/helpers/get-builder.d.ts +9 -7
- package/lib/compiler/helpers/get-builder.js +3 -6
- package/lib/compiler/helpers/get-effective-root-dir.d.ts +16 -0
- package/lib/compiler/helpers/get-effective-root-dir.js +56 -0
- package/lib/compiler/helpers/get-rspack-config-path.d.ts +10 -0
- package/lib/compiler/helpers/get-rspack-config-path.js +19 -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/glob.d.ts +19 -0
- package/lib/compiler/helpers/glob.js +185 -0
- package/lib/compiler/helpers/manual-restart.js +4 -8
- package/lib/compiler/helpers/path-confinement.d.ts +33 -0
- package/lib/compiler/helpers/path-confinement.js +63 -0
- package/lib/compiler/helpers/tsconfig-provider.d.ts +7 -6
- package/lib/compiler/helpers/tsconfig-provider.js +32 -13
- 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 +37 -1
- package/lib/compiler/plugins/plugin-metadata-generator.js +113 -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 +12 -12
- package/lib/compiler/rspack-compiler.d.ts +21 -0
- package/lib/compiler/rspack-compiler.js +111 -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 +13 -6
- package/lib/compiler/swc/swc-compiler.js +116 -70
- package/lib/compiler/swc/type-checker-host.js +31 -24
- package/lib/compiler/typescript-loader.js +7 -9
- package/lib/compiler/watch-compiler.d.ts +5 -5
- package/lib/compiler/watch-compiler.js +13 -15
- package/lib/compiler/watchers/recursive-directory-watcher.d.ts +37 -0
- package/lib/compiler/watchers/recursive-directory-watcher.js +334 -0
- package/lib/compiler/webpack-compiler.d.ts +6 -7
- package/lib/compiler/webpack-compiler.js +46 -23
- package/lib/configuration/configuration.d.ts +16 -3
- 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 +28 -29
- package/lib/package-managers/abstract.package-manager.d.ts +4 -4
- package/lib/package-managers/abstract.package-manager.js +21 -32
- package/lib/package-managers/bun.package-manager.d.ts +7 -0
- package/lib/package-managers/bun.package-manager.js +22 -0
- package/lib/package-managers/index.d.ts +9 -8
- package/lib/package-managers/index.js +9 -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.d.ts +2 -1
- package/lib/package-managers/package-manager.factory.d.ts +2 -2
- package/lib/package-managers/package-manager.factory.js +23 -20
- package/lib/package-managers/package-manager.js +3 -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 +40 -21
- package/lib/runners/bun.runner.d.ts +4 -0
- package/lib/runners/bun.runner.js +6 -0
- 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/mau.runner.d.ts +8 -0
- package/lib/runners/mau.runner.js +10 -0
- 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.d.ts +2 -1
- package/lib/runners/runner.factory.d.ts +7 -6
- package/lib/runners/runner.factory.js +18 -20
- package/lib/runners/runner.js +3 -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 +113 -109
- package/lib/schematics/schematic.option.js +10 -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 -4
- package/lib/ui/index.d.ts +5 -5
- package/lib/ui/index.js +5 -21
- package/lib/ui/messages.d.ts +8 -0
- package/lib/ui/messages.js +23 -18
- package/lib/ui/prefixes.js +3 -6
- package/lib/utils/extra-args-warning.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-interactive.d.ts +8 -0
- package/lib/utils/is-interactive.js +10 -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 +2 -2
- package/lib/utils/local-binaries.js +8 -11
- package/lib/utils/mau.d.ts +14 -0
- package/lib/utils/mau.js +46 -0
- 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 +13 -8
- package/lib/utils/tree-kill.js +7 -10
- package/lib/utils/type-assertions.js +1 -4
- package/package.json +64 -77
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { CommandLoader } from '../../commands';
|
|
1
|
+
import { CommandLoader } from '../../commands/index.js';
|
|
2
2
|
export declare function localBinExists(): boolean;
|
|
3
|
-
export declare function loadLocalBinCommandLoader(): typeof CommandLoader
|
|
3
|
+
export declare function loadLocalBinCommandLoader(): Promise<typeof CommandLoader>;
|
|
@@ -1,15 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
exports.loadLocalBinCommandLoader = loadLocalBinCommandLoader;
|
|
5
|
-
const fs_1 = require("fs");
|
|
6
|
-
const path_1 = require("path");
|
|
1
|
+
import { existsSync } from 'fs';
|
|
2
|
+
import { join } from 'path';
|
|
3
|
+
import { pathToFileURL } from 'url';
|
|
7
4
|
const localBinPathSegments = [process.cwd(), 'node_modules', '@nestjs', 'cli'];
|
|
8
|
-
function localBinExists() {
|
|
9
|
-
return
|
|
5
|
+
export function localBinExists() {
|
|
6
|
+
return existsSync(join(...localBinPathSegments));
|
|
10
7
|
}
|
|
11
|
-
function loadLocalBinCommandLoader() {
|
|
12
|
-
|
|
13
|
-
const commandsFile =
|
|
8
|
+
export async function loadLocalBinCommandLoader() {
|
|
9
|
+
const commandsPath = join(...localBinPathSegments, 'commands', 'index.js');
|
|
10
|
+
const commandsFile = await import(pathToFileURL(commandsPath).href);
|
|
14
11
|
return commandsFile.CommandLoader;
|
|
15
12
|
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export declare const MAU_PACKAGE_NAME = "@nestjs/mau";
|
|
2
|
+
/**
|
|
3
|
+
* Resolves the `mau` executable shipped by `@nestjs/mau`, looking in the
|
|
4
|
+
* user's project first and then next to the CLI itself.
|
|
5
|
+
*
|
|
6
|
+
* The path comes from the package's own `bin` field rather than a hardcoded
|
|
7
|
+
* `node_modules/.bin/mau`: that shim is absent under pnpm's layout, lives in a
|
|
8
|
+
* parent directory in hoisted monorepos, and is not directly executable on
|
|
9
|
+
* Windows.
|
|
10
|
+
*
|
|
11
|
+
* @returns The absolute path to the executable, or `undefined` when
|
|
12
|
+
* `@nestjs/mau` is not installed.
|
|
13
|
+
*/
|
|
14
|
+
export declare function findMauBinary(cwd?: string): string | undefined;
|
package/lib/utils/mau.js
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { existsSync, readFileSync } from 'fs';
|
|
2
|
+
import { createRequire } from 'module';
|
|
3
|
+
import { dirname, join } from 'path';
|
|
4
|
+
const require = createRequire(import.meta.url);
|
|
5
|
+
export const MAU_PACKAGE_NAME = '@nestjs/mau';
|
|
6
|
+
/**
|
|
7
|
+
* Resolves the `mau` executable shipped by `@nestjs/mau`, looking in the
|
|
8
|
+
* user's project first and then next to the CLI itself.
|
|
9
|
+
*
|
|
10
|
+
* The path comes from the package's own `bin` field rather than a hardcoded
|
|
11
|
+
* `node_modules/.bin/mau`: that shim is absent under pnpm's layout, lives in a
|
|
12
|
+
* parent directory in hoisted monorepos, and is not directly executable on
|
|
13
|
+
* Windows.
|
|
14
|
+
*
|
|
15
|
+
* @returns The absolute path to the executable, or `undefined` when
|
|
16
|
+
* `@nestjs/mau` is not installed.
|
|
17
|
+
*/
|
|
18
|
+
export function findMauBinary(cwd = process.cwd()) {
|
|
19
|
+
const searchPaths = [
|
|
20
|
+
cwd,
|
|
21
|
+
join(cwd, 'node_modules'),
|
|
22
|
+
...(require.resolve.paths(MAU_PACKAGE_NAME) ?? []),
|
|
23
|
+
];
|
|
24
|
+
let packageJsonPath;
|
|
25
|
+
try {
|
|
26
|
+
packageJsonPath = require.resolve(`${MAU_PACKAGE_NAME}/package.json`, {
|
|
27
|
+
paths: searchPaths,
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
catch {
|
|
31
|
+
return undefined;
|
|
32
|
+
}
|
|
33
|
+
let bin;
|
|
34
|
+
try {
|
|
35
|
+
bin = JSON.parse(readFileSync(packageJsonPath, 'utf8')).bin;
|
|
36
|
+
}
|
|
37
|
+
catch {
|
|
38
|
+
return undefined;
|
|
39
|
+
}
|
|
40
|
+
const relativeBinPath = typeof bin === 'string' ? bin : (bin?.mau ?? Object.values(bin ?? {})[0]);
|
|
41
|
+
if (!relativeBinPath) {
|
|
42
|
+
return undefined;
|
|
43
|
+
}
|
|
44
|
+
const binaryPath = join(dirname(packageJsonPath), relativeBinPath);
|
|
45
|
+
return existsSync(binaryPath) ? binaryPath : undefined;
|
|
46
|
+
}
|
|
@@ -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,10 +1,11 @@
|
|
|
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];
|
|
3
|
+
const spliceIndex = rawArgs.findIndex((item) => item.startsWith('--'));
|
|
4
|
+
if (spliceIndex === -1) {
|
|
5
|
+
return [];
|
|
6
|
+
}
|
|
6
7
|
return rawArgs
|
|
7
|
-
.splice(
|
|
8
|
+
.splice(spliceIndex)
|
|
8
9
|
.filter((item, index, array) => {
|
|
9
10
|
// If the option is consumed by commander.js, then we skip it
|
|
10
11
|
if (cli.options.find((o) => o.short === item || o.long === item)) {
|
|
@@ -13,9 +14,9 @@ function getRemainingFlags(cli) {
|
|
|
13
14
|
// If it's an argument of an option consumed by commander.js, then we
|
|
14
15
|
// skip it too
|
|
15
16
|
const prevKeyRaw = array[index - 1];
|
|
16
|
-
if (prevKeyRaw) {
|
|
17
|
+
if (prevKeyRaw?.startsWith('-')) {
|
|
17
18
|
const previousKey = camelCase(prevKeyRaw.replace(/--/g, '').replace('no', ''));
|
|
18
|
-
if (cli
|
|
19
|
+
if (cli.getOptionValue(previousKey) === item) {
|
|
19
20
|
return false;
|
|
20
21
|
}
|
|
21
22
|
}
|
|
@@ -30,7 +31,11 @@ function getRemainingFlags(cli) {
|
|
|
30
31
|
* @api private
|
|
31
32
|
*/
|
|
32
33
|
function camelCase(flag) {
|
|
33
|
-
|
|
34
|
+
const words = flag.split('-').filter((word) => word.length > 0);
|
|
35
|
+
if (words.length === 0) {
|
|
36
|
+
return '';
|
|
37
|
+
}
|
|
38
|
+
return words.reduce((str, word) => {
|
|
34
39
|
return str + word[0].toUpperCase() + word.slice(1);
|
|
35
40
|
});
|
|
36
41
|
}
|
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": "@depup/nestjs__cli",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "12.0.0-depup.0",
|
|
4
|
+
"type": "module",
|
|
4
5
|
"description": "Nest - modern, fast, powerful node.js web framework (@cli) (with updated dependencies)",
|
|
5
6
|
"engines": {
|
|
6
7
|
"node": ">= 20.11"
|
|
@@ -10,16 +11,17 @@
|
|
|
10
11
|
},
|
|
11
12
|
"scripts": {
|
|
12
13
|
"build": "tsc",
|
|
13
|
-
"clean": "
|
|
14
|
+
"clean": "node tools/clean.js",
|
|
14
15
|
"format": "prettier --write \"**/*.ts\"",
|
|
15
|
-
"lint": "
|
|
16
|
+
"lint": "oxlint lib/ commands/ actions/",
|
|
16
17
|
"start": "node bin/nest.js",
|
|
17
18
|
"prepublish:next": "npm run build",
|
|
18
19
|
"publish:next": "npm publish --access public --tag next",
|
|
19
20
|
"prepublish:npm": "npm run build",
|
|
20
21
|
"publish:npm": "npm publish --access public",
|
|
21
|
-
"test": "
|
|
22
|
-
"test:
|
|
22
|
+
"test": "vitest run",
|
|
23
|
+
"test:e2e": "vitest run -c vitest.e2e.config.ts",
|
|
24
|
+
"test:dev": "npm run clean && vitest --watch",
|
|
23
25
|
"prerelease": "npm run build",
|
|
24
26
|
"release": "release-it"
|
|
25
27
|
},
|
|
@@ -36,61 +38,78 @@
|
|
|
36
38
|
"@angular-devkit/core": "^22.1.6",
|
|
37
39
|
"@angular-devkit/schematics": "^22.1.6",
|
|
38
40
|
"@angular-devkit/schematics-cli": "^22.1.6",
|
|
39
|
-
"@inquirer/prompts": "
|
|
40
|
-
"@nestjs/schematics": "^
|
|
41
|
-
"ansis": "
|
|
42
|
-
"chokidar": "
|
|
41
|
+
"@inquirer/prompts": "8.7.0",
|
|
42
|
+
"@nestjs/schematics": "^12.0.0",
|
|
43
|
+
"ansis": "4.3.1",
|
|
44
|
+
"chokidar": "5.0.0",
|
|
43
45
|
"cli-table3": "0.6.5",
|
|
44
|
-
"commander": "
|
|
45
|
-
"
|
|
46
|
-
"
|
|
47
|
-
"
|
|
48
|
-
"ora": "^9.4.1",
|
|
46
|
+
"commander": "15.0.0",
|
|
47
|
+
"minimatch": "10.2.6",
|
|
48
|
+
"node-emoji": "2.2.0",
|
|
49
|
+
"ora": "9.4.1",
|
|
49
50
|
"tsconfig-paths": "4.2.0",
|
|
50
|
-
"
|
|
51
|
-
"typescript": "^7.0.2",
|
|
52
|
-
"webpack": "^5.109.2",
|
|
53
|
-
"webpack-node-externals": "3.0.0"
|
|
51
|
+
"typescript": "^7.0.2"
|
|
54
52
|
},
|
|
55
53
|
"devDependencies": {
|
|
56
|
-
"@commitlint/cli": "
|
|
57
|
-
"@commitlint/config-angular": "
|
|
54
|
+
"@commitlint/cli": "21.2.2",
|
|
55
|
+
"@commitlint/config-angular": "21.2.2",
|
|
56
|
+
"@rspack/core": "^2.0.0",
|
|
58
57
|
"@swc/cli": "0.8.1",
|
|
59
|
-
"@swc/core": "1.
|
|
60
|
-
"@types/
|
|
61
|
-
"@types/jest": "29.5.14",
|
|
62
|
-
"@types/node": "24.12.2",
|
|
63
|
-
"@types/node-emoji": "1.8.2",
|
|
58
|
+
"@swc/core": "1.16.1",
|
|
59
|
+
"@types/node": "25.9.5",
|
|
64
60
|
"@types/webpack-node-externals": "3.0.4",
|
|
65
|
-
"@typescript-eslint/eslint-plugin": "8.60.1",
|
|
66
|
-
"@typescript-eslint/parser": "8.60.1",
|
|
67
61
|
"delete-empty": "3.0.0",
|
|
68
|
-
"
|
|
69
|
-
"eslint-config-prettier": "10.1.8",
|
|
62
|
+
"fork-ts-checker-webpack-plugin": "9.1.0",
|
|
70
63
|
"gulp": "5.0.1",
|
|
71
64
|
"gulp-clean": "0.4.0",
|
|
72
65
|
"husky": "9.1.7",
|
|
73
|
-
"
|
|
74
|
-
"
|
|
75
|
-
"prettier": "3.
|
|
76
|
-
"release-it": "
|
|
77
|
-
"ts-
|
|
78
|
-
"
|
|
79
|
-
"
|
|
66
|
+
"lint-staged": "17.3.0",
|
|
67
|
+
"oxlint": "1.80.0",
|
|
68
|
+
"prettier": "3.9.6",
|
|
69
|
+
"release-it": "21.0.2",
|
|
70
|
+
"ts-loader": "9.6.2",
|
|
71
|
+
"tsconfig-paths-webpack-plugin": "4.2.0",
|
|
72
|
+
"vitest": "4.1.11",
|
|
73
|
+
"webpack": "5.109.2",
|
|
74
|
+
"webpack-node-externals": "3.0.0"
|
|
80
75
|
},
|
|
81
76
|
"lint-staged": {
|
|
82
77
|
"**/*.{ts,json}": []
|
|
83
78
|
},
|
|
84
79
|
"peerDependencies": {
|
|
85
|
-
"@
|
|
86
|
-
"@swc/
|
|
80
|
+
"@rspack/core": "^1.7.7 || ^2.1.10",
|
|
81
|
+
"@swc/cli": "^0.8.0",
|
|
82
|
+
"@swc/core": "^1.15.18",
|
|
83
|
+
"fork-ts-checker-webpack-plugin": "^9.1.0",
|
|
84
|
+
"ts-loader": "^9.5.4",
|
|
85
|
+
"tsconfig-paths-webpack-plugin": "^4.2.0",
|
|
86
|
+
"webpack": "^5.105.4",
|
|
87
|
+
"webpack-node-externals": "^3.0.0"
|
|
87
88
|
},
|
|
88
89
|
"peerDependenciesMeta": {
|
|
90
|
+
"@rspack/core": {
|
|
91
|
+
"optional": true
|
|
92
|
+
},
|
|
89
93
|
"@swc/cli": {
|
|
90
94
|
"optional": true
|
|
91
95
|
},
|
|
92
96
|
"@swc/core": {
|
|
93
97
|
"optional": true
|
|
98
|
+
},
|
|
99
|
+
"fork-ts-checker-webpack-plugin": {
|
|
100
|
+
"optional": true
|
|
101
|
+
},
|
|
102
|
+
"ts-loader": {
|
|
103
|
+
"optional": true
|
|
104
|
+
},
|
|
105
|
+
"tsconfig-paths-webpack-plugin": {
|
|
106
|
+
"optional": true
|
|
107
|
+
},
|
|
108
|
+
"webpack": {
|
|
109
|
+
"optional": true
|
|
110
|
+
},
|
|
111
|
+
"webpack-node-externals": {
|
|
112
|
+
"optional": true
|
|
94
113
|
}
|
|
95
114
|
},
|
|
96
115
|
"keywords": [
|
|
@@ -104,58 +123,26 @@
|
|
|
104
123
|
"depup": {
|
|
105
124
|
"changes": {
|
|
106
125
|
"@angular-devkit/core": {
|
|
107
|
-
"from": "
|
|
126
|
+
"from": "22.1.5",
|
|
108
127
|
"to": "^22.1.6"
|
|
109
128
|
},
|
|
110
129
|
"@angular-devkit/schematics": {
|
|
111
|
-
"from": "
|
|
130
|
+
"from": "22.1.5",
|
|
112
131
|
"to": "^22.1.6"
|
|
113
132
|
},
|
|
114
133
|
"@angular-devkit/schematics-cli": {
|
|
115
|
-
"from": "
|
|
134
|
+
"from": "22.1.5",
|
|
116
135
|
"to": "^22.1.6"
|
|
117
136
|
},
|
|
118
|
-
"@inquirer/prompts": {
|
|
119
|
-
"from": "7.10.1",
|
|
120
|
-
"to": "^8.7.0"
|
|
121
|
-
},
|
|
122
|
-
"@nestjs/schematics": {
|
|
123
|
-
"from": "^11.0.1",
|
|
124
|
-
"to": "^11.1.0"
|
|
125
|
-
},
|
|
126
|
-
"ansis": {
|
|
127
|
-
"from": "4.2.0",
|
|
128
|
-
"to": "^4.3.1"
|
|
129
|
-
},
|
|
130
|
-
"chokidar": {
|
|
131
|
-
"from": "4.0.3",
|
|
132
|
-
"to": "^5.0.0"
|
|
133
|
-
},
|
|
134
|
-
"commander": {
|
|
135
|
-
"from": "4.1.1",
|
|
136
|
-
"to": "^15.0.0"
|
|
137
|
-
},
|
|
138
|
-
"node-emoji": {
|
|
139
|
-
"from": "1.11.0",
|
|
140
|
-
"to": "^2.2.0"
|
|
141
|
-
},
|
|
142
|
-
"ora": {
|
|
143
|
-
"from": "5.4.1",
|
|
144
|
-
"to": "^9.4.1"
|
|
145
|
-
},
|
|
146
137
|
"typescript": {
|
|
147
|
-
"from": "
|
|
138
|
+
"from": "~6.0.2",
|
|
148
139
|
"to": "^7.0.2"
|
|
149
|
-
},
|
|
150
|
-
"webpack": {
|
|
151
|
-
"from": "5.106.2",
|
|
152
|
-
"to": "^5.109.2"
|
|
153
140
|
}
|
|
154
141
|
},
|
|
155
|
-
"depsUpdated":
|
|
142
|
+
"depsUpdated": 4,
|
|
156
143
|
"originalPackage": "@nestjs/cli",
|
|
157
|
-
"originalVersion": "
|
|
158
|
-
"processedAt": "2026-08-
|
|
144
|
+
"originalVersion": "12.0.0",
|
|
145
|
+
"processedAt": "2026-08-27T11:23:55.035Z",
|
|
159
146
|
"smokeTest": "failed"
|
|
160
147
|
}
|
|
161
148
|
}
|