create-fleetbo-project 1.2.44 → 1.2.45
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/install-react-template.js +4 -24
- package/package.json +1 -1
|
@@ -78,7 +78,9 @@ const injectRouteIntoAppJs = (pageName, subPath = '') => {
|
|
|
78
78
|
// Chemin dynamique selon si c'est une page ou un mock
|
|
79
79
|
const pathPrefix = subPath ? \`\${subPath}/\` : '';
|
|
80
80
|
const importLine = \`import \${pageName} from './pages/\${pathPrefix}\${pageName}';\`;
|
|
81
|
-
|
|
81
|
+
|
|
82
|
+
// CORRECTION ICI : Syntax React Router valide element={<PageName />}
|
|
83
|
+
const routeLine = \`<Route path="/\${pathPrefix.toLowerCase()}\${pageName.toLowerCase()}" element={<\${pageName} />} />\`;
|
|
82
84
|
|
|
83
85
|
let injected = false;
|
|
84
86
|
if (!content.includes(importLine)) {
|
|
@@ -117,24 +119,17 @@ if (command === 'alex') {
|
|
|
117
119
|
});
|
|
118
120
|
|
|
119
121
|
const aiData = result.data;
|
|
120
|
-
// 1. On efface "Alex is thinking..."
|
|
121
122
|
process.stdout.write('\\r' + ' '.repeat(50) + '\\r');
|
|
122
123
|
|
|
123
|
-
// --- 1. GESTION DU QUOTA (EN ROUGE) ---
|
|
124
124
|
if (aiData.status === 'quota_exceeded') {
|
|
125
125
|
console.log(\`\\n\\x1b[31m⛔ ENGINE OUT OF FUEL:\\x1b[0m \${aiData.message}\`);
|
|
126
126
|
return;
|
|
127
127
|
}
|
|
128
128
|
|
|
129
|
-
// --- 2. AFFICHAGE DE LA RÉPONSE ---
|
|
130
129
|
if (aiData.status === 'success' || aiData.status === 'message') {
|
|
131
|
-
// ✅ AJOUT : Saut de ligne pour séparer de votre commande "username ❯"
|
|
132
130
|
console.log('');
|
|
133
|
-
|
|
134
|
-
// Alex répond en Vert
|
|
135
131
|
console.log(\`\\x1b[32mAlex ❯\\x1b[0m \${aiData.message || "I'm ready."}\`);
|
|
136
132
|
|
|
137
|
-
// Jauge d'énergie (Bleu/Vert/Rouge)
|
|
138
133
|
if (aiData.remainingTokens !== undefined) {
|
|
139
134
|
const remaining = aiData.remainingTokens;
|
|
140
135
|
const limit = aiData.limit || 2500;
|
|
@@ -144,7 +139,6 @@ if (command === 'alex') {
|
|
|
144
139
|
}
|
|
145
140
|
}
|
|
146
141
|
|
|
147
|
-
// --- 4. TRAITEMENT DES FICHIERS (SI PRÉSENTS) ---
|
|
148
142
|
if (aiData.status === 'success' && aiData.moduleData) {
|
|
149
143
|
const { fileName, code, mockFileName, mockCode, moduleName } = aiData.moduleData;
|
|
150
144
|
console.log(\` \\x1b[90m⚙️ Architecting: \${moduleName}\\x1b[0m\`);
|
|
@@ -201,17 +195,12 @@ if (command === 'alex') {
|
|
|
201
195
|
process.exit(1);
|
|
202
196
|
}
|
|
203
197
|
|
|
204
|
-
|
|
205
|
-
process.stdout.write(' '.repeat(60) + '\\r'); // Efface le status de validation
|
|
198
|
+
process.stdout.write(' '.repeat(60) + '\\r');
|
|
206
199
|
|
|
207
|
-
// 1. Accueil Alex (Vert)
|
|
208
200
|
console.log('\\n\\x1b[32m🤖 Alex is now online.\\x1b[0m');
|
|
209
201
|
console.log('\\x1b[32mAlex ❯\\x1b[0m Welcome! I am Alex, your architect. What are we building today?');
|
|
210
|
-
|
|
211
|
-
// 2. Premier saut de ligne pour l'esthétique
|
|
212
202
|
console.log('');
|
|
213
203
|
|
|
214
|
-
// 3. Configuration du prompt Développeur (Bleu)
|
|
215
204
|
const userName = testerEmail ? testerEmail.split('@')[0] : 'Dev';
|
|
216
205
|
const rl = readline.createInterface({
|
|
217
206
|
input: process.stdin,
|
|
@@ -227,13 +216,10 @@ if (command === 'alex') {
|
|
|
227
216
|
rl.close();
|
|
228
217
|
return;
|
|
229
218
|
}
|
|
230
|
-
|
|
231
219
|
if (line.trim()) {
|
|
232
220
|
await processAlexRequest(line.trim());
|
|
233
|
-
// ✅ SAUT DE LIGNE après la réponse d'Alex
|
|
234
221
|
console.log('');
|
|
235
222
|
}
|
|
236
|
-
|
|
237
223
|
rl.prompt();
|
|
238
224
|
}).on('close', () => {
|
|
239
225
|
process.exit(0);
|
|
@@ -268,18 +254,12 @@ if (command === 'deploy') {
|
|
|
268
254
|
return;
|
|
269
255
|
}
|
|
270
256
|
|
|
271
|
-
// ==========================================
|
|
272
|
-
// 2. COMMANDE: GENERATE (Original préservé)
|
|
273
|
-
// ==========================================
|
|
274
257
|
const GENERATOR_COMMANDS = ['page', 'g', 'generate', 'android', 'ios'];
|
|
275
258
|
if (GENERATOR_COMMANDS.includes(command)) {
|
|
276
259
|
try { require('./page.js'); } catch (e) { console.error(e.message); process.exit(1); }
|
|
277
260
|
return;
|
|
278
261
|
}
|
|
279
262
|
|
|
280
|
-
// ==========================================
|
|
281
|
-
// 3. COMMANDE: DEV / CLEANUP (Original préservé)
|
|
282
|
-
// ==========================================
|
|
283
263
|
const NULL_DEV = process.platform === 'win32' ? '>nul 2>&1' : '2>/dev/null';
|
|
284
264
|
|
|
285
265
|
function killProcessOnPort(port) {
|