@mostajs/setup 2.1.34 → 2.1.35
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.
|
@@ -15,8 +15,14 @@ export function createSetupJsonHandler(needsSetup) {
|
|
|
15
15
|
const setupJsonPath = () => path.resolve(process.cwd(), 'setup.json');
|
|
16
16
|
async function GET() {
|
|
17
17
|
const filePath = setupJsonPath();
|
|
18
|
+
// Always include env vars for NET config
|
|
19
|
+
const env = {
|
|
20
|
+
netUrl: process.env.MOSTA_NET_URL || '',
|
|
21
|
+
netTransport: process.env.MOSTA_NET_TRANSPORT || 'rest',
|
|
22
|
+
dataMode: process.env.MOSTA_DATA || '',
|
|
23
|
+
};
|
|
18
24
|
if (!fs.existsSync(filePath)) {
|
|
19
|
-
return Response.json({ exists: false });
|
|
25
|
+
return Response.json({ exists: false, env });
|
|
20
26
|
}
|
|
21
27
|
try {
|
|
22
28
|
const raw = fs.readFileSync(filePath, 'utf-8');
|
|
@@ -37,6 +43,7 @@ export function createSetupJsonHandler(needsSetup) {
|
|
|
37
43
|
})),
|
|
38
44
|
modules: json.modules ?? [],
|
|
39
45
|
},
|
|
46
|
+
env,
|
|
40
47
|
});
|
|
41
48
|
}
|
|
42
49
|
catch (err) {
|
|
@@ -445,6 +445,13 @@ export default function SetupWizard({ t: tProp, onComplete, endpoints = {}, dbNa
|
|
|
445
445
|
fetch(ep.setupJson)
|
|
446
446
|
.then(r => r.json())
|
|
447
447
|
.then((data) => {
|
|
448
|
+
// Pre-fill NET URL from server env if not already set by props
|
|
449
|
+
if (data.env?.netUrl && netUrl === 'http://localhost:4488') {
|
|
450
|
+
setNetUrl(data.env.netUrl);
|
|
451
|
+
}
|
|
452
|
+
if (data.env?.netTransport && netTransport === 'rest') {
|
|
453
|
+
setNetTransport(data.env.netTransport);
|
|
454
|
+
}
|
|
448
455
|
const seeds = data.config?.seeds ?? [];
|
|
449
456
|
setAvailableSeeds(seeds);
|
|
450
457
|
// Initialize seedOptions from defaults
|
package/package.json
CHANGED