diff --git a/src/routes/(console)/project-[region]-[project]/sites/create-site/configuration.svelte b/src/routes/(console)/project-[region]-[project]/sites/create-site/configuration.svelte index 8ab02601a..f92ec6ae0 100644 --- a/src/routes/(console)/project-[region]-[project]/sites/create-site/configuration.svelte +++ b/src/routes/(console)/project-[region]-[project]/sites/create-site/configuration.svelte @@ -17,6 +17,7 @@ export let isLoading = false; export let installCommand = ''; export let buildCommand = ''; + export let startCommand = ''; export let outputDirectory = ''; let frameworkId = selectedFramework.key; @@ -83,6 +84,15 @@ Reset + {#if adapterData?.key === 'ssr'} + + + + {/if} data.frameworks.frameworks.find((f) => f.key === framework)?.adapters?.[0] + ); + const shouldShowStartCommand = $derived(primaryAdapter?.key === Adapter.Ssr); + $effect(() => { if (framework && data.frameworks && !hasCustomCommands) { const fw = data.frameworks.frameworks.find((f) => f.key === framework); @@ -103,10 +109,11 @@ // Build configuration - use from URL params or defaults installCommand = page.url.searchParams.get('install') || ''; buildCommand = page.url.searchParams.get('build') || ''; + startCommand = page.url.searchParams.get('start') || ''; outputDirectory = page.url.searchParams.get('output') || ''; // Check if custom commands were provided via URL - hasCustomCommands = !!(installCommand || buildCommand || outputDirectory); + hasCustomCommands = !!(installCommand || buildCommand || startCommand || outputDirectory); // If no custom commands, auto-fill from framework defaults if (!hasCustomCommands && data.frameworks) { @@ -145,6 +152,7 @@ buildRuntime: selectedFramework.buildRuntime, installCommand: installCommand || undefined, buildCommand: buildCommand || undefined, + startCommand: shouldShowStartCommand ? startCommand || undefined : undefined, outputDirectory: outputDirectory || undefined, adapter: framework === Framework.Other ? Adapter.Static : undefined, providerSilentMode: false @@ -273,6 +281,12 @@ label="Build command" placeholder={buildCommand || 'npm run build'} bind:value={buildCommand} /> + {#if shouldShowStartCommand} + + {/if} [] = []; let files: FileList; @@ -77,6 +78,7 @@ buildRuntime, installCommand: installCommand || undefined, buildCommand: buildCommand || undefined, + startCommand: startCommand || undefined, outputDirectory: outputDirectory || undefined }); @@ -251,6 +253,7 @@ [] = []; let silentMode = false; @@ -121,6 +122,7 @@ buildRuntime, installCommand: installCommand || undefined, buildCommand: buildCommand || undefined, + startCommand: startCommand || undefined, outputDirectory: outputDirectory || undefined, installationId: data.installation.$id, providerRepositoryId: data.repository.id, @@ -219,6 +221,7 @@ a.key === adapter) ?? @@ -105,13 +97,13 @@ buildCommand = isOriginalAdapter ? (site?.buildCommand ?? frameworkAdapterData.buildCommand) : data.buildCommand; + startCommand = isOriginalAdapter ? (site?.startCommand ?? '') : ''; outputDirectory = isOriginalAdapter ? (site?.outputDirectory ?? frameworkAdapterData.outputDirectory) : data.outputDirectory; fallback = isOriginalAdapter ? (site?.fallbackFile ?? data.fallbackFile) : data.fallbackFile; - startCommand = isOriginalAdapter ? (site?.startCommand ?? '') : ''; } lastFrameworkAdapterKey = `${selectedFramework.key}:${adapter ?? ''}`; @@ -335,6 +327,15 @@ Reset + {#if adapter === Adapter.Ssr} + + + + {/if} {/if} - {#if adapter === Adapter.Ssr} - - - Command used to start your SSR server after a successful deploy. - Leave it empty to use the framework default. - - - - {/if}