nestcraftx 0.2.3 → 0.2.4
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.
- package/CHANGELOG.fr.md +2 -2
- package/CHANGELOG.md +2 -2
- package/DEMO.fr.md +2 -2
- package/DEMO.md +2 -2
- package/LICENSE +1 -1
- package/MIGRATION_GUIDE.fr.md +6 -6
- package/MIGRATION_GUIDE.md +6 -6
- package/QUICK_START.fr.md +2 -2
- package/QUICK_START.md +2 -2
- package/README.fr.md +51 -22
- package/bin/nestcraft.js +2 -1
- package/commands/demo.js +36 -29
- package/commands/help.js +1 -78
- package/commands/new.js +9 -9
- package/package.json +1 -1
- package/readme.md +48 -18
- package/utils/configs/setupCleanArchitecture.js +11 -15
- package/utils/configs/setupLightArchitecture.js +49 -98
- package/utils/file-utils/packageJsonUtils.js +6 -0
- package/utils/setups/orms/typeOrmSetup.js +2 -10
- package/utils/setups/setupAuth.js +87 -1
- package/utils/setups/setupLogger.js +29 -23
- package/utils/setups/setupMongoose.js +28 -13
- package/utils/setups/setupPrisma.js +9 -10
- package/utils/systemCheck.js +48 -38
- package/utils/utils.js +30 -102
package/CHANGELOG.fr.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Toutes les modifications notables apportées à NestCraftX seront documentées dans ce fichier.
|
|
4
4
|
|
|
5
|
-
## [0.2.
|
|
5
|
+
## [0.2.4] - 10-01-2026
|
|
6
6
|
|
|
7
7
|
### Ajouté
|
|
8
8
|
|
|
@@ -74,7 +74,7 @@ Toutes les modifications notables apportées à NestCraftX seront documentées d
|
|
|
74
74
|
|
|
75
75
|
## Notes de migration
|
|
76
76
|
|
|
77
|
-
### De 0.1.x à 0.2.
|
|
77
|
+
### De 0.1.x à 0.2.4
|
|
78
78
|
|
|
79
79
|
**Changements non-bloquants** : La version 0.2.x est rétrocompatible.
|
|
80
80
|
|
package/CHANGELOG.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to NestCraftX will be documented in this file.
|
|
4
4
|
|
|
5
|
-
## [0.2.
|
|
5
|
+
## [0.2.4] - 2026-01-10
|
|
6
6
|
|
|
7
7
|
### Added
|
|
8
8
|
|
|
@@ -73,7 +73,7 @@ All notable changes to NestCraftX will be documented in this file.
|
|
|
73
73
|
|
|
74
74
|
## Migration Notes
|
|
75
75
|
|
|
76
|
-
### From 0.1.x to 0.2.
|
|
76
|
+
### From 0.1.x to 0.2.4
|
|
77
77
|
|
|
78
78
|
**Non-breaking changes**: Version 0.2.x is backward compatible.
|
|
79
79
|
|
package/DEMO.fr.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# NestCraftX CLI - Démo du projet `blog-demo` (v0.2.
|
|
1
|
+
# NestCraftX CLI - Démo du projet `blog-demo` (v0.2.4)
|
|
2
2
|
|
|
3
3
|
## Objectif
|
|
4
4
|
|
|
@@ -288,5 +288,5 @@ npm run start:dev
|
|
|
288
288
|
|
|
289
289
|
---
|
|
290
290
|
|
|
291
|
-
**NestCraftX v0.2.
|
|
291
|
+
**NestCraftX v0.2.4** – Clean Architecture Generator for NestJS
|
|
292
292
|
[Documentation complète](https://github.com/august-dev-pro/NestCraftX)
|
package/DEMO.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# NestCraftX CLI - Demo Project `blog-demo` (v0.2.
|
|
1
|
+
# NestCraftX CLI - Demo Project `blog-demo` (v0.2.4)
|
|
2
2
|
|
|
3
3
|
## Objective
|
|
4
4
|
|
|
@@ -290,5 +290,5 @@ npm run start:dev
|
|
|
290
290
|
|
|
291
291
|
---
|
|
292
292
|
|
|
293
|
-
**NestCraftX v0.2.
|
|
293
|
+
**NestCraftX v0.2.4** – Clean Architecture Generator for NestJS
|
|
294
294
|
[Complete Documentation](https://github.com/august-dev-pro/NestCraftX)
|
package/LICENSE
CHANGED
package/MIGRATION_GUIDE.fr.md
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
# Guide de Migration NestCraftX : v0.1.x → v0.2.
|
|
1
|
+
# Guide de Migration NestCraftX : v0.1.x → v0.2.4
|
|
2
2
|
|
|
3
3
|
## Vue d'ensemble
|
|
4
4
|
|
|
5
|
-
La version **0.2.
|
|
5
|
+
La version **0.2.4** marque une étape majeure dans la maturité de NestCraftX. Nous passons d'un simple script de génération à un véritable outil CLI professionnel avec une expérience utilisateur (UX) totalement repensée.
|
|
6
6
|
|
|
7
7
|
**Points clés de la mise à jour :**
|
|
8
8
|
|
|
@@ -20,7 +20,7 @@ La version **0.2.3** marque une étape majeure dans la maturité de NestCraftX.
|
|
|
20
20
|
Bien que le mode interactif reste accessible pour la compatibilité, la commande sémantique recommandée est désormais `new`.
|
|
21
21
|
|
|
22
22
|
- **Ancien (v0.1.x) :** `nestcraftx start`
|
|
23
|
-
- **Nouveau (v0.2.
|
|
23
|
+
- **Nouveau (v0.2.4) :** `nestcraftx new mon-projet`
|
|
24
24
|
|
|
25
25
|
### Nouveaux Flags Professionnels
|
|
26
26
|
|
|
@@ -54,7 +54,7 @@ C'est l'architecture robuste de la v0.1.x, mais affinée. Les services sont main
|
|
|
54
54
|
|
|
55
55
|
---
|
|
56
56
|
|
|
57
|
-
## 3. Gestionnaire de Paquets (Nouveauté v0.2.
|
|
57
|
+
## 3. Gestionnaire de Paquets (Nouveauté v0.2.4)
|
|
58
58
|
|
|
59
59
|
Le flag `--pm` (ou `--packageManager`) vous permet de définir votre outil favori. Si vous ne le spécifiez pas, le CLI vous proposera une liste de choix interactive.
|
|
60
60
|
|
|
@@ -71,7 +71,7 @@ Le flag `--pm` (ou `--packageManager`) vous permet de définir votre outil favor
|
|
|
71
71
|
Le système de génération de secrets a été renforcé pour utiliser des algorithmes cryptographiques plus sûrs.
|
|
72
72
|
|
|
73
73
|
**Ancien comportement :** Saisie manuelle ou secrets courts.
|
|
74
|
-
**Nouveau comportement (v0.2.
|
|
74
|
+
**Nouveau comportement (v0.2.4) :** - `JWT_SECRET` : 64 caractères hexadécimaux uniques.
|
|
75
75
|
|
|
76
76
|
- `DATABASE_URL` : Auto-construit selon l'ORM choisi (Prisma/TypeORM/Mongoose).
|
|
77
77
|
|
|
@@ -124,4 +124,4 @@ Seriez-vous intéressé par un script d'automatisation pour mettre à jour vos v
|
|
|
124
124
|
|
|
125
125
|
---
|
|
126
126
|
|
|
127
|
-
**NestCraftX v0.2.
|
|
127
|
+
**NestCraftX v0.2.4** — _Clean Architecture Made Simple._ [Accéder au Dépôt GitHub](https://github.com/august-dev-pro/NestCraftX)
|
package/MIGRATION_GUIDE.md
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
# NestCraftX Migration Guide: v0.1.x → v0.2.
|
|
1
|
+
# NestCraftX Migration Guide: v0.1.x → v0.2.4
|
|
2
2
|
|
|
3
3
|
## Overview
|
|
4
4
|
|
|
5
|
-
Version **0.2.
|
|
5
|
+
Version **0.2.4** marks a major milestone in NestCraftX's maturity. We are moving from a simple generation script to a truly professional CLI tool with a completely redesigned User Experience (UX).
|
|
6
6
|
|
|
7
7
|
**Update Key Points:**
|
|
8
8
|
|
|
@@ -20,7 +20,7 @@ Version **0.2.3** marks a major milestone in NestCraftX's maturity. We are movin
|
|
|
20
20
|
While interactive mode remains accessible for compatibility, the recommended semantic command is now `new`.
|
|
21
21
|
|
|
22
22
|
- **Old (v0.1.x):** `nestcraftx start`
|
|
23
|
-
- **New (v0.2.
|
|
23
|
+
- **New (v0.2.4):** `nestcraftx new my-project`
|
|
24
24
|
|
|
25
25
|
### New Professional Flags
|
|
26
26
|
|
|
@@ -54,7 +54,7 @@ This is the robust architecture from v0.1.x, but refined. Services are now isola
|
|
|
54
54
|
|
|
55
55
|
---
|
|
56
56
|
|
|
57
|
-
## 3. Package Manager (New in v0.2.
|
|
57
|
+
## 3. Package Manager (New in v0.2.4)
|
|
58
58
|
|
|
59
59
|
The `--pm` (or `--packageManager`) flag allows you to define your favorite tool. If you don't specify it, the CLI will provide an interactive list of choices.
|
|
60
60
|
|
|
@@ -71,7 +71,7 @@ The `--pm` (or `--packageManager`) flag allows you to define your favorite tool.
|
|
|
71
71
|
The secret generation system has been strengthened to use more secure cryptographic algorithms.
|
|
72
72
|
|
|
73
73
|
**Old behavior:** Manual input or short secrets.
|
|
74
|
-
**New behavior (v0.2.
|
|
74
|
+
**New behavior (v0.2.4):** - `JWT_SECRET`: 64 unique hexadecimal characters.
|
|
75
75
|
|
|
76
76
|
- `DATABASE_URL`: Auto-built based on the chosen ORM (Prisma/TypeORM/Mongoose).
|
|
77
77
|
|
|
@@ -121,4 +121,4 @@ Would you be interested in an automation script to update your environment varia
|
|
|
121
121
|
|
|
122
122
|
---
|
|
123
123
|
|
|
124
|
-
**NestCraftX v0.2.
|
|
124
|
+
**NestCraftX v0.2.4** — _Clean Architecture Made Simple._ [Access the GitHub Repository](https://github.com/august-dev-pro/NestCraftX)
|
package/QUICK_START.fr.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Quick Start - NestCraftX v0.2.
|
|
1
|
+
# Quick Start - NestCraftX v0.2.4
|
|
2
2
|
|
|
3
3
|
## Installation
|
|
4
4
|
|
|
@@ -149,4 +149,4 @@ Le CLI genere automatiquement :
|
|
|
149
149
|
|
|
150
150
|
---
|
|
151
151
|
|
|
152
|
-
**NestCraftX v0.2.
|
|
152
|
+
**NestCraftX v0.2.4** - Clean Architecture Made Simple
|
package/QUICK_START.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Quick Start - NestCraftX v0.2.
|
|
1
|
+
# Quick Start - NestCraftX v0.2.4
|
|
2
2
|
|
|
3
3
|
## Installation
|
|
4
4
|
|
|
@@ -166,4 +166,4 @@ The CLI automatically generates:
|
|
|
166
166
|
|
|
167
167
|
---
|
|
168
168
|
|
|
169
|
-
**NestCraftX v0.2.
|
|
169
|
+
**NestCraftX v0.2.4** - Clean Architecture Made Simple
|
package/README.fr.md
CHANGED
|
@@ -3,17 +3,41 @@
|
|
|
3
3
|
demo
|
|
4
4
|

|
|
5
5
|

|
|
6
|
-

|
|
7
7
|
|
|
8
|
-
**NestCraftX** est un CLI Node.js moderne et puissant pour generer automatiquement des projets NestJS avec une architecture propre
|
|
8
|
+
**NestCraftX** est un CLI Node.js moderne et puissant pour generer automatiquement des projets NestJS et leur contenu avec une architecture propre, maintenable et prête pour la production.
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
Il échafaude tout ce dont vous avez besoin pour commencer :
|
|
11
|
+
|
|
12
|
+
- Modules, Contrôleurs & Services (Entièrement typés)
|
|
13
|
+
|
|
14
|
+
- Repositories & Mappers (Pour un flux de données propre)
|
|
15
|
+
|
|
16
|
+
- DTOs (Prêts pour la validation)
|
|
17
|
+
|
|
18
|
+
- Entités / Schémas (Prisma, TypeORM, ou Mongoose)
|
|
19
|
+
|
|
20
|
+
- Authentification (JWT avec Refresh Tokens & secrets auto-générés)
|
|
21
|
+
|
|
22
|
+
- Prêt pour le DevOps (Docker, Docker-Compose & Swagger UI)
|
|
23
|
+
|
|
24
|
+
Il implemente les meilleures pratiques modernes : **Clean Architecture**, **Domain-Driven Design (DDD)**, **Prisma/TypeORM/Mongoose**, **JWT Auth avec secrets auto-generes**, **Swagger**, **Docker**, et plus encore.
|
|
25
|
+
|
|
26
|
+
Fonctionnalités Clés :
|
|
27
|
+
|
|
28
|
+
- **Dual-Architecture** : Choisissez entre une structure Light (idéale pour les MVP) ou Full (basée sur la Clean Architecture / DDD).
|
|
29
|
+
|
|
30
|
+
- **Relations Interactives** : Définissez vos relations 1-N ou N-N directement dans le terminal via un prompt interactif.
|
|
31
|
+
|
|
32
|
+
- **Configuration Intelligente** : Décorateurs Swagger automatisés, fichiers Docker initialisés, fichiers .env auto-documentés et connexions aux bases de données pré-configurées.
|
|
33
|
+
|
|
34
|
+
> Version 0.2.4 : Amélioration majeure - Démo interactif avec flags, Authentification integré, templates professionnels (gitignore, README), code propre et maintenir par la communauté !
|
|
11
35
|
|
|
12
36
|
---
|
|
13
37
|
|
|
14
38
|
## Sommaire
|
|
15
39
|
|
|
16
|
-
- [Nouveautes v0.2.
|
|
40
|
+
- [Nouveautes v0.2.4](#nouveautes-v023)
|
|
17
41
|
- [Objectif du projet](#objectif-du-projet)
|
|
18
42
|
- [Prérequis](#prérequis)
|
|
19
43
|
- [Installation](#installation)
|
|
@@ -28,7 +52,7 @@ demo
|
|
|
28
52
|
|
|
29
53
|
---
|
|
30
54
|
|
|
31
|
-
## Nouveautes v0.2.
|
|
55
|
+
## Nouveautes v0.2.4
|
|
32
56
|
|
|
33
57
|
### Deux Modes d'Architecture
|
|
34
58
|
|
|
@@ -543,28 +567,33 @@ open http://localhost:3000/api/docs
|
|
|
543
567
|
|
|
544
568
|
## Roadmap
|
|
545
569
|
|
|
546
|
-
### Version 0.
|
|
570
|
+
### Version 0.2.x (Objectif Actuel)
|
|
571
|
+
|
|
572
|
+
- [x] Moteurs d'architecture Light & Full.
|
|
573
|
+
|
|
574
|
+
- [x] Prompts interactifs avec Inquirer.js.
|
|
575
|
+
|
|
576
|
+
- [ ] Stabilité : Tests approfondis et stabilisation des intégrations Mongoose et TypeORM.
|
|
577
|
+
|
|
578
|
+
### Version 0.3.0 (Expansion)
|
|
579
|
+
|
|
580
|
+
- [ ] Nouvelles bases de données : Support complet pour MySQL et SQLite.
|
|
581
|
+
|
|
582
|
+
- [ ] Scaffolding : Commande `generate` pour ajouter des modules/entités à un projet existant.
|
|
547
583
|
|
|
548
|
-
- [ ]
|
|
549
|
-
- [ ] Support MySQL et SQLite
|
|
550
|
-
- [ ] Génération de tests unitaires automatiques
|
|
551
|
-
- [ ] Templates de CI/CD (GitHub Actions, GitLab CI)
|
|
552
|
-
- [ ] Support GraphQL
|
|
584
|
+
- [ ] Tests : Génération automatique des tests unitaires pour les services et contrôleurs.
|
|
553
585
|
|
|
554
|
-
### Version 0.
|
|
586
|
+
### Version 0.5.0 (Fonctionnalités Avancées)
|
|
555
587
|
|
|
556
|
-
- [ ]
|
|
557
|
-
- [ ]
|
|
558
|
-
- [ ]
|
|
559
|
-
- [ ] Intégration Redis
|
|
560
|
-
- [ ] WebSocket support
|
|
588
|
+
- [ ] Intégration Redis : Choix de la gestion de session (Redis, Map (dev), ou registre DB).
|
|
589
|
+
- [ ] CI/CD : Templates prêts à l'emploi pour GitHub Actions et GitLab CI.
|
|
590
|
+
- [ ] Seeding : Génération avancée de scripts de "seeding" pour la base de données.
|
|
561
591
|
|
|
562
592
|
### Version 1.0.0
|
|
563
593
|
|
|
564
|
-
- [ ]
|
|
565
|
-
- [ ]
|
|
566
|
-
- [ ]
|
|
567
|
-
- [ ] CLI plugins system
|
|
594
|
+
- [ ] Microservices : Support pour les applications hybrides et les microservices.
|
|
595
|
+
- [ ] Interface Web : Interface visuelle optionnelle pour configurer vos projets.
|
|
596
|
+
- [ ] Communauté : Site de documentation officiel et système de plugins.
|
|
568
597
|
|
|
569
598
|
---
|
|
570
599
|
|
|
@@ -621,7 +650,7 @@ Merci à tous les contributeurs et à la communauté NestJS !
|
|
|
621
650
|
|
|
622
651
|
---
|
|
623
652
|
|
|
624
|
-
**NestCraftX v0.2.
|
|
653
|
+
**NestCraftX v0.2.4** - Clean Architecture Made Simple
|
|
625
654
|
|
|
626
655
|
Pour plus d'informations:
|
|
627
656
|
|
package/bin/nestcraft.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
1
|
+
#!/usr/bin/env node
|
|
2
2
|
const { execSync } = require("child_process");
|
|
3
3
|
const { parseCliArgs } = require("../utils/cliParser");
|
|
4
4
|
|
|
@@ -51,6 +51,7 @@ switch (command) {
|
|
|
51
51
|
|
|
52
52
|
case "--version":
|
|
53
53
|
case "-v":
|
|
54
|
+
case "version":
|
|
54
55
|
const pkg = require("../package.json");
|
|
55
56
|
console.log("NestCraftX v" + pkg.version);
|
|
56
57
|
break;
|
package/commands/demo.js
CHANGED
|
@@ -13,12 +13,14 @@ const { setupSwagger } = require("../utils/setups/setupSwagger");
|
|
|
13
13
|
const { setupDatabase } = require("../utils/setups/setupDatabase");
|
|
14
14
|
const { configureDocker } = require("../utils/configs/configureDocker");
|
|
15
15
|
const { generateEnvFile, writeEnvFile } = require("../utils/envGenerator");
|
|
16
|
+
const { setupBootstrapLogger } = require("../utils/setups/setupLogger");
|
|
16
17
|
const actualInquirer = inquirer.default || inquirer;
|
|
17
18
|
|
|
18
19
|
async function demoCommand(flags = {}) {
|
|
19
20
|
console.log("\n🎯 Generating demonstration project...\n");
|
|
20
|
-
logInfo('Configuring "blog-demo" project');
|
|
21
|
+
logInfo('Configuring "blog-demo" project');
|
|
21
22
|
|
|
23
|
+
// Prépare les questions à poser uniquement si le flag n'est pas passé
|
|
22
24
|
const questions = [];
|
|
23
25
|
if (flags.light === undefined) {
|
|
24
26
|
questions.push({
|
|
@@ -78,11 +80,13 @@ async function demoCommand(flags = {}) {
|
|
|
78
80
|
],
|
|
79
81
|
default: "npm",
|
|
80
82
|
});
|
|
81
|
-
}
|
|
83
|
+
}
|
|
82
84
|
|
|
85
|
+
// Pose uniquement les questions nécessaires
|
|
83
86
|
const answers =
|
|
84
|
-
questions.length > 0 ? await actualInquirer.prompt(questions) : {};
|
|
87
|
+
questions.length > 0 ? await actualInquirer.prompt(questions) : {};
|
|
85
88
|
|
|
89
|
+
// Fusionne les réponses interactives et les flags (flags prioritaire)
|
|
86
90
|
const options = { ...answers, ...flags };
|
|
87
91
|
const packageManager = options.packageManager || "npm";
|
|
88
92
|
const isLight = !!options.light;
|
|
@@ -218,6 +222,8 @@ async function demoCommand(flags = {}) {
|
|
|
218
222
|
|
|
219
223
|
if (useSwagger) {
|
|
220
224
|
await setupSwagger(demoInputs.swaggerInputs);
|
|
225
|
+
} else {
|
|
226
|
+
await setupBootstrapLogger();
|
|
221
227
|
}
|
|
222
228
|
|
|
223
229
|
if (useDocker) {
|
|
@@ -230,10 +236,10 @@ async function demoCommand(flags = {}) {
|
|
|
230
236
|
writeEnvFile(envContent);
|
|
231
237
|
|
|
232
238
|
console.log("\n" + "=".repeat(60));
|
|
233
|
-
logSuccess("
|
|
239
|
+
logSuccess("Demonstration project created successfully!");
|
|
234
240
|
console.log("=".repeat(60));
|
|
235
241
|
|
|
236
|
-
console.log('\
|
|
242
|
+
console.log('\nProject "blog-demo" configured with:');
|
|
237
243
|
console.log(" ✅ 3 Entities: User, Post, Comment");
|
|
238
244
|
console.log(" ✅ Entity Relationships");
|
|
239
245
|
if (useAuth) console.log(" ✅ Integrated JWT Auth");
|
|
@@ -253,34 +259,35 @@ async function demoCommand(flags = {}) {
|
|
|
253
259
|
);
|
|
254
260
|
|
|
255
261
|
console.log("\n🚀 To get started:");
|
|
256
|
-
console.log("
|
|
262
|
+
console.log(" 1- cd blog-demo");
|
|
263
|
+
|
|
264
|
+
// Instructions spécifiques selon le moteur choisi
|
|
265
|
+
const pm = demoInputs.packageManager;
|
|
266
|
+
const run = pm === "yarn" ? "" : "run "; // yarn n'a pas besoin de 'run'
|
|
257
267
|
if (orm === "prisma" || orm === "typeorm") {
|
|
258
268
|
console.log(
|
|
259
|
-
"\n 2
|
|
269
|
+
"\n 2- Create a PostgreSQL database with the name specified in the .env (default 'blog_demo')."
|
|
260
270
|
);
|
|
261
|
-
console.log(" Example (psql) :");
|
|
262
|
-
console.log(" createdb blog_demo");
|
|
271
|
+
console.log(" Example (psql) : createdb blog_demo");
|
|
263
272
|
console.log(
|
|
264
|
-
"\n 3
|
|
273
|
+
"\n 3- Open the generated .env file and replace the values with your actual connection details:"
|
|
265
274
|
);
|
|
266
|
-
console.log("
|
|
267
|
-
console.log("
|
|
268
|
-
console.log("
|
|
269
|
-
console.log("
|
|
270
|
-
console.log("
|
|
271
|
-
console.log("\n 4
|
|
275
|
+
console.log(" POSTGRES_USER=<your_user>");
|
|
276
|
+
console.log(" POSTGRES_PASSWORD=<your_password>");
|
|
277
|
+
console.log(" POSTGRES_DB=blog_demo");
|
|
278
|
+
console.log(" POSTGRES_HOST=localhost");
|
|
279
|
+
console.log(" POSTGRES_PORT=5432");
|
|
280
|
+
console.log("\n 4- Run migrations and seeds:");
|
|
272
281
|
if (orm === "prisma") {
|
|
273
|
-
console.log(`
|
|
274
|
-
console.log(`
|
|
275
|
-
console.log(`
|
|
282
|
+
console.log(` npx prisma migrate reset`);
|
|
283
|
+
console.log(` npx prisma migrate dev`);
|
|
284
|
+
console.log(` npx prisma db seed`);
|
|
276
285
|
} else {
|
|
277
|
-
console.log(
|
|
278
|
-
|
|
279
|
-
);
|
|
280
|
-
console.log(` ${demoInputs.packageManager} run typeorm:seed`);
|
|
286
|
+
console.log(` ${pm} ${run}typeorm:migration:run`);
|
|
287
|
+
console.log(` ${pm} ${run}typeorm:seed`);
|
|
281
288
|
}
|
|
282
289
|
} else if (orm === "mongoose") {
|
|
283
|
-
console.log("\n 2
|
|
290
|
+
console.log("\n 2- MongoDB: You can use either a local server or Docker.");
|
|
284
291
|
console.log(
|
|
285
292
|
" By default, the project uses: MONGO_URI=mongodb://localhost:27017/blog_demo"
|
|
286
293
|
);
|
|
@@ -288,19 +295,19 @@ async function demoCommand(flags = {}) {
|
|
|
288
295
|
" The database will be created automatically upon first write operation."
|
|
289
296
|
);
|
|
290
297
|
console.log(
|
|
291
|
-
"\n 3
|
|
298
|
+
"\n 3- Open the generated .env file and replace the MONGO_URI variable if necessary:"
|
|
292
299
|
);
|
|
293
300
|
console.log(
|
|
294
301
|
" MONGO_URI=mongodb://<user>:<password>@localhost:27017/blog_demo"
|
|
295
302
|
);
|
|
296
|
-
console.log("\n 4
|
|
297
|
-
console.log(`
|
|
303
|
+
console.log("\n 4- Run the seed script (if present):");
|
|
304
|
+
console.log(` ${pm} ${run}seed`);
|
|
298
305
|
}
|
|
299
306
|
|
|
300
|
-
console.log("\n 5
|
|
307
|
+
console.log("\n 5- Run the project:");
|
|
301
308
|
console.log(` ${demoInputs.packageManager} run start:dev`);
|
|
302
309
|
if (useSwagger)
|
|
303
|
-
console.log(" 6
|
|
310
|
+
console.log(" 6- Open Swagger UI : http://localhost:3000/api/docs");
|
|
304
311
|
|
|
305
312
|
console.log("\n📚 Main Endpoints:");
|
|
306
313
|
if (useAuth) {
|
package/commands/help.js
CHANGED
|
@@ -1,85 +1,8 @@
|
|
|
1
|
-
/* async function helpCommand() {
|
|
2
|
-
console.log(`
|
|
3
|
-
╔═══════════════════════════════════════════════════════════╗
|
|
4
|
-
║ ║
|
|
5
|
-
║ 🌟 NestCraftX CLI v0.2.2 🌟 ║
|
|
6
|
-
║ Clean Architecture Generator for NestJS ║
|
|
7
|
-
║ ║
|
|
8
|
-
╚═══════════════════════════════════════════════════════════╝
|
|
9
|
-
|
|
10
|
-
📦 COMMANDES PRINCIPALES:
|
|
11
|
-
|
|
12
|
-
nestcraftx new <project-name> [options]
|
|
13
|
-
Crée un nouveau projet NestJS avec Clean Architecture
|
|
14
|
-
|
|
15
|
-
Options:
|
|
16
|
-
--light Mode rapide (configuration minimale)
|
|
17
|
-
--orm <name> Choisir l'ORM (prisma|typeorm|mongoose)
|
|
18
|
-
--auth Ajouter l'authentification JWT
|
|
19
|
-
--swagger Ajouter Swagger UI
|
|
20
|
-
--docker Générer les fichiers Docker
|
|
21
|
-
|
|
22
|
-
Exemples:
|
|
23
|
-
nestcraftx new my-app
|
|
24
|
-
nestcraftx new blog-api --light --orm prisma --auth --swagger
|
|
25
|
-
nestcraftx new shop --orm typeorm --auth
|
|
26
|
-
|
|
27
|
-
nestcraftx demo [options]
|
|
28
|
-
Génère un projet de démonstration complet (blog avec users, posts, comments)
|
|
29
|
-
Options:
|
|
30
|
-
--light Mode MVP simplifié
|
|
31
|
-
--docker Ajoute Docker
|
|
32
|
-
--auth Ajoute Auth JWT
|
|
33
|
-
--swagger Ajoute Swagger UI
|
|
34
|
-
|
|
35
|
-
nestcraftx test
|
|
36
|
-
Vérifie l'environnement système (Node, npm, Nest CLI, Docker, etc.)
|
|
37
|
-
|
|
38
|
-
nestcraftx info
|
|
39
|
-
Affiche les informations sur le CLI et les fonctionnalités
|
|
40
|
-
|
|
41
|
-
nestcraftx start
|
|
42
|
-
Lance le générateur interactif (mode legacy)
|
|
43
|
-
|
|
44
|
-
📚 AUTRES COMMANDES:
|
|
45
|
-
|
|
46
|
-
nestcraftx --version, -v Version du CLI
|
|
47
|
-
nestcraftx --help, -h Affiche cette aide
|
|
48
|
-
|
|
49
|
-
🎯 MODES:
|
|
50
|
-
|
|
51
|
-
Light Mode - Configuration rapide pour POCs et petits projets
|
|
52
|
-
Full Mode - Configuration complète avec toutes les options
|
|
53
|
-
|
|
54
|
-
🛠️ ORMS SUPPORTÉS:
|
|
55
|
-
|
|
56
|
-
• Prisma - ORM moderne et type-safe (recommandé)
|
|
57
|
-
• TypeORM - ORM complet avec decorateurs
|
|
58
|
-
• Mongoose - ODM pour MongoDB
|
|
59
|
-
|
|
60
|
-
✨ FONCTIONNALITÉS:
|
|
61
|
-
|
|
62
|
-
✅ Clean Architecture avec DDD
|
|
63
|
-
✅ Repository Pattern & Use Cases
|
|
64
|
-
✅ Auth JWT intégrée
|
|
65
|
-
✅ Documentation Swagger automatique
|
|
66
|
-
✅ Docker & Docker Compose
|
|
67
|
-
✅ Génération d'entités et relations
|
|
68
|
-
✅ Validation automatique des DTOs
|
|
69
|
-
✅ Logging structuré
|
|
70
|
-
|
|
71
|
-
📖 Documentation complète:
|
|
72
|
-
https://github.com/august-dev-pro/NestCraftX
|
|
73
|
-
|
|
74
|
-
💬 Besoin d'aide? Ouvre une issue sur GitHub!
|
|
75
|
-
`);
|
|
76
|
-
} */
|
|
77
|
-
|
|
78
1
|
async function helpCommand() {
|
|
79
2
|
console.log(`
|
|
80
3
|
╔═══════════════════════════════════════════════════════════╗
|
|
81
4
|
║ ║
|
|
82
|
-
║ 🌟 NestCraftX CLI v0.2.
|
|
5
|
+
║ 🌟 NestCraftX CLI v0.2.4 🌟 ║
|
|
83
6
|
║ Clean Architecture Generator for NestJS ║
|
|
84
7
|
║ ║
|
|
85
8
|
╚═══════════════════════════════════════════════════════════╝
|
package/commands/new.js
CHANGED
|
@@ -25,7 +25,7 @@ async function newCommand(projectName, flags = {}) {
|
|
|
25
25
|
console.log("\n Welcome to NestCraftX CLI \n");
|
|
26
26
|
|
|
27
27
|
let currentProjectName = "";
|
|
28
|
-
let isValid = false;
|
|
28
|
+
let isValid = false;
|
|
29
29
|
|
|
30
30
|
currentProjectName = readline.question(
|
|
31
31
|
`${info("[?]")} Project name [my-app] : `
|
|
@@ -238,8 +238,6 @@ function buildFullModeFromFlags(projectName, flags) {
|
|
|
238
238
|
return inputs;
|
|
239
239
|
}
|
|
240
240
|
|
|
241
|
-
// L'ancienne version buildFullModeInputs n'était pas utilisée et a été mise à jour/simplifiée.
|
|
242
|
-
|
|
243
241
|
async function executeProjectSetup(inputs) {
|
|
244
242
|
try {
|
|
245
243
|
logInfo("Starting project generation...");
|
|
@@ -269,7 +267,7 @@ async function executeProjectSetup(inputs) {
|
|
|
269
267
|
|
|
270
268
|
printSuccessSummary(inputs);
|
|
271
269
|
} catch (error) {
|
|
272
|
-
//
|
|
270
|
+
// Erreur lors de la creation du projet: ${error.message}
|
|
273
271
|
logError(`Error during project creation: ${error.message}`);
|
|
274
272
|
throw error;
|
|
275
273
|
}
|
|
@@ -291,8 +289,9 @@ function printSuccessSummary(inputs) {
|
|
|
291
289
|
console.log(` Entities: ${inputs.entitiesData.entities.length}`);
|
|
292
290
|
|
|
293
291
|
console.log("\n🚀 Next Steps:");
|
|
294
|
-
console.log(` 1. cd ${inputs.projectName}`);
|
|
292
|
+
console.log(` 1. cd ${inputs.projectName}`);
|
|
295
293
|
|
|
294
|
+
// --- SPECIFIC ORM/DB INSTRUCTIONS ---
|
|
296
295
|
if (inputs.dbConfig.orm === "prisma" || inputs.dbConfig.orm === "typeorm") {
|
|
297
296
|
// Instructions for PostgreSQL (Prisma and TypeORM)
|
|
298
297
|
console.log("\n 2. Create an empty PostgreSQL database.");
|
|
@@ -318,17 +317,18 @@ function printSuccessSummary(inputs) {
|
|
|
318
317
|
|
|
319
318
|
console.log("\n 4. Run the project:");
|
|
320
319
|
console.log(` - ${inputs.packageManager} run start:dev`);
|
|
321
|
-
}
|
|
320
|
+
}
|
|
322
321
|
|
|
322
|
+
// --- ENDPOINTS / SWAGGER ---
|
|
323
323
|
if (inputs.useSwagger) {
|
|
324
324
|
console.log(
|
|
325
325
|
` 6. Open Swagger UI : http://localhost:3000/${inputs.swaggerInputs.endpoint}`
|
|
326
326
|
);
|
|
327
327
|
}
|
|
328
328
|
|
|
329
|
-
console.log("\nUseful commands:");
|
|
330
|
-
console.log(" - nestcraftx test Check environment");
|
|
331
|
-
console.log(" - nestcraftx info CLI information");
|
|
329
|
+
console.log("\nUseful commands:");
|
|
330
|
+
console.log(" - nestcraftx test Check environment");
|
|
331
|
+
console.log(" - nestcraftx info CLI information");
|
|
332
332
|
console.log(" - nestcraftx --help Complete help\n");
|
|
333
333
|
}
|
|
334
334
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nestcraftx",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.4",
|
|
4
4
|
"description": "Modern CLI to generate scalable NestJS projects with Clean Architecture (FULL) and MVP mode (LIGHT) - Enhanced with auto-generated .env secrets, complete ORM support, and entity relations",
|
|
5
5
|
"main": "bin/nestcraft.js",
|
|
6
6
|
"bin": {
|