create-fleetbo-project 1.2.100 → 1.2.102

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.
@@ -181,20 +181,48 @@ yarn-error.log*
181
181
  execSync('npm install cloudflared --save-dev --no-audit --no-fund --silent', { stdio: 'ignore' });
182
182
 
183
183
  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
+
196
+ const result = spawnSync('npx', ['-y', 'fleetbo-cockpit-cli@latest', ...args], {
197
+ stdio: 'inherit',
198
+ shell: true
199
+ });
200
+
201
+ process.exit(result.status || 0);
202
+ `;
203
+ // 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 ---
184
207
  const packageJsonPath = path.join(projectDir, 'package.json');
185
208
  const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, 'utf8'));
186
209
  packageJson.name = projectName;
187
210
 
188
- // Configuration pour utiliser le package NPM centralisé
211
+ // On appelle engine.cjs dans les scripts
189
212
  packageJson.scripts = {
190
- ...packageJson.scripts,
191
- "fleetbo": "npx -y fleetbo-cockpit-cli@latest",
192
213
  "dev": "vite",
193
- "build": "vite build"
214
+ "build": "vite build",
215
+ "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"
194
221
  };
195
222
 
196
223
  fs.writeFileSync(packageJsonPath, JSON.stringify(packageJson, null, 2), 'utf8');
197
224
 
225
+ // --- 3. NETTOYAGE DU DOSSIER SCRIPTS (Comme avant) ---
198
226
  const scriptsDir = path.join(projectDir, 'scripts');
199
227
  if (fs.existsSync(scriptsDir)) {
200
228
  try {
@@ -205,7 +233,7 @@ yarn-error.log*
205
233
  }
206
234
 
207
235
  // ==========================================
208
- // 🎯 L'ANNONCE DE SUCCÈS ET LE MINI-TUTO
236
+ // L'ANNONCE DE SUCCÈS ET LE MINI-TUTO
209
237
  // ==========================================
210
238
  console.log('\n \x1b[1;32m✓ [Fleetbo] Project successfully created!\x1b[0m');
211
239
  console.log(`\n Installation path: \x1b[36m${projectDir}\x1b[0m\n`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-fleetbo-project",
3
- "version": "1.2.100",
3
+ "version": "1.2.102",
4
4
  "description": "Creates a new Fleetbo project.",
5
5
  "main": "install-react-template.js",
6
6
  "bin": {