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
package/QUICK_START.fr.md CHANGED
@@ -1,152 +1,152 @@
1
- # Quick Start - NestCraftX v0.2.4
2
-
3
- ## Installation
4
-
5
- ```bash
6
- npm install -g nestcraftx
7
- ```
8
-
9
- ## Utilisation Rapide
10
-
11
- ### Option 1 : Mode LIGHT avec flags (Le plus rapide)
12
-
13
- ```bash
14
- nestcraftx new mon-api --light --orm=prisma --auth --swagger
15
- cd mon-api
16
- npm run start:dev
17
- ```
18
-
19
- Resultat : Projet genere en quelques secondes avec :
20
-
21
- - Architecture MVP simplifiee
22
- - Prisma ORM
23
- - Authentification JWT
24
- - Documentation Swagger
25
- - Fichier .env avec secrets auto-generes
26
-
27
- ### Option 2 : Mode LIGHT interactif
28
-
29
- ```bash
30
- nestcraftx new mon-api --light
31
- ```
32
-
33
- Le CLI vous posera des questions pour :
34
-
35
- - Choisir l'ORM
36
- - Activer Auth/Swagger/Docker
37
- - Configurer la base de donnees
38
- - Ajouter des entites (optionnel)
39
-
40
- ### Option 3 : Mode FULL interactif
41
-
42
- ```bash
43
- nestcraftx new mon-projet
44
- ```
45
-
46
- Configuration complete avec :
47
-
48
- - Clean Architecture + DDD
49
- - Use-cases, mappers, adapters
50
- - Configuration interactive detaillee
51
- - Entites et relations
52
-
53
- ## Commandes Essentielles
54
-
55
- ```bash
56
- # Creer un projet
57
- nestcraftx new <nom> [options]
58
-
59
- # Mode LIGHT
60
- nestcraftx new api --light --orm=prisma
61
-
62
- # Mode FULL
63
- nestcraftx new app --full
64
-
65
- # Verifier environnement
66
- nestcraftx test
67
-
68
- # Infos CLI
69
- nestcraftx info
70
- ```
71
-
72
- ## Options Principales
73
-
74
- | Option | Description | Valeurs |
75
- | --------------- | ------------------------------------------------------------- | --------------------------------------------- |
76
- | `--light` | Architecture MVP simplifiee | - |
77
- | `--full` | Architecture complete (defaut) | - |
78
- | `--orm` | Choix de l'ORM | `prisma`, `typeorm`, `mongoose (coming soon)` |
79
- | `--auth` | Active JWT auth | - |
80
- | `--swagger` | Active Swagger docs | - |
81
- | `--docker` | Genere Docker files | `true` (defaut), `false` |
82
- | `--interactive` | Force le mode interactif pour la saisie des entités/relations |
83
-
84
- ## Exemples Pratiques
85
-
86
- ### Blog API (LIGHT + Prisma)
87
-
88
- ```bash
89
- nestcraftx new blog-api --light --orm=prisma --auth --swagger
90
- ```
91
-
92
- ### E-commerce API (FULL + TypeORM)
93
-
94
- ```bash
95
- nestcraftx new shop-api --full --orm=typeorm --auth --swagger
96
- ```
97
-
98
- ### MongoDB API (LIGHT + Mongoose)
99
-
100
- ```bash
101
- nestcraftx new mongo-api --light --orm=mongoose --auth
102
- ```
103
-
104
- ## Apres Generation
105
-
106
- ```bash
107
- cd <nom-projet>
108
- npm run start:dev
109
- ```
110
-
111
- **Swagger disponible :** `http://localhost:3000/api/docs`
112
-
113
- ## Differences Modes
114
-
115
- ### Mode LIGHT
116
-
117
- - Structure plate
118
- - Controllers → Services → Repositories
119
- - Demarrage rapide
120
- - Parfait pour MVPs
121
-
122
- ### Mode FULL
123
-
124
- - Clean Architecture complete
125
- - Domain/Application/Infrastructure/Presentation
126
- - Use-cases et mappers
127
- - Ideal pour projets complexes
128
-
129
- ## Fichier .env Auto-genere
130
-
131
- Le CLI genere automatiquement :
132
-
133
- - `JWT_SECRET` (64 chars securises)
134
- - `JWT_REFRESH_SECRET` (64 chars securises)
135
- - `DATABASE_URL` (pre-configure)
136
- - Toutes les variables necessaires
137
-
138
- ## Documentation Complete
139
-
140
- - [Guide d'utilisation complet](./CLI_USAGE.md)
141
- - [Guide de migration](./MIGRATION_GUIDE.md)
142
- - [Changelog](./CHANGELOG.md)
143
- - [README](./readme.md)
144
-
145
- ## Support
146
-
147
- - GitHub : [NestCraftX](https://github.com/august-dev-pro/NestCraftX)
148
- - Issues : [Ouvrir une issue](https://github.com/august-dev-pro/NestCraftX/issues)
149
-
150
- ---
151
-
152
- **NestCraftX v0.2.4** - Clean Architecture Made Simple
1
+ # Quick Start - NestCraftX v0.2.5
2
+
3
+ ## Installation
4
+
5
+ ```bash
6
+ npm install -g nestcraftx
7
+ ```
8
+
9
+ ## Utilisation Rapide
10
+
11
+ ### Option 1 : Mode LIGHT avec flags (Le plus rapide)
12
+
13
+ ```bash
14
+ nestcraftx new mon-api --light --orm=prisma --auth --swagger
15
+ cd mon-api
16
+ npm run start:dev
17
+ ```
18
+
19
+ Resultat : Projet genere en quelques secondes avec :
20
+
21
+ - Architecture MVP simplifiee
22
+ - Prisma ORM
23
+ - Authentification JWT
24
+ - Documentation Swagger
25
+ - Fichier .env avec secrets auto-generes
26
+
27
+ ### Option 2 : Mode LIGHT interactif
28
+
29
+ ```bash
30
+ nestcraftx new mon-api --light
31
+ ```
32
+
33
+ Le CLI vous posera des questions pour :
34
+
35
+ - Choisir l'ORM
36
+ - Activer Auth/Swagger/Docker
37
+ - Configurer la base de donnees
38
+ - Ajouter des entites (optionnel)
39
+
40
+ ### Option 3 : Mode FULL interactif
41
+
42
+ ```bash
43
+ nestcraftx new mon-projet
44
+ ```
45
+
46
+ Configuration complete avec :
47
+
48
+ - Clean Architecture + DDD
49
+ - Use-cases, mappers, adapters
50
+ - Configuration interactive detaillee
51
+ - Entites et relations
52
+
53
+ ## Commandes Essentielles
54
+
55
+ ```bash
56
+ # Creer un projet
57
+ nestcraftx new <nom> [options]
58
+
59
+ # Mode LIGHT
60
+ nestcraftx new api --light --orm=prisma
61
+
62
+ # Mode FULL
63
+ nestcraftx new app --full
64
+
65
+ # Verifier environnement
66
+ nestcraftx test
67
+
68
+ # Infos CLI
69
+ nestcraftx info
70
+ ```
71
+
72
+ ## Options Principales
73
+
74
+ | Option | Description | Valeurs |
75
+ | --------------- | ------------------------------------------------------------- | --------------------------------------------- |
76
+ | `--light` | Architecture MVP simplifiee | - |
77
+ | `--full` | Architecture complete (defaut) | - |
78
+ | `--orm` | Choix de l'ORM | `prisma`, `typeorm`, `mongoose (coming soon)` |
79
+ | `--auth` | Active JWT auth | - |
80
+ | `--swagger` | Active Swagger docs | - |
81
+ | `--docker` | Genere Docker files | `true` (defaut), `false` |
82
+ | `--interactive` | Force le mode interactif pour la saisie des entités/relations |
83
+
84
+ ## Exemples Pratiques
85
+
86
+ ### Blog API (LIGHT + Prisma)
87
+
88
+ ```bash
89
+ nestcraftx new blog-api --light --orm=prisma --auth --swagger
90
+ ```
91
+
92
+ ### E-commerce API (FULL + TypeORM)
93
+
94
+ ```bash
95
+ nestcraftx new shop-api --full --orm=typeorm --auth --swagger
96
+ ```
97
+
98
+ ### MongoDB API (LIGHT + Mongoose)
99
+
100
+ ```bash
101
+ nestcraftx new mongo-api --light --orm=mongoose --auth
102
+ ```
103
+
104
+ ## Apres Generation
105
+
106
+ ```bash
107
+ cd <nom-projet>
108
+ npm run start:dev
109
+ ```
110
+
111
+ **Swagger disponible :** `http://localhost:3000/api/docs`
112
+
113
+ ## Differences Modes
114
+
115
+ ### Mode LIGHT
116
+
117
+ - Structure plate
118
+ - Controllers → Services → Repositories
119
+ - Demarrage rapide
120
+ - Parfait pour MVPs
121
+
122
+ ### Mode FULL
123
+
124
+ - Clean Architecture complete
125
+ - Domain/Application/Infrastructure/Presentation
126
+ - Use-cases et mappers
127
+ - Ideal pour projets complexes
128
+
129
+ ## Fichier .env Auto-genere
130
+
131
+ Le CLI genere automatiquement :
132
+
133
+ - `JWT_SECRET` (64 chars securises)
134
+ - `JWT_REFRESH_SECRET` (64 chars securises)
135
+ - `DATABASE_URL` (pre-configure)
136
+ - Toutes les variables necessaires
137
+
138
+ ## Documentation Complete
139
+
140
+ - [Guide d'utilisation complet](./CLI_USAGE.md)
141
+ - [Guide de migration](./MIGRATION_GUIDE.md)
142
+ - [Changelog](./CHANGELOG.md)
143
+ - [README](./readme.md)
144
+
145
+ ## Support
146
+
147
+ - GitHub : [NestCraftX](https://github.com/august-dev-pro/NestCraftX)
148
+ - Issues : [Ouvrir une issue](https://github.com/august-dev-pro/NestCraftX/issues)
149
+
150
+ ---
151
+
152
+ **NestCraftX v0.2.5** - Clean Architecture Made Simple
package/QUICK_START.md CHANGED
@@ -1,169 +1,169 @@
1
- # Quick Start - NestCraftX v0.2.4
2
-
3
- ## Installation
4
-
5
- ```bash
6
- npm install -g nestcraftx
7
-
8
- ```
9
-
10
- ## Quick Start
11
-
12
- ### Option 1: LIGHT Mode with flags (Fastest)
13
-
14
- ```bash
15
- nestcraftx new my-api --light --orm=prisma --auth --swagger
16
- cd my-api
17
- npm run start:dev
18
-
19
- ```
20
-
21
- Result: Project generated in seconds with:
22
-
23
- - Simplified MVP Architecture
24
- - Prisma ORM
25
- - JWT Authentication
26
- - Swagger Documentation
27
- - `.env` file with auto-generated secrets
28
-
29
- ### Option 2: Interactive LIGHT Mode
30
-
31
- ```bash
32
- nestcraftx new my-api --light
33
-
34
- ```
35
-
36
- The CLI will ask you questions to:
37
-
38
- - Choose the ORM
39
- - Enable Auth/Swagger/Docker
40
- - Configure the database
41
- - Add entities (optional)
42
-
43
- ### Option 3: Interactive FULL Mode
44
-
45
- ```bash
46
- nestcraftx new my-project
47
-
48
- ```
49
-
50
- Complete configuration with:
51
-
52
- - Clean Architecture + DDD
53
- - Use-cases, mappers, adapters
54
- - Detailed interactive setup
55
- - Entities and relationships
56
-
57
- ---
58
-
59
- ## Essential Commands
60
-
61
- ```bash
62
- # Create a project
63
- nestcraftx new <name> [options]
64
-
65
- # LIGHT Mode
66
- nestcraftx new api --light --orm=prisma
67
-
68
- # FULL Mode
69
- nestcraftx new app --full
70
-
71
- # Check environment
72
- nestcraftx test
73
-
74
- # CLI Info
75
- nestcraftx info
76
-
77
- ```
78
-
79
- ## Main Options
80
-
81
- | Option | Description | Values |
82
- | --------------- | ------------------------------------------------------- | --------------------------------------------- |
83
- | `--light` | Simplified MVP architecture | - |
84
- | `--full` | Complete architecture (default) | - |
85
- | `--orm` | Choice of ORM | `prisma`, `typeorm`, `mongoose (coming soon)` |
86
- | `--auth` | Enables JWT auth | - |
87
- | `--swagger` | Enables Swagger docs | - |
88
- | `--docker` | Generates Docker files | `true` (default), `false` |
89
- | `--interactive` | Force interactive mode for entities/relationships input | - |
90
-
91
- ---
92
-
93
- ## Practical Examples
94
-
95
- ### Blog API (LIGHT + Prisma)
96
-
97
- ```bash
98
- nestcraftx new blog-api --light --orm=prisma --auth --swagger
99
-
100
- ```
101
-
102
- ### E-commerce API (FULL + TypeORM)
103
-
104
- ```bash
105
- nestcraftx new shop-api --full --orm=typeorm --auth --swagger
106
-
107
- ```
108
-
109
- ### MongoDB API (LIGHT + Mongoose)
110
-
111
- ```bash
112
- nestcraftx new mongo-api --light --orm=mongoose --auth
113
-
114
- ```
115
-
116
- ---
117
-
118
- ## After Generation
119
-
120
- ```bash
121
- cd <project-name>
122
- npm run start:dev
123
-
124
- ```
125
-
126
- **Swagger available at:** `http://localhost:3000/api/docs`
127
-
128
- ## Mode Differences
129
-
130
- ### LIGHT Mode
131
-
132
- - Flat structure
133
- - Controllers → Services → Repositories
134
- - Fast startup
135
- - Perfect for MVPs
136
-
137
- ### FULL Mode
138
-
139
- - Complete Clean Architecture
140
- - Domain/Application/Infrastructure/Presentation layers
141
- - Use-cases and mappers
142
- - Ideal for complex projects
143
-
144
- ---
145
-
146
- ## Auto-generated .env File
147
-
148
- The CLI automatically generates:
149
-
150
- - `JWT_SECRET` (64 secure chars)
151
- - `JWT_REFRESH_SECRET` (64 secure chars)
152
- - `DATABASE_URL` (pre-configured)
153
- - All necessary environment variables
154
-
155
- ## Complete Documentation
156
-
157
- - [Full User Guide](https://www.google.com/search?q=./CLI_USAGE.md)
158
- - [Migration Guide](https://www.google.com/search?q=./MIGRATION_GUIDE.md)
159
- - [Changelog](https://www.google.com/search?q=./CHANGELOG.md)
160
- - [README](https://www.google.com/search?q=./readme.md)
161
-
162
- ## Support
163
-
164
- - GitHub: [NestCraftX](https://github.com/august-dev-pro/NestCraftX)
165
- - Issues: [Open an issue](https://github.com/august-dev-pro/NestCraftX/issues)
166
-
167
- ---
168
-
169
- **NestCraftX v0.2.4** - Clean Architecture Made Simple
1
+ # Quick Start - NestCraftX v0.2.5
2
+
3
+ ## Installation
4
+
5
+ ```bash
6
+ npm install -g nestcraftx
7
+
8
+ ```
9
+
10
+ ## Quick Start
11
+
12
+ ### Option 1: LIGHT Mode with flags (Fastest)
13
+
14
+ ```bash
15
+ nestcraftx new my-api --light --orm=prisma --auth --swagger
16
+ cd my-api
17
+ npm run start:dev
18
+
19
+ ```
20
+
21
+ Result: Project generated in seconds with:
22
+
23
+ - Simplified MVP Architecture
24
+ - Prisma ORM
25
+ - JWT Authentication
26
+ - Swagger Documentation
27
+ - `.env` file with auto-generated secrets
28
+
29
+ ### Option 2: Interactive LIGHT Mode
30
+
31
+ ```bash
32
+ nestcraftx new my-api --light
33
+
34
+ ```
35
+
36
+ The CLI will ask you questions to:
37
+
38
+ - Choose the ORM
39
+ - Enable Auth/Swagger/Docker
40
+ - Configure the database
41
+ - Add entities (optional)
42
+
43
+ ### Option 3: Interactive FULL Mode
44
+
45
+ ```bash
46
+ nestcraftx new my-project
47
+
48
+ ```
49
+
50
+ Complete configuration with:
51
+
52
+ - Clean Architecture + DDD
53
+ - Use-cases, mappers, adapters
54
+ - Detailed interactive setup
55
+ - Entities and relationships
56
+
57
+ ---
58
+
59
+ ## Essential Commands
60
+
61
+ ```bash
62
+ # Create a project
63
+ nestcraftx new <name> [options]
64
+
65
+ # LIGHT Mode
66
+ nestcraftx new api --light --orm=prisma
67
+
68
+ # FULL Mode
69
+ nestcraftx new app --full
70
+
71
+ # Check environment
72
+ nestcraftx test
73
+
74
+ # CLI Info
75
+ nestcraftx info
76
+
77
+ ```
78
+
79
+ ## Main Options
80
+
81
+ | Option | Description | Values |
82
+ | --------------- | ------------------------------------------------------- | --------------------------------------------- |
83
+ | `--light` | Simplified MVP architecture | - |
84
+ | `--full` | Complete architecture (default) | - |
85
+ | `--orm` | Choice of ORM | `prisma`, `typeorm`, `mongoose (coming soon)` |
86
+ | `--auth` | Enables JWT auth | - |
87
+ | `--swagger` | Enables Swagger docs | - |
88
+ | `--docker` | Generates Docker files | `true` (default), `false` |
89
+ | `--interactive` | Force interactive mode for entities/relationships input | - |
90
+
91
+ ---
92
+
93
+ ## Practical Examples
94
+
95
+ ### Blog API (LIGHT + Prisma)
96
+
97
+ ```bash
98
+ nestcraftx new blog-api --light --orm=prisma --auth --swagger
99
+
100
+ ```
101
+
102
+ ### E-commerce API (FULL + TypeORM)
103
+
104
+ ```bash
105
+ nestcraftx new shop-api --full --orm=typeorm --auth --swagger
106
+
107
+ ```
108
+
109
+ ### MongoDB API (LIGHT + Mongoose)
110
+
111
+ ```bash
112
+ nestcraftx new mongo-api --light --orm=mongoose --auth
113
+
114
+ ```
115
+
116
+ ---
117
+
118
+ ## After Generation
119
+
120
+ ```bash
121
+ cd <project-name>
122
+ npm run start:dev
123
+
124
+ ```
125
+
126
+ **Swagger available at:** `http://localhost:3000/api/docs`
127
+
128
+ ## Mode Differences
129
+
130
+ ### LIGHT Mode
131
+
132
+ - Flat structure
133
+ - Controllers → Services → Repositories
134
+ - Fast startup
135
+ - Perfect for MVPs
136
+
137
+ ### FULL Mode
138
+
139
+ - Complete Clean Architecture
140
+ - Domain/Application/Infrastructure/Presentation layers
141
+ - Use-cases and mappers
142
+ - Ideal for complex projects
143
+
144
+ ---
145
+
146
+ ## Auto-generated .env File
147
+
148
+ The CLI automatically generates:
149
+
150
+ - `JWT_SECRET` (64 secure chars)
151
+ - `JWT_REFRESH_SECRET` (64 secure chars)
152
+ - `DATABASE_URL` (pre-configured)
153
+ - All necessary environment variables
154
+
155
+ ## Complete Documentation
156
+
157
+ - [Full User Guide](https://www.google.com/search?q=./CLI_USAGE.md)
158
+ - [Migration Guide](https://www.google.com/search?q=./MIGRATION_GUIDE.md)
159
+ - [Changelog](https://www.google.com/search?q=./CHANGELOG.md)
160
+ - [README](https://www.google.com/search?q=./readme.md)
161
+
162
+ ## Support
163
+
164
+ - GitHub: [NestCraftX](https://github.com/august-dev-pro/NestCraftX)
165
+ - Issues: [Open an issue](https://github.com/august-dev-pro/NestCraftX/issues)
166
+
167
+ ---
168
+
169
+ **NestCraftX v0.2.5** - Clean Architecture Made Simple