create-fleetbo-project 1.2.86 → 1.2.88
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 +18 -20
- package/package.json +1 -1
|
@@ -103,11 +103,11 @@ async function setupProject() {
|
|
|
103
103
|
}
|
|
104
104
|
fs.mkdirSync(projectDir);
|
|
105
105
|
|
|
106
|
-
console.log(' [1/
|
|
106
|
+
console.log(' [1/8] Downloading Fleetbo Core Engine...');
|
|
107
107
|
const archivePath = path.join(projectDir, 'engine.tar.gz');
|
|
108
108
|
await downloadEngine(archiveUrl, archivePath);
|
|
109
109
|
|
|
110
|
-
console.log(' [2/
|
|
110
|
+
console.log(' [2/8] Scaffolding project structure...');
|
|
111
111
|
try {
|
|
112
112
|
execSync(`tar -xf "${archivePath}" -C "${projectDir}" --strip-components=1`, { stdio: 'ignore' });
|
|
113
113
|
fs.unlinkSync(archivePath);
|
|
@@ -117,7 +117,7 @@ async function setupProject() {
|
|
|
117
117
|
|
|
118
118
|
process.chdir(projectDir);
|
|
119
119
|
|
|
120
|
-
console.log(' [
|
|
120
|
+
console.log(' [3/8] Standardizing Architecture (src/app)...');
|
|
121
121
|
const oldPath = path.join(projectDir, 'src/pages');
|
|
122
122
|
const newPath = path.join(projectDir, 'src/app');
|
|
123
123
|
|
|
@@ -136,21 +136,19 @@ async function setupProject() {
|
|
|
136
136
|
}
|
|
137
137
|
}
|
|
138
138
|
|
|
139
|
-
console.log(' [
|
|
139
|
+
console.log(' [4/8] Authenticating with Fleetbo Cloud...');
|
|
140
140
|
const keys = await fetchProjectKeys(bootstrapTokenArg);
|
|
141
141
|
if (!keys.enterpriseId) throw new Error("Invalid keys.");
|
|
142
142
|
|
|
143
|
-
console.log(' [
|
|
144
|
-
const envContent = `
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
DANGEROUSLY_DISABLE_HOST_CHECK=true
|
|
149
|
-
WDS_SOCKET_PORT=0`;
|
|
143
|
+
console.log(' [5/8] Configuring environment...');
|
|
144
|
+
const envContent = `FLEETBO_APP_DB_KEY=${keys.fleetboDBKey}
|
|
145
|
+
FLEETBO_APP_ENTERPRISE_ID=${keys.enterpriseId}
|
|
146
|
+
FLEETBO_KEY_APP=${projectName}
|
|
147
|
+
FLEETBO_APP_TESTER_EMAIL=${userEmailArg}`;
|
|
150
148
|
|
|
151
149
|
fs.writeFileSync(path.join(projectDir, '.env'), envContent, 'utf8');
|
|
152
150
|
|
|
153
|
-
console.log(' [
|
|
151
|
+
console.log(' [6/8] Securing environment (adding .gitignore)...');
|
|
154
152
|
const gitignoreContent = `# Fleetbo Security
|
|
155
153
|
.env
|
|
156
154
|
.env.local
|
|
@@ -164,27 +162,27 @@ yarn-error.log*
|
|
|
164
162
|
`;
|
|
165
163
|
fs.writeFileSync(path.join(projectDir, '.gitignore'), gitignoreContent, 'utf8');
|
|
166
164
|
|
|
167
|
-
console.log(' [
|
|
165
|
+
console.log(' [7/8] Installing dependencies...');
|
|
168
166
|
execSync('npm install', { stdio: 'inherit' });
|
|
169
167
|
|
|
170
|
-
//
|
|
168
|
+
// Installer cloudflared comme devDependency (nécessaire pour le tunnel)
|
|
171
169
|
execSync('npm install cloudflared --save-dev', { stdio: 'ignore' });
|
|
172
170
|
|
|
173
|
-
console.log(' [
|
|
171
|
+
console.log(' [8/8] Finalizing setup...');
|
|
174
172
|
const packageJsonPath = path.join(projectDir, 'package.json');
|
|
175
173
|
const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, 'utf8'));
|
|
176
174
|
packageJson.name = projectName;
|
|
177
175
|
|
|
178
|
-
//
|
|
176
|
+
// Configuration pour utiliser le package NPM centralisé
|
|
179
177
|
packageJson.scripts = {
|
|
180
178
|
...packageJson.scripts,
|
|
181
|
-
"fleetbo": "npx fleetbo-cli@latest",
|
|
182
|
-
"dev": "npx fleetbo-cli@latest"
|
|
179
|
+
"fleetbo": "npx fleetbo-cockpit-cli@latest",
|
|
180
|
+
"dev": "npx fleetbo-cockpit-cli@latest"
|
|
183
181
|
};
|
|
184
182
|
|
|
185
183
|
fs.writeFileSync(packageJsonPath, JSON.stringify(packageJson, null, 2), 'utf8');
|
|
186
184
|
|
|
187
|
-
//
|
|
185
|
+
// Supprimer le dossier scripts local (car on utilise le CLI npm)
|
|
188
186
|
const scriptsDir = path.join(projectDir, 'scripts');
|
|
189
187
|
if (fs.existsSync(scriptsDir)) {
|
|
190
188
|
try {
|
|
@@ -210,4 +208,4 @@ yarn-error.log*
|
|
|
210
208
|
}
|
|
211
209
|
}
|
|
212
210
|
|
|
213
|
-
setupProject();
|
|
211
|
+
setupProject();
|