create-fleetbo-project 1.2.99 → 1.2.101

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.
@@ -111,7 +111,7 @@ function downloadEngine(url, dest) {
111
111
  }
112
112
 
113
113
  async function setupProject() {
114
- console.log(`\n ⚡ Initializing Fleetbo Framework for "${projectName}"...`);
114
+ console.log(`\n ⚡ Initializing Fleetbo Frontend for "${projectName}"...`);
115
115
 
116
116
  try {
117
117
  if (fs.existsSync(projectDir)) {
@@ -181,20 +181,46 @@ 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
+ fs.writeFileSync(path.join(fleetboDir, 'engine.js'), engineScript, 'utf8');
204
+
205
+ // --- 2. MODIFICATION DU PACKAGE.JSON POUR MASQUER L'ARCHITECTURE ---
184
206
  const packageJsonPath = path.join(projectDir, 'package.json');
185
207
  const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, 'utf8'));
186
208
  packageJson.name = projectName;
187
209
 
188
- // Configuration pour utiliser le package NPM centralisé
189
210
  packageJson.scripts = {
190
- ...packageJson.scripts,
191
- "fleetbo": "npx -y fleetbo-cockpit-cli@latest",
192
211
  "dev": "vite",
193
- "build": "vite build"
212
+ "build": "vite build",
213
+ "lint": "eslint .",
214
+ "preview": "vite preview",
215
+ "fleetbo": "node .fleetbo/engine.js",
216
+ "android": "node .fleetbo/engine.js android",
217
+ "ios": "node .fleetbo/engine.js ios",
218
+ "alex": "node .fleetbo/engine.js alex"
194
219
  };
195
220
 
196
221
  fs.writeFileSync(packageJsonPath, JSON.stringify(packageJson, null, 2), 'utf8');
197
222
 
223
+ // --- 3. NETTOYAGE DU DOSSIER SCRIPTS (Comme avant) ---
198
224
  const scriptsDir = path.join(projectDir, 'scripts');
199
225
  if (fs.existsSync(scriptsDir)) {
200
226
  try {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-fleetbo-project",
3
- "version": "1.2.99",
3
+ "version": "1.2.101",
4
4
  "description": "Creates a new Fleetbo project.",
5
5
  "main": "install-react-template.js",
6
6
  "bin": {