fleetbo-cockpit-cli 1.0.177 → 1.0.179
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/cli.js +14 -12
- package/package.json +1 -1
package/cli.js
CHANGED
|
@@ -1101,7 +1101,7 @@ else {
|
|
|
1101
1101
|
const lines = output.split('\n');
|
|
1102
1102
|
const forbiddenTerms = [
|
|
1103
1103
|
'Attempting to bind to HOST', 'If this was unintentional', 'Learn more here:',
|
|
1104
|
-
'Starting the development server', 'You can now view', 'vite v', 'VITE v',
|
|
1104
|
+
'Starting the development server', 'You can now view', 'vite v', 'VITE v', 'Port', 'is in use',
|
|
1105
1105
|
'ready in', 'Local:', 'Network:', 'press h + enter', '> vite', '> fleetbo', '> npx fleetbo-cockpit-cli@latest'
|
|
1106
1106
|
];
|
|
1107
1107
|
|
|
@@ -1116,19 +1116,21 @@ else {
|
|
|
1116
1116
|
|
|
1117
1117
|
// 🚀 MAGIE 1 : DÉTECTION DU PORT RÉEL (Vite/Vue ou React)
|
|
1118
1118
|
// Cherche un pattern comme http://localhost:5173 ou http://127.0.0.1:3000
|
|
1119
|
+
// ✅ LA SOLUTION : On déclenche UNIQUEMENT quand on a trouvé le port !
|
|
1120
|
+
// 🌐 CAPTURE AGNOSTIQUE DU PORT (S'adapte dynamiquement à Vite)
|
|
1119
1121
|
const portMatch = output.match(/http:\/\/(?:localhost|127\.0\.0\.1):(\d+)/);
|
|
1120
|
-
if (portMatch) {
|
|
1121
|
-
detectedPort = portMatch[1]; // On capture le vrai port !
|
|
1122
|
-
}
|
|
1123
|
-
|
|
1124
|
-
// 🚀 MAGIE 2 : DÉTECTION DU DÉMARRAGE ET LANCEMENT DE L'UPLINK SUR LE BON PORT
|
|
1125
|
-
if (!connectionStarted && (output.includes('localhost') || output.includes('ready in') || output.includes('Local:'))){
|
|
1126
|
-
connectionStarted = true;
|
|
1127
1122
|
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1123
|
+
if (portMatch) {
|
|
1124
|
+
detectedPort = portMatch[1]; // Capture le port final choisi par Vite
|
|
1125
|
+
|
|
1126
|
+
// On lance le tunnel Cloudflare UNIQUEMENT sur ce port définitif
|
|
1127
|
+
if (!connectionStarted) {
|
|
1128
|
+
connectionStarted = true;
|
|
1129
|
+
|
|
1130
|
+
console.log('\n\x1b[33mFleetbo OS ❯\x1b[0m ---------------------------------------------------');
|
|
1131
|
+
console.log(`\x1b[33mFleetbo OS ❯\x1b[0m Establishing Secure Uplink...`);
|
|
1132
|
+
console.log(`\x1b[33mFleetbo OS ❯\x1b[0m Please wait for the green message...`);
|
|
1133
|
+
console.log('\x1b[33mFleetbo OS ❯\x1b[0m ---------------------------------------------------');
|
|
1132
1134
|
|
|
1133
1135
|
const MAX_UPLINK_RETRIES = 5;
|
|
1134
1136
|
const RETRY_DELAYS = [0, 10, 20, 30, 45];
|