@mostajs/setup 1.4.9 → 1.4.10

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.
@@ -19,4 +19,5 @@ export declare function runInstall(installConfig: InstallConfig, setupConfig: Mo
19
19
  error?: string;
20
20
  needsRestart: boolean;
21
21
  seeded?: string[];
22
+ jdbcInfo?: string;
22
23
  }>;
package/dist/lib/setup.js CHANGED
@@ -39,13 +39,26 @@ export async function runInstall(installConfig, setupConfig) {
39
39
  extraVars,
40
40
  port: setupConfig.defaultPort,
41
41
  });
42
- // 2. Set process.env in-memory
42
+ // 2. For JDBC dialects, persist bridge port so app always reconnects to the same bridge
43
+ const JDBC_DIALECTS = ['hsqldb', 'oracle', 'db2', 'hana', 'sybase'];
44
+ if (JDBC_DIALECTS.includes(installConfig.dialect)) {
45
+ const bridgePort = process.env.MOSTA_BRIDGE_PORT_BASE || '8765';
46
+ extraVars['MOSTA_BRIDGE_PORT_BASE'] = bridgePort;
47
+ // Re-write env with bridge port
48
+ await writeEnvLocal({
49
+ dialect: installConfig.dialect,
50
+ uri,
51
+ extraVars,
52
+ port: setupConfig.defaultPort,
53
+ });
54
+ }
55
+ // 3. Set process.env in-memory
43
56
  process.env.DB_DIALECT = installConfig.dialect;
44
57
  process.env.SGBD_URI = uri;
45
58
  if (installConfig.dialect !== 'mongodb') {
46
59
  process.env.DB_SCHEMA_STRATEGY = 'update';
47
60
  }
48
- // 3. Disconnect existing dialect singleton
61
+ // 4. Disconnect existing dialect singleton
49
62
  const { disconnectDialect } = await import('@mostajs/orm');
50
63
  await disconnectDialect();
51
64
  // 4. Seed RBAC
@@ -75,7 +88,11 @@ export async function runInstall(installConfig, setupConfig) {
75
88
  }
76
89
  }
77
90
  }
78
- return { ok: true, needsRestart, seeded };
91
+ // For JDBC dialects, add info about bridge/server requirements
92
+ const jdbcInfo = JDBC_DIALECTS.includes(installConfig.dialect)
93
+ ? `Le serveur ${installConfig.dialect.toUpperCase()} et le bridge JDBC doivent rester actifs.`
94
+ : undefined;
95
+ return { ok: true, needsRestart, seeded, jdbcInfo };
79
96
  }
80
97
  catch (err) {
81
98
  const message = err instanceof Error ? err.message : 'Erreur installation';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mostajs/setup",
3
- "version": "1.4.9",
3
+ "version": "1.4.10",
4
4
  "description": "Reusable setup wizard module — multi-dialect DB configuration, .env.local writer, seed runner",
5
5
  "author": "Dr Hamid MADANI <drmdh@msn.com>",
6
6
  "license": "MIT",