Add VCL reporting guide, update reference manual and config wizard; untrack .kiro/steering/workflow.md
This commit is contained in:
33
configure.js
33
configure.js
@@ -104,9 +104,9 @@ const VARIABLE_DESCRIPTORS = [
|
||||
{
|
||||
name: 'CORS_ORIGINS',
|
||||
group: 'Core Settings',
|
||||
required: true,
|
||||
required: false,
|
||||
default: null, // derived from frontend port at runtime
|
||||
description: 'Comma-separated list of allowed CORS origins for the backend',
|
||||
description: 'Allowed CORS origins (only needed if frontend dev server runs on a separate port)',
|
||||
docUrl: null,
|
||||
sensitive: false,
|
||||
validator: 'validateCorsOrigins'
|
||||
@@ -1229,6 +1229,21 @@ async function main() {
|
||||
let confirmedPort = null;
|
||||
|
||||
for (const group of GROUP_ORDER) {
|
||||
// Auto-derive Frontend Settings from PORT and API_HOST — no need to prompt
|
||||
if (group === 'Frontend Settings') {
|
||||
const port = confirmedPort || '3001';
|
||||
const host = values.get('API_HOST') || 'localhost';
|
||||
const apiBase = `http://${host}:${port}/api`;
|
||||
const apiHost = `http://${host}:${port}`;
|
||||
values.set('REACT_APP_API_BASE', apiBase);
|
||||
values.set('REACT_APP_API_HOST', apiHost);
|
||||
console.log(`\n=== Frontend Settings ===`);
|
||||
console.log(` Auto-configured from your backend settings:`);
|
||||
console.log(` REACT_APP_API_BASE = ${apiBase}`);
|
||||
console.log(` REACT_APP_API_HOST = ${apiHost}`);
|
||||
continue;
|
||||
}
|
||||
|
||||
printGroupHeader(group);
|
||||
|
||||
// For skippable groups, ask if user wants to configure
|
||||
@@ -1267,14 +1282,6 @@ async function main() {
|
||||
if (confirmedPort !== null) {
|
||||
currentValue = null; // Will use derived default below
|
||||
}
|
||||
} else if (descriptor.name === 'REACT_APP_API_BASE') {
|
||||
if (confirmedPort !== null) {
|
||||
currentValue = null; // Will use derived default below
|
||||
}
|
||||
} else if (descriptor.name === 'REACT_APP_API_HOST') {
|
||||
if (confirmedPort !== null) {
|
||||
currentValue = null; // Will use derived default below
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1292,12 +1299,6 @@ async function main() {
|
||||
};
|
||||
} else if (descriptor.name === 'CORS_ORIGINS' && currentValue === null && descriptor.default === null) {
|
||||
effectiveDescriptor = { ...descriptor, default: 'http://localhost:3000' };
|
||||
} else if (descriptor.name === 'REACT_APP_API_BASE' && currentValue === null && descriptor.default === null) {
|
||||
const port = confirmedPort || '3001';
|
||||
effectiveDescriptor = { ...descriptor, default: `http://localhost:${port}/api` };
|
||||
} else if (descriptor.name === 'REACT_APP_API_HOST' && currentValue === null && descriptor.default === null) {
|
||||
const port = confirmedPort || '3001';
|
||||
effectiveDescriptor = { ...descriptor, default: `http://localhost:${port}` };
|
||||
}
|
||||
|
||||
const result = await promptVariable(rl, effectiveDescriptor, currentValue);
|
||||
|
||||
Reference in New Issue
Block a user