create-fleetbo-project 1.2.105 → 1.2.107
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 +15 -34
- package/package.json +1 -1
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
3
|
// 🥷 SILENCIEUX ABSOLU : S'exécute instantanément pour tuer la plomberie de NPX
|
|
4
|
-
process.stdout.write("\x1b[1A\x1b[2K".repeat(4));
|
|
5
|
-
console.clear();
|
|
4
|
+
//process.stdout.write("\x1b[1A\x1b[2K".repeat(4));
|
|
5
|
+
//console.clear();
|
|
6
|
+
|
|
7
|
+
// Nettoyage compatible tous OS (sans forcer le curseur vers le haut)
|
|
8
|
+
if (process.stdout.isTTY) {
|
|
9
|
+
console.clear();
|
|
10
|
+
}
|
|
6
11
|
|
|
7
12
|
const { execSync } = require('child_process');
|
|
8
13
|
const fs = require('fs');
|
|
@@ -31,7 +36,7 @@ if (!projectNameArg || !bootstrapTokenArg || !userEmailArg) {
|
|
|
31
36
|
const getArchiveUrl = () => {
|
|
32
37
|
const templatePackage = jsFramework === 'vue' ? 'my-fleetbo-vue' : 'my-fleetbo-react';
|
|
33
38
|
try {
|
|
34
|
-
const tarball = execSync(`npm view ${templatePackage} dist.tarball`, { stdio: ['pipe', 'pipe', 'ignore'] }).toString().trim();
|
|
39
|
+
const tarball = execSync(`npm view ${templatePackage} dist.tarball`, { stdio: ['pipe', 'pipe', 'ignore'], shell: true }).toString().trim();
|
|
35
40
|
if (!tarball) throw new Error('Empty response');
|
|
36
41
|
return Promise.resolve(tarball);
|
|
37
42
|
} catch (e) {
|
|
@@ -181,48 +186,24 @@ yarn-error.log*
|
|
|
181
186
|
execSync('npm install cloudflared --save-dev --no-audit --no-fund --silent', { stdio: 'ignore' });
|
|
182
187
|
|
|
183
188
|
console.log(' [8/8] Finalizing setup...');
|
|
184
|
-
|
|
185
|
-
// --- 1. CRÉATION DU DOSSIER CACHÉ ET DU SCRIPT RELAI ---
|
|
186
|
-
const fleetboDir = path.join(projectDir, '.fleetbo');
|
|
187
|
-
if (!fs.existsSync(fleetboDir)) {
|
|
188
|
-
fs.mkdirSync(fleetboDir);
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
// Le Proxy. Il prend les arguments et lance le vrai CLI.
|
|
192
|
-
const engineScript = `
|
|
193
|
-
const { spawnSync } = require('child_process');
|
|
194
|
-
const args = process.argv.slice(2);
|
|
195
189
|
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
shell: true
|
|
199
|
-
});
|
|
200
|
-
|
|
201
|
-
process.exit(result.status || 0);
|
|
202
|
-
`;
|
|
203
|
-
// 🟢 FIX : On utilise l'extension .cjs pour forcer le CommonJS
|
|
204
|
-
fs.writeFileSync(path.join(fleetboDir, 'engine.cjs'), engineScript, 'utf8');
|
|
205
|
-
|
|
206
|
-
// --- 2. MODIFICATION DU PACKAGE.JSON POUR MASQUER L'ARCHITECTURE ---
|
|
190
|
+
|
|
191
|
+
// --- 1. NETTOYAGE DU PACKAGE.JSON (Zéro Trace) ---
|
|
207
192
|
const packageJsonPath = path.join(projectDir, 'package.json');
|
|
208
193
|
const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, 'utf8'));
|
|
209
194
|
packageJson.name = projectName;
|
|
210
195
|
|
|
211
|
-
//
|
|
196
|
+
// On s'assure qu'il n'y a QUE les scripts standards d'un projet web pur
|
|
212
197
|
packageJson.scripts = {
|
|
213
198
|
"dev": "vite",
|
|
214
199
|
"build": "vite build",
|
|
215
200
|
"lint": "eslint .",
|
|
216
|
-
"preview": "vite preview"
|
|
217
|
-
"fleetbo": "node .fleetbo/engine.cjs",
|
|
218
|
-
"android": "node .fleetbo/engine.cjs android",
|
|
219
|
-
"ios": "node .fleetbo/engine.cjs ios",
|
|
220
|
-
"alex": "node .fleetbo/engine.cjs alex"
|
|
201
|
+
"preview": "vite preview"
|
|
221
202
|
};
|
|
222
203
|
|
|
223
204
|
fs.writeFileSync(packageJsonPath, JSON.stringify(packageJson, null, 2), 'utf8');
|
|
224
205
|
|
|
225
|
-
// ---
|
|
206
|
+
// --- 2. NETTOYAGE DES SCRIPTS INUTILES ---
|
|
226
207
|
const scriptsDir = path.join(projectDir, 'scripts');
|
|
227
208
|
if (fs.existsSync(scriptsDir)) {
|
|
228
209
|
try {
|
|
@@ -241,8 +222,8 @@ process.exit(result.status || 0);
|
|
|
241
222
|
console.log(' \x1b[1;33m NEXT STEPS (Mini-Tutorial):\x1b[0m');
|
|
242
223
|
console.log(' --------------------------------------------------');
|
|
243
224
|
console.log(` 1️ Navigate to your project : \x1b[36mcd ${projectName}\x1b[0m`);
|
|
244
|
-
console.log(' 2️ Launch the Fleetbo Engine : \x1b[36mnpm
|
|
245
|
-
console.log(' 3️ Summon Alex (AI Architect): \x1b[36mnpm
|
|
225
|
+
console.log(' 2️ Launch the Fleetbo Engine : \x1b[36mnpm fleetbo\x1b[0m');
|
|
226
|
+
console.log(' 3️ Summon Alex (AI Architect): \x1b[36mnpm fleetbo alex\x1b[0m');
|
|
246
227
|
console.log(' --------------------------------------------------');
|
|
247
228
|
console.log('\n \x1b[2mHappy coding! Build something amazing without limits.\x1b[0m\n');
|
|
248
229
|
|