@mostajs/setup 2.1.15 → 2.1.17
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/dist/lib/setup.js +11 -9
- package/package.json +1 -1
package/dist/lib/setup.js
CHANGED
|
@@ -120,8 +120,8 @@ async function runNetInstall(installConfig, setupConfig) {
|
|
|
120
120
|
url: installConfig.net.url,
|
|
121
121
|
apiKey: installConfig.net.apiKey,
|
|
122
122
|
});
|
|
123
|
-
// 1.
|
|
124
|
-
//
|
|
123
|
+
// 1. Préparer les vars .env.local (écriture REPORTÉE à la fin pour éviter
|
|
124
|
+
// le hot-reload de Next.js qui interrompt le seed en cours)
|
|
125
125
|
const extraVars = {
|
|
126
126
|
MOSTA_DATA: 'net',
|
|
127
127
|
MOSTA_NET_URL: installConfig.net.url,
|
|
@@ -132,11 +132,6 @@ async function runNetInstall(installConfig, setupConfig) {
|
|
|
132
132
|
if (installConfig.modules?.length) {
|
|
133
133
|
extraVars['MOSTAJS_MODULES'] = installConfig.modules.join(',');
|
|
134
134
|
}
|
|
135
|
-
await writeEnvLocal({
|
|
136
|
-
skipDb: true, // Ne pas écrire DB_DIALECT/SGBD_URI
|
|
137
|
-
extraVars,
|
|
138
|
-
port: setupConfig.defaultPort,
|
|
139
|
-
});
|
|
140
135
|
const seeded = [];
|
|
141
136
|
// 2. Verify NET server is reachable
|
|
142
137
|
const health = await net.health();
|
|
@@ -184,7 +179,7 @@ async function runNetInstall(installConfig, setupConfig) {
|
|
|
184
179
|
// Si le serveur redémarre, attendre qu'il soit de retour
|
|
185
180
|
if (result.needsRestart) {
|
|
186
181
|
console.log('[Setup] Serveur NET redémarre pour charger les schemas...');
|
|
187
|
-
await new Promise(r => setTimeout(r,
|
|
182
|
+
await new Promise(r => setTimeout(r, 4000)); // Laisser le temps au process.exit + restart
|
|
188
183
|
// Poll health jusqu'à ce que le serveur soit de retour (max 30s)
|
|
189
184
|
for (let i = 0; i < 30; i++) {
|
|
190
185
|
try {
|
|
@@ -307,7 +302,14 @@ async function runNetInstall(installConfig, setupConfig) {
|
|
|
307
302
|
seeded.push(seedDef.key);
|
|
308
303
|
}
|
|
309
304
|
}
|
|
310
|
-
|
|
305
|
+
// Écrire .env.local en DERNIER (après tout le seed)
|
|
306
|
+
// pour éviter le hot-reload Next.js pendant le seed
|
|
307
|
+
await writeEnvLocal({
|
|
308
|
+
skipDb: true,
|
|
309
|
+
extraVars,
|
|
310
|
+
port: setupConfig.defaultPort,
|
|
311
|
+
});
|
|
312
|
+
return { ok: true, needsRestart: true, seeded };
|
|
311
313
|
}
|
|
312
314
|
catch (err) {
|
|
313
315
|
const message = err instanceof Error ? err.message : 'Erreur installation NET';
|
package/package.json
CHANGED