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.
- package/README.md +149 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +603 -0
- package/package.json +41 -0
- package/templates/default/.changeset/config.json +11 -0
- package/templates/default/.eslintignore +13 -0
- package/templates/default/.eslintrc.js +66 -0
- package/templates/default/.github/actions/quality/action.yml +53 -0
- package/templates/default/.github/dependabot.yml +51 -0
- package/templates/default/.github/workflows/deploy-dev.yml +83 -0
- package/templates/default/.github/workflows/deploy-prod.yml +83 -0
- package/templates/default/.github/workflows/deploy-rec.yml +83 -0
- package/templates/default/.husky/commit-msg +1 -0
- package/templates/default/.husky/pre-commit +1 -0
- package/templates/default/.prettierignore +7 -0
- package/templates/default/.prettierrc +19 -0
- package/templates/default/.vscode/extensions.json +14 -0
- package/templates/default/.vscode/settings.json +36 -0
- package/templates/default/apps/.gitkeep +0 -0
- package/templates/default/commitlint.config.js +26 -0
- package/templates/default/docker/docker-compose.dev.yml +49 -0
- package/templates/default/docker/docker-compose.prod.yml +64 -0
- package/templates/default/docker/docker-compose.yml +5 -0
- package/templates/default/package.json +56 -0
- package/templates/default/packages/cache/package.json +26 -0
- package/templates/default/packages/cache/src/index.ts +137 -0
- package/templates/default/packages/cache/tsconfig.json +9 -0
- package/templates/default/packages/cache/tsup.config.ts +9 -0
- package/templates/default/packages/config/eslint/index.js +20 -0
- package/templates/default/packages/config/package.json +9 -0
- package/templates/default/packages/config/typescript/base.json +26 -0
- package/templates/default/packages/constants/package.json +26 -0
- package/templates/default/packages/constants/src/index.ts +121 -0
- package/templates/default/packages/constants/tsconfig.json +9 -0
- package/templates/default/packages/constants/tsup.config.ts +9 -0
- package/templates/default/packages/logger/package.json +27 -0
- package/templates/default/packages/logger/src/index.ts +197 -0
- package/templates/default/packages/logger/tsconfig.json +11 -0
- package/templates/default/packages/logger/tsup.config.ts +9 -0
- package/templates/default/packages/result/package.json +26 -0
- package/templates/default/packages/result/src/index.ts +142 -0
- package/templates/default/packages/result/tsconfig.json +9 -0
- package/templates/default/packages/result/tsup.config.ts +9 -0
- package/templates/default/packages/types/package.json +26 -0
- package/templates/default/packages/types/src/index.ts +78 -0
- package/templates/default/packages/types/tsconfig.json +9 -0
- package/templates/default/packages/types/tsup.config.ts +10 -0
- package/templates/default/packages/ui/package.json +38 -0
- package/templates/default/packages/ui/src/components/Button.tsx +65 -0
- package/templates/default/packages/ui/src/components/Card.tsx +90 -0
- package/templates/default/packages/ui/src/components/Input.tsx +51 -0
- package/templates/default/packages/ui/src/index.ts +15 -0
- package/templates/default/packages/ui/tsconfig.json +11 -0
- package/templates/default/packages/ui/tsup.config.ts +11 -0
- package/templates/default/packages/utils/package.json +30 -0
- package/templates/default/packages/utils/src/index.test.ts +130 -0
- package/templates/default/packages/utils/src/index.ts +154 -0
- package/templates/default/packages/utils/tsconfig.json +10 -0
- package/templates/default/packages/utils/tsup.config.ts +10 -0
- package/templates/default/pnpm-workspace.yaml +3 -0
- package/templates/default/scripts/deploy.sh +25 -0
- package/templates/default/scripts/generate-app.sh +166 -0
- package/templates/default/scripts/publish-cli.sh +54 -0
- package/templates/default/scripts/setup.sh +70 -0
- package/templates/default/services/.env.example +16 -0
- package/templates/default/services/docker-compose.yml +207 -0
- package/templates/default/services/grafana/provisioning/dashboards/dashboards.yml +11 -0
- package/templates/default/services/grafana/provisioning/datasources/datasources.yml +9 -0
- package/templates/default/services/postgres/init/.gitkeep +2 -0
- package/templates/default/services/prometheus/prometheus.yml +13 -0
- package/templates/default/tsconfig.json +27 -0
- package/templates/default/turbo.json +40 -0
- 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
|
+
```
|
package/dist/index.d.ts
ADDED