fleetbo-cockpit-cli 1.0.246 → 1.0.247

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.
Files changed (2) hide show
  1. package/cli.js +33 -15
  2. package/package.json +1 -1
package/cli.js CHANGED
@@ -899,6 +899,9 @@ else if (['page', 'g', 'generate'].includes(command)) {
899
899
  }
900
900
  else {
901
901
  const NULL_DEV = process.platform === 'win32' ? '>nul 2>&1' : '2>/dev/null';
902
+
903
+ // 🟢 FIX 1 : On crée une variable pour garder la trace du serveur Vite
904
+ let devServerProcess = null;
902
905
 
903
906
  function killProcessOnPort(port) {
904
907
  try {
@@ -909,21 +912,23 @@ else {
909
912
  } catch (e) {}
910
913
  }
911
914
 
912
- const killNetworkService = () => {
913
- if (uplinkProcess) {
914
- try {
915
- if (process.platform === 'win32') {
916
- spawn('taskkill', ['/pid', String(uplinkProcess.pid), '/T', '/F'], {
917
- stdio: 'ignore', detached: true, shell: false
918
- }).unref();
919
- } else {
920
- uplinkProcess.kill('SIGINT');
921
- }
922
- console.log('[Fleetbo] Engine closed.');
923
- } catch (e) {
924
- console.error('[Fleetbo] Error closing tunnel:', e.message);
915
+ // 🟢 FIX 2 : On tue TOUS les processus enfants (Cloudflare ET Vite) proprement
916
+ const killAllServices = () => {
917
+ const killProc = (proc) => {
918
+ if (proc && proc.pid) {
919
+ try {
920
+ if (process.platform === 'win32') {
921
+ spawn('taskkill', ['/pid', String(proc.pid), '/T', '/F'], {
922
+ stdio: 'ignore', detached: true, shell: false
923
+ }).unref();
924
+ } else {
925
+ proc.kill('SIGINT');
926
+ }
927
+ } catch (e) {}
925
928
  }
926
- }
929
+ };
930
+ killProc(uplinkProcess);
931
+ killProc(devServerProcess);
927
932
  };
928
933
 
929
934
  let isExiting = false;
@@ -940,6 +945,15 @@ else {
940
945
  }
941
946
  killNetworkService();
942
947
  killProcessOnPort(PORT);
948
+
949
+ try {
950
+ // 🟢 FIX 3 : On met un timeout ultra-court (1s) pour ne jamais bloquer la sortie
951
+ await axios.post(UPDATE_NETWORK_URL, { keyApp, networkUrl: '', tester: testerEmail }, { timeout: 1000 });
952
+ console.log('\x1b[32m[Fleetbo] Network status reset to offline.\x1b[0m');
953
+ } catch (e) {
954
+ // On ignore silencieusement si ça échoue, le but principal est de quitter.
955
+ }
956
+
943
957
  console.log('[Fleetbo] Bye.');
944
958
  process.exit(code);
945
959
  }
@@ -979,7 +993,8 @@ else {
979
993
 
980
994
  const npmCmd = process.platform === 'win32' ? 'npm.cmd' : 'npm';
981
995
 
982
- const devServer = spawn(`${npmCmd} run dev --silent -- --host 127.0.0.1 --port ${PORT}`, {
996
+ // 🟢 (Inclut la correction des arguments Arrays vue précédemment)
997
+ devServerProcess = spawn(npmCmd, ['run', 'dev', '--silent', '--', '--host', '127.0.0.1', '--port', String(PORT)], {
983
998
  stdio: ['ignore', 'pipe', 'pipe'],
984
999
  shell: true,
985
1000
  env: {
@@ -992,6 +1007,9 @@ else {
992
1007
 
993
1008
  let connectionStarted = false;
994
1009
  let detectedPort = PORT;
1010
+
1011
+ // 🟢 (Inclut la correction du Buffer de texte vue précédemment)
1012
+ let viteBuffer = "";
995
1013
 
996
1014
  devServer.stdout.on('data', (data) => {
997
1015
  const output = data.toString();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fleetbo-cockpit-cli",
3
- "version": "1.0.246",
3
+ "version": "1.0.247",
4
4
  "description": "Fleetbo CLI - Build native mobile apps with React",
5
5
  "author": "Fleetbo",
6
6
  "license": "MIT",