@depup/nestjs__cli 11.0.16-depup.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (196) hide show
  1. package/LICENSE +24 -0
  2. package/README.md +42 -0
  3. package/actions/abstract.action.d.ts +4 -0
  4. package/actions/abstract.action.js +6 -0
  5. package/actions/add.action.d.ts +12 -0
  6. package/actions/add.action.js +113 -0
  7. package/actions/build.action.d.ts +22 -0
  8. package/actions/build.action.js +145 -0
  9. package/actions/generate.action.d.ts +5 -0
  10. package/actions/generate.action.js +97 -0
  11. package/actions/index.d.ts +7 -0
  12. package/actions/index.js +23 -0
  13. package/actions/info.action.d.ts +35 -0
  14. package/actions/info.action.js +181 -0
  15. package/actions/new.action.d.ts +7 -0
  16. package/actions/new.action.js +186 -0
  17. package/actions/start.action.d.ts +10 -0
  18. package/actions/start.action.js +122 -0
  19. package/bin/nest.d.ts +2 -0
  20. package/bin/nest.js +25 -0
  21. package/changes.json +54 -0
  22. package/commands/abstract.command.d.ts +7 -0
  23. package/commands/abstract.command.js +9 -0
  24. package/commands/add.command.d.ts +5 -0
  25. package/commands/add.command.js +36 -0
  26. package/commands/build.command.d.ts +5 -0
  27. package/commands/build.command.js +74 -0
  28. package/commands/command.input.d.ts +5 -0
  29. package/commands/command.input.js +2 -0
  30. package/commands/command.loader.d.ts +5 -0
  31. package/commands/command.loader.js +31 -0
  32. package/commands/generate.command.d.ts +9 -0
  33. package/commands/generate.command.js +107 -0
  34. package/commands/index.d.ts +2 -0
  35. package/commands/index.js +18 -0
  36. package/commands/info.command.d.ts +5 -0
  37. package/commands/info.command.js +16 -0
  38. package/commands/new.command.d.ts +5 -0
  39. package/commands/new.command.js +61 -0
  40. package/commands/start.command.d.ts +5 -0
  41. package/commands/start.command.js +104 -0
  42. package/lib/compiler/assets-manager.d.ts +15 -0
  43. package/lib/compiler/assets-manager.js +129 -0
  44. package/lib/compiler/base-compiler.d.ts +9 -0
  45. package/lib/compiler/base-compiler.js +26 -0
  46. package/lib/compiler/compiler.d.ts +12 -0
  47. package/lib/compiler/compiler.js +61 -0
  48. package/lib/compiler/defaults/swc-defaults.d.ts +61 -0
  49. package/lib/compiler/defaults/swc-defaults.js +57 -0
  50. package/lib/compiler/defaults/webpack-defaults.d.ts +3 -0
  51. package/lib/compiler/defaults/webpack-defaults.js +104 -0
  52. package/lib/compiler/helpers/append-extension.d.ts +1 -0
  53. package/lib/compiler/helpers/append-extension.js +7 -0
  54. package/lib/compiler/helpers/copy-path-resolve.d.ts +7 -0
  55. package/lib/compiler/helpers/copy-path-resolve.js +25 -0
  56. package/lib/compiler/helpers/delete-out-dir.d.ts +2 -0
  57. package/lib/compiler/helpers/delete-out-dir.js +12 -0
  58. package/lib/compiler/helpers/get-builder.d.ts +21 -0
  59. package/lib/compiler/helpers/get-builder.js +19 -0
  60. package/lib/compiler/helpers/get-tsc-config.path.d.ts +10 -0
  61. package/lib/compiler/helpers/get-tsc-config.path.js +24 -0
  62. package/lib/compiler/helpers/get-value-or-default.d.ts +4 -0
  63. package/lib/compiler/helpers/get-value-or-default.js +66 -0
  64. package/lib/compiler/helpers/get-webpack-config-path.d.ts +10 -0
  65. package/lib/compiler/helpers/get-webpack-config-path.js +23 -0
  66. package/lib/compiler/helpers/manual-restart.d.ts +2 -0
  67. package/lib/compiler/helpers/manual-restart.js +17 -0
  68. package/lib/compiler/helpers/tsconfig-provider.d.ts +11 -0
  69. package/lib/compiler/helpers/tsconfig-provider.js +22 -0
  70. package/lib/compiler/hooks/tsconfig-paths.hook.d.ts +2 -0
  71. package/lib/compiler/hooks/tsconfig-paths.hook.js +76 -0
  72. package/lib/compiler/interfaces/readonly-visitor.interface.d.ts +10 -0
  73. package/lib/compiler/interfaces/readonly-visitor.interface.js +2 -0
  74. package/lib/compiler/plugins/plugin-metadata-generator.d.ts +58 -0
  75. package/lib/compiler/plugins/plugin-metadata-generator.js +84 -0
  76. package/lib/compiler/plugins/plugin-metadata-printer.d.ts +17 -0
  77. package/lib/compiler/plugins/plugin-metadata-printer.js +51 -0
  78. package/lib/compiler/plugins/plugins-loader.d.ts +30 -0
  79. package/lib/compiler/plugins/plugins-loader.js +70 -0
  80. package/lib/compiler/swc/constants.d.ts +9 -0
  81. package/lib/compiler/swc/constants.js +13 -0
  82. package/lib/compiler/swc/forked-type-checker.d.ts +1 -0
  83. package/lib/compiler/swc/forked-type-checker.js +63 -0
  84. package/lib/compiler/swc/swc-compiler.d.ts +25 -0
  85. package/lib/compiler/swc/swc-compiler.js +231 -0
  86. package/lib/compiler/swc/type-checker-host.d.ts +14 -0
  87. package/lib/compiler/swc/type-checker-host.js +90 -0
  88. package/lib/compiler/typescript-loader.d.ts +6 -0
  89. package/lib/compiler/typescript-loader.js +31 -0
  90. package/lib/compiler/watch-compiler.d.ts +22 -0
  91. package/lib/compiler/watch-compiler.js +89 -0
  92. package/lib/compiler/webpack-compiler.d.ts +21 -0
  93. package/lib/compiler/webpack-compiler.js +99 -0
  94. package/lib/configuration/configuration.d.ts +91 -0
  95. package/lib/configuration/configuration.js +2 -0
  96. package/lib/configuration/configuration.loader.d.ts +4 -0
  97. package/lib/configuration/configuration.loader.js +2 -0
  98. package/lib/configuration/defaults.d.ts +6 -0
  99. package/lib/configuration/defaults.js +86 -0
  100. package/lib/configuration/index.d.ts +3 -0
  101. package/lib/configuration/index.js +19 -0
  102. package/lib/configuration/nest-configuration.loader.d.ts +8 -0
  103. package/lib/configuration/nest-configuration.loader.js +61 -0
  104. package/lib/package-managers/abstract.package-manager.d.ts +25 -0
  105. package/lib/package-managers/abstract.package-manager.js +151 -0
  106. package/lib/package-managers/index.d.ts +8 -0
  107. package/lib/package-managers/index.js +24 -0
  108. package/lib/package-managers/npm.package-manager.d.ts +7 -0
  109. package/lib/package-managers/npm.package-manager.js +26 -0
  110. package/lib/package-managers/package-manager-commands.d.ts +9 -0
  111. package/lib/package-managers/package-manager-commands.js +2 -0
  112. package/lib/package-managers/package-manager.d.ts +5 -0
  113. package/lib/package-managers/package-manager.factory.d.ts +6 -0
  114. package/lib/package-managers/package-manager.factory.js +41 -0
  115. package/lib/package-managers/package-manager.js +9 -0
  116. package/lib/package-managers/pnpm.package-manager.d.ts +7 -0
  117. package/lib/package-managers/pnpm.package-manager.js +27 -0
  118. package/lib/package-managers/project.dependency.d.ts +4 -0
  119. package/lib/package-managers/project.dependency.js +2 -0
  120. package/lib/package-managers/yarn.package-manager.d.ts +7 -0
  121. package/lib/package-managers/yarn.package-manager.js +26 -0
  122. package/lib/questions/questions.d.ts +9 -0
  123. package/lib/questions/questions.js +27 -0
  124. package/lib/readers/file-system.reader.d.ts +8 -0
  125. package/lib/readers/file-system.reader.js +46 -0
  126. package/lib/readers/index.d.ts +2 -0
  127. package/lib/readers/index.js +18 -0
  128. package/lib/readers/reader.d.ts +10 -0
  129. package/lib/readers/reader.js +11 -0
  130. package/lib/runners/abstract.runner.d.ts +11 -0
  131. package/lib/runners/abstract.runner.js +47 -0
  132. package/lib/runners/git.runner.d.ts +4 -0
  133. package/lib/runners/git.runner.js +10 -0
  134. package/lib/runners/index.d.ts +3 -0
  135. package/lib/runners/index.js +19 -0
  136. package/lib/runners/npm.runner.d.ts +4 -0
  137. package/lib/runners/npm.runner.js +10 -0
  138. package/lib/runners/pnpm.runner.d.ts +4 -0
  139. package/lib/runners/pnpm.runner.js +10 -0
  140. package/lib/runners/runner.d.ts +6 -0
  141. package/lib/runners/runner.factory.d.ts +8 -0
  142. package/lib/runners/runner.factory.js +26 -0
  143. package/lib/runners/runner.js +10 -0
  144. package/lib/runners/schematic.runner.d.ts +6 -0
  145. package/lib/runners/schematic.runner.js +21 -0
  146. package/lib/runners/yarn.runner.d.ts +4 -0
  147. package/lib/runners/yarn.runner.js +10 -0
  148. package/lib/schematics/abstract.collection.d.ts +12 -0
  149. package/lib/schematics/abstract.collection.js +23 -0
  150. package/lib/schematics/collection.d.ts +3 -0
  151. package/lib/schematics/collection.factory.d.ts +5 -0
  152. package/lib/schematics/collection.factory.js +19 -0
  153. package/lib/schematics/collection.js +7 -0
  154. package/lib/schematics/custom.collection.d.ts +10 -0
  155. package/lib/schematics/custom.collection.js +33 -0
  156. package/lib/schematics/index.d.ts +4 -0
  157. package/lib/schematics/index.js +20 -0
  158. package/lib/schematics/nest.collection.d.ts +15 -0
  159. package/lib/schematics/nest.collection.js +126 -0
  160. package/lib/schematics/schematic.option.d.ts +8 -0
  161. package/lib/schematics/schematic.option.js +44 -0
  162. package/lib/ui/banner.d.ts +1 -0
  163. package/lib/ui/banner.js +12 -0
  164. package/lib/ui/emojis.d.ts +19 -0
  165. package/lib/ui/emojis.js +23 -0
  166. package/lib/ui/errors.d.ts +4 -0
  167. package/lib/ui/errors.js +8 -0
  168. package/lib/ui/index.d.ts +5 -0
  169. package/lib/ui/index.js +21 -0
  170. package/lib/ui/messages.d.ts +24 -0
  171. package/lib/ui/messages.js +32 -0
  172. package/lib/ui/prefixes.d.ts +2 -0
  173. package/lib/ui/prefixes.js +6 -0
  174. package/lib/utils/formatting.d.ts +8 -0
  175. package/lib/utils/formatting.js +18 -0
  176. package/lib/utils/get-default-tsconfig-path.d.ts +1 -0
  177. package/lib/utils/get-default-tsconfig-path.js +12 -0
  178. package/lib/utils/gracefully-exit-on-prompt-error.d.ts +1 -0
  179. package/lib/utils/gracefully-exit-on-prompt-error.js +11 -0
  180. package/lib/utils/is-module-available.d.ts +1 -0
  181. package/lib/utils/is-module-available.js +12 -0
  182. package/lib/utils/load-configuration.d.ts +2 -0
  183. package/lib/utils/load-configuration.js +9 -0
  184. package/lib/utils/local-binaries.d.ts +3 -0
  185. package/lib/utils/local-binaries.js +15 -0
  186. package/lib/utils/os-info.utils.d.ts +1 -0
  187. package/lib/utils/os-info.utils.js +23 -0
  188. package/lib/utils/project-utils.d.ts +11 -0
  189. package/lib/utils/project-utils.js +83 -0
  190. package/lib/utils/remaining-flags.d.ts +2 -0
  191. package/lib/utils/remaining-flags.js +36 -0
  192. package/lib/utils/tree-kill.d.ts +1 -0
  193. package/lib/utils/tree-kill.js +68 -0
  194. package/lib/utils/type-assertions.d.ts +1 -0
  195. package/lib/utils/type-assertions.js +8 -0
  196. package/package.json +161 -0
@@ -0,0 +1,126 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.NestCollection = void 0;
4
+ const abstract_collection_1 = require("./abstract.collection");
5
+ class NestCollection extends abstract_collection_1.AbstractCollection {
6
+ constructor(runner) {
7
+ super('@nestjs/schematics', runner);
8
+ }
9
+ async execute(name, options) {
10
+ const schematic = this.validate(name);
11
+ await super.execute(schematic, options);
12
+ }
13
+ getSchematics() {
14
+ return NestCollection.schematics.filter((item) => item.name !== 'angular-app');
15
+ }
16
+ validate(name) {
17
+ const schematic = NestCollection.schematics.find((s) => s.name === name || s.alias === name);
18
+ if (schematic === undefined || schematic === null) {
19
+ throw new Error(`Invalid schematic "${name}". Please, ensure that "${name}" exists in this collection.`);
20
+ }
21
+ return schematic.name;
22
+ }
23
+ }
24
+ exports.NestCollection = NestCollection;
25
+ NestCollection.schematics = [
26
+ {
27
+ name: 'application',
28
+ alias: 'application',
29
+ description: 'Generate a new application workspace',
30
+ },
31
+ {
32
+ name: 'angular-app',
33
+ alias: 'ng-app',
34
+ description: '',
35
+ },
36
+ {
37
+ name: 'class',
38
+ alias: 'cl',
39
+ description: 'Generate a new class',
40
+ },
41
+ {
42
+ name: 'configuration',
43
+ alias: 'config',
44
+ description: 'Generate a CLI configuration file',
45
+ },
46
+ {
47
+ name: 'controller',
48
+ alias: 'co',
49
+ description: 'Generate a controller declaration',
50
+ },
51
+ {
52
+ name: 'decorator',
53
+ alias: 'd',
54
+ description: 'Generate a custom decorator',
55
+ },
56
+ {
57
+ name: 'filter',
58
+ alias: 'f',
59
+ description: 'Generate a filter declaration',
60
+ },
61
+ {
62
+ name: 'gateway',
63
+ alias: 'ga',
64
+ description: 'Generate a gateway declaration',
65
+ },
66
+ {
67
+ name: 'guard',
68
+ alias: 'gu',
69
+ description: 'Generate a guard declaration',
70
+ },
71
+ {
72
+ name: 'interceptor',
73
+ alias: 'itc',
74
+ description: 'Generate an interceptor declaration',
75
+ },
76
+ {
77
+ name: 'interface',
78
+ alias: 'itf',
79
+ description: 'Generate an interface',
80
+ },
81
+ {
82
+ name: 'library',
83
+ alias: 'lib',
84
+ description: 'Generate a new library within a monorepo',
85
+ },
86
+ {
87
+ name: 'middleware',
88
+ alias: 'mi',
89
+ description: 'Generate a middleware declaration',
90
+ },
91
+ {
92
+ name: 'module',
93
+ alias: 'mo',
94
+ description: 'Generate a module declaration',
95
+ },
96
+ {
97
+ name: 'pipe',
98
+ alias: 'pi',
99
+ description: 'Generate a pipe declaration',
100
+ },
101
+ {
102
+ name: 'provider',
103
+ alias: 'pr',
104
+ description: 'Generate a provider declaration',
105
+ },
106
+ {
107
+ name: 'resolver',
108
+ alias: 'r',
109
+ description: 'Generate a GraphQL resolver declaration',
110
+ },
111
+ {
112
+ name: 'resource',
113
+ alias: 'res',
114
+ description: 'Generate a new CRUD resource',
115
+ },
116
+ {
117
+ name: 'service',
118
+ alias: 's',
119
+ description: 'Generate a service declaration',
120
+ },
121
+ {
122
+ name: 'sub-app',
123
+ alias: 'app',
124
+ description: 'Generate a new application within a monorepo',
125
+ },
126
+ ];
@@ -0,0 +1,8 @@
1
+ export declare class SchematicOption {
2
+ private name;
3
+ private value;
4
+ constructor(name: string, value: boolean | string);
5
+ get normalizedName(): string;
6
+ toCommandString(): string;
7
+ private format;
8
+ }
@@ -0,0 +1,44 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SchematicOption = void 0;
4
+ const formatting_1 = require("../utils/formatting");
5
+ class SchematicOption {
6
+ constructor(name, value) {
7
+ this.name = name;
8
+ this.value = value;
9
+ }
10
+ get normalizedName() {
11
+ return (0, formatting_1.normalizeToKebabOrSnakeCase)(this.name);
12
+ }
13
+ toCommandString() {
14
+ if (typeof this.value === 'string') {
15
+ if (this.name === 'name') {
16
+ return `--${this.normalizedName}=${this.format()}`;
17
+ }
18
+ else if (this.name === 'version' || this.name === 'path') {
19
+ return `--${this.normalizedName}=${this.value}`;
20
+ }
21
+ else {
22
+ return `--${this.normalizedName}="${this.value}"`;
23
+ }
24
+ }
25
+ else if (typeof this.value === 'boolean') {
26
+ const str = this.normalizedName;
27
+ return this.value ? `--${str}` : `--no-${str}`;
28
+ }
29
+ else {
30
+ return `--${this.normalizedName}=${this.value}`;
31
+ }
32
+ }
33
+ format() {
34
+ return (0, formatting_1.normalizeToKebabOrSnakeCase)(this.value)
35
+ .split('')
36
+ .reduce((content, char) => {
37
+ if (char === '(' || char === ')' || char === '[' || char === ']') {
38
+ return `${content}\\${char}`;
39
+ }
40
+ return `${content}${char}`;
41
+ }, '');
42
+ }
43
+ }
44
+ exports.SchematicOption = SchematicOption;
@@ -0,0 +1 @@
1
+ export declare const BANNER = "\n _ _ _ ___ _____ _____ _ _____\n| \\ | | | | |_ |/ ___|/ __ \\| | |_ _|\n| \\| | ___ ___ | |_ | |\\ `--. | / \\/| | | |\n| . ` | / _ \\/ __|| __| | | `--. \\| | | | | |\n| |\\ || __/\\__ \\| |_ /\\__/ //\\__/ /| \\__/\\| |_____| |_\n\\_| \\_/ \\___||___/ \\__|\\____/ \\____/ \\____/\\_____/\\___/\n\n";
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.BANNER = void 0;
4
+ exports.BANNER = `
5
+ _ _ _ ___ _____ _____ _ _____
6
+ | \\ | | | | |_ |/ ___|/ __ \\| | |_ _|
7
+ | \\| | ___ ___ | |_ | |\\ \`--. | / \\/| | | |
8
+ | . \` | / _ \\/ __|| __| | | \`--. \\| | | | | |
9
+ | |\\ || __/\\__ \\| |_ /\\__/ //\\__/ /| \\__/\\| |_____| |_
10
+ \\_| \\_/ \\___||___/ \\__|\\____/ \\____/ \\____/\\_____/\\___/
11
+
12
+ `;
@@ -0,0 +1,19 @@
1
+ export declare const EMOJIS: {
2
+ HEART: string;
3
+ COFFEE: string;
4
+ BEER: string;
5
+ BROKEN_HEART: string;
6
+ CRYING: string;
7
+ HEART_EYES: string;
8
+ JOY: string;
9
+ KISSING: string;
10
+ SCREAM: string;
11
+ ROCKET: string;
12
+ SMIRK: string;
13
+ RAISED_HANDS: string;
14
+ POINT_RIGHT: string;
15
+ SPARKLES: string;
16
+ BOOM: string;
17
+ PRAY: string;
18
+ WINE: string;
19
+ };
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.EMOJIS = void 0;
4
+ const node_emoji_1 = require("node-emoji");
5
+ exports.EMOJIS = {
6
+ HEART: (0, node_emoji_1.get)('heart'),
7
+ COFFEE: (0, node_emoji_1.get)('coffee'),
8
+ BEER: (0, node_emoji_1.get)('beer'),
9
+ BROKEN_HEART: (0, node_emoji_1.get)('broken_heart'),
10
+ CRYING: (0, node_emoji_1.get)('crying_cat_face'),
11
+ HEART_EYES: (0, node_emoji_1.get)('heart_eyes_cat'),
12
+ JOY: (0, node_emoji_1.get)('joy_cat'),
13
+ KISSING: (0, node_emoji_1.get)('kissing_cat'),
14
+ SCREAM: (0, node_emoji_1.get)('scream_cat'),
15
+ ROCKET: (0, node_emoji_1.get)('rocket'),
16
+ SMIRK: (0, node_emoji_1.get)('smirk_cat'),
17
+ RAISED_HANDS: (0, node_emoji_1.get)('raised_hands'),
18
+ POINT_RIGHT: (0, node_emoji_1.get)('point_right'),
19
+ SPARKLES: (0, node_emoji_1.get)('sparkles'),
20
+ BOOM: (0, node_emoji_1.get)('boom'),
21
+ PRAY: (0, node_emoji_1.get)('pray'),
22
+ WINE: (0, node_emoji_1.get)('wine_glass'),
23
+ };
@@ -0,0 +1,4 @@
1
+ export declare const CLI_ERRORS: {
2
+ MISSING_TYPESCRIPT: (path: string) => string;
3
+ WRONG_PLUGIN: (name: string) => string;
4
+ };
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ // tslint:disable:max-line-length
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.CLI_ERRORS = void 0;
5
+ exports.CLI_ERRORS = {
6
+ MISSING_TYPESCRIPT: (path) => `Could not find TypeScript configuration file "${path}". Please, ensure that you are running this command in the appropriate directory (inside Nest workspace).`,
7
+ WRONG_PLUGIN: (name) => `The "${name}" plugin is not compatible with Nest CLI. Neither "after()" nor "before()" nor "afterDeclarations()" function have been provided.`,
8
+ };
@@ -0,0 +1,5 @@
1
+ export * from './banner';
2
+ export * from './emojis';
3
+ export * from './errors';
4
+ export * from './messages';
5
+ export * from './prefixes';
@@ -0,0 +1,21 @@
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("./banner"), exports);
18
+ __exportStar(require("./emojis"), exports);
19
+ __exportStar(require("./errors"), exports);
20
+ __exportStar(require("./messages"), exports);
21
+ __exportStar(require("./prefixes"), exports);
@@ -0,0 +1,24 @@
1
+ export declare const MESSAGES: {
2
+ PROJECT_NAME_QUESTION: string;
3
+ PROJECT_SELECTION_QUESTION: string;
4
+ LIBRARY_PROJECT_SELECTION_QUESTION: string;
5
+ DRY_RUN_MODE: string;
6
+ PROJECT_INFORMATION_START: string;
7
+ RUNNER_EXECUTION_ERROR: (command: string) => string;
8
+ PACKAGE_MANAGER_QUESTION: string;
9
+ PACKAGE_MANAGER_INSTALLATION_IN_PROGRESS: string;
10
+ PACKAGE_MANAGER_UPDATE_IN_PROGRESS: string;
11
+ PACKAGE_MANAGER_UPGRADE_IN_PROGRESS: string;
12
+ PACKAGE_MANAGER_PRODUCTION_INSTALLATION_IN_PROGRESS: string;
13
+ GIT_INITIALIZATION_ERROR: string;
14
+ PACKAGE_MANAGER_INSTALLATION_SUCCEED: (name: string) => string;
15
+ GET_STARTED_INFORMATION: string;
16
+ CHANGE_DIR_COMMAND: (name: string) => string;
17
+ START_COMMAND: (name: string) => string;
18
+ PACKAGE_MANAGER_INSTALLATION_FAILED: (commandToRunManually: string) => string;
19
+ NEST_INFORMATION_PACKAGE_MANAGER_FAILED: string;
20
+ NEST_INFORMATION_PACKAGE_WARNING_FAILED: (nestDependencies: string[]) => string;
21
+ LIBRARY_INSTALLATION_FAILED_BAD_PACKAGE: (name: string) => string;
22
+ LIBRARY_INSTALLATION_FAILED_NO_LIBRARY: string;
23
+ LIBRARY_INSTALLATION_STARTS: string;
24
+ };
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.MESSAGES = void 0;
4
+ const ansis_1 = require("ansis");
5
+ const emojis_1 = require("./emojis");
6
+ exports.MESSAGES = {
7
+ PROJECT_NAME_QUESTION: 'What name would you like to use for the new project?',
8
+ PROJECT_SELECTION_QUESTION: 'Which project would you like to generate to?',
9
+ LIBRARY_PROJECT_SELECTION_QUESTION: 'Which project would you like to add the library to?',
10
+ DRY_RUN_MODE: 'Command has been executed in dry run mode, nothing changed!',
11
+ PROJECT_INFORMATION_START: `${emojis_1.EMOJIS.SPARKLES} We will scaffold your app in a few seconds..`,
12
+ RUNNER_EXECUTION_ERROR: (command) => `\nFailed to execute command: ${command}`,
13
+ PACKAGE_MANAGER_QUESTION: `Which package manager would you ${emojis_1.EMOJIS.HEART} to use?`,
14
+ PACKAGE_MANAGER_INSTALLATION_IN_PROGRESS: `Installation in progress... ${emojis_1.EMOJIS.COFFEE}`,
15
+ PACKAGE_MANAGER_UPDATE_IN_PROGRESS: `Installation in progress... ${emojis_1.EMOJIS.COFFEE}`,
16
+ PACKAGE_MANAGER_UPGRADE_IN_PROGRESS: `Installation in progress... ${emojis_1.EMOJIS.COFFEE}`,
17
+ PACKAGE_MANAGER_PRODUCTION_INSTALLATION_IN_PROGRESS: `Package installation in progress... ${emojis_1.EMOJIS.COFFEE}`,
18
+ GIT_INITIALIZATION_ERROR: 'Git repository has not been initialized',
19
+ PACKAGE_MANAGER_INSTALLATION_SUCCEED: (name) => name !== '.'
20
+ ? `${emojis_1.EMOJIS.ROCKET} Successfully created project ${(0, ansis_1.green)(name)}`
21
+ : `${emojis_1.EMOJIS.ROCKET} Successfully created a new project`,
22
+ GET_STARTED_INFORMATION: `${emojis_1.EMOJIS.POINT_RIGHT} Get started with the following commands:`,
23
+ CHANGE_DIR_COMMAND: (name) => `$ cd ${name}`,
24
+ START_COMMAND: (name) => `$ ${name} run start`,
25
+ PACKAGE_MANAGER_INSTALLATION_FAILED: (commandToRunManually) => `${emojis_1.EMOJIS.SCREAM} Packages installation failed!\nIn case you don't see any errors above, consider manually running the failed command ${commandToRunManually} to see more details on why it errored out.`,
26
+ // tslint:disable-next-line:max-line-length
27
+ NEST_INFORMATION_PACKAGE_MANAGER_FAILED: `${emojis_1.EMOJIS.SMIRK} cannot read your project package.json file, are you inside your project directory?`,
28
+ NEST_INFORMATION_PACKAGE_WARNING_FAILED: (nestDependencies) => `${emojis_1.EMOJIS.SMIRK} failed to compare dependencies versions, please check that following packages are in the same minor version : \n ${nestDependencies.join('\n')}`,
29
+ LIBRARY_INSTALLATION_FAILED_BAD_PACKAGE: (name) => `Unable to install library ${name} because package did not install. Please check package name.`,
30
+ LIBRARY_INSTALLATION_FAILED_NO_LIBRARY: 'No library found.',
31
+ LIBRARY_INSTALLATION_STARTS: 'Starting library setup...',
32
+ };
@@ -0,0 +1,2 @@
1
+ export declare const ERROR_PREFIX: string;
2
+ export declare const INFO_PREFIX: string;
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.INFO_PREFIX = exports.ERROR_PREFIX = void 0;
4
+ const ansis_1 = require("ansis");
5
+ exports.ERROR_PREFIX = (0, ansis_1.bgRgb)(210, 0, 75).bold.rgb(0, 0, 0)(' Error ');
6
+ exports.INFO_PREFIX = (0, ansis_1.bgRgb)(60, 190, 100).bold.rgb(0, 0, 0)(' Info ');
@@ -0,0 +1,8 @@
1
+ /**
2
+ *
3
+ * @param str
4
+ * @returns formated string
5
+ * @description normalizes input to supported path and file name format.
6
+ * Changes camelCase strings to kebab-case, replaces spaces with dash and keeps underscores.
7
+ */
8
+ export declare function normalizeToKebabOrSnakeCase(str: string): string;
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.normalizeToKebabOrSnakeCase = normalizeToKebabOrSnakeCase;
4
+ /**
5
+ *
6
+ * @param str
7
+ * @returns formated string
8
+ * @description normalizes input to supported path and file name format.
9
+ * Changes camelCase strings to kebab-case, replaces spaces with dash and keeps underscores.
10
+ */
11
+ function normalizeToKebabOrSnakeCase(str) {
12
+ const STRING_DASHERIZE_REGEXP = /\s/g;
13
+ const STRING_DECAMELIZE_REGEXP = /([a-z\d])([A-Z])/g;
14
+ return str
15
+ .replace(STRING_DECAMELIZE_REGEXP, '$1-$2')
16
+ .toLowerCase()
17
+ .replace(STRING_DASHERIZE_REGEXP, '-');
18
+ }
@@ -0,0 +1 @@
1
+ export declare function getDefaultTsconfigPath(): "tsconfig.build.json" | "tsconfig.json";
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getDefaultTsconfigPath = getDefaultTsconfigPath;
4
+ const fs = require("fs");
5
+ const path_1 = require("path");
6
+ const TSCONFIG_BUILD_JSON = 'tsconfig.build.json';
7
+ const TSCONFIG_JSON = 'tsconfig.json';
8
+ function getDefaultTsconfigPath() {
9
+ return fs.existsSync((0, path_1.join)(process.cwd(), TSCONFIG_BUILD_JSON))
10
+ ? TSCONFIG_BUILD_JSON
11
+ : TSCONFIG_JSON;
12
+ }
@@ -0,0 +1 @@
1
+ export declare function gracefullyExitOnPromptError(err: Error): void;
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.gracefullyExitOnPromptError = gracefullyExitOnPromptError;
4
+ function gracefullyExitOnPromptError(err) {
5
+ if (err.name === 'ExitPromptError') {
6
+ process.exit(1);
7
+ }
8
+ else {
9
+ throw err;
10
+ }
11
+ }
@@ -0,0 +1 @@
1
+ export declare function isModuleAvailable(path: string): boolean;
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isModuleAvailable = isModuleAvailable;
4
+ function isModuleAvailable(path) {
5
+ try {
6
+ require.resolve(path);
7
+ return true;
8
+ }
9
+ catch {
10
+ return false;
11
+ }
12
+ }
@@ -0,0 +1,2 @@
1
+ import { Configuration } from '../configuration';
2
+ export declare function loadConfiguration(): Promise<Required<Configuration>>;
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.loadConfiguration = loadConfiguration;
4
+ const nest_configuration_loader_1 = require("../configuration/nest-configuration.loader");
5
+ const readers_1 = require("../readers");
6
+ async function loadConfiguration() {
7
+ const loader = new nest_configuration_loader_1.NestConfigurationLoader(new readers_1.FileSystemReader(process.cwd()));
8
+ return loader.load();
9
+ }
@@ -0,0 +1,3 @@
1
+ import { CommandLoader } from '../../commands';
2
+ export declare function localBinExists(): boolean;
3
+ export declare function loadLocalBinCommandLoader(): typeof CommandLoader;
@@ -0,0 +1,15 @@
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");
7
+ const localBinPathSegments = [process.cwd(), 'node_modules', '@nestjs', 'cli'];
8
+ function localBinExists() {
9
+ return (0, fs_1.existsSync)((0, path_1.join)(...localBinPathSegments));
10
+ }
11
+ function loadLocalBinCommandLoader() {
12
+ // eslint-disable-next-line @typescript-eslint/no-var-requires
13
+ const commandsFile = require(path_1.posix.join(...localBinPathSegments, 'commands'));
14
+ return commandsFile.CommandLoader;
15
+ }
@@ -0,0 +1 @@
1
+ export default function osName(platform: string, release: string): string;
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.default = osName;
4
+ function osName(platform, release) {
5
+ switch (platform) {
6
+ case 'darwin':
7
+ return Number(release.split('.')[0]) > 15 ? 'macOS' : 'OS X';
8
+ case 'linux':
9
+ return 'Linux';
10
+ case 'win32':
11
+ return 'Windows';
12
+ case 'freebsd':
13
+ return 'FreeBSD';
14
+ case 'openbsd':
15
+ return 'OpenBSD';
16
+ case 'sunos':
17
+ return 'Solaris';
18
+ case 'android':
19
+ return 'Android';
20
+ default:
21
+ return platform;
22
+ }
23
+ }
@@ -0,0 +1,11 @@
1
+ import { Input } from '../../commands';
2
+ import { Configuration, ProjectConfiguration } from '../configuration';
3
+ export declare function shouldAskForProject(schematic: string, configurationProjects: {
4
+ [key: string]: ProjectConfiguration;
5
+ }, appName: string): boolean;
6
+ export declare function shouldGenerateSpec(configuration: Required<Configuration>, schematic: string, appName: string, specValue: boolean, specPassedAsInput?: boolean): any;
7
+ export declare function shouldGenerateFlat(configuration: Required<Configuration>, appName: string, flatValue: boolean): boolean;
8
+ export declare function getSpecFileSuffix(configuration: Required<Configuration>, appName: string, specFileSuffixValue: string): string;
9
+ export declare function askForProjectName(promptQuestion: string, projects: string[]): Promise<string | void>;
10
+ 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;
@@ -0,0 +1,83 @@
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) {
15
+ return (['app', 'sub-app', 'library', 'lib'].includes(schematic) === false &&
16
+ configurationProjects &&
17
+ Object.entries(configurationProjects).length !== 0 &&
18
+ !appName);
19
+ }
20
+ function shouldGenerateSpec(configuration, schematic, appName, specValue, specPassedAsInput) {
21
+ if (specPassedAsInput === true || specPassedAsInput === undefined) {
22
+ // CLI parameters has the highest priority
23
+ return specValue;
24
+ }
25
+ let specConfiguration = (0, get_value_or_default_1.getValueOrDefault)(configuration, 'generateOptions.spec', appName || '');
26
+ if (typeof specConfiguration === 'boolean') {
27
+ return specConfiguration;
28
+ }
29
+ if (typeof specConfiguration === 'object' &&
30
+ specConfiguration[schematic] !== undefined) {
31
+ return specConfiguration[schematic];
32
+ }
33
+ if (typeof specConfiguration === 'object' && appName) {
34
+ // The appName has a generateOption spec, but not for the schematic trying to generate
35
+ // Check if the global generateOptions has a spec to use instead
36
+ specConfiguration = (0, get_value_or_default_1.getValueOrDefault)(configuration, 'generateOptions.spec', '');
37
+ if (typeof specConfiguration === 'boolean') {
38
+ return specConfiguration;
39
+ }
40
+ if (typeof specConfiguration === 'object' &&
41
+ specConfiguration[schematic] !== undefined) {
42
+ return specConfiguration[schematic];
43
+ }
44
+ }
45
+ return specValue;
46
+ }
47
+ function shouldGenerateFlat(configuration, appName, flatValue) {
48
+ // CLI parameters have the highest priority
49
+ if (flatValue === true) {
50
+ return flatValue;
51
+ }
52
+ const flatConfiguration = (0, get_value_or_default_1.getValueOrDefault)(configuration, 'generateOptions.flat', appName || '');
53
+ if (typeof flatConfiguration === 'boolean') {
54
+ return flatConfiguration;
55
+ }
56
+ return flatValue;
57
+ }
58
+ function getSpecFileSuffix(configuration, appName, specFileSuffixValue) {
59
+ // CLI parameters have the highest priority
60
+ if (specFileSuffixValue) {
61
+ return specFileSuffixValue;
62
+ }
63
+ const specFileSuffixConfiguration = (0, get_value_or_default_1.getValueOrDefault)(configuration, 'generateOptions.specFileSuffix', appName || '', undefined, undefined, 'spec');
64
+ if (typeof specFileSuffixConfiguration === 'string') {
65
+ return specFileSuffixConfiguration;
66
+ }
67
+ return specFileSuffixValue;
68
+ }
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);
72
+ }
73
+ function moveDefaultProjectToStart(configuration, defaultProjectName, defaultLabel) {
74
+ let projects = configuration.projects != null ? Object.keys(configuration.projects) : [];
75
+ if (configuration.sourceRoot !== 'src') {
76
+ projects = projects.filter((p) => p !== defaultProjectName.replace(defaultLabel, ''));
77
+ }
78
+ projects.unshift(defaultProjectName);
79
+ return projects;
80
+ }
81
+ function hasValidOptionFlag(queriedOptionName, options, queriedValue = true) {
82
+ return options.some((option) => option.name === queriedOptionName && option.value === queriedValue);
83
+ }
@@ -0,0 +1,2 @@
1
+ import { CommanderStatic } from 'commander';
2
+ export declare function getRemainingFlags(cli: CommanderStatic): any[];
@@ -0,0 +1,36 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getRemainingFlags = getRemainingFlags;
4
+ function getRemainingFlags(cli) {
5
+ const rawArgs = [...cli.rawArgs];
6
+ return rawArgs
7
+ .splice(Math.max(rawArgs.findIndex((item) => item.startsWith('--')), 0))
8
+ .filter((item, index, array) => {
9
+ // If the option is consumed by commander.js, then we skip it
10
+ if (cli.options.find((o) => o.short === item || o.long === item)) {
11
+ return false;
12
+ }
13
+ // If it's an argument of an option consumed by commander.js, then we
14
+ // skip it too
15
+ const prevKeyRaw = array[index - 1];
16
+ if (prevKeyRaw) {
17
+ const previousKey = camelCase(prevKeyRaw.replace(/--/g, '').replace('no', ''));
18
+ if (cli[previousKey] === item) {
19
+ return false;
20
+ }
21
+ }
22
+ return true;
23
+ });
24
+ }
25
+ /**
26
+ * Camel-case the given `flag`
27
+ *
28
+ * @param {String} flag
29
+ * @return {String}
30
+ * @api private
31
+ */
32
+ function camelCase(flag) {
33
+ return flag.split('-').reduce((str, word) => {
34
+ return str + word[0].toUpperCase() + word.slice(1);
35
+ });
36
+ }
@@ -0,0 +1 @@
1
+ export declare function treeKillSync(pid: number, signal?: string | number): void;