@cerema/cadriciel 1.3.92 → 1.4.0-a

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 (2) hide show
  1. package/cli/global/init.js +78 -22
  2. package/package.json +1 -1
@@ -110,16 +110,66 @@ module.exports = (args) => {
110
110
  return;
111
111
  }
112
112
 
113
- exec('pnpm -v', (errorPnpm) => {
114
- if (errorPnpm) {
115
- spinner.fail(
116
- `pnpm n'est pas installé sur votre système ! (https://pnpm.js.org/installation)`
117
- );
118
- return;
119
- }
113
+ exec('bun -v', (errorPnpm) => {
114
+ if (errorPnpm)
115
+ return exec('pnpm -v', (errorPnpm) => {
116
+ if (errorPnpm) {
117
+ spinner.fail(
118
+ `pnpm n'est pas installé sur votre système ! (https://pnpm.js.org/installation)`
119
+ );
120
+ return;
121
+ }
120
122
 
121
- // If git and pnpm are installed, proceed with the operations
122
- exec('pnpm i', (errorInstall) => {
123
+ // If git and pnpm are installed, proceed with the operations
124
+ exec('pnpm i', (errorInstall) => {
125
+ if (errorInstall) {
126
+ spinner.fail(
127
+ `Problème pendant l'installation des dépendances :\n`,
128
+ errorInstall
129
+ );
130
+ return;
131
+ }
132
+
133
+ exec(
134
+ 'git init && git add --all && git commit -m "first commit" && git checkout -b dev',
135
+ (errorGit) => {
136
+ if (errorGit) {
137
+ spinner.fail(
138
+ 'Error occurred during git operations:',
139
+ errorGit
140
+ );
141
+ return;
142
+ }
143
+
144
+ spinner.succeed(
145
+ '🚀 Votre projet a été correctement installé.\n'
146
+ );
147
+ console.log(
148
+ `\n──────────────────────────────────────────────────────────────
149
+
150
+ Pour lancer l'environnement local de développement :
151
+
152
+ ${chalk.magenta(' 📦 nécessite docker et docker-compose\n')}
153
+
154
+ cd ${chalk.green(name)}
155
+ ${chalk.cyan('cad start')} .............. 🚀 ${chalk.bold(
156
+ "démarre l'environnement local de développement"
157
+ )}
158
+
159
+ ${chalk.cyan('cad stop')} ............... 🚦 ${chalk.bold(
160
+ "arrête l'environnement."
161
+ )}
162
+
163
+ 👉 https://cadriciel.k8-dev.cerema.fr/api 👈
164
+
165
+ ──────────────────────────────────────────────────────────────\n`
166
+ );
167
+ }
168
+ );
169
+ });
170
+ });
171
+ // If bun is installed, proceed with the operations
172
+ exec('bun i', (errorInstall) => {
123
173
  if (errorInstall) {
124
174
  spinner.fail(
125
175
  `Problème pendant l'installation des dépendances :\n`,
@@ -139,23 +189,29 @@ module.exports = (args) => {
139
189
  spinner.succeed('🚀 Votre projet a été correctement installé.\n');
140
190
  console.log(
141
191
  `\n──────────────────────────────────────────────────────────────
142
-
143
- Pour lancer l'environnement local de développement :
144
-
145
- ${chalk.magenta(' 📦 nécessite docker et docker-compose\n')}
146
-
147
- cd ${chalk.green(name)}
148
- ${chalk.cyan('cad start')} .............. 🚀 ${chalk.bold(
192
+
193
+ Pour lancer l'environnement local de développement :
194
+
195
+ ${chalk.magenta(
196
+ ' 📦 nécessite docker et docker-compose\n'
197
+ )}
198
+
199
+ cd ${chalk.green(name)}
200
+ ${chalk.cyan(
201
+ 'cad start'
202
+ )} .............. 🚀 ${chalk.bold(
149
203
  "démarre l'environnement local de développement"
150
204
  )}
151
-
152
- ${chalk.cyan('cad stop')} ............... 🚦 ${chalk.bold(
205
+
206
+ ${chalk.cyan(
207
+ 'cad stop'
208
+ )} ............... 🚦 ${chalk.bold(
153
209
  "arrête l'environnement."
154
210
  )}
155
-
156
- 👉 https://cadriciel.k8-dev.cerema.fr/api 👈
157
-
158
- ──────────────────────────────────────────────────────────────\n`
211
+
212
+ 👉 https://cadriciel.k8-dev.cerema.fr/api 👈
213
+
214
+ ──────────────────────────────────────────────────────────────\n`
159
215
  );
160
216
  }
161
217
  );
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cerema/cadriciel",
3
- "version": "1.3.92",
3
+ "version": "1.4.0a",
4
4
  "main": "index.js",
5
5
  "license": "MIT",
6
6
  "npm": ">=8.0.0",