@@ -30,6 +30,7 @@ import {
3030 PageContainer ,
3131} from "~/components/layout/AppLayout" ;
3232import { Button , LinkButton } from "~/components/primitives/Buttons" ;
33+ import { CheckboxWithLabel } from "~/components/primitives/Checkbox" ;
3334import { ClipboardField } from "~/components/primitives/ClipboardField" ;
3435import { Fieldset } from "~/components/primitives/Fieldset" ;
3536import { FormButtons } from "~/components/primitives/FormButtons" ;
@@ -180,6 +181,10 @@ const UpdateBuildSettingsFormSchema = z.object({
180181 . refine ( ( val ) => ! val || val . length <= 500 , {
181182 message : "Pre-build command must not exceed 500 characters" ,
182183 } ) ,
184+ useNativeBuildServer : z
185+ . string ( )
186+ . optional ( )
187+ . transform ( ( val ) => val === "on" ) ,
183188} ) ;
184189
185190type UpdateBuildSettingsFormSchema = z . infer < typeof UpdateBuildSettingsFormSchema > ;
@@ -407,12 +412,14 @@ export const action: ActionFunction = async ({ request, params }) => {
407412 } ) ;
408413 }
409414 case "update-build-settings" : {
410- const { installCommand, preBuildCommand, triggerConfigFilePath } = submission . value ;
415+ const { installCommand, preBuildCommand, triggerConfigFilePath, useNativeBuildServer } =
416+ submission . value ;
411417
412418 const resultOrFail = await projectSettingsService . updateBuildSettings ( projectId , {
413419 installCommand : installCommand || undefined ,
414420 preBuildCommand : preBuildCommand || undefined ,
415421 triggerConfigFilePath : triggerConfigFilePath || undefined ,
422+ useNativeBuildServer : useNativeBuildServer ,
416423 } ) ;
417424
418425 if ( resultOrFail . isErr ( ) ) {
@@ -1135,13 +1142,15 @@ function BuildSettingsForm({ buildSettings }: { buildSettings: BuildSettings })
11351142 preBuildCommand : buildSettings ?. preBuildCommand || "" ,
11361143 installCommand : buildSettings ?. installCommand || "" ,
11371144 triggerConfigFilePath : buildSettings ?. triggerConfigFilePath || "" ,
1145+ useNativeBuildServer : buildSettings ?. useNativeBuildServer || false ,
11381146 } ) ;
11391147
11401148 useEffect ( ( ) => {
11411149 const hasChanges =
11421150 buildSettingsValues . preBuildCommand !== ( buildSettings ?. preBuildCommand || "" ) ||
11431151 buildSettingsValues . installCommand !== ( buildSettings ?. installCommand || "" ) ||
1144- buildSettingsValues . triggerConfigFilePath !== ( buildSettings ?. triggerConfigFilePath || "" ) ;
1152+ buildSettingsValues . triggerConfigFilePath !== ( buildSettings ?. triggerConfigFilePath || "" ) ||
1153+ buildSettingsValues . useNativeBuildServer !== ( buildSettings ?. useNativeBuildServer || false ) ;
11451154 setHasBuildSettingsChanges ( hasChanges ) ;
11461155 } , [ buildSettingsValues , buildSettings ] ) ;
11471156
@@ -1222,6 +1231,30 @@ function BuildSettingsForm({ buildSettings }: { buildSettings: BuildSettings })
12221231 </ Hint >
12231232 < FormError id = { fields . preBuildCommand . errorId } > { fields . preBuildCommand . error } </ FormError >
12241233 </ InputGroup >
1234+ < div className = "border-t border-grid-dimmed pt-4" >
1235+ < InputGroup >
1236+ < CheckboxWithLabel
1237+ id = { fields . useNativeBuildServer . id }
1238+ { ...conform . input ( fields . useNativeBuildServer , { type : "checkbox" } ) }
1239+ label = "Use native build server"
1240+ variant = "simple/small"
1241+ defaultChecked = { buildSettings ?. useNativeBuildServer || false }
1242+ onChange = { ( isChecked ) => {
1243+ setBuildSettingsValues ( ( prev ) => ( {
1244+ ...prev ,
1245+ useNativeBuildServer : isChecked ,
1246+ } ) ) ;
1247+ } }
1248+ />
1249+ < Hint >
1250+ Native build server builds do not rely on external build providers and will become the
1251+ default in the future. Version 4.1.0 or newer is required.
1252+ </ Hint >
1253+ < FormError id = { fields . useNativeBuildServer . errorId } >
1254+ { fields . useNativeBuildServer . error }
1255+ </ FormError >
1256+ </ InputGroup >
1257+ </ div >
12251258 < FormError > { buildSettingsForm . error } </ FormError >
12261259 < FormButtons
12271260 confirmButton = {
0 commit comments