create-fleetbo-project 1.2.72 → 1.2.75

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.
@@ -24,6 +24,7 @@ const UPDATE_NETWORK_URL = 'https://us-central1-myapp-259bf.cloudfunctions.net/u
24
24
  const ALEX_ENGINE_URL = "https://us-central1-myapp-259bf.cloudfunctions.net/generateNativeModule";
25
25
  const APP_JS_PATH = path.join(process.cwd(), 'src/App.js');
26
26
  const PORT = 3000;
27
+ let uplinkProcess = null;
27
28
  const args = process.argv.slice(2);
28
29
  const command = args[0];
29
30
  process.env.DOTENV_SILENT = 'true';
@@ -139,7 +140,7 @@ if (command === 'alex') {
139
140
  console.log('');
140
141
  const rawMsg = aiData.message || "I'm ready.";
141
142
  const formattedMsg = wrapText(rawMsg, 85);
142
- console.log('\\x1b[32mAlex ❯\\x1b[0m \\n ' + formattedMsg);
143
+ console.log('\\x1b[32mAlex ❯\\x1b[0m '+formattedMsg);
143
144
 
144
145
  if (aiData.remainingConsultations !== undefined) {
145
146
  const remaining = aiData.remainingConsultations;
@@ -147,7 +148,7 @@ if (command === 'alex') {
147
148
  const tierLabel = aiData.tier === 'pro' ? 'SENIOR' : 'JUNIOR';
148
149
  const percent = Math.round((remaining / limit) * 100);
149
150
  const energyColor = percent > 20 ? '\\x1b[32m' : '\\x1b[31m';
150
- console.log(\`\\x1b[36m⚡ Architect Fuel:\\x1b[0m \${energyColor}\${percent}%\x1b[0m (\${remaining}/\${limit} consultations left) [\${tierLabel}]\`);
151
+ console.log(\`\\x1b[36m⚡ Architect Fuel:\\x1b[0m \${energyColor}\${percent}%\x1b[0m (\${remaining}/\${limit} instructions left) [\${tierLabel}]\`);
151
152
  }
152
153
  }
153
154
  if (aiData.status === 'success' && aiData.moduleData) {
@@ -309,12 +310,19 @@ function killProcessOnPort(port) {
309
310
  }
310
311
  } catch (e) {}
311
312
  }
312
- function killNetworkService() {
313
- try {
314
- const cmd = process.platform === 'win32' ? 'taskkill /IM cloudflared.exe /F' : 'pkill cloudflared';
315
- execSync(cmd + ' ' + NULL_DEV);
316
- } catch (e) {}
317
- }
313
+ const killNetworkService = () => {
314
+ // On tue UNIQUEMENT le processus enfant que nous avons lancé
315
+ if (uplinkProcess) {
316
+ try {
317
+ uplinkProcess.kill('SIGINT'); // On demande poliment de s'arrêter
318
+ console.log('[Fleetbo] Engine closed.');
319
+ } catch (e) {
320
+ console.error('[Fleetbo] Error closing tunnel:', e.message);
321
+ }
322
+ }
323
+ };
324
+
325
+
318
326
  let isExiting = false;
319
327
  async function cleanupAndExit(code = 0) {
320
328
  if (isExiting) return;
@@ -371,10 +379,16 @@ async function runDevEnvironment() {
371
379
  console.log('[Fleetbo] ---------------------------------------------------');
372
380
 
373
381
  const npxCmd = process.platform === 'win32' ? 'npx.cmd' : 'npx';
374
- const uplink = spawn(npxCmd, ['cloudflared', 'tunnel', '--url', \`http://localhost:\${PORT}\`], { shell: true });
375
- uplink.stderr.on('data', (chunk) => {
376
- const match = chunk.toString().match(/https:\\/\\/[a-zA-Z0-9-]+\\.trycloudflare\\.com/);
377
- if (match) syncFirebase(keyApp, match[0], testerEmail);
382
+ uplinkProcess = spawn(npxCmd, [
383
+ 'cloudflared',
384
+ 'tunnel',
385
+ '--url', \`http://127.0.0.1:\${PORT}\`,
386
+ '--http-host-header', \`127.0.0.1:\${PORT}\`
387
+ ], { shell: true });
388
+ uplinkProcess.stderr.on('data', (chunk) => {
389
+ const text = chunk.toString();
390
+ const match = text.match(/https:\\/\\/[a-zA-Z0-9-]+\\.trycloudflare\\.com/);
391
+ if (match) syncFirebase(process.env.REACT_KEY_APP, match[0], process.env.REACT_APP_TESTER_EMAIL);
378
392
  });
379
393
  }
380
394
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-fleetbo-project",
3
- "version": "1.2.72",
3
+ "version": "1.2.75",
4
4
  "description": "Creates a new Fleetbo project.",
5
5
  "main": "install-react-template.js",
6
6
  "bin": {