create-fleetbo-project 1.2.56 → 1.2.57

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.
@@ -18,7 +18,8 @@ const dotenv = require('dotenv');
18
18
  const os = require('os');
19
19
  const archiver = require('archiver');
20
20
  const readline = require('readline');
21
- const CLOUD_ENGINE_URL = "https://us-central1-myapp-259bf.cloudfunctions.net/uploadLogicBundle";
21
+ const ANDROID_BUILD_URL = "https://us-central1-myapp-259bf.cloudfunctions.net/FandroidBuild";
22
+ const IOS_BUILD_URL = "https://us-central1-myapp-259bf.cloudfunctions.net/FiosBuild";
22
23
  const UPDATE_NETWORK_URL = 'https://us-central1-myapp-259bf.cloudfunctions.net/updateDeveloperNetwork';
23
24
  const ALEX_ENGINE_URL = "https://us-central1-myapp-259bf.cloudfunctions.net/generateNativeModule";
24
25
  const APP_JS_PATH = path.join(process.cwd(), 'src/App.js');
@@ -223,10 +224,30 @@ if (command === 'alex') {
223
224
  else processAlexRequest(initialPrompt);
224
225
  return;
225
226
  }
226
- if (command === 'deploy') {
227
+ if (command === 'android' || command === 'ios') {
227
228
  checkGitSecurity();
229
+ const platform = command;
230
+
231
+ // --- NOUVEAU VERROU DE SÉCURITÉ ---
232
+ const nativeDir = platform === 'android' ? 'public/native/android/' : 'public/native/ios/'; //
233
+ const extension = platform === 'android' ? '.kt' : '.swift';
234
+ const fullPath = path.join(process.cwd(), nativeDir);
235
+ let hasNativeFiles = false;
236
+ if (fs.existsSync(fullPath)) {
237
+ const files = fs.readdirSync(fullPath);
238
+ hasNativeFiles = files.some(file => file.endsWith(extension));
239
+ }
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\`);
243
+ process.exit(1);
244
+ }
245
+ // ----------------------------------
246
+
247
+ // Sélection automatique de l'URL selon la plateforme saisie après "fleetbo"
248
+ const targetUrl = platform === 'android' ? ANDROID_BUILD_URL : IOS_BUILD_URL;
228
249
  (async () => {
229
- console.log('\\n\\x1b[36m⚡ FLEETBO CLOUD ENGINE\\x1b[0m');
250
+ console.log(\`\n\x1b[36m⚡ FLEETBO \${platform.toUpperCase()} UPLINK\x1b[0m\`);
230
251
  try {
231
252
  execSync('npm run build', { stdio: 'inherit' });
232
253
  let buildDir = fs.existsSync(path.join(process.cwd(), 'dist')) ? 'dist' : 'build';
@@ -237,11 +258,21 @@ if (command === 'deploy') {
237
258
  archive.directory(path.join(process.cwd(), buildDir), false);
238
259
  archive.finalize();
239
260
  });
240
- console.log('\\n📦 \\x1b[33mPreparing Neural Logic for Uplink...\\x1b[0m');
261
+ console.log(\`\n \x1b[33mSyncing \${platform} logic bundle...\x1b[0m\`);
241
262
  await showEnergyTransfer();
242
- await axios.post(CLOUD_ENGINE_URL, zipBuffer, { headers: { 'Content-Type': 'application/zip', 'x-project-id': projectId } });
243
- console.log('\\n \\x1b[1mDEPLOYMENT SUCCESSFUL\\x1b[0m | \\x1b[32mAlex ❯\\x1b[0m Runtime updated.');
244
- } catch (error) { process.exit(1); }
263
+
264
+ // Envoi vers la fonction cloud spécifique (FandroidBuild ou FiosBuild)
265
+ const res = await axios.post(targetUrl, zipBuffer, {
266
+ headers: { 'Content-Type': 'application/zip', 'x-project-id': projectId }
267
+ });
268
+
269
+ if (res.data.success) {
270
+ console.log(\`\n \x1b[1m$\{platform.toUpperCase()} DEPLOYED\x1b[0m | \x1b[32mAlex ❯\x1b[0m Runtime updated.\`);
271
+ }
272
+ } catch (error) {
273
+ console.error('\n\x1b[31m Build Error:\x1b[0m ' + (error.response?.data?.error || error.message));
274
+ process.exit(1);
275
+ }
245
276
  })();
246
277
  return;
247
278
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-fleetbo-project",
3
- "version": "1.2.56",
3
+ "version": "1.2.57",
4
4
  "description": "Creates a new Fleetbo project.",
5
5
  "main": "install-react-template.js",
6
6
  "bin": {