create-nexu 1.0.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 (73) hide show
  1. package/README.md +149 -0
  2. package/dist/index.d.ts +2 -0
  3. package/dist/index.js +603 -0
  4. package/package.json +41 -0
  5. package/templates/default/.changeset/config.json +11 -0
  6. package/templates/default/.eslintignore +13 -0
  7. package/templates/default/.eslintrc.js +66 -0
  8. package/templates/default/.github/actions/quality/action.yml +53 -0
  9. package/templates/default/.github/dependabot.yml +51 -0
  10. package/templates/default/.github/workflows/deploy-dev.yml +83 -0
  11. package/templates/default/.github/workflows/deploy-prod.yml +83 -0
  12. package/templates/default/.github/workflows/deploy-rec.yml +83 -0
  13. package/templates/default/.husky/commit-msg +1 -0
  14. package/templates/default/.husky/pre-commit +1 -0
  15. package/templates/default/.prettierignore +7 -0
  16. package/templates/default/.prettierrc +19 -0
  17. package/templates/default/.vscode/extensions.json +14 -0
  18. package/templates/default/.vscode/settings.json +36 -0
  19. package/templates/default/apps/.gitkeep +0 -0
  20. package/templates/default/commitlint.config.js +26 -0
  21. package/templates/default/docker/docker-compose.dev.yml +49 -0
  22. package/templates/default/docker/docker-compose.prod.yml +64 -0
  23. package/templates/default/docker/docker-compose.yml +5 -0
  24. package/templates/default/package.json +56 -0
  25. package/templates/default/packages/cache/package.json +26 -0
  26. package/templates/default/packages/cache/src/index.ts +137 -0
  27. package/templates/default/packages/cache/tsconfig.json +9 -0
  28. package/templates/default/packages/cache/tsup.config.ts +9 -0
  29. package/templates/default/packages/config/eslint/index.js +20 -0
  30. package/templates/default/packages/config/package.json +9 -0
  31. package/templates/default/packages/config/typescript/base.json +26 -0
  32. package/templates/default/packages/constants/package.json +26 -0
  33. package/templates/default/packages/constants/src/index.ts +121 -0
  34. package/templates/default/packages/constants/tsconfig.json +9 -0
  35. package/templates/default/packages/constants/tsup.config.ts +9 -0
  36. package/templates/default/packages/logger/package.json +27 -0
  37. package/templates/default/packages/logger/src/index.ts +197 -0
  38. package/templates/default/packages/logger/tsconfig.json +11 -0
  39. package/templates/default/packages/logger/tsup.config.ts +9 -0
  40. package/templates/default/packages/result/package.json +26 -0
  41. package/templates/default/packages/result/src/index.ts +142 -0
  42. package/templates/default/packages/result/tsconfig.json +9 -0
  43. package/templates/default/packages/result/tsup.config.ts +9 -0
  44. package/templates/default/packages/types/package.json +26 -0
  45. package/templates/default/packages/types/src/index.ts +78 -0
  46. package/templates/default/packages/types/tsconfig.json +9 -0
  47. package/templates/default/packages/types/tsup.config.ts +10 -0
  48. package/templates/default/packages/ui/package.json +38 -0
  49. package/templates/default/packages/ui/src/components/Button.tsx +65 -0
  50. package/templates/default/packages/ui/src/components/Card.tsx +90 -0
  51. package/templates/default/packages/ui/src/components/Input.tsx +51 -0
  52. package/templates/default/packages/ui/src/index.ts +15 -0
  53. package/templates/default/packages/ui/tsconfig.json +11 -0
  54. package/templates/default/packages/ui/tsup.config.ts +11 -0
  55. package/templates/default/packages/utils/package.json +30 -0
  56. package/templates/default/packages/utils/src/index.test.ts +130 -0
  57. package/templates/default/packages/utils/src/index.ts +154 -0
  58. package/templates/default/packages/utils/tsconfig.json +10 -0
  59. package/templates/default/packages/utils/tsup.config.ts +10 -0
  60. package/templates/default/pnpm-workspace.yaml +3 -0
  61. package/templates/default/scripts/deploy.sh +25 -0
  62. package/templates/default/scripts/generate-app.sh +166 -0
  63. package/templates/default/scripts/publish-cli.sh +54 -0
  64. package/templates/default/scripts/setup.sh +70 -0
  65. package/templates/default/services/.env.example +16 -0
  66. package/templates/default/services/docker-compose.yml +207 -0
  67. package/templates/default/services/grafana/provisioning/dashboards/dashboards.yml +11 -0
  68. package/templates/default/services/grafana/provisioning/datasources/datasources.yml +9 -0
  69. package/templates/default/services/postgres/init/.gitkeep +2 -0
  70. package/templates/default/services/prometheus/prometheus.yml +13 -0
  71. package/templates/default/tsconfig.json +27 -0
  72. package/templates/default/turbo.json +40 -0
  73. package/templates/default/vitest.config.ts +15 -0
package/README.md ADDED
@@ -0,0 +1,149 @@
1
+ # create-nexu
2
+
3
+ CLI pour créer et mettre à jour des projets Nexu monorepo.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ # Pas besoin d'installer, utiliser directement avec npx
9
+ npx create-nexu init my-project
10
+
11
+ # Ou installer globalement
12
+ npm install -g create-nexu
13
+ ```
14
+
15
+ ## Commandes
16
+
17
+ ### `create-nexu init [project-name]`
18
+
19
+ Crée un nouveau projet Nexu monorepo.
20
+
21
+ ```bash
22
+ # Interactif
23
+ npx create-nexu init
24
+
25
+ # Avec nom de projet
26
+ npx create-nexu init my-app
27
+
28
+ # Options
29
+ npx create-nexu init my-app --skip-install # Ne pas installer les dépendances
30
+ npx create-nexu init my-app --skip-git # Ne pas initialiser git
31
+ ```
32
+
33
+ Le wizard interactif permet de:
34
+
35
+ - Choisir les packages à inclure
36
+ - Sélectionner les fonctionnalités (services Docker, workflows, etc.)
37
+
38
+ ### `create-nexu update`
39
+
40
+ Met à jour un projet existant avec les dernières fonctionnalités.
41
+
42
+ ```bash
43
+ # Mettre à jour tout
44
+ npx create-nexu update
45
+
46
+ # Mettre à jour seulement les packages
47
+ npx create-nexu update --packages
48
+
49
+ # Mettre à jour seulement les configs
50
+ npx create-nexu update --config
51
+
52
+ # Mettre à jour seulement les workflows
53
+ npx create-nexu update --workflows
54
+
55
+ # Mettre à jour seulement les services Docker
56
+ npx create-nexu update --services
57
+
58
+ # Voir ce qui serait mis à jour sans faire de changements
59
+ npx create-nexu update --dry-run
60
+ ```
61
+
62
+ ### `create-nexu add <component>`
63
+
64
+ Ajoute un composant à un projet existant.
65
+
66
+ ```bash
67
+ # Ajouter un package
68
+ npx create-nexu add package
69
+ npx create-nexu add package --name logger
70
+
71
+ # Ajouter les services Docker
72
+ npx create-nexu add service
73
+ ```
74
+
75
+ ## Workflow typique
76
+
77
+ ### Nouveau projet
78
+
79
+ ```bash
80
+ # 1. Créer le projet
81
+ npx create-nexu init my-app
82
+ cd my-app
83
+
84
+ # 2. Créer une application
85
+ pnpm generate:app api 4000
86
+ pnpm generate:app web 3000
87
+
88
+ # 3. Développer
89
+ pnpm dev
90
+ ```
91
+
92
+ ### Mise à jour d'un projet existant
93
+
94
+ ```bash
95
+ # 1. Depuis la racine du projet
96
+ cd my-existing-project
97
+
98
+ # 2. Mettre à jour
99
+ npx create-nexu update
100
+
101
+ # 3. Installer les nouvelles dépendances
102
+ pnpm install
103
+ ```
104
+
105
+ ### Ajouter des fonctionnalités
106
+
107
+ ```bash
108
+ # Ajouter un nouveau package partagé
109
+ npx create-nexu add package
110
+
111
+ # Ajouter les services Docker
112
+ npx create-nexu add service
113
+ ```
114
+
115
+ ## Packages disponibles
116
+
117
+ | Package | Description |
118
+ | ----------- | -------------------------------- |
119
+ | `cache` | Cache in-memory avec TTL |
120
+ | `config` | Configurations ESLint/TypeScript |
121
+ | `constants` | Constantes partagées |
122
+ | `logger` | Logger avec niveaux et couleurs |
123
+ | `result` | Try/catch fonctionnel |
124
+ | `types` | Types TypeScript partagés |
125
+ | `ui` | Composants React |
126
+ | `utils` | Fonctions utilitaires |
127
+
128
+ ## Services Docker disponibles
129
+
130
+ | Service | Profile | Description |
131
+ | ------------- | ---------- | ----------------------------- |
132
+ | PostgreSQL | database | Base de données relationnelle |
133
+ | Redis | database | Cache et store clé-valeur |
134
+ | RabbitMQ | messaging | Message broker (AMQP) |
135
+ | Kafka | messaging | Event streaming |
136
+ | Prometheus | monitoring | Métriques et alerting |
137
+ | Grafana | monitoring | Visualisation des métriques |
138
+ | MinIO | storage | Stockage S3-compatible |
139
+ | Elasticsearch | search | Moteur de recherche |
140
+
141
+ ## Publication
142
+
143
+ Pour publier une nouvelle version:
144
+
145
+ ```bash
146
+ cd packages/create-nexu
147
+ pnpm build
148
+ npm publish
149
+ ```
@@ -0,0 +1,2 @@
1
+
2
+ export { }