nestcraftx 0.2.4 → 0.2.6

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 (63) hide show
  1. package/.gitattributes +6 -0
  2. package/.github/ISSUE_TEMPLATE/bug_report.md +33 -0
  3. package/.github/ISSUE_TEMPLATE/feature_request.md +19 -0
  4. package/.github/ISSUE_TEMPLATE/pull_request_template.md +24 -0
  5. package/CHANGELOG.fr.md +97 -97
  6. package/CHANGELOG.md +98 -98
  7. package/CLI_USAGE.fr.md +331 -331
  8. package/CLI_USAGE.md +364 -364
  9. package/DEMO.fr.md +292 -292
  10. package/DEMO.md +294 -294
  11. package/LICENSE +21 -21
  12. package/MIGRATION_GUIDE.fr.md +127 -127
  13. package/MIGRATION_GUIDE.md +124 -124
  14. package/QUICK_START.fr.md +152 -152
  15. package/QUICK_START.md +169 -169
  16. package/README.fr.md +653 -659
  17. package/SECURITY.md +10 -0
  18. package/bin/nestcraft.js +84 -64
  19. package/commands/demo.js +333 -330
  20. package/commands/generate.js +93 -0
  21. package/commands/generateConf.js +91 -0
  22. package/commands/help.js +78 -78
  23. package/commands/info.js +48 -48
  24. package/commands/new.js +338 -335
  25. package/commands/start.js +19 -19
  26. package/commands/test.js +7 -7
  27. package/package.json +41 -41
  28. package/readme.md +638 -643
  29. package/utils/cliParser.js +133 -76
  30. package/utils/colors.js +62 -62
  31. package/utils/configs/configureDocker.js +120 -120
  32. package/utils/configs/setupCleanArchitecture.js +563 -557
  33. package/utils/configs/setupLightArchitecture.js +701 -660
  34. package/utils/envGenerator.js +122 -122
  35. package/utils/file-utils/packageJsonUtils.js +49 -55
  36. package/utils/file-utils/saveProjectConfig.js +36 -0
  37. package/utils/fullModeInput.js +607 -607
  38. package/utils/generators/application/dtoUpdater.js +54 -0
  39. package/utils/generators/cleanModuleGenerator.js +475 -0
  40. package/utils/generators/database/setupDatabase.js +31 -0
  41. package/utils/generators/domain/entityUpdater.js +78 -0
  42. package/utils/generators/infrastructure/mapperUpdater.js +65 -0
  43. package/utils/generators/lightModuleGenerator.js +131 -0
  44. package/utils/generators/relation/relation.engine.js +64 -0
  45. package/utils/interactive/askEntityInputs.js +165 -0
  46. package/utils/lightModeInput.js +460 -460
  47. package/utils/loggers/logError.js +7 -7
  48. package/utils/loggers/logInfo.js +7 -7
  49. package/utils/loggers/logSuccess.js +7 -7
  50. package/utils/loggers/logWarning.js +7 -7
  51. package/utils/setups/orms/typeOrmSetup.js +630 -630
  52. package/utils/setups/projectSetup.js +46 -46
  53. package/utils/setups/setupAuth.js +973 -926
  54. package/utils/setups/setupDatabase.js +75 -75
  55. package/utils/setups/setupLogger.js +69 -59
  56. package/utils/setups/setupMongoose.js +377 -432
  57. package/utils/setups/setupPrisma.js +802 -630
  58. package/utils/setups/setupSwagger.js +97 -88
  59. package/utils/shell.js +32 -32
  60. package/utils/spinner.js +57 -57
  61. package/utils/systemCheck.js +124 -124
  62. package/utils/userInput.js +421 -421
  63. package/utils/utils.js +2197 -1762
@@ -1,46 +1,46 @@
1
- const readline = require("readline-sync");
2
- const { logInfo } = require("../loggers/logInfo");
3
- const { runCommand } = require("../shell");
4
- const fs = require("fs");
5
- const { info } = require("../colors");
6
-
7
- async function createProject(inputs) {
8
- if (fs.existsSync(inputs.projectName)) {
9
- const confirmation = readline.keyInYNStrict(
10
- `${info("[?]")} The folder '${
11
- inputs.projectName
12
- }' already exists. Do you want to delete it and proceed ?`
13
- );
14
-
15
- if (confirmation) {
16
- // confirmation is true if the user presses 'y'
17
- console.log("Deleting existing project...");
18
- fs.rmSync(inputs.projectName, { recursive: true, force: true });
19
- } else {
20
- console.log("Operation cancelled by user. Exiting.");
21
- return; // Stop function execution if the user cancels
22
- }
23
- }
24
-
25
- logInfo(`Creating NestJS project: ${inputs.projectName}`);
26
-
27
- // Remains asynchronous as runCommand likely involves external processes (npm/npx)
28
- await runCommand(
29
- `npx @nestjs/cli new ${inputs.projectName} --package-manager ${inputs.packageManager}`,
30
- "Failed to create NestJS project"
31
- );
32
-
33
- // Changing the current process directory to the project root
34
- process.chdir(inputs.projectName);
35
-
36
- // Installing dependencies
37
- logInfo("Installing dependencies...");
38
-
39
- // Remains asynchronous as runCommand likely involves external processes (npm/npx)
40
- await runCommand(
41
- `${inputs.packageManager} add @nestjs/config class-validator class-transformer`,
42
- "Failed to install dependencies"
43
- );
44
- }
45
-
46
- module.exports = { createProject };
1
+ const readline = require("readline-sync");
2
+ const { logInfo } = require("../loggers/logInfo");
3
+ const { runCommand } = require("../shell");
4
+ const fs = require("fs");
5
+ const { info } = require("../colors");
6
+
7
+ async function createProject(inputs) {
8
+ if (fs.existsSync(inputs.projectName)) {
9
+ const confirmation = readline.keyInYNStrict(
10
+ `${info("[?]")} The folder '${
11
+ inputs.projectName
12
+ }' already exists. Do you want to delete it and proceed ?`
13
+ );
14
+
15
+ if (confirmation) {
16
+ // confirmation is true if the user presses 'y'
17
+ console.log("Deleting existing project...");
18
+ fs.rmSync(inputs.projectName, { recursive: true, force: true });
19
+ } else {
20
+ console.log("Operation cancelled by user. Exiting.");
21
+ return; // Stop function execution if the user cancels
22
+ }
23
+ }
24
+
25
+ logInfo(`Creating NestJS project: ${inputs.projectName}`);
26
+
27
+ // Remains asynchronous as runCommand likely involves external processes (npm/npx)
28
+ await runCommand(
29
+ `npx @nestjs/cli new ${inputs.projectName} --package-manager ${inputs.packageManager}`,
30
+ "Failed to create NestJS project"
31
+ );
32
+
33
+ // Changing the current process directory to the project root
34
+ process.chdir(inputs.projectName);
35
+
36
+ // Installing dependencies
37
+ logInfo("Installing dependencies...");
38
+
39
+ // Remains asynchronous as runCommand likely involves external processes (npm/npx)
40
+ await runCommand(
41
+ `${inputs.packageManager} add @nestjs/config class-validator class-transformer dotenv`,
42
+ "Failed to install dependencies"
43
+ );
44
+ }
45
+
46
+ module.exports = { createProject };