@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.
Files changed (220) hide show
  1. package/README.md +6 -14
  2. package/actions/abstract.action.d.ts +1 -2
  3. package/actions/abstract.action.js +1 -5
  4. package/actions/add.action.d.ts +3 -4
  5. package/actions/add.action.js +44 -53
  6. package/actions/build.action.d.ts +18 -11
  7. package/actions/build.action.js +172 -79
  8. package/actions/deploy.action.d.ts +6 -0
  9. package/actions/deploy.action.js +51 -0
  10. package/actions/generate.action.d.ts +3 -3
  11. package/actions/generate.action.js +61 -59
  12. package/actions/index.d.ts +9 -7
  13. package/actions/index.js +9 -23
  14. package/actions/info.action.d.ts +18 -28
  15. package/actions/info.action.js +80 -60
  16. package/actions/new.action.d.ts +3 -3
  17. package/actions/new.action.js +108 -104
  18. package/actions/start.action.d.ts +4 -7
  19. package/actions/start.action.js +40 -47
  20. package/actions/upgrade.action.d.ts +6 -0
  21. package/actions/upgrade.action.js +53 -0
  22. package/bin/nest.js +11 -10
  23. package/changes.json +6 -38
  24. package/commands/abstract.command.d.ts +3 -3
  25. package/commands/abstract.command.js +2 -5
  26. package/commands/add.command.d.ts +3 -3
  27. package/commands/add.command.js +17 -20
  28. package/commands/build.command.d.ts +3 -3
  29. package/commands/build.command.js +52 -56
  30. package/commands/command.input.js +1 -2
  31. package/commands/command.loader.d.ts +2 -2
  32. package/commands/command.loader.js +29 -22
  33. package/commands/context/add.context.d.ts +7 -0
  34. package/commands/context/add.context.js +1 -0
  35. package/commands/context/build.context.d.ts +17 -0
  36. package/commands/context/build.context.js +1 -0
  37. package/commands/context/deploy.context.d.ts +7 -0
  38. package/commands/context/deploy.context.js +1 -0
  39. package/commands/context/generate.context.d.ts +18 -0
  40. package/commands/context/generate.context.js +1 -0
  41. package/commands/context/index.d.ts +7 -0
  42. package/commands/context/index.js +7 -0
  43. package/commands/context/new.context.d.ts +19 -0
  44. package/commands/context/new.context.js +1 -0
  45. package/commands/context/start.context.d.ts +22 -0
  46. package/commands/context/start.context.js +1 -0
  47. package/commands/context/upgrade.context.d.ts +11 -0
  48. package/commands/context/upgrade.context.js +1 -0
  49. package/commands/deploy.command.d.ts +5 -0
  50. package/commands/deploy.command.js +22 -0
  51. package/commands/generate.command.d.ts +3 -3
  52. package/commands/generate.command.js +35 -66
  53. package/commands/index.d.ts +3 -2
  54. package/commands/index.js +3 -18
  55. package/commands/info.command.d.ts +3 -3
  56. package/commands/info.command.js +4 -8
  57. package/commands/new.command.d.ts +3 -3
  58. package/commands/new.command.js +34 -36
  59. package/commands/start.command.d.ts +3 -3
  60. package/commands/start.command.js +48 -73
  61. package/commands/upgrade.command.d.ts +5 -0
  62. package/commands/upgrade.command.js +32 -0
  63. package/lib/compiler/assets-manager.d.ts +20 -8
  64. package/lib/compiler/assets-manager.js +199 -63
  65. package/lib/compiler/base-compiler.d.ts +5 -5
  66. package/lib/compiler/base-compiler.js +10 -13
  67. package/lib/compiler/compiler.d.ts +6 -6
  68. package/lib/compiler/compiler.js +7 -9
  69. package/lib/compiler/defaults/rspack-defaults.d.ts +3 -0
  70. package/lib/compiler/defaults/rspack-defaults.js +179 -0
  71. package/lib/compiler/defaults/swc-defaults.d.ts +5 -2
  72. package/lib/compiler/defaults/swc-defaults.js +22 -6
  73. package/lib/compiler/defaults/webpack-defaults.d.ts +2 -2
  74. package/lib/compiler/defaults/webpack-defaults.js +59 -19
  75. package/lib/compiler/helpers/append-extension.js +3 -6
  76. package/lib/compiler/helpers/copy-path-resolve.js +2 -5
  77. package/lib/compiler/helpers/delete-out-dir.d.ts +1 -1
  78. package/lib/compiler/helpers/delete-out-dir.js +45 -10
  79. package/lib/compiler/helpers/get-builder.d.ts +9 -7
  80. package/lib/compiler/helpers/get-builder.js +3 -6
  81. package/lib/compiler/helpers/get-effective-root-dir.d.ts +16 -0
  82. package/lib/compiler/helpers/get-effective-root-dir.js +56 -0
  83. package/lib/compiler/helpers/get-rspack-config-path.d.ts +10 -0
  84. package/lib/compiler/helpers/get-rspack-config-path.js +19 -0
  85. package/lib/compiler/helpers/get-tsc-config.path.d.ts +2 -3
  86. package/lib/compiler/helpers/get-tsc-config.path.js +6 -9
  87. package/lib/compiler/helpers/get-value-or-default.d.ts +2 -3
  88. package/lib/compiler/helpers/get-value-or-default.js +3 -8
  89. package/lib/compiler/helpers/get-webpack-config-path.d.ts +2 -3
  90. package/lib/compiler/helpers/get-webpack-config-path.js +4 -7
  91. package/lib/compiler/helpers/glob.d.ts +19 -0
  92. package/lib/compiler/helpers/glob.js +185 -0
  93. package/lib/compiler/helpers/manual-restart.js +4 -8
  94. package/lib/compiler/helpers/path-confinement.d.ts +33 -0
  95. package/lib/compiler/helpers/path-confinement.js +63 -0
  96. package/lib/compiler/helpers/tsconfig-provider.d.ts +7 -6
  97. package/lib/compiler/helpers/tsconfig-provider.js +32 -13
  98. package/lib/compiler/hooks/tsconfig-paths.hook.js +13 -13
  99. package/lib/compiler/interfaces/readonly-visitor.interface.js +1 -2
  100. package/lib/compiler/plugins/plugin-metadata-generator.d.ts +37 -1
  101. package/lib/compiler/plugins/plugin-metadata-generator.js +113 -13
  102. package/lib/compiler/plugins/plugin-metadata-printer.d.ts +1 -1
  103. package/lib/compiler/plugins/plugin-metadata-printer.js +5 -9
  104. package/lib/compiler/plugins/plugins-loader.d.ts +2 -2
  105. package/lib/compiler/plugins/plugins-loader.js +12 -12
  106. package/lib/compiler/rspack-compiler.d.ts +21 -0
  107. package/lib/compiler/rspack-compiler.js +111 -0
  108. package/lib/compiler/swc/constants.d.ts +0 -1
  109. package/lib/compiler/swc/constants.js +9 -13
  110. package/lib/compiler/swc/forked-type-checker.js +13 -18
  111. package/lib/compiler/swc/swc-compiler.d.ts +13 -6
  112. package/lib/compiler/swc/swc-compiler.js +116 -70
  113. package/lib/compiler/swc/type-checker-host.js +31 -24
  114. package/lib/compiler/typescript-loader.js +7 -9
  115. package/lib/compiler/watch-compiler.d.ts +5 -5
  116. package/lib/compiler/watch-compiler.js +13 -15
  117. package/lib/compiler/watchers/recursive-directory-watcher.d.ts +37 -0
  118. package/lib/compiler/watchers/recursive-directory-watcher.js +334 -0
  119. package/lib/compiler/webpack-compiler.d.ts +6 -7
  120. package/lib/compiler/webpack-compiler.js +46 -23
  121. package/lib/configuration/configuration.d.ts +16 -3
  122. package/lib/configuration/configuration.js +1 -2
  123. package/lib/configuration/configuration.loader.d.ts +1 -1
  124. package/lib/configuration/configuration.loader.js +1 -2
  125. package/lib/configuration/defaults.d.ts +2 -1
  126. package/lib/configuration/defaults.js +8 -10
  127. package/lib/configuration/index.d.ts +3 -3
  128. package/lib/configuration/index.js +3 -19
  129. package/lib/configuration/nest-configuration.loader.d.ts +3 -3
  130. package/lib/configuration/nest-configuration.loader.js +28 -29
  131. package/lib/package-managers/abstract.package-manager.d.ts +4 -4
  132. package/lib/package-managers/abstract.package-manager.js +21 -32
  133. package/lib/package-managers/bun.package-manager.d.ts +7 -0
  134. package/lib/package-managers/bun.package-manager.js +22 -0
  135. package/lib/package-managers/index.d.ts +9 -8
  136. package/lib/package-managers/index.js +9 -24
  137. package/lib/package-managers/npm.package-manager.d.ts +2 -2
  138. package/lib/package-managers/npm.package-manager.js +6 -10
  139. package/lib/package-managers/package-manager-commands.js +1 -2
  140. package/lib/package-managers/package-manager.d.ts +2 -1
  141. package/lib/package-managers/package-manager.factory.d.ts +2 -2
  142. package/lib/package-managers/package-manager.factory.js +23 -20
  143. package/lib/package-managers/package-manager.js +3 -5
  144. package/lib/package-managers/pnpm.package-manager.d.ts +2 -2
  145. package/lib/package-managers/pnpm.package-manager.js +6 -10
  146. package/lib/package-managers/project.dependency.js +1 -2
  147. package/lib/package-managers/yarn.package-manager.d.ts +2 -2
  148. package/lib/package-managers/yarn.package-manager.js +6 -10
  149. package/lib/questions/questions.d.ts +5 -1
  150. package/lib/questions/questions.js +2 -7
  151. package/lib/readers/file-system.reader.d.ts +1 -1
  152. package/lib/readers/file-system.reader.js +6 -9
  153. package/lib/readers/index.d.ts +2 -2
  154. package/lib/readers/index.js +2 -18
  155. package/lib/readers/reader.js +3 -5
  156. package/lib/runners/abstract.runner.js +40 -21
  157. package/lib/runners/bun.runner.d.ts +4 -0
  158. package/lib/runners/bun.runner.js +6 -0
  159. package/lib/runners/git.runner.d.ts +1 -1
  160. package/lib/runners/git.runner.js +2 -6
  161. package/lib/runners/index.d.ts +3 -3
  162. package/lib/runners/index.js +3 -19
  163. package/lib/runners/mau.runner.d.ts +8 -0
  164. package/lib/runners/mau.runner.js +10 -0
  165. package/lib/runners/npm.runner.d.ts +1 -1
  166. package/lib/runners/npm.runner.js +2 -6
  167. package/lib/runners/pnpm.runner.d.ts +1 -1
  168. package/lib/runners/pnpm.runner.js +2 -6
  169. package/lib/runners/runner.d.ts +2 -1
  170. package/lib/runners/runner.factory.d.ts +7 -6
  171. package/lib/runners/runner.factory.js +18 -20
  172. package/lib/runners/runner.js +3 -5
  173. package/lib/runners/schematic.runner.d.ts +1 -1
  174. package/lib/runners/schematic.runner.js +5 -7
  175. package/lib/runners/yarn.runner.d.ts +1 -1
  176. package/lib/runners/yarn.runner.js +2 -6
  177. package/lib/schematics/abstract.collection.d.ts +3 -3
  178. package/lib/schematics/abstract.collection.js +3 -5
  179. package/lib/schematics/collection.factory.d.ts +2 -2
  180. package/lib/schematics/collection.factory.js +9 -13
  181. package/lib/schematics/collection.js +2 -5
  182. package/lib/schematics/custom.collection.d.ts +2 -2
  183. package/lib/schematics/custom.collection.js +4 -8
  184. package/lib/schematics/index.d.ts +4 -4
  185. package/lib/schematics/index.js +4 -20
  186. package/lib/schematics/nest.collection.d.ts +3 -3
  187. package/lib/schematics/nest.collection.js +113 -109
  188. package/lib/schematics/schematic.option.js +10 -9
  189. package/lib/ui/banner.js +1 -4
  190. package/lib/ui/emojis.d.ts +17 -17
  191. package/lib/ui/emojis.js +19 -22
  192. package/lib/ui/errors.js +1 -4
  193. package/lib/ui/index.d.ts +5 -5
  194. package/lib/ui/index.js +5 -21
  195. package/lib/ui/messages.d.ts +8 -0
  196. package/lib/ui/messages.js +23 -18
  197. package/lib/ui/prefixes.js +3 -6
  198. package/lib/utils/extra-args-warning.js +3 -6
  199. package/lib/utils/formatting.js +1 -4
  200. package/lib/utils/get-default-tsconfig-path.js +4 -7
  201. package/lib/utils/gracefully-exit-on-prompt-error.js +1 -4
  202. package/lib/utils/is-esm-project.d.ts +5 -0
  203. package/lib/utils/is-esm-project.js +16 -0
  204. package/lib/utils/is-interactive.d.ts +8 -0
  205. package/lib/utils/is-interactive.js +10 -0
  206. package/lib/utils/is-module-available.js +3 -4
  207. package/lib/utils/load-configuration.d.ts +1 -1
  208. package/lib/utils/load-configuration.js +4 -7
  209. package/lib/utils/local-binaries.d.ts +2 -2
  210. package/lib/utils/local-binaries.js +8 -11
  211. package/lib/utils/mau.d.ts +14 -0
  212. package/lib/utils/mau.js +46 -0
  213. package/lib/utils/os-info.utils.js +1 -4
  214. package/lib/utils/project-utils.d.ts +1 -3
  215. package/lib/utils/project-utils.js +16 -28
  216. package/lib/utils/remaining-flags.d.ts +2 -2
  217. package/lib/utils/remaining-flags.js +13 -8
  218. package/lib/utils/tree-kill.js +7 -10
  219. package/lib/utils/type-assertions.js +1 -4
  220. 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
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.localBinExists = localBinExists;
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 (0, fs_1.existsSync)((0, path_1.join)(...localBinPathSegments));
5
+ export function localBinExists() {
6
+ return existsSync(join(...localBinPathSegments));
10
7
  }
11
- function loadLocalBinCommandLoader() {
12
- // eslint-disable-next-line @typescript-eslint/no-var-requires
13
- const commandsFile = require(path_1.posix.join(...localBinPathSegments, 'commands'));
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;
@@ -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
- "use strict";
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 { Input } from '../../commands';
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
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.shouldAskForProject = shouldAskForProject;
4
- exports.shouldGenerateSpec = shouldGenerateSpec;
5
- exports.shouldGenerateFlat = shouldGenerateFlat;
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 = (0, get_value_or_default_1.getValueOrDefault)(configuration, 'generateOptions.spec', appName || '');
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 = (0, get_value_or_default_1.getValueOrDefault)(configuration, 'generateOptions.spec', '');
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 = (0, get_value_or_default_1.getValueOrDefault)(configuration, 'generateOptions.flat', appName || '');
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 = (0, get_value_or_default_1.getValueOrDefault)(configuration, 'generateOptions.specFileSuffix', appName || '', undefined, undefined, 'spec');
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 = (0, questions_1.generateSelect)('appName')(promptQuestion)(projects);
71
- return (0, prompts_1.select)(projectNameSelect).catch(gracefully_exit_on_prompt_error_1.gracefullyExitOnPromptError);
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 { CommanderStatic } from 'commander';
2
- export declare function getRemainingFlags(cli: CommanderStatic): any[];
1
+ import { Command } from 'commander';
2
+ export declare function getRemainingFlags(cli: Command): any[];
@@ -1,10 +1,11 @@
1
- "use strict";
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(Math.max(rawArgs.findIndex((item) => item.startsWith('--')), 0))
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[previousKey] === item) {
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
- return flag.split('-').reduce((str, word) => {
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
  }
@@ -1,21 +1,18 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
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
- (0, child_process_1.execSync)('taskkill /pid ' + pid + ' /T /F');
4
+ execSync('taskkill /pid ' + pid + ' /T /F');
8
5
  return;
9
6
  }
10
- const childs = getAllChilds(pid);
11
- childs.forEach(function (pid) {
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 = (0, child_process_1.spawnSync)('ps', ['-A', '-o', 'pid,ppid'], {
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 getAllChilds(pid) {
38
+ function getAllChildren(pid) {
42
39
  const allpid = getAllPid();
43
40
  const ppidHash = {};
44
41
  const result = [];
@@ -1,7 +1,4 @@
1
- "use strict";
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": "11.0.24-depup.8",
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": "gulp clean:bundle",
14
+ "clean": "node tools/clean.js",
14
15
  "format": "prettier --write \"**/*.ts\"",
15
- "lint": "eslint '{lib,commands,actions}/**/*.ts' --fix",
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": "jest --config test/jest-config.json",
22
- "test:dev": "npm run clean && jest --config test/jest-config.json --watchAll",
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": "^8.7.0",
40
- "@nestjs/schematics": "^11.1.0",
41
- "ansis": "^4.3.1",
42
- "chokidar": "^5.0.0",
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": "^15.0.0",
45
- "fork-ts-checker-webpack-plugin": "9.1.0",
46
- "glob": "13.0.6",
47
- "node-emoji": "^2.2.0",
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
- "tsconfig-paths-webpack-plugin": "4.2.0",
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": "20.5.3",
57
- "@commitlint/config-angular": "20.5.3",
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.15.40",
60
- "@types/inquirer": "9.0.9",
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
- "eslint": "10.2.1",
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
- "jest": "29.7.0",
74
- "lint-staged": "16.4.0",
75
- "prettier": "3.8.3",
76
- "release-it": "20.0.1",
77
- "ts-jest": "29.4.9",
78
- "ts-loader": "9.5.7",
79
- "ts-node": "10.9.2"
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
- "@swc/cli": "^0.1.62 || ^0.3.0 || ^0.4.0 || ^0.5.0 || ^0.6.0 || ^0.7.0 || ^0.8.0",
86
- "@swc/core": "^1.3.62"
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": "19.2.27",
126
+ "from": "22.1.5",
108
127
  "to": "^22.1.6"
109
128
  },
110
129
  "@angular-devkit/schematics": {
111
- "from": "19.2.27",
130
+ "from": "22.1.5",
112
131
  "to": "^22.1.6"
113
132
  },
114
133
  "@angular-devkit/schematics-cli": {
115
- "from": "19.2.27",
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": "5.9.3",
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": 12,
142
+ "depsUpdated": 4,
156
143
  "originalPackage": "@nestjs/cli",
157
- "originalVersion": "11.0.24",
158
- "processedAt": "2026-08-27T01:38:09.524Z",
144
+ "originalVersion": "12.0.0",
145
+ "processedAt": "2026-08-27T11:23:55.035Z",
159
146
  "smokeTest": "failed"
160
147
  }
161
148
  }