create-fleetbo-project 1.2.31 → 1.2.33

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.
@@ -11,6 +11,7 @@ const branchName = 'master';
11
11
  const archiveUrl = `https://github.com/${repoOwner}/${repoName}/archive/refs/heads/${branchName}.tar.gz`;
12
12
  const bootstrapUrl = 'https://us-central1-myapp-259bf.cloudfunctions.net/bootstrapProject';
13
13
 
14
+ // --- CONTENU DU CLI INJECTÉ (MISE À JOUR) ---
14
15
  const CLI_SCRIPT_CONTENT = `#!/usr/bin/env node
15
16
 
16
17
  const { spawn, execSync } = require('child_process');
@@ -22,7 +23,10 @@ const os = require('os');
22
23
 
23
24
  const args = process.argv.slice(2);
24
25
  const command = args[0];
25
- const GENERATOR_COMMANDS = ['page', 'g', 'generate'];
26
+
27
+
28
+ const GENERATOR_COMMANDS = ['page', 'g', 'generate', 'android', 'ios'];
29
+
26
30
  if (GENERATOR_COMMANDS.includes(command)) {
27
31
  try {
28
32
  require('./page.js');
@@ -42,8 +46,9 @@ if (GENERATOR_COMMANDS.includes(command)) {
42
46
  const UPDATE_NETWORK_URL = 'https://us-central1-myapp-259bf.cloudfunctions.net/updateDeveloperNetwork';
43
47
  const PORT = 3000;
44
48
 
45
-
49
+ // Définir la redirection nulle selon l'OS
46
50
  const NULL_DEV = process.platform === 'win32' ? '>nul 2>&1' : '2>/dev/null';
51
+
47
52
  function killProcessOnPort(port) {
48
53
  try {
49
54
  if (process.platform !== 'win32') {
@@ -82,6 +87,7 @@ async function syncFirebase(keyApp, networkUrl, testerEmail) {
82
87
  console.log('\\n[Fleetbo] ---------------------------------------------------');
83
88
  console.log(\`[Fleetbo] ✅ Uplink Status: Online for \${testerEmail}\`);
84
89
  console.log(\`[Fleetbo] 🚀 Simulator: https://fleetbo.io/studio/view/\${keyApp}\`);
90
+ console.log(\'[Fleetbo] 👉 Your studio is ready. You can now open the link above.\n');
85
91
  console.log('[Fleetbo] ---------------------------------------------------\\n');
86
92
  } catch (err) {
87
93
  console.error(\`[Fleetbo] ⚠️ Sync Error: \${err.message}\`);
@@ -91,6 +97,7 @@ async function syncFirebase(keyApp, networkUrl, testerEmail) {
91
97
  async function runDevEnvironment() {
92
98
  console.log(\`[Fleetbo] 🛡️ Initializing Developer Environment on \${os.platform()}...\`);
93
99
 
100
+ // 1. NETTOYAGE PRÉVENTIF
94
101
  killNetworkService();
95
102
  killProcessOnPort(PORT);
96
103
 
@@ -108,6 +115,7 @@ async function runDevEnvironment() {
108
115
  process.exit(1);
109
116
  }
110
117
 
118
+ // 2. DÉMARRAGE DU SERVEUR LOCAL
111
119
  console.log(\`[Fleetbo] 📦 Starting Local Server...\`);
112
120
  const npmCmd = process.platform === 'win32' ? 'npm.cmd' : 'npm';
113
121
 
@@ -128,8 +136,13 @@ async function runDevEnvironment() {
128
136
  if (!connectionStarted && (output.includes('Local:') || output.includes('Compiled successfully'))) {
129
137
  connectionStarted = true;
130
138
  console.log(\`\\n[Fleetbo] 🔗 Local Server Ready. Establishing Secure Uplink...\`);
139
+ console.log(\`\\n[Fleetbo] 🛑 STOP! DO NOT open the Studio yet.\`);
140
+ console.log(\`\\n[Fleetbo] ⏳ Establishing Secure Uplink... Please wait...\`);
131
141
 
142
+ // 3. DÉMARRAGE DE LA LIAISON (UPLINK)
132
143
  const npxCmd = process.platform === 'win32' ? 'npx.cmd' : 'npx';
144
+
145
+ // --- MODIFICATION : Ajout de { shell: true } pour Windows ---
133
146
  const uplink = spawn(npxCmd, ['cloudflared', 'tunnel', '--url', \`http://localhost:\${PORT}\`], { shell: true });
134
147
 
135
148
  uplink.stderr.on('data', (chunk) => {
@@ -156,6 +169,7 @@ async function runDevEnvironment() {
156
169
  runDevEnvironment();
157
170
  `;
158
171
 
172
+ // --- LOGIQUE D'INSTALLATION (INCHANGÉE) ---
159
173
  const args = process.argv.slice(2);
160
174
  const projectNameArg = args.find(arg => !arg.startsWith('--'));
161
175
  const tokenArg = args.find(arg => arg.startsWith('--token='));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-fleetbo-project",
3
- "version": "1.2.31",
3
+ "version": "1.2.33",
4
4
  "description": "Creates a new Fleetbo project.",
5
5
  "main": "install-react-template.js",
6
6
  "bin": {