fleetbo-cockpit-cli 1.0.158 → 1.0.161
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 -16
- package/package.json +1 -1
package/cli.js
CHANGED
|
@@ -1052,7 +1052,9 @@ else {
|
|
|
1052
1052
|
}
|
|
1053
1053
|
|
|
1054
1054
|
const npmCmd = process.platform === 'win32' ? 'npm.cmd' : 'npm';
|
|
1055
|
-
|
|
1055
|
+
|
|
1056
|
+
// ✅ On passe la chaîne complète, SANS tableau d'arguments du tout !
|
|
1057
|
+
const devServer = spawn(`${npmCmd} run dev --silent`, {
|
|
1056
1058
|
stdio: ['ignore', 'pipe', 'pipe'],
|
|
1057
1059
|
shell: true,
|
|
1058
1060
|
env: {
|
|
@@ -1061,7 +1063,6 @@ else {
|
|
|
1061
1063
|
PORT: PORT.toString(),
|
|
1062
1064
|
}
|
|
1063
1065
|
});
|
|
1064
|
-
|
|
1065
1066
|
//devServer.stdout.pipe(process.stdout);
|
|
1066
1067
|
devServer.stderr.pipe(process.stderr);
|
|
1067
1068
|
|
|
@@ -1079,19 +1080,20 @@ else {
|
|
|
1079
1080
|
'Starting the development server',
|
|
1080
1081
|
'You can now view',
|
|
1081
1082
|
'vite v',
|
|
1082
|
-
'VITE v',
|
|
1083
|
-
'ready in',
|
|
1084
|
-
'
|
|
1085
|
-
'
|
|
1083
|
+
'VITE v',
|
|
1084
|
+
'ready in',
|
|
1085
|
+
'Local:', // 👈 Plus simple et infaillible
|
|
1086
|
+
'Network:', // 👈 Plus simple et infaillible
|
|
1086
1087
|
'press h + enter',
|
|
1087
|
-
'> vite',
|
|
1088
|
+
'> vite',
|
|
1088
1089
|
'> fleetbo',
|
|
1089
1090
|
'> npx fleetbo-cockpit-cli@latest'
|
|
1090
1091
|
];
|
|
1091
1092
|
|
|
1092
|
-
// On filtre les lignes pour ne garder que le vrai code/debug
|
|
1093
1093
|
const filteredOutput = lines.filter(line => {
|
|
1094
|
-
|
|
1094
|
+
// On nettoie les codes couleurs invisibles avant de lire
|
|
1095
|
+
const cleanLine = line.replace(/\x1b\[[0-9;]*[a-zA-Z]/g, '');
|
|
1096
|
+
return !forbiddenTerms.some(term => cleanLine.includes(term));
|
|
1095
1097
|
}).join('\n');
|
|
1096
1098
|
|
|
1097
1099
|
// S'il reste quelque chose d'utile (un console.log du dev, un warning, une vraie erreur), on l'affiche
|
|
@@ -1124,13 +1126,9 @@ else {
|
|
|
1124
1126
|
console.log(`\x1b[33m[Fleetbo] 🔄 Uplink reconnection ${attempt}/${MAX_UPLINK_RETRIES - 1}...\x1b[0m`);
|
|
1125
1127
|
}
|
|
1126
1128
|
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
'tunnel',
|
|
1131
|
-
'--url', `http://127.0.0.1:${PORT}`,
|
|
1132
|
-
'--http-host-header', `127.0.0.1:${PORT}`
|
|
1133
|
-
], { shell: true });
|
|
1129
|
+
// ✅ La commande complète, SANS tableau !
|
|
1130
|
+
const uplinkCommand = `${npxCmd} -y cloudflared tunnel --url http://127.0.0.1:${PORT} --http-host-header 127.0.0.1:${PORT}`;
|
|
1131
|
+
uplinkProcess = spawn(uplinkCommand, { shell: true });
|
|
1134
1132
|
|
|
1135
1133
|
const handleUplinkOutput = (chunk) => {
|
|
1136
1134
|
const text = chunk.toString();
|