@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,18 +1,15 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.AbstractRunner = void 0;
4
- const ansis_1 = require("ansis");
5
- const child_process_1 = require("child_process");
6
- const os_1 = require("os");
7
- const ui_1 = require("../ui");
8
- class AbstractRunner {
1
+ import { red } from 'ansis';
2
+ import { spawn } from 'child_process';
3
+ import { MESSAGES } from '../ui/index.js';
4
+ export class AbstractRunner {
5
+ binary;
6
+ args;
9
7
  constructor(binary, args = []) {
10
8
  this.binary = binary;
11
9
  this.args = args;
12
10
  }
13
11
  async run(command, collect = false, cwd = process.cwd()) {
14
12
  const args = [command];
15
- const isWindows = (0, os_1.platform)() === 'win32';
16
13
  const options = {
17
14
  cwd,
18
15
  stdio: collect ? 'pipe' : 'inherit',
@@ -20,19 +17,42 @@ class AbstractRunner {
20
17
  };
21
18
  return new Promise((resolve, reject) => {
22
19
  const fullCommand = [this.binary, ...this.args, ...args].join(' ');
23
- const child = (0, child_process_1.spawn)(fullCommand, options);
20
+ const child = spawn(fullCommand, options);
24
21
  if (collect) {
25
- child.stdout.on('data', (data) => resolve(data.toString().replace(/\r\n|\n/, '')));
22
+ const chunks = [];
23
+ const errorChunks = [];
24
+ child.stdout.on('data', (data) => chunks.push(data));
25
+ // stderr is piped in collect mode and must be consumed too: an unread
26
+ // pipe blocks the child once the OS buffer fills (e.g. npm printing
27
+ // peer-dependency warnings), and `close` would then never fire.
28
+ child.stderr.on('data', (data) => errorChunks.push(data));
29
+ child.on('close', (code) => {
30
+ if (code === 0) {
31
+ resolve(Buffer.concat(chunks)
32
+ .toString()
33
+ .replace(/\r\n|\n/g, ''));
34
+ }
35
+ else {
36
+ console.error(red(MESSAGES.RUNNER_EXECUTION_ERROR(fullCommand)));
37
+ const errorOutput = Buffer.concat(errorChunks).toString().trim();
38
+ if (errorOutput) {
39
+ console.error(red(errorOutput));
40
+ }
41
+ reject();
42
+ }
43
+ });
44
+ }
45
+ else {
46
+ child.on('close', (code) => {
47
+ if (code === 0) {
48
+ resolve(null);
49
+ }
50
+ else {
51
+ console.error(red(MESSAGES.RUNNER_EXECUTION_ERROR(fullCommand)));
52
+ reject();
53
+ }
54
+ });
26
55
  }
27
- child.on('close', (code) => {
28
- if (code === 0) {
29
- resolve(null);
30
- }
31
- else {
32
- console.error((0, ansis_1.red)(ui_1.MESSAGES.RUNNER_EXECUTION_ERROR(fullCommand)));
33
- reject();
34
- }
35
- });
36
56
  });
37
57
  }
38
58
  /**
@@ -44,4 +64,3 @@ class AbstractRunner {
44
64
  return `${this.binary} ${commandArgs.join(' ')}`;
45
65
  }
46
66
  }
47
- exports.AbstractRunner = AbstractRunner;
@@ -0,0 +1,4 @@
1
+ import { AbstractRunner } from './abstract.runner.js';
2
+ export declare class BunRunner extends AbstractRunner {
3
+ constructor();
4
+ }
@@ -0,0 +1,6 @@
1
+ import { AbstractRunner } from './abstract.runner.js';
2
+ export class BunRunner extends AbstractRunner {
3
+ constructor() {
4
+ super('bun');
5
+ }
6
+ }
@@ -1,4 +1,4 @@
1
- import { AbstractRunner } from './abstract.runner';
1
+ import { AbstractRunner } from './abstract.runner.js';
2
2
  export declare class GitRunner extends AbstractRunner {
3
3
  constructor();
4
4
  }
@@ -1,10 +1,6 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.GitRunner = void 0;
4
- const abstract_runner_1 = require("./abstract.runner");
5
- class GitRunner extends abstract_runner_1.AbstractRunner {
1
+ import { AbstractRunner } from './abstract.runner.js';
2
+ export class GitRunner extends AbstractRunner {
6
3
  constructor() {
7
4
  super('git');
8
5
  }
9
6
  }
10
- exports.GitRunner = GitRunner;
@@ -1,3 +1,3 @@
1
- export * from './runner';
2
- export * from './runner.factory';
3
- export * from './abstract.runner';
1
+ export * from './runner.js';
2
+ export * from './runner.factory.js';
3
+ export * from './abstract.runner.js';
@@ -1,19 +1,3 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./runner"), exports);
18
- __exportStar(require("./runner.factory"), exports);
19
- __exportStar(require("./abstract.runner"), exports);
1
+ export * from './runner.js';
2
+ export * from './runner.factory.js';
3
+ export * from './abstract.runner.js';
@@ -0,0 +1,8 @@
1
+ import { AbstractRunner } from './abstract.runner.js';
2
+ /**
3
+ * Runs the `mau` executable from `@nestjs/mau` through the current Node
4
+ * binary, mirroring how the schematics CLI is invoked.
5
+ */
6
+ export declare class MauRunner extends AbstractRunner {
7
+ constructor(binaryPath: string);
8
+ }
@@ -0,0 +1,10 @@
1
+ import { AbstractRunner } from './abstract.runner.js';
2
+ /**
3
+ * Runs the `mau` executable from `@nestjs/mau` through the current Node
4
+ * binary, mirroring how the schematics CLI is invoked.
5
+ */
6
+ export class MauRunner extends AbstractRunner {
7
+ constructor(binaryPath) {
8
+ super('node', [`"${binaryPath}"`]);
9
+ }
10
+ }
@@ -1,4 +1,4 @@
1
- import { AbstractRunner } from './abstract.runner';
1
+ import { AbstractRunner } from './abstract.runner.js';
2
2
  export declare class NpmRunner extends AbstractRunner {
3
3
  constructor();
4
4
  }
@@ -1,10 +1,6 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.NpmRunner = void 0;
4
- const abstract_runner_1 = require("./abstract.runner");
5
- class NpmRunner extends abstract_runner_1.AbstractRunner {
1
+ import { AbstractRunner } from './abstract.runner.js';
2
+ export class NpmRunner extends AbstractRunner {
6
3
  constructor() {
7
4
  super('npm');
8
5
  }
9
6
  }
10
- exports.NpmRunner = NpmRunner;
@@ -1,4 +1,4 @@
1
- import { AbstractRunner } from './abstract.runner';
1
+ import { AbstractRunner } from './abstract.runner.js';
2
2
  export declare class PnpmRunner extends AbstractRunner {
3
3
  constructor();
4
4
  }
@@ -1,10 +1,6 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.PnpmRunner = void 0;
4
- const abstract_runner_1 = require("./abstract.runner");
5
- class PnpmRunner extends abstract_runner_1.AbstractRunner {
1
+ import { AbstractRunner } from './abstract.runner.js';
2
+ export class PnpmRunner extends AbstractRunner {
6
3
  constructor() {
7
4
  super('pnpm');
8
5
  }
9
6
  }
10
- exports.PnpmRunner = PnpmRunner;
@@ -2,5 +2,6 @@ export declare enum Runner {
2
2
  SCHEMATIC = 0,
3
3
  NPM = 1,
4
4
  YARN = 2,
5
- PNPM = 3
5
+ PNPM = 3,
6
+ BUN = 4
6
7
  }
@@ -1,8 +1,9 @@
1
- import { NpmRunner } from './npm.runner';
2
- import { Runner } from './runner';
3
- import { SchematicRunner } from './schematic.runner';
4
- import { YarnRunner } from './yarn.runner';
5
- import { PnpmRunner } from './pnpm.runner';
1
+ import { NpmRunner } from './npm.runner.js';
2
+ import { PnpmRunner } from './pnpm.runner.js';
3
+ import { Runner } from './runner.js';
4
+ import { SchematicRunner } from './schematic.runner.js';
5
+ import { YarnRunner } from './yarn.runner.js';
6
+ import { BunRunner } from './bun.runner.js';
6
7
  export declare class RunnerFactory {
7
- static create(runner: Runner): NpmRunner | SchematicRunner | YarnRunner | PnpmRunner | undefined;
8
+ static create(runner: Runner): NpmRunner | PnpmRunner | SchematicRunner | YarnRunner | BunRunner;
8
9
  }
@@ -1,26 +1,24 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.RunnerFactory = void 0;
4
- const ansis_1 = require("ansis");
5
- const npm_runner_1 = require("./npm.runner");
6
- const runner_1 = require("./runner");
7
- const schematic_runner_1 = require("./schematic.runner");
8
- const yarn_runner_1 = require("./yarn.runner");
9
- const pnpm_runner_1 = require("./pnpm.runner");
10
- class RunnerFactory {
1
+ import { NpmRunner } from './npm.runner.js';
2
+ import { PnpmRunner } from './pnpm.runner.js';
3
+ import { Runner } from './runner.js';
4
+ import { SchematicRunner } from './schematic.runner.js';
5
+ import { YarnRunner } from './yarn.runner.js';
6
+ import { BunRunner } from './bun.runner.js';
7
+ export class RunnerFactory {
11
8
  static create(runner) {
12
9
  switch (runner) {
13
- case runner_1.Runner.SCHEMATIC:
14
- return new schematic_runner_1.SchematicRunner();
15
- case runner_1.Runner.NPM:
16
- return new npm_runner_1.NpmRunner();
17
- case runner_1.Runner.YARN:
18
- return new yarn_runner_1.YarnRunner();
19
- case runner_1.Runner.PNPM:
20
- return new pnpm_runner_1.PnpmRunner();
10
+ case Runner.SCHEMATIC:
11
+ return new SchematicRunner();
12
+ case Runner.NPM:
13
+ return new NpmRunner();
14
+ case Runner.YARN:
15
+ return new YarnRunner();
16
+ case Runner.PNPM:
17
+ return new PnpmRunner();
18
+ case Runner.BUN:
19
+ return new BunRunner();
21
20
  default:
22
- console.info((0, ansis_1.yellow) `[WARN] Unsupported runner: ${runner}`);
21
+ throw new Error(`Unsupported runner: ${runner}`);
23
22
  }
24
23
  }
25
24
  }
26
- exports.RunnerFactory = RunnerFactory;
@@ -1,10 +1,8 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Runner = void 0;
4
- var Runner;
1
+ export var Runner;
5
2
  (function (Runner) {
6
3
  Runner[Runner["SCHEMATIC"] = 0] = "SCHEMATIC";
7
4
  Runner[Runner["NPM"] = 1] = "NPM";
8
5
  Runner[Runner["YARN"] = 2] = "YARN";
9
6
  Runner[Runner["PNPM"] = 3] = "PNPM";
10
- })(Runner || (exports.Runner = Runner = {}));
7
+ Runner[Runner["BUN"] = 4] = "BUN";
8
+ })(Runner || (Runner = {}));
@@ -1,4 +1,4 @@
1
- import { AbstractRunner } from './abstract.runner';
1
+ import { AbstractRunner } from './abstract.runner.js';
2
2
  export declare class SchematicRunner extends AbstractRunner {
3
3
  constructor();
4
4
  static getModulePaths(): string[];
@@ -1,13 +1,12 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SchematicRunner = void 0;
4
- const abstract_runner_1 = require("./abstract.runner");
5
- class SchematicRunner extends abstract_runner_1.AbstractRunner {
1
+ import { createRequire } from 'module';
2
+ import { AbstractRunner } from './abstract.runner.js';
3
+ const require = createRequire(import.meta.url);
4
+ export class SchematicRunner extends AbstractRunner {
6
5
  constructor() {
7
6
  super(`node`, [`"${SchematicRunner.findClosestSchematicsBinary()}"`]);
8
7
  }
9
8
  static getModulePaths() {
10
- return module.paths;
9
+ return require.resolve.paths('@angular-devkit/schematics-cli') ?? [];
11
10
  }
12
11
  static findClosestSchematicsBinary() {
13
12
  try {
@@ -18,4 +17,3 @@ class SchematicRunner extends abstract_runner_1.AbstractRunner {
18
17
  }
19
18
  }
20
19
  }
21
- exports.SchematicRunner = SchematicRunner;
@@ -1,4 +1,4 @@
1
- import { AbstractRunner } from './abstract.runner';
1
+ import { AbstractRunner } from './abstract.runner.js';
2
2
  export declare class YarnRunner extends AbstractRunner {
3
3
  constructor();
4
4
  }
@@ -1,10 +1,6 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.YarnRunner = void 0;
4
- const abstract_runner_1 = require("./abstract.runner");
5
- class YarnRunner extends abstract_runner_1.AbstractRunner {
1
+ import { AbstractRunner } from './abstract.runner.js';
2
+ export class YarnRunner extends AbstractRunner {
6
3
  constructor() {
7
4
  super('yarn');
8
5
  }
9
6
  }
10
- exports.YarnRunner = YarnRunner;
@@ -1,6 +1,6 @@
1
- import { AbstractRunner } from '../runners';
2
- import { Schematic } from './nest.collection';
3
- import { SchematicOption } from './schematic.option';
1
+ import { AbstractRunner } from '../runners/index.js';
2
+ import { Schematic } from './nest.collection.js';
3
+ import { SchematicOption } from './schematic.option.js';
4
4
  export declare abstract class AbstractCollection {
5
5
  protected collection: string;
6
6
  protected runner: AbstractRunner;
@@ -1,7 +1,6 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.AbstractCollection = void 0;
4
- class AbstractCollection {
1
+ export class AbstractCollection {
2
+ collection;
3
+ runner;
5
4
  constructor(collection, runner) {
6
5
  this.collection = collection;
7
6
  this.runner = runner;
@@ -20,4 +19,3 @@ class AbstractCollection {
20
19
  }, '');
21
20
  }
22
21
  }
23
- exports.AbstractCollection = AbstractCollection;
@@ -1,5 +1,5 @@
1
- import { AbstractCollection } from './abstract.collection';
2
- import { Collection } from './collection';
1
+ import { AbstractCollection } from './abstract.collection.js';
2
+ import { Collection } from './collection.js';
3
3
  export declare class CollectionFactory {
4
4
  static create(collection: Collection | string): AbstractCollection;
5
5
  }
@@ -1,19 +1,15 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.CollectionFactory = void 0;
4
- const runners_1 = require("../runners");
5
- const collection_1 = require("./collection");
6
- const custom_collection_1 = require("./custom.collection");
7
- const nest_collection_1 = require("./nest.collection");
8
- class CollectionFactory {
1
+ import { Runner, RunnerFactory } from '../runners/index.js';
2
+ import { Collection } from './collection.js';
3
+ import { CustomCollection } from './custom.collection.js';
4
+ import { NestCollection } from './nest.collection.js';
5
+ export class CollectionFactory {
9
6
  static create(collection) {
10
- const schematicRunner = runners_1.RunnerFactory.create(runners_1.Runner.SCHEMATIC);
11
- if (collection === collection_1.Collection.NESTJS) {
12
- return new nest_collection_1.NestCollection(schematicRunner);
7
+ const schematicRunner = RunnerFactory.create(Runner.SCHEMATIC);
8
+ if (collection === Collection.NESTJS) {
9
+ return new NestCollection(schematicRunner);
13
10
  }
14
11
  else {
15
- return new custom_collection_1.CustomCollection(collection, schematicRunner);
12
+ return new CustomCollection(collection, schematicRunner);
16
13
  }
17
14
  }
18
15
  }
19
- exports.CollectionFactory = CollectionFactory;
@@ -1,7 +1,4 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Collection = void 0;
4
- var Collection;
1
+ export var Collection;
5
2
  (function (Collection) {
6
3
  Collection["NESTJS"] = "@nestjs/schematics";
7
- })(Collection || (exports.Collection = Collection = {}));
4
+ })(Collection || (Collection = {}));
@@ -1,5 +1,5 @@
1
- import { AbstractCollection } from './abstract.collection';
2
- import { Schematic } from './nest.collection';
1
+ import { AbstractCollection } from './abstract.collection.js';
2
+ import { Schematic } from './nest.collection.js';
3
3
  export interface CollectionSchematic {
4
4
  schema: string;
5
5
  description: string;
@@ -1,11 +1,8 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.CustomCollection = void 0;
4
- const tools_1 = require("@angular-devkit/schematics/tools");
5
- const abstract_collection_1 = require("./abstract.collection");
6
- class CustomCollection extends abstract_collection_1.AbstractCollection {
1
+ import { NodeWorkflow } from '@angular-devkit/schematics/tools/index.js';
2
+ import { AbstractCollection } from './abstract.collection.js';
3
+ export class CustomCollection extends AbstractCollection {
7
4
  getSchematics() {
8
- const workflow = new tools_1.NodeWorkflow(process.cwd(), {});
5
+ const workflow = new NodeWorkflow(process.cwd(), {});
9
6
  const collection = workflow.engine.createCollection(this.collection);
10
7
  const collectionDescriptions = [
11
8
  collection.description,
@@ -30,4 +27,3 @@ class CustomCollection extends abstract_collection_1.AbstractCollection {
30
27
  return schematics.sort((a, b) => a.name < b.name ? -1 : a.name > b.name ? 1 : 0);
31
28
  }
32
29
  }
33
- exports.CustomCollection = CustomCollection;
@@ -1,4 +1,4 @@
1
- export * from './collection';
2
- export * from './collection.factory';
3
- export * from './schematic.option';
4
- export * from './abstract.collection';
1
+ export * from './collection.js';
2
+ export * from './collection.factory.js';
3
+ export * from './schematic.option.js';
4
+ export * from './abstract.collection.js';
@@ -1,20 +1,4 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./collection"), exports);
18
- __exportStar(require("./collection.factory"), exports);
19
- __exportStar(require("./schematic.option"), exports);
20
- __exportStar(require("./abstract.collection"), exports);
1
+ export * from './collection.js';
2
+ export * from './collection.factory.js';
3
+ export * from './schematic.option.js';
4
+ export * from './abstract.collection.js';
@@ -1,6 +1,6 @@
1
- import { AbstractRunner } from '../runners';
2
- import { AbstractCollection } from './abstract.collection';
3
- import { SchematicOption } from './schematic.option';
1
+ import { AbstractRunner } from '../runners/index.js';
2
+ import { AbstractCollection } from './abstract.collection.js';
3
+ import { SchematicOption } from './schematic.option.js';
4
4
  export interface Schematic {
5
5
  name: string;
6
6
  alias: string;