create-fleetbo-project 1.2.73 → 1.2.76
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/install-react-template.js +51 -20
- package/package.json +1 -1
|
@@ -22,8 +22,10 @@ const ANDROID_BUILD_URL = "https://us-central1-myapp-259bf.cloudfunctions.net/Fa
|
|
|
22
22
|
const IOS_BUILD_URL = "https://us-central1-myapp-259bf.cloudfunctions.net/FiosBuild";
|
|
23
23
|
const UPDATE_NETWORK_URL = 'https://us-central1-myapp-259bf.cloudfunctions.net/updateDeveloperNetwork';
|
|
24
24
|
const ALEX_ENGINE_URL = "https://us-central1-myapp-259bf.cloudfunctions.net/generateNativeModule";
|
|
25
|
+
const INJECT_DEPS_URL = "https://us-central1-myapp-259bf.cloudfunctions.net/saveGeneratedFile";
|
|
25
26
|
const APP_JS_PATH = path.join(process.cwd(), 'src/App.js');
|
|
26
27
|
const PORT = 3000;
|
|
28
|
+
let uplinkProcess = null;
|
|
27
29
|
const args = process.argv.slice(2);
|
|
28
30
|
const command = args[0];
|
|
29
31
|
process.env.DOTENV_SILENT = 'true';
|
|
@@ -147,7 +149,7 @@ if (command === 'alex') {
|
|
|
147
149
|
const tierLabel = aiData.tier === 'pro' ? 'SENIOR' : 'JUNIOR';
|
|
148
150
|
const percent = Math.round((remaining / limit) * 100);
|
|
149
151
|
const energyColor = percent > 20 ? '\\x1b[32m' : '\\x1b[31m';
|
|
150
|
-
console.log(\`\\x1b[36m⚡ Architect Fuel:\\x1b[0m \${energyColor}\${percent}%\x1b[0m (\${remaining}/\${limit}
|
|
152
|
+
console.log(\`\\x1b[36m⚡ Architect Fuel:\\x1b[0m \${energyColor}\${percent}%\x1b[0m (\${remaining}/\${limit} instructions left) [\${tierLabel}]\`);
|
|
151
153
|
}
|
|
152
154
|
}
|
|
153
155
|
if (aiData.status === 'success' && aiData.moduleData) {
|
|
@@ -160,15 +162,6 @@ if (command === 'alex') {
|
|
|
160
162
|
fs.writeFileSync(filePath, content);
|
|
161
163
|
console.log(\` \x1b[32m[Written]\x1b[0m \${dir}\${name}\`);
|
|
162
164
|
};
|
|
163
|
-
if (instructions && Array.isArray(instructions) && instructions.length > 0) {
|
|
164
|
-
console.log('\\n\\x1b[33m--- GUIDE (MCI) ---\\x1b[0m');
|
|
165
|
-
instructions.forEach(line => {
|
|
166
|
-
if (typeof line === 'string') {
|
|
167
|
-
const formattedLine = line.replace(/ACTION|CAPTURE|PERSPECTIVE/g, '\\x1b[1m$&\\x1b[0m');
|
|
168
|
-
console.log(\` \${formattedLine}\`);
|
|
169
|
-
}
|
|
170
|
-
});
|
|
171
|
-
}
|
|
172
165
|
if (code && fileName) {
|
|
173
166
|
const folder = fileName.endsWith('.kt') ? 'public/native/android/' : 'src/app/';
|
|
174
167
|
writeFile(folder, fileName, code);
|
|
@@ -182,6 +175,31 @@ if (command === 'alex') {
|
|
|
182
175
|
console.log(\` \\x1b[32m[Routed]\x1b[0m App.js -> /mocks/\${pageName.toLowerCase()}\`);
|
|
183
176
|
}
|
|
184
177
|
}
|
|
178
|
+
if (config_offload && (config_offload.dependencies?.length > 0 || config_offload.permissions?.length > 0)) {
|
|
179
|
+
process.stdout.write(\` \\x1b[33m[Cloud Inject]\x1b[0m Syncing \${config_offload.dependencies.length} libs to Factory...\`);
|
|
180
|
+
try {
|
|
181
|
+
await axios.post(INJECT_DEPS_URL, {
|
|
182
|
+
projectId: projectId,
|
|
183
|
+
fileData: {
|
|
184
|
+
path: fileName,
|
|
185
|
+
config_offload: config_offload
|
|
186
|
+
}
|
|
187
|
+
});
|
|
188
|
+
process.stdout.write(\` \\x1b[32mOK\x1b[0m\n\`);
|
|
189
|
+
} catch (err) {
|
|
190
|
+
process.stdout.write(\` \\x1b[31mFAILED\x1b[0m\n\`);
|
|
191
|
+
console.error(\` ⚠️ Config sync failed: \${err.message}\`);
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
if (instructions && Array.isArray(instructions) && instructions.length > 0) {
|
|
195
|
+
console.log('\\n\\x1b[33m--- GUIDE (MCI) ---\\x1b[0m');
|
|
196
|
+
instructions.forEach(line => {
|
|
197
|
+
if (typeof line === 'string') {
|
|
198
|
+
const formattedLine = line.replace(/ACTION|CAPTURE|PERSPECTIVE/g, '\\x1b[1m$&\\x1b[0m');
|
|
199
|
+
console.log(\` \${formattedLine}\`);
|
|
200
|
+
}
|
|
201
|
+
});
|
|
202
|
+
}
|
|
185
203
|
}
|
|
186
204
|
} catch (error) {
|
|
187
205
|
process.stdout.write('\\r' + ' '.repeat(50) + '\\r');
|
|
@@ -309,12 +327,19 @@ function killProcessOnPort(port) {
|
|
|
309
327
|
}
|
|
310
328
|
} catch (e) {}
|
|
311
329
|
}
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
330
|
+
const killNetworkService = () => {
|
|
331
|
+
// On tue UNIQUEMENT le processus enfant que nous avons lancé
|
|
332
|
+
if (uplinkProcess) {
|
|
333
|
+
try {
|
|
334
|
+
uplinkProcess.kill('SIGINT'); // On demande poliment de s'arrêter
|
|
335
|
+
console.log('[Fleetbo] Engine closed.');
|
|
336
|
+
} catch (e) {
|
|
337
|
+
console.error('[Fleetbo] Error closing tunnel:', e.message);
|
|
338
|
+
}
|
|
339
|
+
}
|
|
340
|
+
};
|
|
341
|
+
|
|
342
|
+
|
|
318
343
|
let isExiting = false;
|
|
319
344
|
async function cleanupAndExit(code = 0) {
|
|
320
345
|
if (isExiting) return;
|
|
@@ -371,10 +396,16 @@ async function runDevEnvironment() {
|
|
|
371
396
|
console.log('[Fleetbo] ---------------------------------------------------');
|
|
372
397
|
|
|
373
398
|
const npxCmd = process.platform === 'win32' ? 'npx.cmd' : 'npx';
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
399
|
+
uplinkProcess = spawn(npxCmd, [
|
|
400
|
+
'cloudflared',
|
|
401
|
+
'tunnel',
|
|
402
|
+
'--url', \`http://127.0.0.1:\${PORT}\`,
|
|
403
|
+
'--http-host-header', \`127.0.0.1:\${PORT}\`
|
|
404
|
+
], { shell: true });
|
|
405
|
+
uplinkProcess.stderr.on('data', (chunk) => {
|
|
406
|
+
const text = chunk.toString();
|
|
407
|
+
const match = text.match(/https:\\/\\/[a-zA-Z0-9-]+\\.trycloudflare\\.com/);
|
|
408
|
+
if (match) syncFirebase(process.env.REACT_KEY_APP, match[0], process.env.REACT_APP_TESTER_EMAIL);
|
|
378
409
|
});
|
|
379
410
|
}
|
|
380
411
|
});
|