create-fleetbo-project 1.2.44 → 1.2.46
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 +6 -25
- 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\`);
|
|
@@ -184,7 +178,7 @@ if (command === 'alex') {
|
|
|
184
178
|
while (attempts < maxAttempts && !isReady) {
|
|
185
179
|
try {
|
|
186
180
|
const validation = await axios.post(ALEX_ENGINE_URL, {
|
|
187
|
-
prompt: "ping", validateProject: true, checkNetwork: true
|
|
181
|
+
prompt: "ping", validateProject: true, checkNetwork: true, projectKey: keyApp
|
|
188
182
|
}, { headers: { 'x-project-id': projectId }, timeout: 5000 });
|
|
189
183
|
|
|
190
184
|
if (validation.data?.isRunning) { isReady = true; break; }
|
|
@@ -198,20 +192,16 @@ if (command === 'alex') {
|
|
|
198
192
|
|
|
199
193
|
if (!isReady) {
|
|
200
194
|
console.error('\\n\\x1b[31m⚠️ ENGINE OFFLINE:\\x1b[0m Start Fleetbo runtime first: "npm run fleetbo" ');
|
|
195
|
+
console.error(\`\\x1b[90m(Ensure you are running the runtime for project: \${keyApp})\\x1b[0m\`);
|
|
201
196
|
process.exit(1);
|
|
202
197
|
}
|
|
203
198
|
|
|
204
|
-
|
|
205
|
-
process.stdout.write(' '.repeat(60) + '\\r'); // Efface le status de validation
|
|
199
|
+
process.stdout.write(' '.repeat(60) + '\\r');
|
|
206
200
|
|
|
207
|
-
// 1. Accueil Alex (Vert)
|
|
208
201
|
console.log('\\n\\x1b[32m🤖 Alex is now online.\\x1b[0m');
|
|
209
202
|
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
203
|
console.log('');
|
|
213
204
|
|
|
214
|
-
// 3. Configuration du prompt Développeur (Bleu)
|
|
215
205
|
const userName = testerEmail ? testerEmail.split('@')[0] : 'Dev';
|
|
216
206
|
const rl = readline.createInterface({
|
|
217
207
|
input: process.stdin,
|
|
@@ -227,13 +217,10 @@ if (command === 'alex') {
|
|
|
227
217
|
rl.close();
|
|
228
218
|
return;
|
|
229
219
|
}
|
|
230
|
-
|
|
231
220
|
if (line.trim()) {
|
|
232
221
|
await processAlexRequest(line.trim());
|
|
233
|
-
// ✅ SAUT DE LIGNE après la réponse d'Alex
|
|
234
222
|
console.log('');
|
|
235
223
|
}
|
|
236
|
-
|
|
237
224
|
rl.prompt();
|
|
238
225
|
}).on('close', () => {
|
|
239
226
|
process.exit(0);
|
|
@@ -268,18 +255,12 @@ if (command === 'deploy') {
|
|
|
268
255
|
return;
|
|
269
256
|
}
|
|
270
257
|
|
|
271
|
-
// ==========================================
|
|
272
|
-
// 2. COMMANDE: GENERATE (Original préservé)
|
|
273
|
-
// ==========================================
|
|
274
258
|
const GENERATOR_COMMANDS = ['page', 'g', 'generate', 'android', 'ios'];
|
|
275
259
|
if (GENERATOR_COMMANDS.includes(command)) {
|
|
276
260
|
try { require('./page.js'); } catch (e) { console.error(e.message); process.exit(1); }
|
|
277
261
|
return;
|
|
278
262
|
}
|
|
279
263
|
|
|
280
|
-
// ==========================================
|
|
281
|
-
// 3. COMMANDE: DEV / CLEANUP (Original préservé)
|
|
282
|
-
// ==========================================
|
|
283
264
|
const NULL_DEV = process.platform === 'win32' ? '>nul 2>&1' : '2>/dev/null';
|
|
284
265
|
|
|
285
266
|
function killProcessOnPort(port) {
|