create-fleetbo-project 1.2.57 → 1.2.58

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.
@@ -102,32 +102,19 @@ if (command === 'alex') {
102
102
  console.log(\`\\n\\x1b[31m⛔ ENGINE OUT OF FUEL:\\x1b[0m \${aiData.message}\`);
103
103
  return;
104
104
  }
105
- if (aiData.status === 'success' || aiData.status === 'message') {
106
- console.log('');
107
- console.log(\`\\x1b[32mAlex ❯\\x1b[0m \${aiData.message || "I'm ready."}\`);
108
- if (aiData.remainingTokens !== undefined) {
109
- const remaining = aiData.remainingTokens;
110
- const limit = aiData.limit || 2500;
111
- const percent = Math.round((remaining / limit) * 100);
112
- const energyColor = percent > 30 ? '\\x1b[32m' : '\\x1b[31m';
113
- console.log(\`\\x1b[36m Energy:\\x1b[0m \${energyColor}\${percent}%\\x1b[0m (\${remaining}/\${limit} tokens left)\`);
114
- }
115
- }
116
-
117
105
  if (aiData.status === 'success' || aiData.status === 'message') {
118
106
  console.log('');
119
107
  console.log(\`\\x1b[32mAlex ❯\\x1b[0m \${aiData.message || "I'm ready."}\`);
120
108
  if (aiData.remainingTokens !== undefined) {
121
109
  const remaining = aiData.remainingTokens;
122
- const limit = aiData.limit; // Récupération dynamique de la limite
110
+ const limit = aiData.limit || 2500;
123
111
  const tierLabel = aiData.tier === 'senior' ? 'SENIOR' : 'STARTER';
124
112
  const percent = Math.round((remaining / limit) * 100);
125
- const energyColor = percent > 20 ? '\x1b[32m' : '\x1b[31m';
113
+ const energyColor = percent > 20 ? '\\x1b[32m' : '\\x1b[31m';
126
114
  console.log(\`\\x1b[36m Energy:\\x1b[0m \${energyColor}\${percent}%\\x1b[0m (\${remaining}/\${limit} tokens left)\`);
127
115
  }
128
116
  }
129
117
  if (aiData.status === 'success' && aiData.moduleData) {
130
- // 1. AJOUT de 'instructions' ici pour éviter l'erreur de variable indéfinie
131
118
  const { fileName, code, mockFileName, mockCode, moduleName, instructions } = aiData.moduleData;
132
119
  console.log(\` \\x1b[90m⚙️ Architecting: \${moduleName}\x1b[0m\`);
133
120
  const writeFile = (dir, name, content) => {
@@ -138,14 +125,13 @@ if (command === 'alex') {
138
125
  console.log(\` \x1b[32m[Written]\x1b[0m \${dir}\${name}\`);
139
126
  };
140
127
  if (instructions && Array.isArray(instructions) && instructions.length > 0) {
141
- console.log('\n\x1b[33m--- GUIDE DE PILOTAGE (MCI) ---\x1b[0m');
128
+ console.log('\\n\\x1b[33m--- GUIDE DE PILOTAGE (MCI) ---\\x1b[0m');
142
129
  instructions.forEach(line => {
143
130
  if (typeof line === 'string') {
144
- const formattedLine = line.replace(/ACTION|CAPTURE|PERSPECTIVE/g, '\x1b[1m$&\x1b[0m');
131
+ const formattedLine = line.replace(/ACTION|CAPTURE|PERSPECTIVE/g, '\\x1b[1m$&\\x1b[0m');
145
132
  console.log(\` \${formattedLine}\`);
146
133
  }
147
134
  });
148
- console.log('\x1b[33m-------------------------------\x1b[0m');
149
135
  }
150
136
  if (code && fileName) {
151
137
  const folder = fileName.endsWith('.kt') ? 'public/native/android/' : 'src/pages/';
@@ -227,8 +213,6 @@ if (command === 'alex') {
227
213
  if (command === 'android' || command === 'ios') {
228
214
  checkGitSecurity();
229
215
  const platform = command;
230
-
231
- // --- NOUVEAU VERROU DE SÉCURITÉ ---
232
216
  const nativeDir = platform === 'android' ? 'public/native/android/' : 'public/native/ios/'; //
233
217
  const extension = platform === 'android' ? '.kt' : '.swift';
234
218
  const fullPath = path.join(process.cwd(), nativeDir);
@@ -237,17 +221,15 @@ if (command === 'android' || command === 'ios') {
237
221
  const files = fs.readdirSync(fullPath);
238
222
  hasNativeFiles = files.some(file => file.endsWith(extension));
239
223
  }
240
- if (!hasNativeFiles) {
241
- console.log(\`\n\x1b[31m⚠️ ENGINE INCOMPLETE:\x1b[0m No native blueprints detected for \x1b[1m\${platform.toUpperCase()}\x1b[0m.\`);
242
- console.log(\`\x1b[90mAlex must architect at least one \${extension} module before deployment.\x1b[0m\n\`);
224
+ if (!hasNativeFiles) {
225
+ console.log(\`\\n\\x1b[31m⚠️ ENGINE INCOMPLETE:\\x1b[0m No native blueprints detected for \\x1b[1m\${platform.toUpperCase()}\\x1b[0m.\`);
226
+ console.log(\`\\x1b[90mAlex must architect at least one \${extension} module before deployment.\\x1b[0m\\n\`);
243
227
  process.exit(1);
244
228
  }
245
- // ----------------------------------
246
-
247
- // Sélection automatique de l'URL selon la plateforme saisie après "fleetbo"
248
229
  const targetUrl = platform === 'android' ? ANDROID_BUILD_URL : IOS_BUILD_URL;
249
230
  (async () => {
250
- console.log(\`\n\x1b[36m⚡ FLEETBO \${platform.toUpperCase()} UPLINK\x1b[0m\`);
231
+ // Utilisation de \\n et \\x1b pour que le texte reste intact dans cli.js
232
+ console.log(\`\\n\\x1b[36m⚡ FLEETBO \${platform.toUpperCase()} UPLINK\\x1b[0m\`);
251
233
  try {
252
234
  execSync('npm run build', { stdio: 'inherit' });
253
235
  let buildDir = fs.existsSync(path.join(process.cwd(), 'dist')) ? 'dist' : 'build';
@@ -258,19 +240,21 @@ if (command === 'android' || command === 'ios') {
258
240
  archive.directory(path.join(process.cwd(), buildDir), false);
259
241
  archive.finalize();
260
242
  });
261
- console.log(\`\n \x1b[33mSyncing \${platform} logic bundle...\x1b[0m\`);
243
+
244
+ // Correction du saut de ligne ici aussi
245
+ console.log(\`\\n\\x1b[33mSyncing \${platform} logic bundle...\\x1b[0m\`);
262
246
  await showEnergyTransfer();
263
247
 
264
- // Envoi vers la fonction cloud spécifique (FandroidBuild ou FiosBuild)
265
248
  const res = await axios.post(targetUrl, zipBuffer, {
266
249
  headers: { 'Content-Type': 'application/zip', 'x-project-id': projectId }
267
250
  });
268
251
 
269
252
  if (res.data.success) {
270
- console.log(\`\n \x1b[1m$\{platform.toUpperCase()} DEPLOYED\x1b[0m | \x1b[32mAlex ❯\x1b[0m Runtime updated.\`);
253
+ console.log(\`\\n\\x1b[1m\${platform.toUpperCase()} DEPLOYED\\x1b[0m | \\x1b[32mAlex ❯\\x1b[0m Runtime updated.\`);
271
254
  }
272
255
  } catch (error) {
273
- console.error('\n\x1b[31m Build Error:\x1b[0m ' + (error.response?.data?.error || error.message));
256
+ // Correction de l'affichage d'erreur
257
+ console.error(\`\\n\\x1b[31m Build Error:\\x1b[0m \${error.response?.data?.error || error.message}\`);
274
258
  process.exit(1);
275
259
  }
276
260
  })();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-fleetbo-project",
3
- "version": "1.2.57",
3
+ "version": "1.2.58",
4
4
  "description": "Creates a new Fleetbo project.",
5
5
  "main": "install-react-template.js",
6
6
  "bin": {